Author: ug Date: Wed Jun 17 16:37:24 2009 New Revision: 57619 URL: http://svn.opensuse.org/viewcvs/yast?rev=57619&view=rev Log: no need anymore to specify the device when using autoyast=device://... Modified: trunk/autoinstallation/doc/Installation.xml trunk/autoinstallation/package/autoyast2.changes trunk/autoinstallation/src/include/io.ycp Modified: trunk/autoinstallation/doc/Installation.xml URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/doc/Installation.xml?rev=57619&r1=57618&r2=57619&view=diff ============================================================================== --- trunk/autoinstallation/doc/Installation.xml (original) +++ trunk/autoinstallation/doc/Installation.xml Wed Jun 17 16:37:24 2009 @@ -350,7 +350,9 @@ <entry> autoyast=device://<device>/<file></entry><entry>Looks for control file on a storage device. (only device name needed - without full path, i.e. /dev/sda1 is wrong, instead use sda1) + without full path, i.e. /dev/sda1 is wrong, instead use sda1). + Since openSUSE 11.2 (not SLES11) you can leave out the device to trigger + AutoYaST's search routine over all devices. (autoyast=device:///my.xml) </entry> </row> Modified: trunk/autoinstallation/package/autoyast2.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/package/autoyast2.changes?rev=57619&r1=57618&r2=57619&view=diff ============================================================================== --- trunk/autoinstallation/package/autoyast2.changes (original) +++ trunk/autoinstallation/package/autoyast2.changes Wed Jun 17 16:37:24 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Jun 17 15:22:24 CEST 2009 - ug@suse.de + +- no need anymore to specify the device when using + autoyast=device://... + +------------------------------------------------------------------- Tue Jun 16 15:16:49 CEST 2009 - ug@suse.de - autoyast=usb://... could fail to find profile on logical Modified: trunk/autoinstallation/src/include/io.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/include/io.ycp?rev=57619&r1=57618&r2=57619&view=diff ============================================================================== --- trunk/autoinstallation/src/include/io.ycp (original) +++ trunk/autoinstallation/src/include/io.ycp Wed Jun 17 16:37:24 2009 @@ -274,8 +274,25 @@ } else if (Scheme == "device") // Device { - if ( Host != "" && Path != "") + if ( Path != "") { + list<string> deviceList = []; + if( Host == "" ) { + list<map> disks = (list<map>)SCR::Read(.probe.disk); + foreach( map m, disks, ``{ + if( haskey( m, "dev_name") ) { + integer i = 0; + string dev = m["dev_name"]:""; + do { + i = i + 1; + dev = m["dev_name"]:"" + sformat("%1",i); + if( SCR::Read(.target.lstat, dev) != $[] ) + deviceList = add( deviceList, substring( dev, 5 ) ); + } while( SCR::Read(.target.lstat, dev) != $[] || i < 5 ); + } + }); + y2milestone("devices to look on: %1", deviceList); + } else { /* sometimes we have devices like /dev/cciss/c1d0p5 those "nested" devices will be catched here @@ -283,45 +300,52 @@ we cut down the Path and enhance the Host (device name) */ while( SCR::Read( .target.dir, "/dev/"+Host ) != nil ) { - y2milestone("nested device found"); - list<string> l = splitstring( Path, "/" ); - Host = Host + "/" + l[0]:""; - l = remove(l,0); - Path = mergestring(l,"/"); - y2milestone("Host=%1 Path=%2",Host,Path); + y2milestone("nested device found"); + list<string> l = splitstring( Path, "/" ); + Host = Host + "/" + l[0]:""; + l = remove(l,0); + Path = mergestring(l,"/"); + y2milestone("Host=%1 Path=%2",Host,Path); } // catching nested devices done - - string mounts = (string)(SCR::Read (.target.string, "/proc/mounts")); - list<string> mount_list = splitstring( mounts, "\n" ); - boolean already_mounted = false; - foreach( string m, mount_list, ``{ - list<string> entries = splitstring( m, " " ); - if( entries[0]:"" == "/dev/"+Host ) { - already_mounted = true; - mount_point = entries[1]:""; - break; + deviceList = [ Host ]; } - }); - y2milestone("already mounted=%1 mountpoint=%2",already_mounted,mount_point); - if( ! already_mounted ) - WFM::Execute(.local.mount, [sformat("/dev/%1", Host) , - mount_point]); + foreach( string Host, deviceList, ``{ + y2milestone("looking for profile on %1", Host); + string mounts = (string)(SCR::Read (.target.string, "/proc/mounts")); + list<string> mount_list = splitstring( mounts, "\n" ); + boolean already_mounted = false; + foreach( string m, mount_list, ``{ + list<string> entries = splitstring( m, " " ); + if( entries[0]:"" == "/dev/"+Host ) { + already_mounted = true; + mount_point = entries[1]:""; + break; + } + }); + y2milestone("already mounted=%1 mountpoint=%2",already_mounted,mount_point); + if( ! already_mounted ) + WFM::Execute(.local.mount, [sformat("/dev/%1", Host) , + mount_point]); - if (WFM::Execute (.local.bash, "/bin/cp " + mount_point + "/" + Path + " " + Localfile) != 0 ) - { + if (WFM::Execute (.local.bash, "/bin/cp " + mount_point + "/" + Path + " " + Localfile) != 0 ) + { // autoyast tried to copy a file but that file can't be found GET_error = sformat(_("File %1 cannot be found"),mount_point + Path); - y2error("file %1 can't be found", mount_point + Path); - } - else - { + y2milestone("file %1 can't be found", mount_point + Path); + } + else + { GET_error = ""; - ok = true; - } - if( ! already_mounted ) - WFM::Execute(.local.umount, mount_point); - } + ok = true; + y2milestone("found"); + } + if( ! already_mounted ) + WFM::Execute(.local.umount, mount_point); + if( ok == true ) + break; + }); + } } else if (Scheme == "tftp") // Device { -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org