0707010006A2FF000041ED0000018F0000018F000000034F1023BB00000000000000080000000100000000000000000000000600000000linux0707010006A300000041ED0000018F0000018F000000064F10367600000000000000080000000100000000000000000000000B00000000linux/suse0707010006A495000041ED0000018F0000018F000000034F10367600000000000000080000000100000000000000000000001700000000linux/suse/i386-sles110707010006A497000041ED0000018F0000018F000000034F10367600000000000000080000000100000000000000000000002000000000linux/suse/i386-sles11/inst-sys0707010006A498000041ED0000018F0000018F000000034F10367600000000000000080000000100000000000000000000002400000000linux/suse/i386-sles11/inst-sys/usr0707010006A499000041ED0000018F0000018F000000034F10367600000000000000080000000100000000000000000000002A00000000linux/suse/i386-sles11/inst-sys/usr/share0707010006A49A000041ED0000018F0000018F000000054F10367600000000000000080000000100000000000000000000003000000000linux/suse/i386-sles11/inst-sys/usr/share/YaST20707010006A49B000041ED0000018F0000018F000000024F1036C400000000000000080000000100000000000000000000003800000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules0707010006A4A6000081A40000018F0000018F000000014F10367600002A63000000080000000100000000000000000000004800000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/IscsiClient.ybcYaST bytecode 1.4.0 IscsiClientIscsiClient.ycp ProgressReportSummaryMessageServicePackagePackagesPopup Mode Confirm Label NetworkService IscsiClientLibStage configuredModifiedmodifiedproposal_valid write_only AbortFunctionAbortinstalled_packagesExportReadWriteImportSummaryOverview AutoPackages!M+/5;Aj settings*0 iscsi-client3ProgressNew      NextStage 3ReportError  3Summary3Message&CannotContinueWithoutPackagesInstalled CannotReadCurrentSettings 3Service3Package InstallMsg  3PackagesaddAdditionalPackage  3PopupError  3Modeautoinst autoupgradeconfig3Confirm MustBeRoot3Label3NetworkServiceRunningNetworkPopup3IscsiClientLib  ay_settingssessions  currentRecord  initiatorname  readSessionsgetiBFT getNode checkInitiatorNamegetStartupStatus getServiceStatussetServiceStatusautoyastPrepare autoyastWrite3Stageinitialcont$!$+$/$5$;%A(B4C-D!-F%M,N   y2debug    modified=%1-O%Tret(W|||| -W,X    y2milestone   %Check if open-iscsi package installed$Y(Z! open-iscsi+   Q

To configure the iSCSI initiator, the %1 package must be installed.

 iscsi-client

Install it now?

 iscsi-client4],^&_-`%jtgetsresult$k ,l    foreachsess   target portal auth  new_target$m    splitstring     $n    splitstring     &o $p $qtargetportalstartup (v  authmethodNoneNone'v authmethodNone&wunion&xadd$zversion1.0 initiatorname targets&&-%caption stepssl$*Initializing iSCSI Initiator Configuration iscsi-client$$, sleep , Read the database iscsi-clientRead the previous settings iscsi-clientDetect the devices iscsi-clientReading the database... iscsi-client Reading the previous settings... iscsi-clientDetecting the devices... iscsi-clientFinished iscsi-client(! -(! -,(-, sleep ( -,, sleep ,(!-,    y2milestone   Check initiator name(! -, sleep (-(! -, sleep ,( 4,-, sleep (-&-%caption sldescr $$Saving iSCSI Initiator Configuration iscsi-client$, sleep $Write the autoYaST settings iscsi-clientSet up service status iscsi-client(!||  &  remove, size (||  4(-,, , , sleep (-,(! -, sleep (-,(&&size , open-iscsi, sleep -% &  - %-Configuration summary... iscsi-client %-! %*-, installremove0707010006A49C000081A40000018F0000018F000000014F10367600003A76000000080000000100000000000000000000004800000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/AutoInstall.ybcYaST bytecode 1.4.0 AutoInstallAutoInstall.ycp ProfileModeStageAutoinstConfigAutoInstallRulesReportTFTPautoconf callbackTrue_boolean_string  callbackFalse_boolean_string  #callbackTrue_boolean_string_integer  $callbackFalse_boolean_string_integer  callback_void_map  callbackTrue_boolean_map callbackFalse_boolean_map  callbackTrue_boolean_map_integer !callbackFalse_boolean_map_integer 'callbackTrue_boolean_string_map_integer  (callbackFalse_boolean_string_map_integer  "callbackTrue_boolean_string_string  #callbackFalse_boolean_string_string  *callbackTrue_boolean_string_string_integer  +callbackFalse_boolean_string_string_integer  Continue AutoInstall SaveFinish   PXELocalBootTurnOff  dummy   dummy   dummy dummy2  #dummy dummy2  ' dummy_map + dummy_map / dummy_map 3 dummy_map dummy7 dummy_map dummy;dummy  dummy_map  dummy_int?dummy  dummy_map  dummy_intCdummy1 dummy2 Gdummy1 dummy2 Kdummy1 dummy2 dummy3Odummy1 dummy2 dummy3Vzdestdir 3SCRReadWriteExecute0 autoinst3 Profilecurrent SaveProfileStructure ReadProfileStructure ReadXML 3Modeautoinst autoupgradeSetMode  3Stageinitialcont3AutoinstConfig parsedControlFile tmpDir  scripts_dir logs_dir cache  xml_tmpfile xml_file  profile_dir  autoconf_file 3AutoInstallRuleshostid 3Report3TFTPPut   $% -% -% - %# -$%' -(%+-,%/-0%3-4%7-8%;-<%?-@%C-D%G-H%K-L%O-P%Vret$\ (] SCR::Read .target.size4^,_    y2milestone   $XML Post installation data found: %1&` ,a SCR::Execute .target.bash   sformat    /bin/mv %1 %2-c 4f&g (h|| ! 4h,i    y2milestone   No saved autoinstall data found-j4k,l    y2milestone   "Found and read saved autoinst data,m SCR::Execute.target.remove-n-r%z(|4}ret$~ (&& size4,    y2milestone   Enabling Auto-Installation mode,autoinstallation(4,    y2milestone   =No autoyast data found, switching back to manual installation, installation(4(&& SCR::Read .target.sizesize4,    y2milestone   autoyast: %1 found,-%(||--% dircontents$  SCR::Read .target.dir+    /pre-scripts/(size 4, SCR::Execute .target.bash+   +   +   +   /bin/cp /pre-scripts/*  , SCR::Execute .target.bash+   +   +   +   /bin/cp /pre-scripts/logs/*  , SCR::Execute .target.bash   sformat   /bin/cp %1 %2%3/tmp/profile/autoinst.xml , SCR::Execute .target.bash   sformat   /bin/chmod 700 %1%2 , SCR::Execute .target.bash   sformat   /bin/cp %1 %2%3+   /pre-autoinst.xml , SCR::Execute .target.bash   sformat   /bin/chmod 700 %1%2 +   /pre-autoinst.xml-%tmpdir hexfile pxeserver $   SCR::Read.target.tmpdir$    sformat   %1/%2 $ pxe $    tftp-server(&&   pxe_localboot4config dir ,    y2milestone   )putting pxe local boot file on server :%1 $   pxelinux-config$    pxelinux-dir pxelinux.cfg( 4& 'DEFAULT linux LABEL linux localboot 0, SCR::Write.target.string  - +   +    / -%(!generalmode second_stage4,    y2milestone   Fswitching from autoinstallation to manual installation in second stage, SCR::Execute .target.bashD/bin/grep -v -i '^autoyast:' /etc/install.inf > /tmp/install.inf.new, SCR::Execute .target.bash-/bin/mv /tmp/install.inf.new /etc/install.inf0707010006A4A9000081A40000018F0000018F000000014F1036760002FDE8000000080000000100000000000000000000004400000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/Storage.ycp/** * Module: Storage.ycp * * Authors: Johannes Buchhold (jbuch@suse.de) * * Purpose: These module contains all settings/information which * are needed to partitioning the harddisk. Futhermore it contains a interface * to * access and modify the partitioning settings. * * Todo: Translate * Diese Modul enthlt alle Informationen die fr die Partitionierung der * Festplatten erforderlich sind. Diese Informationen bestehen aus der * Beschreibung, der vor der Partitionierung vorhandenen Platteneinstellungen, * und der Art und Weise wie diese verndert werden soll. * Alle ntigen Zugriffsfunktionen auf diese Datenstruktur sind ebenfalls in * diesem Modul enthalten. Der Zugriff auf die Speicherung der * Partitionseinstellungen luft also nur ber dieses Modul. * Der Zugriff und die Rckgabe von Teilen der Partitionsdatenstruktur * wurde versucht "intelligent" zu gestallten und ist im einzelen bei den * entspechenden Funktionen nher erklrt. * * $Id: Storage.ycp 62759 2010-11-08 09:57:41Z jsrain $ */ { module "Storage"; textdomain "storage"; import "Arch"; import "AsciiFile"; import "Encoding"; import "Directory"; import "FileSystems"; import "FileUtils"; import "Installation"; import "Label"; import "Mode"; import "Partitions"; import "Popup"; import "Misc"; import "HTML"; import "StorageDevices"; import "StorageClients"; import "ProductFeatures"; import "Stage"; import "String"; import "Region"; import "Hotplug"; import "LibStorage"; import "LibStorage::StorageInterface"; import "LibStorage::VolumeInfo"; import "LibStorage::PartitionInfo"; import "LibStorage::LvmLvInfo"; import "LibStorage::MdInfo"; import "LibStorage::LoopInfo"; import "LibStorage::DmInfo"; import "LibStorage::DmPartInfo"; import "LibStorage::DmraidInfo"; import "LibStorage::DmmultipathInfo"; import "LibStorage::MdPartCoInfo"; import "LibStorage::MdPartInfo"; import "LibStorage::NfsInfo"; import "LibStorage::ContainerInfo"; import "LibStorage::DiskInfo"; import "LibStorage::LvmVgInfo"; import "LibStorage::PartitionAddInfo"; import "LibStorage::DmPartCoInfo"; import "LibStorage::DmraidCoInfo"; import "LibStorage::DmmultipathCoInfo"; import "LibStorage::PartitionSlotInfo"; import "LibStorage::CommitInfo"; import "LibStorage::Environment"; map conv_ctype = $[ "def_sym" : `CT_UNKNOWN, "def_int" : LibStorage::CUNKNOWN(), "m" : $[ LibStorage::DISK() : `CT_DISK, LibStorage::MD() : `CT_MD, LibStorage::LOOP() : `CT_LOOP, LibStorage::LVM() : `CT_LVM, LibStorage::DMRAID() : `CT_DMRAID, LibStorage::DMMULTIPATH() : `CT_DMMULTIPATH, LibStorage::DM() : `CT_DM, LibStorage::MDPART() : `CT_MDPART, LibStorage::NFSC() : `CT_NFS ] ]; map conv_usedby = $[ "def_sym" : `UB_NONE, "def_int" : LibStorage::UB_NONE(), "m" : $[ LibStorage::UB_LVM() : `UB_LVM, LibStorage::UB_MD() : `UB_MD, LibStorage::UB_DMRAID() : `UB_DMRAID, LibStorage::UB_DMMULTIPATH() : `UB_DMMULTIPATH, LibStorage::UB_MDPART() : `UB_MDPART, LibStorage::UB_DM() : `UB_DM ] ]; map conv_ptype = $[ "def_sym" : `primary, "def_int" : LibStorage::PRIMARY(), "m" : $[ LibStorage::LOGICAL() : `logical, LibStorage::EXTENDED() : `extended ] ]; map conv_mountby = $[ "def_sym" : `device, "def_int" : LibStorage::MOUNTBY_DEVICE(), "m" : $[ LibStorage::MOUNTBY_UUID() : `uuid, LibStorage::MOUNTBY_LABEL() : `label, LibStorage::MOUNTBY_ID() : `id, LibStorage::MOUNTBY_PATH() : `path ] ]; map conv_encryption = $[ "def_sym" : `none, "def_int" : LibStorage::ENC_NONE(), "m" : $[ LibStorage::ENC_TWOFISH() : `twofish, LibStorage::ENC_TWOFISH_OLD() : `twofish_old, LibStorage::ENC_TWOFISH256_OLD() : `twofish_256_old, LibStorage::ENC_LUKS() : `luks, LibStorage::ENC_UNKNOWN() : `unknown, ] ]; map conv_mdtype = $[ "def_sym" : `raid_unknown, "def_int" : LibStorage::RAID_UNK(), "m" : $[ LibStorage::RAID0() : `raid0, LibStorage::RAID1() : `raid1, LibStorage::RAID5() : `raid5, LibStorage::RAID6() : `raid6, LibStorage::RAID10() : `raid10, LibStorage::MULTIPATH() : `multipath ] ]; map conv_mdstring = $[ "raid0" : LibStorage::RAID0(), "raid1" : LibStorage::RAID1(), "raid5" : LibStorage::RAID5(), "raid6" : LibStorage::RAID6(), "raid10" : LibStorage::RAID10(), "multipath" : LibStorage::MULTIPATH() ]; map conv_mdparity = $[ "def_sym" : `par_none, "def_int" : LibStorage::PAR_NONE(), "m" : $[ LibStorage::LEFT_ASYMMETRIC() : `left_asymmetric, LibStorage::LEFT_SYMMETRIC() : `left_symmetric, LibStorage::RIGHT_ASYMMETRIC() : `right_asymmetric, LibStorage::RIGHT_SYMMETRIC() : `right_symmetric ] ]; map conv_parstring = $[ "left_asymmetric" : LibStorage::LEFT_ASYMMETRIC(), "left_symmetric" : LibStorage::LEFT_SYMMETRIC(), "right_asymmetric" : LibStorage::RIGHT_ASYMMETRIC(), "right_symmetric" : LibStorage::RIGHT_SYMMETRIC() ]; map conv_imsm_driver = $[ `IMSM_UNDECIDED : LibStorage::IMSM_UNDECIDED(), `IMSM_DMRAID : LibStorage::IMSM_DMRAID(), `IMSM_MDADM : LibStorage::IMSM_MDADM() ]; map DiskMapVersion = $[]; map DiskMap = $[]; map type_order = $[ `CT_DISK : 0, `CT_MD : 1, `CT_MDPART : 2, `CT_DMRAID : 3, `CT_DMMULTIPATH : 4, `CT_LOOP : 5, `CT_DM : 6, `CT_LVM : 7, `CT_NFS : 8 ]; list hw_packages = []; list no_propose_disks = nil; boolean proposal_home = false; boolean proposal_lvm = false; boolean proposal_encrypt = false; string proposal_password = ""; map cfg_xml = $[]; string part_insts = ""; // bnc#477778 - Updating SLES 10 SP2 (GA+) to SLES 11 RC4 produces multiple identical grub boot menu entries // flag indicates calling StorageUpdate::Update() boolean called_update = false; /** * Returns Device Name * * @param string Disk * @param any partition * @return string device name * * @example Storage::GetDeviceName ("/dev/md", 1) */ global define string GetDeviceName( string disk, any partition ) { string ret = disk; if( is( partition, integer ) ) { if( search( disk, "/dev/cciss/" )==0 || search( disk, "/dev/ida/" )==0 || search( disk, "/dev/ataraid/" )==0 || search( disk, "/dev/etherd/" )==0 || (search(disk, "/dev/md") == 0 && disk != "/dev/md") || search( disk, "/dev/rd/" )==0 ) { ret = ret + "p"; } else if( search( disk, "/dev/mapper/" )==0 ) { ret = ret + "_part"; } ret = ret + sformat( "%1", partition ); } else if( size( (string)partition )>0 ) { ret = ret + "/" + (string)partition; } return( ret ); }; global boolean IsKernelDeviceName(string device) { return substring(device, 0, 6) != "LABEL=" && substring(device, 0, 5) != "UUID=" && substring(device, 0, 13) != "/dev/disk/by-"; } /** * Returns ... * * @param string dev * @return string EvmsDevDisk */ /* global string EvmsDevDisk( string dev ) { string ret = "/dev/" + substring( dev, 10 ); integer pos = search( ret, "!" ); y2milestone( "EvmsDevDisk pos:%1", pos ); if( pos!=nil ) ret = String::Replace( ret, "!", "/" ); pos = search( ret, "|" ); y2milestone( "EvmsDevDisk pos:%1", pos ); if( pos!=nil ) ret = String::Replace( ret, "|", "/" ); return( ret ); } */ /* Storage = TargetMap /* Storage = $[ "targets" : $[], "must_reread_partitions" : false, "win_device" : false, "testsuite" : false, "do_resize" : "", "part_proposal_mode" : "", "part_proposal_first" : true, "focus" : key ] */ map StorageMap = $[]; /* stringkeys for access to the Storage map */ string targets_key = "targets"; string part_mode_key = "part_mode"; string part_disk_key = "part_disk"; string testsuite_key = "testsuite"; string do_resize_key = "do_resize"; string win_device_key = "win_device"; string custom_display_key = "custom_display"; string part_proposal_mode_key = "part_proposal_mode"; string part_proposal_first_key = "part_proposal_first"; string part_proposal_active_key = "part_proposal_active"; boolean probe_done = false; symbol exit_key = `next; any sint = nil; list conts = []; string GetProcessName(integer pid) { string name = (string) SCR::Read(.target.symlink, "/proc/" + tostring(pid) + "/exe"); if (name == nil) return nil; integer pos = findlastof(name, "/"); if (pos == nil) return name; return substring(name, pos + 1); } any CreateInterface(boolean readonly) { while (sint == nil) { any env = LibStorage::Environment::new("LibStorage::Environment", readonly); LibStorage::Environment::swig_testmode_set(env, Mode::test()); LibStorage::Environment::swig_autodetect_set(env, true); LibStorage::Environment::swig_instsys_set(env, Stage::initial() || Mode::repair()); integer locker_pid = 0; sint = LibStorage::createStorageInterfacePid(env, locker_pid); if (sint == nil) { string locker_name = GetProcessName(locker_pid); y2milestone("locker_pid:%1 locker_name:%2", locker_pid, locker_name); if (locker_name == nil) { if (!Popup::AnyQuestion(Label::ErrorMsg(), // error popup _("The storage subsystem is locked by an unknown application. You must quit that application before you can continue."), Label::ContinueButton(), Label::CancelButton(), `focus_no)) break; } else { if (!Popup::AnyQuestion(Label::ErrorMsg(), // error popup sformat(_("The storage subsystem is locked by the application \"%1\" (%2). You must quit that application before you can continue."), locker_name, locker_pid), Label::ContinueButton(), Label::CancelButton(), `focus_no)) break; } } } y2milestone("sint:%1", sint); return sint; } symbol imsm_driver = `IMSM_UNDECIDED; global void SetImsmDriver(symbol val) { imsm_driver = val; } list getContainers(); global boolean InitLibstorage(boolean readonly) { if (sint != nil) return true; y2milestone("InitLibstorage"); sint = CreateInterface(readonly); if (sint == nil) { y2error("Storage::CreateInterface failed"); return false; } if (Stage::initial()) { LibStorage::StorageInterface::setDetectMountedVolumes(sint, false); LibStorage::StorageInterface::setRootPrefix(sint, Installation::destdir); } LibStorage::StorageInterface::setEfiBoot(sint, Partitions::EfiBoot()); // LibStorage::StorageInterface::setImsmDriver(sint, conv_imsm_driver[imsm_driver]:LibStorage::IMSM_UNDECIDED()); conts = getContainers(); y2milestone("InitLibstorage conts:%1", conts); FileSystems::InitSlib(sint); return true; } global string ByteToHumanString(integer bytes) { return LibStorage::StorageInterface::byteToHumanString(sint, bytes, false, 2, false); } global string KByteToHumanString(integer kbytes) { return LibStorage::StorageInterface::byteToHumanString(sint, kbytes * 1024, false, 2, false); } global string ByteToHumanStringWithPrecision(integer bytes, integer precision, boolean omit_zeroes) { return LibStorage::StorageInterface::byteToHumanString(sint, bytes, false, precision, omit_zeroes); } global string KByteToHumanStringWithPrecision(integer kbytes, integer precision, boolean omit_zeroes) { return LibStorage::StorageInterface::byteToHumanString(sint, kbytes * 1024, false, precision, omit_zeroes); } global boolean HumanStringToByte(string str, integer& bytes) { integer i = 0; bytes = i; // bnc #408829 and #408891 boolean ret = LibStorage::StorageInterface::humanStringToByte(sint, str, false, bytes); y2milestone("HumanStringToByte ret:%1 str:%2 bytes:%3", ret, str, bytes); return ret; } global boolean HumanStringToKByte(string str, integer& kbytes) { integer bytes = 0; // bnc #408829 boolean ret = LibStorage::StorageInterface::humanStringToByte(sint, str, false, bytes); kbytes = bytes / 1024; y2milestone("HumanStringToKByte ret:%1 str:%2 kbytes:%3", ret, str, kbytes); return ret; } /** * Converts a string into a integer and checks the allowed range for the * integer. The range check is a bit sloppy to compensate rounding issues but * it's guaranteed that the result lies within the allowed range. */ global boolean HumanStringToKByteWithRangeCheck(string str, integer& bytes_k, integer min_k, integer max_k) { if (!HumanStringToKByte(str, bytes_k)) return false; if (min_k != nil && bytes_k < min_k) { if (KByteToHumanString(bytes_k) != KByteToHumanString(min_k)) return false; bytes_k = min_k; } if (max_k != nil && bytes_k > max_k) { if (KByteToHumanString(bytes_k) != KByteToHumanString(max_k)) return false; bytes_k = max_k; } return true; } global define map GetTargetMap(); define list GetDiskPartitionTg( string device, map tg ) ``{ list ret = []; integer dlen = 0; boolean as_string = false; list ls = filter( string s, splitstring( device, "/" ), ``(size(s)>0)); if( search( device, "LABEL=" )==0 || search( device, "UUID=" )==0 ) { list tl = splitstring( device, "=" ); ls = [ "dev", "disk", "", tl[1]:"" ]; ls[2] = (search( device, "LABEL=" )==0)?"by-label":"by-uuid"; y2milestone( "GetDiskPartitionTg ls:%1", ls ); } y2debug( "GetDiskPartitionTg size:%1 ls:%2", size(ls), ls ); if( size(ls)>=4 && ls[1]:"" == "disk" && contains( [ "by-id", "by-path", "by-uuid", "by-label" ], ls[2]:"" )) { map part = $[]; string regex = "-part[0-9]+$"; if( ls[2]:"" == "by-label" ) { foreach( string dev, map disk, tg, ``{ part = find( map p, disk["partitions"]:[], ``(p["label"]:""==ls[3]:"")); if( part!=nil ) { map tmp = $[]; tmp["disk"] = dev; if( haskey( part, "nr" )) tmp["nr"] = part["nr"]:(any)0; else tmp["nr"] = part["name"]:""; ret = add( ret, tmp ); } }); } else if( ls[2]:"" == "by-uuid" ) { foreach( string dev, map disk, tg, ``{ part = find( map p, disk["partitions"]:[], ``(p["uuid"]:""==ls[3]:"")); if( part!=nil ) { map tmp = $[]; tmp["disk"] = dev; if( haskey( part, "nr" )) tmp["nr"] = part["nr"]:(any)0; else tmp["nr"] = part["name"]:""; ret = add( ret, tmp ); } }); } else if( ls[2]:"" == "by-id" ) { string id = ls[3]:""; integer num = 0; list l = regexppos( id, regex ); if( size(l)>0 ) { num = tointeger( substring( id, l[0]:0+5 )); id = substring( id, 0, l[0]:0 ); y2debug( "GetDiskPartitionTg id:%1 num:%2", id, num ); } foreach( string dev, map disk, tg, ``{ if( size(ret)==0 && find( string s, disk["udev_id"]:[], ``(s==id))!=nil) { part = find( map p, disk["partitions"]:[], ``(p["nr"]:0==num)); if( num==0 || part!=nil ) { map tmp = $[]; tmp["disk"] = dev; if( num>0 ) tmp["nr"] = num; else tmp["nr"] = ""; ret = [ tmp ]; } } }); } else if( ls[2]:"" == "by-path" ) { string id = ls[3]:""; integer num = 0; list l = regexppos( id, regex ); if( size(l)>0 ) { num = tointeger( substring( id, l[0]:0+5 )); id = substring( id, 0, l[0]:0 ); y2debug( "GetDiskPartitionTg id:%1 num:%2", id, num ); } foreach( string dev, map disk, tg, ``{ if( size(ret)==0 && disk["udev_path"]:"" == id ) { part = find( map p, disk["partitions"]:[], ``(p["nr"]:0==num)); if( num==0 || part!=nil ) { map tmp = $[]; tmp["disk"] = dev; if( num>0 ) tmp["nr"] = num; else tmp["nr"] = ""; ret = [ tmp ]; } } }); } } else if( search( device, "/" )==0 ) { if( search( device, "/dev/hd" )==0 || search( device, "/dev/sd" )==0 || search( device, "/dev/ed" )==0 || search( device, "/dev/iseries/vd" )==0 ) { dlen = findfirstof( device, "0123456789" ); if( dlen == nil ) { dlen = size(device); } } else if( search( device, "/dev/md" )==0 && size(ls)==2 ) { integer pos = find(device, "p"); y2milestone("device:%1 pos:%2", device, pos); if (pos == -1) dlen = 7; else dlen = pos; } else if( search( device, "/dev/loop" )==0 ) { dlen = 9; } else if( search( device, "/dev/i2o/hd" )==0 ) { dlen = 12; } else if( search( device, "/dev/rd/" )==0 || search( device, "/dev/cciss/" )==0 || search( device, "/dev/ataraid/" )==0 || search( device, "/dev/etherd/" )==0 || search( device, "/dev/ida/" )==0 ) { integer pos = findlastof( device, "p" ); dlen = size(device); if( pos!=nil ) { dlen = pos; } } else if( search( device, "/dev/dasd" )==0 ) { dlen = size(device); if( findfirstof( device, "0123456789" )!=nil ) { dlen = dlen-1; } } else if( search( device, "/dev/mapper/" )==0 ) { string regex = "[_-]part[0-9]+$"; list l = regexppos( device, regex ); if( size(l)>0 ) dlen = l[0]:0; else dlen = size(device); } else { as_string = true; if( size(ls)>=3 ) { integer pos = findlastof( device, "/" ); if( pos!=nil ) { dlen = pos; } } else { dlen = size(device); integer nonzero = findlastnotof( device, "0123456789" ); if( nonzero!=nil && nonzero < dlen-1 ) { dlen = nonzero+1; as_string = false; } } } map tmp =$[]; tmp["disk"] = substring( device, 0, dlen ); device = substring( device, dlen ); if( search( device, "_part" )==0 ) device = substring( device, 5 ); if( size(device)>0 && findfirstof( device, "/p" )==0 ) { device = substring( device, 1 ); } tmp["nr"] = -1; if( as_string ) { tmp["nr"] = device; } else { if( size(device)>0 ) { tmp["nr"] = tointeger(device); } } if( size(tmp["disk"]:"")>0 && tmp["nr"]:(any)1 == -1 ) { tmp["nr"] = ""; } ret = [ tmp ]; } else { ret = [ $[ "disk" : "/dev/nfs", "nr" : device ]]; } if( size(ret)>1 ) { list a = filter( map m, ret, ``(search(m["disk"]:"","/dev/evms")!=0)); list b = filter( map m, ret, ``(search(m["disk"]:"","/dev/evms")==0)); ret = (list)merge( a, b ); } y2debug( "GetDiskPartitionTg device:%1 ret:%2", device, ret ); return( ret ); }; /** * Returns map describing the disk partition * * @param string device * @return map DiskPartition * * Examples: * "/dev/sda" -> $[ "disk" : "/dev/sda", "nr" : "" ] * "/dev/sda2" -> $[ "disk" : "/dev/sda", "nr" : 2 ] * "/dev/system" -> $[ "disk" : "/dev/system", "nr" : "" ] * "/dev/system/abuild" -> $[ "disk" : "/dev/system", "nr" : "abuild" ] */ global define map GetDiskPartition( string device ) ``{ return( GetDiskPartitionTg( device, GetTargetMap() )[0]:$[] ); }; global void UpdateChangeTime() { integer change_time = time(); y2milestone( "UpdateChangeTime time %1", change_time ); StorageMap["targets_time"] = change_time; } /* return list of partitions of map */ define list GetPartitionLst( map tg, string device ) ``{ list ret = []; list tmp = GetDiskPartitionTg( device, tg ); y2milestone( "GetPartitionLst tmp:%1", tmp ); foreach( map m, tmp, ``{ string disk = m["disk"]:""; if( search(device, "/dev/evms")==0 && !haskey( tg, disk ) ) { disk = "/dev/evms"; } y2debug( "GetPartitionLst device=%1 disk=%2", device, disk ); list part = filter( map p, tg[disk,"partitions"]:[], ``(p["device"]:""==device )); part = filter( map p, part, ``(!p["delete"]:false)); if( size(part)==0 ) { part = filter( map p, tg[disk,"partitions"]:[], ``(p["nr"]:-1==m["nr"]:0 )); part = filter( map p, part, ``(!p["delete"]:false)); } if( size(part)==0 ) { part = filter( map p, tg[disk,"partitions"]:[], ``(p["name"]:""==m["nr"]:"" )); part = filter( map p, part, ``(!p["delete"]:false)); } map pa = part[0]:$[]; if( size(pa)==0 && search(device, "/dev/mapper/")==0 ) { part = filter( map p, tg["/dev/mapper","partitions"]:[], ``(p["device"]:""==device )); pa = part[0]:$[]; } if( size(pa)==0 && search(device, "/dev/mapper/")==0 ) { part = filter( map p, tg["/dev/loop","partitions"]:[], ``(p["device"]:""==device )); pa = part[0]:$[]; } if( size(pa)>0 ) ret = add( ret, pa ); }); y2debug( "GetPartitionLst ret=%1", ret ); return( ret ); } global define map GetPartition( map tg, string device ) { return( (map)GetPartitionLst( tg, device )[0]:$[] ); } /** * Returns disk identified by 'device' taken from the 'tg' (target) map * * @param map tg (target map) * @param string device */ global define map GetDisk( map tg, string device ) ``{ map ret = $[]; map tmp = GetDiskPartitionTg( device, tg )[0]:$[]; string disk = tmp["disk"]:""; if( search(device, "/dev/evms")==0 && !haskey( tg, disk ) ) { disk = "/dev/evms"; } y2debug( "GetDisk disk=%1", disk ); return( (map)tg[disk]:$[] ); } /** * Sets partition 'part' into the 'tg' map and returns changed 'tg' map * * @param map tg * @param map part * @return map changed tg */ /* global define map SetPartition( map tg, map part ) ``{ y2milestone( "SetPartition part=%1", part ); map tmp = GetDiskPartitionTg( part["device"]:"", tg )[0]:$[]; y2milestone( "SetPartition tmp=%1", tmp ); string disk = tmp["disk"]:""; if( search(part["device"]:"", "/dev/evms")==0 && !haskey( tg, disk ) ) { disk = "/dev/evms"; } list r_part = filter(map p, tg[disk,"partitions"]:[], ``(p["device"]:"" != part["device"]:"")); r_part = add( r_part, part ); tg[disk,"partitions"] = r_part; return( tg ); } */ /** * Find next free loop device. * * @param integer start (start with /dev/loop$number) * @return string loop_dev ( e.g.: /dev/loop1 ) */ /* global define string GetLoopDev( integer start ) ``{ if( Mode::test () ) return "/dev/loop2"; integer max_loop_dev= 15; integer loop_dev_nb = start; boolean found_free = false; string loop_dev = ""; while( !found_free && loop_dev_nb <= max_loop_dev ) { loop_dev = sformat("/dev/loop%1", loop_dev_nb ); loop_dev_nb = loop_dev_nb + 1; // Test loop dev if( SCR::Execute(.target.bash , "/sbin/losetup 2>/dev/null " + loop_dev ) != 0 ) found_free = true; } if( !found_free ) { loop_dev = ""; // internal error popup Popup::Error( _("Too many loop devices (cryptofs ...)") ); y2error( "Too many loop devices"); } y2milestone("ret \"%1\"",loop_dev); return( loop_dev ); }; */ /** * Get List of swap partitions * @return list List of swap partitions */ global list SwappingPartitions() { SCR::UnmountAgent(.proc.swaps); list swaps = (list) SCR::Read(.proc.swaps); if (swaps == nil) { y2error("SCR::Read(.proc.swaps) returned nil"); swaps = []; } swaps = filter(map e, swaps, ``(e["type"]:""=="partition")); list ret = maplist(map e, swaps, ``(Partitions::TranslateMapperName(e["file"]:""))); y2milestone("SwappingPartitions %1", ret); return ret; } global define list GetDestroyedLvmVgs( map target ) ``{ list vgs = []; foreach(string diskdev, map disk, target, ``{ foreach( map p, disk["partitions"]:[], ``{ if( p["used_by_type"]:`UB_NONE==`UB_LVM && p["format"]:false ) { vgs = union( vgs, [ p["used_by"]:"" ] ); } }); }); vgs = sort( vgs ); y2milestone( "GetDestroyedLvmVgs %1", vgs ); return( vgs ); } global define map DeleteDestroyedLvmVgs( map target ) ``{ list vgs = maplist( string s, (list)GetDestroyedLvmVgs( target ), ``("/dev/"+s)); y2milestone( "DeleteDestroyedLvmVgs %1", vgs ); foreach( string dev, vgs, ``{ if( haskey( target, dev )) target[dev,"delete"] = true; target[dev,"partitions"] = maplist( map p, target[dev,"partitions"]:[], ``{ if( haskey( p, "mount" )) p = remove( p, "mount" ); return( p ); }); y2milestone( "DeleteDestroyedLvmVgs %1: %2", dev, target[dev]:$[] ); }); return( target ); } /** * Returns map of free space per partition * * @param string device * @param integer testsize * @param symbol used_fs * @param boolean verbose */ global define map GetFreeSpace( string device, integer testsize, symbol used_fs, boolean verbose ) ``{ if( Mode::test() ) { integer wf = tointeger(tofloat(testsize) * 0.6); integer wu = tointeger(tofloat(testsize) * 0.4); integer ls = tointeger(tofloat(testsize) * 0.5); return( $[ "free" : wf, "used" : wu, "linux_size" : ls, "new_size": (wu + wf - ls) ] ); } integer used = 0; integer resize_free = 0; integer df_free = 0; boolean win_disk = false; boolean efi = false; boolean r = false; r = LibStorage::StorageInterface::getFreeInfo( sint, device, resize_free, df_free, used, win_disk, efi, used_fs==`ntfs ); resize_free = resize_free * 1024; // Byte df_free = df_free * 1024; // Byte used = used * 1024; // Byte if( used_fs == `ntfs && !r && verbose ) { string cmd = sformat("/usr/sbin/ntfsresize -f -i '%1'", device); y2milestone( "GetFreeSpace Executing cmd:%1", cmd ); map bcall = (map) SCR::Execute( .target.bash_output, cmd, $[ "LC_MESSAGES" :"POSIX"] ); y2milestone( "GetFreeSpace Executing ret:%1", bcall ); string tmp = _("Resize Not Possible:") + "\n\n"; tmp = tmp + bcall["stdout"]:"" + bcall["stderr"]:""; Popup::Error( tmp ); return( $[] ); } integer linux_size = 0; integer min_linux_size = 0; integer add_free = df_free - resize_free; y2milestone( "GetFreeSpace resize_free %1 add_free %2", resize_free, add_free ); if( resize_free < 300*1024*1024 || !r ) { linux_size = 0; min_linux_size = 0; } else if( resize_free < 600*1024*1024 ) { linux_size = resize_free; if( add_free < 75*1024*1024 ) { linux_size = linux_size - 75*1024*1024 + add_free; } min_linux_size = linux_size; } else if ( resize_free < 1024*1024*1024 ) { linux_size = resize_free; if( add_free < 200*1024*1024 ) { linux_size = linux_size - 200*1024*1024 + add_free; } min_linux_size = 300*1024*1024; } else if ( resize_free < 2*1024*1024*1024 ) { linux_size = resize_free; if( add_free < 300*1024*1024 ) { linux_size = linux_size - 300*1024*1024 + add_free; } min_linux_size = 500*1024*1024; } else if ( resize_free < 3*1024*1024*1024 ) { linux_size = resize_free; if( add_free < 800*1024*1024 ) { linux_size = linux_size - 800*1024*1024 + add_free; } min_linux_size = 500*1024*1024; } else { linux_size = resize_free; if( add_free < resize_free/3 ) { linux_size = linux_size - resize_free/3 + add_free; } min_linux_size = 500*1024*1024; } integer new_size = used + add_free + resize_free - linux_size; map ret = $[ "free": (resize_free>0?resize_free:0), "df_free" : df_free, "used":used, "win_disk":win_disk, "efi":efi, "linux_size":linux_size, "max_win_size":used + resize_free + add_free - min_linux_size, "ntfs" : (used_fs == `ntfs), "new_size":new_size ]; ret["ok"] = r; y2milestone( "GetFreeSpace %1 ret %2", device, ret ); return( ret ); }; global integer GetUnusedPartitionSlots(string device, list &slots) { list swig_slots = []; integer ret = LibStorage::StorageInterface::getUnusedPartitionSlots(sint, device, swig_slots); slots = maplist(any swig_slot, swig_slots, { return $[ "region" : [ LibStorage::PartitionSlotInfo::swig_cylStart_get(swig_slot), LibStorage::PartitionSlotInfo::swig_cylSize_get(swig_slot) ], "primary_slot" : LibStorage::PartitionSlotInfo::swig_primarySlot_get(swig_slot), "primary_possible" : LibStorage::PartitionSlotInfo::swig_primaryPossible_get(swig_slot), "extended_slot" : LibStorage::PartitionSlotInfo::swig_extendedSlot_get(swig_slot), "extended_possible" : LibStorage::PartitionSlotInfo::swig_extendedPossible_get(swig_slot), "logical_Slot" : LibStorage::PartitionSlotInfo::swig_logicalSlot_get(swig_slot), "logical_possible" : LibStorage::PartitionSlotInfo::swig_logicalPossible_get(swig_slot) ]; }); return ret; } /** * Adds ... and returns the changed map * * @param map targets * @return map targets */ global define map AddWinInfo( map targets ) ``{ y2milestone( "AddWinInfo called" ); foreach(string disk, map data, targets, ``{ targets[disk,"partitions"] = maplist(map p, data["partitions"]:[], ``{ if( Partitions::IsDosWinNtPartition(p["fsid"]:0) && contains( [ `ntfs, `vfat ], p["used_fs"]:`none )) { p["winfo"] = GetFreeSpace( p["device"]:"", 0, p["used_fs"]:`none, false ); y2milestone( "AddWinInfo %1", p ); } return( p ); }); }); return( targets ); }; global define string SaveDumpPath( string name )``{ string ret = Directory::tmpdir + "/" + name; y2debug( "name=%1 path=%2", name, ret ); return ret; } // add mount point for all mounted partitions /** * Adds mountpoint info to the target map and returns the changed map * * @param map target * @return map target */ global define map AddMountPointInfo( map target ) ``{ list mounts = Partitions::CurMounted(); foreach(string diskdev, map disk, target, ``{ // variable renamed due to some interpreter problems list tmp2 = disk["partitions"]:[]; tmp2 = maplist(map part, tmp2, ``{ map mt = find(map mp, mounts, ``(mp["spec"]:" "==part["device"]:"" || mp["loop_on"]:" "==part["device"]:"")); if( mt != nil ) { part["mount"] = mt["file"]:""; if( part["noauto"]:false ) { part["active"] = true; } } return( part ); }); disk["partitions"] = tmp2; target[diskdev] = disk; }); return( target ); } /* global define list FindFstabLines( map fstab, string mount, string device, string uuid, string label ) ``{ list lines = []; if( size(mount)>0 && mount != "swap" ) { lines = AsciiFile::FindLineField( fstab, 1, mount ); } if( size(lines)==0 ) { lines = AsciiFile::FindLineField( fstab, 0, device ); } if( size(lines)>1 ) { uuid = "UUID=" + uuid; label = "LABEL=" + label; map tlines = AsciiFile::GetLines( fstab, lines ); map nlist = filter(integer num, map line, tlines, ``( line["fields",0]:"" == device || line["fields",0]:"" == uuid || line["fields",0]:"" == label )); if( size(nlist)>0 ) { lines = maplist( integer num, map line, nlist, ``(num)); } } y2milestone( "lines %1", lines ); return( lines ); }; */ // add info gotten from /etc/fstab to targetMap /* global define map AddFstabInfo( map target, boolean lineno ) ``{ y2milestone( "lineno=%1", lineno ); map fstab = Partitions::GetFstab( "/etc/fstab" ); map crtab = Partitions::GetCrypto( "/etc/cryptotab" ); foreach(string diskdev, map disk, target, ``{ list new_part = []; foreach(map part, disk["partitions"]:[], ``{ list rem = []; if( lineno ) { rem = [ "fstabline", "crtabline" ]; } else { rem = [ "mountby", "fstopt" ]; } part = (map)filter(string key, any val, (map)part, ``(!contains( rem, key ))); string mp = part["mount"]:""; if( size(part["ori_mount"]:"")>0 ) { mp = part["ori_mount"]:""; } list lines = []; lines = FindFstabLines( fstab, mp, part["device"]:"", part["uuid"]:"", part["label"]:"" ); if( size(lines)>0 ) { if( lineno ) { part["fstabline"] = lines[0]:-1; } else { map entry = AsciiFile::GetLine( fstab, lines[0]:-1 ); if( entry["fields",3]:"defaults" != "defaults" ) { part["fstopt"] = entry["fields",3]:""; } if( search(entry["fields",0]:"", "UUID=") != nil ) { part["mountby"] = `uuid; } else if( search(entry["fields",0]:"", "LABEL=") != nil ) { part["mountby"] = `label; } else if( search(entry["fields",0]:"", "/dev/disk/by-id/") != nil ) { part["mountby"] = `id; } else if( search(entry["fields",0]:"", "/dev/disk/by-path/") != nil ) { part["mountby"] = `path; } } } lines = AsciiFile::FindLineField( crtab, 2, mp ); if( size(lines)==0 && diskdev!="/dev/loop" ) { lines = AsciiFile::FindLineField( crtab, 1, part["device"]:"" ); } if( size(lines)==0 && diskdev=="/dev/loop" ) { lines = AsciiFile::FindLineField( crtab, 0, part["device"]:"" ); } if( size(lines)>0 ) { if( lineno ) { part["crtabline"] = lines[0]:-1; } else { map entry = AsciiFile::GetLine( crtab, lines[0]:-1 ); if( entry["fields",5]:"defaults" != "defaults" ) { part["fstopt"] = entry["fields",5]:""; } } } y2milestone( "part=%1", part ); new_part = add( new_part, part ); }); target[diskdev] = disk; target[diskdev,"partitions"] = new_part; }); return( target ); } */ string convertFsOptionMapToString( map fsopt, symbol cmd ) { string ret = ""; // do nothing if( fsopt != nil || fsopt != $[] ) { list ignore = [ "auto", "default", "none", "" ]; foreach(any option_key, map option, fsopt, ``{ string option_str = option["option_str"]:""; any option_value = option["option_value"]:(any)""; boolean option_blank = option["option_blank"]:false; symbol option_cmd = option["option_cmd"]:`mkfs; y2milestone( "convertFsOptionMapToString k:%1 opt:%2 val:%3 cmd:%4", option_key, option, option_value, option_cmd ); if (cmd == option_cmd) { if( is(option_value, string) && option_value != nil ) { if( !contains( ignore, option_value )) { if( size(ret)>0 ) ret = ret + " "; ret = ret + option_str; if( option_blank ) ret = ret + " "; ret = ret + (string)option_value; } } else if( is(option_value, boolean) && option_value != nil ) { if( (boolean) option_value ) { if( size(ret)>0 ) ret = ret + " "; ret = ret + option_str; } } else if( is(option_value, integer) && option_value != nil ) { if( size(ret)>0 ) ret = ret + " "; ret = ret + option_str; if( option_blank ) ret = ret + " "; ret = ret + sformat("%1", option_value); } } }); } if( size(fsopt)>0 || size(ret)>0 ) y2milestone( "convertFsOptionMapToString fsopt:%1 ret:%2", fsopt, ret ); return ret; }; map convertStringToFsOptionMap( string opts, symbol fs, symbol cmd ) { map ret = $[]; y2milestone( "convertStringToFsOptionMap opts:\"%1\" fs:%2 cmd:%3", opts, fs, cmd ); integer pos = findfirstnotof( opts, " \t" ); if( pos>0 ) opts = substring( opts, pos ); list op = (list)FileSystems::GetOptions(fs); op = filter(map o, op, { return o[`option_cmd]:`mkfs == cmd; }); while( size(opts)>0 ) { boolean found = false; foreach( map o, op, ``{ map m = $[]; string os = o[`option_str]:""; if( !found && size(os)>0 && search( opts, os )==0 ) { found = true; m["option_str"] = os; m["option_cmd"] = o[`option_cmd]:`mkfs; if( o[`type]:`text==`boolean ) { m["option_value"] = true; ret[o[`query_key]:""] = m; } opts = substring( opts, size(os) ); pos = findfirstnotof( opts, " \t" ); if( pos>0 ) opts = substring( opts, pos ); if( o[`type]:`text!=`boolean && size(opts)>0 && search(opts,"-")!=0 ) { if( pos>0 ) m["option_blank"] = true; pos = findfirstof( opts, " \t" ); if( pos==nil ) { m["option_value"] = opts; opts = ""; } else { m["option_value"] = substring( opts, 0, pos ); opts = substring( opts, pos ); } ret[o[`query_key]:""] = m; } pos = findfirstnotof( opts, " \t" ); if( pos>0 ) opts = substring( opts, pos ); } }); if( !found ) { pos = findfirstnotof( opts, " \t" ); if( pos>0 ) opts = substring( opts, pos ); else opts = ""; } y2milestone( "convertStringToFsOptionMap opts:%1 ret:%2", opts, ret ); } y2milestone( "convertStringToFsOptionMap ret:%1", ret ); return( ret ); } symbol toSymbol( map conv, integer val ) { return( conv["m",val]:(conv["def_sym"]:`invalid_conv_map) ); } integer fromSymbol( map conv, symbol val ) { integer ret = conv["def_int"]:-1; foreach( integer i, symbol s, conv["m"]:$[], ``{ if( s==val ) ret = i; }); return( ret ); } global define boolean CheckBackupState( string who ) { y2milestone( "CheckBackupStates who:%1", who ); if (!InitLibstorage(false)) return nil; boolean ret = LibStorage::StorageInterface::checkBackupState( sint, who ); y2milestone( "CheckBackupStates ret:%1", ret ); return( ret ); } map diskMap( any dinfo, map d ) { d["size_k"] = LibStorage::DiskInfo::swig_sizeK_get(dinfo); d["cyl_size"] = LibStorage::DiskInfo::swig_cylSizeB_get(dinfo); d["cyl_count"] = LibStorage::DiskInfo::swig_cyl_get(dinfo); d["label"] = LibStorage::DiskInfo::swig_disklabel_get(dinfo); d["max_logical"] = LibStorage::DiskInfo::swig_maxLogical_get(dinfo); d["max_primary"] = LibStorage::DiskInfo::swig_maxPrimary_get(dinfo); boolean bt = LibStorage::DiskInfo::swig_iscsi_get(dinfo); if( bt ) d["iscsi"] = true; else if( haskey( d, "iscsi" )) d = remove( d, "iscsi" ); bt = LibStorage::DiskInfo::swig_initDisk_get(dinfo); if( bt ) d["dasdfmt"] = true; else if( haskey( d, "dasdfmt" )) d = remove( d, "dasdfmt" ); string tmp = LibStorage::DiskInfo::swig_udevId_get(dinfo); if( size(tmp)>0 ) d["udev_id"] = splitstring( tmp, " " ); else if( haskey( d, "udev_id" )) d = remove( d, "udev_id" ); tmp = LibStorage::DiskInfo::swig_udevPath_get(dinfo); if( size(tmp)>0 ) d["udev_path"] = tmp; else if( haskey( d, "udev_path" )) d = remove( d, "udev_path" ); y2milestone( "diskMap ret:%1", d ); return( d ); } map dmPartCoMap( any infos, map d ) { any dinfo = LibStorage::DmPartCoInfo::swig_d_get(infos); d = diskMap( dinfo, d ); list ls = splitstring( LibStorage::DmPartCoInfo::swig_devices_get(infos), " " ); y2milestone( "ls=%1", ls ); d["devices"] = ls; integer t = LibStorage::DmPartCoInfo::swig_minor_get(infos); d["minor"] = t; y2milestone( "dmPartCoMap ret:%1", d ); return( d ); } map volumeMap( any vinfo, map p ) { p["device"] = LibStorage::VolumeInfo::swig_device_get(vinfo); p["size_k"] = LibStorage::VolumeInfo::swig_sizeK_get(vinfo); p["name"] = LibStorage::VolumeInfo::swig_name_get(vinfo); integer t = LibStorage::VolumeInfo::swig_fs_get(vinfo); symbol fs = toSymbol( FileSystems::conv_fs, t ); p["detected_fs"] = fs; if( fs != `unknown ) p["used_fs"] = fs; boolean tbool = LibStorage::VolumeInfo::swig_format_get(vinfo); if( tbool ) p["format"] = true; tbool = LibStorage::VolumeInfo::swig_create_get(vinfo); if( tbool ) p["create"] = true; string tmp = LibStorage::VolumeInfo::swig_mount_get(vinfo); if( size(tmp)>0 ) { p["mount"] = tmp; tbool = LibStorage::VolumeInfo::swig_is_mounted_get(vinfo); if( !tbool ) p["inactive"] = true; t = LibStorage::VolumeInfo::swig_mount_by_get(vinfo); p["mountby"] = toSymbol( conv_mountby, t ); } t = LibStorage::VolumeInfo::swig_usedByType_get(vinfo); if( t!=LibStorage::UB_NONE() ) { p["used_by_type"] = toSymbol( conv_usedby, t ); p["used_by"] = LibStorage::VolumeInfo::swig_usedByName_get(vinfo); p["used_by_device"] = LibStorage::VolumeInfo::swig_usedByDevice_get(vinfo); } tmp = LibStorage::VolumeInfo::swig_fstab_options_get(vinfo); if( size(tmp)>0 ) { p["fstopt"] = tmp; if( find( string s, splitstring( tmp, "," ), ``(s=="noauto") )!=nil ) p["noauto"] = true; } tmp = LibStorage::VolumeInfo::swig_mkfs_options_get(vinfo); if( size(tmp)>0 ) { p["mkfs_opt"] = tmp; p["fs_options"] = convertStringToFsOptionMap( tmp, p["detected_fs"]:`unknown, `mkfs ); } else { if( haskey( p, "fs_options" )) p = remove( p, "fs_options" ); } tmp = LibStorage::VolumeInfo::swig_tunefs_options_get(vinfo); if( size(tmp)>0 ) { p["tunefs_opt"] = tmp; p["fs_options"] = union(p["fs_options"]:$[], convertStringToFsOptionMap( tmp, p["detected_fs"]:`unknown, `tunefs )); } tmp = LibStorage::VolumeInfo::swig_dtxt_get(vinfo); if( size(tmp)>0 ) p["dtxt"] = tmp; tmp = LibStorage::VolumeInfo::swig_uuid_get(vinfo); if( size(tmp)>0 ) p["uuid"] = tmp; tmp = LibStorage::VolumeInfo::swig_label_get(vinfo); if( size(tmp)>0 ) p["label"] = tmp; t = LibStorage::VolumeInfo::swig_encryption_get(vinfo); if( t!=LibStorage::ENC_NONE() ) { p["enc_type"] = toSymbol( conv_encryption, t ); } tbool = LibStorage::VolumeInfo::swig_resize_get(vinfo); if( tbool ) { p["resize"] = true; p["orig_size_k"] = LibStorage::VolumeInfo::swig_OrigSizeK_get(vinfo); } tbool = LibStorage::VolumeInfo::swig_ignore_fs_get(vinfo); if( tbool ) p["ignore_fs"] = true; tmp = LibStorage::VolumeInfo::swig_loop_get(vinfo); if( size(tmp)>0 ) p["loop"] = tmp; return( p ); } map partAddMap( any info, map p ) { p["nr"] = LibStorage::PartitionAddInfo::swig_nr_get(info); p["fsid"] = LibStorage::PartitionAddInfo::swig_id_get(info); p["fstype"] = Partitions::FsIdToString( p["fsid"]:0 ); p["region"] = [ LibStorage::PartitionAddInfo::swig_cylStart_get(info), LibStorage::PartitionAddInfo::swig_cylSize_get(info) ]; integer t = LibStorage::PartitionAddInfo::swig_partitionType_get(info); p["type"] = toSymbol( conv_ptype, t ); boolean boot = LibStorage::PartitionAddInfo::swig_boot_get(info); if( boot ) p["boot"] = true; string tmp = LibStorage::PartitionAddInfo::swig_udevId_get(info); if( size(tmp)>0 ) p["udev_id"] = splitstring( tmp, " " ); tmp = LibStorage::PartitionAddInfo::swig_udevPath_get(info); if( size(tmp)>0 ) p["udev_path"] = tmp; y2milestone( "partAddMap ret:%1", p ); return( p ); } map dmPartMap( any info, map p ) { any vinfo = LibStorage::DmPartInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["nr"] = 0; boolean part = LibStorage::DmPartInfo::swig_part_get(info); if( part ) { any pinfo = LibStorage::DmPartInfo::swig_p_get(info); p = partAddMap( pinfo, p ); } y2milestone( "dmPartMap ret:%1", p ); return( p ); } map mdPartMap(any info, map p) { any vinfo = LibStorage::MdPartInfo::swig_v_get(info); p = volumeMap(vinfo, p); p["nr"] = 0; boolean part = LibStorage::MdPartInfo::swig_part_get(info); if (part) { any pinfo = LibStorage::MdPartInfo::swig_p_get(info); p = partAddMap(pinfo, p); } y2milestone("mdPartMap ret:%1", p); return p; } map getContainerInfo( map c ) { y2milestone( "getContainerInfo %1", c ); integer ret = 0; integer t = 0; any vinfo = LibStorage::VolumeInfo::new("LibStorage::VolumeInfo"); if( c["type"]:`CT_UNKNOWN == `CT_DISK ) { list pinfos = []; any infos = LibStorage::DiskInfo::new("LibStorage::DiskInfo"); string d = c["device"]:""; ret = LibStorage::StorageInterface::getDiskInfo( sint, d, infos ); if( ret==0 ) { c = diskMap( infos, c ); } else y2warning( "disk \"%1\" ret:%2", c["device"]:"", ret ); c["partitions"] = []; ret = LibStorage::StorageInterface::getPartitionInfo( sint, d, pinfos ); foreach( any info, pinfos, ``{ string tmp = ""; map p = $[]; vinfo = LibStorage::PartitionInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["nr"] = LibStorage::PartitionInfo::swig_nr_get(info); p["fsid"] = LibStorage::PartitionInfo::swig_id_get(info); p["fstype"] = Partitions::FsIdToString( p["fsid"]:0 ); p["region"] = [ LibStorage::PartitionInfo::swig_cylStart_get(info), LibStorage::PartitionInfo::swig_cylSize_get(info) ]; t = LibStorage::PartitionInfo::swig_partitionType_get(info); p["type"] = toSymbol( conv_ptype, t ); boolean boot = LibStorage::PartitionInfo::swig_boot_get(info); if( boot ) p["boot"] = true; tmp = LibStorage::PartitionInfo::swig_udevId_get(info); if( size(tmp)>0 ) p["udev_id"] = splitstring( tmp, " " ); tmp = LibStorage::PartitionInfo::swig_udevPath_get(info); if( size(tmp)>0 ) p["udev_path"] = tmp; c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_DMRAID ) { list pinfos = []; any infos = LibStorage::DmraidCoInfo::new("LibStorage::DmraidCoInfo"); string d = c["device"]:""; ret = LibStorage::StorageInterface::getDmraidCoInfo( sint, d, infos ); if( ret==0 ) { any pinfo = LibStorage::DmraidCoInfo::swig_p_get( infos ); c = dmPartCoMap( pinfo, c ); } else y2warning( "disk \"%1\" ret:%2", c["device"]:"", ret ); c["partitions"] = []; ret = LibStorage::StorageInterface::getDmraidInfo( sint, d, pinfos ); foreach( any info, pinfos, ``{ any pinfo = LibStorage::DmraidInfo::swig_p_get( info ); map p = $[]; p = dmPartMap( pinfo, p ); p["fstype"] = Partitions::dmraid_name; if( p["nr"]:-1 != 0 ) c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_DMMULTIPATH ) { list pinfos = []; any infos = LibStorage::DmmultipathCoInfo::new("LibStorage::DmmultipathCoInfo"); string d = c["device"]:""; ret = LibStorage::StorageInterface::getDmmultipathCoInfo( sint, d, infos ); if( ret==0 ) { any pinfo = LibStorage::DmmultipathCoInfo::swig_p_get( infos ); c = dmPartCoMap( pinfo, c ); } else y2warning( "disk \"%1\" ret:%2", c["device"]:"", ret ); c["partitions"] = []; ret = LibStorage::StorageInterface::getDmmultipathInfo( sint, d, pinfos ); foreach( any info, pinfos, ``{ any pinfo = LibStorage::DmmultipathInfo::swig_p_get( info ); map p = $[]; p = dmPartMap( pinfo, p ); p["fstype"] = Partitions::dmmultipath_name; if( p["nr"]:-1 != 0 ) c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_MDPART ) { list pinfos = []; any infos = LibStorage::MdPartCoInfo::new("LibStorage::MdPartCoInfo"); string d = c["device"]:""; ret = LibStorage::StorageInterface::getMdPartCoInfo(sint, d, infos); if (ret == 0) { any dinfo = LibStorage::MdPartCoInfo::swig_d_get(infos); c = diskMap(dinfo, c); } else y2warning( "disk \"%1\" ret:%2", c["device"]:"", ret ); list ls = splitstring(LibStorage::MdPartCoInfo::swig_devices_get(infos), " "); y2milestone( "ls=%1", ls ); c["devices"] = ls; integer t = LibStorage::MdPartCoInfo::swig_level_get(infos); c["raid_type"] = substring(sformat("%1", toSymbol(conv_mdtype, t)), 1); if (c["raid_type"]:"" == "raid5") { t = LibStorage::MdPartCoInfo::swig_parity_get(infos); symbol pt = toSymbol(conv_mdparity, t); if (pt != `par_none) c["parity_algorithm"] = substring(sformat("%1", pt), 1); } t = LibStorage::MdPartCoInfo::swig_chunk_get(infos); if (t > 0) { c["chunk_size"] = t; } c["sb_ver"] = LibStorage::MdPartCoInfo::swig_sb_ver_get(infos); c["partitions"] = []; ret = LibStorage::StorageInterface::getMdPartInfo(sint, d, pinfos); foreach(any info, pinfos, { map p = $[]; p = mdPartMap(info, p); p["fstype"] = Partitions::raid_name; if (p["nr"]:-1 != 0) c["partitions"] = add(c["partitions"]:[], p); }); } else if( c["type"]:`CT_UNKNOWN == `CT_LVM ) { list pinfos = []; any infos = LibStorage::LvmVgInfo::new("LibStorage::LvmVgInfo"); string n = c["name"]:""; ret = LibStorage::StorageInterface::getLvmVgInfo( sint, n, infos ); if( ret==0 ) { c["create"] = LibStorage::LvmVgInfo::swig_create_get(infos); c["size_k"] = LibStorage::LvmVgInfo::swig_sizeK_get(infos); c["cyl_size"] = 1024*LibStorage::LvmVgInfo::swig_peSize_get(infos); c["pesize"] = 1024*LibStorage::LvmVgInfo::swig_peSize_get(infos); c["cyl_count"] = LibStorage::LvmVgInfo::swig_peCount_get(infos); c["pe_free"] = LibStorage::LvmVgInfo::swig_peFree_get(infos); c["lvm2"] = LibStorage::LvmVgInfo::swig_lvm2_get(infos); list ls = splitstring( LibStorage::LvmVgInfo::swig_devices_get(infos), " " ); y2milestone( "ls=%1", ls ); c["devices"] = ls; ls = splitstring( LibStorage::LvmVgInfo::swig_devices_add_get(infos), " " ); if( size(ls)>0 ) c["devices_add"] = ls; ls = splitstring( LibStorage::LvmVgInfo::swig_devices_rem_get(infos), " " ); if( size(ls)>0 ) c["devices_rem"] = ls; } else y2warning( "LVM Vg \"%1\" ret:%2", c["name"]:"", ret ); ret = LibStorage::StorageInterface::getLvmLvInfo( sint, n, pinfos ); foreach( any info, pinfos, ``{ map p = $[]; vinfo = LibStorage::LvmLvInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["stripes"] = LibStorage::LvmLvInfo::swig_stripe_get(info); t = LibStorage::LvmLvInfo::swig_stripe_size_get(info); if( t>0 ) p["stripesize"] = t; p["type"] = `lvm; p["fstype"] = Partitions::lv_name; c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_MD ) { list pinfos = []; ret = LibStorage::StorageInterface::getMdInfo( sint, pinfos ); if( ret<0 ) y2warning( "getMdInfo ret:%1", ret ); foreach( any info, pinfos, ``{ map p = $[]; vinfo = LibStorage::MdInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["nr"] = LibStorage::MdInfo::swig_nr_get(info); integer t = LibStorage::MdInfo::swig_type_get(info); p["raid_type"] = substring( sformat( "%1", toSymbol( conv_mdtype, t )), 1 ); if( p["raid_type"]:""=="raid5" ) { t = LibStorage::MdInfo::swig_parity_get(info); symbol pt = toSymbol( conv_mdparity, t ); if( pt != `par_none ) p["parity_algorithm"] = substring( sformat( "%1", pt), 1 ); } p["type"] = `sw_raid; p["fstype"] = Partitions::raid_name; t = LibStorage::MdInfo::swig_chunk_get(info); if( t>0 ) { p["chunk_size"] = t; } string d = LibStorage::MdInfo::swig_sb_ver_get(info); p["sb_ver"] = d; list ls = splitstring( LibStorage::MdInfo::swig_devices_get(info), " " ); p["devices"] = ls; c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_LOOP ) { list pinfos = []; ret = LibStorage::StorageInterface::getLoopInfo( sint, pinfos ); if( ret<0 ) y2warning( "getLoopInfo ret:%1", ret ); foreach( any info, pinfos, ``{ map p = $[]; vinfo = LibStorage::LoopInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["nr"] = LibStorage::LoopInfo::swig_nr_get(info); p["type"] = `loop; p["fstype"] = Partitions::loop_name; p["fpath"] = LibStorage::LoopInfo::swig_file_get(info); p["create_file"] = !LibStorage::LoopInfo::swig_reuseFile_get(info); if( p["enc_type"]:`unknown != `luks ) p["device"] = p["loop"]:""; c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_DM ) { list pinfos = []; ret = LibStorage::StorageInterface::getDmInfo( sint, pinfos ); if( ret<0 ) y2warning( "getDmInfo ret:%1", ret ); foreach( any info, pinfos, ``{ map p = $[]; vinfo = LibStorage::DmInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["nr"] = LibStorage::DmInfo::swig_nr_get(info); p["type"] = `dm; p["fstype"] = Partitions::dm_name; c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_NFS ) { list pinfos = []; y2milestone( "before getNfsInfo" ); ret = LibStorage::StorageInterface::getNfsInfo( sint, pinfos ); y2milestone( "after getNfsInfo" ); if( ret<0 ) y2warning( "getNfsInfo ret:%1", ret ); foreach( any info, pinfos, ``{ map p = $[]; vinfo = LibStorage::NfsInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["type"] = `nfs; p["fstype"] = Partitions::nfs_name; c["partitions"] = add( c["partitions"]:[], p ); }); } //y2milestone ("getContainerInfo container %1", remove( c, "partitions" ) ); y2milestone ("getContainerInfo container %1", c ); return( c ); } map toDiskMap( map disk, map cinfo ) { list l = [ "size_k", "cyl_size", "cyl_count", "label", "max_logical", "max_primary", "type", "readonly", "used_by_type", "used_by", "used_by_device", "partitions", "dasdfmt", "udev_id", "udev_path" ]; foreach( string s, l, ``{ if( haskey( cinfo, s ) ) disk[s] = cinfo[s]:(any)0; else if( haskey( disk, s )) disk = remove( disk, s ); }); return( disk ); } list getContainers() ``{ list ret = []; list cinfos = []; LibStorage::StorageInterface::getContainers( sint, cinfos ); foreach( any info, cinfos, ``{ map c = $[]; c["name"] = LibStorage::ContainerInfo::swig_name_get(info); c["device"] = LibStorage::ContainerInfo::swig_device_get(info); integer t = LibStorage::ContainerInfo::swig_type_get(info); c["type"] = toSymbol( conv_ctype, t ); t = LibStorage::ContainerInfo::swig_usedByType_get(info); if( t!=LibStorage::UB_NONE() ) { c["used_by_type"] = toSymbol( conv_usedby, t ); c["used_by"] = LibStorage::ContainerInfo::swig_usedByName_get(info); c["used_by_device"] = LibStorage::ContainerInfo::swig_usedByDevice_get(info); } boolean b = LibStorage::ContainerInfo::swig_readonly_get(info); if( b ) c["readonly"] = true; ret = add( ret, c ); }); y2milestone( "getContainers ret:%1", ret ); return( ret ); }; integer count=0; global boolean IsDiskType(symbol t) { return contains([ `CT_DISK, `CT_DMRAID, `CT_DMMULTIPATH, `CT_MDPART ], t); } /** * Updates target map * * @see GetTargetMap() */ global void UpdateTargetMap() { conts = getContainers(); list rem_keys = []; map tg = StorageMap[targets_key]:$[]; //SCR::Write(.target.ycp, "/tmp/upd_all_bef_"+sformat("%1",count), StorageMap[targets_key]:$[] ); foreach( string dev, map disk, tg, ``{ map c = $[]; c = find( map c, conts, ``(c["device"]:""==dev) ); if( c==nil ) rem_keys = add( rem_keys, dev ); else if (IsDiskType(c["type"]:`CT_UNKNOWN)) { tg[dev] = toDiskMap( tg[dev]:$[], getContainerInfo( c ) ); } else { tg[dev] = getContainerInfo(c); } y2milestone( "UpdateTargetMap dev:%1 is:%2", dev, tg[dev]:$[] ); }); y2milestone( "UpdateTargetMap rem_keys:%1", rem_keys ); foreach( string dev, rem_keys, ``{tg=remove(tg,dev);}); foreach( map c, conts, ``{ if( c["type"]:`CT_UNKNOWN!=`CT_DISK && !haskey( tg, c["device"]:"" )) { tg[c["device"]:""] = getContainerInfo(c); y2milestone( "UpdateTargetMap dev:%1 is:%2", c["device"]:"", tg[c["device"]:""]:$[] ); } }); StorageMap[targets_key] = tg; //SCR::Write(.target.ycp, "/tmp/upd_all_aft_"+sformat("%1",count), StorageMap[targets_key]:$[] ); //count = count+1; } define void UpdateTargetMapDisk( string dev ) { y2milestone( "UpdateTargetMapDisk" ); conts = getContainers(); map c = $[]; c = find( map c, conts, ``(c["device"]:""==dev) ); map tg = StorageMap[targets_key]:$[]; //SCR::Write(.target.ycp, "/tmp/upd_disk_bef_"+sformat("%1",count), StorageMap[targets_key]:$[] ); if( c==nil ) { if( haskey( tg, dev ) ) tg = remove( tg, dev ); } else if (IsDiskType(c["type"]:`CT_UNKNOWN)) { tg[dev] = toDiskMap( tg[dev]:$[], getContainerInfo( c ) ); } else { tg[dev] = getContainerInfo(c); } StorageMap[targets_key] = tg; //SCR::Write(.target.ycp, "/tmp/upd_disk_aft_"+sformat("%1",count), StorageMap[targets_key]:$[] ); //count = count+1; } define void UpdateTargetMapDev( string dev ) { y2milestone( "UpdateTargetMapDev %1", dev ); map tg = StorageMap[targets_key]:$[]; //SCR::Write(.target.ycp, "/tmp/upd_dev_bef_"+sformat("%1",count), tg ); string cdev=""; foreach( string key, map d, tg, ``{ if( size(cdev)==0 && find( map p, d["partitions"]:[], ``(p["device"]:""==dev))!=nil ) cdev = d["device"]:""; }); y2milestone( "UpdateTargetMapDev cdev %1", cdev ); map c = $[]; c = find( map c, conts, ``(c["device"]:""==cdev) ); map disk = $[]; if( c!=nil ) { disk = getContainerInfo( c ); } if( c!=nil && haskey( tg, cdev )) { list partitions = tg[cdev,"partitions"]:[]; boolean found = false; partitions = maplist( map p, partitions, ``{ if( p["device"]:"" == dev ) { map pp = find( map q, disk["partitions"]:[], ``(q["device"]:""==dev)); if( pp!=nil ) { found = true; p = pp; } } return( p ); }); tg[disk["device"]:"","partitions"] = partitions; if( !found ) y2error( "UpdateTargetMapDev not found %1", dev ); } else y2error( "UpdateTargetMapDev key %1 not found in target", disk["device"]:"" ); StorageMap[targets_key] = tg; //SCR::Write(.target.ycp, "/tmp/upd_dev_aft_"+sformat("%1",count), StorageMap[targets_key]:$[] ); //count = count+1; } /** * Returns map with disk info * * @param string device * @param map disk * @return map disk info */ global define map getDiskInfo( string device, map disk ) { map c = $[]; c = find( map p, conts, ``(p["device"]:""==device )); if( c==nil ) { map tmp = GetDiskPartition( device ); y2milestone( "getDiskInfo map %1", tmp ); if( tmp["disk"]:"" != device ) c = find( map p, conts, ``(p["device"]:""==tmp["disk"]:"" )); } y2milestone( "getDiskInfo c:%1", c ); if( c!=nil ) { disk = toDiskMap( disk, getContainerInfo( c ) ); y2milestone( "getDiskInfo ret:%1", haskey(disk,"partitions")?remove(disk,"partitions"):disk ); } return( disk ); } global define void SaveExitKey( symbol key ) ``{ if( key == `next || key == `back ) { exit_key = key; y2milestone( "Exit Key %1", exit_key ); } }; global define symbol GetExitKey() ``{ return( exit_key ); }; /** * Finds and returns fstab entry * * @param map fstab * @param string mount * @param string device * @param string uuid * @param string label * @return map fstab entry * * @example * FindFstabEntry ($[], "", "", "", "") * * @struct * $[ * "spec" : "...", * "file" : "...", * "vfstype" : "...", * "mntops" : "...", * "freq" : ..., * "passno" : ..., * ] */ /* global define map FindFstabEntry( map fstab, string mount, string device, string uuid, string label ) { map ret = $[]; list lines = []; lines = FindFstabLines( fstab, mount, device, uuid, label ); y2milestone( "mount=%1 device=%2 uuid=%3 label=%4", mount, device, uuid, label ); if( size(lines)>0 ) { map entry = AsciiFile::GetLine( fstab, lines[0]:-1 ); ret = $[ "spec" : entry["fields",0]:"", "file" : entry["fields",1]:"", "vfstype" : entry["fields",2]:"", "mntops" : entry["fields",3]:"", "freq" : entry["fields",4]:0, "passno" : entry["fields",5]:0 ]; } y2milestone( "ret:%1", ret ); return( ret ); } */ /** * Returns map describing the disk target * * @return map */ global define map< string, map > GetOndiskTarget() { list keys = [ "mount", "enc_type", "mountby", "fstopt", "used_fs", "format" ]; map ret = GetTargetMap(); foreach( string d, map disk, ret, ``{ list pl = maplist( map p, disk["partitions"]:[], ``( filter( string k, any e, p, ``(!contains(keys,k))))); pl = maplist( map p, pl, ``({ if( p["detected_fs"]:`unknown!=`unknown ) p["used_fs"] = p["detected_fs"]:`unknown; return(p); })); ret[d,"partitions"] = pl; }); return( ret ); } global define void CreateTargetBackup(string who) { string t = "targetMap_s_" + who + "_" + sformat("%1",count); count = count+1; SCR::Write(.target.ycp, Storage::SaveDumpPath(t), GetTargetMap() ); y2milestone( "CreateTargetBackup who:%1", who ); integer ret = LibStorage::StorageInterface::createBackupState( sint, who ); if( ret<0 ) y2error( "CreateTargetBackup sint ret:%1", ret ); } global define void DisposeTargetBackup(string who) { y2milestone( "DisposeTargetBackup who:%1", who ); integer ret = LibStorage::StorageInterface::removeBackupState( sint, who ); if( ret<0 ) y2error( "DisposeTargetBackup sint ret:%1", ret ); } global define boolean EqualBackupStates( string s1, string s2, boolean vb ) { y2milestone( "EqualBackupStates s1:\"%1\" s2:\"%2\" verbose:%3", s1, s2, vb ); boolean ret = LibStorage::StorageInterface::equalBackupStates( sint, s1, s2, vb ); y2milestone( "EqualBackupStates ret:%1", ret ); return( ret ); } global define void RestoreTargetBackup( string who ) { y2milestone( "RestoreTargetBackup who:%1", who ); integer ret = LibStorage::StorageInterface::restoreBackupState( sint, who ); if( ret<0 ) y2error( "RestoreTargetBackup sint ret:%1", ret ); UpdateTargetMap(); string t = "targetMap_r_" + who; SCR::Write(.target.ycp, Storage::SaveDumpPath(t), GetTargetMap() ); } global define void ResetOndiskTarget() { RestoreTargetBackup( "initial" ); } global define integer GetTargetChangeTime() { return( StorageMap["targets_time"]:0 ); } global define boolean GetPartProposalActive() { return StorageMap[part_proposal_active_key]:true; }; global define void SetPartProposalActive( boolean value ) { StorageMap[part_proposal_active_key] = value; }; global define string GetPartMode() { y2milestone( "GetPartMode %1", StorageMap[part_mode_key]:"" ); return StorageMap[part_mode_key]:""; }; global define void SetPartMode( string value ) { y2milestone( "SetPartMode %1", value ); StorageMap[part_mode_key] = value; }; global define boolean GetCustomDisplay() { return StorageMap[custom_display_key]:false; }; global define void SetCustomDisplay( boolean value ) { StorageMap[custom_display_key] = value; }; global define string GetPartDisk() { return StorageMap[part_disk_key]:""; }; global define void SetPartDisk( string value ) { StorageMap[part_disk_key] = value; }; global define boolean GetTestsuite()``{ return StorageMap[testsuite_key]:false; } global define void SetTestsuite( boolean value ) ``{ StorageMap = add( StorageMap, testsuite_key, value ); } global define string GetDoResize()``{ return StorageMap[do_resize_key]:"NO"; } global define void SetDoResize( string value ) ``{ StorageMap = add( StorageMap, do_resize_key, value ); } global define string GetPartProposalMode()``{ return StorageMap[part_proposal_mode_key]:"accept"; } global define void SetPartProposalMode( string value ) ``{ StorageMap = add( StorageMap, part_proposal_mode_key, value ); } global define boolean GetPartProposalFirst()``{ return StorageMap[part_proposal_first_key]:true; } global define void SetPartProposalFirst( boolean value ) ``{ StorageMap = add( StorageMap, part_proposal_first_key, value ); } global define boolean GetWinDevice()``{ return StorageMap[win_device_key]:false; } global define void SetWinDevice( boolean value ) ``{ StorageMap = add( StorageMap, win_device_key, value ); } global define void InstallCallbacks() { StorageClients::InstallCallbacks(); } // Constructor global define void Storage() ``{ map m = (map)SCR::Execute(.target.bash_output, "date +%s.%N" ); y2milestone( "constructor Storage() time:%1", m["stdout"]:"" ); if( Mode::normal() ) { Storage::SetPartMode( "CUSTOM" ); Storage::SetPartProposalActive( false ); } if( Stage::initial() ) { string inst = (string) SCR::Read( .etc.install_inf.Partition ); if( inst!=nil && size(inst)>0 ) { part_insts = "/dev/" + inst; y2milestone( "Storage .etc.install_inf.Partition \"%1\" part_insts:%2", inst, part_insts ); } Storage::SetPartMode( "CUSTOM" ); Storage::SetPartProposalActive( false ); } InstallCallbacks(); m = (map)SCR::Execute(.target.bash_output, "date +%s.%N" ); y2milestone( "constructor Storage() end time:%1", m["stdout"]:"" ); } /* Dev definitions dev = maindev | subdev maindev = "disk" | "vg" | "md" (raiddev) subdev = "part" | "lv" | "raid" e.g.: "disk" = "/dev/hda" | "dev/sda" | "/dev/hdd" | ... "vg" = "/dev/system" | "dev/group" | ... "md" = "/dev/md" (only) "part" = "1//dev/hda" | "2//dev/sda" | .. "lv" = "usr//dev/system" | "home//dev/system" */ /* Key definitions key = maindevkey | subdevkey + maindevkey maindevkey = key( disk | vg | md ) subdevkey = key( part | lv | raid ) subdevkey = maindevkey + subdevindex | "all" subdevindex = 1 | 2 | "home" | "usr" | .. e.g.: maindevkey = "/dev/hda" | "/dev/md" | "/dev/system" | "all" subdevkey = "1//dev/hda" | "1//dev/md" | "home//dev/system" | "all" */ /* MainDev defines ------------------------------------------------------------------ /* partition_defines -> isDisk */ /* partition_defines -> isRaid */ /* partition_defines -> isLVM */ symbol sw_raid_type_key = `sw_raid; symbol lvm_type_key = `lvm; symbol extended_type_key= `extended; global map NextPartition( string disk, symbol ptype ) { y2milestone( "NextPartition disk:%1 ptype:%2", disk, ptype ); map ret = $[]; integer pt = fromSymbol(conv_ptype,ptype); y2milestone( "NextPartition type:%1 pt:%2", ptype, pt ); integer num = 0; string dev = ""; integer r = LibStorage::StorageInterface::nextFreePartition( sint, disk, pt, num, dev ); if( r<0 ) y2error( "NextPartition ret %1", r ); ret["device"] = dev; ret["nr"] = num; y2milestone( "NextPartition sint ret:%1 map:%2", r, ret ); return( ret ); } global map NextMd() { y2milestone("NextMd"); integer num = 0; string dev = ""; integer r = LibStorage::StorageInterface::nextFreeMd(sint, num, dev); if( r<0 ) y2error("NextMd ret %1", r); map ret = $[ "device" : dev, "nr" : num ]; y2milestone( "NextMd sint ret:%1 map:%2", r, ret ); return ret; } global integer MaxSizeLabelK( map disk ) { integer ret = 0; string tmp = disk["label"]:""; ret = LibStorage::StorageInterface::maxSizeLabelK( sint, tmp ); y2milestone( "MaxSizeLabelK %1 is %2", disk["label"]:"", ret ); return( ret ); } global integer MaxCylLabel( map disk, integer start_cyl ) { integer ret = MaxSizeLabelK(disk); y2milestone( "MaxCylLabel val_k:%1 cyl_size:%2", ret, disk["cyl_size"]:1 ); integer cylk2 = disk["cyl_size"]:1/512; if( cylk2<2 ) cylk2 = 2; y2milestone( "MaxCylLabel val_k:%1 cylk2:%2", ret, cylk2 ); ret = ret*2 / cylk2 - 1; ret = ret + start_cyl; y2milestone( "MaxCylLabel ret:%1", ret ); return( ret ); } /** * Creates a new partition * * @param string disk * @param string device * @param symbol ptype (types?) * @param integer id * @param integer start * @param integer len (bytes|cyls?) * @param symbol mby (one of?) * @return boolean if successful */ global boolean CreatePartition( string disk, string device, symbol ptype, integer id, integer start, integer len, symbol mby ) { y2milestone( "CreatePartition disk:%1 device:%2 ptype:%3 id:%4 start:%5 len:%6 mby:%7", disk, device, ptype, id, start, len, mby ); string cdev = ""; integer pt = fromSymbol(conv_ptype,ptype); y2milestone( "CreatePartition type:%1 pt:%2", ptype, pt ); integer ret = LibStorage::StorageInterface::createPartition( sint, disk, pt, start, len, cdev ); if( device!=cdev ) y2error( "CreatePartition device:%1 cdev:%2", device, cdev ); if( ret<0 ) y2error( "CreatePartition ret %1", ret ); ret = LibStorage::StorageInterface::changePartitionId( sint, device, id ); if( ret<0 ) y2error( "CreatePartition ret %1", ret ); integer tmp = fromSymbol( conv_mountby, mby ); LibStorage::StorageInterface::changeMountBy( sint, device, tmp ); y2milestone( "CreatePartition sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean UpdatePartition( string device, integer start, integer len ) { y2milestone( "UpdatePartition device:%1 start:%2 len:%3", device, start, len ); integer ret = 0; ret = LibStorage::StorageInterface::updatePartitionArea( sint, device, start, len ); if( ret<0 ) y2error( "UpdatePartition sint ret:%1", ret ); UpdateTargetMapDev( device ); return( ret==0 ); } /** * Sets a mountpoint for partition * * @param string device name * @param string mount point * @return boolean if successful */ global boolean SetPartitionMount( string device, string mp ) { y2milestone( "SetPartitionMount device:%1 mp:%2", device, mp ); integer ret = 0; ret = LibStorage::StorageInterface::changeMountPoint( sint, device, mp ); if( ret<0 ) y2error( "SetPartitionMount sint ret:%1", ret ); UpdateTargetMapDev( device ); return( ret==0 ); } /** * Sets whether a partition should be formatted * * @param string device name * @param boolean format (yes,no) * @param symbol filesystem * @return boolean if successful */ global boolean SetPartitionFormat( string device, boolean format, symbol fs ) { y2milestone( "SetPartitionFormat device:%1 format:%2 fs:%3", device, format, fs ); integer ret = 0; integer tmp = fromSymbol( FileSystems::conv_fs, fs ); y2milestone( "SetPartitionFormat fs:%1", tmp ); ret = LibStorage::StorageInterface::changeFormatVolume( sint, device, format, tmp ); if( ret<0 ) y2error( "SetPartitionFormat sint ret:%1", ret ); UpdateTargetMapDev( device ); return( ret==0 ); } /** * Sets partition ID * * @param string device name * @param integer ID * @return boolean if successful * * @see UnchangePartitionId() */ global boolean SetPartitionId( string device, integer id ) { y2milestone( "SetPartitionId device:%1 id:%2", device, id ); integer ret = 0; ret = LibStorage::StorageInterface::changePartitionId( sint, device, id ); if( ret<0 ) y2error( "SetPartitionId sint ret:%1", ret ); UpdateTargetMapDev( device ); return( ret==0 ); } /** * Restores the original partition ID * * @param string device name * @return boolean if succesful * * @see SetPartitionId() */ global boolean UnchangePartitionId( string device ) { y2milestone( "UnchangePartitionId device:%1", device ); integer ret = 0; ret = LibStorage::StorageInterface::forgetChangePartitionId( sint, device ); if( ret<0 ) y2error( "UnchangePartitionId sint ret:%1", ret ); UpdateTargetMapDev( device ); return( ret==0 ); } /** * Sets a new size for volume * * @param string device name * @param string disk * @param integer new_cyls (in cylinders) * @return boolean if successfull */ global boolean ResizePartition(string device, string disk, integer new_cyls) { y2milestone("ResizePartition device:%1 disk:%2 new_cyls:%3", device, disk, new_cyls); integer ret = 0; ret = LibStorage::StorageInterface::resizePartition(sint, device, new_cyls); if (ret < 0) y2error("ResizePartition sint ret:%1", ret); UpdateTargetMapDisk (disk); return ret == 0; } /** * Sets a new size for volume * * @param string device name * @param string disk * @param integer new_size (in kBytes) * @return boolean if successfull */ global boolean ResizeVolume(string device, string disk, integer new_size_k) { y2milestone("ResizeVolume device:%1 disk:%2 new_size_k:%3", device, disk, new_size_k); integer ret = 0; ret = LibStorage::StorageInterface::resizeVolume(sint, device, (new_size_k+1023)/1024); if (ret < 0) y2error("ResizeVolume sint ret:%1", ret); UpdateTargetMapDisk(disk); return ret == 0; } global boolean SetCrypt( string device, boolean crpt, boolean format ) { y2milestone( "SetCrypt device:%1 val:%2 format:%3", device, crpt, format ); boolean is_crypt = false; integer ret = LibStorage::StorageInterface::getCrypt( sint, device, is_crypt ); if( ret==0 && !format && is_crypt==crpt ) y2milestone( "SetCrypt crypt already set" ); else { ret = LibStorage::StorageInterface::setCrypt( sint, device, crpt ); if( ret<0 ) { y2error( "SetCrypt sint ret:%1", ret ); if( !format && crpt ) Popup::Error( sformat(_("Could not set encryption. System error code is %1. The crypt password provided could be incorrect. "), ret )); LibStorage::StorageInterface::forgetCryptPassword( sint, device ); } else y2milestone( "SetCrypt sint ret:%1", ret ); } return( ret==0 ); } integer ChangeDescText( string dev, string txt ) { integer ret = LibStorage::StorageInterface::changeDescText( sint, dev, txt ); return( ret ); } global boolean ChangeVolumeProperties( map part ) { integer ret = 0; integer tmp = 0; boolean changed = false; string ts = ""; string dev = part["device"]:""; any vinfo = LibStorage::VolumeInfo::new("LibStorage::VolumeInfo"); ret = LibStorage::StorageInterface::getVolume( sint, dev, vinfo ); if( ret!=0 ) y2error( "ChangeVolumeProperties device:%1 not found", dev ); map curr = $[]; if( ret==0 ) { curr = volumeMap( vinfo, curr ); } if( ret==0 && part["mount"]:"" != curr["mount"]:"" ) { changed = true; ts = part["mount"]:""; ret = LibStorage::StorageInterface::changeMountPoint( sint, dev, ts ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && part["type"]:`unknown != `extended && (part["format"]:false != curr["format"]:false || part["used_fs"]:`none != curr["used_fs"]:`none) ) { changed = true; tmp = fromSymbol(FileSystems::conv_fs,part["used_fs"]:`none); y2milestone( "ChangeVolumeProperties fs:%1 symbol:%2", tmp, part["used_fs"]:`none ); ret = LibStorage::StorageInterface::changeFormatVolume( sint, dev, part["format"]:false, tmp ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && size(part["mount"]:"")>0 && part["fstopt"]:"" != curr["fstopt"]:"" ) { changed = true; ts = part["fstopt"]:""; ret = LibStorage::StorageInterface::changeFstabOptions( sint, dev, ts ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && size(part["mount"]:"")>0 && part["mountby"]:`id != curr["mountby"]:`id ) { changed = true; tmp = fromSymbol(conv_mountby,part["mountby"]:`device); y2milestone( "ChangeVolumeProperties mby:%1", tmp ); ret = LibStorage::StorageInterface::changeMountBy( sint, dev, tmp ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && part["label"]:"" != curr["label"]:"" ) { changed = true; ts = part["label"]:""; ret = LibStorage::StorageInterface::changeLabelVolume( sint, dev, ts ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && part["format"]:false && convertFsOptionMapToString(part["fs_options"]:$[], `mkfs) != curr["mkfs_opt"]:"" ) { changed = true; ts = convertFsOptionMapToString(part["fs_options"]:$[], `mkfs); y2milestone( "FsOption ts:%1", ts ); ret = LibStorage::StorageInterface::changeMkfsOptVolume( sint, dev, ts ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && part["format"]:false && convertFsOptionMapToString(part["fs_options"]:$[], `tunefs) != curr["tunefs_opt"]:"" ) { changed = true; ts = convertFsOptionMapToString(part["fs_options"]:$[], `tunefs); y2milestone( "FsOption ts:%1", ts ); ret = LibStorage::StorageInterface::changeTunefsOptVolume( sint, dev, ts ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && part["enc_type"]:`none != curr["enc_type"]:`none ) { changed = true; SetCrypt( dev, part["enc_type"]:`none!=`none, part["format"]:false ); } if( ret==0 && part["dtxt"]:"" != curr["dtxt"]:"" ) { changed = true; ret = ChangeDescText( dev, part["dtxt"]:"" ); } if( ret==0 && ((part["resize"]:false && part["region",1]:0 != curr["region",1]:0) || (part["resize"]:false != curr["resize"]:false)) ) { changed = true; string d = part["device"]:""; integer i = part["region",1]:0; if( part["resize"]:false ) { y2milestone( "ChangeVolumeProperties resize to %1 cyl", i ); if( part["ignore_fs"]:false ) ret = LibStorage::StorageInterface::resizePartitionNoFs( sint, d, i ); else ret = LibStorage::StorageInterface::resizePartition( sint, d, i ); } else ret = LibStorage::StorageInterface::forgetResizeVolume( sint, d ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && part["change_fsid"]:false && part["fsid"]:0 != curr["fsid"]:0) { changed = true; string d = part["device"]:""; integer i = part["fsid"]:0; y2milestone( "ChangeVolumeProperties fsid to %1", i ); ret = LibStorage::StorageInterface::changePartitionId( sint, d, i ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 ) { y2debug( "ChangeVolumeProperties changed:%1 part:%2", changed, part ); if( changed ) UpdateTargetMapDev( dev ); } return( ret==0 ); } global boolean DeleteDevice( string disk, string device ) { y2milestone( "DeleteDevice disk:%1 device:%2", disk, device ); integer ret = LibStorage::StorageInterface::removeVolume( sint, device ); if( ret<0 ) y2error( "DeleteDevice sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean DeleteLvmVg( string name ) { y2milestone( "DeleteLvmVg name:%1", name ); integer ret = LibStorage::StorageInterface::removeLvmVg( sint, name ); if( ret<0 ) y2error( "DeleteLvmVg sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean DeleteDmraid( string name ) { y2milestone( "DeleteDmraid name:%1", name ); integer ret = LibStorage::StorageInterface::removeDmraid( sint, name ); if( ret<0 ) y2error( "DeleteDmraid sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean DeleteMdPartCo( string name ) { y2milestone( "DeleteMdPartCo name:%1", name ); integer ret = LibStorage::StorageInterface::removeMdPartCo( sint, name, true ); if( ret<0 ) y2error( "DeleteMdPartCo sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean CreateLvmVg( string name, integer pesize, boolean lvm2 ) { y2milestone( "CreateLvmVg name:%1 pesize:%2 lvm2:%3", name, pesize, lvm2 ); list devs = []; integer ret = 0; ret = LibStorage::StorageInterface::createLvmVg( sint, name, pesize/1024, !lvm2, devs ); if( ret<0 ) y2error( "CreateLvmVg sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean CreateLvmVgWithDevs( string name, integer pesize, boolean lvm2, list devs ) { y2milestone( "CreateLvmVgWithDevs name:%1 pesize:%2 lvm2:%3 devs:%4", name, pesize, lvm2, devs ); integer ret = 0; ret = LibStorage::StorageInterface::createLvmVg( sint, name, pesize/1024, !lvm2, devs ); if( ret<0 ) y2error( "CreateLvmVgWithDevs sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean ExtendLvmVg( string name, string device ) { y2milestone( "ExtendLvmVg name:%1 device:%2", name, device ); integer ret = 0; list devs = [ device ]; ret = LibStorage::StorageInterface::extendLvmVg( sint, name, devs ); if( ret<0 ) y2error( "ExtendLvmVg sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean ReduceLvmVg( string name, string device ) { y2milestone( "ReduceLvmVg name:%1 device:%2", name, device ); integer ret = 0; list devs = [ device ]; ret = LibStorage::StorageInterface::shrinkLvmVg( sint, name, devs ); if( ret<0 ) y2error( "ReduceLvmVg sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean CreateLvmLv( string vgname, string lvname, integer sizeK, integer stripe ) { y2milestone( "CreateLvmLv vg:%1 name:%2 sizeK:%3 stripe:%4", vgname, lvname, sizeK, stripe ); integer ret = 0; string dummy = ""; ret = LibStorage::StorageInterface::createLvmLv( sint, vgname, lvname, (sizeK+1023)/1024, stripe, dummy ); if( ret<0 ) y2error( "CreateLvmLv sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/"+vgname ); return( ret==0 ); } global boolean ChangeLvStripeSize( string vgname, string lvname, integer stripeSize ) { y2milestone( "ChangeLvStripeSize vg:%1 name:%2 stripeSize:%3", vgname, lvname, stripeSize ); integer ret = 0; string dummy = ""; ret = LibStorage::StorageInterface::changeLvStripeSize( sint, vgname, lvname, stripeSize ); if( ret<0 ) y2error( "ChangeLvStripeSize sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/"+vgname ); return( ret==0 ); } global boolean ChangeLvStripeCount( string vgname, string lvname, integer stripes ) { y2milestone( "ChangeLvStripeCount vg:%1 name:%2 stripes:%3", vgname, lvname, stripes ); integer ret = 0; string dummy = ""; ret = LibStorage::StorageInterface::changeLvStripeCount( sint, vgname, lvname, stripes ); if( ret<0 ) y2error( "ChangeLvStripeCount sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/"+vgname ); return( ret==0 ); } global boolean AddNfsVolume( string nfsdev, string opts, integer sz, string mp ) { y2milestone( "AddNfsVolume dev:%1 opts:%2 size:%3 mp:%4", nfsdev, opts, sz, mp ); integer ret = 0; string dummy = ""; ret = LibStorage::StorageInterface::addNfsDevice( sint, nfsdev, opts, sz, mp ); if( ret<0 ) y2error( "AddNfsVolume sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/nfs" ); return( ret==0 ); } global integer CheckNfsVolume( string nfsdev, string opts ) { y2milestone( "CheckNfsVolume dev:%1 opts:%2", nfsdev, opts ); integer ret = 0; integer sz = 0; string dummy = ""; ret = LibStorage::StorageInterface::checkNfsDevice( sint, nfsdev, opts, sz ); if( ret<0 ) y2error( "CheckNfsVolume sint ret:%1", ret ); else ret = sz; y2milestone( "CheckNfsVolume ret:%1", ret ); return( ret ); } global boolean CreateMd( integer nr, string type ) { y2milestone( "CreateMd nr:%1 type:%2", nr, type ); integer ret = 0; integer tmp = conv_mdstring[type]:0; list dummy = []; string rd = sformat("/dev/md%1", nr ); ret = LibStorage::StorageInterface::createMd( sint, rd, tmp, dummy ); if( ret<0 ) y2error( "CreateMd sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/md" ); return( ret==0 ); } global boolean CreateMdWithDevs(integer nr, symbol type, list devices) { y2milestone( "CreateMdWithDevs nr:%1 type:%2 devices:%3", nr, type, devices ); integer ret = 0; integer tmp = LibStorage::RAID_UNK(); foreach(integer k, symbol v, conv_mdtype["m"]:$[], { if (v == type) tmp = k; }); string rd = sformat("/dev/md%1", nr ); ret = LibStorage::StorageInterface::createMd(sint, rd, tmp, devices); if( ret<0 ) y2error( "CreateMdWithDevs sint ret:%1", ret ); UpdateTargetMap(); return ret==0; } global boolean ExtendMd( integer nr, string dev ) { y2milestone( "ExtendMd nr:%1 dev:%2", nr, dev ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); ret = LibStorage::StorageInterface::extendMd( sint, rd, dev ); if( ret<0 ) y2error( "ExtendMd sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean ShrinkMd( integer nr, string dev ) { y2milestone( "ShrinkMd nr:%1 dev:%2", nr, dev ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); ret = LibStorage::StorageInterface::shrinkMd( sint, rd, dev ); if( ret<0 ) y2error( "ShrinkMd sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean ChangeMdType( integer nr, string mdtype ) { y2milestone( "ChangeMdType nr:%1 mdtype:%2", nr, mdtype ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); integer tmp = conv_mdstring[mdtype]:0; ret = LibStorage::StorageInterface::changeMdType( sint, rd, tmp ); if( ret<0 ) y2error( "ChangeMdType sint ret:%1", ret ); UpdateTargetMapDev( rd ); return( ret==0 ); } global boolean ChangeMdParity( integer nr, string ptype ) { y2milestone( "ChangeMdParity nr:%1 parity:%2", nr, ptype ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); integer tmp = conv_parstring[ptype]:0; ret = LibStorage::StorageInterface::changeMdParity( sint, rd, tmp ); if( ret<0 ) y2error( "ChangeMdParity sint ret:%1", ret ); UpdateTargetMapDev( rd ); return( ret==0 ); } global boolean ChangeMdParitySymbol( integer nr, symbol ptype ) { y2milestone( "ChangeMdParitySymbol nr:%1 parity:%2", nr, ptype ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); integer tmp = fromSymbol(conv_mdparity, ptype); ret = LibStorage::StorageInterface::changeMdParity(sint, rd, tmp); if( ret<0 ) y2error( "ChangeMdParitySymbol sint ret:%1", ret ); UpdateTargetMapDev( rd ); return( ret==0 ); } global boolean ChangeMdChunk( integer nr, integer chunk ) { y2milestone( "ChangeMdChunk nr:%1 chunk:%2", nr, chunk ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); ret = LibStorage::StorageInterface::changeMdChunk( sint, rd, chunk ); if( ret<0 ) y2error( "ChangeMdChunk sint ret:%1", ret ); UpdateTargetMapDev( rd ); return( ret==0 ); } global integer CheckMd( integer nr ) { y2milestone( "CheckMd nr:%1", nr ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); ret = LibStorage::StorageInterface::checkMd( sint, rd ); if( ret!=0 ) y2milestone( "CheckMd sint ret:%1", ret ); return( ret ); } global integer ComputeMdSize(symbol md_type, list devices, integer& sizeK) { integer ret = 0; integer tmp = LibStorage::RAID_UNK(); foreach(integer k, symbol v, conv_mdtype["m"]:$[], { if (v == md_type) tmp = k; }); ret = LibStorage::StorageInterface::computeMdSize(sint, tmp, devices, sizeK); if( ret!=0 ) y2milestone( "ComputeMdSize sint ret:%1", ret ); return ret; } global string GetCryptPwd( string device ) { string pwd=""; y2milestone( "GetCryptPwd device:%1", device ); integer ret = 0; ret = LibStorage::StorageInterface::getCryptPassword( sint, device, pwd ); if( ret<0 ) y2error( "GetCryptPwd sint ret:%1", ret ); else y2milestone( "GetCryptPwd empty:%1", size(pwd)==0 ); return( pwd ); } global boolean SetCryptPwd( string device, string pwd ) { y2milestone( "SetCryptPwd device:%1", device ); integer ret = 0; ret = LibStorage::StorageInterface::setCryptPassword( sint, device, pwd ); if( ret<0 ) y2error( "SetCryptPwd sint ret:%1", ret ); else y2milestone( "SetCryptPwd sint ret:%1", ret ); return( ret==0 ); } global boolean NeedCryptPwd( string device ) { boolean ret = false; ret = LibStorage::StorageInterface::needCryptPassword( sint, device ); y2milestone( "NeedCryptPwd device:%1 ret:%2", device, ret ); return( ret ); } global string CreateLoop( string file, boolean create, integer sizeK, string mp ) { y2milestone( "CreateLoop file:%1 create:%2 sizeK:%3 mp:%4", file, create, sizeK, mp ); string dev = ""; integer ret = 0; string pwd = GetCryptPwd( file ); ret = LibStorage::StorageInterface::createFileLoop( sint, file, !create, sizeK, mp, pwd, dev ); if( ret<0 ) y2error( "CreateLoop sint ret:%1", ret ); LibStorage::StorageInterface::forgetCryptPassword( sint, file ); UpdateTargetMapDisk( "/dev/loop" ); y2milestone( "CreateLoop dev:%1", dev ); return( dev ); } /* integer loop_count = 0; global string GetLoopDevice() { y2milestone( "GetLoopDevice" ); string file = Directory::tmpdir + sformat("/dfile_%1", loop_count); string mp = Directory::tmpdir + sformat("/loopmp_%1", loop_count); loop_count = loop_count + 1; string dev = ""; string pwd = "emilemil"; integer ret = LibStorage::StorageInterface::createFileLoop( sint, file, true, 50*1024, mp, pwd, dev ); if( ret<0 ) y2error( "GetLoopDevice sint ret:%1", ret ); LibStorage::StorageInterface::forgetCryptPassword( sint, dev ); y2milestone( "GetLoopDevice dev:%1", dev ); return( dev ); } */ global void UpdateClassified( string key, string pwd ) { LibStorage::StorageInterface::setCryptPassword( sint, key, pwd ); } define void HandleModulesOnBoot( map targetMap ); global boolean UpdateLoop( string dev, string file, boolean create, integer sizeK ) { y2milestone( "UpdateLoop device:%1 file:%2 create:%3 sizeK:%4", dev, file, create, sizeK ); integer ret = LibStorage::StorageInterface::modifyFileLoop( sint, dev, file, !create, sizeK ); if( ret<0 ) y2error( "UpdateLoop sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/loop" ); HandleModulesOnBoot( GetTargetMap() ); return( ret==0 ); } global boolean DeleteLoop( string disk, string file, boolean remove_file ) { y2milestone( "DeleteLoop disk:%1 file:%2 remove_file:%3", disk, file, remove_file ); integer ret = LibStorage::StorageInterface::removeFileLoop( sint, file, remove_file ); if( ret<0 ) y2error( "DeleteLoop sint ret:%1", ret ); UpdateTargetMapDisk( disk ); return( ret==0 ); } global string DefaultDiskLabel(integer size_k) { y2milestone("DefaultDiskLabel size_k:%1", size_k ); string label = LibStorage::StorageInterface::defaultDiskLabelSize(sint, size_k); y2milestone("DefaultDiskLabel label:%1", label); return label; } /** * Delete the partition table and disk label of device * @param string the disk to deleted the partition table from * @return boolean */ global define boolean DeletePartitionTable(string disk, integer size_k) ``{ y2milestone( "DeletePartitionTable %1 size_k:%2", disk, size_k ); string label = LibStorage::StorageInterface::defaultDiskLabelSize( sint, size_k ); y2milestone( "DeletePartitionTable label:%1", label ); integer ret = LibStorage::StorageInterface::destroyPartitionTable( sint, disk, label ); if( ret<0 ) y2error( "DeletePartitionTable sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean CreatePartitionTable(string disk, string label) { y2milestone("CreatePartitionTable %1 label:%2", disk, label); integer ret = LibStorage::StorageInterface::destroyPartitionTable(sint, disk, label); if (ret < 0) y2error("CreatePartitionTable sint ret:%1", ret); UpdateTargetMap(); return ret == 0; } global symbol GetMountBy( string device ); /** * Set the flag if a disk needs to be initialized * @param string the disk to be changed * @return boolean */ global define boolean InitializeDisk(string disk, boolean value) ``{ boolean rbool = true; y2milestone( "InitializeDisk %1 value %2", disk, value ); integer ret = LibStorage::StorageInterface::initializeDisk( sint, disk, value ); if( ret<0 ) { y2error( "InitializeDisk sint ret:%1", ret ); rbool = false; } if( rbool && value ) { map d = GetDisk( GetTargetMap(), disk ); y2milestone( "d:%1", d ); rbool = CreatePartition( disk, disk+"1", `primary, Partitions::fsid_native, 0, d["cyl_count"]:1, GetMountBy( disk+"1" ) ); if( !rbool ) y2error( "InitializeDisk create failed" ); } UpdateTargetMapDisk( disk ); return( rbool ); } global boolean IsPartType(symbol t) { return t == `CT_DMRAID || t == `CT_DMMULTIPATH || t == `CT_DISK || t == `CT_MDPART; } boolean CreateAny( symbol ctype, map d, map& p ) { boolean ret = true; if( IsPartType(ctype) ) { ret = Storage::CreatePartition( d["device"]:"", p["device"]:"", p["type"]:`primary, p["fsid"]:Partitions::fsid_native, p["region",0]:0, p["region",1]:0, p["mountby"]:GetMountBy( p["device"]:"" ) ); } else if( ctype == `CT_MD ) { ret = Storage::CreateMd( p["nr"]:0, p["raid_type"]:"raid1" ); if( ret && haskey( p, "chunk_size" )) Storage::ChangeMdChunk( p["nr"]:0, p["chunk_size"]:4 ); if( ret && p["raid_type"]:""=="raid5" && haskey( p, "parity_algorithm" )) Storage::ChangeMdParity( p["nr"]:0, p["parity_algorithm"]:"" ); foreach( string d, p["devices"]:[], ``{ret=Storage::ExtendMd( p["nr"]:0, d )&&ret;}); } else if( ctype == `CT_LOOP ) { y2milestone( "CreateAny Loop p:%1", p ); string dev = Storage::CreateLoop( p["fpath"]:"", p["create_file"]:false, p["size_k"]:0, p["mount"]:"" ); ret = size(dev)>0; if( ret ) p["device"] = dev; } else if( ctype == `CT_LVM ) { ret = Storage::CreateLvmLv( d["name"]:"", p["name"]:"", p["size_k"]:0, p["stripes"]:1 ); if( ret && p["stripes"]:1>1 && p["stripesize"]:0>0 ) { Storage::ChangeLvStripeSize( d["name"]:"", p["name"]:"", p["stripesize"]:0 ); } } else if( ctype == `CT_NFS ) { ret = Storage::AddNfsVolume( p["device"]:"", p["fstopt"]:"", p["size_k"]:0, p["mount"]:"" ); } y2milestone( "CreateAny ret:%1", ret ); return( ret ); } define boolean IsEfiPartition( map p ) { map m = GetFreeSpace( p["device"]:"", 0, p["used_fs"]:`none, false ); boolean ret = m["efi"]:false; y2milestone( "IsEfiPartition ret:%1", ret ); return( ret ); } /** * Search in the list partitions for windows partitions and add the key * "mount" to the found windows partitions. * @parm partitions the partitions list * @parm primary handle primary or logical partitions * @return list new partitions with windows mountpoints */ define void AddMountPointsForWinParts( list partitions, boolean primary, integer max_prim, integer& foreign_nr ) ``{ if( !Arch::i386 () && !Arch::ia64 () && !Arch::x86_64 () ) return; string foreign_ids = "CDEFGHIJKLMNOPQRSTUVW"; list new_partitions = []; foreach(map partition, partitions, ``{ map new_partition = partition; integer fsid = partition["fsid"]:Partitions::fsid_native; integer partnum = 0; if( haskey( partition, "nr") && is( partition["nr"]:(any)0, integer ) ) { partnum = partition["nr"]:0; } if( !haskey( partition, "mount") && !partition["delete"]:false && ((partnum<=max_prim)==primary) && foreign_nr < 24 && Partitions::IsDosWinNtPartition(fsid) && (!Arch::ia64() || (!IsEfiPartition(partition) && partition["size_k"]:0 >= 1024*1024)) && contains( [`vfat, `ntfs], partition["used_fs"]:`none )) { new_partition["fstopt"] = FileSystems::DefaultFstabOptions(partition); if( contains( Partitions::fsid_dostypes, fsid )) { new_partition["mount"] = "/dos/" + substring (foreign_ids, foreign_nr, 1); foreign_nr = foreign_nr + 1; } else { new_partition["mount"] = "/windows/" + substring (foreign_ids, foreign_nr, 1); foreign_nr = foreign_nr + 1; } ChangeVolumeProperties( new_partition ); y2milestone( "win part %1", new_partition ); } }); }; global define void AddMountPointsForWin( map targets ) ``{ y2milestone( "AddMountPointsForWin called" ); integer foreign_nr = 0; foreach(string disk, map data, targets, ``{ if( !data["hotpluggable"]:false && data["used_by_type"]:`UB_NONE == `UB_NONE ) AddMountPointsForWinParts( data["partitions"]:[], true, data["max_primary"]:4, foreign_nr ); }); foreach(string disk, map data, targets, ``{ if( !data["hotpluggable"]:false && data["used_by_type"]:`UB_NONE == `UB_NONE ) AddMountPointsForWinParts( data["partitions"]:[], false, data["max_primary"]:4, foreign_nr ); }); } /** * Removes ... maps to ... * * @param string device name */ global void RemoveDmMapsTo( string device ) { y2milestone( "RemoveDmMapsTo device:%1", device ); if (!InitLibstorage(false)) return; LibStorage::StorageInterface::removeDmTableTo( sint, device ); } global define boolean CheckSwapable( string dev ) { string cmd = "/sbin/swapon --fixpgsz " + dev; boolean ok = (integer)SCR::Execute(.target.bash, cmd )==0; if( ok ) { cmd = "/sbin/swapoff " + dev; SCR::Execute(.target.bash, cmd ); } y2milestone( "CheckSwapable dev:%1 ret:%2", dev, ok ); return( ok ); } /** * mark swap-partitions with pseudo Mountpoint swap in targetMap * @param target Disk map * @return map modified target */ global define map AddSwapMp( map target ) ``{ list swaps = SwappingPartitions(); y2milestone( "AddSwapMp swaps %1", swaps ); foreach(string diskdev, map disk, target, ``{ disk["partitions"] = maplist(map part, disk["partitions"]:[], ``{ if( (Stage::initial() && !Partitions::IsDosWinNtPartition(part["fsid"]:0) && part["detected_fs"]:`unknown==`swap && !part["old_swap"]:false && search( diskdev, "/dev/evms" )!=0 ) || (contains( swaps, part["device"]:"" ))) { boolean ok = true; if( !contains( swaps, part["device"]:"" )) { ok = CheckSwapable( part["device"]:"" ); y2milestone( "AddSwapMp initial ok:%1", ok ); } if( ok ) { part["mount"] = "swap"; ChangeVolumeProperties( part ); y2milestone( "AddSwapMp %1", part ); } } return( part ); }); target[diskdev] = disk; }); return( target ); } /** * Returns a system target map. * * @return map target map * * @struct * $[ * ... ? * ] */ global map GetTargetMap() { if (!InitLibstorage(false)) return nil; map tmp = $[]; boolean changed = false; if( !probe_done && !Mode::config() ) { map bios_id_raid = $[]; y2milestone ("probing StorageDevices" ); map rename = $[]; tmp = (map)StorageDevices::Probe(true); foreach( string dev, map disk, tmp, ``{ map dtmp = Storage::GetDiskPartitionTg( dev, $[] )[0]:$[]; y2milestone( "probing dev %1 disk %2", dev, dtmp ); if( search( dev, "/dev/dm-" )==0 || search( dev, "/dev/md" )==0 ) { if( size(disk["bios_id"]:"")>0 ) bios_id_raid[dev] = disk["bios_id"]:""; } else if( size(dtmp["disk"]:"")>0 && dev != dtmp["disk"]:"" ) { rename[dev] = dtmp["disk"]:""; y2milestone( "probing rename %1", rename ); } }); tmp = filter( string dev, map disk, tmp, ``(search( dev, "/dev/dm-" )!=0)); tmp = filter( string dev, map disk, tmp, ``(search( dev, "/dev/md" )!=0)); if( size(rename)>0 ) { foreach( string old, string new, rename, ``{ if( haskey( tmp, old )) { tmp[new] = tmp[old]:$[]; tmp = remove( tmp, old ); tmp[new,"device"] = new; y2milestone( "probing old:%1 new:%2", old, tmp[new]:$[] ); } }); } y2milestone ("probing done" ); if( size(tmp)>0 ) { probe_done = true; changed = true; foreach( string dev, map disk, tmp, ``{ disk = getDiskInfo( dev, disk ); integer s = disk["size_k"]:0 * 1024; disk["name"] = disk["dname"]:"" + Storage::ByteToHumanString( s ) + ", " + disk["device"]:"" + ", "; if( size( disk["vendor"]:"")>0 ) disk["name"] = disk["name"]:"" + disk["vendor"]:"" + "-"; disk["name"] = disk["name"]:"" + disk["model"]:""; if( haskey( disk, "dname" )) disk = remove( disk, "dname" ); tmp[dev] = disk; if( disk["dasdfmt"]:false ) Storage::InitializeDisk( dev, true ); }); foreach( map c, conts, ``{ if( c["type"]:`CT_UNKNOWN!=`CT_DISK ) tmp[c["device"]:""] = getContainerInfo( c ); }); if( size(bios_id_raid)>0 ) { y2milestone( "bios_id_raid:%1", bios_id_raid ); foreach( string dm, string bios, bios_id_raid, { integer pos = findfirstof( dm, "0123456789" ); integer minor = tointeger( substring( dm, pos )); y2milestone( "pos:%1 minor:%2", pos, minor ); foreach (string dev, map c, tmp, { if (c["type"]:`CT_UNKNOWN == `CT_DMRAID && c["minor"]:0 == minor) { y2milestone("addind bios_id %1 to %2", bios, dev); tmp[dev, "bios_id"] = bios; } if (c["type"]:`CT_UNKNOWN == `CT_MDPART && c["device"]:"" == dm) { y2milestone("addind bios_id %1 to %2", bios, dev); tmp[dev, "bios_id"] = bios; } }); }); } StorageMap[targets_key] = tmp; } } if( changed ) { tmp = StorageMap[targets_key]:$[]; SCR::Write(.target.ycp, Storage::SaveDumpPath("targetMap_i"), tmp ); y2milestone ("AddSwapMp" ); tmp = AddSwapMp( tmp ); CreateTargetBackup( "initial" ); if( (Stage::initial() || Mode::repair()) && !Mode::autoinst() ) { AddMountPointsForWin( tmp ); } StorageMap[targets_key] = GetTargetMap(); SCR::Write(.target.ycp, Storage::SaveDumpPath("targetMap_ii"), tmp ); y2milestone ("changed done" ); } map ret = StorageMap[targets_key]:$[]; if (changed) y2milestone("GetTargetMap changed:%1 ret:%2", changed, ret); else y2debug("GetTargetMap changed:%1 ret:%2", changed, ret); return ret; } global void SetRecursiveRemoval( boolean val ) { y2milestone( "SetRecursiveRemoval val:%1", val ); LibStorage::StorageInterface::setRecursiveRemoval( sint, val ); } global boolean GetRecursiveRemoval() { return( LibStorage::StorageInterface::getRecursiveRemoval( sint )); } global define void SetTargetMap( map target ) { y2milestone( "SetTargetMap" ); if( !GetRecursiveRemoval() ) SetRecursiveRemoval(true); //SCR::Write(.target.ycp, Storage::SaveDumpPath("targetMap_set_"+sformat("%1",count)), target ); //count = count+1; CreateTargetBackup("tmp_set"); map tg = GetTargetMap(); list keys = maplist( string k, any e, target, ``(k)); foreach( string k, keys, ``{ if( target[k,"delete"]:false && haskey( tg, k ) ) { if( target[k,"type"]:`CT_UNKNOWN==`CT_LVM ) { DeleteLvmVg( target[k,"name"]:"" ); target[k,"delete"] = false; } else if( target[k,"type"]:`CT_UNKNOWN==`CT_DMRAID ) { DeleteDmraid( k ); target[k,"delete"] = false; } } }); keys = maplist( string k, any e, target, ``(k)); y2milestone( "SetTargetMap keys %1", keys ); list t1 = filter( string k, keys, ``(!target[k,"delete"]:false&& !target[k,"create"]:false)); foreach( string k, t1, ``{ list dps = filter( map p, target[k,"partitions"]:[], ``(!p["create"]:false&&!p["delete"]:false)); if( size(dps)>0 ) { foreach( map p, dps, ``{ if( p["type"]:`primary != `extended || p["resize"]:false ) ChangeVolumeProperties( p ); }); } }); keys = maplist( string k, any e, tg, ``(k)); keys = sort( string a, string b, keys, ``( type_order[tg[a,"type"]:`CT_UNKNOWN]:9 > type_order[tg[b,"type"]:`CT_UNKNOWN]:9 )); y2milestone( "SetTargetMap keys %1", keys ); foreach( string k, keys, ``{ list dps = filter( map p, tg[k,"partitions"]:[], ``(p["create"]:false)); if( size(dps)>1 && haskey( dps[0]:$[], "nr" )) { dps = sort( map a, map b, dps, ``(a["nr"]:0>b["nr"]:0)); y2milestone( "SetTargetMap dps:%1", dps ); } foreach( map p, dps, ``{DeleteDevice( k, p["device"]:"" );}); if( tg[k,"create"]:false ) { if( tg[k,"type"]:`CT_UNKNOWN==`CT_LVM ) DeleteLvmVg( tg[k,"name"]:"" ); } else if( !tg[k,"delete"]:false ) { if( tg[k,"type"]:`CT_UNKNOWN==`CT_LVM && size(target[k,"devices_add"]:[])>0 ) { list ls = target[k,"devices_add"]:[]; foreach( string d, ls, ``{Storage::ReduceLvmVg( target[k,"name"]:"", d );}); } } }); keys = maplist( string k, any e, target, ``(k)); keys = sort( string a, string b, keys, ``( type_order[target[a,"type"]:`CT_UNKNOWN]:9 > type_order[target[b,"type"]:`CT_UNKNOWN]:9 )); y2milestone( "SetTargetMap keys %1", keys ); foreach( string k, keys, ``{ list dps = filter( map p, target[k,"partitions"]:[], ``(p["delete"]:false)); if( size(dps)>1 && haskey( dps[0]:$[], "nr" )) { dps = sort( map a, map b, dps, ``(a["nr"]:0>b["nr"]:0)); } foreach( map p, dps, ``{ if( size(p["dtxt"]:"")>0 ) ChangeDescText( p["device"]:"", p["dtxt"]:"" ); DeleteDevice( k, p["device"]:"" ); }); if( target[k,"delete"]:false ) { if( target[k,"type"]:`CT_UNKNOWN==`CT_LVM ) DeleteLvmVg( target[k,"name"]:"" ); else if( target[k,"type"]:`CT_UNKNOWN==`CT_DISK ) DeletePartitionTable( k, target[k,"size_k"]:0 ); else if( target[k,"type"]:`CT_UNKNOWN==`CT_DMRAID ) DeleteDmraid( k ); } if( target[k,"del_ptable"]:false && IsPartType( target[k,"type"]:`CT_UNKNOWN ) ) { DeletePartitionTable( k, target[k,"size_k"]:0 ); } }); keys = maplist( string k, any e, target, ``(k)); keys = sort( string a, string b, keys, ``( type_order[target[a,"type"]:`CT_UNKNOWN]:9 < type_order[target[b,"type"]:`CT_UNKNOWN]:9 )); y2milestone( "SetTargetMap keys %1", keys ); foreach( string k, keys, ``{ if( target[k,"create"]:false ) { if( target[k,"type"]:`CT_UNKNOWN==`CT_LVM ) { CreateLvmVg( target[k,"name"]:"", target[k,"pesize"]:0, target[k,"lvm2"]:true ); list ls = (list)union( target[k,"devices"]:[], target[k,"devices_add"]:[] ); foreach( string d, ls, ``{Storage::ExtendLvmVg( target[k,"name"]:"", d );}); } } if( !target[k,"delete"]:false && !target[k,"create"]:false ) { if( target[k,"type"]:`CT_UNKNOWN==`CT_LVM && size(target[k,"devices_add"]:[])>0 ) { list ls = target[k,"devices_add"]:[]; foreach( string d, ls, ``{Storage::ExtendLvmVg( target[k,"name"]:"", d );}); } } list dps = filter( map p, target[k,"partitions"]:[], ``(!p["delete"]:false&&p["create"]:false) ); if( size(dps)>1 && haskey( dps[0]:$[], "nr" )) dps = sort( map a, map b, dps, ``(a["nr"]:0 target map * * @see GetTargetMap(); */ global map ReReadTargetMap() { boolean need_reread = sint != nil; if (!InitLibstorage(false)) return nil; y2milestone("start reread need_reread:%1", need_reread); probe_done = false; if (need_reread) LibStorage::StorageInterface::rescanEverything(sint); conts = getContainers(); return GetTargetMap(); } /** * Apply storage changes * * @return integer */ global integer CommitChanges() { y2milestone( "CommitChanges" ); integer ret = LibStorage::StorageInterface::commit( sint ); if( ret<0 ) y2error( "CommitChanges sint ret:%1", ret ); return( ret ); } global string DeviceMounted( string dev ) { string ret = ""; LibStorage::StorageInterface::checkDeviceMounted( sint, dev, ret ); if( size(ret)>0 ) y2milestone( "DeviceMounted %1 at %2", dev, ret ); return( ret ); } /** * Umounts a device * * @param string device name * @return boolean if successful * * @see Mount() */ global boolean Umount( string dev ) { boolean ret = LibStorage::StorageInterface::umountDevice( sint, dev ); y2milestone( "Umount %1 ret %2", dev, ret ); return( ret ); } /** * Mounts a device * * @param string device name * @param string mount point * @param fstopt mount options * @return boolean if successful * * @see Umount() */ global boolean MountOpt( string dev, string mp, string fstopt ) { boolean ret = LibStorage::StorageInterface::mountDeviceRo( sint, dev, mp, fstopt ); y2milestone( "MountOpt %1 to %2 with %3 ret %4", dev, mp, fstopt, ret ); return( ret ); } /** * Mounts a device * * @param string device name * @param string mount point * @return boolean if successful * * @see Umount() */ global boolean Mount( string dev, string mp ) { return( MountOpt( dev, mp, "" ) ); } global define map DetectHomeFs( map p ) { y2milestone( "DetectHomeFs p:%1", p ); map ret = $[]; boolean home = false; list poss_fs = [ `ext2, `ext3, `reiser, `xfs, `jfs ]; if( !p["created"]:false && contains( poss_fs, p["detected_fs"]:`unknown ) && size(p["device"]:"")>0 ) { boolean mount_ok = false; string tmpdir = (string)SCR::Read(.target.tmpdir) + "/hmp"; SCR::Execute(.target.mkdir, tmpdir ); string fsto = FileSystems::DefaultFstabOptions( p ); mount_ok = Storage::MountOpt( p["device"]:"", tmpdir, fsto ); if( !mount_ok ) mount_ok = Storage::Mount( p["device"]:"", tmpdir ); else ret["fstopt"] = fsto; if( mount_ok ) { list skip = [ ".", "..", "root" ]; list tfile = [ ".profile", ".ssh", ".bashrc", ".kde2", ".gnome2", ".kde", ".gnome" ]; list files = (list)SCR::Read (.target.dir, tmpdir); y2milestone( "DetectHomeFs files:%1", files ); integer count=0; while( !home && count0; i = i+1; } } count = count+1; } Storage::Umount( p["device"]:"" ); } SCR::Execute( .target.bash, "rmdir " + tmpdir ); } ret["ishome"] = home; y2milestone( "DetectHomeFs ret:%1", ret ); return( ret ); } global define map SetVolOptions( map p, string mnt, symbol fs, string fs_opts, string fstab_opts, string label ) { y2milestone( "SetVolOptions p:%1", p ); y2milestone( "SetVolOptions mount:%1 fs:%2 fs_opt:%3 fst_opt:%4 label:%5", mnt, fs, fs_opts, fstab_opts, label ); map ret = p; if( size(mnt)>0 ) ret["mount"] = mnt; if( fs!=nil && fs!=`unknown ) ret["used_fs"] = fs; else { if( mnt==Partitions::BootMount() ) ret["used_fs"] = Partitions::DefaultBootFs(); else ret["used_fs"] = Partitions::DefaultFs(); } if( ret["used_fs"]:`unknown == `unknown || ret["used_fs"]:`unknown == `none ) ret["format"] = false; else ret["format"] = true; if( ret["format"]:false && !ret["create"]:false && ret["detected_fs"]:`unknown != `unknown && mnt=="/home" ) { boolean lvm = p["type"]:`primary == `lvm; map h = DetectHomeFs( ret ); if( ( lvm && ret["name"]:""=="home") || (!lvm && h["ishome"]:false ) ) { ret["format"] = false; ret["used_fs"] = ret["detected_fs"]:`unknown; if( size(fstab_opts)==0 ) fstab_opts = h["fstopt"]:""; } } if( ret["format"]:false && !ret["create"]:false && ret["detected_fs"]:`unknown == `swap && mnt=="swap" ) { ret["format"] = false; ret["used_fs"] = `swap; } if( size(fstab_opts)>0 ) ret["fstopt"] = fstab_opts; else ret["fstopt"] = FileSystems::DefaultFstabOptions( ret ); if( size(fs_opts)>0 ) ret["fs_options"] = convertStringToFsOptionMap( fs_opts, ret["used_fs"]:`unknown, `mkfs ); else ret["fs_options"] = FileSystems::DefaultFormatOptions( ret ); if( size(label)>0 ) ret["label"] = label; else if( size(ret["label"]:"")>0 && ret["format"]:false ) ret["label"] = ""; y2milestone( "SetVolOptions ret:%1", ret ); return( ret ); } global boolean CanEdit( map p, boolean verbose ) { boolean ret = true; if( Stage::initial() ) { if( !p["created"]:false && !p["inactive"]:false && p["mount"]:""=="swap" ) { ret = false; y2milestone( "CanEdit p:%1", p ); if( verbose ) { string txt = sformat( _(" Device %1 cannot be modified because it contains activated swap that is needed to run the installation. "), p["device"]:"" ); Popup::Message( txt ); } } if( size(part_insts)>0 && p["device"]:""==part_insts ) { ret = false; y2milestone( "CanEdit part_insts:%1 p:%2", part_insts, p ); if( verbose ) { string txt = sformat( _(" Device %1 cannot be modified because it contains the installation data needed to perform the installation. "), p["device"]:"" ); Popup::Message( txt ); } } } y2milestone( "CanEdit dev:%1 verbose:%2 ret:%3", p["device"]:"", verbose, ret ); return( ret ); } global boolean CanDelete( map p, map disk, boolean verbose ) { string txt = ""; boolean ret = CanEdit( p, false ); if( !ret && verbose ) { if( p["mount"]:""=="swap" ) { txt = sformat( _(" Device %1 cannot be removed because it contains activated swap that is needed to run the installation. "), p["device"]:"" ); } else { txt = sformat( _(" Device %1 cannot be removed because it contains the installation data needed to perform the installation. "), p["device"]:"" ); } Popup::Message( txt ); } if( ret && (p["type"]:`unknown == `logical|| p["type"]:`unknown == `extended) ) { integer num = p["type"]:`unknown == `extended ? 4 : p["nr"]:4; list pl = filter( map q, disk["partitions"]:[], ``( q["type"]:`unknown==`logical && q["nr"]:0 > num )); y2milestone( "CanDelete pl:%1", pl ); integer pos = 0; while( ret && pos vinfos = []; boolean r = LibStorage::StorageInterface::readFstab( sint, dir, vinfos ); if( !r ) y2error( "ReadFstab sint dir %1 ret %2", dir, r ); else { foreach( any info, vinfos, ``{ map p = $[]; p = volumeMap( info, p ); ret = add( ret, p ); }); } y2milestone( "ReadFstab from %1 ret %2", dir, ret ); return( ret ); } global list mountedPartitionsOnDisk( string disk ) { map d = GetDisk( GetTargetMap(), disk ); list ret = filter( map p, d["partitions"]:[], ``(size(DeviceMounted(p["device"]:""))>0)); return( ret ); } global map GetCommitInfo() { any info = LibStorage::CommitInfo::new("LibStorage::CommitInfo"); LibStorage::StorageInterface::getCommitInfo(sint, true, info); map ret = $[ `destructive : LibStorage::CommitInfo::swig_destructive_get(info) ]; return ret; } string save_chtxt = ""; global string ChangeText() { list l = LibStorage::StorageInterface::getCommitActions( sint, true ); string ret = ""; if( size(l)>0 ) ret = HTML::List( l ); if( ret != save_chtxt ) { foreach( string s, l, ``{ y2milestone( "ChangeText %1", s ); }); save_chtxt = ret; } return( ret ); } global string LastAction() { string ret = LibStorage::StorageInterface::getLastAction( sint ); return( ret ); } global string ExtendedErrorMsg() { string ret = LibStorage::StorageInterface::getExtendedErrorMessage( sint ); return( ret ); } global void SetZeroNewPartitions( boolean val ) { y2milestone( "SetZeroNewPartitions val:%1", val ); LibStorage::StorageInterface::setZeroNewPartitions( sint, val ); } /** * GetMountPoints() * collect mountpoint:device as map to get a sorted list * @returns: map of lists, the map key is the mount point, * usually starting with a "/". Exception is "swap" * For directory mount points (key starting with /) the value * is a list [partitionName, fsid, targetdevice, raid_type] * For swap mount points, the value is a list of lists: * [[partitionName, fsid, targetdevice, raid_type], ...] * */ global define map GetMountPoints() ``{ map mountPoints = $[]; list swapPoints = []; map tg = GetTargetMap(); foreach ( string targetdevice, map target, tg, ``{ list partitions = target["partitions"]:[]; foreach (map partition, partitions, ``{ string partitionName = partition["device"]:""; string mountPoint = partition["mount"]:""; integer fsid = partition["fsid"]:0; if (mountPoint != "") { string raid_type = ""; if( partition["type"]:`undefined == `sw_raid ) { raid_type = partition["raid_type"]:""; } // partition has a mount point if (mountPoint == "swap") { swapPoints = add( swapPoints, [partitionName, fsid, targetdevice, raid_type]); } else { mountPoints = add( mountPoints, mountPoint, [partitionName, fsid, targetdevice, raid_type]); } } }); }); if (size (swapPoints) > 0) mountPoints = add (mountPoints, "swap", swapPoints); if( !Stage::initial () ) { list cm = filter(map e, Partitions::CurMounted(), ``(search(e["spec"]:"","/dev/")==0)); foreach(map e, cm, ``{ if( !haskey( mountPoints, e["file"]:"" ) ) { map p = GetPartition( tg, e["spec"]:"" ); if( size(p)>0 ) { string raid_type = ""; if( p["type"]:`undefined == `sw_raid ) { raid_type = p["raid_type"]:""; } map d = GetDiskPartition( e["spec"]:"" ); mountPoints[e["file"]:""] = [ p["device"]:"", p["fsid"]:0, d["disk"]:"", raid_type ]; } } }); } y2milestone( "ret %1", mountPoints ); return mountPoints; } global define string GetIdSmaller( string disk, integer delim ) ``{ string ret = disk; map tg = GetTargetMap(); if( haskey( tg[disk,"partitions",0]:$[], "nr" )) { list ps = filter( map p, tg[disk,"partitions"]:[], ``(p["nr"]:01 ) ps = sort( map a, map b, ps, ``(a["nr"]:0>b["nr"]:0)); if( size(ps)>0 ) ret = ps[0,"device"]:""; } else ret = tg[disk,"partitions",0,"device"]:disk; y2milestone( "GetIdSmaller disk:%1 delim:%2 ret:%3", disk, delim, ret ); return( ret ); } /** * Set in partition to the given and return changed map * * @param map tg * @param string device name * @string key * @string value * @return map changed target map */ global define map SetPartitionData( map tg, string device, string key, any value ) ``{ y2milestone( "SetPartitionData device=%1 key=%2 value=%3", device, key, value ); map tmp = GetDiskPartitionTg( device, tg )[0]:$[]; string disk = tmp["disk"]:""; string dev = GetDeviceName( tmp["disk"]:"", tmp["nr"]:(any)0 ); list r_part = filter(map part, tg[disk,"partitions"]:[], ``(part["device"]:"" != dev )); if( size(r_part)!=size(tg[disk,"partitions"]:[]) ) { map p = filter( map part, tg[disk,"partitions"]:[], ``(part["device"]:"" == dev ))[0]:$[]; if( size(p)>0 ) { p[key] = value; r_part = add( r_part, p ); tg[disk,"partitions"] = r_part; } } return( tg ); } /* remove in partition and return changed map */ global define map DelPartitionData( map tg, string device, string key) ``{ y2debug( "device=%1, key=%2", device, key ); map tmp = GetDiskPartitionTg( device, tg )[0]:$[]; string disk = tmp["disk"]:""; string dev = GetDeviceName( tmp["disk"]:"", tmp["nr"]:(any)0 ); list r_part = filter(map part, tg[disk,"partitions"]:[], ``(part["device"]:"" != dev )); if( size(r_part)!=size(tg[disk,"partitions"]:[]) ) { map p = filter( map part, tg[disk,"partitions"]:[], ``(part["device"]:"" == dev ))[0]:$[]; if( size(p)>0 ) { p = filter(string k, any e, (map)p, ``(k != key) ); r_part = add( r_part, p ); tg[disk,"partitions"] = r_part; } } return( tg ); } /** * Check if a disk is a real disk and not RAID or LVM * * @param map entry (disk) * @return boolean true if real disk * * @struct entry ~ $[ * "type":`CT_DISK, * "driver" : "?", * "readonly" : false / true, * ] */ global define boolean IsRealDisk( map entry ) ``{ return( entry["type"]:`CT_UNKNOWN==`CT_DISK && !(entry["type"]:`CT_UNKNOWN==`CT_DISK && entry["readonly"]:false && entry["driver"]:""=="vbd") ); } /** * Checks if a container is partitionable * * @param map entry * @return boolean true if partitionable * * @struct entry ~ $[ "type" : ... ? ] */ global boolean IsPartitionable( map entry ) { return entry["type"]:`CT_UNKNOWN==`CT_DMRAID || entry["type"]:`CT_UNKNOWN==`CT_DMMULTIPATH || entry["type"]:`CT_UNKNOWN==`CT_MDPART || IsRealDisk( entry ); } global define boolean DeviceRealDisk( string device ) ``{ boolean ret = false; if( search( device, "LABEL" )!=0 && search( device, "UUID" )!=0 ) { map dev = $[]; dev = GetDiskPartition( device ); ret = dev["disk"]:"" != "/dev/md" && dev["disk"]:"" != "/dev/loop" && search( dev["disk"]:"", "/dev/evms")!=0 && is( dev["nr"]:(any)0, integer ); if( !ret && dev["disk"]:"" != "/dev/md" ) { map st = (map)SCR::Read( .target.stat, dev["disk"]:"" ); ret = !st["isdir"]:false; } } y2milestone( "DeviceRealDisk %1 ret %2", device, ret ); return ret; } /*** * Determine if there is any Linux partition on this system. * * If there is none, we don't need to ask if the user wants to update or * boot an installed system - he can only do a new installation anyway. * No time-consuming or dangerous operations should be performed here, * only simple checks for existence of a Linux (type 83) partition. * * @return boolean true if there is anything that might be a Linux partition **/ global define boolean HaveLinuxPartitions() ``{ boolean ret = false; foreach ( string dev, map disk, GetTargetMap(), ``{ if( !ret ) { if( IsPartitionable( disk ) ) { foreach( map e, disk["partitions"]:[], ``{ ret = ret || Partitions::IsLinuxPartition( e["fsid"]:Partitions::fsid_native ); }); } } }); y2milestone( "HaveLinuxPartitions ret=%1", ret ); return( ret ); }; /** * Get list of all Partitions on all real disks * @return list Partition list */ /* global define list GetPartitionList()``{ list ret = []; foreach ( string dev, map disk, GetTargetMap(), ``{ if( IsPartitionable( disk ) ) { list l = disk["partitions"]:[]; ret = union( ret, maplist( map p, l, ``(p["device"]:""))); } }); ret = sort( ret ); y2debug( "GetPartitionList ret=%1", ret ); return( ret ); } */ /** * Get list of all Linux Partitions on all real disks * @return list Partition list */ global define list GetOtherLinuxPartitions()``{ list ret = []; foreach ( string dev, map disk, GetTargetMap(), ``{ if( IsPartitionable( disk ) ) { list l = (list) filter( map p, disk["partitions"]:[], ``(!p["format"]:false && Partitions::IsLinuxPartition(p["fsid"]:0)) ); l = filter(map p, l, ``(contains( [`xfs, `ext2, `ext3, `jfs, `reiser], p["used_fs"]:`unknown))); l = filter(map p, l, ``(!FileSystems::IsSystemMp( p["mount"]:"", false ))); if( size(l)>0 ) { ret = union( ret, l ); } } }); y2milestone( "GetOtherLinuxPartitions ret=%1", ret ); return( ret ); } /** * Check if swap paritition is availbe on a disk * @param disk Disk to be checked * @return boolean true if swap available. */ global define boolean CheckSwapOn( string disk )``{ boolean ret = false; list swaps = SwappingPartitions(); while( size(swaps)>0 && !ret ) { if( search( swaps[0]:"", disk )==0) { ret = true; } swaps = remove( swaps, 0 ); } y2milestone( "CheckSwapOn %1 ret %2", disk, ret ); return( ret ); } /** * Returns list of primary partitions found * * @param map targets * @param boolean foreign_os * @return list of primary partitions */ global define list GetPrimPartitions( map targets, boolean foreign_os ) ``{ list ret = []; map entry = $[]; string text = ""; integer num_dos = 0; integer num_win = 0; integer num_os2 = 0; integer num_linux = 0; string linux_text = "Linux other"; string dos_text = "dos"; string win_text = "windows"; string os2_text = "OS/2 Boot Manager"; foreach(string disk, map data, targets, ``{ foreach(map part, data["partitions"]:[], ``{ string device = part["device"]:""; if( part["type"]:`unknown == `primary && SCR::Execute (.target.bash, "/usr/lib/YaST2/bin/check.boot "+device) == 0) { text = ""; if( Partitions::IsDosWinNtPartition( part["fsid"]:0 ) && data["used_by_type"]:`UB_NONE==`UB_NONE && GetFreeSpace( device, 0, part["used_fs"]:`none, false )["win_disk"]:false ) { if( contains( Partitions::fsid_dostypes, part["fsid"]:0 ) ) { num_dos = num_dos+1; text = dos_text; } else { num_win = num_win+1; text = win_text; } } else if( part["fsid"]:0 == 0x12 && !foreign_os ) { text = "Vendor diagnostic"; } else if( part["fsid"]:0 == 0x0a ) { text = os2_text; num_os2 = num_os2+1; } else if( part["fsid"]:0 == Partitions::fsid_native && size(part["mount"]:"")==0 && !foreign_os ) { text = linux_text; num_linux = num_linux+1; } if( size(text)>0 ) { entry["device"] = device; entry["string"] = text; ret = add( ret, eval(entry) ); y2milestone( "new entry %1", entry ); } } }); }); y2milestone( "GetPrimPartitions foreign_os:%5 num_linux %1 num_win %2 num_dos %3 num_os2 %4", num_linux, num_win, num_dos, num_os2, foreign_os ); integer num = 1; if( num_linux>1 ) { ret = maplist( map entry, ret, ``{ if( entry["string"]:""==linux_text ) { entry["string"] = linux_text + sformat( " %1", num ); num = num+1; } return( entry ); }); } num = 1; if( num_dos>1 ) { ret = maplist( map entry, ret, ``{ if( entry["string"]:""==dos_text ) { entry["string"] = dos_text + sformat( " %1", num ); num = num+1; } return( entry ); }); } num = 1; if( num_win>1 ) { ret = maplist( map entry, ret, ``{ if( entry["string"]:""==win_text ) { entry["string"] = win_text + sformat( " %1", num ); num = num+1; } return( entry ); }); } num = 1; if( num_os2>1 ) { ret = maplist( map entry, ret, ``{ if( entry["string"]:""==os2_text ) { entry["string"] = os2_text + sformat( " %1", num ); num = num+1; } return( entry ); }); } y2milestone( "GetPrimPartitions ret %1", ret ); return( ret ); } global define list GetWinPrimPartitions( map targets ) ``{ list ret = GetPrimPartitions( targets, true ); y2milestone( "GetWinPrimPartitions ret %1", ret ); return( ret ); } global list GetUsedFs() { if (!InitLibstorage(false)) return nil; list r = LibStorage::StorageInterface::getAllUsedFs(sint); y2milestone("GetUsedFs ret:%1", r); return r; } global void SaveUsedFs() { y2milestone("SaveUsedFs"); SCR::Write(.sysconfig.storage.USED_FS_LIST, mergestring(GetUsedFs(), " ")); SCR::Write(.sysconfig.storage, nil); } global list AddPackageList() { list pl = hw_packages; map tg = GetTargetMap(); boolean need_lvm = false; boolean need_nfs = false; boolean need_quota = false; boolean need_crypt = false; foreach( string k, map e, tg, { if (e["type"]:`CT_UNKNOWN == `CT_LVM) need_lvm = true; if (e["type"]:`CT_UNKNOWN == `CT_NFS) need_nfs = true; if( size(filter( map p, e["partitions"]:[], ``(FileSystems::HasQuota(p))))>0 ) need_quota = true; if( size(filter( map p, e["partitions"]:[], ``(p["enc_type"]:`none != `none)))>0 ) need_crypt = true; }); y2milestone("AddPackageList need lvm:%1 need nfs: %2 quota:%3 crypt:%4", need_lvm, need_nfs, need_quota, need_crypt); if (need_lvm) { pl = add(pl, "lvm2"); } //nfs-client needs to be marked for installation if we have //some NFS shares. It will pull in portmapper package(#436897) if (need_nfs) { pl = add(pl, "nfs-client"); pl = add(pl, "yast2-nfs-client"); } if( need_quota ) { pl = add( pl, "quota" ); } if( need_crypt ) { pl = add( pl, "cryptsetup" ); pl = add( pl, "pam_mount" ); } y2milestone("AddPackageList ret %1", pl); return pl; } /** * Takes care of selecting packages needed by storage * in installation * (replacement for HandlePackages in *_proposal clients) */ global void HandleProposalPackages() { //Use PackagesProposal to ensure that package selection //does not get reset by this module (#433001) import "PackagesProposal"; string proposal_ID = "storage_proposal"; list pkgs = AddPackageList(); //Set rather than Add, there might be some packs left over //from previous 'MakeProposal' we don't need now //This also covers the case when AddPackagesList returns [] or nil PackagesProposal::SetResolvables( proposal_ID, `package, pkgs ); if( Stage::initial() ) { SaveUsedFs(); } } global define list GetForeignPrimary() ``{ list ret = []; if( Arch::i386 () || Arch::ia64 () || Arch::x86_64 () ) { foreach(map e, (list)GetPrimPartitions( GetTargetMap(), false ), ``{ ret = add( ret, sformat( "%1 %2", e["device"]:"", e["string"]:"" )); }); } y2milestone( "ret=%1", ret ); return( ret ); } /** * Returns whether a partition is resizable * * @param map partition * @return map resizable ? */ global define map IsResizable( map part ) ``{ map ret = FileSystems::IsResizable(`unknown); if ((!Arch::s390() && Partitions::IsResizable(part["fsid"]:0)) || part["type"]:`none == `lvm) { if( part["fsid"]:0==Partitions::fsid_swap ) { ret = FileSystems::IsResizable(`swap); } else { ret = FileSystems::IsResizable(part["used_fs"]:`unknown); } } y2milestone( "IsResizable part:%1 ret:%2", part, ret ); return( ret ); } global integer FreeCylindersAfterPartition(string device) { integer ret = 0; if (LibStorage::StorageInterface::freeCylindersAfterPartition(sint, device, ret) != 0) ret = 0; y2milestone("FreeCylindersAfterPartition ret:%1", ret); return ret; } global define boolean CheckNextCreated( map disk, list region ) ``{ boolean ret = false; integer cylinder = region[0]:0 + region[1]:0; foreach(map part, disk["partitions"]:[], ``{ if( part["region",0]:0 == cylinder && part["create"]:false ) { ret = true; } }); y2milestone( "CheckNextCreated region:%1 ret:%2", region, ret ); return( ret ); } global define string PathToDestdir( string pt ) ``{ if( Installation::scr_destdir != "/" ) { pt = Installation::scr_destdir + pt; } return( pt ); } define void HandleModulesOnBoot( map targetMap ) ``{ list ml = filter( string e, (list) splitstring( Misc::SysconfigRead( .sysconfig.kernel.MODULES_LOADED_ON_BOOT, "" ), " \t"), ``(size(e)>0)); y2milestone( "HandleModulesOnBoot ml %1", ml ); boolean need_cryptoloop = false; boolean need_fish2 = false; foreach( string disk, map e, targetMap, ``{ foreach( map p, e["partitions"]:[], ``{ if( p["noauto"]:false && p["enc_type"]:`none!=`none ) { if( p["enc_type"]:`none == `twofish ) need_cryptoloop = true; else if( p["enc_type"]:`none == `twofish_old || p["enc_type"]:`none == `twofish_256_old ) need_fish2 = true; } }); }); y2milestone( "HandleModulesOnBoot need_fish2 %1 need_cryptoloop %2", need_fish2, need_cryptoloop ); if( need_fish2 && find( string e, ml, ``(e=="loop_fish2"))==nil ) { ml = add( ml, "loop_fish2" ); SCR::Write( .sysconfig.kernel.MODULES_LOADED_ON_BOOT, mergestring( ml, " " ) ); } if( need_cryptoloop && find( string e, ml, ``(e=="cryptoloop"))==nil ) { ml = add( ml, "cryptoloop" ); SCR::Write( .sysconfig.kernel.MODULES_LOADED_ON_BOOT, mergestring( ml, " " ) ); } if( need_cryptoloop && find( string e, ml, ``(e=="twofish"))==nil ) { ml = add( ml, "twofish" ); SCR::Write( .sysconfig.kernel.MODULES_LOADED_ON_BOOT, mergestring( ml, " " ) ); } } /** * Adds an entry into the fstab * * @param map entry * @return integer (0 and higher == OK, otherwise error) */ global define integer AddFstabEntry( map e ) { y2milestone( "AddFstabEntry entry:%1", e ); integer ret = 0; integer freq = e["freq"]:0; integer passno = e["passno"]:0; string dev = e["spec"]:""; string m = e["mount"]:""; string vfs = e["vfstype"]:"auto"; string opts = e["mntops"]:"defaults"; ret = LibStorage::StorageInterface::addFstabEntry( sint, dev, m, vfs, opts, freq, passno ); if( ret<0 ) y2error( "ret:%1 entry:%2", ret, e ); return( ret ); } global void ActivateHld(boolean val) { y2milestone("ActivateHld val:%1", val); LibStorage::StorageInterface::activateHld(sint, val); } global void ActivateMultipath(boolean val) { y2milestone("ActivateMultipath val:%1", val); LibStorage::StorageInterface::activateMultipath(sint, val); } /** * Writes fstab to the disk */ global define void WriteFstab() ``{ y2milestone( "WriteFstab called" ); Storage::AddFstabEntry( FileSystems::GetFstabDefaultMap( "proc" ) ); Storage::AddFstabEntry( FileSystems::GetFstabDefaultMap( "sys" ) ); Storage::AddFstabEntry( FileSystems::GetFstabDefaultMap( "debug" ) ); if( Hotplug::haveUSB ) Storage::AddFstabEntry( FileSystems::GetFstabDefaultMap( "usb" ) ); Storage::AddFstabEntry( FileSystems::GetFstabDefaultMap( "pts" ) ); map m = $[]; integer num = 0; foreach( string tdevice, any tdata, StorageDevices::ZipDrives(), ``{ m = FileSystems::GetFstabDefaultMap( "zip" ); string zfile = "/zip"; if( num > 0 ) zfile = zfile + sformat( "%1", num ); m["mount"] = "/media"+zfile; m["spec"] = tdevice+"4"; Storage::AddFstabEntry( m ); num = num+1; }); HandleModulesOnBoot( GetTargetMap() ); } global define map SpecialBootHandling( map tg ) ``{ boolean have_ppc_boot = false; foreach( string dev, map disk, tg, ``{ foreach(map part, disk["partitions"]:[], ``{ if( !have_ppc_boot && part["fsid"]:0 == Partitions::fsid_prep_chrp_boot && size(part["mount"]:"")==0 && part["create"]:false ) { have_ppc_boot = true; } }); }); y2milestone( "SpecialBootHandling: have_ppc_boot:%1", have_ppc_boot ); foreach( string dev, map disk, tg, ``{ list new_part = []; foreach(map part, disk["partitions"]:[], ``{ // convert a mount point of /boot to a 41 PReP boot partition if( Partitions::PrepBoot() && part["mount"]:"" == Partitions::BootMount() && !have_ppc_boot ) { integer id = Partitions::fsid_prep_chrp_boot; part["format"] = false; part["mount"] = ""; part["fstype"] = Partitions::FsIdToString( id ); part["prep_install"] = true; if( !part["create"]:false && part["fsid"]:0 != id ) { part["ori_fsid"] = part["fsid"]:0; part["change_fsid"] = true; } part["fsid"] = id; y2milestone( "SpecialBootHandling modified Prep part=%1", part ); } if( Arch::board_mac () && part["mount"]:"" == Partitions::BootMount() ) { integer id = Partitions::fsid_mac_hfs; part["mount"] = ""; part["fstype"] = Partitions::FsIdToString( id ); part["fsid"] = id; part["used_fs"] = `hfs; part["detected_fs"] = `hfs; y2milestone( "SpecialBootHandling modified hfs part=%1", part ); } if( Arch::ia64 () && part["mount"]:"" == Partitions::BootMount() ) { integer id = Partitions::fsid_gpt_boot; part["fsid"] = id; part["fstype"] = Partitions::FsIdToString( id ); if( !part["create"]:false && part["detected_fs"]:`none==`vfat ) { part["format"] = false; } y2milestone( "SpecialBootHandling modified GPT boot part=%1", part ); } new_part = add( new_part, part ); }); tg[dev,"partitions"] = new_part; }); return( tg ); } global define boolean PerformLosetup( map& loop, boolean format ) ``{ boolean crypt_ok = false; string pwd = loop["passwd"]:""; string device = loop["partitionName"]:""; string mdir = Storage::SaveDumpPath("tmp_mp" ); y2milestone( "PerformLosetup mdir:%1", mdir ); if( (integer)SCR::Read(.target.size, mdir ) >= 0 ) { SCR::Execute(.target.bash, "rm -f " + mdir ); } SCR::Execute(.target.mkdir, mdir ); crypt_ok = Storage::SetCryptPwd( device, pwd ) && Storage::SetCrypt( device, true, false ) && Storage::Mount( device, mdir ); if( crypt_ok ) { any vinfo = LibStorage::VolumeInfo::new("LibStorage::VolumeInfo"); integer ret = LibStorage::StorageInterface::getVolume( sint, device, vinfo ); if( ret!=0 ) { y2error( "PerformLosetup device:%1 not found (ret:%2)", device, ret ); crypt_ok = false; } else { loop["loop_dev"] = "/dev/mapper/cr_" + substring( device, findlastof( device, "/" )+1 ); y2milestone( "PerformLosetup crdev:%1", loop["loop_dev"]:"" ); } SCR::Execute(.target.bash, "umount " + mdir ); } y2milestone( "PerformLosetup ret %1", crypt_ok ); return( crypt_ok ); } /** * Detects a filesystem on a device * * @param device name * @return symbol filesystem */ global define symbol DetectFs( string device ) ``{ symbol ret = `unknown; y2milestone( "DetectFs:%1", device ); any vinfo = LibStorage::VolumeInfo::new("LibStorage::VolumeInfo"); integer r = LibStorage::StorageInterface::getVolume( sint, device, vinfo ); if( r!=0 ) { y2error( "DetectFs device:%1 not found (ret:%2)", device, r ); } else { map curr = $[]; curr = volumeMap( vinfo, curr ); ret = curr["detected_fs"]:`unknown; } y2milestone( "DetectFs ret %1", ret ); return( ret ); } /* global define boolean DiskmapNeeded() ``{ boolean ret = false; map real_disks = filter( string k, map e, GetTargetMap(), ``(IsRealDisk( e )) ); list disks = (list) maplist( string k, map e, real_disks, ``(k)); y2milestone( "disks %1", disks ); boolean scsi_disk = false; boolean ide_disk = false; foreach( string k, disks, ``{ if( search( k, "/dev/sd" )==0 ) { scsi_disk = true; } else if( search( k, "/dev/hd" )==0 ) { ide_disk = true; } else { ret = true; } }); ret = ret || (scsi_disk && ide_disk); if( !ret && ide_disk ) { string abc = "abcdefghijklmnopqrstuvwxyz"; integer idx = 0; foreach( string k, disks, ``{ y2milestone( "dev %1 abc %2", substring(k, 7, 1), substring(abc, idx, 1)); if( substring(k, 7, 1) != substring(abc, idx, 1) ) { ret = true; } idx = idx+1; }); } y2milestone( "ret %1 disks %2 ide %3 scsi %4", ret, size(disks), ide_disk, scsi_disk ); return( ret ); }; */ /* global define list GetDirPatterns( string dir, list patterns ) ``{ list ret = []; string cmd = sformat( "cd %1 && (ls %2 2>/dev/null)", dir, mergestring( (list)patterns, " ")); map out = (map) SCR::Execute( .target.bash_output, cmd ); ret = splitstring( out["stdout"]:"", "\n" ); ret = filter( string e, ret, ``(size(e)>0) ); ret = maplist( string e, ret, ``(dir+"/"+e)); y2milestone( "dir %1 pat %2", dir, patterns ); y2milestone( "ret %1", ret ); return( ret ); } */ global define map GetBootPartition( string disk ) ``{ map ret = $[]; map tg = GetTargetMap(); ret = filter( map p, tg[disk,"partitions"]:[], ``(p["boot"]:false))[0]:$[]; y2milestone( "disk:%1 ret:%2", disk, ret ); return( ret ); } global define void UpdateFstabSubfs() ``{ y2milestone( "UpdateFstabSubfs removing fstab entries for cdrom and floppy" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; list rem_lines = []; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); if( search( l["fields",1]:"", "/media/floppy" )==0 ) { rem_lines = add( rem_lines, line ); } else if( search( l["fields",1]:"", "/media/cdrom" )==0 || search( l["fields",1]:"", "/media/dvd" )==0 || search( l["fields",1]:"", "/media/cdrecorder" )==0 || search( l["fields",1]:"", "/media/dvdrecorder" )==0 || search( l["fields",1]:"", "/cdrom" )==0 || search( l["fields",1]:"", "/dvd" )==0 || search( l["fields",1]:"", "/cdrecorder" )==0 || search( l["fields",1]:"", "/dvdrecorder" )==0 ) { rem_lines = add( rem_lines, line ); } line = line+1; } y2milestone( "UpdateFstabSubfs %1", rem_lines ); if( size(rem_lines)>0 ) { rem_lines = sort(rem_lines); AsciiFile::RemoveLines( fstab, rem_lines ); } AsciiFile::RewriteFile( fstab, tabpath ); } global define void UpdateFstabSysfs() ``{ y2milestone( "UpdateFstabSysfs called" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; boolean have_sysfs = false; while( !have_sysfs && line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); have_sysfs = l["fields",1]:"" == "/sys"; line = line+1; } if( !have_sysfs ) { map entry = FileSystems::GetFstabDefaultMap( "sys" ); list fstlist = [ entry["spec"]:"", entry["mount"]:"", entry["vfstype"]:"", entry["mntops"]:"", sformat("%1",entry["freq"]:0), sformat("%1",entry["passno"]:0) ]; y2milestone( "UpdateFstabSysfs entry %1", entry ); y2milestone( "UpdateFstabSysfs fstlist %1", fstlist ); AsciiFile::AppendLine( fstab, fstlist ); AsciiFile::RewriteFile( fstab, tabpath ); } } global define void UpdateFstabOptions() { y2milestone( "UpdateFstabOptions" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; string n = ""; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); string options = l["fields", 3]:""; if (regexpmatch (options, "^\(.*,\)\?hotplug\(,.*\)\?$")) { options = regexpsub (options, "^\(.*,\)\?hotplug\(,.*\)\?$", "\\1nofail\\2"); AsciiFile::ChangeLineField( fstab, line, 3, options ); } line = line+1; } AsciiFile::RewriteFile( fstab, tabpath ); } global string HdToIseries( string input ) ``{ string ret = input; string regex = "/dev/hd[a-z][0-9]*"; if( regexpmatch( input, regex )) { ret = "/dev/iseries/vd" + substring( ret, 7 ); } y2milestone( "HdToIseries input:%1 ret:%2", input, ret ); return( ret ); } global string SLES9PersistentDevNames( string input ) ``{ string ret = input; string regex1 = "/dev/disk/by-id/.*"; string regex2 = "/dev/disk/by-path/.*"; string prefix = "scsi-"; string tmpdev = ""; if( regexpmatch( input, ".*-part[0-9]*$" )) { return input; } if( regexpmatch( input, ".*/by-id/(scsi|ccw|usb|ata)-.*$" )) { return input; } if( regexpmatch( input, regex1 )) { if (regexpmatch ( input, ".*/by-id/0X.{4}p?[0-9]?$" ) ) { prefix = "ccw-"; } tmpdev = "/dev/disk/by-id/" + prefix + substring( input, findlastof(input, "/")+1 ); y2milestone( "by id tmp %1", tmpdev ); ret = tmpdev; } else if( regexpmatch( input, regex2 )) { tmpdev = input; y2milestone( "by path tmp %1", tmpdev ); } if( size(tmpdev)>0 ) { if( regexpmatch( tmpdev, ".*p[0-9]*$" ) ) { ret = regexpsub( tmpdev, "(.*)p([0-9]*)$", "\\1-part\\2" ); } else { ret = regexpsub( tmpdev, "(.*[[:alpha:][:punct:]])([0-9]*)$", "\\1-part\\2" ); } } y2milestone( "SLES9PersistentDevNames input:%1 ret:%2", input, ret ); return( ret ); } global string HdDiskMap( string input, map diskmap ) ``{ string ret = input; if (IsKernelDeviceName(input)) { map d = GetDiskPartition( input ); if( haskey( diskmap, d["disk"]:"" )) { ret = GetDeviceName( diskmap[d["disk"]:""]:"", d["nr"]:(any)0 ); } } y2milestone( "HdDiskMap input:%1 ret:%2", input, ret ); return( ret ); } global define void UpdateFstabIseriesVd() ``{ y2milestone( "UpdateFstabIseriesVd updating hdx to iseries/vdx" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; string n = ""; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); n = HdToIseries( l["fields",0]:"" ); if( n != l["fields",0]:"" ) { AsciiFile::ChangeLineField( fstab, line, 0, n ); } line = line+1; } AsciiFile::RewriteFile( fstab, tabpath ); tabpath = PathToDestdir( "/etc/cryptotab" ); map crtab = Partitions::GetCrypto( tabpath ); line = 0; while( line<=AsciiFile::NumLines( crtab ) ) { map l = AsciiFile::GetLine( crtab, line ); n = HdToIseries( l["fields",1]:"" ); if( n != l["fields",1]:"" ) { AsciiFile::ChangeLineField( crtab, line, 1, n ); } line = line+1; } AsciiFile::RewriteFile( crtab, tabpath ); } global define void UpdateCdromLinks( map diskmap ) ``{ y2milestone( "UpdateCdromLinks map %1", diskmap ); foreach( string link, StorageDevices::TypeNames, ``{ string dev = "/dev/" + link; string cont = (string)SCR::Read( .target.symlink, dev ); if( cont!=nil && search( cont, "/dev/") != 0 ) cont = "/dev/" + cont; y2milestone( "UpdateCdromLinks dev %1 cont %2", dev, cont ); if( cont!=nil && haskey( diskmap, cont ) && size(diskmap[cont]:"")>0 ) { y2milestone( "Change symlink %1 from %2 -> %3", dev, cont, diskmap[cont]:"" ); SCR::Execute( .target.remove, dev ); SCR::Execute( .target.symlink, substring(diskmap[cont]:"",5), dev ); } }); } global define void UpdateFstabPersistentNames() ``{ y2milestone( "UpdateFstabPersistentDevNames updating to SLES10 names" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; string n = ""; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); n = SLES9PersistentDevNames( l["fields",0]:"" ); if( n != l["fields",0]:"" ) { AsciiFile::ChangeLineField( fstab, line, 0, n ); } line = line+1; } AsciiFile::RewriteFile( fstab, tabpath ); } global void UpdateFstabEvms2Lvm() { y2milestone( "UpdateFstabEvms2Lvm migrating EVMS to LVM" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; string n = ""; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); n = l["fields",0]:""; if (substring (n, 0, 15) == "/dev/evms/lvm2/") { n = "/dev/" + substring (n, 15); AsciiFile::ChangeLineField( fstab, line, 0, n ); } line = line+1; } AsciiFile::RewriteFile( fstab, tabpath ); } global define void UpdateFstabDiskmap( map diskmap ) ``{ y2milestone( "UpdateFstabDiskmap map %1", diskmap ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; string n = ""; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); n = HdDiskMap( l["fields",0]:"", diskmap ); if( n != l["fields",0]:"" ) { AsciiFile::ChangeLineField( fstab, line, 0, n ); } line = line+1; } AsciiFile::RewriteFile( fstab, tabpath ); tabpath = PathToDestdir( "/etc/cryptotab" ); map crtab = Partitions::GetCrypto( tabpath ); line = 0; while( line<=AsciiFile::NumLines( crtab ) ) { map l = AsciiFile::GetLine( crtab, line ); n = HdDiskMap( l["fields",1]:"", diskmap ); if( n != l["fields",1]:"" ) { AsciiFile::ChangeLineField( crtab, line, 1, n ); } line = line+1; } AsciiFile::RewriteFile( crtab, tabpath ); } global define void UpdateMdadm() ``{ y2milestone( "UpdateMdadm" ); string cpath = PathToDestdir( "/etc/mdadm.conf" ); map file = $[]; AsciiFile::SetComment( file, "^[ \t]*#" ); AsciiFile::ReadFile( file, cpath ); integer line = 0; boolean changed = false; while( line<=AsciiFile::NumLines( file ) ) { if( search( file["l",line,"line"]:"", "DEVICE" )!=nil && search( file["l",line,"line"]:"", "/dev/" )!=nil ) { changed = true; file["l",line,"line"] = "DEVICE partitions"; y2milestone( "UpdateMdadm %1", file["l",line]:$[] ); } line = line+1; } if( changed ) AsciiFile::RewriteFile( file, cpath ); } global define void UpdateCryptoType() ``{ y2milestone( "UpdateCryptoType" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; integer pos = 0; string searchstr = "encryption=twofish256"; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); pos = search( l["fields",3]:"", searchstr ); if( pos != nil ) { string new = substring( l["fields",3]:"", 0, pos ); new = new + "encryption=twofishSL92"; new = new + substring( l["fields",3]:"", pos+size(searchstr) ); y2milestone( "new options line in %1 is %2", l, new ); AsciiFile::ChangeLineField( fstab, line, 3, new ); } line = line+1; } AsciiFile::RewriteFile( fstab, tabpath ); tabpath = PathToDestdir( "/etc/cryptotab" ); map crtab = Partitions::GetCrypto( tabpath ); line = 0; while( line<=AsciiFile::NumLines( crtab ) ) { map l = AsciiFile::GetLine( crtab, line ); if( l["fields",4]:"" == "twofish256" ) { y2milestone( "set twofishSL92 in line %1", l ); AsciiFile::ChangeLineField( crtab, line, 4, "twofishSL92" ); } line = line+1; } AsciiFile::RewriteFile( crtab, tabpath ); } global define void UpdateFstabUsbdevfs() ``{ y2milestone( "UpdateFstabUsbdevfs updating usbdevfs to usbfs" ); boolean changed = false; string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); if( l["fields",2]:"" == "usbdevfs" ) { AsciiFile::ChangeLineField( fstab, line, 2, "usbfs" ); AsciiFile::ChangeLineField( fstab, line, 0, "usbfs" ); changed = true; } line = line+1; } if( changed ) { y2milestone( "UpdateFstabUsbdevfs changed" ); AsciiFile::RewriteFile( fstab, tabpath ); } } global define map BuildDiskmap( map oldv ) ``{ map d = (map)SCR::Read( .target.stat, Installation::destdir + "/var/lib/hardware" ); y2milestone( "BuildDiskmap oldv:%1 Vers:%2", oldv, DiskMapVersion ); y2milestone( "dir:%1 d:%2", Installation::destdir+"/var/lib/hardware", d ); if( d["isdir"]:false && (oldv != DiskMapVersion || size(oldv)==0) ) { DiskMap = $[]; string cmd = ""; cmd = "LIBHD_HDDB_DIR=" + Installation::destdir + "/var/lib/hardware " + "hwinfo --verbose --map"; y2milestone( "BuildDiskmap cmd %1", cmd ); map bo = (map)SCR::Execute (.target.bash_output, cmd ); y2milestone( "BuildDiskmap bo %1", bo ); if( bo["exit"]:1==0 && size(bo["stdout"]:"")>0 ) { list lines = splitstring( bo["stdout"]:"", "\n" ); foreach( string line, lines, ``{ list disks = filter( string d, splitstring( line, " \t" ), ``(size(d)>0)); if( size(disks)>1 ) { integer index = 1; while( index0 ) { UpdateFstabDiskmap( dm ); UpdateMdadm(); } if( oldv["major"]:0<9 || (oldv["major"]:0==9 && oldv["minor"]:0<=2)) { Storage::UpdateCryptoType(); } if( oldv["major"]:0<10 || (oldv["major"]:0==10 && oldv["minor"]:0==0) ) { string of = "/etc/udev/rules.d/20-cdrom.rules"; y2milestone( "removing obsolete %1", of ); SCR::Execute( .target.remove, of ); of = "/etc/udev/rules.d/55-cdrom.rules"; y2milestone( "removing obsolete %1", of ); SCR::Execute( .target.remove, of ); } if( oldv["major"]:0<10 || (oldv["major"]:0==10 && oldv["minor"]:0<=2) ) { string of = "/etc/udev/rules.d/65-cdrom.rules"; y2milestone( "removing obsolete %1", of ); SCR::Execute( .target.remove, of ); } if( oldv["major"]:0<10 || (oldv["major"]:0==10 && oldv["minor"]:0==0)) UpdateFstabSubfs(); if( oldv["major"]:0<9 || (oldv["major"]:0==9 && oldv["minor"]:0==0)) { if( Arch::board_iseries () ) { UpdateFstabIseriesVd(); } string cmd = "cd / && /sbin/insserv -r /etc/init.d/boot.evms"; y2milestone( "Update cmd %1", cmd ); map bo = (map)SCR::Execute (.target.bash_output, cmd ); y2milestone( "Update bo %1", bo ); } if( oldv["major"]:0<10 || (oldv["major"]:0==10 && oldv["minor"]:0<=2)) { string cmd = "cd / && /sbin/insserv /etc/init.d/boot.crypto"; map bo = (map)SCR::Execute (.target.bash_output, cmd ); y2milestone( "Update bo %1", bo ); cmd = "cd / && /sbin/insserv /etc/init.d/boot.crypto-early"; bo = (map)SCR::Execute (.target.bash_output, cmd ); y2milestone( "Update bo %1", bo ); } // set flag -> it indicates that Update was already called called_update = true; } else { y2milestone("Skip calling Update() -> It was already called"); } } global define list GetTranslatedDevices( map oldv, map newv, list names ) { y2milestone( "GetTranslatedDevices old:%1 new:%2", oldv, newv ); y2milestone( "GetTranslatedDevices names %1", names ); list ret = names; map dm = BuildDiskmap( oldv ); if( size(dm)>0 ) { ret = maplist( string n, ret, ``(HdDiskMap( n, dm ))); } if( (oldv["major"]:0<9 || (oldv["major"]:0==9 && oldv["minor"]:0==0)) && Arch::board_iseries () ) { ret = maplist( string n, ret, ``(HdToIseries( n ))); } if( oldv["major"]:0==9 ) { ret = maplist( string n, ret, ``(SLES9PersistentDevNames( n ))); } // convert EVMS names to LVM // FIXME: add version checking, but does not seem necessary, since non-LVM // installations will not be affected by this conversion at all ret = maplist (string n, ret, { if (substring (n, 0, 15) == "/dev/evms/lvm2/") n = "/dev/" + substring (n, 15); return n; }); y2milestone( "GetTranslatedDevices ret %1", ret ); return( ret ); } /* global define list GetUsedLvmGroups( map tg ) ``{ list groups = []; foreach( string disk, map data, tg, ``{ if( data["type"]:`CT_UNKNOWN==`CT_LVM && size( filter( map p, data["partitions"]:[], ``(size(p["mount"]:"")>0 ) )) > 0 ) { y2milestone( "GetUsedLvmGroups %1", filter( map p, data["partitions"]:[], ``(size(p["mount"]:"")>0 ) ) ); groups = add( groups, substring( disk, 5 ) ); } }); y2milestone( "GetUsedLvmGroups ret %1", groups ); return( groups ); }; */ /** * Get used real disks * * @param map tg Target map * @param boolean ignore boot * @return list disks List of disks */ /* global define list GetUsedRealDisksNew( map tg, boolean ignore_boot ) ``{ list disks = []; list lvmgr = GetUsedLvmGroups( tg ); list mdlist = []; foreach( map p, tg["/dev/md","partitions"]:[], ``{ if( size(p["mount"]:"")>0 || contains( lvmgr, p["used_by"]:"" ) ) { mdlist = add( mdlist, p["device"]:"" ); } }); foreach( string disk, map data, tg, ``{ if( IsRealDisk( data ) && size( filter( map p, data["partitions"]:[], ``( (size(p["mount"]:"")>0 && (!ignore_boot || p["mount"]:""!=Partitions::BootMount())) || contains( mdlist, p["used_by"]:"" ) || contains( lvmgr, p["used_by"]:"" ) ) )) > 0 ) { disks = add( disks, disk ); } }); y2milestone( "GetUsedRealDisksNew ignore_boot %1 ret %2", ignore_boot, disks ); return( disks ); }; */ /* global define list GetUsedRealDisks( map tg ) { return( GetUsedRealDisksNew( tg, false )); }; */ /* global define list GetEvmsRealDisk( map tg, map p ) ``{ list rdisk = []; string name = ""; string namel = ""; if( size(p["device"]:"")>10 ) name = substring( p["device"]:"", 10 ); if( search( name, "lvm/" ) == 0 || search( name, "lvm2/" ) == 0) { name = substring( name, 0, findlastof( name, "/" )); } namel = name; integer pos = search( namel, "/" ); if( pos != nil ) { namel = substring( namel, pos+1 ); } y2milestone( "GetEvmsRealDisk name is %1 namel is %2", name, namel ); foreach( string disk, map data, tg, ``{ if( size(name)>0 && (IsRealDisk( data ) || disk=="/dev/md") && ((size( filter( map p, data["partitions"]:[], ``(p["used_by_type"]:`UB_NONE==`UB_EVMS && p["used_by"]:""==name)))>0) || (size( filter( map p, data["partitions"]:[], ``(p["used_by_type"]:`UB_NONE==`UB_LVM && p["used_by"]:""==namel)))>0) )) { list dl = [ disk ]; if( disk=="/dev/md" ) { list tl = []; tl = filter( map p, data["partitions"]:[], ``((p["used_by_type"]:`UB_NONE==`UB_EVMS && p["used_by"]:""==name)|| (p["used_by_type"]:`UB_NONE==`UB_LVM && p["used_by"]:""==namel))); dl = maplist( map p, tl, ``(p["device"]:"")); dl = (list)sort( dl ); dl = (list)toset( dl ); y2milestone( "GetEvmsRealDisk dl %1", dl ); } rdisk = (list)union( rdisk, dl ); } }); if( size(rdisk)==0 && !p["evms_native"]:false ) { map d = GetDiskPartitionTg( EvmsDevDisk( p["device"]:"" ), tg )[0]:$[]; if( haskey( tg, d["disk"]:"" )) { rdisk = [ d["disk"]:"" ]; } } y2milestone( "GetEvmsRealDisk %1 is %2", p["device"]:"", rdisk ); return( rdisk ); } */ /* global define list GetUsedEvmsDisks( map tg ) ``{ list disks = []; list mdlist = []; foreach( string disk, map data, tg, ``{ if( search( disk, "/dev/evms" )==0 ) { foreach( map p, data["partitions"]:[], ``{ if( size(p["mount"]:"")>0 ) { list dl = GetEvmsRealDisk( tg, p ); foreach( string d, dl, ``{ y2milestone( "GetUsedEvmsDisks d %1", d ); if( search( d, "/dev/md" ) == 0 ) { list ndl = []; foreach( string dd, map pp, tg, ``{ map pu = find( map p, pp["partitions"]:[], ``(p["used_by"]:""==substring(d,5)) ); y2milestone( "GetUsedEvmsDisks disk:%1 used:%2", dd, pu ); if( pu!=nil && size(pu)>0 ) { ndl = add( ndl, dd ); } }); disks = (list)union( disks, ndl ); } else { disks = (list)union( disks, [d] ); } }); } }); } }); disks = sort( disks ); y2milestone( "GetUsedEvmsDisks ret %1", disks ); return( disks ); }; */ /* global list GetPrepBoot( map tg ) { list ret = []; list cl = [ 0x06, 0x41 ]; foreach( string s, map e, tg, ``{ if( IsRealDisk( e ) && Partitions::PrepBoot() ) ret = (list)merge( ret, filter( map p, e["partitions"]:[], ``( size(p["mount"]:"")==0 && contains( cl, p["fsid"]:0 ) && !p["delete"]:false ))); }); y2milestone( "GetPrepBoot ret:%1", ret ); return( ret ); } */ void CallInsserv( boolean on, string name ) { y2milestone( "CallInsserv on:%1 name:%2", on, name ); string scrname = "/etc/init.d/" + name; if( SCR::Read( .target.size, scrname )>0 ) { string cmd = "cd / && /sbin/insserv "; if( !on ) cmd = cmd + "-r "; cmd = cmd + scrname; y2milestone( "CallInsserv cmd %1", cmd ); map bo = (map)SCR::Execute (.target.bash_output, cmd ); y2milestone( "CallInsserv bo %1", bo ); } } global void FinishInstall() { y2milestone("FinishInstall initial:%1", Stage::initial()); map tg = GetTargetMap(); if( Stage::initial() ) { HandleModulesOnBoot( tg ); /* list evms = GetUsedEvmsDisks( tg ); y2milestone( "FinishInstall evms %1", evms ); if( size(evms)>0 ) CallInsserv( true, "evms" ); list nonevms = GetUsedRealDisks( tg ); nonevms = filter( string d, nonevms, ``(!contains( evms, d ))); nonevms = maplist( string d, nonevms, ``(substring(d,5))); y2milestone( "FinishInstall nonevms %1", nonevms ); nonevms = (list)merge( nonevms, maplist( map p, GetPrepBoot(tg), ``(substring(p["device"]:"",5)))); y2milestone( "FinishInstall nonevms %1", nonevms ); if( size(nonevms)>0 && SCR::Read( .target.size, "/etc/evms.conf" )>=0 ) { map evmsconf = $[]; AsciiFile::ReadFile( evmsconf, "/etc/evms.conf" ); boolean found = false; integer i = 1; string regex1 = "^[ \t]*activate[ \t]*\\{"; string regex2 = "^[ \t]*exclude[ \t]*="; string regex3 = "^[ \t]*\\}"; while( i<=AsciiFile::NumLines(evmsconf) && !found ) { found = regexpmatch( evmsconf["l",i,"line"]:"", regex1 ); i = i+1; } found = false; boolean found2 = false; while( i<=AsciiFile::NumLines(evmsconf) && !found && !found2) { found = regexpmatch( evmsconf["l",i,"line"]:"", regex2 ); found2 = regexpmatch( evmsconf["l",i,"line"]:"", regex3 ); if( found ) { string co = evmsconf["l",i,"line"]:""; integer pos = search( co, "[" ); if( pos!=nil ) co = substring( co, pos+1 ); pos = search( co, "]" ); if( pos!=nil ) co = substring( co, 0, pos ); y2milestone( "FinishInstall co = \"%1\"", co ); string li = "\texclude = [ " + co + mergestring( nonevms, " " ) + " ]"; y2milestone( "FinishInstall li = %1", li ); evmsconf["l",i,"line"] = li; evmsconf["l",i,"buildline"] = false; AsciiFile::RewriteFile( evmsconf, "/etc/evms.conf" ); } i = i+1; } } */ } boolean need_crypt = false; boolean need_md = false; boolean need_lvm = false; boolean need_dmraid = false; boolean need_dmmultipath = false; foreach( string k, map e, tg, { if( size(filter( map p, e["partitions"]:[], ``(p["enc_type"]:`none != `none)))>0 ) need_crypt = true; if( e["type"]:`CT_UNKNOWN==`CT_MD && size(e["partitions"]:[])>0 ) need_md = true; if( e["type"]:`CT_UNKNOWN==`CT_MDPART ) need_md = true; if( e["type"]:`CT_UNKNOWN==`CT_LVM ) need_lvm = true; if( e["type"]:`CT_UNKNOWN==`CT_DMRAID ) need_dmraid = true; if( e["type"]:`CT_UNKNOWN==`CT_DMMULTIPATH ) need_dmmultipath = true; }); y2milestone( "FinishInstall need crypto:%1 md:%2 lvm:%3 dmraid:%4 dmmultipath:%5", need_crypt, need_md, need_lvm, need_dmraid, need_dmmultipath ); if( need_crypt ) { CallInsserv( true, "boot.crypto" ); CallInsserv( true, "boot.crypto-early" ); } CallInsserv( need_md, "boot.md" ); CallInsserv( need_lvm, "boot.lvm" ); CallInsserv( need_dmraid, "boot.dmraid" ); CallInsserv( need_dmmultipath, "boot.multipath" ); CallInsserv( need_dmmultipath, "multipathd" ); y2milestone("FinishInstall done"); } global define map GetEntryForMountpoint( string mp ) ``{ list all_partitions = []; foreach( string dev, map disk, GetTargetMap(), ``{ all_partitions = (list)union( all_partitions, disk["partitions"]:[] ); }); map partition = find( map part, all_partitions, ``(part["mount"]:""==mp) ); if( partition==nil || partition["mount"]:"" != mp ) { partition = $[]; } return partition; } global define list GetRootInitrdModules() ``{ map partition = GetEntryForMountpoint( "/" ); y2milestone("GetRootInitrdModules root partition %1", partition ); map tg = GetTargetMap(); map disk = $[]; foreach( string k, map d, tg, ``{ if( size(disk)==0 && find( map p, d["partitions"]:[], ``(!p["delete"]:false && p["device"]:""==partition["device"]:""))!=nil ) disk = d; }); y2milestone( "GetRootInitrdModules disk %1", haskey(disk,"partitions")?remove(disk,"partitions"):disk ); list initrdmodules = FileSystems::GetNeededModules( partition["used_fs"]:`ext2 ); if( partition["type"]:`unknown == `sw_raid ) { string t = partition["raid_type"]:""; if (!contains (initrdmodules, t)) { initrdmodules = add (initrdmodules, t); } } if( partition["type"]:`unknown == `lvm ) { string vgname = substring( partition["device"]:"", 5 ); vgname = substring( vgname, 0, findfirstof( vgname, "/" )); list mod = (list) maplist(map k, filter(map e, tg["/dev/md","partitions"]:[], ``(e["used_by"]:""==vgname) ), ``(k["raid_type"]:"")); y2milestone( "GetRootInitrdModules mod %1", mod ); foreach(string e, mod, ``{ if( size(e)>0 && !contains( initrdmodules, e ) ) { initrdmodules = add( initrdmodules, e ); } }); if( !contains( initrdmodules, "dm_mod" ) ) { initrdmodules = add( initrdmodules, "dm_mod" ); } } if( partition["type"]:`unknown == `evms ) { string evmsco = partition["device"]:""; evmsco = substring( evmsco, 0, findlastof( evmsco, "/" )); y2milestone( "GetRootInitrdModules evmsco %1", evmsco ); y2milestone( "GetRootInitrdModules evms %1", tg[evmsco]:$[] ); list md = filter( string s, tg[evmsco,"devices"]:[], ``(search(s,"/dev/md")==0)); y2milestone( "GetRootInitrdModules mddev %1", md ); list mod = (list) maplist(map k, filter(map e, tg["/dev/md","partitions"]:[], ``(contains(md,e["device"]:""))), ``(k["raid_type"]:"")); y2milestone( "GetRootInitrdModules mod %1", mod ); foreach(string e, mod, ``{ if( size(e)>0 && !contains( initrdmodules, e ) ) { initrdmodules = add( initrdmodules, e ); } }); if( !contains( initrdmodules, "dm_mod" ) ) { initrdmodules = add( initrdmodules, "dm_mod" ); } } if( size(disk["modules"]:[])>0 ) { y2milestone( "adding disk modules %1", disk["modules"]:[] ); foreach( string m, disk["modules"]:[], ``{ if( !contains( initrdmodules, m )) { initrdmodules = add( initrdmodules, m ); } }); } if( size(disk["driver_module"]:"")>0 ) { string m = disk["driver_module"]:""; y2milestone( "adding driver modules %1", m ); if( !contains( initrdmodules, m )) { initrdmodules = add( initrdmodules, m ); } } SCR::UnmountAgent (.proc.modules); map lmod = (map) SCR::Read(.proc.modules); y2milestone( "GetRootInitrdModules lmod:%1", lmod ); if( size(lmod["edd"]:$[])>0 ) initrdmodules = add( initrdmodules, "edd" ); y2milestone( "GetRootInitrdModules ret %1", initrdmodules ); return initrdmodules; }; /** * CheckForLvmRootFs *--------------------------------------------------------------------- * check if the root filesystem is a lvm logical volume * **/ global define boolean CheckForLvmRootFs() ``{ map part = GetEntryForMountpoint( "/" ); y2milestone( "CheckForLvmRootFs root=%1", part ); boolean ret = part["type"]:`primary==`lvm; y2milestone( "CheckForLvmRootFs ret=%1", ret ); return ret; }; /*--------------------------------------------------------------------- * checkForMdRootFs *--------------------------------------------------------------------- * check if the root filesystem is a md device *--------------------------------------------------------------------- */ global define boolean CheckForMdRootFs() ``{ map part = GetEntryForMountpoint( "/" ); boolean ret = part["type"]:`primary==`sw_raid; y2milestone( "CheckForMdRootFs root=%1", part ); y2milestone( "CheckForMdRootFs ret=%1", ret ); return ret; }; global define void AdaptResize( string maindev, list region, integer schange ) ``{ map tg = GetTargetMap(); list partitions = tg[maindev,"partitions"]:[]; integer cylinder = region[0]:0 + region[1]:0; boolean found = false; integer index = -1; integer e_idx = -1; list idx_list = []; map part = (map) find(map p, partitions, ``(p["region",0]:0 == cylinder && p["create"]:false)); y2milestone( "AdaptResize %1 reg %2 change %3", maindev, region, schange ); if( part != nil ) { found = false; index = 0; foreach(map p, partitions, ``{ if( p["region",0]:0 == cylinder && p["create"]:false ) { found = true; } else if( !found ) { index = index + 1; } }); if( partitions[index,"type"]:`primary == `extended ) { e_idx = index; found = false; index = 0; foreach(map p, partitions, ``{ if( p["region",0]:0 == cylinder && p["create"]:false && p["type"]:`primary != `extended ) { found = true; part = p; } else if( !found ) { index = index + 1; } }); } cylinder = part["region",0]:0 + part["region",1]:0; y2milestone( "AdaptResize part:%1", part ); y2milestone( "AdaptResize index:%1 e_idx:%2 cylinder:%3", index, e_idx, cylinder ); map pnew = (map) find( map p, partitions, ``( p["region",0]:0 == cylinder && p["create"]:false )); y2milestone( "AdaptResize pnew:%1", pnew ); while( pnew != nil && (part["mount"]:"" == Partitions::BootMount() || part["fsid"]:0==Partitions::fsid_swap || part["region",1]:0 < (schange<0?(-1*schange):schange)) ) { y2milestone( "AdaptResize pnew:%1", pnew ); part = pnew; idx_list = add( idx_list, index ); y2milestone( "AdaptResize index:%1 idx_list:%2", index, idx_list ); found = false; index = 0; foreach(map p, partitions, ``{ y2milestone( "found:%1 index:%2 p=%3", found, index, p ); if( p["nr"]:0 == pnew["nr"]:0 ) { found = true; } else if( !found ) { index = index + 1; } }); cylinder = part["region",0]:0 + part["region",1]:0; pnew = (map) find( map p, partitions, ``( p["region",0]:0 == cylinder && p["create"]:false )); } y2milestone( "AdaptResize idx:%1 list:%2", index, idx_list ); foreach(integer num, idx_list, ``{ partitions[num,"region",0] = partitions[num,"region",0]:0 - schange; UpdatePartition( partitions[num,"device"]:"", partitions[num,"region",0]:0, partitions[num,"region",1]:1 ); }); partitions[index,"region",0] = partitions[index,"region",0]:0 - schange; partitions[index,"region",1] = partitions[index,"region",1]:0 + schange; if( partitions[index,"region",1]:0 <= 0 ) { partitions[index,"region",1] = 1; } y2milestone( "AdaptResize increase p:%1", partitions[index]:$[] ); UpdatePartition( partitions[index,"device"]:"", partitions[index,"region",0]:0, partitions[index,"region",1]:1 ); if( e_idx>=0 ) { partitions[e_idx,"region",0] = partitions[e_idx,"region",0]:0 - schange; partitions[e_idx,"region",1] = partitions[e_idx,"region",1]:0 + schange; if( partitions[e_idx,"region",1]:0 <= 0 ) { partitions[e_idx,"region",1] = 1; } UpdatePartition( partitions[e_idx,"device"]:"", partitions[e_idx,"region",0]:0, partitions[e_idx,"region",1]:1 ); } } else { y2error( "AdaptResize this should not happen %1", partitions ); } y2milestone( "AdaptResize partitions:%1", partitions ); y2milestone( "AdaptResize maindev:%1 region:%2 change:%3", maindev, region, schange ); } global define integer NumLoopDevices() { map bo = (map)WFM::Execute (.local.bash_output, "losetup -a" ); list sl = splitstring( bo["stdout"]:"", "\n" ); sl = filter( string s, sl, ``(search( s, "/dev/loop" )==0 )); sl = maplist( string s, sl, ``(substring( s, 0, search( s, ":" )))); sl = maplist( string s, sl, ``(substring( s, 9 ))); list il = sort( maplist( string s, sl, ``(tointeger(s)))); integer ret = il[size(sl)-1]:-1 + 1; y2milestone( "NumLoopDevices ret:%1", ret ); return( ret ); } //----------------------------------------------------- // convert partitions to fstab entries // return map (might be empty) global define map onepartition2fstab (map part, integer& other_nr) ``{ y2milestone( "onepartition2fstab part=%1", part ); if (part["delete"]:false || part["type"]:`unknown == `extended || (contains( [ `lvm, `sw_raid, `evms ], part["type"]:`unknown ) && size(part["mount"]:"")==0) || (part["enc_type"]:`none!=`none && !part["noauto"]:false) || part["used_by_type"]:`UB_NONE != `UB_NONE || (contains( [ Partitions::fsid_prep_chrp_boot, Partitions::fsid_lvm, Partitions::fsid_raid ], part["fsid"]:0 ) && size(part["mount"]:"")==0)) { return $[]; } string spec = part["device"]:""; if( part["mountby"]:`device == `label && size(part["label"]:"")>0 ) { spec = sformat("LABEL=%1", part["label"]:"" ); } else if( part["mountby"]:`device == `uuid && size(part["uuid"]:"")>0 ) { spec = sformat("UUID=%1", part["uuid"]:"" ); } y2debug( "onepartition2fstab spec=%1", spec ); string mount_point = part["mount"]:""; integer fsid = part["fsid"]:0; symbol used_fs = part["used_fs"]:`ext2; boolean format = part["format"]:false; string vfstype = "unknown"; // keep "unknown", used again below integer freq = 0; integer passno = 0; string mntops = part["fstopt"]:""; if( mount_point == "swap" ) { vfstype = "swap"; if( size(mntops) == 0 ) { mntops = FileSystems::GetFstabDefaultMntops( "swap" ); } passno = 0; } else if( fsid==Partitions::fsid_native || fsid==Partitions::fsid_lvm || (part["type"]:`unknown == `evms && part["detected_fs"]:`none!=`unknown) ) { vfstype = FileSystems::GetMountString( used_fs, (format ? "ext2" : "auto")); freq = 1; if( mount_point == "/" ) { passno = 1; } else if( mount_point != "" ) { passno = 2; } else if( Stage::initial () && !Arch::s390 () ) { mount_point = "/data" + other_nr; // Don't mount and fsck this filesystem during boot, its // state is unknown. mntops = "noauto,user"; vfstype = "auto"; freq = 0; passno = 0; other_nr = other_nr + 1; y2milestone( "TT add MountPoint %1", mount_point ); } } else if( (Arch::i386()||Arch::ia64()||Arch::x86_64()) && size(mount_point)>0 && (used_fs==`vfat || used_fs==`ntfs) && (contains(union(union(Partitions::fsid_dostypes, Partitions::fsid_ntfstypes), Partitions::fsid_wintypes), fsid ) || fsid==Partitions::fsid_gpt_boot)) { freq = 0; passno = 0; string lower_point = tolower( mount_point ); if( lower_point != "" && mount_point != lower_point) { if( Installation::scr_destdir != "/" ) { lower_point = Installation::scr_destdir + lower_point; } y2milestone( "symlink %1 -> %2", substring(mount_point,(findlastof(mount_point,"/")+1)), lower_point ); SCR::Execute(.target.symlink, substring(mount_point,(findlastof(mount_point,"/")+1)), lower_point); } vfstype = FileSystems::GetMountString( used_fs, "auto" ); } else if( (Arch::sparc () || Arch::alpha ()) && contains (Partitions::fsid_skipped, fsid)) { return $[]; // skip "whole disk" partition } else { return $[]; // unknown type } if( part["detected_fs"]:`unknown == `unknown || part["noauto"]:false ) { passno = 0; } map ret = $[ "spec":spec, "mount":mount_point, "vfstype":vfstype, "mntops":mntops, "freq":freq, "device":part["device"]:"", "passno":passno ]; if( size(ret["mntops"]:"")==0 ) { ret["mntops"] = "defaults"; } y2milestone( "onepartition2fstab ret=%1", ret ); return( ret ); }; global boolean ProposalHome() { return( proposal_home ); } global void SetProposalHome(boolean val) { proposal_home = val; y2milestone( "SetProposalHome val:%1", proposal_home ); } global boolean ProposalLvm() { return proposal_lvm; } global void SetProposalLvm(boolean val) { proposal_lvm = val; y2milestone("SetProposalLvm val:%1", proposal_lvm); } global boolean ProposalEncrypt() { return proposal_encrypt; } global void SetProposalEncrypt(boolean val) { proposal_encrypt = val; y2milestone("SetProposalEncrypt val:%1", val); } global string ProposalPassword() { return proposal_password; } global void SetProposalPassword(string val) { proposal_password = val; y2milestone("SetProposalPassword"); } global boolean ProposalEvms() { return false; } global void SetProposalDefault( boolean home_only ) { SetProposalHome( cfg_xml["home"]:false ); if( !home_only ) { if( cfg_xml["prop_lvm"]:false ) { SetProposalLvm(true); SetProposalEncrypt(false); SetProposalPassword(""); } else { SetProposalLvm(false); } } y2milestone("SetProposalDefault home:%1 lvm:%2 encypt:%3 home_only:%4", proposal_home, proposal_lvm, proposal_encrypt, home_only); } global map GetControlCfg() { integer StrToByte(string str) { integer bytes = 0; if (!LibStorage::StorageInterface::humanStringToByte(sint, str, true, bytes)) y2error("cannot parse %1", str); return bytes; } if (size(cfg_xml) == 0) { boolean bt = ProductFeatures::GetBooleanFeature( "partitioning", "try_separate_home" ); cfg_xml["home"] = bt?true:false; cfg_xml["root_percent"] = tointeger(ProductFeatures::GetStringFeature( "partitioning", "root_space_percent")); if( cfg_xml["root_percent"]:0 == nil || cfg_xml["root_percent"]:0 <= 0 ) cfg_xml["root_percent"] = 40; string tmp = ProductFeatures::GetStringFeature( "partitioning", "limit_try_home"); cfg_xml["home_limit"] = StrToByte(tmp) / (1024*1024); if( cfg_xml["home_limit"]:0 <= 0 ) cfg_xml["home_limit"] = 5*1024; tmp = ProductFeatures::GetStringFeature( "partitioning", "root_base_size"); cfg_xml["root_base"] = StrToByte(tmp) / (1024*1024); if( cfg_xml["root_base"]:0 <= 0 ) cfg_xml["root_base"] = 3*1024; tmp = ProductFeatures::GetStringFeature( "partitioning", "root_max_size"); cfg_xml["root_max"] = StrToByte(tmp) / (1024*1024); if( cfg_xml["root_max"]:0 <= 0 ) cfg_xml["root_max"] = 10*1024; tmp = ProductFeatures::GetStringFeature( "partitioning", "vm_desired_size"); cfg_xml["vm_want"] = StrToByte(tmp) / (1024*1024); if( cfg_xml["vm_want"]:0 <= 0 ) cfg_xml["vm_want"] = 15*1024; tmp = ProductFeatures::GetStringFeature( "partitioning", "vm_home_max_size"); cfg_xml["home_max"] = StrToByte(tmp) / (1024*1024); if( cfg_xml["home_max"]:0 <= 0 ) cfg_xml["home_max"] = 25*1024; bt = ProductFeatures::GetBooleanFeature( "partitioning", "proposal_lvm" ); cfg_xml["prop_lvm"] = bt?true:false; SetProposalDefault(false); y2milestone("GetControlCfg cfg_xml:%1", cfg_xml); } return cfg_xml; } global boolean BootEvms() { return false; } global string ProposalVM() { string ret = ""; map xml = GetControlCfg(); if (proposal_lvm) { ret = "system"; } y2milestone("ProposalVM lvm:%1 ret:%2", proposal_lvm, ret); return ret; } global void AddHwPackage( string name ) { y2milestone( "AddHwPackage name %1 list:%2", name, hw_packages ); if( find( string s, hw_packages, ``(s==name)) == nil ) hw_packages = add( hw_packages, name ); y2milestone( "AddHwPackage list:%1", hw_packages ); } global void SwitchUiAutomounter(boolean on) { y2milestone("SwitchUiAutomounter on:%1", on); if (!on) { SCR::Execute(.dbus.method, $[ `destination : "org.freedesktop.Hal", `path : "/org/freedesktop/Hal/Manager", `interface : "org.freedesktop.Hal.Manager", `method : "AcquireGlobalInterfaceLock" ], [ "org.freedesktop.Hal.Device.Storage", true ]); } else { SCR::Execute(.dbus.method, $[ `destination : "org.freedesktop.Hal", `path : "/org/freedesktop/Hal/Manager", `interface : "org.freedesktop.Hal.Manager", `method : "ReleaseGlobalInterfaceLock" ], [ "org.freedesktop.Hal.Device.Storage" ]); } y2milestone("SwitchUiAutomounter exit"); } global void DumpObjectList() { if (!InitLibstorage(false)) return; LibStorage::StorageInterface::dumpObjectList(sint); } global define list NoProposeDisks() { if( no_propose_disks == nil ) { no_propose_disks = []; if( Stage::initial() && SCR::Read( .target.size, "/etc/install.inf" )>0 ) { string inst = (string) SCR::Read( .etc.install_inf.Partition ); y2milestone( "NoProposeDisks .etc.install_inf.Partition \"%1\"", inst ); if( inst!=nil && size(inst)>0 ) { if( search( inst, "/dev/" )!=0 ) inst = "/dev/" + inst; map d = GetDiskPartition( inst ); y2milestone( "NoProposeDisks inst:%1 disk:%2", inst, d ); if( size(d["disk"]:"")>0 ) no_propose_disks = add( no_propose_disks, d["disk"]:"" ); } inst = (string) SCR::Read( .etc.install_inf.Cdrom ); y2milestone( "NoProposeDisks .etc.install_inf.Cdrom \"%1\"", inst ); if( inst!=nil && size(inst)>0 ) { if( search( inst, "/dev/" )!=0 ) inst = "/dev/" + inst; map d = GetDiskPartition( inst ); y2milestone( "NoProposeDisks inst:%1 disk:%2", inst, d ); if( size(d["disk"]:"")>0 ) no_propose_disks = add( no_propose_disks, d["disk"]:"" ); } } if( Stage::initial() ) { map ret = (map)SCR::Execute( .target.bash_output, "echo $YAST2_STORAGE_NO_PROPOSE_DISKS" ); y2milestone( "NoProposeDisks ret \"%1\"", ret["stdout"]:"" ); list ls = filter( string e, splitstring( ret["stdout"]:"", " \t\n" ), ``(size(e)>0) ); no_propose_disks = (list)merge( no_propose_disks, ls ); } y2milestone( "NoProposeDisks \"%1\"", no_propose_disks ); } return( no_propose_disks ); } global void SetDefaultMountBy(symbol mby) { integer val = fromSymbol( conv_mountby, mby ); LibStorage::StorageInterface::setDefaultMountBy(sint, val); } global symbol GetDefaultMountBy() { integer val = LibStorage::StorageInterface::getDefaultMountBy(sint); symbol ret = toSymbol(conv_mountby, val); return ret; } global symbol GetMountBy( string device ) { integer val = 0; integer r = LibStorage::StorageInterface::getMountBy( sint, device, val ); symbol ret = toSymbol( conv_mountby, val ); return( ret ); } global boolean DeviceMatchFstab( string device, string fstab_spec ) { boolean ret = false; map tg = GetTargetMap(); string ts = fstab_spec; if (IsKernelDeviceName(fstab_spec)) { // translate fstab_spec from old to new kernel device name ts = GetTranslatedDevices( $[], $[], [ fstab_spec ] )[0]:""; if( ts!=fstab_spec ) y2milestone( "DeviceMatchFstab translate %1 --> %2", fstab_spec, ts ); } list pl = GetPartitionLst( tg, ts ); ret = find( map p, pl, ``(p["device"]:"" == device) )!=nil; y2milestone( "DeviceMatchFstab device:%1 fstab:%2 ret:%3", device, fstab_spec, ret ); return( ret ); } global boolean IsPersistent( map p ) { boolean ret = contains( [ `lvm, `sw_raid, `dm ], p["type"]:`unknown ); if( !ret && contains( [ `evms, `primary, `logical, `extended ], p["type"]:`unknown )) { map d = GetDisk( GetTargetMap(), p["device"]:"" ); if( p["type"]:`unknown==`evms ) ret = d["is_container"]:false || p["evms_native"]:false; else ret = d["type"]:`CT_UNKNONW==`CT_DMRAID || d["type"]:`CT_UNKNONW==`CT_DMMULTIPATH || size(d["udev_id"]:[])>0; } y2milestone( "IsPersistent device:%1 ret:%2", p["device"]:"", ret ); return( ret ); } global integer ActionsCount() { return size(LibStorage::StorageInterface::getCommitActions( sint, true )); } global boolean CheckEncryptionPasswords(string pw1, string pw2, integer min_length, boolean empty_allowed) { if (pw1 != pw2) { // popup text Popup::Message(_("The first and the second version\nof the password do not match. Try again.")); return false; } if (size(pw1) == 0 && !empty_allowed) { // popup text Popup::Message(_("You did not enter a password. Try again. ")); return false; } if (size(pw1) < min_length && !empty_allowed) { // popup text Popup::Message(sformat(_("The password must have at least %1 characters. Try again. "), min_length)); return false; } if (size(pw1) >= min_length || empty_allowed) { any tmp = findfirstnotof( pw1, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#* ,.;:._-+!$%&/|\?{[()]}@^\\<>" ); if (tmp != nil && size(pw1) > 0) { // popup text Popup::Message(_("The password may only contain the following characters: 0..9, a..z, A..Z, and any of \"@#* ,.;:._-+!$%&/|\?{[()]}^\\<>\". Try again.")); return false; } } return true; } global boolean CheckCryptOk( string dev, string fs_passwd ) { integer i = LibStorage::StorageInterface::verifyCryptPassword( sint, dev, fs_passwd ); if( i!=0 ) Popup::Error( sformat(_("Could not set encryption. System error code is %1. The crypt password provided could be incorrect. "), i )); y2milestone( "CheckCryptOk dev:%1 pwlen:%2 ret:%3", dev, size(fs_passwd), i==0 ); return( i==0 ); } } 0707010006A49E000081A40000018F0000018F000000014F1036760003E33D000000080000000100000000000000000000004500000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/RootPart.ybcYaST bytecode 1.4.0RootPartv RootPart.ycp  DirectoryModeLinuxrcStoragePopup ModuleLoading FileSystemsUpdate  SuSERelease  FileUtils Arch String  InstallationReportLabelStageWizard$partitioning/custom_part_dialogs.ycp  PartitionsPackage"partitioning/partition_defines.ycp kmgt_str_to_byte notUsedMountpoints   PartedSizeToClySingleMountPointProposal &partitioning/custom_part_helptexts.ycp GetCreateCryptFsHelptext GetUpdateCryptFsHelptext getEditOrCreateHelptext getCreateEditExtendedHelptext getMainHelptext  getMainHelptextS390 ! ia64_gpt_text ",partitioning/custom_part_check_generated.ycp #Product$ AutoinstData%check_created_partition_table &check_devices_used 'check_device_edit(check_device_delete)check_extended_delete*check_unique_label +CheckFstabOptions,DlgCreateCryptFs  -QueryProposalPassword.DlgUpdateCryptFs   / DoInputChecks  0FileSystemOptions  1PopupNoSlashLabel 2 FstabOptions   3FileSystemsComboBox  4 CryptButton 5 FsidComboBox  6 FormatDlg  7ChangeExistingSymbolsState 8MountDlg 9&UseChangedPartitionContinueCancelPopup:#ModifyPartitionInSystemWarningPopup  ;FsysCannotShrinkPopup<FsysCannotGrowPopup=FsysCannotResizeMountPopup  >FsysShrinkReiserWarning?FstabAddDialog@ReallyInstPrepdisk AdeleteAllDevPartitions Bpossible_root_fsCselectedRootPartition DpreviousRootPartition ErootPartitions FnumberOfValidRootPartitionsGshowAllPartitionsHdidSearchForRootPartitionsItargetOkJdid_try_mount_partitionsKalready_checked_jfs_partitions Lnon_modular_fs M activated  NMountedOsdb PGetInfoOfSelected  QSetSelectedToValid RAddToTargetMap SRemoveFromTargetMap TUnmountPartitions UAddMountedPartition   V FSCKPartition  WAnyQuestionAnyButtonsDetails     X RunFSCKonJFS   YMountPartition    Z FsckAndMount    [check_root_device  \FindPartitionInFstab  ]backward_translation  ^update_mount_options  _TranslateFsOrCryptoTab  ` readFsTab a readCryptoTab bFstabHasSeparateVarc%FstabUsesKernelDeviceNameForHarddisksdMountVarIfRequired  eread_fstab_and_cryptotab fPrepareCryptoTabg IsMounted h CheckBootSize i MountFSTab jMountVarPartition  kMountUserDefinedVarPartitionlMountPartitions mSetFormatPartitionsn GetArchOfELF  oIncompleteInstallationDetected pCheckPartitionqFindRootPartitions r GetDistroArch s mount_targettDetect uPropose """#"""$"BB%CC(DD+EE/FF2GG5HH8II;JJ>NNWPPgwhat QQTTkeep_in_targetWW,headline question  button_yes  button_no details llYroot_device_current mm fstabpartoo mounted_to qqrrss ttuu/ force_reset3UI UserInput OpenDialog   CloseDialog ChangeWidget   QueryWidget   ReplaceWidget  SetFocus  WidgetExists 3WFM SCRGetDefaultcall Execute3SCRReadExecute RegisterAgent UnregisterAgent3UI UserInput OpenDialog   CloseDialog ChangeWidget   QueryWidget   ReplaceWidget  SetFocus  WidgetExists 0update3 Directoryybindir logdir 3Modenormal autoupgradeconfigtest3Linuxrcmanual3Storage GetDeviceName  IsKernelDeviceName  GetTargetMap GetDiskPartition  GetPartition   GetOndiskTarget  DeleteDevice   GetMountBy  RemoveDmMapsTo   SetTargetMap   DeviceMounted  Umount CanEdit CanDeletemountedPartitionsOnDisk  ChangeText SetPartitionData    DeviceRealDisk PerformLosetupDetectFs  GetTranslatedDevices  ProposalPassword SetProposalPassword  DeviceMatchFstab  CheckEncryptionPasswords  3PopupError  ContinueCancelHeadline  ContinueCancel YesNo  AnyQuestion3       Message  Warning   TimedWarning  3 ModuleLoadingLoad     3 FileSystemsnchars SuggestMPoints GetGeneralFstabOptions GetArbitraryOptionField GetFstabOptWidgets  GetMountString    MountUuid  MountLabel  LabelLength  IsSystemMp RemoveCryptOpts   CanDoQuotaHasQuotaRemoveQuotaOpts   AddQuotaOpts  3UpdateGetProductName3 SuSEReleaseReleaseInformation  3 FileUtilsExists 3Archsparc32sparc board_iseries board_preps390ia64 board_mac board_chrp3StringQuote   FormatSize 3 Installationrun_yast_at_boot  updateVersion installedVersion destdir mountlog 3ReportError  3Label CancelButton ContinueButton  YesButton NoButton  FinishButton OKButton  HelpButton  WarningMsg 3Stageinitial3 Wizard SetContents    1"$partitioning/custom_part_dialogs.ycp0storage3 Partitions  fsid_swapfsid_prep_chrp_boot no_fsid_menuEfiBoot DefaultFs  BootMount BootCylPrepBoot ToHexString  FsIdToString 3Package InstallAll 1""partitioning/partition_defines.ycp0!storage%-input ""numberpos""$/$0  findfirstnotof   +(2&&43""&4   substring  (7 size     filterchars   0123456789kKmMgGtTbBoO . size 48""-9&<    filterchars   0123456789kKmMgGtTbBoO.(>&& size   findfirstnotof   0123456789.4? last_char  number_str ""$A   substring  - size (C||||||bBoO4E""&F   substring  - size &H   substring  - size $K   substring  - size (M  findfirstnotof   0123456789.4N""(O||kK4P""&Q tointeger*tofloat1024.(S||mM4T""&U tointeger**tofloat1024.1024.(W||gG4X""&Y tointeger***tofloat1024.1024.1024.(\||tT4]""&^ tointeger****tofloat1024.1024.1024.1024.4b""&c4g""&h(k size 4l""&m4p""&q tointeger-s% targetMap all_mountpoints "" mountpointsnot_used_mountpoints ""(|| 4""& $  maplistdevdevmap""    maplistpart""  partitions  mount&flatten&union $   filtermnt "" !contains-% win_size_fcyl_size"" new_length_f new_length_i""$/tofloat$ tointeger,   y2debug   'new_length_f: <%1> - new_length_i: <%2>(tofloattofloat4""&+-%""(-4 free_list""$ - 2$partitioning/custom_part_dialogs.ycp1#&partitioning/custom_part_helptexts.ycp0storage%minpwlenformattmpcrypt#"helptext #"$!(#4$#"&&*

Create an encrypted file system.

storage4,#"&.*

Access an encrypted file system.

storage&5+   

Keep in mind that this file system is only protected when it is not mounted. Once it is mounted, it is as secure as every other Linux file system.

storage(=4>#"(?4@#"&A+   !

This mount point corresponds to a temporary filesystem like /tmp or /var/tmp. You may leave the crypt password empty. If you do this, the system will create a random password at system startup for you. This means, you will lose all data on these filesystems at system shutdown.

storage&J+   

If you forget your password, you will lose access to the data on your file system. Choose your password carefully. A combination of letters and numbers is recommended. To ensure the password was entered correctly, enter it twice.

storage&S+      sformat   

You must distinguish between uppercase and lowercase. A password should have at least %1 characters and, as a rule, not contain any special characters (e.g., letters with accents or umlauts).

storage&[+      sformat   

Possible characters are %1, blanks, uppercase and lowercase letters (A-Za-Z), and digits 0 to 9.

storage"#*,.;:._-+!$%&/|?{[()]}^\<>!&d+   %

Do not forget this password!

storage-h%lhelptext #"$o7

You will need to enter your crypt fs password.

storage&t+   

If the encrypted file system does not contain any system file and therefore is not needed for the update, you may select Skip. In this case, the file system is not accessed during update.

storage-{%new_val edit_format#" helptextCR #"$(4#"&l

On already-existing partitions, you can change everything except the start and size of the partition.

storage4#"&^

First, choose the type of the partition and whether this partition should be formatted.

storage&+   @

Then, enter the mount point ( /, /boot, /usr, /var, etc.)

storage(!create4#"&+   

To change the start or end cylinder, delete this partition then create a new one with the new parameters. All data on this partition will be lost.

storage4#"&+   G

Now, enter the location of the new partition on your hard disk.

storage&+   C

Please enter the starting cylinder number of the partition.

storage&+   m

After that, either specify an ending cylinder number or an offset from the first cylinder (e.g., +66).

storage&+   b

It is also possible to specify the size of the partition directly (e.g., +100M or +20000K).

storage-% helptextCR #"$

Enter the starting cylinder number of the partition. After that, either specify an ending cylinder number or an offset from the first cylinder (e.g., +66). It is also possible to specify the size of the partition directly (e.g., +2G, +100M, or +20000K).

storage-% installation#" help_text #"$&%

Partition your hard disks...

storage&+   

This is intended for experts. If you are not familiar with the concepts of hard disk partitions and how to use them, you might want to go back and select automatic partitioning.

storage(4#"&+   

Please note that nothing will be written to your hard disk until you confirm the entire installation in the last installation dialog. Until that point, you can safely abort the installation.

storage4#"&+   

Nothing will be written to your hard disk until you confirm all your changes with the "Apply" button. Until that point, you can safely abort.

storage&+   

For LVM setup, using a non-LVM boot partition is necessary. Other than the boot partition, you should have partitions managed by LVM.

storage&+   U

The table to the right shows the current partitions on all your hard disks.

storage&+   +   +   +   2

Hard disks are designated like this

storageX/dev/sda 1st disk
/dev/sdb 2nd disk
/dev/sdc 3rd diskstorage

etc.

storage8

This notation always refers to the entire disk.

storage&+   4

Partitions are designated like this:

storage&+   +   +   +   @

/dev/sda1 1st primary partition on the 1st disk.

storage@

/dev/sda2 2nd primary partition on the 1st disk.

storage

...



/dev/sda5 1st logical partition within the extended partition on the first disk. Note: this is always #5, even if there are less than four primary partitions.

storage&+   +   /

/dev/sda6 2nd logical partition

storage

...

&+   

On the i386 platform (i.e., normal PCs), there cannot be more than four primary partitions on any hard disk, because the respective table in the master boot record cannot contain more than four entries.

storage&+   x

Older PCs may have a BIOS limitation that restricts bootable partitions to cylinders below 1024.

storage& +    

If you have an older PC and want to boot from a partition, make sure it ends below this 1024 cylinder boundary. Create a separate partition and mount it as /boot, if necessary. A partition consisting of one single cylinder (at least 64 MB) is usually sufficient for that.

storage&+   

One of the four primary partitions may be an extended partition. This extended partition can contain one or more logical partitions.

storage&+   

The extended partition itself cannot hold any data. To use its space, create logical partitions. These logical partitions may contain any kind of Linux partition (Linux file systems or Linux swap partition) or partitions for other operating systems.

storage&!+   

In connection with advanced boot managers such as GRUB, you can even boot your computer from a logical partition.

storage&&+   

The extended partition will overlap with the logical partitions: for an extended partition from cylinder 200 to 500, logical partitions could range from, for example, 200 to 250, 251 to 400, and 401 to 500.

storage&-+   

An asterisk (*) after the mount point indicates a file system that is currently not mounted (for example, because it has the noauto option set in /etc/fstab).

storage&3+   

The column labeled F contains flags. C means the partition is encrypted. F means the partition is selected to be formatted.

storage&9+   

Used By tells if a device is used by LVM or RAID. If you do not use such things, it is perfectly normal for this column to be empty.

storage&?+   

Mount By indicates how the file system is mounted: (K) by Kernel Name, (L) by Label, (U) by UUID, (I) by Device ID, and (P) by Device Path.

storage-G%J  help_text #"$L&O\

For a root file system on SCSI disks, add a /boot partition on DASD to use for IPL.

storage&U+   

The table to the right shows the current partitions on all your hard disks. Nothing will be written to your hard disk until you confirm the entire installation in the last installation dialog. Until that point, you can safely abort the installation.

storage&\+   

Hard disks are designated like this:

/dev/dasda First DASD disk /dev/dasdb Second DASD disk /dev/dasdc Third DASD disk

- or -

/dev/sda First SCSI disk /dev/sdb Second SCSI disk /dev/sdc Third SCSI disk

storage&g+   7

This notation always refers to the entire disk.

storage&k+   

If a DASD disk is selected for low level formatting with the dasdfmt command, an X appears in the third column of the line corresponding to the disk.

storage&s+   ,

Partitions are designated like this:

/dev/dasda1 First partition on the first DASD disk.

/dev/dasda2 Second partition on the first DASD disk.

/dev/dasda3 Third partition on the first DASD disk.

/dev/sda1, etc., for SCSI.

storage-{%~!#"-VWarning: With your current setup, your installation will encounter problems when booting, because the disk you have your /boot partition on does not contain a GPT disk label. It will probably not be possible to boot such a setup. If you need to use this disk for installation, you should destroy the disk label in the expert partitioner.storage2$partitioning/custom_part_dialogs.ycp1$,partitioning/custom_part_check_generated.ycp3Productname 3 AutoinstDataBootCylWarningBootRaidWarningBootLVMWarning1!&partitioning/custom_part_helptexts.ycp0#storage%0% targetMap  installation"$"show_all_popupsdiskless"partition_mounted_but_not_formated have_swapretval sparc_first_is_swapsparc_first_dev  swap_found boot_found  root_found  gpt_warning  gpt_boot_ia64 boot_end root_end root_raid boot_raidroot_lvmroot_fs boot_fs  boot_size_kboot_size_checkroot_cyl_for_gbboot_cyl_for_gbfat_system_mountfat_system_boot dmraid_root raid_type "$"/,2    y2milestone   1now checking generated target map installation:%1$4$6$8$9$:next$;$<$=$>$? $@ $A $B $C $D$E$F$Gunknown$Hunknown$I$J!||||||$K$L$M$N$O$P,R    foreachdisk diskinfo"$"   part_infocyl_size"$"$T partitions $Ucyl_size@B(W  contains CT_DISK CT_DMRAIDCT_DMMULTIPATH CT_MDPART type CT_UNKNOWN&X,Z  foreachpart"$" fsid mountpoint "$"$\fsid$] mount(c/4d"$" (e labelgpt4f"$"&g &i &j type CT_UNKNOWN CT_DMRAID&k -+regionregion(l!  contains primarylogical typeunknown4m"$"&o &q used_fsunknown&r/@cyl_size@B(t typeunknownsw_raid&t(u!&u  raid_type(v typeunknownlvm&v(x4y"$"(z labelgpt4{"$"&| (~&&|| labelgptgpt4"$"& &( type CT_UNKNOWNCT_DISK4"$"& -+regionregion&/@cyl_size@B4"$"& && used_fsunknown&size_k( typeunknownsw_raid&&  raid_type(4"$"(&&||4"$"&& -+regionregion& used_fsunknown&/@cyl_size@B&size_k(&& used_fsunknownhfs4"$"&& -+regionregion& used_fsunknown&/@cyl_size@B&size_k(swap4"$"&(&&&& typeunknownprimarynr4"$"&&(&& used_fsunknownvfatformat4"$"(&&!  contains /usr//home/var/opt4"$"&(&&&&!|| used_fsunknownvfatformat4"$"(&&!/boot4"$"&(&&&&!format used_fsunknownnfs  mount4"$"&,    y2milestone    diskless:%1,    y2milestone   root_found:%1 boot_found %2 ,    y2milestone   5dmraid_root:%1 root_raid %2 boot_raid %3 raid_type:%4(||&&&&! 4ret"$"$    sformat   The disk label type on your system disk is GPT. Linux can handle a GPT partition table fine, but most BIOS versions cannot handle this disk label. To remove the GPT disk label from a disk, use the menu entry "%1" of the "%2" button. Change your partitioning? storage    deletechars   Create New Partition Tablestorage&    deletechars   Expert..storage&(&again(||&&! 4"$", Z YaST2 needs a root partition to install. Assign the root mount point "/" to a partition. storage&again(||4"$", You tried to mount a fat partition to one of the following mount points: / /usr /home /opt /var. Use a Linux file system, such as ext3 or reiserfs, for these mount points. storage& again(||4"$", You tried to mount a fat partition to the mount point /boot. Use a Linux file system, such as ext2, ext3 or reiserfs, for this mount point. storage&again(||&&4"$"(|| 4ret"$"$    sformat   Warning: Your boot partition ends above cylinder %1. Your BIOS does not seem able to boot partitions above cylinder %1. With the current setup, your %2 installation might not be directly bootable. Change this? storage((&(again(-||&& 4.ret"$"$0    sformat   Warning: With the current setup, your %1 installation might not be directly bootable. Some PROM versions have problems with a boot partition with an end cylinder above 1 GB. Change this? storage(:&:again(>||&&* 4?ret"$"$A zWarning: Your boot partition is less than 12MB. It is recommended to increase the size of /boot. Do you want to do this? storage(H&Hagain(N||&&!4O"$"(S||&&&&!!4Tret"$"$X Warning: There is no partition mounted as /boot. To boot from your hard disk, a small /boot partition (approx. 4MB) is required. Consider creating one. (Partitions assigned to /boot will automatically be changed to type 0x41 PReP/CHRP). Do you want to change your setup? storage(a&aagain(g&&|| 4hret"$"$j    sformat   8Warning: According to your setup, you intend to boot your machine from the root partition (/), which, unfortunately, has an end cylinder above %1. Your BIOS does not seem capable of booting partitions beyond the %1 cylinder boundary, which means your %2 installation will not be directly bootable. Change this? storage(t&tagain(w||&& 4xret"$"$z    sformat   Warning: With your current setup, your %1 installation might not be directly bootable, because some PROM versions have problems with a boot partition ending above the 1 GB boundary. Change this? storage(&again(||&&ext24ret"$"$    sformat   Warning: With your current setup, your %1 installation might not be directly bootable, because some PROM versions have problems with a boot partition ending above the 1 GB boundary. Change this? storage(&again(&&&&&&!||&&||&&!raid14ret"$"$    sformat   Warning: With your current setup, your %1 installation might not be directly bootable, because your files below "/boot" are on a software RAID device. The boot loader setup sometimes fails in this configuration. Change this? storage(&again(&&&&&&!||&&!4ret"$"$    sformat   <Warning: With your current setup, your %1 installation will encounter problems when booting, because you have no "boot" partition and your "root" partition is an LVM logical volume. This does not work. If you do not know exactly what you are doing, use a normal partition for your files below /boot. Change this? storage(&again(||&&&&||||!vfat4ret"$"$    sformat   >Warning: With your current setup, your %2 installation will encounter problems when booting, because you have no FAT partition mounted onto %1. This will give severe problems with the normal boot setup. If you do not know exactly what you are doing, use a normal FAT partition for your files below %1. Change this? storage(&again(||&&!4ret"$"$    sformat   KWarning: With your current setup, your installation will probably encounter problems when booting, because you have no separate %1 partition on your RAID disk. This will give severe problems with the normal boot setup. If you do not know exactly what you are doing, use a normal partition for your files below %1. Change this? storage(&again(||&&&&&&|| 4ret"$"$ +   +   !  Change this?storage(&again(||&&&&!nfs4ret"$"$  You have not assigned a swap partition. There is nothing wrong with that, but in most cases it is highly recommended to create and assign a swap partition. Swap partitions on your system are listed in the main window with the type "Linux Swap". An assigned swap partition has the mount point "swap". You can assign more than one swap partition, if desired. Do you want to change this? storage(&again(||4"$",    sformat    Your swap partition is the first partition of %1. It is strongly recommended to change this, because the disk label will be deleted. storage&again( ||&&4 message ret"$"$ +   +   +    WARNING: You chose to install onto an existing partition that will not be formatted. YaST2 cannot guarantee your installation will succeed, particularly in any of the following cases: storage- if this is an existing ReiserFS partition - if this partition already contains a Linux distribution that will be overwritten - if this partition does not yet contain a file system storageIf in doubt, you might want to go back and mark this partition for formatting, especially if it is assigned to one of the standard mount points like /, /boot, /usr, /opt, or /var. storagegIf you decide to format the partition, all data on it will be lost. Do you want to change your setup? storage$$ (&&&again-)next%-& partitionsnot_cr"$"ret pl"$"$/UB_NONE$0filterp"$"   used_by_typeUB_NONEUB_NONE(2&&size43tg ppl"$"$4$5 ,6  foreachp"$" "$"(8||  used_by_typeUB_NONEUB_MD  used_by_typeUB_NONEUB_DM4:dev pa"$"$; used_by(<&&  used_by_typeUB_NONEUB_MD  search  /dev/&>+   /dev/(?&&  used_by_typeUB_NONEUB_DM  search   /dev/mapper/&A+    /dev/mapper/$B(C||size!create&Dadd(F  used_by_typeUB_NONEUB_LVM4G"$"(H!+   /dev/ used_bycreate&Iadd&L(Nsize&O  used_by_typeUB_NONE-P%U' curr_part bsd_label"$"used ret"$"([&&&& typeunknownprimarynr4]"$",_ +Partition 3 "Entire Disk" is not changeablestorage-`$c&(eUB_MD4f"$",h    sformat   YThe selected device belongs to the RAID (%1). Remove it from the RAID before editing it. storage used_by-k(mUB_LVM4n"$",p    sformat   gThe selected device belongs to a volume group (%1). Remove it from the volume group before editing it. storage used_by(tUB_NONE4u"$",w    sformat   QThe selected device is used by volume (%1). Remove the volume before editing it. storage used_by${UB_NONE(|&}-~%( curr_part bsd_label installationdisk"$" part_name used ret"$" $ device(4"$"(&&&& typeunknownprimarynr4"$", +Partition 3 "Entire Disk" is not changeablestorage-$&(UB_NONE4"$"(UB_LVM4"$",    sformat   dThe device (%2) belongs to a volume group (%1). Remove it from the volume group before deleting it. storage used_by(UB_MD4"$",    sformat   VThe device (%2) belongs to the RAID (%1). Remove it from the RAID before deleting it. storage used_by4"$",    sformat   =The device (%2) is used by %1. Remove %1 before deleting it. storage used_by-(!4mounts "$"$(4message "$"$   sformat   The selected device is currently mounted on %1. It is *strongly* recommended to unmount it manually before deleting it. Click Cancel unless you know exactly what you are doing. If you proceed, YaST2 will try unmounting before deleting it. storage(! 4"$"-4ret "$"$none*"$"(!4"$"&   sformat   0Unmount of %1 failed. Remove the device anyway? storage&  &Retry umountstorage focus_yesretry(no-(&&! typeunknownlogical4okppl"$"$$filterp"$"  partitions nrnr(&&size&UB_NONE&(&&&&!size4i"$"$)&&size4"$"( size  device&&+(!4"$",    sformat   The device (%1) cannot be removed Since it is a logical partition and another logical partition with higher number is in use. storage-$UB_NONE(&-%) curr_disk installation"$" partitionsdel_dev  logical_partslogical_parts_namesused ret"$"$ partitions $ device$ filterpart"$"  typeprimarylogical,     y2milestone   &check_extended_delete logical_parts %1$  &  maplistp"$"  device,    y2milestone   ,check_extended_delete logical_parts_names %1( -(!4mounts"$"$,    y2milestone   check_extended_delete mounts:%1&filtermount"$" contains device,    y2milestone   check_extended_delete mounts:%1(size4 mounted_parts message "$"$#,$  foreachmount"$" "$"&'+   +      sformat    %1 --> %2 device mount $-   sformat   The selected extended partition contains partitions which are currently mounted: %1 It is *strongly* recommended to unmount these partitions before you delete the extended partition. Please choose Cancel unless you know exactly what you are doing. storage(3! 44"$"-5$:&(<UB_LVM4="$",?  The selected extended partition contains at least one LVM partition assigned to a volume group. Remove all partitions from their respective volume groups before deleting the extended partition. storage(FUB_MD4G"$",I  The selected extended partition contains at least one partition that is part of a RAID system. Unassign the partitions from their respective RAID systems before deleting the extended partition. storage(PUB_NONE4Q"$",S  The selected extended partition contains at least one partition that is in use. Remove the used volume before deleting the extended partition. storage$YUB_NONE(Z4[extd"$"$\findp"$"  typeprimaryextended(^&&size&_-a2$partitioning/custom_part_dialogs.ycp%,,device minpwlenformattmpcrypt"helptext h label password widget " $/,0    y2milestone   <DlgCreateCryptFs device:%1 minpwlen:%2 format:%3 tmpcrypt:%4$42Enter your password for the encrypted file system.storage$6!Don't forget what you enter here!storage(748"&9+    &:+   Empty password allowed.(= size &?   sformat   (Password for Encrypted File System on %1storage,A opt decoratedHBoxHWeightRichTextHWeightVBoxVSpacing0.3HBoxHSpacingHeadingHSpacingVSpacingHBoxHSpacingVBoxLabelVSpacingHBoxPasswordidpw1'&Enter a password for your file system:storageHSpacingVSpacing0.5HBoxPasswordidpw2'Reenter the password for &verification:storageHSpacingHSpacingVSpacing ButtonBox PushButtonidokoptdefault PushButtonidcancelVSpacing0.5$p$q+s",vidpw1Value,widpw2Value,yidpw1&{ 5oktmp "& idpw1Value$ idpw2Value(!&again.||cancelok,(ok4"-4"-%-password widget "( size -,VBoxLabel0Enter your password for the proposal encryption.storageMinWidth(Passwordidpw1 Password:storageVSpacing0.5MinWidth(Passwordidpw2&Reenter the password for verification:storageLabel!Don't forget what you enter here!storage ButtonBox PushButtonidokoptdefault PushButtonidcancel$$+",idpw1Value,idpw2Value,idpw1& 5oktmp "& idpw1Value$ idpw2Value(!&again.||cancelok,(ok4",-4"-%.device mount "helptext enter ret  input_is_okpw1 pw2 " $$   sformat   7Enter your crypt password for device %1 mounted on %2. storage, opt decoratedHBoxHWeightRichTextHWeightVBoxVSpacing0.3HBoxHSpacingHeading1Enter your password for the encrypted file systemstorageHSpacingVSpacingHBoxHSpacingVBoxLabelVSpacingHBoxPasswordidpw1'&Enter a password for your file system:storageHSpacingVSpacing0.5HBoxPasswordidpw2'Reenter the password for &verification:storageHSpacingHSpacingVSpacingHBox PushButtonidokoptdefault PushButtonidcancel&SkipstorageVSpacing0.5$$$$ +"",%idpw1Value,&idpw2Value,(idpw1&* (-cancel4."&/ idpw1Value&0 idpw2Value(243",5 PThe first and the second version of the password do not match! Please try again.storage(748",: )You did not enter a password. Try again. storage(> size 4?"&@4C",E    sformat   :The password must have at least %1 characters. Try again. storage||cancel,M(Ocancel4P"-Q4T"-U%Z/entryquery "ret between valid_chars  str_length" $\ok$]between $^  valid_chars$_ str_length(a&& || size ! empty_allowed4b",c    y2milestone   !DoInputChecks entry:%1 query:"%2"(d|| tointeger&& tointeger4f",g   error_text&herror(l&&&& size error4m"(n  findfirstnotof  4o",p   error_text&qerror(u&&&& size error4v",w   error_text&xerror,z    y2milestone   DoInputChecks value %1 ret %2-{%0org_fs_options  fs_define" fs_options contents helptext iglistret ",    y2milestone   0FileSystemOptions org_fs_options:%1 fs_define:%2$$VBoxVSpacing$,  foreachoption" options  emptyterm add_help "$Empty&  add   widget$  help_text(&+   , opt decoratedVBoxHSpacing2LeftHeadingFile system options:storageVStretchVSpacingHBoxHStretchHSpacingHStretchHSpacingVSpacingVStretchHBoxLeft PushButtonidhelpopt helpButtonRightHBox PushButtonidokoptdefault PushButtonidcancel,helpHelpText,    foreach query_key option_map "  ",idValue option_value$ autononedefault$ok+"& (ok4",  foreachentry" options ",    y2milestone   FileSystemOptions entry %1(error4query fs_option "$ id query_keyValue,    y2milestone   FileSystemOptions query %1 $  option_str  option_str option_cmd  option_cmdmkfs option_value ,    y2milestone   FileSystemOptions fs_option %1 ( option_blank4"'  option_blank(&&  !contains 4"&/  (error4"(&& default!contains 4"' query_key (haskey query_key4"&  remove query_key,    y2milestone   FileSystemOptions fs_options %1||okcancel,(ok&,    y2milestone   FileSystemOptions ret %1-%1", The character '/' is no longer permitted in a volume label. Change your volume label so that it does not contain this character. storage%2old new " helptext contents  emptyterm opt_listentryfstopt opt_lstr  old_statepos arb_opt  ret"*$$VBox$Empty( enc_typenonenone4"&+   S

Mount in /etc/fstab By: Normally, a file system to mount is identified in /etc/fstab by the device name. This identification can be changed so the file system to mount is found by searching for a UUID or a volume label. Not all file systems can be mounted by UUID or a volume label. If an option is disabled, it is not possible. storage& +   

Volume Label: The name entered in this field is used as the volume label. This usually makes sense only when you activate the option for mounting by volume label. A volume label cannot contain the / character or spaces. storage&  add  VBoxRadioButtonGroupidmt_groupVBoxLeftLabelMount in /etc/fstab bystorageHBoxVBoxLeft RadioButtoniddevice &Device namestorageLeft RadioButtonidlabel Volume &labelstorageLeft RadioButtoniduuidU&UIDTopVBoxLeft RadioButtonidid Device &IDstorageLeft RadioButtonidpath Device &Pathstorage TextEntryid vol_labelopthstretch Volume &LabelstorageVSpacing$5 (6 mountswap47",8  foreachentry"  "&:add&<  add   widget&=+     help_text&?  add  VSpacing,A  foreachentry"   used_fsext2"&Cadd&D  add   widget&E+     help_text&G  add  VSpacing$H &Iadd&J  add   widget&K+     help_text$M    deletechars    fstopt (Ndefaults&O$Q    splitstring   ,$R $S,T  foreachopt" "(V typetextboolean4Wvalue"$Xdefault&Y)Zsize4[",\  foreachlist_el"  str_scan "(^   4_"&` 'a&d+'f  query_key4ivalue pos"$j default$k)lsize4m"(n&& size  str_scan   regexpmatch    str_scan4p"&q     regexpsub      str_scan\1's&u+'w  query_key&{-size)|4}"(~ size  4"&  remove&-,    y2milestone   FstabOptions key=%1 val:%2 -size query_key    mergestring   ,$     mergestring   ,(&&!noauto enc_typenonenone4"&   (&&  ' opt_quota&   ' -size query_key ,    y2milestone   FstabOptions old_state=%1, opt decoratedVBoxHSpacing2LeftHeadingFstab options:storageVStretchVSpacingHBoxHStretchHSpacingHStretchHSpacingVSpacingVStretchHBoxLeft PushButtonidhelpopt helpButtonRightHBox PushButtonidokoptdefault PushButtonidcancel,helpHelpText(-idmt_group4no_mountby_typemountby_id_path_typedefmb " $ loop$ primarylogical$! devicedevice,    y2milestone   FstabOptions defmb %1,idmt_group CurrentButton mountby,idlabelEnabled&&&&  used_fsunknown enc_typenonenone!contains typeprimary,iduuidEnabled&&&&||format size  uuid  used_fsunknown!contains typeprimary,ididEnabledcontains typenone,idpathEnabledcontains typenone(-id vol_label4",id vol_labelEnabled&&  used_fsunknown enc_typenonenone,id vol_label ValidChars+    -._:/,id vol_labelValue label,    y2milestone   FstabOptions Exists opt_user %1-idopt_user,    y2milestone   FstabOptions new=%1(-idopt_user4",idopt_userEnabled|| enc_typenonenonenoauto(-id opt_noauto4",id opt_noautoEnabled|| enc_typenonenonenoauto(-id opt_quota4",id opt_quotaEnabled ,  foreachkeyvalue"  ",idValue$ ok+"& ,    y2milestone   FstabOptions ret %1 (  opt_noauto4"(-idopt_user4val"$id opt_noautoValue,idopt_userEnabled|| enc_typenonenone( ok4 new_statetext  new_fstopt " (-idmt_group4"'mountbyidmt_group CurrentButton(&&&&!format!create mountbydevice mountbydevice4"(!haskey ori_mountby' ori_mountby mountbydevice'labelid vol_labelValue( label label4max_len"$  used_fsunknown( size  label4"'label   substring   label,    sformat   o Maximum volume label length for the selected file system is %1. Your volume label was truncated to this size. storage(   search   label/4 ", 1&  again(&&&&!format!create!haskey ori_label4"' ori_label label(&& mountbydevicelabel size  label4"& again, )Provide a volume label to mount by label.storage/(&& size  label!*4"& again, <This volume label is already in use. Select a different one.storage/ ("&& mountbydevicelabel  search   label/4$"&% again,&1/'(*-id opt_noauto4+"',noautoid opt_noautoValue$. $/$0,1  foreachentry" value"&3$4id  query_keyValue'6  query_key(7 typetextboolean48"&9 str_optdefault(:&&haskeystr_opt 4;"&< str_opt(>&&haskeystr_opt 4?"&@ str_opt4D"(E/ ok4F"&G again(I size  4J"&K   sformat    str_opt%1(N data=ordered4O"&P(S size 4T"(U size &V+   ,&W+   (Z&&-id opt_quotaid opt_quotaValue4\"&] (^&&! opt_quota4_",` quota,c    y2milestone   FstabOptions new_state=%1,d    y2milestone   (FstabOptions old_fstopt=%1 new_fstopt=%2 fstopt(f&& fstopt4g"(h&&&&!format!create!haskey ori_fstopt4j"'k ori_fstopt fstopt'mfstopt(o!+4p"'qfstopt fstopt&r again|| ok cancel,w,x    y2milestone   *FstabOptions fstopt %1 mountby:%2 label:%3 fstopt mountbydevice label-{%3new_val file_systems "fs_sel  filesystemsis_swapufs " $ $ $fsid,   y2debug   "FileSystemsComboBox new=%1 swap=%2$ used_fs,    foreachfile_system_name file_system_map"  "(&&real_fs||supports_format4"' 'text nameExt2('selectedswap'selected,    y2milestone   FileSystemsComboBox fs_sel=%1,    y2milestone   FileSystemsComboBox DefFs=%1(&&haskeysizefilterke"  selected4"'selected,    y2milestone   FileSystemsComboBox fs_sel=%1,    foreachfs_type entry"  "(swap&additemid textExt2selected(haskeyswap4"&additemidswap swaptextSwapswapselected-VBoxComboBoxidfsopthstretchnotify File &systemstorage PushButtonid fs_optionsopthstretch O&ptions...storage%4new_val"cr"(-Empty$ enc_typenonenone-VBoxLeftCheckBoxidcrypt_fsoptnotify&Encrypt devicestorage%5new_val file_systems "items  added_items added_fsidsidso val " $ $ $ ,  foreachfs_namefs_map"   fsid_item "$  fsid_item (!contains4"&   additemidfsidfsid&addfsid&add$fsid(&&!contains4part_id "$+   +    &   additemid$ 0x00x100x80x830xF$ ,    foreacht " "' ,    foreachs i"  ",    foreachmatch w"  found"$(&&!  search  4"'&&    sorta b "    -ComboBoxid fsid_pointoptnotifyeditablehstretchFile system &ID:storage%6new_val file_systems "fsid ",   y2debug   FormatDlg val:%1$Empty(&&&&&&&& typeprimarylvm typeprimarysw_raid typeprimaryevms typeprimaryloop!4 "& VBoxHBoxHSpacing ReplacePointid fsid_dlg_rp5VSpacing0.5VStretch4"&VSpacing0.5-FrameFormatstorageRadioButtonGroupidformatVBoxVSpacingLeft RadioButtonid format_falseoptnotifyDo ¬ formatstorage!formatLeft RadioButtonid format_trueoptnotify&FormatstorageformatHBoxHSpacing34VSpacing0.5%77symbolswhat"",9  foreachsym" ",:idEnabled%E8new_val mountpoints"mount dlg "(G&H//usr/var/home/opt(K&&!contains enc_typenonenone&Ladd$M mount(O!contains&Punion$RVBox PushButtonid fstab_optionsopthstretchFs&tab OptionsstorageVSpacingComboBoxid mount_pointopteditablehstretchnotify &Mount Pointstorage-\%b9"(e You have changed the parameters of a partition currently mounted. In some cases, this can damage your Linux installation. Proceed only if you know what you are doing. If you are unsure, press Cancel. storage-l-n%q:part mount "warning ret"$u   sformat   H The selected partition (%1) is currently mounted on %2. If you change parameters (such as the mount point or the file system type), your Linux installation might be damaged. Unmount the partition if possible. If you are unsure, it is recommended to abort. Do not proceed unless you know exactly what you are doing. Continue? storage$& -%;asklvm"rettxt "$$(!& The file system on the partition cannot be shrunk by YaST2. Only fat, ext2, ext3, and reiser allow shrinking of a file system.storage& The file system on the logical volume cannot be shrunk by YaST2. Only fat, ext2, ext3, and reiser allow shrinking of a file system.storage(4"&+    (!&+   2You risk losing data if you shrink this partition.storage&+   7You risk losing data if you shrink this logical volume.storage&+    &+    Continue?storage(4"& 4", &-%<asklvm"rettxt "$$(!& The file system on the selected partition cannot be extended by YaST2. Only fat, ext2, ext3, xfs, and reiser allow extending a file system.storage& The file system on the selected logical volume cannot be extended by YaST2. Only fat, ext2, ext3, xfs, and reiser allow extending a file system.storage(4"&+    &+   Continue resizing?storage(4"& 4", &-%=lvmmount "txt "$   sformat    The file system is currently mounted on %1. It is not possible to resize the file system while it is mounted. Unmount the file system and retry resizing. storage, %>lvm"rettxt "$$(!&:You decreased a partition with a reiser file system on it.storage&?You decreased a logical volume with a reiser file system on it.storage&+    &+    It is possible to shrink a reiser file system, but this feature is not very thoroughly tested. A backup of your data is recommended. Shrink the file system now?storage& -%? table_input"header  help_text  userinput idxret" ,    y2milestone   FstabAddDialog start %1(|| 4", 2No previous system with mount points was detected.storage-$header Device storage Mount storage$ +   +   

Attention:
YaST2 has scanned your hard disks and found an old Linux system with mount points. On the right, see a list with the mount points found.

storage7

To use these mount points,
press Yes.

storage:

To ignore these mount points,
press No.

storage, opt decoratedHBoxVBoxHSpacingRichTextVBoxVSpacing ReplacePointidheadingEmptyHBoxHSpacing3.VSpacingVBoxVSpacingTableidtable HSpacing3.VSpacingHeadingCWould you like to use these mount points for your new installation?storageVSpacing ReplacePointidbboxEmpty$)none$*++tmp bbox " $.   sformat   VA previous system with the following mount points was detected: /etc/fstab found on %1storage root /dev/emil,1idheadingHeading,3idtableItemstbl $5HBox PushButtonidokoptdefault PushButtonidcancel(9size4:"&;  add  HSpacing(<4="&>  add   PushButtonidshow_pShow &Previousstorage(A-size4B"&C  add   PushButtonidshow_n Show &Nextstorage,G    y2milestone   userinput UI::ReplaceWidget,Hidbbox,I    y2milestone   after UI::ReplaceWidget&K ,L    y2milestone    userinput %1(Nshow_n4O"&P+(Rshow_p4S"&T-,V    y2milestone   idx %1||okcancel,Y$[ok,\    y2milestone   ret %1-]%b@ret doto "$dnone$f,g    y2milestone   ReallyInstPrepdisk doto:%1(i size 4j",l No unsaved changes exist.storage&mback4pdlg "$qVBoxVSpacingHSpacing<LeftHeadingChanges:storageRichText,w opt decorated warncolorHBoxHSpacingVBoxVSpacingHeading- Do you really want to execute these changes?storageVSpacingHBox PushButtonidbackHStretch PushButtonidapply&Applystorage PushButtonidfinishVSpacing0.2HSpacing& ,,    y2milestone   ReallyInstPrepdisk ret=%1-%Adisk  installation bsd_label"go_ondel_dev "$$ device,    y2milestone   deleteAllDevPartitions disk:%1   remove partitions(!4mounts"$(size4 mounted_parts message "$,  foreachmount" "&+   +      sformat   %1 on %2 device mount $   sformat   The selected device contains partitions that are currently mounted: %1 It is *strongly* recommended to unmount these partitions before deleting the partition table. Choose Cancel unless you know exactly what you are doing. storage(! 4"&(4 partitionsused "$ partitions $&&UB_NONE(UB_LVM4",  The selected device contains at least one LVM partition assigned to a volume group. Remove all partitions from their respective volume groups before deleting the device. storage(UB_MD4",  The selected device contains at least one partition that is part of a RAID system. Unassign the partitions from their respective RAID systems before deleting the device. storage(UB_NONE4",  The selected device contains at least one partition that is used by another volume. Delete the volume using it before deleting the device. storage(&& type CT_UNKNONW CT_DMRAID4dp"$filterpart" nr max_primary,    y2milestone   deleteAllDevPartitions dp:%1&sortab"  nrnr,    y2milestone   deleteAllDevPartitions dp:%1,  foreachpart" "&&& device,    y2milestone   deleteAllDevPartitions ret:%1-2 RootPart.ycp$%B ext2ext3reiserxfsjfs$(C$+D$/E $2F$5G$8H$;I$>J$@K $BL procsysfs$UM %WN-XsizeM$_O   sformat   FSee the SDB article at %1 for details about how to solve this problem.updateThttp://support.novell.com/techcenter/sdb/en/2003/03/fhassel_update_not_possible.html%gPi$iEC (kname4k(m 4m-n (qcontainsB fsnil4q-sUnknown Linux Systemupdate4v-xNon-Linux Systemupdate4z-|Unknownupdate%Q&C,    foreachp i  E(&&validC&C%R target_map tmp$,    y2milestone   On disk target map: %1$filtere M typemount,  foreache ,    y2milestone   2Setting partition data: Device: %1, MountPoint: %2 device mntpt& devicemount mntpt(   issubstring   device/dev/disk/by-id& devicemountbyid(   issubstring   device/dev/& devicemountbydevice& devicemountbylabel&filtere M typeswap,  foreache ,    y2milestone   'Setting swap partition data: Device: %1 device& devicemountswap(   issubstring   device/dev/disk/by-id& devicemountbyid(   issubstring   device/dev/& devicemountbydevice& devicemountbylabel,    y2milestone   Setting target map: %1,%S target_map tmp$$filtere M typemount,  foreache & devicemount,%T,    y2milestone   UnmountPartitions: %1&J,  foreachinfo Mtype ,    y2milestone    Unmounting %1$ type(4(mount4file $+    mntpt(! SCR::Execute.target.umount4,   sformat   Cannot unmount partition %1. It is currently in use. If the partition stays mounted, the data may be lost. Unmount the partition manually or restart your computer. update(swap4device $ device( SCR::Execute .target.bash+   /sbin/swapoff 4,   y2error   Cannot deactivate swap %1(crypt4dmname $ device&+   cr_   substring  +   findlastof  /( WFM::Execute .local.bash+   cryptsetup remove 4,   y2error   Cannot remove dm device %1(!,S&M %Upartinfo  & M      prependM,    y2debug   adding %1 yields %2M%V partition (!4 detected_fs $(ext24out $   sformat   Checking partition %1update, opt decoratedLabel,    y2milestone   command: /sbin/e2fsck -y %1, SCR::Execute .target.bash+   /sbin/e2fsck -y , %,W has_details has_headingheading  popup_def details_checkbox  popup_buttons  userinputret$/(0||&0$2(3||&3$5VBoxLeftHeadingEmpty$=LeftLabel$?VBoxVSpacingLeftCheckBoxiddetailsoptnotify Show &DetailsupdateEmpty$HVBoxVSpacingHBoxHSpacing PushButtonidyesVSpacing PushButtonidcancelHSpacingVSpacing0.5,T opt decoratedVSquashVBoxLeftopthstretch ReplacePointid rp_detailsEmpty,_idyes$a$b)d4d&e(gyes4g&h.i(jdetails4j curr_status$kiddetailsValue(m4m,nid rp_detailsEmpty4o,pid rp_detailsMinSize< RichTextid details_textopt plainTexthstretch4{&|.},-%X mount_type device  error_message (&&jfs4cmd(  containsK4,    y2milestone   %Device %1 has been already checked...-,Label   sformat   Checking file system on %1...update,    y2milestone   Running fsck on %1$ SCR::Execute.target.bash_output   sformat   fsck.jfs -n %1,(exit4details ,   y2error    Result: %1& tostring stderr$( stdout4&+    stdout( stderr4&+   +     stderr-WFile System Check Failedupdate   sformat   fThe file system check of device %1 has failed. Would you like to continue in the mounting the device?update&Skip Mountingupdate4&K   addK,    y2milestone    Result: %1--%Y mount_point device  mount_type  error_message ret(& (4,    y2warning   (Unknown filesystem, skipping modprobe...(!  containsL4,    y2milestone   Calling 'modprobe %1', SCR::Execute.target.modprobe4,    y2milestone   /FS type %1 is not modular, skipping modprobe...$(!X 4-(&+   -t $ SCR::Execute .target.mount+   (--  SCR::Read.target.string%Z mount_point device  mount_type ret ,V$Y(,Utypemountdevicemntpt,     y2milestone   mounting (%1, %2, %3) yield %4+   - %[ partition fstabfound_partition tmproot$filterentry  file/(size4,   y2error   -not exactly one root partition found in fstab&none-$  ("! spec4#-&-D%M\fstab mountpoint tmp(N   substring  - size /&O   substring  - size $Qfilterentry || file file+   /(Vsize-W-Y spec$^] %`^options (a   regexpmatch  ^(.*,)?hotplug(,.*)?$-b     regexpsub    ^(.*,)?hotplug(,.*)?$ \1nofail\2-c%q_ translatekey_to_translate key_preserve_as  check_command cmd old_names  new_names i $s   sformat   $/usr/bin/find '%1/var/lib/hardware/'$t SCR::Execute.target.bash_output(vexit4vfiles  files_count$w    splitstring    stdout $xsize(y||4y,z   y2error   HThere are only %1 files in /var/lib/hardware/, translation needn't work!4{,|    y2milestone   (There are %1 files in /var/lib/hardware/$ ,  foreachm &   add $$)size4 default_val new_val $ $ ''']'mntops^ mntops&+,    y2milestone   !Current backward translations: %1]-%`fstab fstab_file $+    /etc/fstab(4, SCR::RegisterAgent .target.etc.fstab ag_anyagent DescriptionFile# ListTuple specString^  Separator fileString^  Separator vfstypeString^  Separator mntopsString^ Optional WhitespaceOptionalfreqNumberOptional WhitespaceOptionalpassnoNumberOptional WhitespaceOptionalthe_restString^  & SCR::Read.target.etc.fstab,SCR::UnregisterAgent.target.etc.fstab4,   y2error   !No such file %1. Not using fstab.%acrtab crtab_file $+   /etc/cryptotab(4, SCR::RegisterAgent .target.etc.cryptotab ag_anyagent DescriptionFile# ListTuple loopString^  Separator fileString^  Separator mountString^  Separator vfstypeString^  Separator opt1String^  Separator opt2String^ Optional WhitespaceOptionalthe_restString^  & SCR::Read.target.etc.cryptotab,SCR::UnregisterAgent.target.etc.cryptotab4,    y2milestone   %No such file %1. Not using cryptotab.%bfstabvar_device_fstab $\ /var,    y2milestone   /var partition is %1-%cfstab-findline spec $ specerror(   regexpmatch  ^/dev/sd[a-z]+[0-9]+$- (    regexpmatch  ^/dev/hd[a-z]+[0-9]+$- (    regexpmatch  ^/dev/dasd[a-z]+[0-9]+$- -%efstabcrtabroot_device_current  default_scrnew_scrfstab_has_separate_var$WFM::SCRGetDefault$&] (!4",#` ,$a 4'&( SCR::Read .etc.fstab&) SCR::Read.etc.cryptotab,, $.b (040,1    y2warning   Separate /var partition!,2d43,4    y2milestone    No separate /var partition found,7    y2milestone    fstab: %1&8_specspec_old,9    y2milestone   fstab: (translated) %1,;    y2milestone    crtab: %1&<_filefile_old,=    y2milestone   crtab: (translated) %1(@4@,A SCR::Execute.target.umount+   /var-D%Kfcrtabfstabcrypt_nb$M,O  foreachmounts vfstype mntops loop fspath device $Q vfstype$R opt2$S loop$T mount$U file,W    y2milestone   0vfstype:%1 mntops:%2 loop:%3 fspath:%4 device:%5(Z!   issubstring  noauto4[again$\)]4^crypt_ok crypt_passwd $_$`.(b||4c&d&e,h    y2milestone   crypt pwd ok:%1(j4ksetloop$l  encryptiontwofishpasswdloop_dev partitionName&q  ,r    y2milestone    crypt ok: %1(s&t  loop_dev4v&x Incorrect password. Try again?update(|4}add_fs$~ filemntopsspecfreqpassnovfstype&prepend ,Utypecryptdevice&-%g mountpoint ret(   substring  - size /&   substring  - size $,  foreache M(&& typemount|| mntpt mntpt+   /4&-%hbootpart min_suggested_bootsizebootsizecmd  bootsizeout $(4& $$   sformat   X/bin/df --portability --no-sync -k '%1/boot' | grep -v '^Filesystem' | sed 's/[ ]\+/ /g'$ SCR::Execute.target.bash_output(exit4,   y2error   Error: '%1' -> %24 scriptout $    splitstring    stdout ,    y2milestone    Scriptout: %1& tointeger0 (||4,   y2error   !Cannot find out bootpart size: %1-,    y2milestone   %Boot size is: %1 recommended min.: %2(4-4 current_bs suggested_bscont$/$/$ Warningupdate   sformat   Your /boot partition is too small (%1 MB). We recommend a size not less than %2 MB. It might happen, that the new Kernel does not fit, so it would be safer to either enlarge that partition or not to use the /boot partition at all. Would you like to continue updating the current system?update(4,    y2warning   8User decided to continue despite small a /boot partition-4,    y2milestone   7User decided not to continue with small /boot partition-%ifstabmessage  allowed_fsret success raidMounted$  extext2ext3minixreiserfsjfsxfsxiafshpfsvfatautoproc$Y/syssysfssysfs(,U devicesysfsmntpt/systypemount$$,  foreachmounts vfstype mntops spec fspath $ vfstype$ mntops$ spec$ file(&&&&&&contains/||/var!g/var!   issubstring  noauto4,    y2milestone   mounting %1 to %2( !4  mount_type  mount_err $ ( proc4 &$)4&Z(4act ,   y2error   "mounting %1 (type %2) on %3 failed+   ,VBoxLabel   sformat   The partition %1 could not be mounted. %2 If you are sure that the partition is not necessary for the update (it is not any system partition), click Continue. To check or fix the mount options, click Specify Mount Options. To abort update, click Cancel.updateVSpacingHBox PushButtonidcont PushButtonidcmd&Specify Mount Optionsupdate PushButtonidcancel$.! ,/(0!cancel41&2&3(5!cont46&7(9!cmd4:,;VBox Heading Mount OptionsupdateVSpacing0.6 TextEntryidmp &Mount PointupdateVSpacing0.4 TextEntryiddevice&DeviceupdateVSpacing0.4 TextEntryidfs&&File System (empty for autodetection)updateVSpacingHBox PushButtonidok PushButtonidcancel&N! (O!ok4P&Q idmpValue&R iddeviceValue&S idfsValue,U(Z||/boot/boot/4Z checkspec $[ (_] 4_&` ] (c!h 4c&d(i&&swapswap4j,k    y2milestone   mounting %1 to %2(m!4ncommand $o /sbin/swapon (p4qret_from_shell&s+   $v  SCR::Execute .target.bash(w 4x,y   y2error   swapon failed: %14|,}Utypeswapdevice-%jdevice  mount_err  err_message $Z/var$(4,   y2error   failed to mount /var&+   +   +   +      sformat   ,The /var partition %1 could not be mounted. update  O-%kmanual_mount_successfullist_of_devices  device_info  $$ $ ,    foreachdevice  description  ,  foreach partition  partitions (  detected_fsunknownswap-( typeunknownextended-(!haskeydevice-&   add device' device   sformat   File system: %1, Type: %2,
Label: %3, Size: %4,
udev IDs: %5,
udev path: %6update   substring   tostring   detected_fsunknownfstypeUnknownupdatelabelNoneupdate*size_k    mergestring   udev_id ,  udev_pathUnknownupdate&  sort,    y2milestone   Known devices: %1)4ret var_device ,VBox MarginBoxVBoxLeftHeading/Unable to find the /var partition automaticallyupdateLeftLabelYour system uses a separate /var partition which is required for the upgrade process to detect the disk-naming changes. Select the /var partition manually to continue the upgrade process.updateVSpacingLeftComboBoxid var_deviceoptnotify&Select /var Partition DeviceupdateVSpacing0.5LeftLabel Device Infoupdate MinHeightRichTextid device_infoVSpacing MarginBox ButtonBox PushButtonidokoptokButton PushButtonidcancelopt cancelButton$$ id var_deviceValue,id device_infoValue )4&& id var_deviceValue( var_device4,id device_infoValue 4.,(ok4 mount_error ,    y2milestone   Trying to mount %1 as /var$j(4,/4,    y2milestone   Manual mount (/var) successful&.4,    y2warning   4User doesn't want to enter the /var partition device. - %dfstabroot_device_current manual_var_mountvar_device_fstab tmp1root_device_fstab  root_infovar_info realdisks  other_disk var_partition_current $\ /var(4,    y2milestone   Not a separate /var...-(!!4!,"    y2milestone   )Device %1 is not a real disk, mounting...-#j('!4',(    y2milestone   2Device %1 is not a Kernel device name, mounting...-)j$,filterentry  file/$- spec(.!-/j$1$2(4 disk disk45tmp2var_partition_current $6$7 disknr-9j$< ,=    foreachs m  (?&&&@   add(Csize4D(F&&k4F-G,J   y2error   :don't know how to handle more than two disks at this point-L+   =Unable to mount /var partition with this disk configuration. updateO$O  disk $Pnr-Rj%Ylsuccessmessage ret_boolfstabcrtab,[    y2milestone   mount partitions: %1(]J-^&`J$b$e   sformat   8Partitions could not be mounted. Check the log file %1.update+   /y2log,g    y2milestone   selected partition: %1$i$k $l (o!4p&qZ/(t4u(y4y,z  WFM::call rootpart_check_keyboarddestdir,}e  (c4warning ,    y2warning   2fstab on %1 uses kernel device name for hard disks$   sformat    Some partitions in the system on %1 are mounted by kernel-device name. This is not reliable for the update since kernel-device names are unfortunately not persistent. It is strongly recommended to start the old system and change the mount-by method to any other method for all partitions.update(4,  4, (size4,   y2error   no or empty fstab found!&No fstab found.update&4tmp_msg $d(4,   y2error   failed to mount /var!&&4tmp $(![ 4,   y2error   fstab has wrong root device!&+   +   =The root partition in /etc/fstab has an invalid root device. update   sformat   0It is currently mounted as %1 but listed as %2. updateO&4,    y2milestone    cryptotab %1,f ,    y2milestone   fstab %1(!i &4,   y2error   !Could not mount root '%1' to '%2'&,    y2milestone   MountPartition (%1) = %2,    y2milestone    activated %1M(!4, ,T&J4,R-%m target_map fstabtmp$$ ,` $filtere M|| typemount typeswap,  foreache mntpt part p mount_options  $ typeswapswap mntpt$ device$ ,  foreachpp ( mount4&.$,  foreachentry ( file4& mntops.&mount&formatformat&delete&create(&& size !haskeyfstopt&fstopt(haskeyfstopt&fstopt fstopt(haskeymountby&mountby mountbydevice,-%nfilename bash_out$  SCR::Execute.target.bash_output+   +    /elf-arch ( exit- unknown-    deletechars    stdoutunknown %oret$,    foreach check_this  &   sformat   %1/%2(4,    y2milestone   *File %1 exists, installation is incomplete& .!-%%,p partitionfreshmanp_dev p_fsidp_type  p_detect_fs $.validnameunknownarchunknownlabel labelfs  detected_fsunknownfstype fstypeunknown$7 deviceerror$8fsid$9 typeprimary$:  detected_fsunknown(=containsB4>mt_map   mount_type  error_message $? ext2ext2ext3ext3jfsjfsreiserreiserfsxfsxfs$F $H(I!X 4I'Jvalid-K(O&&!  containsL,P SCR::Execute.target.modprobe,R(S SCR::Execute .target.mount-o ro4U(W SCR::Read .target.size+    /etc/fstab4Xfstabcrtabrelease  instsys_arch ,Y    y2milestone   found fstab on %1$[ $\ ,^e  &`filterp  file/(b size  spec4b,c    y2warning   Cannot find / entry in fstab %1'fvalid&& size  spec spec_old spec(ovalid4o,p    y2warning   *Device does not match fstab: '%1' vs. '%2' spec$t ,v   y2debug    release: %1(w?4w&yUnknownupdate'{name'~archn+    /bin/bash$n /bin/bash( archunknown4,    y2milestone   Architecture (%1) is valid' arch_valid(&&  contains ppcppc64 archunknown  contains ppcppc644,    y2milestone   1Architecture for partition %1 is %2, upgrading %3 archunknown' arch_valid4,    y2milestone   1Architecture for partition %1 is %2, upgrading %3 archunknown' arch_valid( arch_valid4,    y2milestone   =Architecture is not valid -> the whole partition is not valid'valid(o4,    y2milestone   8Incomplete installation detected, partition is not valid'valid,    y2milestone   )Partition is valid: %1, arch is valid: %2valid arch_valid, SCR::Execute.target.umount,    y2milestone   %1 %2-%q target_map  max_stepscounter(H-, reiserfsLinux Reiser FS, jfsLinuxJFS, xfsLinuxXFS, ext3LinuxExt3, raid0LinuxRaid 0, raid1LinuxRaid 1, raid5LinuxRaid 5,  multipathLinux Multipath, dm-modLinuxDM, SCR::Execute .target.bash/sbin/devmap_mknod.sh,  dm-snapshotLinuxDM(4,  SCR::Read .target.yast2test_target_map.ycp$,    y2milestone   target_map: %1(-idsearch_progress,idsearch_progress ProgressBarid search_pb/Evaluating root partition. One moment please...updated&E &F$,    foreachdevice  description  &+size partitions $,    foreachdevice  description  ,  foreach partition  partitions &+(-idsearch_progress,id search_pbValue/*d(&&  detected_fsunknownswap typeprimaryextended4freshman$ (& archi286labelLabelnameSuSE Linux 4.2valid&p&E   addE deviceerror(valid&F+F(-idsearch_progress,id search_pbValued&H,    y2milestone   rootPartitions: %1E%r- n /bin/bash% stmp, opt decoratedLabel)Mounting partitions. One moment please...update$lC,-%t(!H4,Update ConfigurationupdateVBox ReplacePointidsearch_progressEmpty,(q&*C,+    y2milestone   Detected root partitions: %1E%/u,0    y2milestone   Proposing root partition,1t(243&4C(7&&FC49&:I4=(>C4?,@Q0707010006A4A3000081A40000018F0000018F000000014F10367600001A46000000080000000100000000000000000000004A00000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/ModuleLoading.ycp/** * Module: ModuleLoading.ycp * * Authors: Klaus Kaempf (initial) * * Purpose: * This module does all module loading stuff. * * $Id: ModuleLoading.ycp 62597 2010-10-12 09:23:09Z jsrain $ */ { module "ModuleLoading"; textdomain "base"; import "Mode"; import "Label"; import "Icon"; string vendor_name = ""; string device_name = ""; /** * @param map controller * @returns list [string vendor, string device] * Convert internal probing data to user readable string * for module loading. * @see ModuleLoading::Load */ global define list prepareVendorDeviceInfo (map controller) ``{ // build up vendor/device information // if vendor not given, try sub_vendor string controller_vendor = controller["vendor"]:(controller["sub_vendor"]:""); if (controller_vendor != "") { string controller_sub_vendor = controller["sub_vendor"]:""; if (controller_sub_vendor != "") { controller_vendor = controller_vendor + "\n(" + controller_sub_vendor + ")"; } } // if device not given, try sub_device string controller_device = controller["device"]:(controller["sub_device"]:""); if (controller_device != "") { string controller_sub_device = controller["sub_device"]:""; if (controller_sub_device != "") { controller_device = controller_device + "\n(" + controller_sub_device + ")"; } } return [controller_vendor, controller_device]; }; /** * Cache for MarkedAsBroken */ list broken_modules = nil; /** * Is the module marked as broken in install.inf? (BrokenModules) * #97655 * @param mod module * @return broken? */ boolean MarkedAsBroken (string mod) { if (broken_modules == nil) { string bms = (string)SCR::Read (.etc.install_inf.BrokenModules); if (bms == nil) { bms = ""; } broken_modules = splitstring (bms, " "); } return contains (broken_modules, mod); } /** * @param string modulename * @param string moduleargs * @param string vendorname * @param string devicename * @param boolean ask_before_loading * @param boolean with_modprobe * * @returns symbol: `dont user choose *not* to load module * `ok module loaded ok * `fail module loading failed * * load a module if not already loaded by linuxrc */ global define symbol Load (string modulename, string moduleargs, string vendorname, string devicename, boolean ask_before_loading, boolean with_modprobe) ``{ if ((modulename != "") // there is no reason for checking initrd, if I need the module to get loaded, I just need to // check if it isn't already loaded // && (!contains (Initrd::ListModules (), modulename)) && !Mode::test ()) { // always look whether the module is already loaded map loaded_modules = (map) SCR::Read(.proc.modules); if (size (loaded_modules[modulename]:$[]) > 0) { // already loaded return `ok; } // sformat( _("Loading module %1"), modulename); // #97655 if (MarkedAsBroken (modulename)) { y2milestone ("In BrokenModules, skipping: %1", modulename); return `dont; } if (ask_before_loading && (!Mode::autoinst()) && (!Mode::autoupgrade())) { UI::OpenDialog(`opt(`decorated, `centered), `HBox ( `HSpacing(1), `HCenter ( `HSquash( `VBox ( `HCenter ( `HSquash( `VBox( // Popup-Box for manual driver installation. // If the user selects 'manual installation' when // booting from CD, YaST2 does not load any modules // automatically, but asks the user for confirmation // about every module. // The popup box informs the user about the detected // hardware and suggests a module to load. // The user can confirm the module or change // the suggested load command // // This is the heading of the popup box `HBox ( // bnc #421002 Icon::Simple ("question"), `Heading(_("Confirm driver activation")), `HStretch() ), `VSpacing(0.2), // This is in information message. Next come the // vendor and device information strings as stored // in the hardware-probing database. `Left(`Label(_("YaST2 detected the following device"))), `Left(`Label(vendorname)), `Left(`Label(devicename)), `VSpacing(0.1), `Left ( // Caption for Textentry with module information `InputField ( `id(`mod_name), `opt(`hstretch), _("&Driver/Module to load"), modulename+" "+moduleargs) ) ) ) ), `ButtonBox ( `PushButton (`id (`ok_msg), `opt (`default, `okButton, `key_F10), Label::OKButton()), `PushButton (`id (`cancel_msg), `opt (`cancelButton, `key_F9), Label::CancelButton()) ), `VSpacing(0.2) ) ) ), `HSpacing(1) ) ); UI::SetFocus (`id(`ok_msg)); symbol ret = (symbol) UI::UserInput(); if (ret == `ok_msg) { string module_data = (string) UI::QueryWidget(`id(`mod_name), `Value); if (size (module_data) > 0) { // skip leading spaces integer firstspace = findfirstnotof (module_data, " "); if (firstspace != nil) { module_data = substring (module_data, firstspace); } // split name and args firstspace = findfirstof (module_data, " "); if (firstspace == nil) { modulename = module_data; moduleargs = ""; } else { modulename = substring (module_data, 0, firstspace); moduleargs = substring (module_data, firstspace+1); } } } UI::CloseDialog(); if (ret == `cancel_msg) { y2milestone ("NOT loaded module %1 %2", modulename, moduleargs); return `dont; } } // ask_before_loading } boolean load_success = false; if (with_modprobe) { load_success = (boolean) SCR::Execute(.target.modprobe, modulename, moduleargs); } else { load_success = (boolean) SCR::Execute(.target.insmod, modulename, moduleargs); } if (load_success == nil) load_success = false; y2milestone ("Loaded module %1 %2 %3", modulename, moduleargs, load_success?"Ok":"Failed"); return (load_success?`ok:`fail); }; } 0707010006A4A8000081A40000018F0000018F000000014F10367600076B9B000000080000000100000000000000000000004400000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/Storage.ybcYaST bytecode 1.4.0StorageB Storage.ycp Arch AsciiFileEncoding Directory FileSystems FileUtils InstallationLabel Mode  Partitions Popup Misc HTMLStorageDevicesStorageClientsProductFeaturesStageStringRegionHotplug LibStorageLibStorage::StorageInterfaceLibStorage::VolumeInfoLibStorage::PartitionInfoLibStorage::LvmLvInfoLibStorage::MdInfoLibStorage::LoopInfoLibStorage::DmInfoLibStorage::DmPartInfoLibStorage::DmraidInfoLibStorage::DmmultipathInfo LibStorage::MdPartCoInfo!LibStorage::MdPartInfo"LibStorage::NfsInfo#LibStorage::ContainerInfo$LibStorage::DiskInfo%LibStorage::LvmVgInfo&LibStorage::PartitionAddInfo'LibStorage::DmPartCoInfo(LibStorage::DmraidCoInfo)LibStorage::DmmultipathCoInfo*LibStorage::PartitionSlotInfo+LibStorage::CommitInfo,LibStorage::Environment- conv_ctype . conv_usedby / conv_ptype 0 conv_mountby 1conv_encryption 2 conv_mdtype 3 conv_mdstring 4 conv_mdparity 5conv_parstring 6conv_imsm_driver 7DiskMapVersion8DiskMap9 type_order: hw_packages ;no_propose_disks < proposal_home= proposal_lvm>proposal_encrypt?proposal_password @cfg_xml A part_insts B called_updateC GetDeviceName  DIsKernelDeviceName E StorageMapF targets_key G part_mode_key H part_disk_key I testsuite_key J do_resize_key Kwin_device_key Lcustom_display_key Mpart_proposal_mode_key Npart_proposal_first_key Opart_proposal_active_key P probe_doneQexit_key RsintScontsTGetProcessName UCreateInterfaceV imsm_driver W SetImsmDriver  X getContainersYInitLibstorageZByteToHumanString [KByteToHumanString \ByteToHumanStringWithPrecision ]KByteToHumanStringWithPrecision ^HumanStringToByte _HumanStringToKByte ` HumanStringToKByteWithRangeCheck a GetTargetMap bGetDiskPartitionTg  cGetDiskPartition dUpdateChangeTime eGetPartitionLst  f GetPartition   gGetDisk   hSwappingPartitionsiGetDestroyedLvmVgs jDeleteDestroyedLvmVgs  k GetFreeSpace  lGetUnusedPartitionSlots m AddWinInfo  n SaveDumpPath  oAddMountPointInfo  pconvertFsOptionMapToString  qconvertStringToFsOptionMap   rtoSymbol  s fromSymbol  tCheckBackupState udiskMapv dmPartCoMapw volumeMapx partAddMapy dmPartMapz mdPartMap{getContainerInfo| toDiskMap}count~ IsDiskType UpdateTargetMap UpdateTargetMapDisk  UpdateTargetMapDev   getDiskInfo  SaveExitKey   GetExitKey GetOndiskTarget CreateTargetBackup  DisposeTargetBackup  EqualBackupStates  RestoreTargetBackup  ResetOndiskTarget GetTargetChangeTimeGetPartProposalActiveSetPartProposalActive  GetPartMode  SetPartMode  GetCustomDisplaySetCustomDisplay  GetPartDisk  SetPartDisk   GetTestsuite SetTestsuite  GetDoResize  SetDoResize  GetPartProposalMode SetPartProposalMode  GetPartProposalFirstSetPartProposalFirst  GetWinDevice SetWinDevice InstallCallbacks Storage sw_raid_type_key  lvm_type_key extended_type_key  NextPartition  NextMd  MaxSizeLabelK MaxCylLabelCreatePartition    UpdatePartition SetPartitionMount  SetPartitionFormat  SetPartitionId UnchangePartitionId ResizePartition   ResizeVolume  SetCrypt ChangeDescText  ChangeVolumeProperties DeleteDevice   DeleteLvmVg  DeleteDmraid DeleteMdPartCo  CreateLvmVg CreateLvmVgWithDevs   ExtendLvmVg   ReduceLvmVg   CreateLvmLv  ChangeLvStripeSize  ChangeLvStripeCount   AddNfsVolume   CheckNfsVolume  CreateMd CreateMdWithDevs  ExtendMd ShrinkMd  ChangeMdType ChangeMdParity ChangeMdParitySymbol  ChangeMdChunkCheckMd ComputeMdSize   GetCryptPwd   SetCryptPwd   NeedCryptPwd  CreateLoop   UpdateClassified   HandleModulesOnBoot   UpdateLoop   DeleteLoop  DefaultDiskLabel DeletePartitionTable CreatePartitionTable   GetMountBy  InitializeDisk  IsPartType  CreateAny IsEfiPartitionAddMountPointsForWinParts AddMountPointsForWin  RemoveDmMapsTo   CheckSwapable  AddSwapMp  SetRecursiveRemoval GetRecursiveRemoval SetTargetMap  ReReadTargetMap  CommitChanges DeviceMounted  Umount MountOpt   Mount   DetectHomeFs SetVolOptions     CanEdit CanDelete ReadFstab mountedPartitionsOnDisk  GetCommitInfo  save_chtxt  ChangeText  LastAction ExtendedErrorMsg SetZeroNewPartitions GetMountPoints GetIdSmaller  SetPartitionData    DelPartitionData     IsRealDiskIsPartitionableDeviceRealDisk HaveLinuxPartitionsGetOtherLinuxPartitions CheckSwapOn GetPrimPartitions GetWinPrimPartitions  GetUsedFs  SaveUsedFs AddPackageList HandleProposalPackages GetForeignPrimary IsResizableFreeCylindersAfterPartition CheckNextCreated PathToDestdir   AddFstabEntry  ActivateHld  ActivateMultipath   WriteFstab  SpecialBootHandling   PerformLosetupDetectFs  GetBootPartition UpdateFstabSubfs UpdateFstabSysfs UpdateFstabOptions  HdToIseries  SLES9PersistentDevNames   HdDiskMap  UpdateFstabIseriesVd UpdateCdromLinks UpdateFstabPersistentNames UpdateFstabEvms2Lvm UpdateFstabDiskmap  UpdateMdadm UpdateCryptoType UpdateFstabUsbdevfs  BuildDiskmapUpdate  GetTranslatedDevices  ! CallInsserv  " FinishInstall #GetEntryForMountpoint $GetRootInitrdModules%CheckForLvmRootFs&CheckForMdRootFs' AdaptResize  (NumLoopDevices)onepartition2fstab* ProposalHome+SetProposalHome , ProposalLvm-SetProposalLvm .ProposalEncrypt/SetProposalEncrypt 0ProposalPassword 1SetProposalPassword  2 ProposalEvms3SetProposalDefault 4 GetControlCfg 5BootEvms6 ProposalVM 7 AddHwPackage  8SwitchUiAutomounter 9DumpObjectList :NoProposeDisks ;SetDefaultMountBy  <GetDefaultMountBy =DeviceMatchFstab  > IsPersistent? ActionsCount@CheckEncryptionPasswords  A CheckCryptOk  CCdisk  partitionDDdevice WWaval YYireadonlyZZbytes[[kbytes\\bytes precision omit_zeroes]]kbytes precision omit_zeroes^^str bytes__str kbytes``str bytes_kmin_kmax_kaa ccdevice ddff tg device ggtg device hhnii|target jjtarget kkdevice testsizeused_fs verboselldevice slotsmm:targets nnOname oo\target ttwho ~~t  device disk"key +eywho who s1 s2 vbwho valuevalue valuevalue valuevalue value valuevalue I disk ptype \ i diskr disk start_cyl disk device ptype idstartlenmby  device startlen device mp  device formatfs  device id device  device disk new_cyls! device disk  new_size_k- device crptformatO part disk device  name  name  name  name pesizelvm2 name pesizelvm2devs ' name device 3 name device ? vgname lvname sizeKstripeO vgname lvname  stripeSize_ vgname lvname stripeso nfsdev opts szmp | nfsdev opts  nrtype  nrtype devices  nrdev  nrdev  nrmdtype  nrptype  nrptype  nrchunk nr md_type devices sizeK device  device pwd , device 4 file createsizeKmp \ key pwd c dev file createsizeKr disk file  remove_file~ size_k disk size_k disk label device  disk value t B targets \ device d dev v target val"'target dev dev  dev mp fstopt dev mp !pTpmnt fs fs_opts  fstab_opts label pverbosepdiskverbose dir disk (7HNTvaledisk delimtg device key valuetg device key entryentrydevice 4^ydisk targets  foreign_os targets %_tpartdevice diskregionpt e  val   val    0tg   uloopformatdevice disk "=Pinput \input input diskmapdiskmapdiskmap4[uoldvoldvnewv  oldvnewvnames ""##mmp $$}%%&&''maindev regionschange(({))partother_nr**++val,,--!val..'//,val002117val 22>33D home_only44Y556677name 88on99::;;mby << ==device  fstab_spec >>0p??A@@Fpw1 pw2  min_length empty_allowedAArdev  fs_passwd D3WFMExecute3SCRReadWriteExecute UnmountAgent0storage3Archi386sparc board_iseriesalphas390ia64x86_64 board_mac3 AsciiFileNumLinesChangeLineField   AppendLine  RemoveLines  RewriteFile   SetComment  ReadFile  GetLine3Encoding3 Directorytmpdir 3  FileSystems conv_fs InitSlib  GetOptions GetMountString   GetNeededModules   IsResizable  IsSystemMp DefaultFstabOptions DefaultFormatOptions  GetFstabDefaultMap GetFstabDefaultMntops  HasQuota3! FileUtilsGetSize  IsDirectory 3" Installationdestdir  scr_destdir 3#Label CancelButton ContinueButton ErrorMsg 3$Modenormalrepairautoinstconfigtest3% Partitions IsResizable fsid_native fsid_swapfsid_lvm fsid_mac_hfs fsid_raidfsid_prep_chrp_bootlv_name dm_name  fsid_gpt_boot raid_name IsDosWinNtPartition loop_name  dmraid_name dmmultipath_name nfs_name  fsid_wintypes fsid_dostypesfsid_ntfstypes fsid_skippedEfiBoot DefaultFs  DefaultBootFs  BootMount PrepBootIsLinuxPartitionTranslateMapperName   CurMountedGetFstab  GetCrypto  FsIdToString 3&PopupError   AnyQuestion     Message  3'Misc SysconfigRead  3(HTMLList  3)StorageDevices TypeNames  ZipDrives Probe3*StorageClientsInstallCallbacks 3+ProductFeaturesGetStringFeature   GetBooleanFeature  3,Stageinitial3-String3.Region3/HotplughaveUSB31 LibStorage/MDPARTDMNFSCLOOPLOGICALENC_TWOFISH256_OLDcreateStorageInterfacePidLVMRIGHT_ASYMMETRICRAID5RAID10RAID0UB_NONEUB_LVMUB_MD UB_MDPARTUB_DM UB_DMRAIDUB_DMMULTIPATHRAID_UNKRAID6RAID1RIGHT_SYMMETRICPRIMARYPAR_NONE MOUNTBY_IDMOUNTBY_DEVICE MOUNTBY_PATH MOUNTBY_LABEL MULTIPATH MOUNTBY_UUIDMDLEFT_ASYMMETRICLEFT_SYMMETRIC IMSM_MDADM IMSM_DMRAIDIMSM_UNDECIDEDEXTENDED ENC_UNKNOWNENC_TWOFISH_OLD ENC_TWOFISHENC_NONEENC_LUKSDMRAID DMMULTIPATHDISKCUNKNOWN32LibStorage::StorageInterfacegbyteToHumanString  extendLvmVg  getMdPartCoInfo  getMdPartInfo  setRootPrefix  updatePartitionArea verifyCryptPassword   getContainers extendMd  changeFstabOptions   getLvmVgInfo checkBackupState  getMdInfogetCrypt defaultDiskLabelSize changeMdParity changeMountPoint   getMountBy  umountDevice  setEfiBoot checkMd changeTunefsOptVolume  createBackupState shrinkMd  createMd  checkDeviceMounted   changeMountBy activateMultipath getDmmultipathInfo getDmmultipathCoInfo  changeMdChunk  shrinkLvmVg  getCommitActions humanStringToByte changeMkfsOptVolume  getRecursiveRemovalchangeLabelVolume   createLvmVg  restoreBackupState changeLvStripeCount  setCryptPassword  removeBackupState nextFreePartition  changePartitionId getExtendedErrorMessage setDefaultMountBy rescanEverything  getCommitInfo setDetectMountedVolumes resizePartitionNoFs setCrypt getCryptPassword  getUnusedPartitionSlots needCryptPassword changeFormatVolume setRecursiveRemoval setZeroNewPartitions equalBackupStates   getNfsInfodumpObjectList resizePartition  resizeVolume forgetResizeVolume forgetCryptPassword  getDiskInfo checkNfsDevice  forgetChangePartitionId  removeVolume removeMdPartCo  removeLvmVg changeLvStripeSize   computeMdSize destroyPartitionTable  createFileLoop     changeMdType removeFileLoop  createLvmLv    getLastAction  removeDmraid getPartitionInfo removeDmTableTo   getLvmLvInfo  readFstab  addNfsDevice    getDmInfochangeDescText   getFreeInfo getDefaultMountBygetDmraidCoInfo  activateHld  getLoopInfo addFstabEntry     getDmraidInfo freeCylindersAfterPartition  getVolume  mountDeviceRo    nextFreeMd modifyFileLoop  createPartition  commit getAllUsedFs initializeDisk  maxSizeLabelK 33LibStorage::VolumeInfonew swig_sizeK_getswig_mkfs_options_get swig_OrigSizeK_getswig_is_mounted_get swig_name_get swig_ignore_fs_get swig_uuid_get swig_create_getswig_fstab_options_get swig_device_get swig_mount_get  swig_dtxt_get swig_encryption_getswig_format_getswig_usedByType_get swig_fs_getswig_usedByName_get swig_label_get  swig_loop_get swig_mount_by_getswig_usedByDevice_get swig_resize_getswig_tunefs_options_get 34LibStorage::PartitionInfo swig_udevPath_get swig_udevId_get  swig_nr_get swig_v_getswig_partitionType_get swig_id_getswig_cylStart_get swig_boot_getswig_cylSize_get35LibStorage::LvmLvInfoswig_stripe_size_get swig_v_getswig_stripe_get36LibStorage::MdInfo swig_type_get swig_nr_get swig_v_getswig_sb_ver_get swig_chunk_getswig_parity_getswig_devices_get 37LibStorage::LoopInfo swig_nr_getswig_reuseFile_get swig_v_get swig_file_get 38LibStorage::DmInfo swig_nr_get swig_v_get39LibStorage::DmPartInfo swig_v_get swig_part_get swig_p_get3:LibStorage::DmraidInfo swig_p_get3;LibStorage::DmmultipathInfo swig_p_get3<LibStorage::MdPartCoInfonew swig_sb_ver_get swig_chunk_getswig_parity_getswig_devices_get  swig_d_getswig_level_get3=LibStorage::MdPartInfo swig_v_get swig_part_get swig_p_get3>LibStorage::NfsInfo swig_v_get3?LibStorage::ContainerInfo swig_type_get swig_name_get swig_device_get swig_usedByType_getswig_usedByName_get swig_usedByDevice_get swig_readonly_get3@LibStorage::DiskInfo new swig_maxPrimary_get swig_cyl_getswig_disklabel_get swig_initDisk_getswig_iscsi_getswig_udevPath_get swig_udevId_get swig_sizeK_getswig_maxLogical_getswig_cylSizeB_get3ALibStorage::LvmVgInfo new swig_sizeK_getswig_create_getswig_devices_get swig_devices_rem_get swig_peSize_get swig_lvm2_getswig_peFree_getswig_peCount_getswig_devices_add_get 3BLibStorage::PartitionAddInfoswig_udevPath_get swig_udevId_get  swig_nr_getswig_partitionType_get swig_id_getswig_cylStart_get swig_boot_getswig_cylSize_get3CLibStorage::DmPartCoInfoswig_minor_getswig_devices_get  swig_d_get3DLibStorage::DmraidCoInfonew  swig_p_get3ELibStorage::DmmultipathCoInfonew  swig_p_get3FLibStorage::PartitionSlotInfoswig_cylStart_getswig_cylSize_getswig_logicalPossible_getswig_logicalSlot_getswig_extendedPossible_getswig_primarySlot_getswig_primaryPossible_getswig_extendedSlot_get3GLibStorage::CommitInfonew swig_destructive_get3HLibStorage::Environmentnew swig_instsys_set swig_testmode_set swig_autodetect_set $K-def_sym CT_UNKNOWNdef_intm CT_DISKCT_MDCT_LOOPCT_LVM CT_DMRAIDCT_DMMULTIPATHCT_DM CT_MDPARTCT_NFS$Z.def_symUB_NONEdef_intmUB_LVMUB_MD UB_DMRAIDUB_DMMULTIPATH UB_MDPARTUB_DM$f/def_symprimarydef_intmlogicalextended$n0def_symdevicedef_intmuuidlabelidpath$x1def_symnonedef_intmtwofish twofish_oldtwofish_256_oldluksunknown$2def_sym raid_unknowndef_intmraid0raid1raid5raid6raid10 multipath$3raid0raid1raid5raid6raid10 multipath$4def_sympar_nonedef_intmleft_asymmetricleft_symmetricright_asymmetricright_symmetric$5left_asymmetricleft_symmetricright_asymmetricright_symmetric$6IMSM_UNDECIDED IMSM_DMRAID IMSM_MDADM$7 $8 $9  CT_DISKCT_DMCT_DMMULTIPATH CT_DMRAIDCT_LOOPCT_LVMCT_MD CT_MDPARTCT_NFS$: $;$<$=$>$?$@ $A$B%Cret $0/(/4(||||||||||  search  / /dev/cciss/  search  / /dev/ida/  search  / /dev/ataraid/  search  / /dev/etherd/&&  search  //dev/md//dev/md  search  //dev/rd/4&0+   0p(  search  / /dev/mapper/4&0+   0_part&0+   0   sformat   %1/( size  /4&0+   +   0/ /-0%D-&&&&   substring  /LABEL=   substring  /UUID=   substring  /  /dev/disk/by-$E $Ftargets$G part_mode$H part_disk$I testsuite$J do_resize$K win_device$Lcustom_display$Mpart_proposal_mode$Npart_proposal_first$Opart_proposal_active$P$ Qnext$!R$"S %%Tpidname pos$'0  SCR::Read.target.symlink+   +   /proc/ tostring //exe((0-)$+0   findlastof  0/(,0--0-/   substring  0+0%3Ureadonly)5R46env locker_pid$71.LibStorage::Environment/,8.1 ,9.1,:.1|| $<1&=R1 1(?R4@ locker_name $A2T1,B    y2milestone   locker_pid:%1 locker_name:%212(D24E(F!  rThe storage subsystem is locked by an unknown application. You must quit that application before you can continue.storage  focus_no.K4N(O!     sformat   uThe storage subsystem is locked by the application "%1" (%2). You must quit that application before you can continue.storage21  focus_no.U,Z    y2milestone   sint:%1R-[R$_VIMSM_UNDECIDED%aW&cV/%iY (kR-l,n    y2milestone   InitLibstorage&oRU/(pR4p,q   y2error   Storage::CreateInterface failed-r(u4v,wR,xR  ,{R &SX,    y2milestone   InitLibstorage conts:%1S,R-%Z-R/%[-R*/%\-R///%]-R*///%^iret$0&/0$0R / /,    y2milestone   (HumanStringToByte ret:%1 str:%2 bytes:%30//-0%_bytesret$0$0R / 0&//0,    y2milestone   *HumanStringToKByte ret:%1 str:%2 kbytes:%30//-0%`(!_/ /-(&&///4([/[/-&//(&&///4([/[/-&//-%bdevice tg retdlen as_stringls  $0 $0$0$0   filters  1    splitstring   // size 1(||  search  /LABEL=  search  /UUID=4tl $1    splitstring   /=&0devdisk1 '0  search  /LABEL=by-labelby-uuid,    y2milestone   GetDiskPartitionTg ls:%10,   y2debug    GetDiskPartitionTg size:%1 ls:%2size00(&&&&size00 disk  contains by-idby-pathby-uuidby-label0 4partregex $1 $1 -part[0-9]+$(0 by-label4,    foreachdev disk 3 3/&1findp 53 partitions  5label0 (14tmp$5 '5disk3(haskey1nr'5nr1nr'5nr 1name&0add05(0 by-uuid4,    foreachdev disk 3 3/&1findp 53 partitions  5uuid0 (14tmp$5 '5disk3(haskey1nr'5nr1nr'5nr 1name&0add05( 0 by-id4 id numl$ 20 $2$2   regexppos  21(size24&2 tointeger   substring  2+2&2   substring  22,   y2debug   GetDiskPartitionTg id:%1 num:%222,    foreachdev disk 3 3/(&&size0   finds  53udev_id 524&1findp 63 partitions 6nr2(||214tmp$6 ' 6disk3(!2'"6nr2'$6nr&%06(*0 by-path4+id numl$,20 $-2$.2   regexppos  21(/size240&12 tointeger   substring  2+2&22   substring  22,3   y2debug   GetDiskPartitionTg id:%1 num:%222,5    foreachdev disk 3 3/(7&&size0 3 udev_path248&91findp 63 partitions 6nr2(;||214<tmp$=6 '>6disk3(?2'@6nr2'B6nr&C06(I  search  //4Jtmp (K||||||  search  //dev/hd  search  //dev/sd  search  //dev/ed  search  //dev/iseries/vd4O&P0   findfirstof  / 0123456789(Q04R&S0 size /(V&&  search  //dev/mdsize04Wpos$X2  find  /p,Y    y2milestone   device:%1 pos:%2/2(Z2&[0&]02(_  search  / /dev/loop4`&a0 (c  search  / /dev/i2o/hd4d&e0 (g||||||||  search  //dev/rd/  search  / /dev/cciss/  search  / /dev/ataraid/  search  / /dev/etherd/  search  / /dev/ida/4lpos$m2   findlastof  /p&n0 size /(o24p&q02(t  search  / /dev/dasd4u&v0 size /(w   findfirstof  / 01234567894x&y0-0(|  search  / /dev/mapper/4}regex l$~2[_-]part[0-9]+$$2   regexppos  /2(size2&02&0 size /4&0(size04pos$3   findlastof  //(34&034nonzero&0 size /$3   findlastnotof  / 0123456789(&&33-04&0+3&0$1 '1disk   substring  /0&/   substring  /0(  search  /_part&/   substring  /(&& size /   findfirstof  //p4&/   substring  /'1nr(04'1nr/4( size /4'1nr tointeger/(&& size  1disk1nr4'1nr&014&0disk/dev/nfsnr/(size04ab$1filterm 20  search   2disk /dev/evms$1filterm 20  search   2disk /dev/evms&0merge11,   y2debug   #GetDiskPartitionTg device:%1 ret:%2/0-0%c-b/a %d change_time$/time,    y2milestone   UpdateChangeTime time %1/'E targets_time/%etg device rettmp$0 $0b//,    y2milestone   GetPartitionLst tmp:%10,  foreachm 10disk partpa $2 1disk(&&  search  / /dev/evms!haskey/24&2 /dev/evms,   y2debug   !GetPartitionLst device=%1 disk=%2/2$2filterp 3/2 partitions  3device/&2filterp 32!3delete(size24&2filterp 4/2 partitions 4nr1nr&2filterp 42!4delete(size24&2filterp 4/2 partitions  4name 1nr&2filterp 42!4delete$22 (&&size2  search  / /dev/mapper/4&2filterp 4/ /dev/mapper partitions  4device/&22 (&&size2  search  / /dev/mapper/4&2filterp 4/ /dev/loop partitions  4device/&22 (size2&0add02,    y2debug   GetPartitionLst ret=%10- 0% f- e// %gret tmpdisk $0 $0b// $0 0disk(&&  search  / /dev/evms!haskey/04&0 /dev/evms,!   y2debug   GetDisk disk=%10-" /0 %nhswapsret,pSCR::UnmountAgent .proc.swaps$q/ SCR::Read .proc.swaps(r/4r,s   y2error   #SCR::Read(.proc.swaps) returned nil&t/ &v/filtere 0/ 0type partition$w/  mapliste 0/  0file,x    y2milestone   SwappingPartitions %1/-y/%|ivgs$~0 ,    foreachdiskdev disk 1 1/,  foreachp 31 partitions (&& 3 used_by_typeUB_NONEUB_LVM3format4&0union0 3used_by&0sort0,    y2milestone   GetDestroyedLvmVgs %10-0%jvgs $0    maplists  1 i/+   /dev/1,    y2milestone   DeleteDestroyedLvmVgs %10,    foreachdev  10(haskey/1'/1delete'/1 partitionsmaplistp 3/1 partitions (haskey3mount&3remove3mount-3,    y2milestone   DeleteDestroyedLvmVgs %1: %21/1 -/%k used resize_freedf_freewin_diskefir linux_sizemin_linux_sizeadd_free new_size ret( 4wfwuls$1 tointeger*tofloat/0.6$1 tointeger*tofloat/0.4$1 tointeger*tofloat/0.5-free1used1 linux_size1new_size-+111$0$0$0$0$0$0&0R / 0 0 0 0 0/ntfs&0*0&0*0&0*0(&&&&/ntfs!0/4cmd bcalltmp $1   sformat   /usr/sbin/ntfsresize -f -i '%1'/,    y2milestone   GetFreeSpace Executing cmd:%11$1 SCR::Execute.target.bash_output1  LC_MESSAGESPOSIX,    y2milestone   GetFreeSpace Executing ret:%11$1+   Resize Not Possible:storage &1+   +   1 1stdout 1stderr, 1- $0$0$0-00,    y2milestone   'GetFreeSpace resize_free %1 add_free %200(||0**,!04&0&0(0**X4&00(0**K4&0+-0**K0&00(0**4&00(0**4&0+-0**0&0**,(0***4&00(0**,4&0+-0**,0&0**(0***4&00(0** 4&0+-0** 0&0**4&00(0/04&0+-0/00& 0**$ 0 -++0000$0  free00df_free0used0win_disk0efi0 linux_size0 max_win_size-++0000ntfs/ntfsnew_size0 '0 ok0,    y2milestone   GetFreeSpace %1 ret %2/0 -0 %l swig_slotsret$0 $!0R / 0&#/  maplist swig_slot 10region,1,1 primary_slot,1primary_possible,1 extended_slot,1extended_possible,1 logical_Slot,1logical_possible,1-00%:m,<    y2milestone   AddWinInfo called,=    foreachdisk data 1 1/'?/1 partitionsmaplistp 31 partitions (B&& 3fsid  contains ntfsvfat 3used_fsnone4D'E3winfok 3device 3used_fsnone,G    y2milestone    AddWinInfo %13-I3-L/%Onret $P0+   +   //,Q   y2debug   name=%1 path=%2/0-R0%\omounts$^0 ,_    foreachdiskdev disk 1 1/tmp2$b21 partitions &c2maplistpart 32mt$e4findmp 50|| 5spec  3device 5loop_on  3device(g44h'i3mount 4file(j3noauto4k'l3active-o3'q1 partitions2'r/11-t/%pfsoptcmd ret $0(||// 4ignore$1 autodefaultnone,  foreach option_keyoption 2 2/ option_str  option_value option_blank option_cmd $3 2 option_str$32 option_value$32 option_blank$3 2 option_cmdmkfs,    y2milestone   4convertFsOptionMapToString k:%1 opt:%2 val:%3 cmd:%42233(/34 ( && 334 ( !contains134 ( size 0&0+   0 &0+   03(3&0+   0 &0+   0 3(&&334(34( size 0&0+   0 &0+   03(&&334 (! size 0&"0+   0 &#0+   03($3&%0+   0 &&0+   0   sformat   %13(+||size/ size 0,,    y2milestone   *convertFsOptionMapToString fsopt:%1 ret:%2/0--0%0qopts fs cmd retposop $20 ,3    y2milestone   1convertStringToFsOptionMap opts:"%1" fs:%2 cmd:%3///$40  findfirstnotof  / (50&6/   substring  /0$80/&90filtero 10 1 option_cmdmkfs/); size /4<found$=1,>  foreacho 20mos $@3 $A3 2 option_str(B&&&&!1 size 3  search  /34C &D1'E3 option_str3'F3 option_cmd 2 option_cmdmkfs(G 2typetextboolean4H'I3 option_value'J0 2 query_key3&L/   substring  / size 3&M0  findfirstnotof  / (N0&O/   substring  /0(P&&&& 2typetextboolean size /  search  /-4R(S0'T3 option_blank&U0   findfirstof  / (V04W'X3 option_value/&Y/4\']3 option_value   substring  /0&^/   substring  /0'`0 2 query_key3&b0  findfirstnotof  / (c0&d/   substring  /0(g!14h&i0  findfirstnotof  / (j0&k/   substring  /0&m/,o    y2milestone   )convertStringToFsOptionMap opts:%1 ret:%2/0,q    y2milestone   !convertStringToFsOptionMap ret:%10-r0%urconv val-w /m/ /def_syminvalid_conv_map%zsconv val ret$|0/def_int,}    foreachis  1 1/m (1/&01-0%tret,    y2milestone   CheckBackupStates who:%1/(!Y-$0R /,    y2milestone   CheckBackupStates ret:%10-0%udinfodbttmp '/size_k&/'/cyl_size&/'/ cyl_count&/'/label&/'/ max_logical&/'/ max_primary&/$0&/(0'/iscsi(haskey/iscsi&/remove/iscsi&0&/(0'/dasdfmt(haskey/dasdfmt&/remove/dasdfmt$0&/( size 0'/udev_id    splitstring   0 (haskey/udev_id&/remove/udev_id&0&/( size 0'/ udev_path0(haskey/ udev_path&/remove/ udev_path,    y2milestone   diskMap ret:%1/-/%vinfosddinfols t $0)/&/u0/$0    splitstring   )/ ,    y2milestone   ls=%10'/devices0$0)/'/minor0,    y2milestone   dmPartCoMap ret:%1/-/%wvinfoptfs tbooltmp $'/device/'/size_k/'/name/$0/$0r0'/ detected_fs0(0unknown'/used_fs0$0/(0'/format&0/(0'/create$0/( size 04'/mount0&0/(!0'/inactive&0/'/mountbyr00&0/(04'/ used_by_typer.0'/used_by/'/used_by_device/&0/( size 04'/fstopt0(   finds  2    splitstring   0,2noauto'/noauto&0/( size 04'/mkfs_opt0'/ fs_optionsq0 / detected_fsunknownmkfs4(haskey/ fs_options&/remove/ fs_options&0/( size 04'/ tunefs_opt0'/ fs_optionsunion/ fs_options q0 / detected_fsunknowntunefs&0/( size 0'/dtxt0&0/( size 0'/uuid0&0/( size 0'/label0&0/(04'/enc_typer10&0/(04'/resize' / orig_size_k/& 0/( 0' / ignore_fs&0/( size 0'/loop0-/%xinfoptboottmp '/nr(/'/fsid(/'/fstype /fsid'/region(/(/$0(/'/typer/0$0(/(0'/boot$ 0(/(! size 0'"/udev_id    splitstring   0 &#0(/($ size 0'%/ udev_path0,&    y2milestone   partAddMap ret:%1/-'/%*yinfopvinfopart$,0/&-/w0/'./nr$/0/(0041pinfo$21/&3/x1/,5    y2milestone   dmPartMap ret:%1/-6/%9zinfopvinfopart$;0#/&</w0/'=/nr$>0#/(?04@pinfo$A1#/&B/x1/,D    y2milestone   mdPartMap ret:%1/-E/%H{crettvinfo,J    y2milestone   getContainerInfo %1/$K0$L0$M0LibStorage::VolumeInfo(N /type CT_UNKNOWNCT_DISK4Opinfosinfosd $P1 $Q1&LibStorage::DiskInfo$R1 /device&S0R 11(T04U&V/u1/,Y    y2warning   disk "%1" ret:%2 /device0'Z/ partitions &[0R 1 1,\  foreachinfo 21tmp pboot$^3$_3 &`02&a3w03'b3nr2'c3fsid2'd3fstype 3fsid'e3region22&g02'h3typer/0$i32(j3'k3boot&l32(m size 3'n3udev_id    splitstring   3 &o32(p size 3'q3 udev_path3'r/ partitionsadd/ partitions 3(u /type CT_UNKNOWN CT_DMRAID4vpinfosinfosd $w1 $x1*LibStorage::DmraidCoInfo$y1 /device&z0R 11({04|pinfo$}2*1&~/v2/,    y2warning   disk "%1" ret:%2 /device0'/ partitions &0R 1 1,  foreachinfo 21pinfop$3 2$3 &3y33'3fstype (3nr'/ partitionsadd/ partitions 3( /type CT_UNKNOWNCT_DMMULTIPATH4pinfosinfosd $1 $1+LibStorage::DmmultipathCoInfo$1 /device&0R 11(04pinfo$2+1&/v2/,    y2warning   disk "%1" ret:%2 /device0'/ partitions &0R 1 1,  foreachinfo 21pinfop$3!2$3 &3y33'3fstype (3nr'/ partitionsadd/ partitions 3( /type CT_UNKNOWN CT_MDPART4pinfosinfosd ls t$1 $1"LibStorage::MdPartCoInfo$1 /device&0R 11(04dinfo$2"1&/u2/,    y2warning   disk "%1" ret:%2 /device0$1    splitstring   "1 ,    y2milestone   ls=%11'/devices1$1"1'/ raid_type   substring     sformat   %1r21( / raid_typeraid54pt &1"1$2r41(2par_none'/parity_algorithm   substring     sformat   %12&1"1(14'/ chunk_size1'/sb_ver"1'/ partitions &0R 1 1,  foreachinfo 21p$3 &3z23'3fstype (3nr'/ partitionsadd/ partitions 3( /type CT_UNKNOWNCT_LVM4pinfosinfosn $1 $1'LibStorage::LvmVgInfo$1 /name&0R 11(04ls '/create'1'/size_k'1'/cyl_size*'1'/pesize*'1'/ cyl_count'1'/pe_free'1'/lvm2'1$2    splitstring   '1 ,    y2milestone   ls=%12'/devices2&2    splitstring   '1 (size2'/ devices_add2&2    splitstring   '1 (size2'/ devices_rem2,    y2warning   LVM Vg "%1" ret:%2 /name0&0R 1 1,  foreachinfo 21p $3 &02&3w03'3stripes2&02(0'3 stripesize0'3typelvm'3fstype '/ partitionsadd/ partitions 3( /type CT_UNKNOWNCT_MD4pinfos$1 &0R 1(0,    y2warning   getMdInfo ret:%10,  foreachinfo 21ptd ls $3 &02&3w03'3nr2$ 32' 3 raid_type   substring     sformat   %1r23(  3 raid_typeraid54 pt & 32$4r43(4par_none'3parity_algorithm   substring     sformat   %14'3typesw_raid'3fstype &32(34'3 chunk_size3$32'3sb_ver3$3    splitstring   2 '3devices3'/ partitionsadd/ partitions 3(  /type CT_UNKNOWNCT_LOOP4!pinfos$"1 &#0R 1($0,%    y2warning   getLoopInfo ret:%10,&  foreachinfo 21p $(3 &)02&*3w03'+3nr2',3typeloop'-3fstype '.3fpath2'/3 create_file!2(0 3enc_typeunknownluks'13device 3loop'2/ partitionsadd/ partitions 3(5 /type CT_UNKNOWNCT_DM46pinfos$71 &80R 1(90,:    y2warning   getDmInfo ret:%10,;  foreachinfo 21p$=3 &>02&?3w03'@3nr2'A3typedm'B3fstype 'C/ partitionsadd/ partitions 3(F /type CT_UNKNOWNCT_NFS4Gpinfos$H1 ,I    y2milestone   before getNfsInfo&J0R 1,K    y2milestone   after getNfsInfo(L0,M    y2warning   getNfsInfo ret:%10,N  foreachinfo 21p$P3 &Q0$2&R3w03'S3typenfs'T3fstype 'U/ partitionsadd/ partitions 3,Y    y2milestone   getContainerInfo container %1/-Z/%]|diskcinfol $_0 size_kcyl_size cyl_countlabel max_logical max_primarytypereadonly used_by_typeused_byused_by_device partitionsdasdfmtudev_id udev_path,c    foreachs  10(ehaskey/1'f/1/1(ghaskey/1&h/remove/1-j/%mXretcinfos$o/ $p/ ,qR /,r  foreachinfo 0/ctb $t1 'u1name%0'v1device%0$w1%0'x1typer-1&y1%0(z14{'|1 used_by_typer.1'}1used_by%0'~1used_by_device%0$1%0(1'1readonly&/add/1,    y2milestone   getContainers ret:%1/-/$}%~-  contains CT_DISK CT_DMRAIDCT_DMMULTIPATH CT_MDPART/%rem_keys tg &SX$/ $/EF ,    foreachdev disk 0 0/c$1 &1findc 2S 2device0(1&/   add/0(~ 1type CT_UNKNOWN4'/0|/0 {14'/0{1,    y2milestone   UpdateTargetMap dev:%1 is:%20/0 ,    y2milestone   UpdateTargetMap rem_keys:%1/,    foreachdev  0/&/   remove/0,  foreachc 0S(&& 0type CT_UNKNOWNCT_DISK!haskey/ 0device4'/ 0device{0,    y2milestone   UpdateTargetMap dev:%1 is:%2 0device/ 0device 'EF/%dev ctg,    y2milestone   UpdateTargetMapDisk&SX$0 &0findc 1S 1device/$0EF (04(haskey0/&0remove0/(~ 0type CT_UNKNOWN4'0/|0/ {04'0/{0'EF0%dev tg cdev cdisk ,    y2milestone   UpdateTargetMapDev %1/$0EF $0,    foreachkey d 1 10(&& size 0findp 31 partitions  3device/&0 1device,    y2milestone   UpdateTargetMapDev cdev %10$0 &0findc 1S 1device0$0 (04&0{0(&&0haskey004 partitionsfound$100 partitions $1&1maplistp 21( 2device/4pp$4findq 50 partitions  5device/(44&1&24-2'0 0device partitions1(!1,   y2error   UpdateTargetMapDev not found %1/,   y2error   -UpdateTargetMapDev key %1 not found in target 0device'EF0% c$0 &0findp 1S 1device/(04tmp$1c/,    y2milestone   getDiskInfo map %11( 1disk/&0findp 2S 2device 1disk,    y2milestone   getDiskInfo c:%10(04&/|/{0,    y2milestone   getDiskInfo ret:%1haskey/ partitionsremove/ partitions/-/%"($||/next/back4%&&Q/,'    y2milestone    Exit Key %1Q%+--Q%ekeysret $g/ mountenc_typemountbyfstoptused_fsformat$h/a,i    foreachd disk 0 0/pl$k1    maplistp  20 partitions    filterk e 3 32!contains/3&n1maplistp 21(p 2 detected_fsunknownunknown'q2used_fs 2 detected_fsunknown-r2't/0 partitions1-v/%yt ret${0+   +   +    targetMap_s_/_   sformat   %1}&|}+},} SCR::Write .target.ycpn0a,~    y2milestone   CreateTargetBackup who:%1/$0R /(0,   y2error   CreateTargetBackup sint ret:%10%ret,    y2milestone   DisposeTargetBackup who:%1/$0R /(0,   y2error   DisposeTargetBackup sint ret:%10%ret,    y2milestone   ,EqualBackupStates s1:"%1" s2:"%2" verbose:%3///$0R / //,    y2milestone   EqualBackupStates ret:%10-0%rett ,    y2milestone   RestoreTargetBackup who:%1/$0R /(0,   y2error   RestoreTargetBackup sint ret:%10,$0+    targetMap_r_/, SCR::Write .target.ycpn0a%,initial%-E targets_time%-EO%'EO/%,    y2milestone   GetPartMode %1 EG- EG%,    y2milestone   SetPartMode %1/'EG/%-EL%'EL/%- EH%'EH/%-EI%&EaddEI/%- EJNO%&EaddEJ/%- EMaccept%&EaddEM/%-EN%&EaddEN/%-EK%&EaddEK/%, % m$ / SCR::Execute.target.bash_output date +%s.%N,     y2milestone   constructor Storage() time:%1 /stdout(  4 , CUSTOM, ( 4 inst $ 0  SCR::Read.etc.install_inf.Partition( &&0 size 04 & A+   /dev/0,     y2milestone   5Storage .etc.install_inf.Partition "%1" part_insts:%20A, CUSTOM, , & / SCR::Execute.target.bash_output date +%s.%N,     y2milestone   !constructor Storage() end time:%1 /stdout$D sw_raid$E lvm$F extended%I retptnumdev r ,K     y2milestone   NextPartition disk:%1 ptype:%2//$L 0 $M 0s//,N     y2milestone   NextPartition type:%1 pt:%2/0$O 0$P 0$Q 0R /0 0 0(S 0,T    y2error   NextPartition ret %10'U 0device0'V 0nr0,W     y2milestone    NextPartition sint ret:%1 map:%200-X 0%\ numdev rret ,^     y2milestone   NextMd$_ /$` /$a /R / /(b /,c    y2error    NextMd ret %1/$d /device/nr/,e     y2milestone   NextMd sint ret:%1 map:%2//-f /%i rettmp $k 0$l 0 /label&m 0R 0,n     y2milestone   MaxSizeLabelK %1 is %2 /label0-o 0%r retcylk2 $t 0/,u     y2milestone    MaxCylLabel val_k:%1 cyl_size:%20/cyl_size$v 0//cyl_size(w 0&x 0,y     y2milestone   MaxCylLabel val_k:%1 cylk2:%200&z 0-/*00&{ 0+0/,|     y2milestone   MaxCylLabel ret:%10-} 0% cdev ptrettmp,     y2milestone   GCreatePartition disk:%1 device:%2 ptype:%3 id:%4 start:%5 len:%6 mby:%7///////$ 0$ 0s//,     y2milestone   CreatePartition type:%1 pt:%2/0$ 0R /0// 0( /0,    y2error   !CreatePartition device:%1 cdev:%2/0( 0,    y2error   CreatePartition ret %10& 0R //( 0,    y2error   CreatePartition ret %10$ 0s0/, R /0,     y2milestone   CreatePartition sint ret:%10, - 0% ret,     y2milestone   )UpdatePartition device:%1 start:%2 len:%3///$ 0& 0R ///( 0,    y2error   UpdatePartition sint ret:%10, /- 0% ret,     y2milestone   !SetPartitionMount device:%1 mp:%2//$ 0& 0R / /( 0,    y2error   SetPartitionMount sint ret:%10, /- 0% rettmp,     y2milestone   ,SetPartitionFormat device:%1 format:%2 fs:%3///$ 0$ 0s/,     y2milestone   SetPartitionFormat fs:%10& 0R //0( 0,    y2error   SetPartitionFormat sint ret:%10, /- 0% ret,     y2milestone   SetPartitionId device:%1 id:%2//$ 0& 0R //( 0,    y2error   SetPartitionId sint ret:%10, /- 0% ret,     y2milestone   UnchangePartitionId device:%1/$ 0& 0R /( 0,    y2error   UnchangePartitionId sint ret:%10, /- 0% ret,     y2milestone   -ResizePartition device:%1 disk:%2 new_cyls:%3///$ 0& 0R //( 0,    y2error   ResizePartition sint ret:%10, /- 0%! ret,#     y2milestone   ,ResizeVolume device:%1 disk:%2 new_size_k:%3///$$ 0&% 0R //+/(& 0,'    y2error   ResizeVolume sint ret:%10,( /-) 0%- is_cryptret,/     y2milestone   #SetCrypt device:%1 val:%2 format:%3///$0 0$1 0R / 0(3 &&&&0!/0/,4     y2milestone   SetCrypt crypt already set46 &7 0R //(8 049 ,:    y2error   SetCrypt sint ret:%10(; &&!//,<     sformat   dCould not set encryption. System error code is %1. The crypt password provided could be incorrect. storage0,A R /,D     y2milestone   SetCrypt sint ret:%10-F 0%I dev txt ret$K 0R / /-L 0%O rettmpchangedts dev vinfocurr$Q 0$R 0$S 0$T 0$U 0 /device$V 0LibStorage::VolumeInfo&W 0R 00(X 0,Y    y2error   *ChangeVolumeProperties device:%1 not found0$Z 0 ([ 04\ &] 0w00(_ &&0 /mount 0mount4` &a 0&b 0 /mount&c 0R 0 0(d 0,e    y2error   "ChangeVolumeProperties sint ret:%10,g     y2milestone   "ChangeVolumeProperties sint ret:%10(i &&&&0 /typeunknownextended||/format0format /used_fsnone 0used_fsnone4l &m 0&n 0s /used_fsnone,o     y2milestone   &ChangeVolumeProperties fs:%1 symbol:%20 /used_fsnone&p 0R 0/format0(s 0,t    y2error   "ChangeVolumeProperties sint ret:%10,v     y2milestone   "ChangeVolumeProperties sint ret:%10(x &&&&0 size  /mount /fstopt 0fstopt4z &{ 0&| 0 /fstopt&} 0R 0 0(~ 0,    y2error   "ChangeVolumeProperties sint ret:%10,     y2milestone   "ChangeVolumeProperties sint ret:%10( &&&&0 size  /mount /mountbyid 0mountbyid4 & 0& 0s0 /mountbydevice,     y2milestone   ChangeVolumeProperties mby:%10& 0R 00( 0,    y2error   "ChangeVolumeProperties sint ret:%10,     y2milestone   "ChangeVolumeProperties sint ret:%10( &&0 /label 0label4 & 0& 0 /label& 0R 0 0( 0,    y2error   "ChangeVolumeProperties sint ret:%10,     y2milestone   "ChangeVolumeProperties sint ret:%10( &&&&0/formatp/ fs_options mkfs 0mkfs_opt4 & 0& 0p/ fs_options mkfs,     y2milestone   FsOption ts:%10& 0R 0 0( 0,    y2error   "ChangeVolumeProperties sint ret:%10,     y2milestone   "ChangeVolumeProperties sint ret:%10( &&&&0/formatp/ fs_options tunefs 0 tunefs_opt4 & 0& 0p/ fs_options tunefs,     y2milestone   FsOption ts:%10& 0R 0 0( 0,    y2error   "ChangeVolumeProperties sint ret:%10,     y2milestone   "ChangeVolumeProperties sint ret:%10( &&0 /enc_typenone 0enc_typenone4 & 0, 0 /enc_typenonenone/format( &&0 /dtxt 0dtxt4 & 0& 00 /dtxt( &&0||&&/resize/region0region/resize0resize4 d i& 0$ 1 /device$ 1/region( /resize4 ,     y2milestone   'ChangeVolumeProperties resize to %1 cyl1( / ignore_fs& 0R 11& 0R 11& 0R 1( 0,    y2error   "ChangeVolumeProperties sint ret:%10,     y2milestone   "ChangeVolumeProperties sint ret:%10( &&&&0/ change_fsid/fsid0fsid4 d i& 0$ 1 /device$ 1/fsid,     y2milestone   !ChangeVolumeProperties fsid to %11& 0R 11( 0,    y2error   "ChangeVolumeProperties sint ret:%10,     y2milestone   "ChangeVolumeProperties sint ret:%10( 04 ,    y2debug   )ChangeVolumeProperties changed:%1 part:%20/( 0, 0- 0% ret,     y2milestone   DeleteDevice disk:%1 device:%2//$ 0R /( 0,    y2error   DeleteDevice sint ret:%10, - 0% ret,     y2milestone   DeleteLvmVg name:%1/$ 0R /( 0,    y2error   DeleteLvmVg sint ret:%10, - 0% ret,     y2milestone   DeleteDmraid name:%1/$ 0R /( 0,    y2error   DeleteDmraid sint ret:%10, - 0% ret,     y2milestone   DeleteMdPartCo name:%1/$ 0R /( 0,    y2error   DeleteMdPartCo sint ret:%10, - 0% devs ret,     y2milestone   %CreateLvmVg name:%1 pesize:%2 lvm2:%3///$ 0 $ 0& 0R ///!/ 0( 0,    y2error   CreateLvmVg sint ret:%10, - 0% ret,     y2milestone   5CreateLvmVgWithDevs name:%1 pesize:%2 lvm2:%3 devs:%4////$ 0& 0R ///!/ /(! 0,"    y2error   CreateLvmVgWithDevs sint ret:%10,# -$ 0%' retdevs ,)     y2milestone   ExtendLvmVg name:%1 device:%2//$* 0$+ 0/&, 0R / 0(- 0,.    y2error   ExtendLvmVg sint ret:%10,/ -0 0%3 retdevs ,5     y2milestone   ReduceLvmVg name:%1 device:%2//$6 0$7 0/&8 0R / 0(9 0,:    y2error   ReduceLvmVg sint ret:%10,; -< 0%? retdummy ,B     y2milestone   ,CreateLvmLv vg:%1 name:%2 sizeK:%3 stripe:%4////$D 0$E 0&F 0R / //+// 0(I 0,J    y2error   CreateLvmLv sint ret:%10,K +   /dev//-L 0%O retdummy ,R     y2milestone   .ChangeLvStripeSize vg:%1 name:%2 stripeSize:%3///$T 0$U 0&V 0R / //(Y 0,Z    y2error   ChangeLvStripeSize sint ret:%10,[ +   /dev//-\ 0%_ retdummy ,b     y2milestone   ,ChangeLvStripeCount vg:%1 name:%2 stripes:%3///$d 0$e 0&f 0R / //(i 0,j    y2error   ChangeLvStripeCount sint ret:%10,k +   /dev//-l 0%o retdummy ,q     y2milestone   )AddNfsVolume dev:%1 opts:%2 size:%3 mp:%4////$s 0$t 0&u 0R / // /(v 0,w    y2error   AddNfsVolume sint ret:%10,x /dev/nfs-y 0%| retszdummy ,~     y2milestone   CheckNfsVolume dev:%1 opts:%2//$ 0$ 0$ 0& 0R / / 0( 0,    y2error   CheckNfsVolume sint ret:%10& 00,     y2milestone   CheckNfsVolume ret:%10- 0% rettmpdummy rd  ,     y2milestone   CreateMd nr:%1 type:%2//$ 0$ 03/$ 0 $ 0   sformat    /dev/md%1/& 0R 00 0( 0,    y2error   CreateMd sint ret:%10, /dev/md- 0% rettmprd  ,     y2milestone   )CreateMdWithDevs nr:%1 type:%2 devices:%3///$ 0$ 0,     foreachkv  1 12m ( 1/& 01$ 0   sformat    /dev/md%1/& 0R 00 /( 0,    y2error   CreateMdWithDevs sint ret:%10, - 0% retrd ,     y2milestone   ExtendMd nr:%1 dev:%2//$ 0$ 0   sformat    /dev/md%1/& 0R 0 /( 0,    y2error   ExtendMd sint ret:%10, - 0% retrd ,     y2milestone   ShrinkMd nr:%1 dev:%2//$ 0$ 0   sformat    /dev/md%1/& 0R 0 /( 0,    y2error   ShrinkMd sint ret:%10, - 0% retrd tmp,     y2milestone   ChangeMdType nr:%1 mdtype:%2//$ 0$ 0   sformat    /dev/md%1/$ 03/& 0R 00( 0,    y2error   ChangeMdType sint ret:%10, 0- 0% retrd tmp,     y2milestone   ChangeMdParity nr:%1 parity:%2//$ 0$ 0   sformat    /dev/md%1/$ 05/& 0R 00( 0,    y2error   ChangeMdParity sint ret:%10, 0- 0% retrd tmp,     y2milestone   $ChangeMdParitySymbol nr:%1 parity:%2//$ 0$ 0   sformat    /dev/md%1/$ 0s4/& 0R 00( 0,    y2error    ChangeMdParitySymbol sint ret:%10, 0- 0% retrd ,     y2milestone   ChangeMdChunk nr:%1 chunk:%2//$ 0$ 0   sformat    /dev/md%1/& 0R 0/( 0,    y2error   ChangeMdChunk sint ret:%10, 0- 0% retrd ,     y2milestone    CheckMd nr:%1/$ 0$ 0   sformat    /dev/md%1/& 0R 0( 0,     y2milestone   CheckMd sint ret:%10- 0% rettmp$ 0$ 0,     foreachkv  1 12m ( 1/& 01& 0R0/ /( 0,     y2milestone   ComputeMdSize sint ret:%10- 0% pwd ret$ 0,     y2milestone   GetCryptPwd device:%1/$ 0& 0R / 0( 0,    y2error   GetCryptPwd sint ret:%10,     y2milestone   GetCryptPwd empty:%1 size 0- 0% ret,"     y2milestone   SetCryptPwd device:%1/$# 0&$ 0R / /(% 0,&    y2error   SetCryptPwd sint ret:%10,(     y2milestone   SetCryptPwd sint ret:%10-) 0%, ret$. 0&/ 0R /,0     y2milestone   NeedCryptPwd device:%1 ret:%2/0-1 0%4 dev retpwd  ,7     y2milestone   +CreateLoop file:%1 create:%2 sizeK:%3 mp:%4////$9 0$: 0$; 0/&< 0R /!// / 0 0(> 0,?    y2error   CreateLoop sint ret:%10,@ R /,A  /dev/loop,B     y2milestone   CreateLoop dev:%10-C 0%\ ,^ R / /%c ret,f     y2milestone   /UpdateLoop device:%1 file:%2 create:%3 sizeK:%4////$h 0R / /!//(k 0,l    y2error   UpdateLoop sint ret:%10,m  /dev/loop,n a-o 0%r ret,t     y2milestone   )DeleteLoop disk:%1 file:%2 remove_file:%3///$v 0R //(x 0,y    y2error   DeleteLoop sint ret:%10,z /-{ 0%~ label ,     y2milestone   DefaultDiskLabel size_k:%1/$ 0R/,     y2milestone   DefaultDiskLabel label:%10- 0% label ret,     y2milestone   !DeletePartitionTable %1 size_k:%2//$ 0R/,     y2milestone   DeletePartitionTable label:%10$ 0R / 0( 0,    y2error    DeletePartitionTable sint ret:%10, - 0% ret,     y2milestone    CreatePartitionTable %1 label:%2//$ 0R / /( 0,    y2error    CreatePartitionTable sint ret:%10, - 0% rboolret$ 0,     y2milestone   InitializeDisk %1 value %2//$ 0R //( 04 ,    y2error   InitializeDisk sint ret:%10& 0( &&0/4 d $ 1ga/,     y2milestone   d:%11& 0/+   /1primary 1 cyl_count+   /1( !0,    y2error   InitializeDisk create failed, /- 0% - ||||||/ CT_DMRAID/CT_DMMULTIPATH/CT_DISK/ CT_MDPART% ctype dpret$ 0( /4 & 0 /device /device /typeprimary/fsid /region/region /mountby /device( /CT_MD4 & 0/nr / raid_typeraid1( &&0haskey/ chunk_size, /nr/ chunk_size( &&&&0 / raid_typeraid5haskey/parity_algorithm, /nr /parity_algorithm,     foreachd  2/devices & 0&&/nr20( /CT_LOOP4 dev ,     y2milestone   CreateAny Loop p:%1/$ 1 /fpath/ create_file/size_k /mount& 0 size 1( 0' /device1( /CT_LVM4 & 0 /name /name/size_k/stripes( &&&&0/stripes/ stripesize4 ,  /name /name/ stripesize( /CT_NFS4 & 0 /device /fstopt/size_k /mount,     y2milestone   CreateAny ret:%10- 0% pmret$ 0k /device /used_fsnone$ 00efi,     y2milestone   IsEfiPartition ret:%10- 0%  partitionsprimarymax_prim foreign_nr foreign_ids new_partitions( &&&&!!!- $ 0CDEFGHIJKLMNOPQRSTUVW$ 0 ,   foreach partition 1/ new_partitionfsidpartnum$ 21$ 21fsid $ 2( &&haskey1nr1nr4! &" 21nr(% &&&&&&&&&&&&!haskey1mount!1delete2/// 2||!&&!11size_k*  contains vfatntfs 1used_fsnone4- '. 2fstopt1(0 contains 241 '2 2mount+   /dos/   substring  0/&4 /+/47 '8 2mount+    /windows/   substring  0/&: /+/,< 2,=     y2milestone    win part %12%B  foreign_nr,D     y2milestone   AddMountPointsForWin called$E 0,G     foreachdisk data 1 1/(I &&!1 hotpluggable 1 used_by_typeUB_NONEUB_NONE,K 1 partitions 1 max_primary 0,N     foreachdisk data 1 1/(P &&!1 hotpluggable 1 used_by_typeUB_NONEUB_NONE,R 1 partitions 1 max_primary 0%\ ,^     y2milestone   RemoveDmMapsTo device:%1/(_ !Y-` ,a R /%d cmd ok$f 0+   /sbin/swapon --fixpgsz /$g 0 SCR::Execute .target.bash0(h 04i &j 0+   /sbin/swapoff /,k  SCR::Execute .target.bash0,m     y2milestone   CheckSwapable dev:%1 ret:%2/0-n 0%v swaps$x 0h,y     y2milestone   AddSwapMp swaps %10,z     foreachdiskdev disk 1 1/'| 1 partitionsmaplistpart 31 partitions (~ ||&&&&&&&&! 3fsid 3 detected_fsunknownswap!3old_swap  search  1 /dev/evmscontains0 3device4 ok$ 5( !contains0 3device4 & 5 3device,     y2milestone   AddSwapMp initial ok:%15( 54 ' 3mountswap, 3,     y2milestone    AddSwapMp %13- 3' /11- /% atmp changedret ( !Y- $ / $ /( &&!P! 4  bios_id_raid  rename   $ 0 ,     y2milestone   probing StorageDevices$ 0 & / ,     foreachdev disk 1 1/dtmp$ 2b1  ,     y2milestone   probing dev %1 disk %212( ||  search  1/dev/dm-  search  1/dev/md4 (  size  1bios_id' 01 1bios_id( && size  2disk1 2disk4 ' 01 2disk,     y2milestone   probing rename %10& /   filterdev disk 1 1/  search  1/dev/dm-& /   filterdev disk 1 1/  search  1/dev/md( size04 ,       foreachold new  2 20( haskey/24 ' /2/2 & /   remove/2' /2device2,     y2milestone   probing old:%1 new:%22/2 ,     y2milestone    probing done( size/4 & P& /,     foreachdev disk 2 2/s& 222$ 3*2size_k' 2name+   +   +   +    2dnameZ3,  2device, (  size  2vendor' 2name+   +    2name 2vendor-' 2name+    2name 2model( haskey2dname& 2remove2dname' /22( 2dasdfmt, 2,   foreachc 2S(  2type CT_UNKNOWNCT_DISK' / 2device{2( size04 ,     y2milestone   bios_id_raid:%10,       foreachdm bios  3 30posminor$ 4   findfirstof  3 0123456789$ 4 tointeger   substring  34,     y2milestone   pos:%1 minor:%244,     foreachdev c 5 5/( && 5type CT_UNKNOWN CT_DMRAID5minor44 ,     y2milestone   addind bios_id %1 to %235' /5bios_id3( && 5type CT_UNKNOWN CT_MDPART 5device34 ,     y2milestone   addind bios_id %1 to %235' /5bios_id3'EF/(/4 &/EF , SCR::Write .target.ycpn targetMap_i/,    y2milestone    AddSwapMp&//, initial( &&|| ! 4 , /'EFa, SCR::Write .target.ycpn targetMap_ii/,    y2milestone    changed done$/EF (/,    y2milestone   GetTargetMap changed:%1 ret:%2//,   y2debug   GetTargetMap changed:%1 ret:%2//-/%,    y2milestone   SetRecursiveRemoval val:%1/,R/%"-$R%'tg keys t1 changed,)    y2milestone    SetTargetMap(*!,+,.tmp_set$/0a$00    maplistk e 1 1/1,1    foreachk  10(3&&/1deletehaskey0144(5 /1type CT_UNKNOWNCT_LVM46,7 /1name'8/1delete(: /1type CT_UNKNOWN CT_DMRAID4;,<1'=/1delete&A0    maplistk e 1 1/1,B    y2milestone   SetTargetMap keys %10$C0   filterk  10&&!/1delete!/1create,F    foreachk  10dps$H2filterp 3/1 partitions &&!3create!3delete(Jsize24K,L  foreachp 42(N|| 4typeprimaryextended4resize,O4&S0    maplistk e 1 101&T0    sorta b  1 109 01type CT_UNKNOWN 9 01type CT_UNKNOWN ,W    y2milestone   SetTargetMap keys %10,X    foreachk  10dps$Z2filterp 301 partitions 3create(\&&size2haskey2 nr4]&^2sortab 4 424nr4nr,_    y2milestone   SetTargetMap dps:%12,a  foreachp 32,a1 3device(b01create4c(d 01type CT_UNKNOWNCT_LVM,e 01name(g!01delete4h(i&& 01type CT_UNKNOWNCT_LVMsize/1 devices_add 4kls $l4/1 devices_add ,m    foreachd  54,n /1name5&r0    maplistk e 1 1/1&s0    sorta b  1 109 /1type CT_UNKNOWN 9 /1type CT_UNKNOWN ,v    y2milestone   SetTargetMap keys %10,w    foreachk  10dps$y2filterp 3/1 partitions 3delete({&&size2haskey2 nr4|&}2sortab 4 424nr4nr,  foreachp 32( size  3dtxt, 3device 3dtxt,1 3device(/1delete4( /1type CT_UNKNOWNCT_LVM, /1name( /1type CT_UNKNOWNCT_DISK,1/1size_k( /1type CT_UNKNOWN CT_DMRAID,1(&&/1 del_ptable /1type CT_UNKNOWN4,1/1size_k&0    maplistk e 1 1/1&0    sorta b  1 109 /1type CT_UNKNOWN 9 /1type CT_UNKNOWN ,    y2milestone   SetTargetMap keys %10,    foreachk  10dps(/1create4( /1type CT_UNKNOWNCT_LVM4ls , /1name/1pesize/1lvm2$4 union/1devices /1 devices_add ,    foreachd  54, /1name5(&&!/1delete!/1create4(&& /1type CT_UNKNOWNCT_LVMsize/1 devices_add 4ls $4/1 devices_add ,    foreachd  54, /1name5$2filterp 3/1 partitions &&!3delete3create(&&size2haskey2 nr&2sortab 3 323nr3nr,  foreachp 32, /1type CT_UNKNOWN/1  3( 3typeprimaryextended,3$0!tmp_set,    y2milestone   SetTargetMap changed:%10(0,d,tmp_set,    y2milestone   SetTargetMap ChangeTime %1% need_reread$/R(!Y-,    y2milestone   start reread need_reread:%1/&P(/,R&SX-a%ret,    y2milestone    CommitChanges$/R(/,   y2error   CommitChanges sint ret:%1/-/%ret $0,R / 0( size 0,    y2milestone   DeviceMounted %1 at %2/0-0%ret$0R /,    y2milestone   Umount %1 ret %2/0-0% ret$ 0R / / /,    y2milestone    MountOpt %1 to %2 with %3 ret %4///0-0%-//%!rethomeposs_fs,#    y2milestone   DetectHomeFs p:%1/$$0 $%0$&0 ext2ext3reiserxfsjfs('&&&&!/createdcontains0 / detected_fsunknown size  /device4)mount_oktmpdir fsto $*1$+1+     SCR::Read.target.tmpdir/hmp,, SCR::Execute .target.mkdir1$-1/&.1 /device11(/!1&01 /device1'20fstopt1(3144skiptfilefiles count$52 ...root$62 .profile.ssh.bashrc.kde2.gnome2.kde.gnome$72  SCR::Read .target.dir1,8    y2milestone   DetectHomeFs files:%12$92);&&!02size24<td $=3+   +   1/22 (>&&!contains222 34@i$A4)B&&!04size24Ctname $D5+   +   3/ 24&E05&F4+4&I2+2,K /device,M SCR::Execute .target.bash+   rmdir 1'O0ishome0,P    y2milestone   DetectHomeFs ret:%10-Q0%Tret ,W    y2milestone   SetVolOptions p:%1/,X    y2milestone   :SetVolOptions mount:%1 fs:%2 fs_opt:%3 fst_opt:%4 label:%5/////$Z0/([ size /'\0mount/(]&&//unknown'^0used_fs/4`(a/ 'b0used_fs 'd0used_fs (f|| 0used_fsunknownunknown 0used_fsunknownnone'h0format'j0format(k&&&&&&0format!0create 0 detected_fsunknownunknown//home4mlvmh$n1 /typeprimarylvm$o10(p||&&1 0namehome&&!11ishome4r's0format't0used_fs 0 detected_fsunknown(u size /&v/ 1fstopt(y&&&&&&0format!0create 0 detected_fsunknownswap/swap4{'|0format'}0used_fsswap( size /'0fstopt/'0fstopt0( size /'0 fs_optionsq/ 0used_fsunknownmkfs'0 fs_options0( size /'0label/(&& size  0label0format'0label,    y2milestone   SetVolOptions ret:%10-0%ret$0(4(&&&&!/created!/inactive /mountswap4&0,    y2milestone    CanEdit p:%1/(/4txt $3   sformat   i Device %1 cannot be modified because it contains activated swap that is needed to run the installation. storage /device, 3(&& size A /deviceA4&0,    y2milestone   CanEdit part_insts:%1 p:%2A/(/4txt $3   sformat   l Device %1 cannot be modified because it contains the installation data needed to perform the installation. storage /device, 3,    y2milestone    CanEdit dev:%1 verbose:%2 ret:%3 /device/0-0%txt ret$0$0/(&&!0/4( /mountswap4&0   sformat   h Device %1 cannot be removed because it contains activated swap that is needed to run the installation. storage /device4&0   sformat   k Device %1 cannot be removed because it contains the installation data needed to perform the installation. storage /device, 0(&&0|| /typeunknownlogical /typeunknownextended4numplpos$1 /typeunknownextended/nr$1filterq 2/ partitions && 2typeunknownlogical2nr1,    y2milestone   CanDelete pl:%11$1)&&01size14&011 (0&1+1(&&!0/4( /mountswap4&0   sformat    Device %1 cannot be removed because this would indirectly change device %2 which contains activated swap that is needed to run the installation. storage /device 11device4&0   sformat    Device %1 cannot be removed because this would indirectly change device %2 which contains data needed to perform the installation. storage /device 11device, 0(&&0   substring   /device  /dev/dasd4(find partition 2/ partitions && 2device /device 2 used_by_typeUB_NONEUB_NONE4&0   sformat   R Partition %1 cannot be removed since other partitions on the disk %2 are in used.storage /device /device, 0&0,    y2milestone   "CanDelete dev:%1 verbose:%2 ret:%3 /device/0-0% retvinfosr$ 0 $0 $0R / 0(!0,   y2error   ReadFstab sint dir %1 ret %2/04,  foreachinfo 20p$3 &3w23&0add03,    y2milestone   ReadFstab from %1 ret %2/0-0%d ret$!0ga/$"0filterp 10 partitions  size  1device-$0%(inforet $*/-LibStorage::CommitInfo,+R/$-/ destructive-/-1/$5%7l ret $9/R$:/(;size/&<//(=/4>,?    foreachs  1/,A    y2milestone    ChangeText %11&C/-E/%Hret $J/R-K/%Nret $P/R-Q/%T,V    y2milestone   SetZeroNewPartitions val:%1/,WR/%e mountPoints swapPointstg $g/ $h/ $i/a,j    foreach targetdevice target 0 0/ partitions$l10 partitions ,m  foreach partition 21 partitionName  mountPoint fsid$o3 2device$p3 2mount$q32fsid(r34s raid_type $t4(u 2type undefinedsw_raid4v&w4 2 raid_type(z3swap4{&|/add/33044&/add/33304(size/&/add/swap/(!4cm$0filtere 1   search   1spec/dev/,  foreache 10(!haskey/ 1file4p$3f/ 1spec(size34 raid_type d$4( 3type undefinedsw_raid4&4 3 raid_type$4c 1spec'/ 1file 3device3fsid 4disk4,    y2milestone   ret %1/-/%ret tg $0/$0a(haskey0/ partitions nr4ps$1filterp 20/ partitions 2nr/(size1&1sortab 2 212nr2nr(size1&0 1device&0 0/ partitionsdevice/,    y2milestone   $GetIdSmaller disk:%1 delim:%2 ret:%3//0-0%tmpdisk dev r_part,    y2milestone   *SetPartitionData device=%1 key=%2 value=%3///$0b// $0 0disk$0C 0disk0nr$0filterpart 1/0 partitions  1device0(size0size/0 partitions 4p$1filterpart 2/0 partitions  2device0 (size14'1//&0add01'/0 partitions0-/%tmpdisk dev r_part,   y2debug   device=%1, key=%2//$0b// $0 0disk$0C 0disk0nr$0filterpart 1/0 partitions  1device0(size0size/0 partitions 4p$1filterpart 2/0 partitions  2device0 (size14&1   filterk e 3 3 13/&0add01'/0 partitions0-/%-&& /type CT_UNKNOWNCT_DISK!&&&& /type CT_UNKNOWNCT_DISK/readonly /drivervbd%-|||||| /type CT_UNKNOWN CT_DMRAID /type CT_UNKNOWNCT_DMMULTIPATH /type CT_UNKNOWN CT_MDPART/%ret$0(&&  search  /LABEL  search  /UUID4dev$1 &1c/&0&&&&&& 1disk/dev/md 1disk /dev/loop  search   1disk /dev/evms1nr( &&!0 1disk/dev/md4!st$"2 SCR::Read .target.stat 1disk&#0!2isdir,&    y2milestone   DeviceRealDisk %1 ret %2/0-'0%4ret$5/,6    foreachdev disk 0 0a(7!/48(904:,;  foreache 40 partitions &</||/ 4fsid ,B    y2milestone   HaveLinuxPartitions ret=%1/-C/%^ret$_/ ,`    foreachdev disk 0 0a(a04bl$c2filterp 30 partitions &&!3format 3fsid&f2filterp 32  contains xfsext2ext3jfsreiser 3used_fsunknown&h2filterp 32! 3mount(jsize24k&l/union/2,p    y2milestone   GetOtherLinuxPartitions ret=%1/-q/%yretswaps$z0${0h)|&&size0!04}(~  search   0/4&0&0remove0,    y2milestone   CheckSwapOn %1 ret %2/0-0% retentrytext num_dosnum_winnum_os2 num_linux linux_text dos_text  win_text  os2_text  num$0 $0 $0$0$0$0$0$0 Linux other$0dos$0 windows$0 OS/2 Boot Manager,    foreachdisk data 1 1/,  foreachpart 31 partitions device $4 3device(&& 3typeunknownprimary SCR::Execute .target.bash+   /usr/lib/YaST2/bin/check.boot 44&0(&&&& 3fsid 1 used_by_typeUB_NONEUB_NONEk4 3used_fsnonewin_disk4(contains 3fsid4&0+0&004&0+0&00 (&&3fsid!/4&0Vendor diagnostic(3fsid 4&00 &0+0(&&&&3fsid  size  3mount!/4&00&0+0( size 04'0device4'0string0&0add0eval0,    y2milestone    new entry %10,    y2milestone   MGetPrimPartitions foreign_os:%5 num_linux %1 num_win %2 num_dos %3 num_os2 %40000/$0 (04&0maplistentry 20( 2string04'2string+   0   sformat    %10 &0 +0 -2&0 (04&0maplistentry 20( 2string04'2string+   0   sformat    %10 &0 +0 -2&0 (04&0maplistentry 20( 2string0 4'2string+   0    sformat    %10 &0 +0 -2&0 (04&0maplistentry 20( 2string0 4'2string+   0    sformat    %10 &0 +0 -2,    y2milestone   GetPrimPartitions ret %10-0% ret$ 0/,     y2milestone   GetWinPrimPartitions ret %10-0%r (!Y-$/R,    y2milestone   GetUsedFs ret:%1/-/%,    y2milestone    SaveUsedFs,  SCR::Write.sysconfig.storage.USED_FS_LIST    mergestring    ,! SCR::Write.sysconfig.storage%%pl tg need_lvmneed_nfs need_quota need_crypt$'/:$)/a$+/$,/$-/$./,0    foreachk e 0 0/(1 0type CT_UNKNOWNCT_LVM&2/(3 0type CT_UNKNOWNCT_NFS&4/(5sizefilterp 20 partitions 2&7/(8sizefilterp 20 partitions  2enc_typenonenone&:/,=    y2milestone   9AddPackageList need lvm:%1 need nfs: %2 quota:%3 crypt:%4////(?/4@&A/   add/lvm2(F/4G&H/   add/ nfs-client&I/   add/yast2-nfs-client(K/4L&M/   add/quota(O/4P&Q/   add/ cryptsetup&R/   add/ pam_mount,U    y2milestone   AddPackageList ret %1/-V/%_PackagesProposal proposal_ID pkgs 3cPackagesProposalSetResolvables   $e/storage_proposal$f/,k0/package/(m4n,o%tret$v/ (w||||4x,y  foreache 1a&{/add/   sformat   %1 %2 1device 1string,~    y2milestone   ret=%1/-/%ret$0unknown(||&&! /fsid /typenonelvm4(/fsid 4&0swap4&0 /used_fsunknown,    y2milestone   IsResizable part:%1 ret:%2/0-0%ret$0(R / 0&0,    y2milestone   "FreeCylindersAfterPartition ret:%10-0%retcylinder$0$0+//,  foreachpart 1/ partitions (&&1region01create4&0,    y2milestone   !CheckNextCreated region:%1 ret:%2/0-0%( /4&/+    /-/% targetMap ml need_cryptoloop need_fish2 $0   filtere  1    splitstring   (.sysconfig.kernel.MODULES_LOADED_ON_BOOT  size 1,    y2milestone   HandleModulesOnBoot ml %10$0$0,    foreachdisk e 1 1/,  foreachp 31 partitions (&&3noauto 3enc_typenonenone4( 3enc_typenonetwofish&0(|| 3enc_typenone twofish_old 3enc_typenonetwofish_256_old&0,    y2milestone   4HandleModulesOnBoot need_fish2 %1 need_cryptoloop %200(&&0   finde  101 loop_fish24&0   add0 loop_fish2, SCR::Write(.sysconfig.kernel.MODULES_LOADED_ON_BOOT    mergestring   0 (&&0   finde  101 cryptoloop4&0   add0 cryptoloop, SCR::Write(.sysconfig.kernel.MODULES_LOADED_ON_BOOT    mergestring   0 (&&0   finde  101twofish4&0   add0twofish, SCR::Write(.sysconfig.kernel.MODULES_LOADED_ON_BOOT    mergestring   0 %retfreqpassnodev m vfs opts  ,    y2milestone   AddFstabEntry entry:%1/$0$0/freq$0/passno$0 /spec$0 /mount$0 /vfstypeauto$0 /mntopsdefaults&0R 0 0 0 000(0,   y2error   ret:%1 entry:%20/-0% ,    y2milestone   ActivateHld val:%1/,R/%  ,     y2milestone   ActivateMultipath val:%1/,R/% mnum ,    y2milestone   WriteFstab called,proc,sys,debug(,usb,pts$/ $ /,"    foreachtdevice tdata 0 0zfile &$/zip$%1/zip(&/&'1+   1   sformat   %1/'(/mount+   /media1')/spec+   04,*/&+/+/,-a%0  have_ppc_boot$20,3    foreachdev disk 1 1/,5  foreachpart 31 partitions (7&&&&&&!03fsid  size  3mount3create4:&;0,?    y2milestone   %SpecialBootHandling: have_ppc_boot:%10,@    foreachdev disk 1 1/new_part$B2 ,C  foreachpart 31 partitions (F&&&&  3mount !04Hid$I5 'J3format'K3mount'L3fstype 5'M3 prep_install(N&&!3create3fsid54O'P3ori_fsid3fsid'Q3 change_fsid'S3fsid5,T    y2milestone   )SpecialBootHandling modified Prep part=%13(V&& 3mount 4Xid$Y5 'Z3mount'[3fstype 5'\3fsid5']3used_fshfs'^3 detected_fshfs,_    y2milestone   (SpecialBootHandling modified hfs part=%13(a&& 3mount 4cid$d5 'e3fsid5'f3fstype 5(g&&!3create 3 detected_fsnonevfat4h'i3format,k    y2milestone   -SpecialBootHandling modified GPT boot part=%13&m2add23'o/1 partitions2-q/%u crypt_okpwd device mdir  $w0$x0 /passwd$y0 / partitionName$z0ntmp_mp,{    y2milestone   PerformLosetup mdir:%10(| SCR::Read .target.size04},~ SCR::Execute .target.bash+   rm -f 0, SCR::Execute .target.mkdir0&0&&&&00000(04vinforet$1LibStorage::VolumeInfo$1R 01(14,   y2error   +PerformLosetup device:%1 not found (ret:%2)01&04'/loop_dev+   /dev/mapper/cr_   substring  0+   findlastof  0/,    y2milestone   PerformLosetup crdev:%1 /loop_dev, SCR::Execute .target.bash+   umount 0,    y2milestone   PerformLosetup ret %10-0%ret vinfor$0unknown,    y2milestone    DetectFs:%1/$0LibStorage::VolumeInfo$0R /0(04,   y2error   %DetectFs device:%1 not found (ret:%2)/04curr$1 &1w01&0 1 detected_fsunknown,    y2milestone   DetectFs ret %10-0%rettg$0 $0a&0filterp 10/ partitions 1boot ,    y2milestone   disk:%1 ret:%2/0-0%tabpath fstabline rem_lines ,    y2milestone   <UpdateFstabSubfs removing fstab entries for cdrom and floppy$/ /etc/fstab$/ /$/$/ )//4l$0 //(  search   0fields /media/floppy4 & /add//( ||||||||||||||  search   0fields /media/cdrom  search   0fields /media/dvd  search   0fields/media/cdrecorder  search   0fields/media/dvdrecorder  search   0fields/cdrom  search   0fields/dvd  search   0fields /cdrecorder  search   0fields /dvdrecorder4&/add//&/+/,    y2milestone   UpdateFstabSubfs %1/(size/4&/sort/, //, //%"tabpath fstabline have_sysfs,$    y2milestone   UpdateFstabSysfs called$%/ /etc/fstab$&/ /$'/$(/))&&!///4*l$+0 //&,/ 0fields/sys&-/+/(/!/40entryfstlist$10sys$20 0spec 0mount 0vfstype 0mntops   sformat   %10freq   sformat   %10passno,6    y2milestone   UpdateFstabSysfs entry %10,7    y2milestone   UpdateFstabSysfs fstlist %10,8 /0,9 //%=tabpath fstablinen ,>    y2milestone   UpdateFstabOptions$?/ /etc/fstab$@/ /$A/$B/)C//4Dloptions $E0 //$F0 0fields(G   regexpmatch  0^(.*,)?hotplug(,.*)?$4G&H0     regexpsub    0^(.*,)?hotplug(,.*)?$ \1nofail\2,I //0&K/+/,M //%Pret regex $R0/$S0/dev/hd[a-z][0-9]*(T   regexpmatch  /04U&V0+   /dev/iseries/vd   substring  0,X    y2milestone   HdToIseries input:%1 ret:%2/0-Y0%\ret regex1 regex2 prefix tmpdev  $^0/$_0/dev/disk/by-id/.*$`0/dev/disk/by-path/.*$a0scsi-$b0(d   regexpmatch  /.*-part[0-9]*$4e-f/(i   regexpmatch  /.*/by-id/(scsi|ccw|usb|ata)-.*$4j-k/(n   regexpmatch  /04o(p   regexpmatch  /.*/by-id/0X.{4}p?[0-9]?$4q&r0ccw-&t0+   +   /dev/disk/by-id/0   substring  /+   findlastof  //,v    y2milestone    by id tmp %10&w00(y   regexpmatch  /04z&{0/,|    y2milestone   by path tmp %10( size 04(   regexpmatch  0 .*p[0-9]*$4&0     regexpsub    0(.*)p([0-9]*)$ \1-part\24&0     regexpsub    0!(.*[[:alpha:][:punct:]])([0-9]*)$ \1-part\2,    y2milestone   'SLES9PersistentDevNames input:%1 ret:%2/0-0%ret $0/(D/4d$1c/(haskey/ 1disk4&0C / 1disk1nr,    y2milestone   HdDiskMap input:%1 ret:%2/0-0%tabpath fstablinen crtab ,    y2milestone   0UpdateFstabIseriesVd updating hdx to iseries/vdx$/ /etc/fstab$/ /$/$/)//4l$0 //&/ 0fields(/ 0fields4, ///&/+/, //&//etc/cryptotab$/ /&/)//4l$0 //&/ 0fields(/ 0fields4, ///&/+/, //%,    y2milestone   UpdateCdromLinks map %1/,    foreachlink  1dev cont $2+   /dev/1$2  SCR::Read.target.symlink2(&&2  search  2/dev/&2+   /dev/2,    y2milestone   UpdateCdromLinks dev %1 cont %222(&&&&2haskey/2 size  /24,    y2milestone   Change symlink %1 from %2 -> %322 /2, SCR::Execute.target.remove2, SCR::Execute.target.symlink   substring   /22%tabpath fstablinen ,    y2milestone   6UpdateFstabPersistentDevNames updating to SLES10 names$/ /etc/fstab$/ /$/$/)//4l$0 //&/ 0fields(/ 0fields4, ///&/+/, //%tabpath fstablinen ,    y2milestone   )UpdateFstabEvms2Lvm migrating EVMS to LVM$/ /etc/fstab$/ /$/$/)//4l$0 //&/ 0fields(   substring  //dev/evms/lvm2/4&/+   /dev/   substring  /, ///&/+/, //%tabpath fstablinen crtab ,    y2milestone   UpdateFstabDiskmap map %1/$0 /etc/fstab$0 0$0$0)004l$1 00&0 1fields/(0 1fields4, 000& 0+0,  00& 0/etc/cryptotab$ 0 0&0)004l$1 00&0 1fields/(0 1fields4, 000&0+0, 00%cpath filelinechanged ,    y2milestone    UpdateMdadm$//etc/mdadm.conf$ / ,! /^[ ]*#," //$#/$$/)%//4&('&&  search   /l/lineDEVICE  search   /l/line/dev/4)&*/'+/l/lineDEVICE partitions,,    y2milestone   UpdateMdadm %1/l/ &./+/(0/,1 //%4tabpath fstablinepos searchstr crtab ,6    y2milestone   UpdateCryptoType$7/ /etc/fstab$8/ /$9/$:/$;/encryption=twofish256)<//4=l$>0 //&?/  search   0fields/(@/4Anew $B1   substring   0fields/&C1+   1encryption=twofishSL92&D1+   1   substring   0fields+/ size /,E    y2milestone   new options line in %1 is %201,F //1&H/+/,J //&K//etc/cryptotab$L/ /&M/)N//4Ol$P0 //(Q 0fields twofish2564R,S    y2milestone   set twofishSL92 in line %10,T // twofishSL92&V/+/,X //%[changedtabpath fstabline,]    y2milestone   .UpdateFstabUsbdevfs updating usbdevfs to usbfs$^/$_/ /etc/fstab$`/ /$a/)b//4cl$d0 //(e 0fieldsusbdevfs4f,g //usbfs,h //usbfs&i/&k/+/(m/4n,o    y2milestone   UpdateFstabUsbdevfs changed,p //%ud$w0 SCR::Read .target.stat+    /var/lib/hardware,y    y2milestone   BuildDiskmap oldv:%1 Vers:%2/7,z    y2milestone    dir:%1 d:%2+    /var/lib/hardware0({&&0isdir||/7size/4|cmd bo&}8 $~1&1+   +   +   LIBHD_HDDB_DIR= /var/lib/hardware hwinfo --verbose --map,    y2milestone   BuildDiskmap cmd %11$1 SCR::Execute.target.bash_output1,    y2milestone   BuildDiskmap bo %11(&&1exit size  1stdout4lines $2    splitstring    1stdout ,    foreachline  32disks $4   filterd  5    splitstring   3  size 5(size44index$5)5size44'845 4 &5+5(1exit&7/&7 ,    y2milestone   BuildDiskmap DiskMap %18,    y2milestone   BuildDiskmap DiskMapVersion %17-8%(!B4sles_major_to_minordm,    y2milestone   Update old:%1 new:%2//$1   (&&haskey/major!haskey/minor4'/minor1/major,    y2milestone    Update old:%1/(&&haskey/major!haskey/minor4'/minor1/major,    y2milestone    Update new:%1/(||!haskey/major!haskey/major,   y2error   Missing key major or minor(/major 4,(/major 4,(/major 4,,,$1/(size14,1,(||/major &&/major /minor4,(||/major &&/major /minor4of $2 /etc/udev/rules.d/20-cdrom.rules,    y2milestone   removing obsolete %12, SCR::Execute.target.remove2&2 /etc/udev/rules.d/55-cdrom.rules,    y2milestone   removing obsolete %12, SCR::Execute.target.remove2(||/major &&/major /minor4of $2 /etc/udev/rules.d/65-cdrom.rules,    y2milestone   removing obsolete %12, SCR::Execute.target.remove2(||/major &&/major /minor,(||/major &&/major /minor4cmd bo(4,$2.cd / && /sbin/insserv -r /etc/init.d/boot.evms,    y2milestone    Update cmd %12$2 SCR::Execute.target.bash_output2,    y2milestone    Update bo %12(||/major &&/major /minor4cmd bo$2-cd / && /sbin/insserv /etc/init.d/boot.crypto$2 SCR::Execute.target.bash_output2,    y2milestone    Update bo %12&23cd / && /sbin/insserv /etc/init.d/boot.crypto-early&2 SCR::Execute.target.bash_output2,    y2milestone    Update bo %12& B4,    y2milestone   .Skip calling Update() -> It was already called% ret dm ,    y2milestone   "GetTranslatedDevices old:%1 new:%2//,    y2milestone   GetTranslatedDevices names %1/$0/$0/(size04&0    maplistn  2020(&&||/major &&/major /minor4 &!0    maplistn  202(#/major 4$&%0    maplistn  202&*0    maplistn  10(+   substring  1/dev/evms/lvm2/&,1+   /dev/   substring  1--1,/    y2milestone   GetTranslatedDevices ret %10-00%!onname scrname ,    y2milestone   CallInsserv on:%1 name:%2//$0+    /etc/init.d//( SCR::Read .target.size04cmd bo$1cd / && /sbin/insserv (!/&1+   1-r &1+   10,    y2milestone   CallInsserv cmd %11$1 SCR::Execute.target.bash_output1,    y2milestone   CallInsserv bo %11%"tg  need_cryptneed_mdneed_lvm need_dmraidneed_dmmultipath,    y2milestone   FinishInstall initial:%1$ /a( 4 , /$E/$F/$G/$H/$I/,K    foreachk e 0 0/(Lsizefilterp 20 partitions  2enc_typenonenone&N/(O&& 0type CT_UNKNOWNCT_MDsize0 partitions &P/(Q 0type CT_UNKNOWN CT_MDPART&R/(S 0type CT_UNKNOWNCT_LVM&T/(U 0type CT_UNKNOWN CT_DMRAID&V/(W 0type CT_UNKNOWNCT_DMMULTIPATH&X/,[    y2milestone   BFinishInstall need crypto:%1 md:%2 lvm:%3 dmraid:%4 dmmultipath:%5/////(^/4_,`! boot.crypto,a!boot.crypto-early,d!/boot.md,e!/boot.lvm,f!/ boot.dmraid,g!/boot.multipath,h!/ multipathd,j    y2milestone   FinishInstall done%m#all_partitions partition$o0 ,p    foreachdev disk 1 1a&r0union01 partitions $u0findpart 10 1mount/(v||0 0mount/4w&x0 -z0%}$ partitiontg disk initrdmoduleslmod$/#/,    y2milestone   &GetRootInitrdModules root partition %1/$/a$/ ,    foreachk d 0 0/(&&size/findp 20 partitions &&!2delete 2device /device&/0,    y2milestone   GetRootInitrdModules disk %1haskey/ partitionsremove/ partitions/$/ /used_fsext2( /typeunknownsw_raid4t $0 / raid_type(!contains/04&/add/0( /typeunknownlvm4vgname mod $0   substring   /device&0   substring  0   findfirstof  0/$0  maplistk 1filtere 2//dev/md partitions  2used_by0 1 raid_type,    y2milestone   GetRootInitrdModules mod %10,    foreache  10(&& size 1!contains/14&/add/1(!contains/dm_mod4&/add/dm_mod( /typeunknownevms4evmsco md mod  $0 /device&0   substring  0   findlastof  0/,    y2milestone   GetRootInitrdModules evmsco %10,    y2milestone   GetRootInitrdModules evms %1/0 $0   filters  1/0devices   search  1/dev/md,    y2milestone   GetRootInitrdModules mddev %10$0  maplistk 1filtere 2//dev/md partitions   contains0 2device 1 raid_type,    y2milestone   GetRootInitrdModules mod %10,    foreache  10(&& size 1!contains/14&/add/1(!contains/dm_mod4&/add/dm_mod(size/modules 4,    y2milestone   adding disk modules %1/modules ,    foreachm  1/modules (!contains/14&/add/1( size  / driver_module4m $0 / driver_module,    y2milestone   adding driver modules %10(!contains/04&/add/0,SCR::UnmountAgent .proc.modules$/ SCR::Read .proc.modules,    y2milestone   GetRootInitrdModules lmod:%1/(size/edd &/add/edd,    y2milestone   GetRootInitrdModules ret %1/-/%%partret$/#/,    y2milestone   CheckForLvmRootFs root=%1/$/ /typeprimarylvm,    y2milestone   CheckForLvmRootFs ret=%1/-/%&partret$/#/$/ /typeprimarysw_raid,    y2milestone   CheckForMdRootFs root=%1/,    y2milestone   CheckForMdRootFs ret=%1/-/%'tg  partitionscylinderfoundindexe_idxidx_listpart $0a$00/ partitions $0+//$ 0$ 0$ 0$ 0 $ 0findp 10&&1region01create,    y2milestone   AdaptResize %1 reg %2 change %3///(04pnew&0&0,  foreachp 20(&&2region02create4&0(!04&0+0( 00typeprimaryextended4 &!00&"0&#0,$  foreachp 30(&&&&&3region03create 3typeprimaryextended4(&)0&*03(,!04-&.0+0&20+0region0region,3    y2milestone   AdaptResize part:%10,4    y2milestone   )AdaptResize index:%1 e_idx:%2 cylinder:%3000$61findp 20&&2region02create,9    y2milestone   AdaptResize pnew:%11):&&1|||| 0mount 0fsid 0region/*//4> ,?    y2milestone   AdaptResize pnew:%11&@01&A0add00,B    y2milestone    AdaptResize index:%1 idx_list:%200&C0&D0,E  foreachp 30,F    y2milestone   found:%1 index:%2 p=%3003(G3nr1nr4H&I0(K!04L&M0+0&P0+0region0region&Q1findp 30&&3region03create,U    y2milestone   AdaptResize idx:%1 list:%200,W  foreachnum 20'X02region-02region/,Y 02device02region02region'\00region-00region/']00region+00region/(^00region4_'`00region,b    y2milestone   AdaptResize increase p:%100 ,c 00device00region00region(e04f'g00region-00region/'h00region+00region/(i00region4j'k00region,m 00device00region00region4r,s   y2error   %AdaptResize this should not happen %10,u    y2milestone   AdaptResize partitions:%10,v    y2milestone   *AdaptResize maindev:%1 region:%2 change:%3///%{(bosl ilret $}/ WFM::Execute.local.bash_output losetup -a$~/    splitstring    /stdout &/   filters  0/  search  0 /dev/loop&/    maplists  0/   substring  0  search  0:&/    maplists  0/   substring  0 $/sort  maplists  0/ tointeger0$/+/-size/,    y2milestone   NumLoopDevices ret:%1/-/%) spec  mount_point fsidused_fs formatvfstype freqpassnomntops  ret,    y2milestone   onepartition2fstab part=%1/(||||||||||/delete /typeunknownextended&&  contains lvmsw_raidevms /typeunknown size  /mount&& /enc_typenonenone!/noauto / used_by_typeUB_NONEUB_NONE&&contains   /fsid size  /mount4- $0 /device(&& /mountbydevicelabel size  /label4&0   sformat   LABEL=%1 /label(&& /mountbydeviceuuid size  /uuid4&0   sformat   UUID=%1 /uuid,   y2debug   onepartition2fstab spec=%10$0 /mount$0/fsid$0 /used_fsext2$0/format$0unknown$0$0$0 /fstopt(0swap4&0swap( size 04&0swap&0(||||0 0 && /typeunknownevms / detected_fsnoneunknown4&000ext2auto&0(0/4&0(04&0(&&!4&0+  /data/&0 noauto,user&0auto&0&0&/+/,    y2milestone   TT add MountPoint %10(&&&&&&|||| size 0||0vfat0ntfs||containsunionunion   00 4 lower_point &0&0$1  tolower  0(&&1014( /4&1+    1,    y2milestone   symlink %1 -> %2   substring  0+   findlastof  0/1, SCR::Execute.target.symlink   substring  0+   findlastof  0/1&00auto(&&||contains 04- 4- (|| / detected_fsunknownunknown/noauto4&0$0 spec0mount0vfstype0mntops0freq0device /devicepassno0( size  0 mntops4' 0 mntopsdefaults,     y2milestone   onepartition2fstab ret=%10 - 0 %*-<%+&</,    y2milestone   SetProposalHome val:%1<%,-=%!-&#=/,$    y2milestone   SetProposalLvm val:%1=%'.-)>%,/&.>/,/    y2milestone   SetProposalEncrypt val:%1/%20-4?%71&9?/,:    y2milestone   SetProposalPassword%>2-@%D3,F+@home(G!/4H(I@prop_lvm4J,K-,L/,M14P,Q-,T    y2milestone   8SetProposalDefault home:%1 lvm:%2 encypt:%3 home_only:%4<=>/%Y4 StrToByte %[/str bytes$]1(^!R 0 1,_   y2error   cannot parse %10-`1(csize@4dbttmp $e0 partitioningtry_separate_home'g@home0'i@ root_percent tointeger partitioningroot_space_percent(l||@ root_percent@ root_percent'm@ root_percent($o0 partitioninglimit_try_home'q@ home_limit//0*(r@ home_limit's@ home_limit*&u0 partitioningroot_base_size'w@ root_base//0*(x@ root_base'y@ root_base*&{0 partitioning root_max_size'}@root_max//0*(~@root_max'@root_max* &0 partitioningvm_desired_size'@vm_want//0*(@vm_want'@vm_want*&0 partitioningvm_home_max_size'@home_max//0*(@home_max'@home_max*&0 partitioning proposal_lvm'@prop_lvm0,3,    y2milestone   GetControlCfg cfg_xml:%1@-@%5-%6ret xml$/$/4(=4&/system,    y2milestone   ProposalVM lvm:%1 ret:%2=/-/%7,    y2milestone   AddHwPackage name %1 list:%2/:(   finds  1:1/&:   add:/,    y2milestone   AddHwPackage list:%1:%8,    y2milestone   SwitchUiAutomounter on:%1/(!/4, SCR::Execute .dbus.method  destinationorg.freedesktop.Hal interfaceorg.freedesktop.Hal.ManagermethodAcquireGlobalInterfaceLockpath/org/freedesktop/Hal/Manager "org.freedesktop.Hal.Device.Storage4, SCR::Execute .dbus.method  destinationorg.freedesktop.Hal interfaceorg.freedesktop.Hal.ManagermethodReleaseGlobalInterfaceLockpath/org/freedesktop/Hal/Manager "org.freedesktop.Hal.Device.Storage,    y2milestone   SwitchUiAutomounter exit%9(!Y-,R%:(;4&; (&& SCR::Read .target.size/etc/install.inf4inst $1  SCR::Read.etc.install_inf.Partition,    y2milestone   .NoProposeDisks .etc.install_inf.Partition "%1"1(&&1 size 14d(  search  1/dev/&1+   /dev/1$2c1,    y2milestone   NoProposeDisks inst:%1 disk:%212( size  2disk&;   add; 2disk&1  SCR::Read.etc.install_inf.Cdrom,    y2milestone   *NoProposeDisks .etc.install_inf.Cdrom "%1"1(&&1 size 14d(  search  1/dev/&1+   /dev/1$2c1,    y2milestone   NoProposeDisks inst:%1 disk:%212( size  2disk&;   add; 2disk(4retls$1 SCR::Execute.target.bash_output$echo $YAST2_STORAGE_NO_PROPOSE_DISKS,    y2milestone   NoProposeDisks ret "%1" 1stdout$1   filtere  2    splitstring    1stdout  size 2&; merge;1,    y2milestone   NoProposeDisks "%1";-;%;val$0s0/,R0% <valret $ /R$/r0/-/%valrret $0$0R / 0$0r00-0%=rettg ts pl$0$0a$ 0/(!D/4"&$0   / (%0/,&    y2milestone   $DeviceMatchFstab translate %1 --> %2/0$(0e00&)0findp 10 1device/,*    y2milestone   *DeviceMatchFstab device:%1 fstab:%2 ret:%3//0-,0%0>ret$20  contains lvmsw_raiddm /typeunknown(3&&!0  contains evmsprimarylogicalextended /typeunknown45d$61ga /device(7 /typeunknownevms&80||1 is_container/ evms_native&:0|||| 1type CT_UNKNONW CT_DMRAID 1type CT_UNKNONWCT_DMMULTIPATHsize1udev_id ,=    y2milestone   IsPersistent device:%1 ret:%2 /device0->0%A?-CsizeR%F@(H//4I,K IThe first and the second version of the password do not match. Try again.storage-M(P&& size /!/4Q,S )You did not enter a password. Try again. storage-V(Y&& size //!/4Z,\    sformat   :The password must have at least %1 characters. Try again. storage/-_(b|| size ///4ctmp$d1  findfirstnotof  /[0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#* ,.;:._-+!$%&/|?{[()]}@^\<>(e&&1 size /4f,h The password may only contain the following characters: 0..9, a..z, A..Z, and any of "@#* ,.;:._-+!$%&/|?{[()]}^\<>". Try again.storage-k-o%rAi$t0R / /(u0,v    sformat   dCould not set encryption. System error code is %1. The crypt password provided could be incorrect. storage0,{    y2milestone   #CheckCryptOk dev:%1 pwlen:%2 ret:%3/ size /0-}00707010006A49D000081A40000018F0000018F000000014F10367600001DFC000000080000000100000000000000000000004800000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/AutoInstall.ycp/** * File: modules/AutoInstall.ycp * Package: Auto-installation * Summary: Auto-installation related functions module * Author: Anas Nashif * * $Id: AutoInstall.ycp 62630 2010-10-13 12:00:45Z jsrain $ */ { module "AutoInstall"; textdomain "autoinst"; import "Profile"; import "Mode"; import "Stage"; import "AutoinstConfig"; import "AutoInstallRules"; import "Report"; import "TFTP"; global boolean autoconf = false; global define boolean callbackTrue_boolean_string(string dummy) { return true; } global define boolean callbackFalse_boolean_string(string dummy) { return false; } global define boolean callbackTrue_boolean_string_integer(string dummy, integer dummy2) { return true; } global define boolean callbackFalse_boolean_string_integer(string dummy, integer dummy2) { return false; } global define void callback_void_map(map dummy_map) { return; } global define boolean callbackTrue_boolean_map(map dummy_map) { return true; } global define boolean callbackFalse_boolean_map(map dummy_map) { return false; } global define boolean callbackTrue_boolean_map_integer(map dummy_map, integer dummy) { return true; } global define boolean callbackFalse_boolean_map_integer(map dummy_map, integer dummy) { return false; } global define boolean callbackTrue_boolean_string_map_integer(string dummy, map dummy_map, integer dummy_int) { return true; } global define boolean callbackFalse_boolean_string_map_integer(string dummy, map dummy_map, integer dummy_int) { return false; } global define boolean callbackTrue_boolean_string_string(string dummy1, string dummy2) { return true; } global define boolean callbackFalse_boolean_string_string(string dummy1, string dummy2) { return false; } global define boolean callbackTrue_boolean_string_string_integer(string dummy1, string dummy2, integer dummy3) { return true; } global define boolean callbackFalse_boolean_string_string_integer(string dummy1, string dummy2, integer dummy3) { return false; } /** * Read saved data in continue mode * @return boolean true on success */ global define boolean Continue() { // // First check if there are some other control files availabe // i.e. for post-installation only // boolean ret = false; if ( SCR::Read(.target.size, AutoinstConfig::autoconf_file) != -1 ) { y2milestone("XML Post installation data found: %1", AutoinstConfig::autoconf_file ); ret = Profile::ReadXML ( AutoinstConfig::autoconf_file ); SCR::Execute(.target.bash, sformat("/bin/mv %1 %2", AutoinstConfig::autoconf_file, AutoinstConfig::cache)); return (ret); } else { ret = Profile::ReadProfileStructure ( AutoinstConfig::parsedControlFile ); if ( Profile::current == $[] || !ret ) { y2milestone( "No saved autoinstall data found" ); return (false); } else { y2milestone( "Found and read saved autoinst data"); SCR::Execute(.target.remove, AutoinstConfig::parsedControlFile); return (true); } } return false; } /** * Constructer * @return void */ global define void AutoInstall() { if (Stage::cont ()) { boolean ret = Continue(); if (ret && size ( Profile::current ) > 0) { y2milestone("Enabling Auto-Installation mode"); Mode::SetMode("autoinstallation"); } else if (Mode::autoinst ()) { y2milestone("No autoyast data found, switching back to manual installation"); Mode::SetMode("installation"); } } else if (Stage::initial ()) { if ( SCR::Read(.target.size, AutoinstConfig::xml_tmpfile) != -1 && size ( Profile::current ) == 0) { y2milestone("autoyast: %1 found", AutoinstConfig::xml_tmpfile); // Profile is available and it has not been parsed yet. Profile::ReadXML( AutoinstConfig::xml_tmpfile ); } } return; } /** * Save configuration * @return boolean true on success */ global define boolean Save() { if (Mode::autoinst () || Mode::autoupgrade()) return (Profile::SaveProfileStructure( AutoinstConfig::parsedControlFile )); else return true; } /** * Finish Auto-Installation by saving misc files * @param string destdir * @return void */ global define void Finish ( string destdir ) { list dircontents = (list)SCR::Read(.target.dir, AutoinstConfig::tmpDir + "/pre-scripts/"); if (size(dircontents) > 0 ) { SCR::Execute(.target.bash, "/bin/cp " + AutoinstConfig::tmpDir + "/pre-scripts/* " + destdir + AutoinstConfig::scripts_dir); SCR::Execute(.target.bash, "/bin/cp " + AutoinstConfig::tmpDir + "/pre-scripts/logs/* " + destdir + AutoinstConfig::logs_dir); } SCR::Execute(.target.bash, sformat("/bin/cp %1 %2%3", "/tmp/profile/autoinst.xml" , destdir , AutoinstConfig::xml_file) ); SCR::Execute(.target.bash, sformat("/bin/chmod 700 %1%2", destdir , AutoinstConfig::xml_file) ); SCR::Execute(.target.bash, sformat("/bin/cp %1 %2%3", AutoinstConfig::profile_dir+"/pre-autoinst.xml" , destdir , AutoinstConfig::cache) ); SCR::Execute(.target.bash, sformat("/bin/chmod 700 %1%2", destdir , AutoinstConfig::cache+"/pre-autoinst.xml") ); return; } /** * Put PXE file on the boot server using tftp * @return true on success */ global boolean PXELocalBoot () { string tmpdir = (string)SCR::Read(.target.tmpdir); string hexfile = sformat("%1/%2", tmpdir, AutoInstallRules::hostid ); map pxe = Profile::current["pxe"]:$[]; string server = pxe["tftp-server"]:""; if (server!="" && pxe["pxe_localboot"]:false) { y2milestone("putting pxe local boot file on server :%1", server); string config = pxe["pxelinux-config"]:""; string dir = pxe["pxelinux-dir"]:"pxelinux.cfg"; if (config == "") { config = "DEFAULT linux\nLABEL linux\n localboot 0"; } SCR::Write(.target.string, hexfile, config); return TFTP::Put(server, dir + "/" + AutoInstallRules::hostid, hexfile ); } return true; } /** * Turn off the second stage of autoyast * */ global boolean TurnOff () { if( ! Profile::current["general","mode","second_stage"]:true ) { y2milestone("switching from autoinstallation to manual installation in second stage"); SCR::Execute(.target.bash, "/bin/grep -v -i '^autoyast:' /etc/install.inf > /tmp/install.inf.new"); SCR::Execute(.target.bash, "/bin/mv /tmp/install.inf.new /etc/install.inf"); } } //EOF } 0707010006A4AA000081A40000018F0000018F000000014F103676000024D1000000080000000100000000000000000000004100000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/Mode.ybcYaST bytecode 1.4.0ModeMode.ycp _mode _test test_autochecked_ui  Initialize mode SetMode   commandline testMode  SetTest   ui  SetUI    installationlive_installationupdateDepechenormalrepairautoinst autoupgradeconfigtest screen_shot testsuite-fonew_mode      new_test_mode     new_ui    3WFMArgs3SCRRead0base$$$"$'dialog%- arg_countarg_no&.normal&/none$0size WFM::Args$1)243(5|||| WFM::Argsinitial WFM::Argscontinue WFM::Args firstboot48&9 installation(<|| WFM::Argstest WFM::Argsdemo4=&>test,?    y2warning   ***** Test mode enabled *****(A WFM::Args screenshots4B&C screenshot,D    y2warning   $***** Screen shot mode enabled *****&G+(M&& installation SCR::Read .target.size/etc/install.inf4Oautoinstrepair$P SCR::Read.etc.install_inf.AutoYaST(Q4R&Sautoinstallation$V SCR::Read.etc.install_inf.Repair(W4X&Yrepair&\ autoupgrade%f(g4h,i-l%o(p,q(s!  contains  installationupdatenormalrepairautoinstallationautoinst_configlive_installation autoupgrade4y,z   y2error   Unknown mode %1,}    y2milestone   setting mode to %1&~% (,(!4(||  getenv   Y2MODETEST  getenv   Y2ALLGLOBAL4& testsuite&-% (,(!  contains nonetestdemo screenshot testsuite4,   y2error   Unknown test mode %1&% -% (!  contains  commandlinedialognone4,   y2error   Unknown UI mode %1&% -|||| installationautoinstallationlive_installation%-live_installation%-||update autoupgrade%-%-normal%-repair%-autoinstallation%- autoupgrade%-autoinst_config%-|||| test  screenshot  testsuite%-  screenshot% -   testsuite%-  commandline0707010006A49F000081A40000018F0000018F000000014F1036760000D343000000080000000100000000000000000000004500000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/RootPart.ycp/** * Module: RootPart.ycp * * Authors: Arvin Schnell * * Purpose: Responsible for searching of root partitions and * mounting of target partitions. * * $Id: RootPart.ycp 62967 2010-12-07 14:05:09Z jsrain $ */ { module "RootPart"; textdomain "update"; import "Directory"; import "Mode"; import "Linuxrc"; import "Storage"; import "Popup"; import "ModuleLoading"; import "FileSystems"; import "Update"; import "SuSERelease"; import "FileUtils"; import "Arch"; import "String"; import "Installation"; import "Report"; import "Label"; import "Stage"; import "Wizard"; include "partitioning/custom_part_dialogs.ycp"; // all supported filesystems global list possible_root_fs = [ `ext2, `ext3, `reiser, `xfs, `jfs ]; // Selected root partition for the update or boot. global string selectedRootPartition = ""; // FATE #301844, to find out that a system for update has been changed global string previousRootPartition = ""; // Map of all root partitions (key) and information map (value). // The information map contains the keys `valid, `name and `arch. global map rootPartitions = $[]; // Number of valid root partitions. global integer numberOfValidRootPartitions = 0; // Show all partitions (not only root partitions) in the dialog. global boolean showAllPartitions = false; // Did we search for root partitions global boolean didSearchForRootPartitions = false; // We successfully mounted the target partitions global boolean targetOk = false; // Did we try to mount the target partitions? global boolean did_try_mount_partitions = false; list already_checked_jfs_partitions = []; list non_modular_fs = [ "proc", "sysfs" ]; /** * List of mounted partitions, activated swap partitions and loop devices. * Amongst other things used for reversing action if mode is changed from * update to new installation or if root partition for update is changed. * The order of the list if of paramount importance. * * Each item is list [string value, string type [, string device]] where: * * Keys/values are: * * `type The type, one of "mount", "swap" or "crypt". * * `device The device. * * `mntpt The mount point, only for `type = "mount". Does not * include Installation::destdir. */ list > activated = []; global boolean Mounted () { return size (activated) > 0; } /** * Link to SDB article concerning renaming of devices. */ string sdb = sformat (_("See the SDB article at %1 for details about how to solve this problem."), "http://support.novell.com/techcenter/sdb/en/2003/03/fhassel_update_not_possible.html"); /** * Get the key what of the selected root partition. */ global define string GetInfoOfSelected (symbol what) { map i = rootPartitions[selectedRootPartition]:$[]; if (what == `name) { // Name is known if (i[what]:"" != "") { return i[what]:""; // Linux partition, but no root FS found } else if (contains (possible_root_fs, i[`fs]:`nil)) { // label - name of sustem to update return _("Unknown Linux System"); // Non-Linux } else { // label - name of sustem to update return _("Non-Linux System"); } } else { // label - name of sustem to update return i[what]:_("Unknown"); } } /** * Set the selected root partition to some valid one. Only * make sense if the number of valid root partition is one. */ global define void SetSelectedToValid () { selectedRootPartition = ""; foreach (string p, map i, rootPartitions, { if (i[`valid]:false && selectedRootPartition == "") selectedRootPartition = p; }); } /** * */ define void AddToTargetMap () { map target_map = (map ) Storage::GetOndiskTarget (); y2milestone ("On disk target map: %1", target_map); list tmp = filter (map e, activated, ``(e[`type]:"" == "mount")); foreach (map e, tmp, { y2milestone ("Setting partition data: Device: %1, MountPoint: %2", e[`device]:"", e[`mntpt]:""); target_map = Storage::SetPartitionData (target_map, e[`device]:"", "mount", e[`mntpt]:""); if( issubstring( e[`device]:"", "/dev/disk/by-id" ) ) target_map = Storage::SetPartitionData (target_map, e[`device]:"", "mountby", `id); else if( issubstring( e[`device]:"", "/dev/" ) ) target_map = Storage::SetPartitionData (target_map, e[`device]:"", "mountby", `device); else target_map = Storage::SetPartitionData (target_map, e[`device]:"", "mountby", `label); }); tmp = filter (map e, activated, ``(e[`type]:"" == "swap")); foreach (map e, tmp, { y2milestone ("Setting swap partition data: Device: %1", e[`device]:""); target_map = Storage::SetPartitionData (target_map, e[`device]:"", "mount", "swap"); if( issubstring( e[`device]:"", "/dev/disk/by-id" ) ) target_map = Storage::SetPartitionData (target_map, e[`device]:"", "mountby", `id); else if( issubstring( e[`device]:"", "/dev/" ) ) target_map = Storage::SetPartitionData (target_map, e[`device]:"", "mountby", `device); else target_map = Storage::SetPartitionData (target_map, e[`device]:"", "mountby", `label); }); y2milestone ("Setting target map: %1", target_map); Storage::SetTargetMap (target_map); } /** * */ define void RemoveFromTargetMap () { map target_map = Storage::GetTargetMap (); list tmp = filter (map e, activated, ``(e[`type]:"" == "mount")); foreach (map e, tmp, { target_map = Storage::SetPartitionData (target_map, e[`device]:"", "mount", ""); }); Storage::SetTargetMap (target_map); } /** * Unmount all mounted partitions, deactivate swaps, detach loopback * devices. Uses list activated to make actions in reverse order. * @param keeep_in_target Do not remove mounts from targetmap * @return void */ global define void UnmountPartitions (boolean keep_in_target) { y2milestone ("UnmountPartitions: %1", keep_in_target); did_try_mount_partitions = false; foreach (map info, activated, { y2milestone ("Unmounting %1", info); string type = info[`type]:""; if (type != "") { if (type == "mount") { string file = Installation::destdir + info[`mntpt]:""; if (! (boolean)SCR::Execute (.target.umount, file)) { // error report, %1 is device (eg. /dev/hda1) Report::Error (sformat (_("Cannot unmount partition %1. It is currently in use. If the partition stays mounted, the data may be lost. Unmount the partition manually or restart your computer. "), file)); } } else if (type == "swap") { string device = info[`device]:""; // FIXME? is it safe? if (SCR::Execute (.target.bash, "/sbin/swapoff " + device) != 0) { y2error("Cannot deactivate swap %1", device); } } else if (type == "crypt") { string dmname = info[`device]:""; dmname = "cr_" + substring( dmname, findlastof( dmname, "/" )+1 ); // FIXME? is it safe? if (WFM::Execute(.local.bash, "cryptsetup remove " + dmname) != 0) { y2error("Cannot remove dm device %1", dmname); } } } }); // now remove the mount points of the mounted partitions // in the target map of the storage module if (!keep_in_target) RemoveFromTargetMap (); // clear activated list activated = []; } /** * Add information about mounted partition to internal list. * @param partinfo partinfo has to be list with exactly two strings, * see description of list "activated" * @return void */ define void AddMountedPartition (map partinfo) { activated = prepend (activated, partinfo); y2debug ("adding %1 yields %2", partinfo, activated); } /** * Check the filesystem of a partition. */ define void FSCKPartition (string partition) { if (!Mode::test ()) { symbol detected_fs = Storage::DetectFs (partition); if (detected_fs == `ext2) { // label, %1 is partition string out = sformat (_("Checking partition %1"), partition); UI::OpenDialog (`opt(`decorated ), `Label(out)); y2milestone ("command: /sbin/e2fsck -y %1", partition); SCR::Execute (.target.bash, "/sbin/e2fsck -y " + partition); UI::CloseDialog (); } } } /** * @param string headline (optional; to disable, use "") * @param string question * @param string button (true) * @param string button (false) * @param string details (hidden under [Details] button; optional; to disable, use "") */ global boolean AnyQuestionAnyButtonsDetails ( string headline, string question, string button_yes, string button_no, string details ) { boolean has_details = true; if (details == "" || details == nil) has_details = false; boolean has_heading = true; if (headline == "" || headline == nil) has_heading = false; term heading = (has_heading ? `VBox ( `Left(`Heading (headline)) ) : `Empty() ); term popup_def = `Left (`Label (question)); term details_checkbox = (has_details ? `VBox ( `VSpacing (1), `Left (`CheckBox (`id (`details), `opt (`notify), _("Show &Details"), false)) ) : `Empty () ); term popup_buttons = `VBox ( `VSpacing (1), `HBox ( `HSpacing (8), `PushButton (`id (`yes), button_yes), `VSpacing (2), `PushButton (`id (`cancel), button_no), `HSpacing (8) ), `VSpacing (0.5) ); UI::OpenDialog (`opt (`decorated), `VSquash ( `VBox ( heading, popup_def, `Left (`opt(`hstretch), `ReplacePoint (`id(`rp_details), `Empty())), details_checkbox, popup_buttons ) ) ); UI::SetFocus (`id (`yes)); any userinput = nil; boolean ret = nil; while (true) { userinput = UI::UserInput(); if (userinput == `yes) { ret = true; break; } else if (userinput == `details) { boolean curr_status = (boolean) UI::QueryWidget (`id (`details), `Value); if (curr_status == false) { UI::ReplaceWidget (`id (`rp_details), `Empty()); } else { UI::ReplaceWidget (`id (`rp_details), `MinSize ( 60, 10, `RichText ( `id (`details_text), `opt (`plainText, `hstretch), details ) ) ); } } else { ret = false; break; } } UI::CloseDialog(); return ret; } /** * Function checks the device and returns whether it is OK or not. * The read-only FS check is performed for jfs only and only one for * one device. * * @param string mount_type "jfs", "ext2" or "reiser" * @param string device, such as /dev/hda3 or /dev/sda8 * @param string error_message (a reference to string) * @return boolean if successfull or if user forces it */ define boolean RunFSCKonJFS (string mount_type, string device, string & error_message) { // #176292, run fsck before jfs is mounted if (mount_type == "jfs" && device != "") { if (contains (already_checked_jfs_partitions, device)) { y2milestone ("Device %1 has been already checked...", device); return true; } UI::OpenDialog (`Label (sformat (_("Checking file system on %1..."), device))); y2milestone ("Running fsck on %1", device); // -n == Check read only, make no changes to the file system. map cmd = (map) SCR::Execute (.target.bash_output, sformat ("fsck.jfs -n %1", device)); UI::CloseDialog(); // failed if (cmd["exit"]:nil != 0) { y2error ("Result: %1", cmd); error_message = tostring(cmd["stderr"]:nil); string details = ""; if (cmd["stdout"]:"" != "") { details = details + cmd["stdout"]:""; } if (cmd["stderr"]:"" != "") { details = (details == "" ? "":"\n") + details + cmd["stderr"]:""; } return AnyQuestionAnyButtonsDetails ( // popup headline _("File System Check Failed"), sformat ( // popup question (continue/cancel dialog) // %1 is a device name such as /dev/hda5 _("The file system check of device %1 has failed. Would you like to continue in the mounting the device?"), device ), Label::ContinueButton(), // button _("&Skip Mounting"), details ); // succeeded } else { // add device into the list of already checked partitions (with exit status 0); already_checked_jfs_partitions = add (already_checked_jfs_partitions, device); y2milestone ("Result: %1", cmd); return true; } } return true; } /** * Mount partition on specified mount point * @param mount_point string mount point to monut the partition at * @param device string device to mount * @param mount_type string filesystem type to be specified while mounting * @return string nil on success, error description on fail */ define string MountPartition (string mount_point, string device, string mount_type) { if (mount_type == "") // e.g. -> "reiserfs" mount_type = FileSystems::GetMountString ( Storage::DetectFs (device), ""); // #223878, do not call modprobe with empty mount_type if (mount_type == "") { y2warning ("Unknown filesystem, skipping modprobe..."); // #211916, sysfs, proc are not modular } else if (! contains (non_modular_fs, mount_type)) { // #167976, was broken with "-t ", modprobe before adding it y2milestone("Calling 'modprobe %1'", mount_type); SCR::Execute(.target.modprobe, mount_type, "" ); } else { y2milestone("FS type %1 is not modular, skipping modprobe...", mount_type); } string error_message = nil; if (! RunFSCKonJFS (mount_type, device, error_message)) { return error_message; } if (mount_type != "") mount_type = "-t " + mount_type; boolean ret = (boolean) SCR::Execute (.target.mount, [device, Installation::destdir + mount_point, Installation::mountlog], mount_type ); if (ret) return nil; else return (string)SCR::Read (.target.string, Installation::mountlog); } /** * Check filesystem on a partition and mount the partition on specified mount * point * @param mount_point string mount point to monut the partition at * @param device string device to mount * @param mount_type string filesystem type to be specified while mounting * @return string nil on success, error description on fail */ define string FsckAndMount (string mount_point, string device, string mount_type) { FSCKPartition (device); string ret = MountPartition (mount_point, device, mount_type); if (ret == nil) AddMountedPartition($[`type : "mount", `device : device, `mntpt : mount_point]); y2milestone ("mounting (%1, %2, %3) yield %4", Installation::destdir + mount_point, device, mount_type, ret); return ret; } /** * Check that the root filesystem in fstab has the correct device. */ define boolean check_root_device (string partition, list fstab, string& found_partition) { list tmp = filter (map entry, fstab, ``(entry["file"]:"" == "/")); if (size (tmp) != 1) { y2error ("not exactly one root partition found in fstab"); found_partition = "none"; return false; } map root = tmp[0]:$[]; if (!Storage::DeviceRealDisk (root["spec"]:"")) { // There's nothing I can check. Anyway, it's not mounted per device // name so it can't be wrong, in theory. return true; } /* * No more EVMS // bugzilla #237139 // '/dev/evms/lvm2/system/root' is the same as '/dev/system/root' // the root from /etc/fstab must be used if (regexpmatch (root["spec"]:"", "/dev/evms/lvm2/") || regexpmatch (partition, "/dev/evms/lvm2/")) { y2milestone ("Special case with EVMS: %1 vs. %2", root["spec"]:"", partition); string tmp_rootspec = root["spec"]:""; string tmp_partition = partition; // they might be the same but this case covers it as well if (regexpmatch (root["spec"]:"", "/dev/evms/lvm2/")) tmp_rootspec = regexpsub (root["spec"]:"", "/dev/evms/lvm2/(.*)$", "/dev/\\1"); if (regexpmatch (partition, "/dev/evms/lvm2/")) tmp_partition = regexpsub (partition, "/dev/evms/lvm2/(.*)$", "/dev/\\1"); y2milestone ("Checking '%1' vs. '%2'", tmp_rootspec, tmp_partition); if (tmp_rootspec == tmp_partition) { found_partition = root["spec"]:""; y2milestone ("EVMS case matching, using %1", found_partition); return true; } } */ return true; } /** * Find a mount point in fstab * @param fstab a list of fstab entries * @param mountpoint string a mount point to find * @return string the found partition */ define string FindPartitionInFstab (list & fstab, string mountpoint) { if (substring (mountpoint, size (mountpoint) - 1, 1) == "/") mountpoint = substring (mountpoint, 0, size (mountpoint) - 1); list tmp = filter (map entry, fstab, { return entry["file"]:"" == mountpoint || entry["file"]:"" == mountpoint + "/"; }); if (size (tmp) == 0) return nil; return tmp[0,"spec"]:""; } // translation from new to old device names // such as /dev/sdc4 -> /dev/hdb4 map backward_translation = $[]; string update_mount_options (string options) { if (regexpmatch (options, "^\(.*,\)\?hotplug\(,.*\)\?$")) return regexpsub (options, "^\(.*,\)\?hotplug\(,.*\)\?$", "\\1nofail\\2"); return options; } /** * Translates FS or Cryptotab (old devices to new ones). * Such as /dev/hda5 to /dev/sda5. * * @param list of definitions to translate * @param string key name in map to translate * @param string key name in map to keep the old value * @return list of translated definitions * * @see https://bugzilla.novell.com/show_bug.cgi?id=258222 */ define list TranslateFsOrCryptoTab (list translate, string key_to_translate, string key_preserve_as) { // Check whether there is any hardware information that could be used string check_command = sformat ("/usr/bin/find '%1/var/lib/hardware/'", String::Quote (Installation::destdir)); map cmd = (map) SCR::Execute (.target.bash_output, check_command); if (cmd["exit"]:nil != nil) { list files = splitstring (cmd["stdout"]:"", "\n"); integer files_count = size (files); if (files_count == nil || files_count <= 2) { y2error ("There are only %1 files in /var/lib/hardware/, translation needn't work!", files_count); } else { y2milestone ("There are %1 files in /var/lib/hardware/", files_count); } } // first find a list of values for translation list old_names = []; foreach (map m, translate, { old_names = add (old_names, m[key_to_translate]:""); }); // translate them list new_names = Storage::GetTranslatedDevices ( Installation::installedVersion, Installation::updateVersion, old_names ); integer i = 0; // replace old values with translated ones while (i < size (translate)) { string default_val = translate[i, key_to_translate]:""; string new_val = new_names[i]:default_val; translate[i, key_to_translate] = new_val; translate[i, key_preserve_as] = default_val; backward_translation[new_val] = default_val; translate[i, "mntops"] = update_mount_options (translate[i, "mntops"]:""); i = i + 1; }; y2milestone ("Current backward translations: %1", backward_translation); return translate; } /** * Register a new fstab agent and read the configuration * from Installation::destdir */ void readFsTab (list & fstab) { string fstab_file = Installation::destdir + "/etc/fstab"; if (FileUtils::Exists (fstab_file)) { SCR::RegisterAgent (.target.etc.fstab, `ag_anyagent( `Description ( (`File(fstab_file)), "#\n", // Comment false, // read-only (`List ( `Tuple ( `spec (`String("^\t ")), `Separator ("\t "), `file (`String("^\t ")), `Separator ("\t "), `vfstype (`String("^\t ")), `Separator ("\t "), `mntops (`String("^ \t\n")), `Optional(`Whitespace()), `Optional(`freq (`Number())), `Optional(`Whitespace()), `Optional(`passno (`Number())), `Optional(`Whitespace()), `Optional(`the_rest (`String ("^\n"))) ), "\n" )) ) )); fstab = (list) SCR::Read (.target.etc.fstab); SCR::UnregisterAgent (.target.etc.fstab); } else { y2error ("No such file %1. Not using fstab.", fstab_file); } } /** * Register a new cryptotab agent and read the configuration * from Installation::destdir */ void readCryptoTab (list & crtab) { string crtab_file = Installation::destdir + "/etc/cryptotab"; if (FileUtils::Exists (crtab_file)) { SCR::RegisterAgent (.target.etc.cryptotab, `ag_anyagent( `Description ( (`File(crtab_file)), "#\n", // Comment false, // read-only (`List ( `Tuple ( `loop (`String("^\t ")), `Separator ("\t "), `file (`String("^\t ")), `Separator ("\t "), `mount (`String("^\t ")), `Separator ("\t "), `vfstype (`String("^\t ")), `Separator ("\t "), `opt1 (`String("^\t ")), `Separator ("\t "), `opt2 (`String("^ \t")), `Optional(`Whitespace()), `Optional(`the_rest (`String ("^\n"))) ), "\n" )) ) )); crtab = (list) SCR::Read (.target.etc.cryptotab); SCR::UnregisterAgent (.target.etc.cryptotab); } else { y2milestone ("No such file %1. Not using cryptotab.", crtab_file); } } boolean FstabHasSeparateVar (list & fstab) { string var_device_fstab = FindPartitionInFstab (fstab, "/var"); y2milestone ("/var partition is %1", var_device_fstab); return (var_device_fstab != nil); } boolean FstabUsesKernelDeviceNameForHarddisks(list fstab) { // We just want to check the use of kernel device names for hard // disks. Not for e.g. BIOS RAIDs or LVM logical volumes. // Since we are looking at device names of hard disks that may no // longer exist all we have at hand is the name. return find(map line, fstab, { string spec = line["spec"]:"error"; if (regexpmatch(spec, "^/dev/sd[a-z]+[0-9]+$")) return true; if (regexpmatch(spec, "^/dev/hd[a-z]+[0-9]+$")) return true; if (regexpmatch(spec, "^/dev/dasd[a-z]+[0-9]+$")) return true; return false; }) != nil; } define string MountVarIfRequired (list fstab, string root_device_current, boolean manual_var_mount); /** * */ define boolean read_fstab_and_cryptotab (list & fstab, list & crtab, string root_device_current) { integer default_scr = WFM::SCRGetDefault (); integer new_scr = nil; backward_translation = $[]; if (Stage::initial ()) { readFsTab (fstab); readCryptoTab (crtab); } else { fstab = (list) SCR::Read (.etc.fstab); crtab = (list) SCR::Read (.etc.cryptotab); } Update::GetProductName(); boolean fstab_has_separate_var = FstabHasSeparateVar (fstab); // mount /var if (fstab_has_separate_var) { y2warning ("Separate /var partition!"); MountVarIfRequired (fstab, root_device_current, false); } else { y2milestone ("No separate /var partition found"); } y2milestone ("fstab: %1", fstab); fstab = TranslateFsOrCryptoTab (fstab, "spec", "spec_old"); y2milestone ("fstab: (translated) %1", fstab); y2milestone ("crtab: %1", crtab); crtab = TranslateFsOrCryptoTab (crtab, "file", "file_old"); y2milestone ("crtab: (translated) %1", crtab); // umount /var if (fstab_has_separate_var) { SCR::Execute (.target.umount, Installation::destdir + "/var"); } return true; } /** * */ define boolean PrepareCryptoTab (list crtab, list & fstab) { integer crypt_nb = 0; foreach (map mounts, crtab, { string vfstype = mounts["vfstype"]:""; string mntops = mounts["opt2"]:""; string loop = mounts["loop"]:""; string fspath = mounts["mount"]:""; string device = mounts["file"]:""; y2milestone ("vfstype:%1 mntops:%2 loop:%3 fspath:%4 device:%5", vfstype, mntops, loop, fspath, device); if (!issubstring (mntops, "noauto")) { boolean again = true; while (again) { boolean crypt_ok = true; string crypt_passwd = DlgUpdateCryptFs( device, fspath ); if (crypt_passwd == nil || crypt_passwd == "") { crypt_ok = false; again = false; } y2milestone ("crypt pwd ok:%1", crypt_ok); if (crypt_ok) { map setloop = $[ "encryption" : "twofish", "passwd" : crypt_passwd, "loop_dev" : loop, "partitionName" : device ]; crypt_ok = Storage::PerformLosetup( setloop, false ); y2milestone ("crypt ok: %1", crypt_ok); if( crypt_ok ) loop = setloop["loop_dev"]:""; else { // yes-no popup again = Popup::YesNo (_("Incorrect password. Try again?")); } } if (crypt_ok) { map add_fs = $[ "file" : fspath, "mntops" : mntops, "spec" : loop, "freq" : 0, "passno" : 0, "vfstype": vfstype ]; fstab = prepend (fstab, add_fs); AddMountedPartition ($[`type : "crypt", `device : device]); again = false; } } } }); return true; } /** * Check if specified mount point is mounted * @param mountpoint the mount point to be checked * @return boolean true if it is mounted */ define boolean IsMounted (string mountpoint) { if (substring (mountpoint, size (mountpoint) - 1, 1) == "/") mountpoint = substring (mountpoint, 0, size (mountpoint) - 1); boolean ret = true; foreach (map e, activated, { if (e[`type]:"" == "mount" && (e[`mntpt]:"" == mountpoint || e[`mntpt]:"" == mountpoint + "/")) { ret = true; } }); return ret; } // bugzilla #258563 boolean CheckBootSize (string bootpart) { integer min_suggested_bootsize = 65536; if (Arch::ia64()) { min_suggested_bootsize = 204800; } integer bootsize = nil; string cmd = sformat ( "/bin/df --portability --no-sync -k '%1/boot' | grep -v '^Filesystem' | sed 's/[ ]\\+/ /g'", Installation::destdir ); map bootsizeout = (map) SCR::Execute (.target.bash_output, cmd); if (bootsizeout["exit"]:-1 != 0) { y2error ("Error: '%1' -> %2", cmd, bootsizeout); } else { list scriptout = splitstring (bootsizeout["stdout"]:"", " "); y2milestone ("Scriptout: %1", scriptout); bootsize = tointeger (scriptout[1]:"0"); } if (bootsize == nil || bootsize == 0) { y2error ("Cannot find out bootpart size: %1", Installation::destdir); return true; } y2milestone ("Boot size is: %1 recommended min.: %2", bootsize, min_suggested_bootsize); // Size of the /boot partition is satisfactory if (bootsize >= min_suggested_bootsize) { return true; // Less than a hero } else { integer current_bs = bootsize / 1024; integer suggested_bs = min_suggested_bootsize / 1024; boolean cont = Popup::ContinueCancelHeadline ( // TRANSLATORS: a popup headline _("Warning"), // TRANSLATORS: error message, // %1 is replaced with the current /boot partition size // %2 with the recommended size sformat ( _("Your /boot partition is too small (%1 MB). We recommend a size not less than %2 MB. It might happen, that the new Kernel does not fit, so it would be safer to either enlarge that partition or not to use the /boot partition at all. Would you like to continue updating the current system?"), current_bs, suggested_bs ) ); if (cont) { y2warning ("User decided to continue despite small a /boot partition"); return true; } else { y2milestone ("User decided not to continue with small /boot partition"); return false; } } } /** * */ define boolean MountFSTab (list fstab, string& message) { list allowed_fs = [ "ext", "ext2", "ext3", "minix", "reiserfs", "jfs", "xfs", "xiafs", "hpfs", "vfat", "auto", "proc" ]; // mount sysfs first string ret = MountPartition ("/sys", "sysfs", "sysfs"); if (ret == nil) AddMountedPartition($[`type : "mount", `device : "sysfs", `mntpt : "/sys"]); boolean success = true; boolean raidMounted = false; foreach (map mounts, fstab, { string vfstype = mounts["vfstype"]:""; string mntops = mounts["mntops"]:""; string spec = mounts["spec"]:""; string fspath = mounts["file"]:""; if (contains (allowed_fs, vfstype) && fspath != "/" && (fspath != "/var" || ! IsMounted("/var")) && !issubstring (mntops,"noauto")) { y2milestone ("mounting %1 to %2", spec, fspath); if ( !Mode::test () ) { string mount_type = ""; if (vfstype == "proc") { mount_type = vfstype; } string mount_err = ""; while (mount_err != nil) { mount_err = FsckAndMount (fspath, spec, mount_type); if (mount_err != nil) { y2error("mounting %1 (type %2) on %3 failed", spec, mount_type, Installation::destdir + fspath); UI::OpenDialog (`VBox ( `Label (sformat ( // label in a popup, %1 is device (eg. /dev/hda1), %2 is output of the 'mount' command _("The partition %1 could not be mounted. %2 If you are sure that the partition is not necessary for the update (it is not any system partition), click Continue. To check or fix the mount options, click Specify Mount Options. To abort update, click Cancel."), spec, mount_err) ), `VSpacing (1), `HBox ( `PushButton (`id (`cont), Label::ContinueButton ()), // push button `PushButton (`id (`cmd), _("&Specify Mount Options")), `PushButton (`id (`cancel), Label::CancelButton ()) ) )); symbol act = (symbol)UI::UserInput (); UI::CloseDialog (); if (act == `cancel) { mount_err = nil; success = false; } else if (act == `cont) { mount_err = nil; } else if (act == `cmd) { UI::OpenDialog (`VBox ( // popup heading `Heading (_("Mount Options")), `VSpacing (0.6), // text entry label `TextEntry (`id (`mp), _("&Mount Point"), fspath), `VSpacing (0.4), // tex entry label `TextEntry (`id (`device), _("&Device"), spec), `VSpacing (0.4), // text entry label `TextEntry (`id (`fs), _("&File System\n(empty for autodetection)"), mount_type), `VSpacing (1), `HBox ( `PushButton (`id (`ok), Label::OKButton ()), `PushButton (`id (`cancel), Label::CancelButton ()) ) )); act = (symbol)UI::UserInput (); if (act == `ok) { fspath = (string)UI::QueryWidget (`id (`mp), `Value); spec = (string)UI::QueryWidget (`id (`device), `Value); mount_type = (string)UI::QueryWidget (`id (`fs), `Value); } UI::CloseDialog (); } } } if (fspath == "/boot" || fspath == "/boot/") { string checkspec = spec; // translates new device name to the old one because // storage still returns them in the old way if (backward_translation[spec]:nil != nil) { checkspec = backward_translation[spec]:spec; } if (! CheckBootSize (checkspec)) { success = false; } } } } // allowed_fs else if (vfstype == "swap" && fspath == "swap" ) { y2milestone("mounting %1 to %2", spec, fspath); if ( !Mode::test () ) { string command = "/sbin/swapon "; if ( spec != "" ) { // swap-partition command = command + spec; // run /sbin/swapon integer ret_from_shell = (integer) SCR::Execute (.target.bash, command); if ( ret_from_shell != 0 ) { y2error("swapon failed: %1", command ); } else { AddMountedPartition ($[`type : "swap", `device : spec]); } } } } }); return success; } /** * Mount /var partition * @param device string device holding the /var subtree * @return string nil on success, error description on fail */ string MountVarPartition (string device) { string mount_err = FsckAndMount ("/var", device, ""); string err_message = nil; if (mount_err != nil) { y2error (-1, "failed to mount /var"); err_message = sformat ( // error message _("The /var partition %1 could not be mounted.\n"), device) + "\n" + mount_err + "\n\n" + sdb; } return err_message; } // <-- BNC #448577, Cannot find /var partition automatically // returns if successful boolean MountUserDefinedVarPartition () { // function return value boolean manual_mount_successful = false; list list_of_devices = []; // $[ "/dev/sda3" : "Label: My_Partition" ] map device_info = $[]; // Creating the list of known partitions foreach (string device, map description, Storage::GetOndiskTarget(), { foreach (map partition, description["partitions"]:[], { // Some partitions logically can't be used for /var if (partition["detected_fs"]:`unknown == `swap) return; if (partition["type"]:`unknown == `extended) return; if (! haskey (partition, "device")) return; list_of_devices = add (list_of_devices, partition["device"]:""); device_info[partition["device"]:""] = sformat ( // Informational text about selected partition, %x are replaced with values later _("File system: %1, Type: %2,
Label: %3, Size: %4,
udev IDs: %5,
udev path: %6"), // starts with >`< substring (tostring (partition["detected_fs"]:`unknown), 1), partition["fstype"]:_("Unknown"), partition["label"]:_("None"), String::FormatSize (partition["size_k"]:0 * 1024), mergestring (partition["udev_id"]:[], ", "), partition["udev_path"]:_("Unknown") ); }); }); list_of_devices = sort (list_of_devices); y2milestone ("Known devices: %1", list_of_devices); while (true) { UI::OpenDialog ( `VBox ( `MarginBox (1, 0, `VBox ( // a popup caption `Left (`Heading (_("Unable to find the /var partition automatically"))), // a popup message `Left (`Label (_("Your system uses a separate /var partition which is required for the upgrade process to detect the disk-naming changes. Select the /var partition manually to continue the upgrade process."))), `VSpacing (1), `Left (`ComboBox ( `id ("var_device"), `opt (`notify), // a combo-box label _("&Select /var Partition Device"), list_of_devices )), `VSpacing (0.5), // an informational rich-text widget label `Left (`Label (_("Device Info"))), `MinHeight ( 3, `RichText (`id ("device_info"), "") ), `VSpacing (1) ) ), `MarginBox (1, 0, `ButtonBox ( `PushButton (`id (`ok), `opt (`okButton), Label::OKButton()), `PushButton (`id (`cancel), `opt (`cancelButton), Label::CancelButton()) )) ) ); any ret = nil; // initial device string var_device = (string) UI::QueryWidget (`id ("var_device"), `Value); UI::ChangeWidget (`id ("device_info"), `Value, device_info[var_device]:""); // to handle switching the combo-box or [OK]/[Cancel] while (true) { ret = UI::UserInput(); var_device = (string) UI::QueryWidget (`id ("var_device"), `Value); if (ret == "var_device") { UI::ChangeWidget (`id ("device_info"), `Value, device_info[var_device]:""); } else { break; } } UI::CloseDialog(); // Trying user-selection if (ret == `ok) { y2milestone ("Trying to mount %1 as /var", var_device); string mount_error = MountVarPartition (var_device); if (mount_error != nil) { Report::Error (mount_error); continue; } else { y2milestone ("Manual mount (/var) successful"); manual_mount_successful = true; break; } // `cancel } else { y2warning ("User doesn't want to enter the /var partition device"); break; } } return manual_mount_successful; } /** * Check if /var partition is needed, mount it if it is * @param fstab a list of fstab entries * @param root_device_current string current root device * @param manual_var_mount whether to ask user to enter /var device if not found * @return string nil on success, error description on fail */ define string MountVarIfRequired (list fstab, string root_device_current, boolean manual_var_mount) { string var_device_fstab = FindPartitionInFstab (fstab, "/var"); // No need to mount "/var", it's not separate == already mounted with "/" if (var_device_fstab == nil) { y2milestone ("Not a separate /var..."); return nil; } if (!Storage::DeviceRealDisk (var_device_fstab)) { y2milestone ("Device %1 is not a real disk, mounting...", var_device_fstab); return MountVarPartition (var_device_fstab); } // BNC #494240: If a device name is not created by Kernel, we can use it for upgrade if (!Storage::IsKernelDeviceName (var_device_fstab)) { y2milestone ("Device %1 is not a Kernel device name, mounting...", var_device_fstab); return MountVarPartition (var_device_fstab); } list tmp1 = filter (map entry, fstab, ``(entry["file"]:"" == "/")); string root_device_fstab = tmp1[0,"spec"]:""; if (!Storage::DeviceRealDisk (root_device_fstab)) return MountVarPartition (var_device_fstab); map root_info = Storage::GetDiskPartition (root_device_fstab); map var_info = Storage::GetDiskPartition (var_device_fstab); if (root_info["disk"]:"" == var_info["disk"]:"") { map tmp2 = Storage::GetDiskPartition (root_device_current); string var_partition_current = Storage::GetDeviceName (tmp2["disk"]:"", var_info["nr"]:0); return MountVarPartition (var_partition_current); } list realdisks = []; foreach (string s, map m, (map ) Storage::GetOndiskTarget (), { // BNC #448577, checking device if (Storage::IsKernelDeviceName(s) && Storage::DeviceRealDisk (s)) realdisks = add (realdisks, s); }); if (size (realdisks) != 2) { // <-- BNC #448577, Cannot find /var partition automatically if (manual_var_mount && MountUserDefinedVarPartition ()) { return nil; } y2error ("don't know how to handle more than two disks at this point"); // error message return _("Unable to mount /var partition with this disk configuration.\n") + sdb; } string other_disk = realdisks[ realdisks[0]:"" == root_info["disk"]:"" ? 1 : 0 ]:""; string var_partition_current = Storage::GetDeviceName (other_disk, var_info["nr"]:0); return MountVarPartition (var_partition_current); } /** * Mounting root-partition; reading fstab and mounting read partitions */ global define boolean MountPartitions (string root_device_current) { y2milestone ("mount partitions: %1", root_device_current); if (did_try_mount_partitions) return true; did_try_mount_partitions = true; boolean success = true; // popup message, %1 will be replace with the name of the logfile string message = sformat (_("Partitions could not be mounted.\n Check the log file %1."), Directory::logdir + "/y2log"); y2milestone ("selected partition: %1", root_device_current); boolean ret_bool = true; list fstab = []; list crtab = []; // Mount selected root partition to Installation::destdir if ( !Mode::test () ) { ret_bool = nil == FsckAndMount ("/", root_device_current, ""); } if ( ret_bool ) { // read the keyboard settings now, so that it used when // typing passwords for encrypted partitions // Calling a script because otherwise this module would depend on yast2-country if (Stage::initial()) { WFM::call ("rootpart_check_keyboard", [$["destdir":Installation::destdir]]); } read_fstab_and_cryptotab (fstab, crtab, root_device_current); if (FstabUsesKernelDeviceNameForHarddisks(fstab)) { y2warning("fstab on %1 uses kernel device name for hard disks", root_device_current); string warning = sformat (_("Some partitions in the system on %1 are mounted by kernel-device name. This is not reliable for the update since kernel-device names are unfortunately not persistent. It is strongly recommended to start the old system and change the mount-by method to any other method for all partitions."), root_device_current); if (Mode::autoupgrade()) { Popup::TimedWarning(warning, 10); } else { Popup::Warning(warning); } } if (size (fstab) == 0) { y2error ("no or empty fstab found!"); // error message message = _("No fstab found."); success = false; } else { string tmp_msg = MountVarIfRequired (fstab, root_device_current, true); if (tmp_msg != nil) { y2error ("failed to mount /var!"); message = tmp_msg; success = false; } else { string tmp = ""; if (!check_root_device (root_device_current, fstab, tmp)) { y2error ("fstab has wrong root device!"); // message part 1 message = _("The root partition in /etc/fstab has an invalid root device.\n") + // message part 2 sformat (_("It is currently mounted as %1 but listed as %2.\n"), root_device_current, tmp) + sdb; success = false; } else { y2milestone ("cryptotab %1", crtab); PrepareCryptoTab (crtab, fstab); y2milestone ("fstab %1", fstab); if (!MountFSTab (fstab, message)) success = false; } } } } else { y2error("Could not mount root '%1' to '%2'", root_device_current, Installation::destdir); success = false; } y2milestone ("MountPartition (%1) = %2", root_device_current, success); y2milestone ("activated %1", activated); if (!success) { Popup::Message(message); // some mount failed, unmount all mounted fs UnmountPartitions(false); did_try_mount_partitions = true; } else { // enter the mount points of the newly mounted partitions // in the target map of the storage module AddToTargetMap (); } return success; } global define boolean SetFormatPartitions (list fstabpart) { // All storage devices map target_map = Storage::GetTargetMap (); list fstab = []; readFsTab(fstab); // all activated list tmp = filter (map e, activated, { return (e[`type]:"" == "mount" || e[`type]:"" == "swap"); }); foreach (map e, tmp, { string mntpt = (e[`type]:"" == "swap")?("swap"):(e[`mntpt]:""); string part = e[`device]:""; map p = $[]; foreach (map pp, fstabpart, { // mountpoint matches if (pp["mount"]:"" == mntpt) { p = pp; break; } }); string mount_options = ""; foreach (map entry, fstab, { if( entry["file"]:"" == mntpt ) { mount_options = entry["mntops"]:""; break; } }); target_map = Storage::SetPartitionData (target_map, part, "mount", mntpt ); target_map = Storage::SetPartitionData (target_map, part, "format", p["format"]:false ); target_map = Storage::SetPartitionData (target_map, part, "delete", false); target_map = Storage::SetPartitionData (target_map, part, "create", false); if( size(mount_options) > 0 && !haskey(p, "fstopt" ) ) target_map = Storage::SetPartitionData (target_map, part, "fstopt", mount_options); if( haskey(p, "fstopt" ) ) target_map = Storage::SetPartitionData (target_map, part, "fstopt", p["fstopt"]:""); if( haskey( p, "mountby" ) ) target_map = Storage::SetPartitionData (target_map, part, "mountby", p["mountby"]:`device); }); Storage::SetTargetMap (target_map); return true; } /** * Get architecture of an elf file. */ define string GetArchOfELF (string filename) { map bash_out = (map) SCR::Execute (.target.bash_output, Directory::ybindir + "/elf-arch " + filename); if (bash_out["exit"]:1 != 0) return "unknown"; return deletechars (bash_out["stdout"]:"unknown", "\n"); } /** * Checks the partition whether it contains an incomplete installation. * * @see BNC #441919 * @param string system mounted to directory * @return boolean true if incomplete */ global boolean IncompleteInstallationDetected (string mounted_to) { // by default, installation is complete boolean ret = false; foreach (string check_this, [Installation::run_yast_at_boot], { check_this = sformat ("%1/%2", mounted_to, check_this); if (FileUtils::Exists (check_this) == true) { y2milestone ("File %1 exists, installation is incomplete", check_this); ret = true; break; } }); return ret; } /** * Check a root partition and return map with infomations (see * variable rootPartitions). */ define map CheckPartition (map partition) { map freshman = $[ `valid : false, `name : "unknown", `arch : "unknown", `label: partition["label"]:"", `fs : partition["detected_fs"]:`unknown, `fstype : partition["fstype"]:"unknown", ]; string p_dev = partition["device"]:"error"; integer p_fsid = partition["fsid"]:0; symbol p_type = partition["type"]:`primary; symbol p_detect_fs = partition["detected_fs"]:`unknown; // possible root FS if ( contains (possible_root_fs, p_detect_fs)) { map mt_map = $[ `ext2: "ext2", `ext3: "ext3", `reiser: "reiserfs", `xfs: "xfs", `jfs: "jfs", ]; string mount_type = mt_map[p_detect_fs]:""; string error_message = nil; if (! RunFSCKonJFS (mount_type, p_dev, error_message)) { freshman[`valid] = false; return freshman; } // mustn't be empty and must be modular if (mount_type != "" && ! contains (non_modular_fs, mount_type)) SCR::Execute(.target.modprobe, mount_type, "" ); // mount (read-only) partition to Installation::destdir Storage::RemoveDmMapsTo( p_dev ); if ((boolean) SCR::Execute (.target.mount, [p_dev, Installation::destdir, Installation::mountlog], "-o ro")) { // Is this a root partition, does /etc/fstab exists? if (SCR::Read (.target.size, Installation::destdir + "/etc/fstab") > 0) { y2milestone ("found fstab on %1", partition); list fstab = []; list crtab = []; read_fstab_and_cryptotab (fstab, crtab, p_dev); fstab = filter (map p, fstab, ``(p["file"]:""=="/")); if (size(fstab[0,"spec"]:"") == 0) { y2warning ("Cannot find / entry in fstab %1", fstab); } freshman[`valid] = size(fstab[0,"spec"]:"")>0 && Storage::DeviceMatchFstab( p_dev, // bugzilla #304269 // DeviceMatchFstab expects _old_ not _translated_ device fstab[0,"spec_old"]:fstab[0,"spec"]:"" ); // Why this doesn't match? // Possible reasons: // - /var not mounted so hwinfo cannot translate device names if (freshman[`valid]:false != true) { y2warning ("Device does not match fstab: '%1' vs. '%2'", p_dev, fstab[0,"spec"]:""); } // Get installed release name string release = SuSERelease::ReleaseInformation (Installation::destdir); y2debug("release: %1", release ); if (release == "?") { // label for an unknown installed system release = _("Unknown"); } freshman[`name] = release; // Right architecture? freshman[`arch] = GetArchOfELF (Installation::destdir + "/bin/bash"); string instsys_arch = GetArchOfELF ("/bin/bash"); // `arch_valid, see bugzilla #288201 // installed /bin/bash and the one from inst-sys are matching if (freshman[`arch]:"unknown" == instsys_arch) { y2milestone ("Architecture (%1) is valid", instsys_arch); freshman[`arch_valid] = true; // both are PPC, bugzilla #249791 } else if ( contains(["ppc", "ppc64"], freshman[`arch]:"unknown") && contains(["ppc", "ppc64"], instsys_arch) ) { y2milestone ("Architecture for partition %1 is %2, upgrading %3", p_dev, freshman[`arch]:"unknown", instsys_arch); freshman[`arch_valid] = true; // Architecture is not matching } else { y2milestone ("Architecture for partition %1 is %2, upgrading %3", p_dev, freshman[`arch]:"unknown", instsys_arch); freshman[`arch_valid] = false; } // If architecture is not matching, the whole partition is considered to be wrong if (freshman[`arch_valid]:false != true) { y2milestone ("Architecture is not valid -> the whole partition is not valid"); freshman[`valid] = false; } if (IncompleteInstallationDetected (Installation::destdir)) { y2milestone ("Incomplete installation detected, partition is not valid"); freshman[`valid] = false; } y2milestone ("Partition is valid: %1, arch is valid: %2", freshman[`valid]:false, freshman[`arch_valid]:false); } // unmount partition SCR::Execute (.target.umount, Installation::destdir); } } y2milestone ("%1 %2", partition, freshman); return freshman; } /** * Find all valid root partitions and place the result in rootPartitions. * The partitions are mounted and unmounted again (to Installation::destdir). * Loads a bunch of kernel modules. * @return void */ global define void FindRootPartitions () { if (didSearchForRootPartitions) return; ModuleLoading::Load ("reiserfs", "", "Linux", "Reiser FS", Linuxrc::manual (), true); ModuleLoading::Load ("jfs", "", "Linux", "JFS", Linuxrc::manual (), true); ModuleLoading::Load ("xfs", "", "Linux", "XFS", Linuxrc::manual (), true); ModuleLoading::Load ("ext3", "", "Linux", "Ext3", Linuxrc::manual (), true); ModuleLoading::Load ("raid0", "", "Linux", "Raid 0", Linuxrc::manual (), true); ModuleLoading::Load ("raid1", "", "Linux", "Raid 1", Linuxrc::manual (), true); ModuleLoading::Load ("raid5", "", "Linux", "Raid 5", Linuxrc::manual (), true); ModuleLoading::Load ("multipath", "", "Linux", "Multipath", Linuxrc::manual (), true); ModuleLoading::Load ("dm-mod", "", "Linux", "DM", Linuxrc::manual (), true); SCR::Execute (.target.bash, "/sbin/devmap_mknod.sh"); ModuleLoading::Load ("dm-snapshot", "", "Linux", "DM", Linuxrc::manual (), true); if (Mode::test ()) { Storage::SetTargetMap ((map) SCR::Read (.target.yast2, "test_target_map.ycp")); } // Storage::ActivateEvms(); map target_map = (map ) Storage::GetOndiskTarget (); y2milestone ("target_map: %1", target_map); // prepare progress-bar if (UI::WidgetExists (`id ("search_progress"))) UI::ReplaceWidget ( `id ("search_progress"), `ProgressBar ( `id ("search_pb"), _("Evaluating root partition. One moment please..."), 100, 0 ) ); rootPartitions = $[]; numberOfValidRootPartitions = 0; // all partitions on all devices integer max_steps = 0; foreach (string device, map description, target_map, { max_steps = max_steps + size (description["partitions"]:[]); }); integer counter = 0; foreach (string device, map description, target_map, { foreach (map partition, description["partitions"]:[], { counter = counter + 1; if (UI::WidgetExists (`id ("search_progress"))) UI::ChangeWidget (`id ("search_pb"), `Value, (100 * counter / max_steps)); // some partitions don't make sense at all if (partition["detected_fs"]:`unknown != `swap && partition["type"]:`primary != `extended) { map freshman = $[]; if (Mode::test ()) freshman = $[`valid : true, `name : "SuSE Linux 4.2", `arch : "i286", `label: "Label" ]; else freshman = CheckPartition (partition); rootPartitions = add (rootPartitions, partition["device"]:"error", freshman); if (freshman[`valid]:false) numberOfValidRootPartitions = numberOfValidRootPartitions + 1; } }); }); // 100% if (UI::WidgetExists (`id ("search_progress"))) UI::ChangeWidget (`id ("search_pb"), `Value, 100); didSearchForRootPartitions = true; y2milestone ("rootPartitions: %1", rootPartitions); } global string GetDistroArch () { return GetArchOfELF ("/bin/bash"); } global boolean mount_target () { UI::OpenDialog (`opt(`decorated ), // intermediate popup while mounting partitions `Label(_("Mounting partitions. One moment please..."))); boolean tmp = RootPart::MountPartitions (RootPart::selectedRootPartition); // sleep (500); UI::CloseDialog (); return tmp; } global void Detect () { if (!didSearchForRootPartitions) { Wizard::SetContents ( // TRANSLATORS: dialog caption _("Update Configuration"), `VBox ( `ReplacePoint (`id ("search_progress"), `Empty()) ), "", false, false ); FindRootPartitions (); selectedRootPartition = ""; y2milestone ("Detected root partitions: %1", rootPartitions); } } global void Propose (boolean force_reset) { y2milestone ("Proposing root partition"); Detect (); if (force_reset) { selectedRootPartition = ""; } if (numberOfValidRootPartitions == 0 && selectedRootPartition == "") { targetOk = false; } else { if (selectedRootPartition == "") { SetSelectedToValid (); } } } } 0707010006A4C1000081A40000000000000000000000014F1036C400015657000000080000000100000000000000000000004C00000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/AutoinstScripts.ybcYaST bytecode 1.4.0AutoinstScripts'AutoinstScripts.ycp ModeAutoinstConfigSummaryURLServicePopupLabelautoinstall/io.ycp  FTP  Installation HTTP StorageDevices TFTP GET_error basename  dirname  Get    GetURL  prepostchrootinitmergedmodified SetModified  GetModified mergeScriptsAutoinstScripts Export Resolve_relurlImport Summary ! deleteScript  " AddEditScript       # typeString  $ splitParams   %interactiveScript      &Write "%(.7pds  !!0 scriptName ""?  scriptName source  interpreter type  notification chrooteddebugfeedbacknetwork##{type &&type special.3UI UserInput OpenDialog   CloseDialog ChangeWidget   QueryWidget  3WFMReadExecute3SCRReadWriteExecute3WFMReadExecute3SCRReadWriteExecute0 autoinst3Modeautoinst autoupgrade3AutoinstConfig tmpDir urltok scripts_dir initscripts_dir logs_dir destdir scheme host  directory  ShellEscape  3Summary AddHeader   AddLine   OpenList   CloseList   AddListItem    NotConfigured 3URLParse Build 3ServiceEnable 3PopupLongText    ClearFeedback  ShowFeedback   3LabelOKButton 1autoinstall/io.ycp0 autoinst3 FTPGet  3  Installation sourcedir mountlog boot 3HTTPGet  easySSL 3StorageDevices FloppyReady FloppyDevice 3TFTPGet   $%filePath pathComponentsret $    splitstring   /$ -size-%&filePath pathComponentslast ret $(    splitstring   /$) -size$*   substring  - size  size -+%3Scheme Host Path  Localfile okrestoksfull_url tmp_dir  mount_point &8$9$: $;'<scheme'=host(>     regexpsub     (.*)//(.*)\1/\24?&@     regexpsub     (.*)//(.*)\1/\2'Bpath$C $E  WFM::Read .local.tmpdir $F+    /tmp_mount,G WFM::Execute .local.mkdir(I||httphttps4J,K&L(Mcode4N&O-P4S,T   y2error   Can't find URL: %1&V   sformat   CCannot find URL '%1' via protocol HTTP(S). Server returned code %2.autoinstcode-W(Zftp4[&\ (]&&&&codecode, SCR::Read .target.size4^&_-`4c,d   y2error   Can't find URL: %1&f   sformat   ?Cannot find URL '%1' via protocol FTP. Server returned code %2.autoinstcode-g(jfile4kfile $l   sformat   %1/%2(m SCR::Read .target.size4ncpcmd $o   sformat   cp %1 %2,p    y2milestone   Copy profile: %1,q SCR::Execute .target.bash4tcpcmd &u+      sformat   Reading file on %1/%2 failed. autoinst$v   sformat   cp %1 %2,w    y2milestone   Copy profile: %1,x SCR::Execute .target.bash({ SCR::Read .target.size4|&}&~4&+      sformat   Reading file on %1 failed. autoinst,    y2milestone   -Trying to find file on installation media: %1(cd4cdrom $  SCR::Read.etc.install_inf.Cdrom(! WFM::Execute .local.mount+   /dev/4&+      sformat   Mounting %1 failed.autoinst,    y2warning    Mount failed4cpcmd $   sformat   +   +   cp /%1 %2,    y2milestone   Copy profile: %1, SCR::Execute .target.bash, WFM::Execute .local.umount( SCR::Read .target.size4&-&+      sformat   )Reading a file on CD failed. Path: %1/%2.autoinst&(nfs4copyCmd (nfs4,    y2milestone   Starting portmap: %1 SCR::Execute .target.bash /sbin/portmap(&&! SCR::Execute .target.mount+   +   : -o nolock! SCR::Execute .target.mount+   +   :-t nfs44,    y2warning    Mount failed&   sformat   Mounting %1 failed.autoinst+   +   :-$+   +   +   +   +   /bin/cp / ,    y2milestone   Copy Command: %1( WFM::Execute .local.bash4&&4&   sformat   "Remote file %1 cannot be retrievedautoinst+   +   /,   y2error   !remote file %1 can't be retrieved+   +   /, WFM::Execute .local.umount(||floppyusb4(&&floppy4, WFM::Execute .local.mount( WFM::Execute .local.bash+   +   +   +   +   /bin/cp / 4,   y2error   file %1 can't be retrieved+   +   /4&&, SCR::Execute.target.umount4probe,    y2milestone   looking for %1 on USB$ SCR::Read .probe.usb,  foreachd (&& busUSBSCSIhaskeydev_name4idev $$ dev_name)|| SCR::Read .target.lstat 4mounts  mount_list already_mounted $  SCR::Read.target.string /proc/mounts$    splitstring    $,    foreachm  entries $    splitstring    ( 4&& .,    y2milestone    already mounted=%1 mountpoint=%2(&&!! WFM::Execute .local.mount4,    y2milestone   mount failed for %1&+&+    dev_name   sformat   %1/( WFM::Execute .local.bash+   +   +   +   +   /bin/cp / 4,    y2milestone   not found on %14,    y2milestone    found on %1&&(!, SCR::Execute.target.umount(.&+&+    dev_name   sformat   %1(.(device4(&&4mounts  mount_list already_mounted )  SCR::Read .target.dir+   /dev/4 l ,    y2milestone   nested device found$    splitstring   /&+   +   / &  remove&    mergestring   /,    y2milestone   Host=%1 Path=%2$  SCR::Read.target.string /proc/mounts$    splitstring    $,    foreachm  entries $    splitstring    ( +   /dev/4&& .,"    y2milestone    already mounted=%1 mountpoint=%2(#!,$ WFM::Execute .local.mount   sformat   /dev/%1(' WFM::Execute .local.bash+   +   +   +   +   /bin/cp / 4(&*   sformat   File %1 cannot be foundautoinst+   ,+   y2error   file %1 can't be found+   4.&/&0(2!,3 WFM::Execute .local.umount(6tftp47(849&:&;4>&?   sformat   'Cannot find URL '%1' via protocol TFTP.autoinst+   +   :,@   y2error   file %1 can't be found4D&F   sformat   Unknown protocol %1.autoinst,G   y2error   Protocol not supported&H-J%Qurl target toks&S $T-U scheme host path2AutoinstScripts.ycp$ $ $ $" $% $(%.&0%7-9%Bresult$Emaplistp &Gaddtype pre-scripts-H&Junionmaplistp &Laddtype post-scripts-M&Punionmaplistp &Raddtypechroot-scripts-S&Vunionmaplistp &Xaddtype init-scripts-Y-\%c(e!4f&g%pexpreexpostexchrootexinitresult &r &s &t &u ,v    y2milestone    Merged %1,y  foreachs (z type pre-scripts&{add(| type post-scripts&}add(~ type init-scripts&add( typechroot-scripts&add$  maplistp filename filename interpreter  interpretersource sourcelocation locationfeedbackfeedback notification  notificationdebugdebug$  maplistp filename filename interpreter  interpretersource sourcelocation locationfeedbackfeedbackdebugdebug notification  notificationnetwork_needednetwork_needed$  maplistp filename filename interpreter  interpretersource sourcechrootedchrootedlocation locationfeedbackfeedback notification  notificationdebugdebug$  maplistp filename filenamesource sourcelocation locationdebugdebug$ (size' pre-scripts(size' post-scripts(size'chroot-scripts(size' init-scripts-%&maplistscript (   issubstring   location relurl://4l newloc $ location&   substring   $(relurl4tok,    y2milestone   autoyast profile was relurl too&  SCR::Read.etc.install_inf.ayrelurl$ ,    y2milestone   tok = %1&+   +   +   +   +    scheme:// host/ path4&+   +   +   +   +   :///'location,    y2milestone   changed relurl to %1 for script--% ,   y2debug   !Calling AutoinstScripts::Import()& pre-scripts & init-scripts & post-scripts &chroot-scripts &&&&&,   y2debug    merged: %1-% summary  $&Preinstallation Scriptsautoinst(size4&,  foreachscript & filename&4&&Postinstallation Scriptsautoinst(size4&,  foreachscript & filename&4 & &Chroot Scriptsautoinst(size4&,  foreachscript & filename&4&& Init Scriptsautoinst(size4&,  foreachscript &  filename&"4%&&-(%0!clean$2filters  filename&3-4%?"mod$J&Kmaplistscript (M filename4N oldScript $O &Paddfilename&Qaddsource&Radd interpreter&Saddtype&Taddchrooted&Uadddebug&Vaddfeedback&Waddnetwork_needed&Xadd notification&Z-[4]-^(b!4cscript $d &eaddfilename&faddsource&gadd interpreter&haddtype&iaddchrooted&jadddebug&kaddfeedback&laddnetwork_needed&madd notification&oadd,q   y2debug   Merged scripts: %1-r%{#(} pre-scripts4~-Preautoinst( post-scripts4-Postautoinst( init-scripts4-Initautoinst(chroot-scripts4-Chrootautoinst-Unknownautoinst%$s l ret  $    splitstring   |$ &  remove,    foreachelement  p $    splitstring   ='  -%%shell debug  scriptPath current_logdir  scriptName datawidget execute run ok_buttonvbox buffer $ $, SCR::Execute.target.remove /tmp/ay_opipe, SCR::Execute.target.remove /tmp/ay_ipipe, SCR::Execute .target.bashmkfifo -m 660 /tmp/ay_opipe , SCR::Execute .target.bashmkfifo -m 660 /tmp/ay_ipipe $   sformat   %1 %2 %3 2&> %4/%5.log , SCR::Execute.target.bash_background+   (OPIPE=/tmp/ay_opipe IPIPE=/tmp/ay_ipipe  $$$VBox$ )&& SCR::Read .target.lstat /tmp/ay_opipe 4& SCR::Execute.target.bash_outputcat /tmp/ay_opipe &    splitstring    stdout ) 4line $ &  remove( size /'stdout,    y2milestone   working on line %1(   substring   stdout__EXIT__4( radiobutton4&  add   PushButtonidok ,RadioButtonGroupidrb(4ret,idokEnabled$( radiobutton4val$idrb CurrentButton, SCR::Execute .target.bash   sformat   echo "%1" > /tmp/ay_ipipe  (entry4val$iday_entryValue, SCR::Execute .target.bash   sformat   echo "%1" > /tmp/ay_ipipe  &&VBox(&,&(   substring   stdout  __PROGRESS__4params  $$ stdout,VBox ProgressBaridprlabel  tointegermax100 & progressbar(   substring   stdout__TEXT__4params  hspacevspace $$ stdout$ tointegerwidth10 $ tointegerheight20 &haskeyokbutton&VBoxHSpacingHBoxVSpacingRichTextidmle(&  add   PushButtonidok ,(,idokEnabled&text(   substring   stdout  __ENTRY__4params  $$ stdout(haskey description4&  add  HSpacing(&  add  RichText description &  add   TextEntryiday_entrylabel default &  add   PushButtonidok ,&entry&(   substring   stdout__RADIOBUTTON__4params  $$ stdout(haskey description4&  add  HSpacing<&  add  RichText description & radiobutton&4( progressbar4,idprValue tointeger stdout0(text4,idmleValue+    idmleValue stdout( radiobutton4(   substring   stdout  __BUTTON__4params  $$ stdout&  add  Left RadioButtonidval label 4,    y2milestone   H*urgs* received '%1' instead of '__BUTTON__' during RADIOBUTTON creation stdout, SCR::Execute.target.remove /tmp/ay_opipe, SCR::Execute.target.remove /tmp/ay_ipipe%&scripts tmpdirString current_logdir (&&!!-$ ( pre-scripts4&( init-scripts4&(&&chroot-scripts!4& filters !chrooted("&&chroot-scripts4#&$filters chrooted(&&& post-scripts!4'&(filters !network_needed(*&& post-scripts4+&,filters network_needed4/,0   y2error   Unsupported script type-1$5$6(8 pre-scripts49&:   sformat   %1/%2,; SCR::Execute .target.mkdir&=   sformat   %1/logs,> SCR::Execute .target.mkdir(@chroot-scripts4A(B!4B&C   sformat   %1%2,D SCR::Execute .target.mkdir&F   sformat   %1%2,G SCR::Execute .target.mkdir4H&I   sformat   %1,J SCR::Execute .target.mkdir&L   sformat   %1,M SCR::Execute .target.mkdir4Q&R,V  foreachs scriptInterpreter  scriptName  scriptPath $X  interpretershell$Y filename(Z4[t$\  location&] path$_(a pre-scripts4b&e   sformat   %1/%2/%3,f    y2milestone   Writing pre script into %1(g location4h,i   y2debug   getting script: %1 location(j! location4k,l   y2error    script %1 could not be retrieved location4n,o SCR::Write.target.string sourceecho Empty script!(r init-scripts4s&t   sformat   %1/%2,u    y2milestone   Writing init script into %1(v location4w,x   y2debug   getting script: %1 location(y! location4z,{   y2error    script %1 could not be retrieved location4},~ SCR::Write.target.string sourceecho Empty script!, autoyast(chroot-scripts4toks$  location(|| schemenfs!4&   sformat   %1%2/%34&   sformat   %1/%2,    y2milestone   Writing chroot script into %1( location4(! location4,   y2error    script %1 could not be retrieved location4, SCR::Write.target.string sourceecho Empty script!(&& schemenfs4&   substring  4&   sformat   %1/%2,    y2milestone   Writing script into %1( location4(! location4,   y2error    script %1 could not be retrieved location4, SCR::Write.target.string sourceecho Empty script!( init-scripts4executionString  showFeedbackfeedback $$feedback(  notification,   notification(shell4debug $debug-x(|| SCR::Read .target.size+   -runrerun4( interactive4,%/bin/sh4&   sformat   /bin/sh %1 %2 2&> %3/%4.log ,    y2milestone   Script Execution command: %1, SCR::Execute .target.bash, SCR::Execute .target.bash/bin/touch $FILEFILE+   -run(perl4debug $debug-w(|| SCR::Read .target.size+   -runrerun4( interactive4,% /usr/bin/perl4&   sformat   "/usr/bin/perl %1 %2 2&> %3/%4.log ,    y2milestone   Script Execution command: %1, SCR::Execute .target.bash, SCR::Execute .target.bash/bin/touch $FILEFILE+   -run(python4(|| SCR::Read .target.size+   -runrerun4( interactive4,%/usr/bin/python4&   sformat   !/usr/bin/python %1 2&> %2/%3.log ,    y2milestone   Script Execution command: %1, SCR::Execute .target.bash, SCR::Execute .target.bash/bin/touch $FILEFILE+   -run4,   y2error   Unknown interpreter: %1$(  notification, (4(4&  SCR::Read.target.string+   +   +   /.log( size 4, RichTextopt plainText2-0707010006A4A4000081A40000018F0000018F000000014F103676000015E1000000080000000100000000000000000000004400000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/Confirm.ybcYaST bytecode 1.4.0Confirm  Confirm.ycp IconLabelModePopupLinuxrcStageArchdetection_cache   Detection    MustBeRoot DeleteSelected Delete   &class  icon_name   z    delete 3UITimeoutUserInput OpenDialog   CloseDialogSetFocus 3SCRReadExecute0base3IconImage   3LabelContinueButton 3Modeautoinst autoupgrade3PopupContinueCancelHeadline  YesNo 3Linuxrcmanual3Stageinitial3Archs390$ %& icon resultret((-((+||-+(- --(/ &0  yast-hardware$2   $4  (5 45,6    y2milestone   !Detection cached result: %1 -> %2  -7 ,: opt decoratedHBoxHSpacingHCenterHSquashVBoxHCenterHSquashVBoxLeftHeadingConfirm Hardware DetectionbaseVSpacing0.5HVCenterLabel)YaST2 will detect the following hardware:baseHVCenterHBox HSpacing0.5Heading VSpacing0.5 ButtonBoxHWeight PushButtonidcontinueoptdefaultokButtonHWeight PushButtonidskipopt cancelButton&SkipbaseVSpacing0.2HSpacing,[idcontinue$_ * ,a&c (d continue4d,e    y2milestone   Detection skipped: %1 &f 'i  -j %z outrootpop (| SCR::Read .target.size /usr/bin/id4}(~!,    y2warning   ./usr/bin/id not existing, supposing to be root-$  SCR::Execute.target.bash_output/usr/bin/id --user$   stdout0 ( -$ This module must be run as root. If you continue now, the module may not function properly. For example, some settings can be read improperly and it is unlikely that settings can be written. base(Root Privileges Neededbase 4,   y2error   NOT running as root!--% -Really delete selected entry?base% -   sformat   Really delete '%1'?base 0707010006A4A0000081A40000018F0000018F000000014F1036760000B898000000080000000100000000000000000000004B00000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/AutoinstConfig.ybcYaST bytecode 1.4.0AutoinstConfigHAutoinstConfig.ycp MiscMode InstallationURLautoinstall/xml.ycp XML profileSetup  classSetup   runModule   Repository  ProfileEncrypted ProfilePassword  PackageRepository classDir  currentFile tmpDir var_dir  scripts_dir initscripts_dir logs_dir destdir cache  xml_tmpfile xml_file  runtime_dir  files_dir  profile_dir modified_profile  autoconf_file parsedControlFile remote_rules_location  local_rules_location !local_rules_file "urltok#scheme $host %filepath & directory 'port (user )pass * default_rl +Confirm, OriginalURI -message . dontmerge / noWriteNow 0Halt1 ForceBoot2 RebootMsg3ProfileInRootPart4 remoteProfile5 Proposals 6getProposalList 7setProposalList  8autoinstall/io.ycp 9FTP:HTTP;StorageDevices<TFTP= GET_error >basename  ?dirname  @Get    AGetURL  B ParseCmdLine CSetProtocolMessage DSave E ShellEscape  FAutoinstConfig GMainHelp 7          "%*/45:?EJOUZ_dglo  p!!q""t##v$$w%%x&&y''z(({))|**++,,--..//0011223344556677l 88BB autoinstall CCDD+EE:s FFLGGrO3WFMReadExecute3SCRReadWriteExecute3WFMReadExecute3SCRReadWriteExecute0 autoinst3 Misc SysconfigRead  3Modeautoinst autoupgradeconfig3 Installationdestdir  sourcedir mountlog boot 3URLParse Build 1autoinstall/xml.ycp3 XML xmlCreateDoc  %doc$  '  listEntries Laddonsaddonaliasesaliasallowedallowed_clientsallowed_interfacesallowed_interface allowusers allowuserarchivesarchivechildrenchildchroot-scriptsscriptclassesclass denyusersdenyuser device_mapdevice_map_entrydevice_map_entrydevice dont_mergeelement fetchmailfetchmail_entryfilesfileglobal global_entrygroupsgrouphosts hosts_entryinetd_services inetd_service init-scriptsscriptinitrd_modules initrd_module interfaces interfacekeyskeyid local_domainsdomainslogical_volumeslvlvm lvm_group maps_to_servenis_mapmasquerade_other_domainsdomainmasquerade_usersmasquerade_usermodules module_entry modules_conf module_confnamesname nameservers nameservernet-udevrule netd_confconfnfs nfs_entry nfs_exports nfs_exportnis_other_domainsnis_other_domain nis_servers nis_serveroptionsoptionpackagespackage partitioningdrive partitions partitionpathlistpathpatternspatternpeerspeer post-packagespackage post-patternspattern post-scriptsscript ppd_options ppd_option pre-scriptsscriptprintcapprintcap_entryprintersprinter proposalsproposalraiddeviceregion region_entryremove-packagespackageroutesrouteschemesschema searchlistsearchsection section_entrysectionssection securenets securenet selections selectionservicesservicesettingssettings_entrysharesshareslavesslave smtp_authsmtp_auth_entry sysconfigsysconfig_entrytrusteddomains trusteddomainusersuser virtual_users virtual_uservolume_componentvolume_component_settings volume_entryvolume_componentvolume_settings volume_entry'f  cdataSections source info_file file_contentspxelinux-config media_urllocation'h  rootElementprofile'i  nameSpacehttp://www.suse.com/1.0/yast2ns'j  typeNamespace http://www.suse.com/1.0/configns,l profile -m%tdoc$w  'x  listEntries classesclass'{  rootElement autoinstall'}  nameSpacehttp://www.suse.com/1.0/yast2ns'~  typeNamespace http://www.suse.com/1.0/configns, class -2AutoinstConfig.ycp$ $ $ $ $ $"$%$*  SCR::Read.target.tmpdir$//var/adm/autoinstall$4+   /scripts$5+   /init.d$:+   /logs$?$E+   /cache$J+    /autoinst.xml$O+   /installedSystem.xml$U/var/lib/autoinstall$Z+   /files$_ /tmp/profile$d+    /modified.xml$g+   /autoconf/autoconf.xml$l+    /autoinst.ycp$orules/rules.xml$p +   /rules$q!+     /rules.xml$t" $v#$w$$x%$y&$z'${($|)$*5$+$,$-$. $/ $0$1$2$3$4$5 %6-5%7&5 1autoinstall/io.ycp0 autoinst3 FTPGet  3HTTPGet  easySSL 3StorageDevices FloppyReady FloppyDevice 3TFTPGet   $=%>filePath 8pathComponentsret 8$    splitstring   /$ -size-%&?filePath 8pathComponentslast ret 8$(    splitstring   /$) -size$*   substring  - size  size -+%3@Scheme Host Path  Localfile 8okrestoksfull_url tmp_dir  mount_point 8&8=$9$: $;"'<scheme'=host(>     regexpsub     (.*)//(.*)\1/\24?8&@     regexpsub     (.*)//(.*)\1/\2'Bpath$C$E  WFM::Read .local.tmpdir $F+    /tmp_mount,G WFM::Execute .local.mkdir(I||httphttps4J8,K &L (Mcode4N8&O=-P4S8,T   y2error   Can't find URL: %1&V=   sformat   CCannot find URL '%1' via protocol HTTP(S). Server returned code %2.autoinstcode-W(Zftp4[8&\ (]&&&&codecode, SCR::Read .target.size4^8&_=-`4c8,d   y2error   Can't find URL: %1&f=   sformat   ?Cannot find URL '%1' via protocol FTP. Server returned code %2.autoinstcode-g(jfile4kfile 8$l   sformat   %1/%2(m SCR::Read .target.size4ncpcmd 8$o   sformat   cp %1 %2,p    y2milestone   Copy profile: %1,q SCR::Execute .target.bash4tcpcmd 8&u=+   =   sformat   Reading file on %1/%2 failed. autoinst$v   sformat   cp %1 %2,w    y2milestone   Copy profile: %1,x SCR::Execute .target.bash({ SCR::Read .target.size4|8&}=&~48&=+   =   sformat   Reading file on %1 failed. autoinst,    y2milestone   -Trying to find file on installation media: %1(cd4cdrom 8$  SCR::Read.etc.install_inf.Cdrom(! WFM::Execute .local.mount+   /dev/48&=+   =   sformat   Mounting %1 failed.autoinst,    y2warning    Mount failed4cpcmd 8$   sformat   +   +   cp /%1 %2,    y2milestone   Copy profile: %1, SCR::Execute .target.bash, WFM::Execute .local.umount( SCR::Read .target.size48&=-&=+   =   sformat   )Reading a file on CD failed. Path: %1/%2.autoinst&(nfs4copyCmd 8(nfs48,    y2milestone   Starting portmap: %1 SCR::Execute .target.bash /sbin/portmap(&&! SCR::Execute .target.mount+   +   :? -o nolock! SCR::Execute .target.mount+   +   :?-t nfs448,    y2warning    Mount failed&=   sformat   Mounting %1 failed.autoinst+   +   :?-$+   +   +   +   +   /bin/cp /> ,    y2milestone   Copy Command: %1( WFM::Execute .local.bash48&=&48&=   sformat   "Remote file %1 cannot be retrievedautoinst+   +   />,   y2error   !remote file %1 can't be retrieved+   +   />, WFM::Execute .local.umount(||floppyusb48(&& floppy48, WFM::Execute .local.mount ( WFM::Execute .local.bash+   +   +   +   +   /bin/cp / 48,   y2error   file %1 can't be retrieved+   +   /48&=&, SCR::Execute.target.umount4probe8,    y2milestone   looking for %1 on USB$ SCR::Read .probe.usb,  foreachd8 8(&& busUSBSCSIhaskeydev_name4idev 8$$ dev_name)|| SCR::Read .target.lstat 4mounts  mount_list already_mounted8 $  SCR::Read.target.string /proc/mounts$    splitstring    $,    foreachm 8 entries 8$    splitstring    ( 48&& .,    y2milestone    already mounted=%1 mountpoint=%2(&&!! WFM::Execute .local.mount48,    y2milestone   mount failed for %1&+&+    dev_name   sformat   %1/( WFM::Execute .local.bash+   +   +   +   +   /bin/cp / 48,    y2milestone   not found on %148,    y2milestone    found on %1&=&(!, SCR::Execute.target.umount(.&+&+    dev_name   sformat   %1(.(device48(&&4mounts  mount_list already_mounted8 )  SCR::Read .target.dir+   /dev/4 l 8,    y2milestone   nested device found$    splitstring   /&+   +   / &  remove&    mergestring   /,    y2milestone   Host=%1 Path=%2$  SCR::Read.target.string /proc/mounts$    splitstring    $,    foreachm 8 entries 8$    splitstring    ( +   /dev/48&& .,"    y2milestone    already mounted=%1 mountpoint=%2(#!,$ WFM::Execute .local.mount   sformat   /dev/%1(' WFM::Execute .local.bash+   +   +   +   +   /bin/cp / 4(8&*=   sformat   File %1 cannot be foundautoinst+   ,+   y2error   file %1 can't be found+   4.8&/=&0(2!,3 WFM::Execute .local.umount(6tftp478(8 498&:=&;4>8&?=   sformat   'Cannot find URL '%1' via protocol TFTP.autoinst+   +   :,@   y2error   file %1 can't be found4D8&F=   sformat   Unknown protocol %1.autoinst,G   y2error   Protocol not supported&H-J%QAurl target 8toks8&S"$T"-U@ scheme host path2AutoinstConfig.ycp%BresultcmdLine $ $( size 4&(default4'schemefile'path /autoinst.xml4&&,( scheme4&addschemefloppy&addpath /autoinst.xml&"&# "schemedefault&$ "host&% "path&' "port&( "user&) "pass(||||#default#file#floppy4&4,    y2milestone    urltok = %1"-%C(#floppy4&-$Retrieving control file from floppy.autoinst(#tftp4&-   sformat   2Retrieving control file (%1) from TFTP server: %2.autoinst%$(#nfs4& -   sformat   1Retrieving control file (%1) from NFS server: %2.autoinst%$( #http4 & -   sformat   2Retrieving control file (%1) from HTTP server: %2.autoinst%$(#ftp4&-   sformat   1Retrieving control file (%1) from FTP server: %2.autoinst%$(#file4&-   sformat   #Copying control file from file: %1.autoinst%(#device4&-   sformat   *Copying control file from device: /dev/%1.autoinst%(#default4&-+Copying control file from default location.autoinst4 &!-Source unknown.autoinst-#%+D,.    y2milestone   Saving configuration data,0 SCR::Write!.sysconfig.autoinstall.REPOSITORY ,1 SCR::Write .sysconfig.autoinstall.CLASS_DIR-3%:Eires $;$<)> size 4>c $?   substring  (@||||||"$\`&A+   \&B+   &C+-E%LF(N||4O autoinstall$P SCR::Read.etc.install_inf.AutoYaST(Q&& 4R,SB ,T    y2milestone    cmd line=%1,UC(X4Y tmp_dontmerge tmp_no_writenow &[ !.sysconfig.autoinstall.REPOSITORY /var/lib/autoinstall/repository/&\ .sysconfig.autoinstall.CLASS_DIR+    /classes$]%.sysconfig.autoinstall.XSLT_DONTMERGE addon,conf$^&.sysconfig.autoinstall.FORBID_WRITENOW;add-on,suse_register,partitioning,bootloader,general,report&`.    splitstring   ,&a/    splitstring   ,(d||  4e&f /var/lib/autoinstall/repository-o%rG main_help $s+   +   

AutoYaST Configuration Management System

Almost all resources of the control file can be configured using the configuration management system.

autoinst

Most of the modules used to create the configuration are identical to those available through the YaST2 Control Center. Instead of configuring this system, the data entered is collected and exported to the control file that can be used to install another system using AutoYaST.

autoinst

In addition to the existing and familiar modules, new interfaces were created for special and complex configurations, including partitioning, general options, and software.

autoinst-0707010006A4A1000081A40000018F0000018F000000014F1036760000297E000000080000000100000000000000000000004B00000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/AutoinstConfig.ycp/** * File: modules/AutoinstConfig.ycp * Module: Auto-Installation * Summary: This module handles the configuration for auto-installation * Authors: Anas Nashif * * $Id: AutoinstConfig.ycp 62507 2010-09-30 08:49:54Z jsrain $ */ { module "AutoinstConfig"; textdomain "autoinst"; import "Misc"; import "Mode"; import "Installation"; import "URL"; include "autoinstall/xml.ycp"; global string runModule = ""; // Profile Repository global string Repository = ""; global boolean ProfileEncrypted = false; global string ProfilePassword = ""; // Package Repository global string PackageRepository = ""; // Classes global string classDir = ""; // Current file name global string currentFile = ""; // // Temporary directory for storing profile before installation starts // global string tmpDir = (string)SCR::Read( .target.tmpdir ); // // Main directory for data generated during installation // global string var_dir = "/var/adm/autoinstall"; // // Directory for the pre/post and chroot scripts // global string scripts_dir = var_dir + "/scripts"; global string initscripts_dir = var_dir + "/init.d"; // // Directory where log files of pre/post and chroot scripts are kept // global string logs_dir = var_dir + "/logs"; // // Destination dir // global string destdir = Installation::destdir; // // Cache directory // global string cache = var_dir + "/cache"; // // Temporary file name for retrieved system profile // global string xml_tmpfile = tmpDir + "/autoinst.xml"; // // Final location for retrieved system profile // global string xml_file = cache + "/installedSystem.xml"; // // Direcotry for runtime operation data // global string runtime_dir = "/var/lib/autoinstall"; // // Directory where complete configuration files are kept. // global string files_dir = var_dir + "/files"; // // Directory to store profile for possible user manipulation. // global string profile_dir = "/tmp/profile"; // // The user modified version of the Profile // global string modified_profile = profile_dir + "/modified.xml"; global string autoconf_file = runtime_dir + "/autoconf/autoconf.xml"; // // Parsed data from XML control in YCP format // global string parsedControlFile = cache + "/autoinst.ycp"; global string remote_rules_location = "rules/rules.xml"; global string local_rules_location = tmpDir + "/rules"; global string local_rules_file = local_rules_location + "/rules.xml"; // Data from command line global map urltok = $[]; global string scheme = ""; global string host = ""; global string filepath = ""; global string directory = ""; global string port = ""; global string user = ""; global string pass = ""; // // Default runlevel // global string default_rl = "5"; // // Confirm installation // global boolean Confirm = true; global string OriginalURI = ""; global string message = ""; // Class merging. // lists not to be merged, instead they will be "added" // global list dontmerge = []; // the "writo setting now" button is disabled for there modules // // global list noWriteNow = []; // // Halt after initial phase // global boolean Halt = false; // // Dont Hard Reboot // global boolean ForceBoot = false; // // Show Reboot Message // global boolean RebootMsg = false; // // AutoYaST profile is stored in the root partition (for upgrade) // global boolean ProfileInRootPart = false; // // remote profile (invented for pre-probing of s390) // in case of a remote profile, the profile can be fetched // before the probing stage DASD module can has run // global boolean remoteProfile = true; global list Proposals = []; global list getProposalList() { return Proposals; } global void setProposalList(list l) { Proposals = l; } include "autoinstall/io.ycp"; /** * Return location of profile from command line. * @return map with protocol, server, path * @example autoyast=http://www.server.com/profiles/ */ global define boolean ParseCmdLine (string autoinstall) ``{ import "URL"; map result = $[]; string cmdLine = ""; if (size(autoinstall) > 0 ) { cmdLine = autoinstall; if (cmdLine == "default") { result["scheme"] = "file"; result["path"] = "/autoinst.xml"; } else { result = URL::Parse (cmdLine); OriginalURI = cmdLine; } } if (result["scheme"]:"" == "") { // Autoinstall mode was not activated from command line. // There must be a floppy with an 'autoinst.xml' in order // to be able to reach this point, so we set floppy with // autoinst.xml as the control file. result = add(result, "scheme", "floppy"); result = add(result, "path","/autoinst.xml"); } urltok = result; scheme = urltok["scheme"]:"default"; host = urltok["host"]:""; filepath = urltok["path"]:""; port = urltok["port"]:""; user = urltok["user"]:""; pass = urltok["pass"]:""; if( scheme == "default" || scheme == "file" || scheme == "floppy" ) { remoteProfile = false; } y2milestone("urltok = %1", urltok ); return true;; } /** * SetProtocolMessage () * @return void */ global define void SetProtocolMessage () ``{ if (scheme == "floppy") { message = _("Retrieving control file from floppy."); } else if (scheme == "tftp") { message = sformat ( _("Retrieving control file (%1) from TFTP server: %2."), filepath, host ); } else if (scheme == "nfs") { message = sformat ( _("Retrieving control file (%1) from NFS server: %2."), filepath, host ); } else if (scheme == "http") { message = sformat ( _("Retrieving control file (%1) from HTTP server: %2."), filepath, host ); } else if (scheme == "ftp") { message = sformat ( _("Retrieving control file (%1) from FTP server: %2."), filepath, host ); } else if (scheme == "file") { message = sformat ( _("Copying control file from file: %1."), filepath); } else if (scheme == "device") { message = sformat ( _("Copying control file from device: /dev/%1."), filepath ); } else if (scheme == "default") { message = _("Copying control file from default location."); } else { message = _("Source unknown."); } return; } /** * Save Configuration global settings * @return void */ global define void Save () ``{ // Write sysconfig variables. y2milestone("Saving configuration data"); SCR::Write( .sysconfig.autoinstall.REPOSITORY, Repository ); SCR::Write( .sysconfig.autoinstall.CLASS_DIR, classDir); return; } /** * escape a string so it can be passed to a shell * @return escaped string string */ global define string ShellEscape( string s ) ``{ integer i = 0; string res = ""; while( iAutoYaST Configuration Management System

Almost all resources of the control file can be configured using the configuration management system.

") + _("

Most of the modules used to create the configuration are identical to those available through the YaST2 Control Center. Instead of configuring this system, the data entered is collected and exported to the control file that can be used to install another system using AutoYaST.

") + _("

In addition to the existing and familiar modules, new interfaces were created for special and complex configurations, including partitioning, general options, and software.

"); return main_help; } } 0707010006A4A7000081A40000018F0000018F000000014F10367600001CF6000000080000000100000000000000000000004800000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/IscsiClient.ycp/** * File: modules/IscsiClient.ycp * Package: Configuration of iscsi-client * Summary: IscsiClient settings, input and output functions * Authors: Michal Zugec * * $Id: IscsiClient.ycp 62753 2010-11-05 06:56:22Z jsrain $ * * Representation of the configuration of iscsi-client. * Input and output routines. */ { module "IscsiClient"; textdomain "iscsi-client"; import "Progress"; import "Report"; import "Summary"; import "Message"; import "Service"; import "Package"; import "Packages"; import "Popup"; import "Mode"; import "Confirm"; import "Label"; import "NetworkService"; import "IscsiClientLib"; import "Stage"; global boolean configured = false; /** * Prototypes */ global boolean Modified(); /** * Data was modified? */ global boolean modified = false; /** */ global boolean proposal_valid = false; /** * Write only, used during autoinstallation. * Don't run services and SuSEconfig, it's all done at one place. */ global boolean write_only = false; /** * Abort function * return boolean return true if abort */ global boolean() AbortFunction = Modified; /** * Abort function * @return boolean return true if abort */ global define boolean Abort() ``{ if(AbortFunction != nil) { return AbortFunction () == true; } return false; } /** * Data was modified? * @return true if modified */ global boolean Modified() { y2debug("modified=%1",modified); return modified; } // check if package open-iscsi is installed boolean installed_packages(){ // don't check interactively for packages (bnc#367300) // skip it during second stage or when create AY profile if(Stage::cont() || Stage::initial() || Mode::config()) return true; y2milestone("Check if open-iscsi package installed"); boolean ret = false; if( !Package::InstallMsg( "open-iscsi", _("

To configure the iSCSI initiator, the %1 package must be installed.

") + _("

Install it now?

")) ) { Popup::Error( Message::CannotContinueWithoutPackagesInstalled() ); } else ret = true; return ret; } /** * Dump the iscsi-client settings to a single map * (For use by autoinstallation.) * @return map Dumped settings (later acceptable by Import ()) */ global map Export () { list tgets = []; foreach(string sess, IscsiClientLib::sessions, { string target = splitstring(sess, " ")[1]:""; string portal = splitstring(sess, " ")[0]:""; IscsiClientLib::currentRecord = [portal, target]; map auth = IscsiClientLib::getNode(); map new_target = $["target": target, "portal" : portal, "startup" : IscsiClientLib::getStartupStatus(), ]; if (auth["authmethod"]:"None"=="None") new_target["authmethod"]="None"; else new_target = union(new_target, auth); tgets = add(tgets, new_target); }); map result = $[ "version" : "1.0", "initiatorname" : IscsiClientLib::initiatorname, "targets" : tgets ]; configured = true; modified = true; return result; } /** * Read all iscsi-client settings * @return true on success */ global boolean Read() { /* IscsiClient read dialog caption */ string caption = _("Initializing iSCSI Initiator Configuration"); // TODO FIXME Set the right number of stages integer steps = 4; integer sl = 500; sleep(sl); // TODO FIXME Names of real stages // We do not set help text here, because it was set outside Progress::New( caption, " ", steps, [ /* Progress stage 1/3 */ _("Read the database"), /* Progress stage 2/3 */ _("Read the previous settings"), /* Progress stage 3/3 */ _("Detect the devices") ], [ /* Progress step 1/3 */ _("Reading the database..."), /* Progress step 2/3 */ _("Reading the previous settings..."), /* Progress step 3/3 */ _("Detecting the devices..."), /* Progress finished */ _("Finished") ], "" ); // check if user is root - must be root if(!Confirm::MustBeRoot()) return false; if(!NetworkService::RunningNetworkPopup()) return false; Progress::NextStage(); if(false) return false; sleep(sl); if(IscsiClientLib::getiBFT()==nil) return false; /* Progress finished */ Progress::NextStage(); sleep(sl); Progress::NextStage(); // check if required package is installed if(!installed_packages()) return false; // check initiatorname - create it if no exists y2milestone("Check initiator name"); if(!IscsiClientLib::checkInitiatorName()) return false; sleep(sl); if(Abort()) return false; // Progress::NextStep(); // read status of service if(!IscsiClientLib::getServiceStatus()) return false; sleep(sl); // read current settings // if(!IscsiClientLib::autoLogOn()) return false; Progress::NextStage(); // read config file if(IscsiClientLib::readSessions()==false) { Report::Error( Message::CannotReadCurrentSettings() ); return false; } sleep(sl); if(Abort()) return false; modified = false; return true; } /** * Write all iscsi-client settings * @return true on success */ global boolean Write() { /* IscsiClient read dialog caption */ string caption = _("Saving iSCSI Initiator Configuration"); // TODO FIXME And set the right number of stages integer sl = 500; sleep(sl); list descr = [ /* Progress stage 1/2 */ _("Write the autoYaST settings"), /* Progress stage 2/2 */ _("Set up service status") ]; if (!(Mode::autoinst() || Mode::autoupgrade())) descr=remove(descr, 0); // TODO FIXME Names of real stages // We do not set help text here, because it was set outside Progress::New(caption, " ", size(descr), descr, [], ""); if (Mode::autoinst() || Mode::autoupgrade()){ if(Abort()) return false; Progress::NextStage(); IscsiClientLib::autoyastPrepare(); IscsiClientLib::autoyastWrite(); sleep(sl); } if(Abort()) return false; Progress::NextStage (); // set open-iscsi service status if(!IscsiClientLib::setServiceStatus()) return false; sleep(sl); if(Abort()) return false; Progress::NextStage(); if (Stage::initial() && size(IscsiClientLib::sessions)>0 ) Packages::addAdditionalPackage("open-iscsi"); sleep(sl); return true; } /** * Get all iscsi-client settings from the first parameter * (For use by autoinstallation.) * @param settings The YCP structure to be imported. * @return boolean True on success */ global boolean Import (map settings) { IscsiClientLib::ay_settings = settings; return true; } /** * Create a textual summary and a list of unconfigured cards * @return summary of the current configuration */ global list Summary() { // TODO FIXME: your code here... /* Configuration summary text for autoyast */ return [ _("Configuration summary..."), [] ]; } /** * Create an overview table with all configured cards * @return table items */ global list Overview() { // TODO FIXME: your code here... return []; } /** * Return packages needed to be installed and removed during * Autoinstallation to insure module has all needed software * installed. * @return map with 2 lists. */ global map AutoPackages() { // TODO FIXME: your code here... return $[ "install":[], "remove":[] ]; } /* EOF */ } 0707010006A4AB000081A40000018F0000018F000000014F10367600001544000000080000000100000000000000000000004100000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/Mode.ycp/** * File: modules/Mode.ycp * Module: yast2 * Summary: Installation mode * Authors: Klaus Kaempf * Flags: Stable * * $Id: Mode.ycp 62171 2010-06-29 13:29:06Z jsrain $ * * Provide installation mode information. * Mostly values from /etc/install.inf * See linuxrc documentation for detailed docs about this. */ { module "Mode"; textdomain "base"; /** * Current mode */ string _mode = nil; /** * Current testing mode */ string _test = nil; /** * We do one automatic check whether _test should be set to testsuite. */ boolean test_autochecked = false; /** * Current UI mode */ string _ui = "dialog"; /** * initialize everything from command-line of y2base */ global void Initialize () { _mode = "normal"; _test = "none"; integer arg_count = size(WFM::Args()); integer arg_no = 0; while ( arg_no < arg_count ) { // parsing for main mode if (WFM::Args(arg_no) == "initial" || WFM::Args(arg_no) == "continue" || WFM::Args(arg_no) == "firstboot") { _mode = "installation"; } // parsing for test mode else if (WFM::Args(arg_no) == "test" || WFM::Args(arg_no) == "demo") { _test = "test"; y2warning("***** Test mode enabled *****"); } else if (WFM::Args(arg_no) == "screenshots" ) { _test = "screenshot"; y2warning("***** Screen shot mode enabled *****"); } arg_no = arg_no + 1; } // only use the /etc/install.inf agent when file is present // and installation is being processed // FIXME remove the part below and let it be set in clients if (_mode == "installation" && SCR::Read (.target.size, "/etc/install.inf") != -1) { boolean autoinst = SCR::Read (.etc.install_inf.AutoYaST) != nil; if (autoinst) { _mode="autoinstallation"; } boolean repair = SCR::Read (.etc.install_inf.Repair ) != nil; if (repair) { _mode ="repair"; } // FIXME FIXME FIXME this is a hack for DUD only _mode = "autoupgrade"; } } // main mode definitions /** * Returns the current mode name. It's one of * "installation", "normal", "update", "repair", "autoinstallation", "autoinst_config" */ global string mode () { if (_mode == nil) { Initialize (); } return _mode; } global void SetMode (string new_mode) { if (_mode == nil) Initialize (); if (! contains ( [ "installation", "update", "normal", "repair", "autoinstallation", "autoinst_config", "live_installation", "autoupgrade" ], new_mode)) { y2error ("Unknown mode %1", new_mode); } y2milestone ("setting mode to %1", new_mode); _mode = new_mode; } global boolean commandline(); // test mode definitions global string testMode () { if (_test == nil) Initialize (); if (!test_autochecked) { // bnc#243624#c13: Y2ALLGLOBAL is set by yast2-testsuite/skel/runtest.sh if (getenv ("Y2MODETEST") != nil || getenv ("Y2ALLGLOBAL") != nil) { _test = "testsuite"; } test_autochecked = true; } return _test; } global void SetTest (string new_test_mode) { if (_test == nil) Initialize (); if (! contains ( [ "none", "test", "demo", "screenshot", "testsuite", ], new_test_mode)) { y2error ("Unknown test mode %1", new_test_mode); } _test = new_test_mode; } // UI mode definitions /** * Returns the current UI mode. * It's one of "commandline", "dialog", "none" */ global string ui () { return _ui; } global void SetUI (string new_ui) { if (! contains ( [ "commandline", "dialog", "none", ], new_ui)) { y2error ("Unknown UI mode %1", new_ui); } _ui = new_ui; } // main mode wrappers /** * we're doing a fresh installation */ global boolean installation () { return mode () == "installation" || mode () == "autoinstallation" || mode () == "live_installation"; } /** * we're doing a fresh installation from live CD/DVD */ global boolean live_installation () { return mode () == "live_installation"; } /** * we're doing an update */ global boolean update () { return mode () == "update" || mode () == "autoupgrade"; } global boolean Depeche () { return true; } /** * normal, running system */ global boolean normal () { return mode () == "normal"; } /** * start repair module */ global boolean repair () { return mode () == "repair"; } /** * doing auto-installation */ global boolean autoinst () { return mode () == "autoinstallation"; } /** * doing auto-upgrade */ global boolean autoupgrade () { return mode () == "autoupgrade"; } /** * configuration for auto-installation, only in running system */ global boolean config () { return mode () == "autoinst_config"; } // test mode wrappers /** * Just testing. * See installation/Test-Scripts/doit* */ global boolean test () { return testMode () == "test" || testMode () == "screenshot" || testMode () == "testsuite"; } /** * dump screens to /tmp. Implies @ref #demo . * See installation/Test-Scripts/yast2-screen-shots* */ global boolean screen_shot () { return testMode () == "screenshot"; } /** * Returns whether running in testsuite. */ global boolean testsuite () { return testMode () == "testsuite"; } // UI mode wrappers /** * we're running in command line interface * @return true if command-line is running */ global boolean commandline () { return ui () == "commandline"; } } // EOF 0707010006A4A2000081A40000018F0000018F000000014F10367600002233000000080000000100000000000000000000004A00000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/ModuleLoading.ybcYaST bytecode 1.4.0 ModuleLoading ModuleLoading.ycp ModeLabelIcon vendor_name  device_name prepareVendorDeviceInfobroken_modules MarkedAsBroken  Load      controller  l modulename  moduleargs  vendorname  devicename ask_before_loading with_modprobe 3UI UserInput OpenDialog   CloseDialog QueryWidget  SetFocus 3SCRReadExecute0base3Modeautoinst autoupgradetest3Label CancelButton OKButton 3IconSimple  $$%controller_vendor controller_device $% vendor  sub_vendor(&4'controller_sub_vendor $(  sub_vendor()4*&++   +   +    ()$4 device  sub_device(546controller_sub_device $7  sub_device(849&:+   +   +    ()-A$G%Omod (P4Qbms $R  SCR::Read.etc.install_inf.BrokenModules(S4T&U&W    splitstring    -Z  contains%l  load_success(p&&!4uloaded_modules$w SCR::Read .proc.modules(xsize 4y-{ok(4,    y2milestone   In BrokenModules, skipping: %1-dont(&&&&!!4ret , opt decoratedcenteredHBoxHSpacingHCenterHSquashVBoxHCenterHSquashVBoxHBoxquestionHeadingConfirm driver activationbaseHStretchVSpacing0.2LeftLabel#YaST2 detected the following devicebaseLeftLabelLeftLabelVSpacing0.1Left InputFieldidmod_nameopthstretch&Driver/Module to loadbase+   +     ButtonBox PushButtonidok_msgoptdefaultokButtonkey_F10 PushButtonid cancel_msgopt cancelButtonkey_F9VSpacing0.2HSpacing,idok_msg$  ( ok_msg4 module_data $  idmod_nameValue( size  4 firstspace$   findfirstnotof    ( 4&    substring    &    findfirstof    ( 4& &4&   substring    &   substring   + ,(  cancel_msg4,    y2milestone   NOT loaded module %1 %2-dont$(4& SCR::Execute.target.modprobe4& SCR::Execute.target.insmod(&,    y2milestone   Loaded module %1 %2 %3OkFailed-okfail0707010006A4C2000081A40000000000000000000000014F1036C400007260000000080000000100000000000000000000004C00000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/AutoinstScripts.ycp/** * File: modules/AutoinstScripts.ycp * Module: Auto-Installation * Summary: Custom scripts * Authors: Anas Nashif * * $Id: AutoinstScripts.ycp 65507 2011-09-01 15:13:01Z ug $ */ { module "AutoinstScripts"; textdomain "autoinst"; import "Mode"; import "AutoinstConfig"; import "Summary"; import "URL"; import "Service"; import "Popup"; import "Label"; include "autoinstall/io.ycp"; /* Pre scripts */ global list pre = []; /* Post scripts */ global list post = []; /* Chroot scripts */ global list chroot = []; /* Init scripts */ global list init = []; /* Merged scripts */ global list merged = []; /* default value of settings modified */ global boolean modified = false; /** * Function sets internal variable, which indicates, that any * settings were modified, to "true" */ global define void SetModified () { modified = true; } /** * Functions which returns if the settings were modified * @return boolean settings were modified */ global define boolean GetModified () { return modified; } /** * merge all types of scripts into one single list * @param - * @return merged list */ list mergeScripts () { list result = maplist (map p, pre, ``{ p = add(p,"type","pre-scripts"); return p; }); result = (list)union(result, maplist (map p, post, ``{ p = add(p,"type","post-scripts"); return p; }) ); result = (list)union(result, maplist (map p, chroot, ``{ p = add(p,"type","chroot-scripts"); return p; }) ); result = (list)union(result, maplist (map p, init, ``{ p = add(p,"type","init-scripts"); return p; }) ); return result; } /** * Constructor */ define void AutoinstScripts() { if ( !Mode::autoinst () ) { merged = mergeScripts(); } } /** * Dump the settings to a map, for autoinstallation use. * @return map */ global define map Export() { pre = []; post = []; chroot = []; init = []; y2milestone("Merged %1", merged); // split foreach(map s, merged, ``{ if (s["type"]:"" == "pre-scripts") pre = add(pre,s); else if (s["type"]:"" == "post-scripts") post = add(post,s); else if (s["type"]:"" == "init-scripts") init = add(init,s); else if (s["type"]:"" == "chroot-scripts") chroot = add(chroot,s); }); // clean list expre = maplist (map p, pre, ``{ return ($["filename":p["filename"]:"", "interpreter": p["interpreter"]:"", "source":p["source"]:"", "location":p["location"]:"", "feedback":p["feedback"]:false, "notification":p["notification"]:"", "debug":p["debug"]:true ]); }); list expost = maplist (map p, post, ``{ return ($["filename":p["filename"]:"", "interpreter": p["interpreter"]:"", "source":p["source"]:"", "location":p["location"]:"", "feedback":p["feedback"]:false, "debug":p["debug"]:true, "notification":p["notification"]:"", "network_needed":p["network_needed"]:false ] ); }); list exchroot = maplist (map p, chroot, ``{ return ($["filename":p["filename"]:"", "interpreter": p["interpreter"]:"", "source":p["source"]:"", "chrooted":p["chrooted"]:false, "location":p["location"]:"", "feedback":p["feedback"]:false, "notification":p["notification"]:"", "debug":p["debug"]:true ]); }); list exinit = maplist (map p, init, ``{ return ($["filename":p["filename"]:"", "source":p["source"]:"", "location":p["location"]:"", "debug":p["debug"]:true ]); }); map result = $[]; if (size(expre) > 0 ) result["pre-scripts"] = expre; if (size(expost) > 0 ) result["post-scripts"] = expost; if (size(exchroot) > 0 ) result["chroot-scripts"] = exchroot; if (size(exinit) > 0 ) result["init-scripts"] = exinit; return result; } global define list Resolve_relurl( list d ) { d = maplist (map script , d, ``{ if( issubstring( script["location"]:"", "relurl://" ) ) { string l = script["location"]:""; l = substring ( l, 9 ); string newloc = ""; if( AutoinstConfig::scheme == "relurl" ) { y2milestone("autoyast profile was relurl too"); newloc = (string)SCR::Read(.etc.install_inf.ayrelurl); map tok = URL::Parse(newloc); y2milestone("tok = %1", tok); newloc = tok["scheme"]:"" + "://" + tok["host"]:"" + "/" + dirname(tok["path"]:"") + l; } else { newloc = AutoinstConfig::scheme + "://" + AutoinstConfig::host + "/" + AutoinstConfig::directory + l; } script["location"] = newloc; y2milestone("changed relurl to %1 for script", newloc); } return script; }); return d; } /** * Get all the configuration from a map. * When called by autoinst_ (preparing autoinstallation data) * the map may be empty. * @param settings $[...] * @return success */ global define boolean Import(map s) { y2debug("Calling AutoinstScripts::Import()"); pre = s["pre-scripts"]:[]; init = s["init-scripts"]:[]; post = s["post-scripts"]:[]; chroot = s["chroot-scripts"]:[]; pre = Resolve_relurl(pre); init = Resolve_relurl(init); post = Resolve_relurl(post); chroot = Resolve_relurl(chroot); merged = mergeScripts(); y2debug("merged: %1", merged); return true; } /** * Return Summary * @return string summary */ global define string Summary() { string summary = ""; summary = Summary::AddHeader(summary, _("Preinstallation Scripts")); if (size( pre) > 0 ) { summary = Summary::OpenList(summary); foreach(map script, pre, ``{ summary = Summary::AddListItem(summary, script["filename"]:"" ); }); summary = Summary::CloseList(summary); } else { summary = Summary::AddLine(summary, Summary::NotConfigured()); } summary = Summary::AddHeader(summary, _("Postinstallation Scripts")); if (size( post) > 0) { summary = Summary::OpenList(summary); foreach(map script, post, ``{ summary = Summary::AddListItem(summary, script["filename"]:"" ); }); summary = Summary::CloseList(summary); } else { summary = Summary::AddLine(summary, Summary::NotConfigured()); } summary = Summary::AddHeader(summary, _("Chroot Scripts")); if (size( chroot) > 0 ) { summary = Summary::OpenList(summary); foreach(map script, chroot, ``{ summary = Summary::AddListItem(summary, script["filename"]:"" ); }); summary = Summary::CloseList(summary); } else { summary = Summary::AddLine(summary, Summary::NotConfigured()); } summary = Summary::AddHeader(summary, _("Init Scripts")); if (size( init) > 0 ) { summary = Summary::OpenList(summary); foreach(map script, init, ``{ summary = Summary::AddListItem(summary, script["filename"]:"" ); }); summary = Summary::CloseList(summary); } else { summary = Summary::AddLine(summary, Summary::NotConfigured()); } return summary; } /** * delete a script from a list * @param script name * @return void */ global define void deleteScript(string scriptName) { list clean = filter(map s, merged, ``(s["filename"]:"" != scriptName)); merged = clean; return; } /** * Add or edit a script * @param scriptName script name * @param source source of script * @param interpreter interpreter to be used with script * @param type type of script * @return void */ global define void AddEditScript(string scriptName, string source, string interpreter, string type, string notification, boolean chrooted, boolean debug, boolean feedback, boolean network ) { boolean mod = false; merged = maplist (map script , merged, ``{ // Edit if (script["filename"]:"" == scriptName) { map oldScript = $[]; oldScript=add(oldScript,"filename", scriptName); oldScript=add(oldScript,"source", source); oldScript=add(oldScript,"interpreter", interpreter); oldScript=add(oldScript,"type", type); oldScript=add(oldScript,"chrooted", chrooted); oldScript=add(oldScript,"debug",debug); oldScript=add(oldScript,"feedback",feedback); oldScript=add(oldScript,"network_needed",network); oldScript=add(oldScript,"notification", notification); mod = true; return oldScript; } else { return script; } }); if (!mod) { map script = $[]; script=add(script,"filename", scriptName); script=add(script,"source", source); script=add(script,"interpreter", interpreter); script=add(script,"type", type); script=add(script,"chrooted", chrooted); script=add(script,"debug",debug); script=add(script,"feedback",feedback); script=add(script,"network_needed",network); script=add(script,"notification", notification); merged=add(merged,script); } y2debug("Merged scripts: %1", merged); return; } /** * return type of script as formatted string * @param script type * @return string type as translated string */ global define string typeString(string type) { if (type == "pre-scripts") { return _("Pre"); } else if (type == "post-scripts") { return _("Post"); } else if (type == "init-scripts") { return _("Init"); } else if (type == "chroot-scripts") { return _("Chroot"); } return _("Unknown"); } /* bidirectional feedback during script execution Experimental */ define map splitParams( string s ) ``{ list l = splitstring( s, "|" ); map ret = $[]; l = remove( l, 0 ); foreach( string element, l, ``{ list p = splitstring( element, "=" ); ret[ p[0]:"" ] = p[1]:""; }); return ret; } define void interactiveScript( string shell, string debug, string scriptPath, string current_logdir, string scriptName ) ``{ map data = $[]; string widget = ""; SCR::Execute(.target.remove, "/tmp/ay_opipe"); SCR::Execute(.target.remove, "/tmp/ay_ipipe"); SCR::Execute(.target.bash, "mkfifo -m 660 /tmp/ay_opipe", $[]); SCR::Execute(.target.bash, "mkfifo -m 660 /tmp/ay_ipipe", $[]); string execute = sformat("%1 %2 %3 2&> %4/%5.log ", shell, debug, scriptPath, current_logdir, scriptName); SCR::Execute(.target.bash_background, "OPIPE=/tmp/ay_opipe IPIPE=/tmp/ay_ipipe "+execute, $[]); boolean run = true; boolean ok_button = false; term vbox = `VBox(); list buffer = []; while( SCR::Read(.target.lstat, "/tmp/ay_opipe") != $[] && run ) { data = (map)SCR::Execute (.target.bash_output, "cat /tmp/ay_opipe", $[]); buffer = splitstring( data["stdout"]:"", "\n" ); while( buffer != [] ) { string line = buffer[0]:""; buffer = remove( buffer, 0 ); if( size(line) == 0 ) continue; data["stdout"] = line; y2milestone("working on line %1", line); if( substring( data["stdout"]:"", 0, 8 ) == "__EXIT__" ) { if ( widget == "radiobutton" ) { vbox = add( vbox, `PushButton(`id(`ok), Label::OKButton() ) ); UI::OpenDialog( `RadioButtonGroup(`id(`rb), vbox) ); } if( ok_button == true ) { UI::ChangeWidget(`id(`ok) , `Enabled, true); any ret = UI::UserInput(); if( widget == "radiobutton" ) { any val = UI::QueryWidget(`id(`rb), `CurrentButton); SCR::Execute (.target.bash, sformat("echo \"%1\" > /tmp/ay_ipipe", AutoinstConfig::ShellEscape((string)val) ), $[]); } else if( widget == "entry" ) { any val = UI::QueryWidget(`id(`ay_entry), `Value); SCR::Execute (.target.bash, sformat("echo \"%1\" > /tmp/ay_ipipe", AutoinstConfig::ShellEscape((string)(val)) ), $[]); } ok_button = false; } vbox = `VBox(); if( widget == "" ) run = false; else UI::CloseDialog(); widget = ""; } else if( substring( data["stdout"]:"", 0, 12 ) == "__PROGRESS__" ) { map params = splitParams( data["stdout"]:"" ); UI::OpenDialog( `VBox( `ProgressBar(`id(`pr), params["label"]:"", tointeger(params["max"]:"100"), 0 ) ) ); widget = "progressbar"; } else if( substring( data["stdout"]:"", 0, 8 ) == "__TEXT__" ) { map params = splitParams( data["stdout"]:"" ); integer hspace = tointeger(params["width"]:"10"); integer vspace = tointeger(params["height"]:"20"); ok_button = haskey(params, "okbutton")?true:false; vbox = `VBox( `HSpacing(hspace), `HBox( `VSpacing(vspace), `RichText( `id( `mle ), "" ) ) ); if( ok_button == true ) vbox = add( vbox, `PushButton(`id(`ok), Label::OKButton() ) ); UI::OpenDialog( vbox ); if( ok_button == true ) UI::ChangeWidget(`id(`ok) , `Enabled, false); widget = "text"; } else if( substring( data["stdout"]:"", 0, 9 ) == "__ENTRY__" ) { map params = splitParams( data["stdout"]:"" ); if( haskey( params, "description" ) ) { vbox = add( vbox, `HSpacing(40) ); vbox = add( vbox, `RichText( params["description"]:"" ) ); } vbox = add( vbox, `TextEntry( `id(`ay_entry), params["label"]:"", params["default"]:"" ) ); vbox = add( vbox, `PushButton(`id(`ok), Label::OKButton() ) ); UI::OpenDialog( vbox ); widget = "entry"; ok_button = true; } else if( substring( data["stdout"]:"", 0, 15 ) == "__RADIOBUTTON__" ) { map params = splitParams( data["stdout"]:"" ); if( haskey( params, "description" ) ) { vbox = add( vbox, `HSpacing(60) ); vbox = add( vbox, `RichText( params["description"]:"" ) ); } widget = "radiobutton"; ok_button = true; } else { if( widget == "progressbar" ) { UI::ChangeWidget(`id(`pr), `Value, tointeger(data["stdout"]:"0") ); } else if( widget == "text" ) { UI::ChangeWidget(`id(`mle), `Value, (string)UI::QueryWidget(`id(`mle), `Value)+data["stdout"]:"" ); } else if( widget == "radiobutton" ) { if( substring( data["stdout"]:"", 0, 10 ) == "__BUTTON__" ) { map params = splitParams( data["stdout"]:"" ); vbox = add( vbox, `Left(`RadioButton(`id(params["val"]:""), params["label"]:"")) ); } else { y2milestone("*urgs* received '%1' instead of '__BUTTON__' during RADIOBUTTON creation",data["stdout"]:""); } } } }; }; SCR::Execute (.target.remove, "/tmp/ay_opipe"); SCR::Execute (.target.remove, "/tmp/ay_ipipe"); } /** * Execute pre scripts * @param string type of script * @param boolean if script should be executed in chroot env. * @return boolean true on success */ global define boolean Write( string type , boolean special) { if (!Mode::autoinst () && !Mode::autoupgrade () ) return true; list scripts = []; if (type == "pre-scripts") { scripts = pre; } else if (type == "init-scripts") { scripts = init; } else if ( type == "chroot-scripts" && !special) { scripts = filter(map s, chroot, ``(!s["chrooted"]:false)); } else if ( type == "chroot-scripts" && special) { scripts = filter(map s, chroot, ``(s["chrooted"]:false)); } else if (type == "post-scripts" && !special) { scripts = filter(map s, post, ``(!s["network_needed"]:false)); } else if (type == "post-scripts" && special) { scripts = filter(map s, post, ``(s["network_needed"]:false)); } else { y2error("Unsupported script type"); return false; } string tmpdirString = ""; string current_logdir = ""; if (type == "pre-scripts") { tmpdirString = sformat("%1/%2", AutoinstConfig::tmpDir, type); SCR::Execute (.target.mkdir, tmpdirString); current_logdir = sformat("%1/logs", tmpdirString); SCR::Execute (.target.mkdir, current_logdir); } else if (type == "chroot-scripts") { if( !special ) { tmpdirString = sformat("%1%2", AutoinstConfig::destdir, AutoinstConfig::scripts_dir); SCR::Execute (.target.mkdir, tmpdirString); current_logdir = sformat("%1%2", AutoinstConfig::destdir, AutoinstConfig::logs_dir); SCR::Execute (.target.mkdir, current_logdir); } else { tmpdirString = sformat("%1", AutoinstConfig::scripts_dir); SCR::Execute (.target.mkdir, tmpdirString); current_logdir = sformat("%1", AutoinstConfig::logs_dir); SCR::Execute (.target.mkdir, current_logdir); } } else { current_logdir = AutoinstConfig::logs_dir; } foreach( map s, scripts, ``{ string scriptInterpreter = s["interpreter"]:"shell"; string scriptName = s["filename"]:type; if (scriptName=="") { map t = URL::Parse(s["location"]:""); scriptName=basename(t["path"]:""); } string scriptPath = ""; if (type == "pre-scripts") { // y2milestone("doing /sbin/udevcontrol stop_exec_queue now to prevent trouble if one is doing partitioning in a pre-script"); // SCR::Execute( .target.bash, "/sbin/udevcontrol stop_exec_queue" ); scriptPath = sformat("%1/%2/%3", AutoinstConfig::tmpDir, type, scriptName); y2milestone("Writing pre script into %1", scriptPath); if (s["location"]:"" != "") { y2debug("getting script: %1", s["location"]:"" ); if (!GetURL(s["location"]:"", scriptPath ) ) { y2error("script %1 could not be retrieved", s["location"]:""); } } else { SCR::Write(.target.string, scriptPath, s["source"]:"echo Empty script!"); } } else if (type == "init-scripts") { scriptPath = sformat("%1/%2", AutoinstConfig::initscripts_dir, scriptName); y2milestone("Writing init script into %1", scriptPath); if (s["location"]:""!="") { y2debug("getting script: %1", s["location"]:"" ); if (!GetURL(s["location"]:"", scriptPath ) ) { y2error("script %1 could not be retrieved", s["location"]:""); } } else { SCR::Write(.target.string, scriptPath, s["source"]:"echo Empty script!"); } Service::Enable("autoyast"); } else if (type == "chroot-scripts") { //scriptPath = sformat("%1%2/%3", (special) ? "" : AutoinstConfig::destdir, AutoinstConfig::scripts_dir, scriptName); map toks = URL::Parse(s["location"]:""); if( toks["scheme"]:"" == "nfs" || !special ) { scriptPath = sformat("%1%2/%3",AutoinstConfig::destdir, AutoinstConfig::scripts_dir, scriptName); } else { scriptPath = sformat("%1/%2",AutoinstConfig::scripts_dir, scriptName); } y2milestone("Writing chroot script into %1", scriptPath); if (s["location"]:""!="") { if (!GetURL(s["location"]:"", scriptPath ) ) { y2error("script %1 could not be retrieved", s["location"]:""); } } else { SCR::Write(.target.string, scriptPath, s["source"]:"echo Empty script!"); } if( special && toks["scheme"]:"" == "nfs" ) { scriptPath = substring (scriptPath, 4); // cut off the /mnt for later execution } } else { // makes post-scripts with network_needed=true throwing an error (bnc#553284) //Pkg::SourceFinishAll(); //Pkg::TargetFinish(); scriptPath = sformat("%1/%2", AutoinstConfig::scripts_dir, scriptName); y2milestone("Writing script into %1", scriptPath); if (s["location"]:""!="") { if (!GetURL(s["location"]:"", scriptPath ) ) { y2error("script %1 could not be retrieved", s["location"]:""); } } else { SCR::Write(.target.string, scriptPath, s["source"]:"echo Empty script!"); } } if (type != "init-scripts") { // string message = sformat(_("Executing user supplied script: %1"), scriptName); string executionString = ""; boolean showFeedback = s["feedback"]:false; if( s["notification"]:"" != "" ) Popup::ShowFeedback( "", s["notification"]:"" ); if (scriptInterpreter == "shell") { string debug = ( s["debug"]:true ? "-x" : "" ); if( SCR::Read (.target.size, scriptPath+"-run" ) == -1 || s["rerun"]:false == true ) { if( s["interactive"]:false == true ) { interactiveScript( "/bin/sh", debug, scriptPath, current_logdir, scriptName ); } else { executionString = sformat("/bin/sh %1 %2 2&> %3/%4.log ", debug, scriptPath, current_logdir, scriptName); y2milestone("Script Execution command: %1", executionString ); SCR::Execute (.target.bash, executionString); SCR::Execute (.target.bash, "/bin/touch $FILE", $["FILE":scriptPath+"-run"]); } } } else if (scriptInterpreter == "perl") { string debug = ( s["debug"]:true ? "-w" : "" ); if( SCR::Read (.target.size, scriptPath+"-run" ) == -1 || s["rerun"]:false == true ) { if( s["interactive"]:false == true ) { interactiveScript( "/usr/bin/perl", debug, scriptPath, current_logdir, scriptName ); } else { executionString = sformat("/usr/bin/perl %1 %2 2&> %3/%4.log ", debug, scriptPath, current_logdir, scriptName); y2milestone("Script Execution command: %1", executionString ); SCR::Execute (.target.bash, executionString); SCR::Execute (.target.bash, "/bin/touch $FILE", $["FILE":scriptPath+"-run"]); } } } else if (scriptInterpreter == "python") { if( SCR::Read (.target.size, scriptPath+"-run" ) == -1 || s["rerun"]:false == true ) { if( s["interactive"]:false == true ) { interactiveScript( "/usr/bin/python", "", scriptPath, current_logdir, scriptName ); } else { executionString = sformat("/usr/bin/python %1 2&> %2/%3.log ", scriptPath, current_logdir, scriptName ); y2milestone("Script Execution command: %1", executionString ); SCR::Execute (.target.bash, executionString); SCR::Execute (.target.bash, "/bin/touch $FILE", $["FILE":scriptPath+"-run"]); } } } else { y2error("Unknown interpreter: %1", scriptInterpreter); } string feedback = ""; if( s["notification"]:"" != "" ) Popup::ClearFeedback(); if( executionString != "" ) { if( showFeedback ) { feedback = (string)SCR::Read(.target.string, current_logdir+"/"+scriptName+".log" ); } if( size(feedback) > 0 ) { Popup::LongText("", `RichText(`opt(`plainText), feedback), 50, 20 ); } } } }); return true; } } 0707010006A4A5000081A40000018F0000018F000000014F10367600001267000000080000000100000000000000000000004400000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/modules/Confirm.ycp/** * File: modules/Confirm.ycp * * Package: yast2 * * Summary: Confirmation routines * * Authors: Michal Svec * * Flags: Stable * * $Id: Confirm.ycp 62597 2010-10-12 09:23:09Z jsrain $ */ { module "Confirm"; textdomain "base"; import "Icon"; import "Label"; import "Mode"; import "Popup"; import "Linuxrc"; import "Stage"; import "Arch"; // #TODO bug number map detection_cache = $[]; /** * Confirm hardware detection (only in manual installation) * @param class hardware class (network cards) * @param icon_name name of the icon. If nil, generic hardware icon will be used * @return true on continue */ global boolean Detection(string class, string icon_name) { if(Linuxrc::manual () != true) return true; // L3: no interaction in AY, just re-probe (bnc#568653) if(Mode::autoinst () == true || Mode::autoupgrade() == true) return true; if(Arch::s390()) return true; if( icon_name == nil ) icon_name = "yast-hardware"; term icon = Icon::Image ( icon_name, $[] ); boolean result = detection_cache[class]:nil; if (result != nil) { y2milestone ("Detection cached result: %1 -> %2", class, result); return result; } UI::OpenDialog(`opt(`decorated), `HBox( `HSpacing(1), `HCenter(`HSquash(`VBox( `HCenter(`HSquash(`VBox( // Popup-Box for manual hardware detection. // If the user selects 'manual installation' when // booting from CD, YaST2 does not load any modules // automatically, but asks the user for confirmation // about every module. // The popup box informs the user about the detected // hardware and suggests a module to load. // The user can confirm the module or change // the suggested load command // // This is the heading of the popup box `Left(`Heading(_("Confirm Hardware Detection"))), `VSpacing(0.5), // This is in information message. Next come the // hardware class name (network cards). `HVCenter(`Label(_("YaST2 will detect the following hardware:"))), `HVCenter(`HBox(icon, `HSpacing(0.5), `Heading(class))), `VSpacing(0.5) ))), `ButtonBox ( `HWeight (1, `PushButton (`id(`continue), `opt(`default, `okButton), Label::ContinueButton())), /* PushButton label */ `HWeight (1, `PushButton (`id (`skip), `opt (`cancelButton), _("&Skip"))) ), `VSpacing(0.2) ))), `HSpacing(1) )); UI::SetFocus (`id(`continue)); // for autoinstallation popup has timeout 10 seconds (#192181) // timeout for every case (bnc#429562) any ret = UI::TimeoutUserInput(10*1000); // any ret = Mode::autoinst() ? UI::TimeoutUserInput(10*1000) : UI::UserInput(); UI::CloseDialog(); result = true; if(ret != `continue) { y2milestone("Detection skipped: %1", class); result = false; } detection_cache[class] = result; return result; } /* y2milestone("--%1", Detection("graphics cards")); Linuxrc::manual () = true; y2milestone("--%1", Detection("network cards")); y2milestone("--%1", Detection("modems")); */ /** * If we are running as root, return true. * Otherwise ask the user whether we should continue even though things * might not work * @return true if running as root */ global boolean MustBeRoot() { if ((integer)SCR::Read (.target.size, "/usr/bin/id") <= 0) { if (! Stage::initial ()) y2warning ("/usr/bin/id not existing, supposing to be root"); return true; } map out = (map) SCR::Execute (.target.bash_output, "/usr/bin/id --user"); boolean root = out["stdout"]:"" == "0\n"; if(root) return true; /* Message in a continue/cancel popup */ string pop = _("This module must be run as root. If you continue now, the module may not function properly. For example, some settings can be read improperly and it is unlikely that settings can be written.\n"); /* Popup headline */ if(Popup::ContinueCancelHeadline(_("Root Privileges Needed"), pop)) { y2error("NOT running as root!"); return true; } return false; } /** * Opens a popup yes/no confirmation. * If users confirms deleting, return true, * else return false * * @return boolean delete selected entry */ global boolean DeleteSelected() { return Popup::YesNo( /* Popup question */ _("Really delete selected entry?") ); } /** * Opens a popup yes/no confirmation. * If users confirms deleting of named entry/file/etc., * return true, else return false * * @param string file/entry name/etc. * @return boolean delete selected entry */ global boolean Delete(string delete) { return Popup::YesNo( /* Popup question, %1 is an item to delete (or filename, etc.) */ sformat(_("Really delete '%1'?"), delete) ); } /* EOF */ } 0707010006A4AC000041ED0000018F0000018F000000044F10367600000000000000080000000100000000000000000000003800000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/include0707010006A4AD000041ED0000018F0000018F000000024F10367600000000000000080000000100000000000000000000004500000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/include/installation0707010006A4AE000081A40000018F0000018F000000014F10367600001BAF000000080000000100000000000000000000005600000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/include/installation/inst_inc_all.ycp/** * File: include/installation/inst_inc_all.ycp * Module: System installation * Summary: Miscelaneous functions * Authors: Lukas Ocilka * * $Id:$ * */ { textdomain "installation"; import "ProductControl"; import "Label"; import "Linuxrc"; import "Wizard"; import "Arch"; import "Report"; import "Installation"; import "Stage"; import "Mode"; void SetInitializingUI () { // dialog content - busy message string ui_message = _("Initializing the installation environment..."); // help for the dialog - busy message string ui_help = _("

Initializing the installation...

"); // another texts for second stage if (Stage::cont()) { // dialog content - busy message ui_message = _("Preparing the 1st system configuration..."); // help for the dialog - busy message ui_help = _("

Please wait...

"); } Wizard::SetContents( // dialog caption _("Initializing..."), `Label(ui_message), ui_help, false, false ); Wizard::SetTitleIcon("yast-inst-mode"); } void SetUIContent () { // Wizard::OpenNextBackStepsDialog(); SetInitializingUI (); } void SetGlobalInstallationFeatures () { // FATE #304395: Disabling (or handling) screensaver during installation // Disabling screen-saver on startup if (WFM::Read (.local.size, "/usr/bin/xset") != -1) { y2milestone ("Disabling Energy Star (DPMS) features"); // DPMS off values, disable DPMS, disable screen-saver WFM::Execute (.local.bash, "/usr/bin/xset dpms 0 0 0; /usr/bin/xset -dpms; /usr/bin/xset s 0 0; /usr/bin/xset s off"); } } void FinishInstallation (symbol ret) { y2milestone("Finishing the installation..."); if (ret == `reboot || ret == `restart_yast || ret == `restart_same_step || ret == `abort) { // TRANSLATORS: busy message UI::OpenDialog (`Label(_("Writing YaST Configuration..."))); // #2 } else { // FATE #304395: Disabling (or handling) screensaver during installation // Enabling screen-saver on exit if (WFM::Read (.local.size, "/usr/bin/xset") != -1) { y2milestone ("Enabling Energy Star (DPMS) features"); // default DPMS values, enable DPMS, enable screen-saver WFM::Execute (.local.bash, "/usr/bin/xset dpms 1200 1800 2400; /usr/bin/xset +dpms; /usr/bin/xset s on; /usr/bin/xset s default;"); } // TRANSLATORS: busy message UI::OpenDialog (`Label(_("Finishing the installation..."))); // #2 } UI::CloseDialog(); // #2 } /** * Sets autoinstallation behavior. */ void SetAutoinstHandling () { if (! Mode::autoinst()) return; map reportMap = $[ "errors":$[ "timeout":0 ], "warnings":$[ "timeout":10 ], "yesno_messages":$[ "timeout":10 ] ]; Report::Import( reportMap ); Report::DisplayErrors (true, 0); Report::DisplayWarnings(true, 10); Report::DisplayMessages(true, 10); } /** * Sets autoupgrade behavior */ void SetAutoupgHandling () { // if profile is defined, first read it, then probe hardware any autoinstall = SCR::Read(.etc.install_inf.AutoYaST); if (autoinstall != nil && is ( autoinstall , string ) && (string)autoinstall != "") { ProductControl::DisableModule ("system_analysis"); ProductControl::DisableModule ("update_partition_auto"); } } void ShowTextFallbackMessage () { if ( (Installation::text_fallback () || Installation::no_x11 ()) && (Installation::x11_setup_needed () && Arch::x11_setup_needed ()) && !Installation::shown_text_mode_warning ) { string x11_msg = ""; if ((Installation::no_x11 () || Installation::text_fallback ()) && Stage::initial ()) { // Somehow the graphical frontend failed and we're running in // text mode. Inform the user about this fact. x11_msg = sformat(_("Your computer does not fulfill all requirements for a graphical installation. There is less than %1 MB memory or the X server could not be started. As a fallback, the text front-end of YaST2 will guide you through the installation. This front-end offers the same functionality as the graphical one, but the screens differ from those in the manual. "), "96"); } else if ( (Installation::no_x11 () || Installation::text_fallback ()) && Stage::cont () ) { // The script YaST2 wants to inform about a problem with the // option no_x11 but it's broken. // else if (Installation::no_x11 ()) // Somehow the graphical frontend failed and we're running in // text mode. Inform the user about this fact. x11_msg = _("The graphical interface could not be started. The required packages were not installed (minimal installation) or the graphics card is not properly supported. As a fallback, the text front-end of YaST2 will guide you through the installation. This front-end offers the same functionality as the graphical one, but the screens differ from those in the manual. "); } if (x11_msg != "") { Report::Message(x11_msg); } else { y2error ("There should be a more detailed message displayed here, but something went wrong, that's why it is only in the log"); } // show this warning only once Installation::shown_text_mode_warning = true; } } /** * Re-translate static part of wizard dialog and other predefined messages * after language change */ void retranslateWizardDialog() { y2milestone( "Retranslating messages" ); // Make sure the labels for default function keys are retranslated, too. // Using Label::DefaultFunctionKeyMap() from Label module. UI::SetFunctionKeys( Label::DefaultFunctionKeyMap() ); // Activate language changes on static part of wizard dialog ProductControl::RetranslateWizardSteps(); Wizard::RetranslateButtons(); Wizard::SetFocusToNextButton(); return; } void SetNetworkActivationModule () { // update the workflow according to current situation // disable lan activation if not needed if (!(Linuxrc::InstallInf("ConfigureNetwork")=="1") ) { y2milestone ("Disabling network activation module"); ProductControl::DisableModule ("lan"); } } void SetDiskActivationModule () { // update the workflow according to current situation // disable disks activation if not needed boolean iscsi = Linuxrc::InstallInf("WithiSCSI") == "1"; if (! (Arch::s390() || iscsi)) { y2milestone ("Disabling disk activation module"); ProductControl::DisableModule ("disks_activate"); } } } //end of include 0707010006A4AF000041ED0000018F0000018F000000024F10367600000000000000080000000100000000000000000000003F00000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/include/update0707010006A4B0000081A40000018F0000018F000000014F10367600002C45000000080000000100000000000000000000004C00000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/include/update/rootpart.ycp/** * Module: include/installation/rootpart.ycp * * Authors: Stefan Schubert * Arvin Schnell * Jiri Srain * * Purpose: Select root partition for update or booting. * RootPart::rootPartitions must be filled before * calling this module. */ { textdomain "update"; import "Wizard"; import "Popup"; import "Label"; import "RootPart"; import "GetInstArgs"; import "Report"; import "Update"; import "Installation"; import "Mode"; // Returns boolean whether partition can be // a Linux 'root' file system boolean CanBeLinuxRootFS (symbol partition_fs) { if (partition_fs == nil) { y2error("partition_fs not defined!"); return false; } // possible_root_fs contains list of supported FSs return contains (RootPart::possible_root_fs, partition_fs); } // flavor is either `update or `boot list make_partition_list (boolean withall, symbol flavor) { list part_list = []; foreach (string partition, map i, RootPart::rootPartitions, { // see https://bugzilla.novell.com/attachment.cgi?id=96783&action=view // see bugzilla #288201 // architecture needs to be valid when updating, not booting boolean arch_is_valid = (flavor == `boot ? true:i[`arch_valid]:false); if (withall || (i[`valid]:false && arch_is_valid)) { // `ext2, `jfs, ... symbol part_fs = (symbol) i[`fs]:nil; string part_fs_name = tostring (part_fs); if (part_fs_name != nil && regexpmatch (part_fs_name, "^`(.*)$")) { part_fs_name = regexpsub (part_fs_name, "^`(.*)$", "\\1"); } string system = i[`name]:"error"; // unknown system if (system == "unknown") { if (part_fs != nil) { if (CanBeLinuxRootFS (part_fs)) { // Table item (unknown system) system = _("Unknown Linux"); } else { // Table item (unknown system) system = _("Unknown or Non-Linux"); } } else { // Table item (unknown system [neither openSUSE 11.1 nor SLES 14 nor ...]) if (system == "unknown") system = _("Unknown"); } } string arch = i[`arch]:"error"; // Table item (unknown architecture) if (arch == "unknown") arch = _("Unknown"); // fist, use the name of file system (with short name for Linux) // then the file system short name // then "Unknown" string fs = ""; // is a linux fs, can be a root fs, has a fs name if (part_fs != nil && i[`fstype]:nil != nil && CanBeLinuxRootFS (part_fs) && part_fs_name != nil) { fs = sformat( _("%1 (%2)"), i[`fstype]:"", part_fs_name ); } else { fs = i[`fstype]:i[`fs]:""; } // Table item (unknown file system) if (fs == "") fs = _("Unknown"); string label = i[`label]:""; part_list = add (part_list, `item (`id (partition), system, partition, arch, fs, label ) ); } }); return part_list; } // Returns whether wanted and selected architectures match // bnc #372309 boolean DoArchitecturesMatch (string arch_1, string arch_2) { list ppc_archs = ["ppc", "ppc64"]; // exact match if (arch_1 == arch_2) { return true; // ppc exception } else if (contains (ppc_archs, arch_1) && contains (ppc_archs, arch_2)) { return true; } // else return false; } void UmountMountedPartition () { Update::Detach (); RootPart::UnmountPartitions (false); } /** * This dialog comes in several different flavors: * `update_dialog - used to show partitions available for upgrade, * `update_popup - obsolete, used to be used as a pop-up in proposal dialog (MakeProposal), * `update_dialog_proposal - obsolete, used to be used as a pop-up in proposal dialog (AskUser), * `boot_popup - obsolete, used to be used as a dilaog offering to boot to a selected partition, * * @param symbol flavor * @return symbol `cancel, `back, `next, `abort */ symbol RootPartitionDialog (symbol flavor) { // FIXME: Most of the code in this function is obsolete list partition_list = make_partition_list ( RootPart::showAllPartitions, (flavor == `boot_popup ? `boot : `update) ); string title = ""; string label = ""; string help_text = ""; if (flavor == `boot_popup) { // label for selection of root partition (for boot) label = _("Partition or System to Boot:"); // help text for root partition dialog (for boot) help_text = _("

Select the partition or system to boot.

"); } else { // label for selection of root partition (for update) label = _("Partition or System to Update:"); // help text for root partition dialog (for update) help_text = _("

Select the partition or system to update.

"); if (flavor == `update_dialog || flavor == `update_dialog_proposal) { // headline for dialog "Select for update" title = _("Select for Update"); } } // help text for root partition dialog (general part) help_text = help_text + _("

Show All Partitions expands the list to a general overview of your system's partitions.

"); term contents = `HBox ( `VBox ( `VSpacing (1), `Left (`Label (label)), `MinSize ( 70, 14, `Table ( `id (`partition), `opt(`hstretch), `header ( // table header _("System"), // table header item _("Partition"), // table header item _("Architecture"), // table header item _("File System"), // table header item _("Label") ), partition_list ) ), `Left(`CheckBox(`id(`showall), `opt(`notify), // check box _("&Show All Partitions"), false)), `VSpacing (1) ) ); // bnc #429080 // finishing the target before selecting a new system to load if (flavor == `update_dialog) { Pkg::TargetFinish(); } if (flavor == `update_dialog) { Wizard::SetContents (title, contents, help_text, true, true); if (Mode::autoupgrade()) Wizard::EnableAbortButton(); } else if (flavor == `update_dialog_proposal) { Wizard::CreateDialog (); Wizard::SetContentsButtons (title, contents, help_text, Label::BackButton (), Label::OKButton ()); } else { term buttons = `PushButton (`id(`next), `opt(`default), Label::OKButton()); if (flavor == `boot_popup) { buttons = `HBox ( `HStretch (), // pushbutton to (rightaway) boot the system selected above `HWeight( 1, `PushButton(`id(`next), `opt(`default), _("&Boot")) ), `HSpacing( 1 ), `HWeight( 1, `PushButton(`id(`cancel), Label::CancelButton() ) ), `HStretch () ); } term full = `MinHeight ( 16, `HBox ( `HSquash ( `MinWidth ( 26, `RichText (`opt(`vstretch), help_text) ) ), `HSpacing (2), `VBox ( `MinHeight ( 15, contents ), buttons ), `HSpacing (2) ) ); UI::OpenDialog (full); } if (size (RootPart::selectedRootPartition) > 0) UI::ChangeWidget (`id(`partition), `CurrentItem, RootPart::selectedRootPartition); UI::ChangeWidget(`id(`showall), `Value, RootPart::showAllPartitions); any ret = nil; while (true) { if (flavor == `update_dialog || flavor == `update_dialog_proposal) ret = Wizard::UserInput (); else ret = UI::UserInput (); if (ret == `cancel) ret = `abort; if (ret == `abort && Popup::ConfirmAbort (`painless)) break; if (ret == `showall) { string tmp = (string) UI::QueryWidget (`id(`partition), `CurrentItem); partition_list = make_partition_list ( (boolean) UI::QueryWidget (`id(`showall), `Value), (flavor == `boot_popup ? `boot : `update) ); UI::ChangeWidget (`id(`partition), `Items, partition_list); if (tmp != nil) UI::ChangeWidget (`id(`partition), `CurrentItem, tmp); continue; } if ((flavor == `update_dialog || flavor == `update_popup || flavor == `update_dialog_proposal) && ret == `next) { string selected = (string) UI::QueryWidget (`id(`partition), `CurrentItem); map freshman = RootPart::rootPartitions[selected]:$[]; boolean cont = true; y2milestone ("Selected root partition: %1 %2", selected, freshman); if (freshman[`name]:"unknown" == "unknown") { cont = Popup::ContinueCancel ( // continue-cancel popup _("No installed system that can be upgraded with this product was found on the selected partition.")); } else if (! DoArchitecturesMatch (freshman[`arch]:"", RootPart::GetDistroArch())) { cont = Popup::ContinueCancel ( // continue-cancel popup _("The architecture of the system installed in the selected partition is different than the one of this product.")); } if (! cont) ret = nil; } if (ret == `next) { RootPart::selectedRootPartition = (string) UI::QueryWidget (`id(`partition), `CurrentItem); RootPart::showAllPartitions = (boolean) UI::QueryWidget (`id(`showall), `Value); if (flavor == `update_dialog) { RootPart::targetOk = RootPart::mount_target (); // Not mounted correctly if (! RootPart::targetOk) { // error report Report::Error (_("Failed to mount target system")); UmountMountedPartition(); continue; // Correctly mounted but incomplete installation found } else if (RootPart::IncompleteInstallationDetected (Installation::destdir)) { if (Popup::AnyQuestion ( Label::WarningMsg(), // pop-up question _("A possibly incomplete installation has been detected on the selected partition. Are sure you want to use it anyway?"), // button label _("&Yes, Use It"), Label::CancelButton(), `focus_no )) { y2milestone ("User wants to update possibly incomplete system"); } else { y2milestone ("User decided not to update incomplete system"); UmountMountedPartition(); continue; } } } break; } if (ret == `cancel || ret == `back || ret == `next) break; } if (flavor != `update_dialog) UI::CloseDialog (); else if (Mode::autoupgrade()) Wizard::DisableAbortButton(); // New partition has been mounted if (flavor == `update_dialog && ret == `next) { // Target load failed, #466803 if (Pkg::TargetInitialize (Installation::destdir) != true) { y2error ("Pkg::TargetInitialize failed"); if (Popup::AnyQuestion ( Label::ErrorMsg(), _("Initializing the system for upgrade has failed for unknown reason. It is highly recommended not to continue the upgrade process. Are you sure you want to continue?"), _("&Yes, Continue"), Label::CancelButton(), `focus_no )) { ret = `back; } else { y2warning ("User decided to continue despite the error above (Pkg::TargetInit() failed)"); } } // not aborted if (ret != `back) { // Target load failed, #466803 if (Pkg::TargetLoad() != true) { y2error ("Pkg::TargetLoad failed"); if (Popup::AnyQuestion ( Label::ErrorMsg(), _("Initializing the system for upgrade has failed for unknown reason. It is highly recommended not to continue the upgrade process. Are you sure you want to continue?"), _("&Yes, Continue"), Label::CancelButton(), `focus_no )) { ret = `back; } else { y2warning ("User decided to continue despite the error above (Pkg::TargetLoad() failed)"); } } } } return (symbol)ret; } } // EOF 0707010006A4B1000041ED0000018F0000018F000000024F10367600000000000000080000000100000000000000000000003800000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients0707010006A4B6000081A40000018F0000018F000000014F103676000006CD000000080000000100000000000000000000005700000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients/inst_update_partition_auto.ycp/** * Module: inst_update_partition.ycp * * Authors: Stefan Schubert * Arvin Schnell * * Purpose: Select root partition for update or booting. * RootPart::rootPartitions must be filled before * calling this module. * * $Id:$ */ { textdomain "update"; import "ProductControl"; import "RootPart"; include "update/rootpart.ycp"; if (RootPart::Mounted ()) { Update::Detach (); RootPart::UnmountPartitions (false); } RootPart::Detect (); // if there is only one suitable partition which can be mounted, use it without asking string target_system = ""; map partitions = filter (string name, map p, RootPart::rootPartitions, { if (p[`valid]:false) target_system = name; return p[`valid]:false; }); if (size (partitions) == 1) { y2milestone ("Auto-mounting system located at %1", target_system); RootPart::selectedRootPartition = target_system; RootPart::targetOk = RootPart::mount_target (); // Not mounted correctly if (! RootPart::targetOk) { // error report Report::Error (_("Failed to mount target system")); UmountMountedPartition(); // Correctly mounted but incomplete installation found } else if (RootPart::IncompleteInstallationDetected (Installation::destdir)) { Report::Error (_("A possibly incomplete installation has been detected.")); UmountMountedPartition(); } else if (!(Pkg::TargetInitialize (Installation::destdir) && Pkg::TargetLoad())) { Report::Error ("Initializing the target system failed"); UmountMountedPartition(); Pkg::TargetFinish(); } else { return `next; } } symbol ret = RootPartitionDialog (`update_dialog); return ret; } 0707010006A4B3000081A40000018F0000018F000000014F10367600000B12000000080000000100000000000000000000004E00000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients/iscsi-client_auto.ycp/** * File: clients/iscsi-client_auto.ycp * Package: Configuration of iscsi-client * Summary: Client for autoinstallation * Authors: Michal Zugec * * $Id: iscsi-client_auto.ycp 62753 2010-11-05 06:56:22Z jsrain $ * * This is a client for autoinstallation. It takes its arguments, * goes through the configuration and return the setting. * Does not do any changes to the configuration. */ /** * @param function to execute * @param map/list of iscsi-client settings * @return map edited settings, Summary or boolean on success depending on called function * @example map mm = $[ "FAIL_DELAY" : "77" ]; * @example map ret = WFM::CallFunction ("iscsi-client_auto", [ "Summary", mm ]); */ { textdomain "iscsi-client"; y2milestone("----------------------------------------"); y2milestone("IscsiClient auto started"); import "IscsiClient"; import "ModuleLoading"; include "iscsi-client/wizards.ycp"; any ret = nil; string func = ""; map param = $[]; /* Check arguments */ if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) { func = (string)WFM::Args(0); if(size(WFM::Args()) > 1 && is(WFM::Args(1), map)) param = (map) WFM::Args(1); } y2debug("func=%1", func); y2debug("param=%1", param); /* Create a summary*/ if(func == "Summary") { ret = select(IscsiClient::Summary(), 0, ""); } /* Reset configuration */ else if (func == "Reset") { IscsiClient::Import($[]); ret = $[]; } /* Change configuration (run AutoSequence) */ else if (func == "Change") { ret = IscsiClientAutoSequence(); } /* Import configuration */ else if (func == "Import") { ret = IscsiClient::Import(param); } /* Return actual state */ else if (func == "Export") { ret = IscsiClient::Export(); } /* Return needed packages */ else if (func == "Packages") { ret = IscsiClient::AutoPackages(); } else if (func == "GetModified") { ret = IscsiClient::modified; } else if (func == "SetModified") { IscsiClient::modified=true; IscsiClient::configured=true; } /* Read current state */ else if (func == "Read") { import "Progress"; boolean progress_orig = Progress::set (false); ret = IscsiClient::Read(); Progress::set (progress_orig); } /* Write given settings */ else if (func == "Write") { import "Progress"; boolean progress_orig = Progress::set (false); IscsiClient::write_only = true; ModuleLoading::Load("iscsi_tcp", "", "", "", false, true); IscsiClientLib::autoyastPrepare(); SCR::Execute(.background.run_output_err, "iscsid"); ret = IscsiClient::Write(); Progress::set (progress_orig); } /* Unknown function */ else { y2error("Unknown function: %1", func); ret = false; } y2debug("ret=%1", ret); y2milestone("IscsiClient auto finished"); y2milestone("----------------------------------------"); return ret; /* EOF */ } 0707010006A4B4000081A40000018F0000018F000000014F103676000004AA000000080000000100000000000000000000005500000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients/autoinst_scripts1_finish.ycp/** * File: * autoinst_scripts1_finish.ycp * * Module: * Step of base installation finish * * Authors: * Jiri Srain * * $Id: autoinst_scripts1_finish.ycp 62222 2010-07-12 11:56:35Z jsrain $ * */ { textdomain "autoinst"; import "AutoinstScripts"; import "AutoInstall"; import "Installation"; any ret = nil; string func = ""; map param = $[]; /* Check arguments */ if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) { func = (string)WFM::Args(0); if(size(WFM::Args()) > 1 && is(WFM::Args(1), map)) param = (map)WFM::Args(1); } y2milestone ("starting autoinst_scripts1_finish"); y2debug("func=%1", func); y2debug("param=%1", param); if (func == "Info") { return (any)$[ "steps" : 1, // progress step title "title" : _("Executing autoinstall scripts in the installation environment..."), "when" : [ `autoinst, `autoupg ], ]; } else if (func == "Write") { AutoinstScripts::Write("chroot-scripts", false); AutoInstall::Finish(Installation::destdir); } else { y2error ("unknown function: %1", func); ret = nil; } y2debug("ret=%1", ret); y2milestone("autoinst_scripts1_finish finished"); return ret; } /* EOF */ 0707010006A4B7000081A40000018F0000018F000000014F10367600000482000000080000000100000000000000000000005500000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients/autoinst_scripts2_finish.ycp/** * File: * autoinst_scripts2_finish.ycp * * Module: * Step of base installation finish * * Authors: * Jiri Srain * * $Id: autoinst_scripts2_finish.ycp 62222 2010-07-12 11:56:35Z jsrain $ * */ { textdomain "autoinst"; import "AutoinstScripts"; import "AutoInstall"; any ret = nil; string func = ""; map param = $[]; /* Check arguments */ if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) { func = (string)WFM::Args(0); if(size(WFM::Args()) > 1 && is(WFM::Args(1), map)) param = (map)WFM::Args(1); } y2milestone ("starting autoinst_scripts2_finish"); y2debug("func=%1", func); y2debug("param=%1", param); if (func == "Info") { return (any)$[ "steps" : 1, // progress step title "title" : _("Executing autoinstall scripts in the installation environment..."), "when" : [ `autoinst, `autoupg ], ]; } else if (func == "Write") { AutoinstScripts::Write("chroot-scripts", true); AutoInstall::PXELocalBoot(); } else { y2error ("unknown function: %1", func); ret = nil; } y2debug("ret=%1", ret); y2milestone("autoinst_scripts2_finish finished"); return ret; } /* EOF */ 0707010006A4B8000081A40000018F0000018F000000014F103676000008BD000000080000000100000000000000000000005800000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients/inst_store_upgrade_software.ycp{ import "GetInstArgs"; import "Popup"; import "Profile"; import "Installation"; if ( GetInstArgs::going_back()) return `auto; // find out status of patterns list > patterns = Pkg::ResolvableProperties ("", `pattern, ""); patterns = filter (map p, patterns, { return p["transact_by"]:nil == `user || p["transact_by"]:nil == `app_high; }); list patterns_to_remove = []; list patterns_to_install = maplist (map p, patterns, { if (p["status"]:nil == `selected || p["status"]:nil == `installed) return p["name"]:""; else if (p["status"]:nil == `removed || p["status"]:nil == `available) patterns_to_remove = add (patterns_to_remove, p["name"]:""); return nil; }); patterns_to_install = filter (string p, patterns_to_install, { return p != nil; }); y2milestone ("Patterns to install: %1", patterns_to_install); y2milestone ("Patterns to remove: %1", patterns_to_remove); // find out status of packages list > packages = Pkg::ResolvableProperties ("", `package, ""); packages = filter (map p, packages, { return p["transact_by"]:nil == `user || p["transact_by"]:nil == `app_high; }); list packages_to_remove = []; list packages_to_install = maplist (map p, packages, { if (p["status"]:nil == `selected || p["status"]:nil == `installed) return p["name"]:""; else if (p["status"]:nil == `removed || p["status"]:nil == `available) packages_to_remove = add (packages_to_remove, p["name"]:""); return nil; }); packages_to_install = filter (string p, packages_to_install, { return p != nil; }); y2milestone ("Packages to install: %1", packages_to_install); y2milestone ("Packages to remove: %1", packages_to_remove); map software = $[ "packages": packages_to_install, "patterns": patterns_to_install, "remove-packages": packages_to_remove, "remove-patterns": patterns_to_remove, ]; Profile::current["software"] = software; // /root exists during upgrade Profile::Save (Installation::destdir + "/root/autoupg_updated.xml"); return `auto; } 0707010006A4BD000081A40000018F0000018F000000014F103676000009E9000000080000000100000000000000000000005000000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients/inst_worker_initial.ycp/** * File: inst_worker_initial.ycp * * Authors: Klaus Kaempf * Mathias Kettner * Michael Hager * Stefan Hundhammer * Arvin Schnell * Jiri Srain * Lukas Ocilka * * Purpose: Set up the UI and define macros for the * installation dialog, general framework, ... * Describing and calling all submodules. * (For initial installation only). * * $Id:$ */ { textdomain "installation"; import "Installation"; import "Linuxrc"; import "Mode"; import "ProductControl"; import "Stage"; // General installation functions include "installation/misc.ycp"; // Both First & Second stage-related functions include "installation/inst_inc_all.ycp"; // First-stage-related functions only include "installation/inst_inc_first.ycp"; /* --- First, connect to the system via SCR --- */ // this is installation, so start SCR always locally (as plugin) ! integer scr_handle = WFM::SCROpen ("scr", false); WFM::SCRSetDefault (scr_handle); Installation::scr_handle = scr_handle; /* --- Global settings --- */ // All stages SetAutoinstHandling (); SetAutoupgHandling (); SetGlobalInstallationFeatures (); // Initial stage SetInitialInstallation (); // Update initiated from running system SetSystemUpdate (); // All stages SetUIContent(); SetNetworkActivationModule(); SetDiskActivationModule(); // Cleanup and other settings InitFirstStageInstallationSystem(); // Redraw steps before mouse is initialized // Bugzilla #296406 UpdateWizardSteps (); // Initial stage InitMouse(); // All stages // Shows fallback message if running in textmode (if used as fallback) ShowTextFallbackMessage(); // First stage if (!Mode::screen_shot() && !Stage::firstboot()) WFM::CallFunction ("inst_check_autoinst_mode", []); symbol ret = nil; /* --- Runing the installation workflow --- */ ret = ProductControl::Run(); y2milestone ("ProductControl::Run() returned %1", ret); /* --- Handling finished installation workflow --- */ y2milestone("Evaluating ret: %1", ret); // Installation has been aborted if (ret == `abort) { // tell linuxrc that we aborted Linuxrc::WriteYaSTInf($["Aborted" : "1"]); } // All Sources and Target need to be released... FinishInstallation (ret); return ret; } 0707010006A4BC000081A40000018F0000018F000000014F103676000015AF000000080000000100000000000000000000004F00000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients/save_config_finish.ycp/** * File: * save_config_finish.ycp * * Module: * Step of base installation finish * * Authors: * Jiri Srain * * $Id: save_config_finish.ycp 62526 2010-10-01 11:47:31Z jsrain $ * */ { textdomain "installation"; import "Directory"; import "Mode"; import "Timezone"; import "Language"; import "Keyboard"; import "ProductFeatures"; import "AutoInstall"; import "Console"; import "Product"; import "Progress"; import "SignatureCheckDialogs"; import "Stage"; import "AddOnProduct"; import "FileUtils"; import "Installation"; import "String"; any ret = nil; string func = ""; map param = $[]; /* Check arguments */ if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) { func = (string)WFM::Args(0); if(size(WFM::Args()) > 1 && is(WFM::Args(1), map)) param = (map)WFM::Args(1); } y2milestone ("starting save_config_finish"); y2debug("func=%1", func); y2debug("param=%1", param); if (func == "Info") { return (any)$[ "steps" : Mode::autoinst () ? 7 : (Mode::update() ? 5 : 6), "when" : [ `installation, `update, `autoinst ], ]; } else if (func == "Write") { // Bugzilla #209119 // ProductFeatures::Save() moved here from inst_kickoff.ycp // (After the SCR is switched) if (Stage::initial ()) { y2milestone ("Saving ProductFeatures..."); SCR::Execute (.target.bash, "/bin/mkdir -p '/etc/YaST2'"); SCR::Execute (.target.bash, "touch '/etc/YaST2/ProductFeatures'"); ProductFeatures::Save(); } // Bugzilla #187558 // Save Add-On products configuration // to be able to restore the settings string save_to = AddOnProduct::TmpExportFilename(); if (FileUtils::Exists (save_to)) { SCR::Execute (.target.remove, save_to); } if (Stage::initial ()) { y2milestone ("Saving Add-On configuration..."); map exported_add_ons = AddOnProduct::Export(); if (exported_add_ons == nil) { y2error ("Error, Add-Ons returned 'nil'"); } else { boolean saved = (boolean) SCR::Write (.target.ycp, save_to, exported_add_ons); if (saved) { y2milestone ("Add-Ons configuration saved successfuly"); } else { y2error ("Error occurred when storing Add-Ons configuration!"); } } } if (!Mode::update ()) { // progress step title Progress::Title (_("Saving time zone...")); // clock must be set correctly in new chroot Timezone::Set (Timezone::timezone, true); Timezone::Save(); } Progress::NextStep (); if (!Mode::update ()) { // progress step title Progress::Title (_("Saving language...")); Language::Save(); Progress::NextStep (); } // save the update language for the second stage (F300572) else { string lang = Language::language; string file = Directory::vardir + "/language.ycp"; y2milestone ("saving %1 to %2 for 2nd stage of update", lang, file); SCR::Write (.target.ycp, file, $[ "second_stage_language" : lang ]); } // progress step title Progress::Title (_("Saving keyboard configuration...")); Keyboard::Save(true); Progress::NextStep (); // progress step title Progress::Title (_("Saving product information...")); ProductFeatures::Save(); if (Mode::autoinst () || Mode::autoupgrade()) { Progress::NextStep (); // progress step title Progress::Title (_("Saving automatical installation settings...")); AutoInstall::Save(); } Progress::NextStep (); // progress step title Progress::Title (_("Saving console configuration...")); Console::Save(); Progress::NextStep (); // progress step title Progress::Title (_("Configuring the superuser's environment...")); SCR::Write (.sysconfig.suseconfig.CWD_IN_USER_PATH, contains (Product::flags, "usercwd") ? "yes" : "no"); SCR::Write (.sysconfig.suseconfig, nil); Progress::NextStep (); // progress step title Progress::Title (_("Saving security settings...")); SCR::Write (.sysconfig.security.CHECK_SIGNATURES, SignatureCheckDialogs::CheckSignatures ()); SCR::Write (.sysconfig.security, nil); Progress::NextStep (); // progress step title Progress::Title (_("Saving boot scripts settings...")); boolean run_in_parallel = ProductFeatures::GetBooleanFeature( "globals", "run_init_scripts_in_parallel"); SCR::Write (.sysconfig.boot.RUN_PARALLEL, run_in_parallel ? "yes" : "no" ); SCR::Write (.sysconfig.boot, nil); // save supportconfig if(SCR::Read(.target.size,"/etc/install.inf") > 0) { string url = (string)SCR::Read(.etc.install_inf.supporturl); y2milestone("URL value from /etc/install.inf : %1", url); if( url!=nil && size(url)>0){ string config_path= "/etc/supportconfig.conf"; //sformat("%1%2", String::Quote(Installation::destdir), "/etc/supportconfig.conf"); y2milestone("URL from install.inf readed, test if %1 exists", config_path); if (FileUtils::Exists(config_path)){ y2milestone("Insert value into supportconfig.conf: %1", url); SCR::Execute(.target.bash_output,sformat("sed -i '/VAR_OPTION_UPLOAD_TARGET=.*/d;/^$/d' %1", config_path)); SCR::Execute(.target.bash_output, sformat("echo \"VAR_OPTION_UPLOAD_TARGET='%1'\">> %2", url, config_path)); // SCR::Write(.target.string, config_path, sformat("VAR_OPTION_UPLOAD_TARGET=%1", url)); } else y2error("filename %1 was not found", config_path); } } else y2warning("/etc/install.inf not found"); } else { y2error ("unknown function: %1", func); ret = nil; } y2debug("ret=%1", ret); y2milestone("save_config_finish finished"); return ret; } /* EOF */ 0707010006A4BA000081A40000018F0000018F000000014F103676000039E7000000080000000100000000000000000000005300000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients/inst_autosetup_upgrade.ycp/** * File: clients/inst_autosetup.ycp * Package: Auto-installation * Summary: Setup and prepare system for auto-installation * Authors: Anas Nashif * Uwe Gansert * * $Id: inst_autosetup.ycp 61521 2010-03-29 09:10:07Z ug $ */ { textdomain "autoinst"; import "AutoinstConfig"; import "AutoInstall"; import "Installation"; import "Profile"; import "Progress"; import "Report"; import "AutoinstStorage"; import "AutoinstScripts"; import "AutoinstGeneral"; import "AutoinstSoftware"; import "Bootloader"; import "BootCommon"; import "Popup"; import "RunlevelEd"; import "Arch"; import "AutoinstLVM"; import "AutoinstRAID"; import "Storage"; import "Timezone"; import "Keyboard"; import "Call"; import "ProductControl"; import "LanUdevAuto"; import "Language"; import "Console"; include "bootloader/routines/autoinstall.ycp"; include "autoinstall/ask.ycp"; define symbol readModified() { if (SCR::Read(.target.size, AutoinstConfig::modified_profile) > 0 ) { if (! Profile::ReadXML( AutoinstConfig::modified_profile ) || Profile::current == $[] ) { Popup::Error(_("Error while parsing the control file. Check the log files for more details or fix the control file and try again. ")); return `abort; } string cpcmd = sformat("mv %1 %2","/tmp/profile/autoinst.xml", "/tmp/profile/pre-autoinst.xml"); y2milestone("copy original profile: %1",cpcmd); SCR::Execute(.target.bash, cpcmd); cpcmd = sformat("mv %1 %2", AutoinstConfig::modified_profile, "/tmp/profile/autoinst.xml"); y2milestone("moving modified profile: %1",cpcmd); SCR::Execute(.target.bash, cpcmd); return `found; } return `not_found; } string help_text = _("

Please wait while the system is prepared for autoinstallation.

"); list progress_stages = [ _("Configure General Settings "), _("Execute pre-install user scripts"), _("Set up language"), _("Configure Software selections"), ]; list progress_descriptions = [ _("Configuring general settings..."), _("Executing pre-install user scripts..."), _("Configuring Software selections...") ]; Progress::New( _("Preparing System for Automated Installation"), "", // progress_title size( progress_stages ), // progress bar length progress_stages, progress_descriptions, help_text ); if(UI::PollInput() == `abort) if (Popup::ConfirmAbort (`painless)) return `abort; Progress::NextStage(); // configure general settings if(UI::PollInput() == `abort) if (Popup::ConfirmAbort (`painless)) return `abort; Progress::NextStage(); // Pre-Scripts AutoinstScripts::Import(Profile::current["scripts"]:$[]); AutoinstScripts::Write("pre-scripts", false); // Reread Profile in case it was modified in pre-script // User has to create the new profile in a pre-defined // location for easy processing in pre-script. if( readModified() == `abort ) return `abort; // // Partitioning and Storage //////////////////////////////////////////////////////////////////////// boolean modified = true; do { askDialog(); // Pre-Scripts AutoinstScripts::Import(Profile::current["scripts"]:$[]); AutoinstScripts::Write("pre-scripts", false); symbol ret = readModified(); if( ret == `abort ) return `abort; if( ret == `not_found ) modified = false; } while( modified == true ); // reimport scripts, for the case has changed them AutoinstScripts::Import(Profile::current["scripts"]:$[]); // // Set Mouse and other workflow variables // AutoinstGeneral::Import(Profile::current["general"]:$[]); y2milestone("general: %1", Profile::current["general"]:$[] ); AutoinstGeneral::Write(); if( haskey( Profile::current, "add-on" ) ) { Call::Function("add-on_auto", ["Import", Profile::current["add-on"]:$[]] ); Call::Function("add-on_auto", ["Write"]); } boolean use_utf8 = true; // utf8 is default map displayinfo = UI::GetDisplayInfo(); if ( ! displayinfo["HasFullUtf8Support"]:true ) { use_utf8 = false; // fallback to ascii } // // Set it in the Language module. // Progress::NextStep(); Progress::Title(_("Configuring language...")); Language::Import( Profile::current["language"]:$[] ); // // Set Console font // Installation::encoding = Console::SelectFont( Language::language ); if (displayinfo["HasFullUtf8Support"]:true) { Installation::encoding = "UTF-8"; } UI::SetLanguage (Language::language, Installation::encoding); WFM::SetLanguage (Language::language, "UTF-8"); if( haskey( Profile::current, "timezone" ) ) Timezone::Import(Profile::current["timezone"]:$[]); if( haskey( Profile::current, "keyboard" ) ) Keyboard::Import(Profile::current["keyboard"]:$[]); // one can override the option by the commandline parameter y2confirm string tmp = (string)SCR::Read (.target.string, "/proc/cmdline"); if (tmp != nil && contains (splitstring (tmp, " \n"), "y2confirm")) { AutoinstConfig::Confirm = true; y2milestone("y2confirm found and confirm turned on"); } if(UI::PollInput() == `abort) if (Popup::ConfirmAbort (`painless)) return `abort; // moved here from autoinit for fate #301193 // needs testing if( Arch::s390 () && AutoinstConfig::remoteProfile == true ) { y2milestone("arch=s390 and remote_profile=true"); if( haskey(Profile::current, "dasd") ) { y2milestone("dasd found"); Call::Function("dasd_auto", ["Import", Profile::current["dasd"]:$[] ]); } if( haskey(Profile::current, "zfcp") ) { y2milestone("zfcp found"); Call::Function("zfcp_auto", ["Import", Profile::current["zfcp"]:$[] ]); } } Progress::NextStage(); Storage::ReReadTargetMap(); if (! (Mode::autoupgrade() && AutoinstConfig::ProfileInRootPart)) { if (`abort == WFM::CallFunction("inst_update_partition_auto", [])) return `abort; } // Software if(UI::PollInput() == `abort) if (Popup::ConfirmAbort (`painless)) return `abort; Progress::NextStage(); // initialize package manager import "Packages"; import "PackageCallbacks"; import "Update"; import "RootPart"; import "ProductFeatures"; import "Product"; // FIXME FIXME FIXME copy-paste from update_proposal map GetUpdateConf () { // 'nil' values are skipped, in that case, ZYPP uses own default values map ret = $[]; // not supported by libzypp anymore // if (Update::deleteOldPackages != nil) { // ret["delete_unmaintained"] = Update::deleteOldPackages; // } if (Update::silentlyDowngradePackages != nil) { ret["silent_downgrades"] = Update::silentlyDowngradePackages; } y2milestone ("Using update configuration: %1", ret); return ret; } Packages::Init(true); // initialize target if (true) { PackageCallbacks::SetConvertDBCallbacks (); Pkg::TargetInit (Installation::destdir, false); Update::GetProductName (); } // FATE #301990, Bugzilla #238488 // Set initial update-related (packages/patches) values from control file Update::InitUpdate(); // some products are listed in media control file and at least one is compatible // with system just being updated boolean update_not_possible = false; // FATE #301844 y2milestone ("Previous '%1', New '%2' RootPart", RootPart::previousRootPartition, RootPart::selectedRootPartition); if (RootPart::previousRootPartition != RootPart::selectedRootPartition) { RootPart::previousRootPartition = RootPart::selectedRootPartition; // check whether update is possible // reset deleteOldPackages and onlyUpdateInstalled in respect to the selected system Update::Reset(); if (! Update::IsProductSupportedForUpgrade()) { y2milestone ("Upgrade is not supported"); update_not_possible = true; } } // this is new - override the default upgrade mode if (Profile::current["upgrade","only_installed_packages"]:nil != nil) Update::onlyUpdateInstalled = Profile::current["upgrade","only_installed_packages"]:true; // connect target with package manager if (!Update::did_init1) { Update::did_init1 = true; if (size (Pkg::ResolvableProperties ("", `pattern, "")) > 0) { y2milestone ("No base selection found, but patterns found..."); Packages::using_patterns = true; } list restore = []; list > selected = Pkg::ResolvableProperties ("", `product, ""); foreach (map s, selected, { restore = add (restore, s["name"]:""); }); Pkg::PkgApplReset (); // bnc #300540 // bnc #391785 // Drops packages after PkgApplReset, not before (that would null that) Update::DropObsoletePackages(); foreach (string res, restore, { Pkg::ResolvableInstall (res, `product); }); if (! Update::onlyUpdateInstalled) { if (Packages::using_patterns) { Update::SetDesktopPattern (); } else { Update::ProposeSelection (); } } if (Update::onlyUpdateInstalled) // just consider already installed packages { Pkg::SetSelection (""); // -> don't select any additional selections } else if (Packages::using_patterns) { if (! ProductFeatures::GetBooleanFeature ("software", "only_update_installed")) { foreach (string pat, Product::patterns, { y2milestone("Pre-select pattern %1", pat); Pkg::ResolvableInstall( pat, `pattern ); }); } } else // update selections too { Pkg::SetSelection (Update::selected_selection); // -> set the base selection (minimal, default, ....) if (!Update::manual_interaction) { // now compare installed (old) selections against available (new) selections // and set all selections which are installed (old) and available (new) // as 'to be installed' -> UI will show "to be updated" for these selections list available_addons = Pkg::GetSelections (`available, ""); list installed_addons = Pkg::GetSelections (`installed, ""); foreach (string installed, installed_addons, { if (contains (available_addons, installed)) // we have a newer selection for an installed one { Pkg::SetSelection (installed); // update this selection too (selection solving included) } }); } } Packages::SelectProduct(); Pkg::ActivateSelections (); // now go through all selected selections and select their packages // bnc #382208 // bnc#582702 - do not select kernel on update, leave that on dependencies like 'zypper dup' // therefore commented line below out // Packages::SelectKernelPackages (); // FATE #301990, Bugzilla #238488 // Control the upgrade process better map update_sum = Pkg::PkgUpdateAll (GetUpdateConf()); y2milestone ("Update summary: %1", update_sum); Update::unknown_packages = update_sum[`ProblemListSze]:0; list sys_patterns = Packages::ComputeSystemPatternList (); foreach (string pat, sys_patterns, { Pkg::ResolvableInstall (pat, `pattern); }); // this is new, (de)select stuff from the profile list packages = Profile::current["software","packages"]:[]; list patterns = Profile::current["software","patterns"]:[]; list remove_packages = Profile::current["software","remove-packages"]:[]; list remove_patterns = Profile::current["software","remove-patterns"]:[]; foreach (string p, remove_patterns, { Pkg::ResolvableRemove (p, `pattern); }); foreach (string p, remove_packages, { Pkg::ResolvableRemove (p, `package); }); foreach (string p, patterns, { Pkg::ResolvableInstall (p, `pattern); }); foreach (string p, packages, { Pkg::ResolvableInstall (p, `package); }); // old stuff again here if (Pkg::PkgSolve (!Update::onlyUpdateInstalled)) Update::solve_errors = 0; else { Update::solve_errors = Pkg::PkgSolveErrors (); if (Profile::current["upgrade","stop_on_solver_conflict"]:true) AutoinstConfig::Confirm = true; } } // Backup y2internal ("Backup: %1", Profile::current["backup"]:nil); Installation::update_backup_modified = Profile::current["backup","modified"]:true; y2internal ("Backup modified: %1", Installation::update_backup_modified); Installation::update_backup_sysconfig = Profile::current["backup","sysconfig"]:true; Installation::update_remove_old_backups = Profile::current["backup","remove_old"]:false; AutoInstall::TurnOff(); Progress::Finish(); symbol ret = ProductControl::RunFrom ( ProductControl::CurrentStep () + 1, true); if (ret == `next) return `finish; return ret; } 0707010006A4BB000081A40000018F0000018F000000014F103676000016F6000000080000000100000000000000000000004A00000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients/inst_autoinit.ycp/** * File: clients/inst_autoinit.ycp * Package: Auto-installation * Summary: Parses XML Profile for automatic installation * Authors: Anas Nashif * * $Id: inst_autoinit.ycp 62646 2010-10-15 13:14:22Z jsrain $ * */ { textdomain "autoinst"; import "Installation"; import "AutoInstall"; import "AutoinstConfig"; import "ProfileLocation"; import "AutoInstallRules"; import "Progress"; import "Report"; import "Profile"; // import "Arch"; import "Call"; import "Console"; import "Mode"; import "Popup"; include "autoinstall/autoinst_dialogs.ycp"; define symbol processProfile() { Progress::NextStage(); // Initialize Rules Progress::Title(AutoinstConfig::message); AutoInstallRules::Init(); boolean ret = false; Progress::NextStep(); Progress::Title(_("Processing Profiles and Rules")); while (true) { boolean r = ProfileLocation::Process(); if (r) { break; } else { string newURI = ProfileSourceDialog(AutoinstConfig::OriginalURI); if ( newURI == "") { return `abort; } else { AutoinstConfig::ParseCmdLine(newURI); AutoinstConfig::SetProtocolMessage(); continue; } } } /* if (!ProfileLocation::Process()) { y2error("Aborting..."); return `abort; } */ sleep(1000); if(UI::PollInput() == `abort) if (Popup::ConfirmAbort (`painless)) return `abort; Progress::NextStage(); // // Set reporting behaviour to default, changed later if required // Report::LogMessages(true); Report::LogErrors(true); Report::LogWarnings(true); if(UI::PollInput() == `abort) if (Popup::ConfirmAbort (`painless)) return `abort; Progress::NextStage(); Progress::Title( _("Parsing control file")); if (! Profile::ReadXML( AutoinstConfig::xml_tmpfile ) || Profile::current == $[] || Profile::current == nil) { Popup::Error(_("Error while parsing the control file. Check the log files for more details or fix the control file and try again. ")); return `abort; } y2debug ("Autoinstall control file %1", Profile::current ); Progress::NextStage(); Progress::Title(_("Initial Configuration")); Report::Import(Profile::current["report"]:$[]); // // Copy the control file for easy access by user to a pre-defined // directory // SCR::Execute(.target.bash, sformat("cp %1 %2/autoinst.xml", AutoinstConfig::xml_tmpfile, AutoinstConfig::profile_dir)); return `ok; } Console::Init (); string help_text = _("

Please wait while the system is prepared for autoinstallation.

"); list progress_stages = [ _("Probe hardware"), _("Retrieve & Read Control File"), _("Process Profiles and Rules"), _("Parse control file") ]; boolean profileFetched = false; Progress::New( _("Preparing System for Automatic Installation"), "", // progress_title 7 , // progress bar length progress_stages, [], help_text ); Progress::NextStage(); Progress::Title(_("Preprobing stage")); y2milestone("pre probing"); /* // moved to autoset to fulfill fate #301193 // the DASD section in an autoyast profile can't be changed via pre-script // if( Arch::s390 () && AutoinstConfig::remoteProfile == true ) { y2milestone("arch=s390 and remote_profile=true"); symbol ret = processProfile(); if( ret != `ok ) { return ret; } y2milestone("processProfile=ok"); profileFetched = true; // FIXME: the hardcoded stuff should be in the control.xml later if( haskey(Profile::current, "dasd") ) { y2milestone("dasd found"); Call::Function("dasd_auto", ["Import", Profile::current["dasd"]:$[] ]); } if( haskey(Profile::current, "zfcp") ) { y2milestone("zfcp found"); Call::Function("zfcp_auto", ["Import", Profile::current["zfcp"]:$[] ]); } } */ string tmp = (string)SCR::Read (.target.string, "/etc/install.inf"); if (tmp != nil && issubstring( tolower(tmp), "iscsi: 1" ) ) { WFM::CallFunction("inst_iscsi-client", []); } Progress::Title(_("Probing hardware...")); if (! (Mode::autoupgrade() && AutoinstConfig::ProfileInRootPart)) WFM::CallFunction("inst_system_analysis", [] ); AutoInstallRules::ProbeRules(); if( ! profileFetched ) { // if profile is defined, first read it, then probe hardware any autoinstall = SCR::Read(.etc.install_inf.AutoYaST); if (Mode::autoupgrade() && ! (autoinstall != nil && is ( autoinstall , string ) && (string)autoinstall != "")) { AutoinstConfig::ParseCmdLine("file:///mnt/root/autoupg.xml"); AutoinstConfig::ProfileInRootPart = true; } symbol ret = processProfile(); if( ret != `ok ) { return ret; } } if( haskey(Profile::current, "iscsi-client") ) { y2milestone("iscsi-client found"); WFM::CallFunction("iscsi-client_auto", ["Import", Profile::current["iscsi-client"]:$[]] ); WFM::CallFunction("iscsi-client_auto", ["Write"] ); } if(UI::PollInput() == `abort) if (Popup::ConfirmAbort (`painless)) return `abort; // AutoInstall::ProcessSpecialResources(); sleep(1000); Progress::Finish(); return `next; } 0707010006A4B2000081A40000018F0000018F000000014F10367600002BF8000000080000000100000000000000000000005100000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients/inst_system_analysis.ycp/** * File: clients/inst_system_analysis.ycp * Package: Installation * Summary: Installation mode selection, system analysis * Authors: Jiri Srain * Lukas Ocilka * * $Id: inst_system_analysis.ycp 62645 2010-10-15 13:11:23Z jsrain $ * */ { textdomain "installation"; import "Arch"; import "GetInstArgs"; import "Hotplug"; import "InstData"; import "Kernel"; import "Packages"; import "Popup"; import "Product"; import "Progress"; import "Report"; import "Storage"; import "StorageControllers"; import "StorageDevices"; import "Wizard"; import "PackageCallbacks"; include "installation/misc.ycp"; include "packager/storage_include.ycp"; if( Mode::autoinst() || Mode::autoupgrade() ) { Report::Import( $[ "messages":$[ "timeout":10 ], "errors":$[ "timeout":10 ], "warnings":$[ "timeout":10 ]]); } // This dialog in not interactive // always return `back when came from the previous dialog if (GetInstArgs::going_back()) { return `back; } // Function definitions --> // -------------------------------------------------------------- // USB // -------------------------------------------------------------- boolean ActionUSB () { Hotplug::StartUSB (); return true; } // -------------------------------------------------------------- // FireWire (ieee1394) // -------------------------------------------------------------- boolean ActionFireWire () { Hotplug::StartFireWire (); return true; } // -------------------------------------------------------------- // Floppy // -------------------------------------------------------------- boolean ActionFloppyDisks () { StorageDevices::FloppyReady (); return true; } boolean found_controllers = true; // -------------------------------------------------------------- // Hard disk controllers // 1. Probe // 2. Initialize (module loading) // -------------------------------------------------------------- // In live_eval mode, all modules have been loaded by linuxrc. But // they are loaded by StorageControllers::Initialize(). Well, there // also was another reason for skipping StorageControllers::Probe () // but nobody seems to remember more. // -------------------------------------------------------------- boolean ActionHHDControllers () { found_controllers = (StorageControllers::Probe () > 0); return true; } // -------------------------------------------------------------- // Don't abort or even warn if no storage controllers can be // found. Disks might be detected even without proper knowledge // about the controller. There's a warning below if no disks were // found. // -------------------------------------------------------------- boolean ActionLoadModules () { StorageControllers::Initialize (); return true; } // -------------------------------------------------------------- // Hard disks // -------------------------------------------------------------- boolean ActionHDDProbe () { map targetMap = StorageDevices::Probe (true); if (size (targetMap) == 0) { if (found_controllers) { if( !(Mode::autoinst() || Mode::autoupgrade())) { // pop-up error report Report::Error(_("No hard disks were found for the installation. Please check your hardware! ")); } else { Report::Warning(_("No hard disks were found for the installation. During an automatic installation, they might be detected later. (especially on s390 or iSCSI systems) ")); } } else { // pop-up error report Report::Error(_("No hard disks and no hard disk controllers were found for the installation. Check your hardware. ")); } return false; } return true; } boolean EvaluateUpdatePossibilities () { y2milestone ("Product flags: %1", Product::flags); if (contains (Product::flags, "update") || Kernel::GetSuSEUpdate ()) { InstData::offer_update = true; } return true; } boolean SearchForLinuxPartitions () { if (Storage::HaveLinuxPartitions ()) { InstData::have_linux = true; } return true; } boolean packager_initialized = false; boolean InitInstallationRepositoriesReal () { // disable callbacks PackageCallbacks::RegisterEmptyProgressCallbacks(); boolean ret = true; Packages::InitializeCatalogs (); if (Packages::InitFailed ()) { // popup message Popup::Message (_("Failed to initialize the software repositories. Aborting the installation.")); ret = false; } else { packager_initialized = true; Packages::InitializeAddOnProducts (); } // reregister callbacks PackageCallbacks::RestorePreviousProgressCallbacks(); return ret; } boolean InitInstallationRepositories () { //boolean progress_orig = Progress::set (false); //y2milestone ("Pregress was: %1", progress_orig); boolean ret = InitInstallationRepositoriesReal(); //y2milestone ("Adjusting progress: %1", progress_orig); //Progress::set (progress_orig); return ret; } boolean FilesFromOldedSystems () { // FATE #300421: Import ssh keys from previous installations // FATE #120103: Import Users From Existing Partition // FATE #302980: Simplified user config during installation // All needs to be known before configuring users y2milestone ("PreInstallFunctions -- start --"); WFM::CallFunction ("inst_pre_install", []); y2milestone ("PreInstallFunctions -- end --"); return true; } // <-- Function definitions Wizard::SetContents (_("Analyzing the Computer"), `Empty (), "", false, false); Wizard::SetTitleIcon ("yast-controller"); // Do hardware probing // // This must happen before submodule descriptions are initialized; module // constructors might depend on it. // In autoinst mode, this has been called already. list actions_todo = []; list actions_doing = []; list actions_functions = []; list visible_icons = []; y2milestone ("Probing done: %1", Installation::probing_done); if (! Installation::probing_done) { if (!(Arch::s390 () || Arch::board_iseries ())) { // TRANSLATORS: progress step actions_todo = add (actions_todo, _("Probe USB devices")); // TRANSLATORS: progress step actions_doing = add (actions_doing, _("Probing USB devices...")); actions_functions = add (actions_functions, ActionUSB); visible_icons = add (visible_icons, "32x32/apps/yast-usb.png"); // TRANSLATORS: progress step actions_todo = add (actions_todo, _("Probe FireWire devices")); // TRANSLATORS: progress step actions_doing = add (actions_doing, _("Probing FireWire devices...")); actions_functions = add (actions_functions, ActionFireWire); visible_icons = add (visible_icons, "32x32/apps/yast-firewire.png"); // TRANSLATORS: progress step actions_todo = add (actions_todo, _("Probe floppy disks devices")); // TRANSLATORS: progress step actions_doing = add (actions_doing, _("Probing floppy disks devices...")); actions_functions = add (actions_functions, ActionFloppyDisks); visible_icons = add (visible_icons, "32x32/apps/yast-floppy.png"); } // TRANSLATORS: progress step actions_todo = add (actions_todo, _("Probe hard disk controllers")); // TRANSLATORS: progress step actions_doing = add (actions_doing, _("Probing hard disk controllers...")); actions_functions = add (actions_functions, ActionHHDControllers); visible_icons = add (visible_icons, "32x32/apps/yast-hdd-controller.png"); // TRANSLATORS: progress step actions_todo = add (actions_todo, _("Load kernel modules for hard disk controllers")); // TRANSLATORS: progress step actions_doing = add (actions_doing, _("Loading kernel modules for hard disk controllers...")); actions_functions = add (actions_functions, ActionLoadModules); visible_icons = add (visible_icons, "32x32/apps/yast-hdd-controller-kernel-module.png"); // TRANSLATORS: progress step actions_todo = add (actions_todo, _("Probe hard disks")); // TRANSLATORS: progress step actions_doing = add (actions_doing, _("Probing hard disks...")); actions_functions = add (actions_functions, ActionHDDProbe); visible_icons = add (visible_icons, "32x32/apps/yast-hdd.png"); WFM::CallFunction("inst_features", []); } // TRANSLATORS: progress step actions_todo = add (actions_todo, _("Search for Linux partitions")); // TRANSLATORS: progress step actions_doing = add (actions_doing, _("Searching for Linux partitions...")); actions_functions = add (actions_functions, SearchForLinuxPartitions); visible_icons = add (visible_icons, "32x32/apps/yast-search-linux-partition.png"); // TRANSLATORS: progress step actions_todo = add (actions_todo, _("Search for system files")); // TRANSLATORS: progress step actions_doing = add (actions_doing, _("Searching for system files...")); // FATE #302980: Simplified user config during installation actions_functions = add (actions_functions, FilesFromOldedSystems); visible_icons = add (visible_icons, "32x32/apps/yast-system-files.png"); // TRANSLATORS: progress step actions_todo = add (actions_todo, _("Evaluate update possibility")); // TRANSLATORS: progress step actions_doing = add (actions_doing, _("Evaluating update possibility...")); actions_functions = add (actions_functions, EvaluateUpdatePossibilities); visible_icons = add (visible_icons, "32x32/apps/yast-update-possibility.png"); // TRANSLATORS: progress step actions_todo = add (actions_todo, _("Initialize package manager")); // TRANSLATORS: progress step actions_doing = add (actions_doing, _("Initializing package manager...")); actions_functions = add (actions_functions, InitInstallationRepositories); visible_icons = add (visible_icons, "32x32/apps/yast-package-manager.png"); Progress::NewProgressIcons ( // TRANSLATORS: dialog caption _("System Probing"), " ", size (actions_todo), actions_todo, actions_doing, // TRANSLATORS: dialog help _("Please wait while computer hardware and installed systems are being probed..."), [visible_icons] ); foreach (any run_function, actions_functions, { Progress::NextStage(); // Bugzilla #298049 // Allow to abort the probing any ui_ret = UI::PollInput(); if (ui_ret == `abort) { y2milestone ("Abort pressed"); if (Popup::ConfirmAbort (`painless)) { y2warning ("User decided to abort the installation"); return `abort; } } y2milestone ("Running function: %1", run_function); boolean () run_this = (boolean()) (run_function); boolean ret = run_this(); y2milestone ("Function %1 returned %2", run_function, ret); }); Installation::probing_done = true; Progress::Finish(); sleep (500); if (! packager_initialized) { return `abort; } y2milestone ("Have Linux: %1, Offer Update: %2", InstData::have_linux, InstData::offer_update); return `next; /* EOF */ } 0707010006A4B9000081A40000018F0000018F000000014F103676000026AD000000080000000100000000000000000000004800000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients/inst_finish.ycp/** * File: clients/inst_finish.ycp * Package: installation * Summary: Finish installation * Authors: Klaus Kämpf * Arvin Schnell * Jiri Srain * * $Id: inst_finish.ycp 62221 2010-07-12 11:52:46Z jsrain $ * * Writes: * [target] /var/lib/YaST2/runme_at_boot run yast2 after initial boot * SCR::Write (.etc.shadow.root, */ { textdomain "installation"; import "AddOnProduct"; import "WorkflowManager"; import "Installation"; import "Linuxrc"; import "Misc"; import "Mode"; import "Stage"; import "Popup"; import "ProductControl"; import "Progress"; import "Report"; import "Wizard"; import "String"; import "GetInstArgs"; import "ProductFeatures"; // added for fate# 303395 import "Directory"; if (GetInstArgs::going_back()) return `auto; boolean test_mode = false; if (size (WFM::Args()) > 0 && is (WFM::Args(0), string)) { y2milestone ("Args: %1", WFM::Args()); if (WFM::Args(0) == "test") test_mode = true; } if (test_mode) Wizard::CreateDialog(); // Help text for last dialog of base installation string help_text = _("

Please wait while the base system is being installed.

"); Wizard::SetContents ( _("Finishing Basic Installation"), `Label (_("Preparing installation finish-scripts...")), help_text, false, false ); // Used later in 'stages' definition Pkg::TargetInit (Installation::destdir, true); list > stages = [ $[ "id" : "copy_files", // progress stage "label" : _("Copy files to installed system"), "steps" : [ "autoinst_scripts1", "mouse", "copy_files", "copy_systemfiles", // For live installer only (Mode::live_installation() ? "live_copy_files":""), "switch_scr", ], "icon" : "pattern-basis", ], $[ "id" : "save_config", // progress stage "label" : _("Save configuration"), "steps" : [ "ldconfig", "save_config", // For live installer only (Mode::live_installation() ? "live_save_config":""), "runlevel", "desktop", "fonts", "storage", "iscsi-client", "kernel", "x11", "proxy", "pkg", "driver_update1", // bnc #340733 "system_settings", ], "icon" : "yast-desktop-select", ], $[ "id" : "install_bootloader", // progress stage "label" : _("Install boot manager"), "steps" : [ "bootloader", ((ProductFeatures::GetBooleanFeature ("globals", "enable_kdump") == true) ? "kdump" : "") ], "icon" : "yast-bootloader", ], $[ "id" : "save_settings", // progress stage "label" : _("Save installation settings"), "steps" : [ "yast_inf", "network", "ntp-client", "ssh_settings", "save_hw_status", "users", "autoinst_scripts2", "installation_settings", ], "icon" : "yast-network", ], $[ "id" : "prepare_for_reboot", // progress stage "label" : _("Prepare system for initial boot"), "steps" : [ // For live installer only (Mode::live_installation() ? "live_runme_at_boot":""), // vm_finish called only if yast2-vm is installed // Can't use PackageSystem::Installed as the current SCR is attached to inst-sys // instead of the installed system (Pkg::PkgInstalled ("yast2-vm") ? "vm":""), "driver_update2", // no second stage if possible "pre_umount", // copy logs just before 'umount' // keeps maximum logs available after reboot "copy_logs", "umount", ], // bnc #438154 "icon" : (Mode::live_installation() ? "yast-live-install-finish":"yast-scripts"), ], ]; if (size (ProductControl::inst_finish) > 0) { y2milestone ("Using inst_finish steps definition from control file"); stages = ProductControl::inst_finish; // Inst-finish need to be translated (#343783) string textdom = ProductControl::productControl["textdomain"]:"control"; list > stages_copy = stages; y2milestone ("Inst finish stages before: %1", stages); integer counter = -1; // going through copy, the original is going to be changed in the loop foreach (map one_stage, stages_copy, { counter = counter + 1; string label = one_stage["label"]:""; if (label == nil || label == "") return; string loc_label = dgettext (textdom, label); // if translated if (loc_label != nil && loc_label != "" && loc_label != label) { stages[counter, "label"] = loc_label; } }); y2milestone ("Inst finish stages after: %1", stages); } else { y2milestone ("inst_finish steps definition not found in control file"); } // merge steps from add-on products // bnc #438678 stages[0, "steps"] = merge ( WorkflowManager::GetAdditionalFinishSteps("before_chroot"), stages[0, "steps"]:[] ); stages[1, "steps"] = merge ( WorkflowManager::GetAdditionalFinishSteps("after_chroot"), stages[1, "steps"]:[] ); stages[3, "steps"] = merge ( stages[3, "steps"]:[], WorkflowManager::GetAdditionalFinishSteps("before_umount") ); symbol run_type = `installation; if (Mode::update ()) run_type = `update; else if (Mode::autoinst ()) run_type = `autoinst; else if (Mode::live_installation ()) run_type = `live_installation; integer steps_count = 0; stages = maplist (map stage, stages, { list steps = maplist (string s, stage["steps"]:[], { // some steps are called in live installer only if (s == "" || s == nil) { return nil; } s = s + "_finish"; if (! WFM::ClientExists (s)) { y2error ("Missing YCP client: %1", s); return nil; } y2milestone ("Calling inst_finish script: %1 (Info)", s); boolean orig = Progress::set (false); map info = (map) WFM::CallFunction (s, ["Info"]); if (test_mode == true) { y2milestone ("Test mode, forcing run"); info["when"] = [`installation, `update, `autoinst]; } Progress::set (orig); if (info == nil) { y2error ("Client %1 returned invalid data", s); return nil; } if (info["when"]:nil != nil && ! contains (info["when"]:[], run_type) && // special hack for autoupgrade - should be as regular upgrade as possible, scripts are the only exception (!(Mode::autoupgrade() && contains (info["when"]:[], `autoupg))) ) return nil; y2milestone ("inst_finish client %1 will be called", s); info["client"] = s; steps_count = steps_count + info["steps"]:1; return info; }); stage["steps"] = filter (map s, steps, { return s != nil; }); return stage; }); y2milestone ("These inst_finish stages will be called:"); foreach (map stage, stages, { y2milestone ("Stage: %1", stage); }); stages = filter (map s, stages, { return size (s["steps"]:[]) > 0; }); list stage_names = maplist (map s, stages, { return s["label"]:""; }); Progress::New ( // Headline for last dialog of base installation: Install LILO etc. _("Finishing Basic Installation"), "", // Initial progress bar label - not empty (reserve space!) steps_count, stage_names, [], help_text ); Wizard::DisableBackButton (); Wizard::DisableNextButton (); Wizard::SetTitleIcon ("yast-sysconfig"); boolean aborted = false; foreach (map stage, stages, { if (stage["icon"]:"" != "") Wizard::SetTitleIcon (stage["icon"]:""); Progress::NextStage (); boolean first = true; foreach (map step, stage["steps"]:[], { integer scount = step["steps"]:1; if (scount != 0) { if (first) first = false; else Progress::NextStep (); } if (haskey (step, "title")) Progress::Title (step["title"]:""); boolean orig = Progress::set (false); if (test_mode == true) { y2milestone ("Test-mode, skipping WFM::CallFunction (%1, ['Write'])", step["client"]:""); sleep (500); } else { WFM::CallFunction (step["client"]:"", ["Write"]); } Progress::set (orig); if (UI::PollInput () == `abort && Popup::ConfirmAbort (`incomplete)) { aborted = true; break; } }); if (aborted) break; }); if (aborted) { y2milestone ("inst_finish aborted"); return `abort; } Progress::Finish(); Progress::Title (_("Finished.")); // -------------------------------------------------------------- // Check if there is a message left to display // and display it, if necessary // Do not call any SCR, it's already closed! if (size (Misc::boot_msg) > 0 && !Mode::autoinst ()) { // bugzilla #245742, #160301 if ((Linuxrc::usessh () && !Linuxrc::vnc()) // also live installation - bzilla #297691 || Mode::live_installation ()) { // Display the message and wait for user to accept it Report::DisplayMessages (true, 0); } else Report::DisplayMessages (true, 10); Report::Message (Misc::boot_msg); Misc::boot_msg = ""; } if (test_mode) { Wizard::CloseDialog(); return `auto; } // fate #303395: Use kexec to avoid booting between first and second stage // run new kernel via kexec instead of reboot // command for reading kernel_params string cmd = sformat("ls '%1/kexec_done' |tr -d '\n'", String::Quote (Directory::vardir)); y2milestone("Checking flag of successful loading kernel via command %1", cmd); map out = (map)WFM::Execute(.local.bash_output, cmd); cmd = sformat("%1/kexec_done",Directory::vardir); // check output if (out["stdout"]:"" != cmd) { y2milestone ("File kexec_done was not found, output: %1", out); return `next; } // hack for using kexec switch to console 1 cmd = sformat ("chvt 1"); y2milestone("Switch to console 1 via command: %1", cmd); // switch to console 1 out = (map)WFM::Execute(.local.bash_output, cmd); // check output if (out["exit"]:nil != 0) { y2error ("Switching failed, output: %1", out); return `next; } // waiting s for switching... sleep(1000); return `next; } // EOF 0707010006A4B5000081A40000018F0000018F000000014F10367600008F7F000000080000000100000000000000000000004A00000000linux/suse/i386-sles11/inst-sys/usr/share/YaST2/clients/inst_proposal.ycp/** * File: clients/inst_proposal.ycp * Module: Installation * Summary: Create and display proposal * Authors: Stefan Hundhammer * Arvin Schnell * Jiri Srain * Lukas Ocilka * * $Id: inst_proposal.ycp 62221 2010-07-12 11:52:46Z jsrain $ * * Create and display reasonable proposal for basic * installation and call sub-workflows as required * on user request. * * See also file proposal-API.txt for details. */ { textdomain "installation"; import "Label"; import "Mode"; import "Stage"; import "AutoinstConfig"; import "Wizard"; import "HTML"; import "Popup"; import "Language"; import "GetInstArgs"; include "installation/misc.ycp"; define void retranslate_proposal_dialog(); define symbol load_matching_submodules_list(); define boolean get_submod_descriptions_and_build_menu(); define void make_proposal( boolean force_reset, boolean language_changed ); define string format_sub_proposal( map prop ); define void build_dialog (); define void set_icon(); define string help_text(); // values used in defined functions map proposal_properties = $[]; list submodules = []; list submodules_presentation = []; map mod2tab = $[]; // module -> tab it is in list display_only_modules = []; // modules which do not have propose, but only summary integer current_tab = 0; // ID of current tab boolean has_tab = false; // true if is tabbed proposal map html = $[]; // proposals of all modules - HTML part list present_only = []; list locked_modules = []; list titles = []; map submod2id = $[]; map id2submod = $[]; map link2submod = $[]; boolean have_blocker = false; string proposal_mode = ""; // FATE #301151: Allow YaST proposals to have help texts map submodule_helps = $[]; symbol proposal_result = nil; // skip if not interactive mode. if (!AutoinstConfig::Confirm && (Mode::autoinst () || Mode::autoupgrade ())) { return `auto; } /** * Display preformatted proposal in the RichText widget * * @param proposal human readable proposal preformatted in HTML **/ define void display_proposal( string proposal ) ``{ if (UI::WidgetExists (`id(`proposal))) { UI::ChangeWidget(`id(`proposal), `Value, proposal ); } else { y2error (-1, "Widget `proposal does not exist"); } }; void CheckAndCloseWindowsLeft () { if (! UI::WidgetExists (`id (`proposal))) { y2error (-1, "Widget `proposal is not active!!!"); y2milestone ("--- Current widget tree ---"); UI::DumpWidgetTree(); y2milestone ("--- Current widget tree ---"); } } /** * Call a submodule's MakeProposal() function. * * @param submodule name of the submodule's proposal dispatcher * @param force_reset discard any existing (cached) proposal * @param language_changed installation language changed since last call * @return proposal_map see proposal-API.txt **/ define map submod_make_proposal( string submodule, boolean force_reset, boolean language_changed ) ``{ UI::BusyCursor(); map proposal = (map) WFM::CallFunction ( submodule, [ "MakeProposal", $[ "force_reset" : force_reset, "language_changed" : language_changed ] ] ); y2debug( "%1 MakeProposal() returns %2", submodule, proposal ); // There might be some UI layers left // we need to close them CheckAndCloseWindowsLeft(); UI::NormalCursor(); return proposal; }; /** * Call a submodule's AskUser() function. * * @param submodule name of the submodule's proposal dispatcher * @param has_next force a "next" button even if the submodule would otherwise rename it * @return workflow_sequence see proposal-API.txt **/ define symbol submod_ask_user( string submodule, map additional_info ) ``{ // Call the AskUser() function map ask_user_result = (map) WFM::CallFunction( submodule, [ "AskUser", additional_info ] ); symbol workflow_sequence = ask_user_result["workflow_sequence"]:`next; boolean language_changed = ask_user_result["language_changed"]:false; boolean mode_changed = ask_user_result["mode_changed"]:false; boolean rootpart_changed = ask_user_result["rootpart_changed"]:false; if (workflow_sequence != `cancel && workflow_sequence != `back && workflow_sequence != `abort && workflow_sequence != `finish) { if ( language_changed ) { retranslate_proposal_dialog(); Pkg::SetLocale (Language::language); Pkg::SetAdditionalLocales ([Language::language]); } /* if (mode_changed || rootpart_changed || workflow_sequence == `finish) { RootPart::UnmountPartitions (false); } */ if (mode_changed) { Wizard::SetHelpText (help_text ()); build_dialog(); load_matching_submodules_list(); if (!get_submod_descriptions_and_build_menu ()) { y2error ("i'm in dutch"); } } // Make a new proposal based on those user changes make_proposal( false, language_changed ); } // There might be some UI layers left // we need to close them CheckAndCloseWindowsLeft(); return workflow_sequence; }; /** * Call a submodule's Description() function. * * @param submodule name of the submodule's proposal dispatcher or nil if no such module * @return description_map see proposal-API.txt **/ define map submod_description (string submodule) ``{ UI::BusyCursor(); map description = (map) WFM::CallFunction( submodule, [ "Description", $[] ] ); // There might be some UI layers left // we need to close them CheckAndCloseWindowsLeft(); UI::NormalCursor(); return description; }; void SubmoduleHelp (map & prop_map, string & submod) { if (haskey (prop_map, "help")) { boolean use_this_help = false; // using tabs if (haskey (mod2tab, submod)) { // visible in the current tab if (mod2tab[submod]:999 == current_tab) { use_this_help = true; } // not using tabs } else { use_this_help = true; } if (use_this_help) { y2milestone("Submodule '%1' has it's own help", submod); string own_help = prop_map["help"]:""; if (own_help == nil) { y2error ("Help text cannot be 'nil'"); } else if (own_help == "") { y2milestone ("Skipping empty help"); } else { submodule_helps[submod] = prop_map["help"]:""; } } } } /** * Call each submodule's MakeProposal() function in turn and display the * proposals in the RichText widget. * * @param force_reset discard any existing (cached) proposal * @param language_changed installation language changed since last call **/ define void make_proposal( boolean force_reset, boolean language_changed ) ``{ integer tab_to_switch = 999; boolean current_tab_affected = false; integer no = 0; map prop_map = $[]; boolean skip_the_rest = false; have_blocker = false; link2submod = $[]; UI::ReplaceWidget (`id ("inst_proposal_progress"), `ProgressBar (`id ("pb_ip"), "", 2 * size (submodules), 0)); integer submodule_nr = 0; html = $[]; foreach ( string submod, submodules, ``{ string prop = ""; if (!contains(locked_modules, submod)) { string heading = issubstring ( titles[no]:"", " tab_to_switch || tab_to_switch == 999) { tab_to_switch = mod2tab[submod]:999; } if (mod2tab[submod]:999 == current_tab) { current_tab_affected = true; } } } // update link map if (haskey (prop_map, "links")) { foreach ( string link, prop_map["links"]:[], ``{ link2submod[link] = submod; }); } } if ( prop_map["language_changed"]:false && ! skip_the_rest) { skip_the_rest = true; retranslate_proposal_dialog(); make_proposal( force_reset, true ); } if ( ! skip_the_rest ) { prop = prop + format_sub_proposal( prop_map ); html[submod] = prop; // now do the complete html string proposal = ""; foreach (string mod, submodules_presentation, ``{ proposal = proposal + html[mod]:""; }); display_proposal( proposal ); // display_proposal( prop ); no = no + 1; } if ( prop_map["warning_level"]:`none == `fatal ) { skip_the_rest = true; } submodule_nr = submodule_nr + 1; UI::ChangeWidget (`id ("pb_ip"), `Value, submodule_nr); }); // FATE #301151: Allow YaST proposals to have help texts if (size(submodule_helps) > 0) { Wizard::SetHelpText (help_text ()); } if (has_tab && tab_to_switch < 999 && ! current_tab_affected) { // FIXME copy-paste from event loop (but for last 2 lines) current_tab = tab_to_switch; load_matching_submodules_list(); string proposal = ""; foreach (string mod, submodules_presentation, ``{ proposal = proposal + html[mod]:""; }); display_proposal( proposal ); get_submod_descriptions_and_build_menu (); y2milestone("Switching to tab '%1'", current_tab); if (UI::HasSpecialWidget (`DumbTab)) { if (UI::WidgetExists(`_cwm_tab)) { UI::ChangeWidget (`id (`_cwm_tab), `CurrentItem, current_tab); } else { y2warning ("Widget with id %1 does not exist!", `_cwm_tab); } } } // now do the display-only proposals UI::ReplaceWidget (`id ("inst_proposal_progress"), `Empty()); Wizard::EnableNextButton (); UI::NormalCursor(); }; /** * Format a submodule's proposal in HTML * * @param prop proposal map - see proposal-API.txt * @return HTML string **/ define string format_sub_proposal( map prop ) ``{ string html = ""; string warning = prop["warning"]:""; if ( warning != nil && warning != "" ) { symbol level = prop["warning_level"]:`warning; if ( level == `notice ) warning = HTML::Bold( warning ); else if ( level == `warning ) warning = HTML::Colorize( warning, "red" ); else if ( level == `error ) warning = HTML::Colorize( warning, "red" ); else if ( level == `blocker || level == `fatal ) { have_blocker = true; warning = HTML::Colorize( warning, "red" ); } html = html + HTML::Para( warning ); } string preformatted_prop = prop["preformatted_proposal"]:""; if (preformatted_prop == nil) preformatted_prop = ""; if ( preformatted_prop != "" ) { html = html + preformatted_prop; } else { // fallback proposal, means usually an internal error list raw_prop = prop["raw_proposal"]:[_("ERROR: No proposal")]; html = html + HTML::List( raw_prop ); } return html; }; /** * Call a submodule's Write() function. * * @param submodule name of the submodule's proposal dispatcher * @return success true if Write() was successful of if there is no Write() function **/ define boolean submod_write_settings( string submodule ) ``{ map result = (map) WFM::CallFunction( submodule, [ "Write", $[] ] ); if ( result == nil ) result = $[]; return result["success"]:true; }; /** * Call each submodule's "Write()" function to let it write its settings, * i.e. the settings effective. **/ define void write_settings() ``{ boolean success = true; foreach (string submod, submodules, ``{ boolean submod_success = submod_write_settings( submod ); if (submod_success == nil) submod_success = true; if ( ! submod_success ) y2error( "Write() failed for submodule %1", submod ); success = success && submod_success; }); if ( ! success ) { y2error( "Write() failed for one or more submodules" ); // Submodules handle their own error reporting // text for a message box Popup::TimedMessage( _("Configuration saved.\nThere were errors."), 3 ); } // else // { // // text for a message box // Popup::TimedMessage( _("Configuration saved successfully."), 3 ); // } }; /** * Force a RichText widget to use the busy cursor * * @param widget_id ID of the widget, e.g. `id(`proposal) **/ define void richtext_busy_cursor( any widget_id ) ``{ if (is(widget_id, symbol)) { UI::ChangeWidget( (symbol) widget_id, `Enabled, false ); } else { UI::ChangeWidget( (term) widget_id, `Enabled, false ); } }; /** * Switch a RichText widget back to use the normal cursor * * @param widget_id ID of the widget, e.g. `id(`proposal) **/ define void richtext_normal_cursor( any widget_id ) ``{ if (is(widget_id, symbol)) { UI::ChangeWidget( (symbol) widget_id, `Enabled, true ); } else { UI::ChangeWidget( (term) widget_id, `Enabled, true ); } }; /** * Retranslate the proposal (wizard) dialog after the language is changed. **/ define void retranslate_proposal_dialog() ``{ y2debug( "Retranslating proposal dialog" ); build_dialog(); ProductControl::RetranslateWizardSteps(); Wizard::RetranslateButtons(); get_submod_descriptions_and_build_menu(); }; /** * Load a list of submodules matching the current internal states * * @return submodules_list list of submodule names (strings) **/ define symbol load_matching_submodules_list() ``{ list< list > modules = []; modules = ProductControl::getProposals ( Stage::stage (), Mode::mode (), proposal_mode ); if (modules == nil ) { y2error("Error loading proposals"); return `abort; } locked_modules = ProductControl::getLockedProposals (Stage::stage (), Mode::mode (), proposal_mode); y2milestone("getting proposals for stage: \"%1\" mode: \"%2\" proposal type: \"%3\"", Stage::stage (), Mode::mode (), proposal_mode ); proposal_properties = ProductControl::getProposalProperties(Stage::stage (), Mode::mode (), proposal_mode); if (size(modules) == 0 ) { y2error("No proposals available"); return `abort; } // in normal mode we don't want to switch between installation and update if (Mode::normal ()) { modules = filter (list v, modules, ``(v[0]:"" != "mode_proposal")); } // now create the list of modules and order of modules for presentation submodules = maplist (list mod, modules, ``(mod[0]:"") ); y2milestone ("Execution order: %1", submodules); if (has_tab) { y2milestone ("Proposal uses tabs"); map data = ProductControl::getProposalProperties ( Stage::stage (), Mode::mode (), proposal_mode ); submodules_presentation = data["proposal_tabs", current_tab, "proposal_modules"]:[]; // All proposal file names end with _proposal submodules_presentation = maplist (string m, submodules_presentation, { if (!issubstring(m, "_proposal")) m = m + "_proposal"; return m; }); integer index = -1; mod2tab = $[]; list > tmp_all_submods = maplist (map tab, data["proposal_tabs"]:[], { index = index + 1; foreach (string m, tab["proposal_modules"]:[], { if (!issubstring(m, "_proposal")) m = m + "_proposal"; if (index < mod2tab[m]:999) mod2tab[m] = index; }); return tab["proposal_modules"]:[]; }); list all_submods = flatten (tmp_all_submods); all_submods = maplist (string m, all_submods, { if (!issubstring(m, "_proposal")) m = m + "_proposal"; return m; }); display_only_modules = filter (string m, all_submods, { return ! contains (submodules, m); }); submodules = (list)merge (submodules, display_only_modules); list p = AutoinstConfig::getProposalList(); submodules_presentation = filter (string v, submodules_presentation, { return ( contains( p, v ) || p == [] ); }); } else { y2milestone ("Proposal doesn't use tabs"); // sort modules according to presentation ordering modules = sort (list mod1, list mod2, modules, ``( mod1[1]:50 < mod2[1]:50 )); // setup the list submodules_presentation = maplist (list mod, modules, ``(mod[0]:"") ); list p = AutoinstConfig::getProposalList(); submodules_presentation = filter (string v, submodules_presentation, { return ( contains( p, v ) || p == [] ); }); } y2milestone ("Presentation order: %1", submodules_presentation); y2milestone ("Execution order: %1", submodules); }; /** * Find out if the target machine has a network card. * @return true if a network card is found, false otherwise **/ define boolean have_network_card() ``{ // Maybe obsolete if ( Mode::test () ) return true; return size( (list) SCR::Read(.probe.netcard) ) > 0; }; /** * Create the proposal dialog * (the inner part, excluding the wizard frame) **/ define void build_dialog () { // headline for installation proposal string headline = proposal_properties["label"]:""; y2milestone("headline: %1", headline ); if ( headline == "") { // dialog headline headline = _("Installation Overview"); } else { headline = dgettext( ProductControl::getProposalTextDomain() , headline ); } // icon for installation proposal string icon = ""; /* radiobuttons */ term skip_buttons = `RadioButtonGroup ( `VBox ( `VSpacing(1), `Left(`RadioButton(`id(`skip), `opt(`notify), // Check box: Skip all the configurations in this dialog - // do this later manually or not at all // Translators: About 40 characters max, // use newlines for longer translations. // radio button _("&Skip Configuration"), false)), `Left(`RadioButton(`id(`dontskip), `opt(`notify), // radio button _("&Use Following Configuration"), true)), `VSpacing(1) ) ); /* change menu */ term menu_box = `VBox ( `HBox ( `HStretch (), `ReplacePoint(`id(`rep_menu), // menu button `MenuButton(`id(`menu_dummy), _("&Change..."), [`item(`id(`dummy), "" ) ] ) ), `HStretch () ), `ReplacePoint (`id ("inst_proposal_progress"), `Empty()) ); term vbox = nil; boolean enable_skip = true; if (haskey(proposal_properties, "enable_skip")) { enable_skip = proposal_properties["enable_skip"]:"yes" == "yes"; } else { if (proposal_mode == "initial" || proposal_mode == "uml") enable_skip = false; else enable_skip = true; } term rt = `RichText( `id(`proposal), // Initial contents of proposal subwindow while proposals are calculated HTML::Newlines( 3 ) + HTML::Para( _("Analyzing your system...") ) ); map data = ProductControl::getProposalProperties ( Stage::stage (), Mode::mode (), proposal_mode ); if (haskey (data, "proposal_tabs")) { has_tab = true; integer index = -1; list tabs = data["proposal_tabs"]:[]; list tab_ids = maplist (map tab, tabs, { index = index + 1; return index; }); if (UI::HasSpecialWidget (`DumbTab)) { list panes = maplist (integer t, tab_ids, { string label = tabs[t, "label"]:"Tab"; return `item (`id (t), label, t == 0); }); rt = `DumbTab (`id (`_cwm_tab), panes, rt); } else { term tabbar = `HBox (); foreach (integer t, tab_ids, { string label = tabs[t, "label"]:"Tab"; tabbar = add (tabbar, `PushButton (`id (t), label)); }); rt = `VBox (`Left(tabbar), `Frame( "", rt)); } } else { has_tab = false; } if (!enable_skip) { vbox = `VBox( // Help message between headline and installation proposal / settings summary. // May contain newlines, but don't make it very much longer than the original. `Left( `Label( _("Click any headline to make changes or use the \"Change...\" menu below.") ) ), rt, menu_box ); } else { vbox = `VBox( skip_buttons, `HBox ( `HSpacing (4), rt ), menu_box ); } Wizard::SetContents(headline, vbox, help_text(), GetInstArgs::enable_back(), // have_back_button false // have_next_button ); set_icon(); if (UI::HasSpecialWidget (`DumbTab)) { if (UI::WidgetExists(`_cwm_tab)) { UI::ChangeWidget (`id (`_cwm_tab), `CurrentItem, current_tab); } else { y2milestone ("Not using CWM tabs..."); } } if ( Stage::stage () == "initial" ) // push button Wizard::ShowReleaseNotesButton (_("&Show Release Notes"), "rel_notes"); } /** * Query all submodules about their descriptions, build a "Change" menu * from that, and cache the descriptions for further usage: They will * become hyperlinks in the RichText widget, too. Return false if no * submodule exists. **/ define boolean get_submod_descriptions_and_build_menu() ``{ list menu_list = []; list new_submodules = []; integer no = 1; titles = []; map descriptions = $[]; foreach(string submod, submodules, ``{ map description = submod_description( submod ); if ( description == nil ) { y2milestone( "Submodule %1 not available (not installed?)", submod ); } else { if ( description != $[] ) { description["no"] = no; descriptions[submod] = description; new_submodules = add( new_submodules, submod ); string title = description["rich_text_title"]:description["rich_text_raw_title"]:submod; string id = description["id" ]:sformat( "module_%1", no ); titles = add( titles, title ); submod2id[submod] = id; id2submod[id] = submod; no = no + 1; } } }); submodules = new_submodules; // maybe some submodules are not installed y2milestone ("Execution order after rewrite: %1", submodules); // now build the menu button foreach (string submod, submodules_presentation, { map descr = descriptions[submod]:$[]; if (descr != $[]) { integer no = descr["no"]:0; string id = descr["id"]:sformat( "module_%1", no); if (haskey (descr, "menu_titles")) { foreach (map i, descr["menu_titles"]:[], { string id = i["id"]:""; string title = i["title"]:""; if (id != "" && title != "") { menu_list = add (menu_list, `item (`id (id), title + "...")); } else { y2error ("Invalid menu item: %1", i); } }); } else { string menu_title = descr["menu_title"]:descr["rich_text_title"]:submod; menu_list = add( menu_list, `item(`id( id ), menu_title + "..." )); } } }); // menu button item menu_list = add( menu_list, `item(`id(`reset_to_defaults), _("&Reset to defaults") ) ); // menu button UI::ReplaceWidget(`id(`rep_menu), `MenuButton(`id(`menu), _("&Change..."), menu_list ) ); return no > 1; }; /** * Set an appropriate wizard icon for the current proposal mode. * * .desktop files may or may not be available (e.g. in the inst-sys they are not), * so use icon names directly rather than looking them up in the .desktop file * with Wizard::SetDesktopIcon(). **/ define void set_icon() { string icon = "yast-software"; if ( proposal_mode == "network" ) icon = "yast-network"; else if ( proposal_mode == "hardware" ) icon = "yast-controller"; else if ( proposal_properties["icon"]:"" != "" ) icon = proposal_properties["icon"]:""; // else if ( proposal_mode == `uml ) icon = ""; // else if ( proposal_mode == `dirinstall ) icon = ""; Wizard::SetTitleIcon( icon ); }; /** * Help text for proposal dialog. * * @return string help text **/ define string help_text() ``{ string help_text_string = ""; // General part of the help text for all types of proposals string how_to_change = _("

Change the values by clicking on the respective headline or by using the Change... menu.

"); if ( proposal_mode == "initial" && Mode::installation () ) { // Help text for installation proposal // General part ("You can change values...") is added as the next paragraph. help_text_string = _("

Select Install to perform a new installation with the values displayed.

") + how_to_change; // kicking out, bug #203811 // no such headline // // Help text for installation proposal, continued // help_text_string = help_text_string + _("

//To update an existing &product; system instead of doing a new install, //click the Mode headline or select Mode in the //Change... menu. //

//"); /** * Deliberately omitting "boot installed system" here to avoid * confusion: The user will be prompted for that if Linux * partitions are found. * - sh@suse.de 2002-02-26 **/ // Help text for installation proposal, continued help_text_string = help_text_string + _("

Your hard disk has not been modified in any way, so you can still safely abort.

"); } else if ( proposal_mode == "initial" && Mode::update () ) { // Help text for update proposal // General part ("You can change values...") is added as the next paragraph. help_text_string = _("

Select Update to perform an update with the values displayed.

") + how_to_change; /** * Deliberately omitting "boot installed system" here to avoid * confusion: The user will be prompted for that if Linux * partitions are found. * - sh@suse.de 2002-02-26 **/ // Help text for installation proposal, continued help_text_string = help_text_string + _("

Your hard disk has not been modified in any way, so you can still safely abort.

"); } else if ( proposal_mode == "network" ) { // Help text for network configuration proposal // General part ("You can change values...") is added as the next paragraph. help_text_string = _("

Put the network settings into effect by pressing Next.

") + how_to_change; } else if ( proposal_mode == "service" ) { // Help text for service configuration proposal // General part ("You can change values...") is added as the next paragraph. help_text_string = _("

Put the service settings into effect by pressing Next.

") + how_to_change; } else if ( proposal_mode == "hardware" ) { // Help text for hardware configuration proposal // General part ("You can change values...") is added as the next paragraph. help_text_string = _("

Put the hardware settings into effect by pressing Next.

") + how_to_change; } else if (proposal_mode == "uml") { // Proposal in uml module help_text_string = _("

UML Installation Proposal

") // help text + _("

UML (User Mode Linux) installation allows you to start independent Linux virtual machines in the host system.

"); } else if (proposal_properties["help"]:"" != "") { // Proposal help from control file module help_text_string = dgettext( ProductControl::getProposalTextDomain() , proposal_properties["help"]:"") + how_to_change; } else { // Generic help text for other proposals (not basic installation or // hardhware configuration. // General part ("You can change values...") is added as the next paragraph. help_text_string = _("

To use the settings as displayed, press Next.

") + how_to_change; } if (size(locked_modules) > 0 ) { // help text help_text_string = help_text_string + _("

Some proposals might be locked by the system administrator, so cannot be changed. To change a proposal that is locked, ask your system administrator.

"); } foreach (string submod, submodules_presentation, { if (submodule_helps[submod]:"" != "") { help_text_string = help_text_string + submodule_helps[submod]:""; } }); return help_text_string; }; /*-----------------------------------------------------------------------*/ /* main() */ /*-----------------------------------------------------------------------*/ // // Create dialog // // This is done as early as possible for instant feedback, even though the // menu is still empty. Fortunately enough, nobody will notice this since // we also disable it until everything in there is known. This is to be // done before even the submodule descriptions are known since they usually // are in separate YCP files that liberally import other YCP modules which // in turn takes considerable time for the module constructors. // y2milestone( "Installation step #2" ); proposal_mode = GetInstArgs::proposal(); if (contains (ProductControl::GetDisabledProposals(), proposal_mode)) return `auto; proposal_properties = ProductControl::getProposalProperties(Stage::stage (), Mode::mode (), proposal_mode); build_dialog(); // // Get submodule descriptions // proposal_result = load_matching_submodules_list(); if (proposal_result == `abort) return `abort; UI::ChangeWidget(`id(`menu_dummy), `Enabled, false ); richtext_busy_cursor(`id(`proposal ) ); // The "next" button is disabled via Wizard::SetContents() until everything is set up allright Wizard::EnableNextButton(); Wizard::EnableAbortButton(); if (!get_submod_descriptions_and_build_menu ()) { return `auto; } // // Make the initial proposal // make_proposal( false, false ); void SetNextButton () { if (Stage::initial () && proposal_mode == "initial") Wizard::SetNextButton (`next, ( // FATE #120373 Mode::update() ? _("&Update") : _("&Install") )); } // // Input loop // any input = nil; // Set keyboard focus to the [Install] / [Update] or [Next] button Wizard::SetFocusToNextButton(); while ( true ) { richtext_normal_cursor(`id(`proposal ) ); // bnc #431567 // Some proposal module can change it while called SetNextButton(); input = Wizard::UserInput(); y2milestone("Proposal - UserInput: '%1'", input); richtext_busy_cursor(`id(`proposal ) ); // check for tab if (is (input, integer)) { current_tab = (integer)input; load_matching_submodules_list(); string proposal = ""; foreach (string mod, submodules_presentation, ``{ proposal = proposal + html[mod]:""; }); display_proposal( proposal ); get_submod_descriptions_and_build_menu (); } // check for hyperlink id if (is (input, string)) { // get module for hyperlink id string submod = id2submod[input]:""; if (submod == "") { // also try hyperlinks submod = link2submod[input]:""; } if (submod != "") { // if submod is not the same as input id, provide id to the module map additional_info = $[ "has_next" : false, ]; if (submod != input) { additional_info["chosen_id"] = input; } // Call AskUser() function. // This will trigger another call to make_proposal() internally. input = submod_ask_user( submod, additional_info ); // The workflow_sequence doesn't get handled as a workflow sequence // so we have to do this special case here. Kind of broken. if (input == `finish) return `finish; } } else if (input == "rel_notes") { WFM::CallFunction("release_notes_popup", [] ); } else if (input == `finish) { return `finish; } else if (input == `abort) { if ( Stage::initial () ) { if (Popup::ConfirmAbort (`painless)) return `abort; } else { if (Popup::ConfirmAbort (`incomplete)) return `abort; } } else if (input == `reset_to_defaults && Popup::ContinueCancel( // question in a popup box _("Really reset everything to default values?") + "\n" + // explain consequences of a decision _("You will lose all changes.") ) ) { make_proposal( true, false ); // force_reset } else if ( input == `skip || input == `dontskip ) { if ((boolean) UI::QueryWidget (`id(`skip), `Value)) { // User doesn't want to use any of the settings UI::ChangeWidget( `id(`proposal), `Value, HTML::Newlines( 3 ) + // message show when user has disabled the configuration HTML::Para( _("Skipping configuration upon user request") ) ); UI::ChangeWidget(`id(`menu), `Enabled, false ); } else { // User changed his mind and wants the settings back - recreate them make_proposal( false, false ); UI::ChangeWidget(`id(`menu), `Enabled, true ); } } else if ( input == `next ) { boolean skip = UI::WidgetExists(`id(`skip) ) ? (boolean) UI::QueryWidget(`id(`skip), `Value ) : true; boolean skip_blocker = UI::WidgetExists(`id(`skip) ) && skip; if (have_blocker && !skip_blocker) { // error message is a popup Popup::Error (_("The proposal contains an error that must be resolved before continuing. ")); continue; } if ( Stage::stage () == "initial" ) { input = WFM::CallFunction("inst_doit", [] ); } // bugzilla #219097, #221571, yast2-update on running system else if ( Stage::stage () == "normal" && Mode::update () ) { if (! confirmInstallation()) { y2milestone ("Update not confirmed, returning back..."); input = nil; } } if ( input == `next ) { // anything that needs to be done before // real installation starts if ( ! skip ) { write_settings(); } Wizard::HideReleaseNotesButton(); return `next; } } else if ( input == `back ) { Wizard::HideReleaseNotesButton(); if (Stage::initial ()) Wizard::SetNextButton (`next, Label::NextButton ()); return `back; } } // while input loop // NOTREACHED /* EOF */ } 0707010006A4BE000081A40000018F0000018F000000014F1036760000D724000000080000000100000000000000000000002C00000000linux/suse/i386-sles11/inst-sys/control.xml control false true false false false 95 true true expert root true true true true false true true true true false /root/ /root/inst-sys/ / /etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.pub /etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_dsa_key.pub /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_rsa_key.pub /var/lib/YaST2/imported/userdata/ /etc/shadow /etc/passwd /etc/login.defs /etc/group false /etc/YaST2/licenses/base/ true true false restrictive service_sfcb sfcb sblim-sfcb false sblim-sfcb true ^SUSE (LINUX|Linux) Enterprise Server 11.*$ true ^SUSE (LINUX|Linux) Enterprise Server 11.*$ false ^SUSE (LINUX|Linux) Enterprise Server 11.*$ ^SUSE (LINUX|Linux) Enterprise Server 10.*$ ^SUSE (LINUX|Linux) Enterprise Server 11.*$ auto scenario_physical_machine base x11 gnome apparmor print_server 32bit 64bit x86 documentation WBEM yast-system scenario_virtual_machine base x11 gnome apparmor print_server 32bit 64bit x86 documentation WBEM yast-vm-install scenario_virtualization_host Dom0 yast-vm-management scenario_physical_machine gnome gnome dummy_desktop gdm DMZ gdm 1 base x11 gnome apparmor print_server 32bit 64bit x86 documentation pattern-gnome kde startkde dummy_desktop kdm DMZ kdm 1 kde x11 base pattern-kde4 kde3 startkde3 dummy_desktop kdm3 DMZ kdebase3-kdm 2 kde3 x11 base pattern-kde xfce startxfce4 dummy_desktop xdm DMZ xfce4-desktop 4 xfce x11 base pattern-xfce min_x twm dummy_desktop xdm DMZ xorg-x11 6 x11 base yast-x11 textmode twm dummy_desktop xdm DMZ xorg-x11 8 enhanced_base yast-sshd gnome true true false 5GB 40 3GB 10GB false false 15GB 25GB false false never auto language keyboard timezone users networking firewall host routing proxy runlevel x11 nis ldap printer dasd zfcp ldap-server ca_mgm add-on iscsi-client software partitioning bootloader kdump installation,demo,autoinstallation initial initial no hwinfo 10 keyboard 15 mouse 20 partitions 25 add-on 30 bootloader 40 kdump 60 language 50 timezone 45 software 35 runlevel 55 keyboard partitions software language_simple hwinfo keyboard mouse partitions bootloader add-on software timezone language runlevel kdump s390 installation,demo,autoinstallation initial initial no hwinfo 10 mouse 15 partitions 20 add-on 25 bootloader 35 language 45 timezone 40 dasd 55 zfcp 60 software 30 runlevel 50 partitions software language_simple hwinfo mouse partitions bootloader add-on software timezone language runlevel dasd zfcp live_installation initial initial no hwinfo partitions bootloader keyboard timezone runlevel update initial normal no update packages backup language update,autoupgrade initial initial no hwinfo media update add-on packages backup language keyboard s390 update initial initial no hwinfo update add-on dasd zfcp packages backup language network continue,normal yes lan 20 general 5 dsl 30 isdn 40 modem 50 remote 60 firewall 10 proxy 70 s390,ppc64 network continue,normal yes lan 20 remote 60 firewall 10 proxy 70 service continue,normal ca_mgm ldap-server services ppc64 hardware continue yes x11 printer s390 hardware continue yes printer hardware continue yes x11 printer sound all installation initial complex_welcome no yes yes true checkmedia yes yes lan yes yes disks_activate yes yes system_analysis yes yes mode yes yes add-on yes yes timezone yes yes yes yes scenarios i386,x86_64 initial_installation_proposal inst_proposal initial prepareprogress do_resize false i386,x86_64,ia64 prepdisk kickoff rpmcopy reiplauto s390 finish all yes yes live_installation initial complex_welcome no yes yes true timezone yes yes disk_proposal yes yes user_first root_first inst_live_pre-proposal inst_proposal initial prepareprogress inst_do_resize false i386,x86_64,ia64 inst_prepdisk inst_kickoff inst_live_doit no no inst_finish no all update initial autosetup_upgrade yes initial_update_proposal inst_proposal initial no yes rpmcopy all initial repair info repair all initial screen_shot no yes language true initial_screenshot_proposal inst_proposal initial prepareprogress do_resize false i386,x86_64,ia64 prepdisk kickoff rpmcopy all initial demo no yes language true initial_demo_proposal inst_proposal initial prepareprogress do_resize false i386,x86_64,ia64 prepdisk kickoff rpmcopy continue installation yes yes all yes root no initialization no no netprobe no no rpmcopy_secondstage no no hostname no continue_network_proposal inst_proposal network ask_net_test do_net_test addon_update_sources suse_register yes yes ask_online_update yes yes you extrasources restore_settings continue_service_proposal inst_proposal service auth user suseconfig no no release_notes continue_hardware_proposal inst_proposal hardware save_hardware_status congratulate i386,x86_64,ia64,ppc,ppc64 yes no yes yes congratulate s390,s390x yes yes yes yes continue live_installation yes yes all yes automatic_configuration no no user_non_interactive inst_user live_cleanup no initial autoinstallation all no no autoinit all true autosetup initial_autoinstallation_proposal inst_proposal initial no yes prepareprogress prepdisk kickoff autoimage rpmcopy reiplauto s390 finish all autoupgrade initial system_analysis yes yes update_partition_auto yes yes autoinit all true autosetup_upgrade yes initial_update_proposal inst_proposal initial no yes bl_preupdate bootloader_preupdate prepareprogress do_resize false i386,x86_64,ia64 prepdisk kickoff store_upgrade_software rpmcopy reiplauto s390 finish all no no continue autoinstallation netprobe autopost rpmcopy_secondstage yes autoconfigure suseconfig all no no continue autoupgrade autopost rpmcopy_secondstage yes autoconfigure suseconfig all no no continue update autopost rpmcopy_secondstage yes autoconfigure suseconfig 0707010006A496000081A40000018F0000018F000000014F10367600000038000000080000000100000000000000000000002200000000linux/suse/i386-sles11/dud.configUpdateID: laksdjhflkjdfghldkfsj UpdateName: AutoUpgrade 0707010006A30B000041ED0000018F0000018F000000034F1023BB00000000000000080000000100000000000000000000001900000000linux/suse/x86_64-sles110707010006A30C000041ED0000018F0000018F000000034F1023BB00000000000000080000000100000000000000000000002200000000linux/suse/x86_64-sles11/inst-sys0707010006A30D000041ED0000018F0000018F000000034F1023BB00000000000000080000000100000000000000000000002600000000linux/suse/x86_64-sles11/inst-sys/usr0707010006A30E000041ED0000018F0000018F000000034F1023BB00000000000000080000000100000000000000000000002C00000000linux/suse/x86_64-sles11/inst-sys/usr/share0707010006A30F000041ED0000018F0000018F000000054F1023BB00000000000000080000000100000000000000000000003200000000linux/suse/x86_64-sles11/inst-sys/usr/share/YaST20707010006A311000041ED0000018F0000018F000000024F1023BB00000000000000080000000100000000000000000000003A00000000linux/suse/x86_64-sles11/inst-sys/usr/share/YaST2/modules0707010006A31B000081A40000018F0000018F000000014F1023BB00002A63000000080000000100000000000000000000004A00000000linux/suse/x86_64-sles11/inst-sys/usr/share/YaST2/modules/IscsiClient.ybcYaST bytecode 1.4.0 IscsiClientIscsiClient.ycp ProgressReportSummaryMessageServicePackagePackagesPopup Mode Confirm Label NetworkService IscsiClientLibStage configuredModifiedmodifiedproposal_valid write_only AbortFunctionAbortinstalled_packagesExportReadWriteImportSummaryOverview AutoPackages!M+/5;Aj settings*0 iscsi-client3ProgressNew      NextStage 3ReportError  3Summary3Message&CannotContinueWithoutPackagesInstalled CannotReadCurrentSettings 3Service3Package InstallMsg  3PackagesaddAdditionalPackage  3PopupError  3Modeautoinst autoupgradeconfig3Confirm MustBeRoot3Label3NetworkServiceRunningNetworkPopup3IscsiClientLib  initiatorname  readSessionsgetiBFT getNode sessions  ay_settings currentRecord checkInitiatorNamegetStartupStatus getServiceStatussetServiceStatusautoyastPrepare autoyastWrite3Stageinitialcont$!$+$/$5$;%A(B4C-D!-F%M,N   y2debug    modified=%1-O%Tret(W|||| -W,X    y2milestone   %Check if open-iscsi package installed$Y(Z! open-iscsi+   Q

To configure the iSCSI initiator, the %1 package must be installed.

 iscsi-client

Install it now?

 iscsi-client4],^&_-`%jtgetsresult$k ,l    foreachsess   target portal auth  new_target$m    splitstring     $n    splitstring     &o $p $qtargetportalstartup (v  authmethodNoneNone'v authmethodNone&wunion&xadd$zversion1.0 initiatorname targets&&-%caption stepssl$*Initializing iSCSI Initiator Configuration iscsi-client$$, sleep , Read the database iscsi-clientRead the previous settings iscsi-clientDetect the devices iscsi-clientReading the database... iscsi-client Reading the previous settings... iscsi-clientDetecting the devices... iscsi-clientFinished iscsi-client(! -(! -,(-, sleep ( -,, sleep ,(!-,    y2milestone   Check initiator name(! -, sleep (-(! -, sleep ,( 4,-, sleep (-&-%caption sldescr $$Saving iSCSI Initiator Configuration iscsi-client$, sleep $Write the autoYaST settings iscsi-clientSet up service status iscsi-client(!||  &  remove, size (||  4(-,, , , sleep (-,(! -, sleep (-,(&&size , open-iscsi, sleep -% &  - %-Configuration summary... iscsi-client %-! %*-, installremove0707010006A323000081A40000018F0000018F000000014F1023BB00003A76000000080000000100000000000000000000004A00000000linux/suse/x86_64-sles11/inst-sys/usr/share/YaST2/modules/AutoInstall.ybcYaST bytecode 1.4.0 AutoInstallAutoInstall.ycp ProfileModeStageAutoinstConfigAutoInstallRulesReportTFTPautoconf callbackTrue_boolean_string  callbackFalse_boolean_string  #callbackTrue_boolean_string_integer  $callbackFalse_boolean_string_integer  callback_void_map  callbackTrue_boolean_map callbackFalse_boolean_map  callbackTrue_boolean_map_integer !callbackFalse_boolean_map_integer 'callbackTrue_boolean_string_map_integer  (callbackFalse_boolean_string_map_integer  "callbackTrue_boolean_string_string  #callbackFalse_boolean_string_string  *callbackTrue_boolean_string_string_integer  +callbackFalse_boolean_string_string_integer  Continue AutoInstall SaveFinish   PXELocalBootTurnOff  dummy   dummy   dummy dummy2  #dummy dummy2  ' dummy_map + dummy_map / dummy_map 3 dummy_map dummy7 dummy_map dummy;dummy  dummy_map  dummy_int?dummy  dummy_map  dummy_intCdummy1 dummy2 Gdummy1 dummy2 Kdummy1 dummy2 dummy3Odummy1 dummy2 dummy3Vzdestdir 3SCRReadWriteExecute0 autoinst3 Profilecurrent SaveProfileStructure ReadProfileStructure ReadXML 3ModeautoinstSetMode   autoupgrade3Stageinitialcont3AutoinstConfig parsedControlFile tmpDir  scripts_dir logs_dir cache  xml_tmpfile xml_file  profile_dir  autoconf_file 3AutoInstallRuleshostid 3Report3TFTPPut   $% -% -% - %# -$%' -(%+-,%/-0%3-4%7-8%;-<%?-@%C-D%G-H%K-L%O-P%Vret$\ (] SCR::Read .target.size4^,_    y2milestone   $XML Post installation data found: %1&` ,a SCR::Execute .target.bash   sformat    /bin/mv %1 %2-c 4f&g (h|| ! 4h,i    y2milestone   No saved autoinstall data found-j4k,l    y2milestone   "Found and read saved autoinst data,m SCR::Execute.target.remove-n-r%z(|4}ret$~ (&& size4,    y2milestone   Enabling Auto-Installation mode,autoinstallation(4,    y2milestone   =No autoyast data found, switching back to manual installation, installation(4(&& SCR::Read .target.sizesize4,    y2milestone   autoyast: %1 found,-%(||--% dircontents$  SCR::Read .target.dir+    /pre-scripts/(size 4, SCR::Execute .target.bash+   +   +   +   /bin/cp /pre-scripts/*  , SCR::Execute .target.bash+   +   +   +   /bin/cp /pre-scripts/logs/*  , SCR::Execute .target.bash   sformat   /bin/cp %1 %2%3/tmp/profile/autoinst.xml , SCR::Execute .target.bash   sformat   /bin/chmod 700 %1%2 , SCR::Execute .target.bash   sformat   /bin/cp %1 %2%3+   /pre-autoinst.xml , SCR::Execute .target.bash   sformat   /bin/chmod 700 %1%2 +   /pre-autoinst.xml-%tmpdir hexfile pxeserver $   SCR::Read.target.tmpdir$    sformat   %1/%2 $ pxe $    tftp-server(&&   pxe_localboot4config dir ,    y2milestone   )putting pxe local boot file on server :%1 $   pxelinux-config$    pxelinux-dir pxelinux.cfg( 4& 'DEFAULT linux LABEL linux localboot 0, SCR::Write.target.string  - +   +    / -%(!generalmode second_stage4,    y2milestone   Fswitching from autoinstallation to manual installation in second stage, SCR::Execute .target.bashD/bin/grep -v -i '^autoyast:' /etc/install.inf > /tmp/install.inf.new, SCR::Execute .target.bash-/bin/mv /tmp/install.inf.new /etc/install.inf0707010006A31F000081A40000018F0000018F000000014F1023BB0002FDE8000000080000000100000000000000000000004600000000linux/suse/x86_64-sles11/inst-sys/usr/share/YaST2/modules/Storage.ycp/** * Module: Storage.ycp * * Authors: Johannes Buchhold (jbuch@suse.de) * * Purpose: These module contains all settings/information which * are needed to partitioning the harddisk. Futhermore it contains a interface * to * access and modify the partitioning settings. * * Todo: Translate * Diese Modul enthlt alle Informationen die fr die Partitionierung der * Festplatten erforderlich sind. Diese Informationen bestehen aus der * Beschreibung, der vor der Partitionierung vorhandenen Platteneinstellungen, * und der Art und Weise wie diese verndert werden soll. * Alle ntigen Zugriffsfunktionen auf diese Datenstruktur sind ebenfalls in * diesem Modul enthalten. Der Zugriff auf die Speicherung der * Partitionseinstellungen luft also nur ber dieses Modul. * Der Zugriff und die Rckgabe von Teilen der Partitionsdatenstruktur * wurde versucht "intelligent" zu gestallten und ist im einzelen bei den * entspechenden Funktionen nher erklrt. * * $Id: Storage.ycp 62759 2010-11-08 09:57:41Z jsrain $ */ { module "Storage"; textdomain "storage"; import "Arch"; import "AsciiFile"; import "Encoding"; import "Directory"; import "FileSystems"; import "FileUtils"; import "Installation"; import "Label"; import "Mode"; import "Partitions"; import "Popup"; import "Misc"; import "HTML"; import "StorageDevices"; import "StorageClients"; import "ProductFeatures"; import "Stage"; import "String"; import "Region"; import "Hotplug"; import "LibStorage"; import "LibStorage::StorageInterface"; import "LibStorage::VolumeInfo"; import "LibStorage::PartitionInfo"; import "LibStorage::LvmLvInfo"; import "LibStorage::MdInfo"; import "LibStorage::LoopInfo"; import "LibStorage::DmInfo"; import "LibStorage::DmPartInfo"; import "LibStorage::DmraidInfo"; import "LibStorage::DmmultipathInfo"; import "LibStorage::MdPartCoInfo"; import "LibStorage::MdPartInfo"; import "LibStorage::NfsInfo"; import "LibStorage::ContainerInfo"; import "LibStorage::DiskInfo"; import "LibStorage::LvmVgInfo"; import "LibStorage::PartitionAddInfo"; import "LibStorage::DmPartCoInfo"; import "LibStorage::DmraidCoInfo"; import "LibStorage::DmmultipathCoInfo"; import "LibStorage::PartitionSlotInfo"; import "LibStorage::CommitInfo"; import "LibStorage::Environment"; map conv_ctype = $[ "def_sym" : `CT_UNKNOWN, "def_int" : LibStorage::CUNKNOWN(), "m" : $[ LibStorage::DISK() : `CT_DISK, LibStorage::MD() : `CT_MD, LibStorage::LOOP() : `CT_LOOP, LibStorage::LVM() : `CT_LVM, LibStorage::DMRAID() : `CT_DMRAID, LibStorage::DMMULTIPATH() : `CT_DMMULTIPATH, LibStorage::DM() : `CT_DM, LibStorage::MDPART() : `CT_MDPART, LibStorage::NFSC() : `CT_NFS ] ]; map conv_usedby = $[ "def_sym" : `UB_NONE, "def_int" : LibStorage::UB_NONE(), "m" : $[ LibStorage::UB_LVM() : `UB_LVM, LibStorage::UB_MD() : `UB_MD, LibStorage::UB_DMRAID() : `UB_DMRAID, LibStorage::UB_DMMULTIPATH() : `UB_DMMULTIPATH, LibStorage::UB_MDPART() : `UB_MDPART, LibStorage::UB_DM() : `UB_DM ] ]; map conv_ptype = $[ "def_sym" : `primary, "def_int" : LibStorage::PRIMARY(), "m" : $[ LibStorage::LOGICAL() : `logical, LibStorage::EXTENDED() : `extended ] ]; map conv_mountby = $[ "def_sym" : `device, "def_int" : LibStorage::MOUNTBY_DEVICE(), "m" : $[ LibStorage::MOUNTBY_UUID() : `uuid, LibStorage::MOUNTBY_LABEL() : `label, LibStorage::MOUNTBY_ID() : `id, LibStorage::MOUNTBY_PATH() : `path ] ]; map conv_encryption = $[ "def_sym" : `none, "def_int" : LibStorage::ENC_NONE(), "m" : $[ LibStorage::ENC_TWOFISH() : `twofish, LibStorage::ENC_TWOFISH_OLD() : `twofish_old, LibStorage::ENC_TWOFISH256_OLD() : `twofish_256_old, LibStorage::ENC_LUKS() : `luks, LibStorage::ENC_UNKNOWN() : `unknown, ] ]; map conv_mdtype = $[ "def_sym" : `raid_unknown, "def_int" : LibStorage::RAID_UNK(), "m" : $[ LibStorage::RAID0() : `raid0, LibStorage::RAID1() : `raid1, LibStorage::RAID5() : `raid5, LibStorage::RAID6() : `raid6, LibStorage::RAID10() : `raid10, LibStorage::MULTIPATH() : `multipath ] ]; map conv_mdstring = $[ "raid0" : LibStorage::RAID0(), "raid1" : LibStorage::RAID1(), "raid5" : LibStorage::RAID5(), "raid6" : LibStorage::RAID6(), "raid10" : LibStorage::RAID10(), "multipath" : LibStorage::MULTIPATH() ]; map conv_mdparity = $[ "def_sym" : `par_none, "def_int" : LibStorage::PAR_NONE(), "m" : $[ LibStorage::LEFT_ASYMMETRIC() : `left_asymmetric, LibStorage::LEFT_SYMMETRIC() : `left_symmetric, LibStorage::RIGHT_ASYMMETRIC() : `right_asymmetric, LibStorage::RIGHT_SYMMETRIC() : `right_symmetric ] ]; map conv_parstring = $[ "left_asymmetric" : LibStorage::LEFT_ASYMMETRIC(), "left_symmetric" : LibStorage::LEFT_SYMMETRIC(), "right_asymmetric" : LibStorage::RIGHT_ASYMMETRIC(), "right_symmetric" : LibStorage::RIGHT_SYMMETRIC() ]; map conv_imsm_driver = $[ `IMSM_UNDECIDED : LibStorage::IMSM_UNDECIDED(), `IMSM_DMRAID : LibStorage::IMSM_DMRAID(), `IMSM_MDADM : LibStorage::IMSM_MDADM() ]; map DiskMapVersion = $[]; map DiskMap = $[]; map type_order = $[ `CT_DISK : 0, `CT_MD : 1, `CT_MDPART : 2, `CT_DMRAID : 3, `CT_DMMULTIPATH : 4, `CT_LOOP : 5, `CT_DM : 6, `CT_LVM : 7, `CT_NFS : 8 ]; list hw_packages = []; list no_propose_disks = nil; boolean proposal_home = false; boolean proposal_lvm = false; boolean proposal_encrypt = false; string proposal_password = ""; map cfg_xml = $[]; string part_insts = ""; // bnc#477778 - Updating SLES 10 SP2 (GA+) to SLES 11 RC4 produces multiple identical grub boot menu entries // flag indicates calling StorageUpdate::Update() boolean called_update = false; /** * Returns Device Name * * @param string Disk * @param any partition * @return string device name * * @example Storage::GetDeviceName ("/dev/md", 1) */ global define string GetDeviceName( string disk, any partition ) { string ret = disk; if( is( partition, integer ) ) { if( search( disk, "/dev/cciss/" )==0 || search( disk, "/dev/ida/" )==0 || search( disk, "/dev/ataraid/" )==0 || search( disk, "/dev/etherd/" )==0 || (search(disk, "/dev/md") == 0 && disk != "/dev/md") || search( disk, "/dev/rd/" )==0 ) { ret = ret + "p"; } else if( search( disk, "/dev/mapper/" )==0 ) { ret = ret + "_part"; } ret = ret + sformat( "%1", partition ); } else if( size( (string)partition )>0 ) { ret = ret + "/" + (string)partition; } return( ret ); }; global boolean IsKernelDeviceName(string device) { return substring(device, 0, 6) != "LABEL=" && substring(device, 0, 5) != "UUID=" && substring(device, 0, 13) != "/dev/disk/by-"; } /** * Returns ... * * @param string dev * @return string EvmsDevDisk */ /* global string EvmsDevDisk( string dev ) { string ret = "/dev/" + substring( dev, 10 ); integer pos = search( ret, "!" ); y2milestone( "EvmsDevDisk pos:%1", pos ); if( pos!=nil ) ret = String::Replace( ret, "!", "/" ); pos = search( ret, "|" ); y2milestone( "EvmsDevDisk pos:%1", pos ); if( pos!=nil ) ret = String::Replace( ret, "|", "/" ); return( ret ); } */ /* Storage = TargetMap /* Storage = $[ "targets" : $[], "must_reread_partitions" : false, "win_device" : false, "testsuite" : false, "do_resize" : "", "part_proposal_mode" : "", "part_proposal_first" : true, "focus" : key ] */ map StorageMap = $[]; /* stringkeys for access to the Storage map */ string targets_key = "targets"; string part_mode_key = "part_mode"; string part_disk_key = "part_disk"; string testsuite_key = "testsuite"; string do_resize_key = "do_resize"; string win_device_key = "win_device"; string custom_display_key = "custom_display"; string part_proposal_mode_key = "part_proposal_mode"; string part_proposal_first_key = "part_proposal_first"; string part_proposal_active_key = "part_proposal_active"; boolean probe_done = false; symbol exit_key = `next; any sint = nil; list conts = []; string GetProcessName(integer pid) { string name = (string) SCR::Read(.target.symlink, "/proc/" + tostring(pid) + "/exe"); if (name == nil) return nil; integer pos = findlastof(name, "/"); if (pos == nil) return name; return substring(name, pos + 1); } any CreateInterface(boolean readonly) { while (sint == nil) { any env = LibStorage::Environment::new("LibStorage::Environment", readonly); LibStorage::Environment::swig_testmode_set(env, Mode::test()); LibStorage::Environment::swig_autodetect_set(env, true); LibStorage::Environment::swig_instsys_set(env, Stage::initial() || Mode::repair()); integer locker_pid = 0; sint = LibStorage::createStorageInterfacePid(env, locker_pid); if (sint == nil) { string locker_name = GetProcessName(locker_pid); y2milestone("locker_pid:%1 locker_name:%2", locker_pid, locker_name); if (locker_name == nil) { if (!Popup::AnyQuestion(Label::ErrorMsg(), // error popup _("The storage subsystem is locked by an unknown application. You must quit that application before you can continue."), Label::ContinueButton(), Label::CancelButton(), `focus_no)) break; } else { if (!Popup::AnyQuestion(Label::ErrorMsg(), // error popup sformat(_("The storage subsystem is locked by the application \"%1\" (%2). You must quit that application before you can continue."), locker_name, locker_pid), Label::ContinueButton(), Label::CancelButton(), `focus_no)) break; } } } y2milestone("sint:%1", sint); return sint; } symbol imsm_driver = `IMSM_UNDECIDED; global void SetImsmDriver(symbol val) { imsm_driver = val; } list getContainers(); global boolean InitLibstorage(boolean readonly) { if (sint != nil) return true; y2milestone("InitLibstorage"); sint = CreateInterface(readonly); if (sint == nil) { y2error("Storage::CreateInterface failed"); return false; } if (Stage::initial()) { LibStorage::StorageInterface::setDetectMountedVolumes(sint, false); LibStorage::StorageInterface::setRootPrefix(sint, Installation::destdir); } LibStorage::StorageInterface::setEfiBoot(sint, Partitions::EfiBoot()); // LibStorage::StorageInterface::setImsmDriver(sint, conv_imsm_driver[imsm_driver]:LibStorage::IMSM_UNDECIDED()); conts = getContainers(); y2milestone("InitLibstorage conts:%1", conts); FileSystems::InitSlib(sint); return true; } global string ByteToHumanString(integer bytes) { return LibStorage::StorageInterface::byteToHumanString(sint, bytes, false, 2, false); } global string KByteToHumanString(integer kbytes) { return LibStorage::StorageInterface::byteToHumanString(sint, kbytes * 1024, false, 2, false); } global string ByteToHumanStringWithPrecision(integer bytes, integer precision, boolean omit_zeroes) { return LibStorage::StorageInterface::byteToHumanString(sint, bytes, false, precision, omit_zeroes); } global string KByteToHumanStringWithPrecision(integer kbytes, integer precision, boolean omit_zeroes) { return LibStorage::StorageInterface::byteToHumanString(sint, kbytes * 1024, false, precision, omit_zeroes); } global boolean HumanStringToByte(string str, integer& bytes) { integer i = 0; bytes = i; // bnc #408829 and #408891 boolean ret = LibStorage::StorageInterface::humanStringToByte(sint, str, false, bytes); y2milestone("HumanStringToByte ret:%1 str:%2 bytes:%3", ret, str, bytes); return ret; } global boolean HumanStringToKByte(string str, integer& kbytes) { integer bytes = 0; // bnc #408829 boolean ret = LibStorage::StorageInterface::humanStringToByte(sint, str, false, bytes); kbytes = bytes / 1024; y2milestone("HumanStringToKByte ret:%1 str:%2 kbytes:%3", ret, str, kbytes); return ret; } /** * Converts a string into a integer and checks the allowed range for the * integer. The range check is a bit sloppy to compensate rounding issues but * it's guaranteed that the result lies within the allowed range. */ global boolean HumanStringToKByteWithRangeCheck(string str, integer& bytes_k, integer min_k, integer max_k) { if (!HumanStringToKByte(str, bytes_k)) return false; if (min_k != nil && bytes_k < min_k) { if (KByteToHumanString(bytes_k) != KByteToHumanString(min_k)) return false; bytes_k = min_k; } if (max_k != nil && bytes_k > max_k) { if (KByteToHumanString(bytes_k) != KByteToHumanString(max_k)) return false; bytes_k = max_k; } return true; } global define map GetTargetMap(); define list GetDiskPartitionTg( string device, map tg ) ``{ list ret = []; integer dlen = 0; boolean as_string = false; list ls = filter( string s, splitstring( device, "/" ), ``(size(s)>0)); if( search( device, "LABEL=" )==0 || search( device, "UUID=" )==0 ) { list tl = splitstring( device, "=" ); ls = [ "dev", "disk", "", tl[1]:"" ]; ls[2] = (search( device, "LABEL=" )==0)?"by-label":"by-uuid"; y2milestone( "GetDiskPartitionTg ls:%1", ls ); } y2debug( "GetDiskPartitionTg size:%1 ls:%2", size(ls), ls ); if( size(ls)>=4 && ls[1]:"" == "disk" && contains( [ "by-id", "by-path", "by-uuid", "by-label" ], ls[2]:"" )) { map part = $[]; string regex = "-part[0-9]+$"; if( ls[2]:"" == "by-label" ) { foreach( string dev, map disk, tg, ``{ part = find( map p, disk["partitions"]:[], ``(p["label"]:""==ls[3]:"")); if( part!=nil ) { map tmp = $[]; tmp["disk"] = dev; if( haskey( part, "nr" )) tmp["nr"] = part["nr"]:(any)0; else tmp["nr"] = part["name"]:""; ret = add( ret, tmp ); } }); } else if( ls[2]:"" == "by-uuid" ) { foreach( string dev, map disk, tg, ``{ part = find( map p, disk["partitions"]:[], ``(p["uuid"]:""==ls[3]:"")); if( part!=nil ) { map tmp = $[]; tmp["disk"] = dev; if( haskey( part, "nr" )) tmp["nr"] = part["nr"]:(any)0; else tmp["nr"] = part["name"]:""; ret = add( ret, tmp ); } }); } else if( ls[2]:"" == "by-id" ) { string id = ls[3]:""; integer num = 0; list l = regexppos( id, regex ); if( size(l)>0 ) { num = tointeger( substring( id, l[0]:0+5 )); id = substring( id, 0, l[0]:0 ); y2debug( "GetDiskPartitionTg id:%1 num:%2", id, num ); } foreach( string dev, map disk, tg, ``{ if( size(ret)==0 && find( string s, disk["udev_id"]:[], ``(s==id))!=nil) { part = find( map p, disk["partitions"]:[], ``(p["nr"]:0==num)); if( num==0 || part!=nil ) { map tmp = $[]; tmp["disk"] = dev; if( num>0 ) tmp["nr"] = num; else tmp["nr"] = ""; ret = [ tmp ]; } } }); } else if( ls[2]:"" == "by-path" ) { string id = ls[3]:""; integer num = 0; list l = regexppos( id, regex ); if( size(l)>0 ) { num = tointeger( substring( id, l[0]:0+5 )); id = substring( id, 0, l[0]:0 ); y2debug( "GetDiskPartitionTg id:%1 num:%2", id, num ); } foreach( string dev, map disk, tg, ``{ if( size(ret)==0 && disk["udev_path"]:"" == id ) { part = find( map p, disk["partitions"]:[], ``(p["nr"]:0==num)); if( num==0 || part!=nil ) { map tmp = $[]; tmp["disk"] = dev; if( num>0 ) tmp["nr"] = num; else tmp["nr"] = ""; ret = [ tmp ]; } } }); } } else if( search( device, "/" )==0 ) { if( search( device, "/dev/hd" )==0 || search( device, "/dev/sd" )==0 || search( device, "/dev/ed" )==0 || search( device, "/dev/iseries/vd" )==0 ) { dlen = findfirstof( device, "0123456789" ); if( dlen == nil ) { dlen = size(device); } } else if( search( device, "/dev/md" )==0 && size(ls)==2 ) { integer pos = find(device, "p"); y2milestone("device:%1 pos:%2", device, pos); if (pos == -1) dlen = 7; else dlen = pos; } else if( search( device, "/dev/loop" )==0 ) { dlen = 9; } else if( search( device, "/dev/i2o/hd" )==0 ) { dlen = 12; } else if( search( device, "/dev/rd/" )==0 || search( device, "/dev/cciss/" )==0 || search( device, "/dev/ataraid/" )==0 || search( device, "/dev/etherd/" )==0 || search( device, "/dev/ida/" )==0 ) { integer pos = findlastof( device, "p" ); dlen = size(device); if( pos!=nil ) { dlen = pos; } } else if( search( device, "/dev/dasd" )==0 ) { dlen = size(device); if( findfirstof( device, "0123456789" )!=nil ) { dlen = dlen-1; } } else if( search( device, "/dev/mapper/" )==0 ) { string regex = "[_-]part[0-9]+$"; list l = regexppos( device, regex ); if( size(l)>0 ) dlen = l[0]:0; else dlen = size(device); } else { as_string = true; if( size(ls)>=3 ) { integer pos = findlastof( device, "/" ); if( pos!=nil ) { dlen = pos; } } else { dlen = size(device); integer nonzero = findlastnotof( device, "0123456789" ); if( nonzero!=nil && nonzero < dlen-1 ) { dlen = nonzero+1; as_string = false; } } } map tmp =$[]; tmp["disk"] = substring( device, 0, dlen ); device = substring( device, dlen ); if( search( device, "_part" )==0 ) device = substring( device, 5 ); if( size(device)>0 && findfirstof( device, "/p" )==0 ) { device = substring( device, 1 ); } tmp["nr"] = -1; if( as_string ) { tmp["nr"] = device; } else { if( size(device)>0 ) { tmp["nr"] = tointeger(device); } } if( size(tmp["disk"]:"")>0 && tmp["nr"]:(any)1 == -1 ) { tmp["nr"] = ""; } ret = [ tmp ]; } else { ret = [ $[ "disk" : "/dev/nfs", "nr" : device ]]; } if( size(ret)>1 ) { list a = filter( map m, ret, ``(search(m["disk"]:"","/dev/evms")!=0)); list b = filter( map m, ret, ``(search(m["disk"]:"","/dev/evms")==0)); ret = (list)merge( a, b ); } y2debug( "GetDiskPartitionTg device:%1 ret:%2", device, ret ); return( ret ); }; /** * Returns map describing the disk partition * * @param string device * @return map DiskPartition * * Examples: * "/dev/sda" -> $[ "disk" : "/dev/sda", "nr" : "" ] * "/dev/sda2" -> $[ "disk" : "/dev/sda", "nr" : 2 ] * "/dev/system" -> $[ "disk" : "/dev/system", "nr" : "" ] * "/dev/system/abuild" -> $[ "disk" : "/dev/system", "nr" : "abuild" ] */ global define map GetDiskPartition( string device ) ``{ return( GetDiskPartitionTg( device, GetTargetMap() )[0]:$[] ); }; global void UpdateChangeTime() { integer change_time = time(); y2milestone( "UpdateChangeTime time %1", change_time ); StorageMap["targets_time"] = change_time; } /* return list of partitions of map */ define list GetPartitionLst( map tg, string device ) ``{ list ret = []; list tmp = GetDiskPartitionTg( device, tg ); y2milestone( "GetPartitionLst tmp:%1", tmp ); foreach( map m, tmp, ``{ string disk = m["disk"]:""; if( search(device, "/dev/evms")==0 && !haskey( tg, disk ) ) { disk = "/dev/evms"; } y2debug( "GetPartitionLst device=%1 disk=%2", device, disk ); list part = filter( map p, tg[disk,"partitions"]:[], ``(p["device"]:""==device )); part = filter( map p, part, ``(!p["delete"]:false)); if( size(part)==0 ) { part = filter( map p, tg[disk,"partitions"]:[], ``(p["nr"]:-1==m["nr"]:0 )); part = filter( map p, part, ``(!p["delete"]:false)); } if( size(part)==0 ) { part = filter( map p, tg[disk,"partitions"]:[], ``(p["name"]:""==m["nr"]:"" )); part = filter( map p, part, ``(!p["delete"]:false)); } map pa = part[0]:$[]; if( size(pa)==0 && search(device, "/dev/mapper/")==0 ) { part = filter( map p, tg["/dev/mapper","partitions"]:[], ``(p["device"]:""==device )); pa = part[0]:$[]; } if( size(pa)==0 && search(device, "/dev/mapper/")==0 ) { part = filter( map p, tg["/dev/loop","partitions"]:[], ``(p["device"]:""==device )); pa = part[0]:$[]; } if( size(pa)>0 ) ret = add( ret, pa ); }); y2debug( "GetPartitionLst ret=%1", ret ); return( ret ); } global define map GetPartition( map tg, string device ) { return( (map)GetPartitionLst( tg, device )[0]:$[] ); } /** * Returns disk identified by 'device' taken from the 'tg' (target) map * * @param map tg (target map) * @param string device */ global define map GetDisk( map tg, string device ) ``{ map ret = $[]; map tmp = GetDiskPartitionTg( device, tg )[0]:$[]; string disk = tmp["disk"]:""; if( search(device, "/dev/evms")==0 && !haskey( tg, disk ) ) { disk = "/dev/evms"; } y2debug( "GetDisk disk=%1", disk ); return( (map)tg[disk]:$[] ); } /** * Sets partition 'part' into the 'tg' map and returns changed 'tg' map * * @param map tg * @param map part * @return map changed tg */ /* global define map SetPartition( map tg, map part ) ``{ y2milestone( "SetPartition part=%1", part ); map tmp = GetDiskPartitionTg( part["device"]:"", tg )[0]:$[]; y2milestone( "SetPartition tmp=%1", tmp ); string disk = tmp["disk"]:""; if( search(part["device"]:"", "/dev/evms")==0 && !haskey( tg, disk ) ) { disk = "/dev/evms"; } list r_part = filter(map p, tg[disk,"partitions"]:[], ``(p["device"]:"" != part["device"]:"")); r_part = add( r_part, part ); tg[disk,"partitions"] = r_part; return( tg ); } */ /** * Find next free loop device. * * @param integer start (start with /dev/loop$number) * @return string loop_dev ( e.g.: /dev/loop1 ) */ /* global define string GetLoopDev( integer start ) ``{ if( Mode::test () ) return "/dev/loop2"; integer max_loop_dev= 15; integer loop_dev_nb = start; boolean found_free = false; string loop_dev = ""; while( !found_free && loop_dev_nb <= max_loop_dev ) { loop_dev = sformat("/dev/loop%1", loop_dev_nb ); loop_dev_nb = loop_dev_nb + 1; // Test loop dev if( SCR::Execute(.target.bash , "/sbin/losetup 2>/dev/null " + loop_dev ) != 0 ) found_free = true; } if( !found_free ) { loop_dev = ""; // internal error popup Popup::Error( _("Too many loop devices (cryptofs ...)") ); y2error( "Too many loop devices"); } y2milestone("ret \"%1\"",loop_dev); return( loop_dev ); }; */ /** * Get List of swap partitions * @return list List of swap partitions */ global list SwappingPartitions() { SCR::UnmountAgent(.proc.swaps); list swaps = (list) SCR::Read(.proc.swaps); if (swaps == nil) { y2error("SCR::Read(.proc.swaps) returned nil"); swaps = []; } swaps = filter(map e, swaps, ``(e["type"]:""=="partition")); list ret = maplist(map e, swaps, ``(Partitions::TranslateMapperName(e["file"]:""))); y2milestone("SwappingPartitions %1", ret); return ret; } global define list GetDestroyedLvmVgs( map target ) ``{ list vgs = []; foreach(string diskdev, map disk, target, ``{ foreach( map p, disk["partitions"]:[], ``{ if( p["used_by_type"]:`UB_NONE==`UB_LVM && p["format"]:false ) { vgs = union( vgs, [ p["used_by"]:"" ] ); } }); }); vgs = sort( vgs ); y2milestone( "GetDestroyedLvmVgs %1", vgs ); return( vgs ); } global define map DeleteDestroyedLvmVgs( map target ) ``{ list vgs = maplist( string s, (list)GetDestroyedLvmVgs( target ), ``("/dev/"+s)); y2milestone( "DeleteDestroyedLvmVgs %1", vgs ); foreach( string dev, vgs, ``{ if( haskey( target, dev )) target[dev,"delete"] = true; target[dev,"partitions"] = maplist( map p, target[dev,"partitions"]:[], ``{ if( haskey( p, "mount" )) p = remove( p, "mount" ); return( p ); }); y2milestone( "DeleteDestroyedLvmVgs %1: %2", dev, target[dev]:$[] ); }); return( target ); } /** * Returns map of free space per partition * * @param string device * @param integer testsize * @param symbol used_fs * @param boolean verbose */ global define map GetFreeSpace( string device, integer testsize, symbol used_fs, boolean verbose ) ``{ if( Mode::test() ) { integer wf = tointeger(tofloat(testsize) * 0.6); integer wu = tointeger(tofloat(testsize) * 0.4); integer ls = tointeger(tofloat(testsize) * 0.5); return( $[ "free" : wf, "used" : wu, "linux_size" : ls, "new_size": (wu + wf - ls) ] ); } integer used = 0; integer resize_free = 0; integer df_free = 0; boolean win_disk = false; boolean efi = false; boolean r = false; r = LibStorage::StorageInterface::getFreeInfo( sint, device, resize_free, df_free, used, win_disk, efi, used_fs==`ntfs ); resize_free = resize_free * 1024; // Byte df_free = df_free * 1024; // Byte used = used * 1024; // Byte if( used_fs == `ntfs && !r && verbose ) { string cmd = sformat("/usr/sbin/ntfsresize -f -i '%1'", device); y2milestone( "GetFreeSpace Executing cmd:%1", cmd ); map bcall = (map) SCR::Execute( .target.bash_output, cmd, $[ "LC_MESSAGES" :"POSIX"] ); y2milestone( "GetFreeSpace Executing ret:%1", bcall ); string tmp = _("Resize Not Possible:") + "\n\n"; tmp = tmp + bcall["stdout"]:"" + bcall["stderr"]:""; Popup::Error( tmp ); return( $[] ); } integer linux_size = 0; integer min_linux_size = 0; integer add_free = df_free - resize_free; y2milestone( "GetFreeSpace resize_free %1 add_free %2", resize_free, add_free ); if( resize_free < 300*1024*1024 || !r ) { linux_size = 0; min_linux_size = 0; } else if( resize_free < 600*1024*1024 ) { linux_size = resize_free; if( add_free < 75*1024*1024 ) { linux_size = linux_size - 75*1024*1024 + add_free; } min_linux_size = linux_size; } else if ( resize_free < 1024*1024*1024 ) { linux_size = resize_free; if( add_free < 200*1024*1024 ) { linux_size = linux_size - 200*1024*1024 + add_free; } min_linux_size = 300*1024*1024; } else if ( resize_free < 2*1024*1024*1024 ) { linux_size = resize_free; if( add_free < 300*1024*1024 ) { linux_size = linux_size - 300*1024*1024 + add_free; } min_linux_size = 500*1024*1024; } else if ( resize_free < 3*1024*1024*1024 ) { linux_size = resize_free; if( add_free < 800*1024*1024 ) { linux_size = linux_size - 800*1024*1024 + add_free; } min_linux_size = 500*1024*1024; } else { linux_size = resize_free; if( add_free < resize_free/3 ) { linux_size = linux_size - resize_free/3 + add_free; } min_linux_size = 500*1024*1024; } integer new_size = used + add_free + resize_free - linux_size; map ret = $[ "free": (resize_free>0?resize_free:0), "df_free" : df_free, "used":used, "win_disk":win_disk, "efi":efi, "linux_size":linux_size, "max_win_size":used + resize_free + add_free - min_linux_size, "ntfs" : (used_fs == `ntfs), "new_size":new_size ]; ret["ok"] = r; y2milestone( "GetFreeSpace %1 ret %2", device, ret ); return( ret ); }; global integer GetUnusedPartitionSlots(string device, list &slots) { list swig_slots = []; integer ret = LibStorage::StorageInterface::getUnusedPartitionSlots(sint, device, swig_slots); slots = maplist(any swig_slot, swig_slots, { return $[ "region" : [ LibStorage::PartitionSlotInfo::swig_cylStart_get(swig_slot), LibStorage::PartitionSlotInfo::swig_cylSize_get(swig_slot) ], "primary_slot" : LibStorage::PartitionSlotInfo::swig_primarySlot_get(swig_slot), "primary_possible" : LibStorage::PartitionSlotInfo::swig_primaryPossible_get(swig_slot), "extended_slot" : LibStorage::PartitionSlotInfo::swig_extendedSlot_get(swig_slot), "extended_possible" : LibStorage::PartitionSlotInfo::swig_extendedPossible_get(swig_slot), "logical_Slot" : LibStorage::PartitionSlotInfo::swig_logicalSlot_get(swig_slot), "logical_possible" : LibStorage::PartitionSlotInfo::swig_logicalPossible_get(swig_slot) ]; }); return ret; } /** * Adds ... and returns the changed map * * @param map targets * @return map targets */ global define map AddWinInfo( map targets ) ``{ y2milestone( "AddWinInfo called" ); foreach(string disk, map data, targets, ``{ targets[disk,"partitions"] = maplist(map p, data["partitions"]:[], ``{ if( Partitions::IsDosWinNtPartition(p["fsid"]:0) && contains( [ `ntfs, `vfat ], p["used_fs"]:`none )) { p["winfo"] = GetFreeSpace( p["device"]:"", 0, p["used_fs"]:`none, false ); y2milestone( "AddWinInfo %1", p ); } return( p ); }); }); return( targets ); }; global define string SaveDumpPath( string name )``{ string ret = Directory::tmpdir + "/" + name; y2debug( "name=%1 path=%2", name, ret ); return ret; } // add mount point for all mounted partitions /** * Adds mountpoint info to the target map and returns the changed map * * @param map target * @return map target */ global define map AddMountPointInfo( map target ) ``{ list mounts = Partitions::CurMounted(); foreach(string diskdev, map disk, target, ``{ // variable renamed due to some interpreter problems list tmp2 = disk["partitions"]:[]; tmp2 = maplist(map part, tmp2, ``{ map mt = find(map mp, mounts, ``(mp["spec"]:" "==part["device"]:"" || mp["loop_on"]:" "==part["device"]:"")); if( mt != nil ) { part["mount"] = mt["file"]:""; if( part["noauto"]:false ) { part["active"] = true; } } return( part ); }); disk["partitions"] = tmp2; target[diskdev] = disk; }); return( target ); } /* global define list FindFstabLines( map fstab, string mount, string device, string uuid, string label ) ``{ list lines = []; if( size(mount)>0 && mount != "swap" ) { lines = AsciiFile::FindLineField( fstab, 1, mount ); } if( size(lines)==0 ) { lines = AsciiFile::FindLineField( fstab, 0, device ); } if( size(lines)>1 ) { uuid = "UUID=" + uuid; label = "LABEL=" + label; map tlines = AsciiFile::GetLines( fstab, lines ); map nlist = filter(integer num, map line, tlines, ``( line["fields",0]:"" == device || line["fields",0]:"" == uuid || line["fields",0]:"" == label )); if( size(nlist)>0 ) { lines = maplist( integer num, map line, nlist, ``(num)); } } y2milestone( "lines %1", lines ); return( lines ); }; */ // add info gotten from /etc/fstab to targetMap /* global define map AddFstabInfo( map target, boolean lineno ) ``{ y2milestone( "lineno=%1", lineno ); map fstab = Partitions::GetFstab( "/etc/fstab" ); map crtab = Partitions::GetCrypto( "/etc/cryptotab" ); foreach(string diskdev, map disk, target, ``{ list new_part = []; foreach(map part, disk["partitions"]:[], ``{ list rem = []; if( lineno ) { rem = [ "fstabline", "crtabline" ]; } else { rem = [ "mountby", "fstopt" ]; } part = (map)filter(string key, any val, (map)part, ``(!contains( rem, key ))); string mp = part["mount"]:""; if( size(part["ori_mount"]:"")>0 ) { mp = part["ori_mount"]:""; } list lines = []; lines = FindFstabLines( fstab, mp, part["device"]:"", part["uuid"]:"", part["label"]:"" ); if( size(lines)>0 ) { if( lineno ) { part["fstabline"] = lines[0]:-1; } else { map entry = AsciiFile::GetLine( fstab, lines[0]:-1 ); if( entry["fields",3]:"defaults" != "defaults" ) { part["fstopt"] = entry["fields",3]:""; } if( search(entry["fields",0]:"", "UUID=") != nil ) { part["mountby"] = `uuid; } else if( search(entry["fields",0]:"", "LABEL=") != nil ) { part["mountby"] = `label; } else if( search(entry["fields",0]:"", "/dev/disk/by-id/") != nil ) { part["mountby"] = `id; } else if( search(entry["fields",0]:"", "/dev/disk/by-path/") != nil ) { part["mountby"] = `path; } } } lines = AsciiFile::FindLineField( crtab, 2, mp ); if( size(lines)==0 && diskdev!="/dev/loop" ) { lines = AsciiFile::FindLineField( crtab, 1, part["device"]:"" ); } if( size(lines)==0 && diskdev=="/dev/loop" ) { lines = AsciiFile::FindLineField( crtab, 0, part["device"]:"" ); } if( size(lines)>0 ) { if( lineno ) { part["crtabline"] = lines[0]:-1; } else { map entry = AsciiFile::GetLine( crtab, lines[0]:-1 ); if( entry["fields",5]:"defaults" != "defaults" ) { part["fstopt"] = entry["fields",5]:""; } } } y2milestone( "part=%1", part ); new_part = add( new_part, part ); }); target[diskdev] = disk; target[diskdev,"partitions"] = new_part; }); return( target ); } */ string convertFsOptionMapToString( map fsopt, symbol cmd ) { string ret = ""; // do nothing if( fsopt != nil || fsopt != $[] ) { list ignore = [ "auto", "default", "none", "" ]; foreach(any option_key, map option, fsopt, ``{ string option_str = option["option_str"]:""; any option_value = option["option_value"]:(any)""; boolean option_blank = option["option_blank"]:false; symbol option_cmd = option["option_cmd"]:`mkfs; y2milestone( "convertFsOptionMapToString k:%1 opt:%2 val:%3 cmd:%4", option_key, option, option_value, option_cmd ); if (cmd == option_cmd) { if( is(option_value, string) && option_value != nil ) { if( !contains( ignore, option_value )) { if( size(ret)>0 ) ret = ret + " "; ret = ret + option_str; if( option_blank ) ret = ret + " "; ret = ret + (string)option_value; } } else if( is(option_value, boolean) && option_value != nil ) { if( (boolean) option_value ) { if( size(ret)>0 ) ret = ret + " "; ret = ret + option_str; } } else if( is(option_value, integer) && option_value != nil ) { if( size(ret)>0 ) ret = ret + " "; ret = ret + option_str; if( option_blank ) ret = ret + " "; ret = ret + sformat("%1", option_value); } } }); } if( size(fsopt)>0 || size(ret)>0 ) y2milestone( "convertFsOptionMapToString fsopt:%1 ret:%2", fsopt, ret ); return ret; }; map convertStringToFsOptionMap( string opts, symbol fs, symbol cmd ) { map ret = $[]; y2milestone( "convertStringToFsOptionMap opts:\"%1\" fs:%2 cmd:%3", opts, fs, cmd ); integer pos = findfirstnotof( opts, " \t" ); if( pos>0 ) opts = substring( opts, pos ); list op = (list)FileSystems::GetOptions(fs); op = filter(map o, op, { return o[`option_cmd]:`mkfs == cmd; }); while( size(opts)>0 ) { boolean found = false; foreach( map o, op, ``{ map m = $[]; string os = o[`option_str]:""; if( !found && size(os)>0 && search( opts, os )==0 ) { found = true; m["option_str"] = os; m["option_cmd"] = o[`option_cmd]:`mkfs; if( o[`type]:`text==`boolean ) { m["option_value"] = true; ret[o[`query_key]:""] = m; } opts = substring( opts, size(os) ); pos = findfirstnotof( opts, " \t" ); if( pos>0 ) opts = substring( opts, pos ); if( o[`type]:`text!=`boolean && size(opts)>0 && search(opts,"-")!=0 ) { if( pos>0 ) m["option_blank"] = true; pos = findfirstof( opts, " \t" ); if( pos==nil ) { m["option_value"] = opts; opts = ""; } else { m["option_value"] = substring( opts, 0, pos ); opts = substring( opts, pos ); } ret[o[`query_key]:""] = m; } pos = findfirstnotof( opts, " \t" ); if( pos>0 ) opts = substring( opts, pos ); } }); if( !found ) { pos = findfirstnotof( opts, " \t" ); if( pos>0 ) opts = substring( opts, pos ); else opts = ""; } y2milestone( "convertStringToFsOptionMap opts:%1 ret:%2", opts, ret ); } y2milestone( "convertStringToFsOptionMap ret:%1", ret ); return( ret ); } symbol toSymbol( map conv, integer val ) { return( conv["m",val]:(conv["def_sym"]:`invalid_conv_map) ); } integer fromSymbol( map conv, symbol val ) { integer ret = conv["def_int"]:-1; foreach( integer i, symbol s, conv["m"]:$[], ``{ if( s==val ) ret = i; }); return( ret ); } global define boolean CheckBackupState( string who ) { y2milestone( "CheckBackupStates who:%1", who ); if (!InitLibstorage(false)) return nil; boolean ret = LibStorage::StorageInterface::checkBackupState( sint, who ); y2milestone( "CheckBackupStates ret:%1", ret ); return( ret ); } map diskMap( any dinfo, map d ) { d["size_k"] = LibStorage::DiskInfo::swig_sizeK_get(dinfo); d["cyl_size"] = LibStorage::DiskInfo::swig_cylSizeB_get(dinfo); d["cyl_count"] = LibStorage::DiskInfo::swig_cyl_get(dinfo); d["label"] = LibStorage::DiskInfo::swig_disklabel_get(dinfo); d["max_logical"] = LibStorage::DiskInfo::swig_maxLogical_get(dinfo); d["max_primary"] = LibStorage::DiskInfo::swig_maxPrimary_get(dinfo); boolean bt = LibStorage::DiskInfo::swig_iscsi_get(dinfo); if( bt ) d["iscsi"] = true; else if( haskey( d, "iscsi" )) d = remove( d, "iscsi" ); bt = LibStorage::DiskInfo::swig_initDisk_get(dinfo); if( bt ) d["dasdfmt"] = true; else if( haskey( d, "dasdfmt" )) d = remove( d, "dasdfmt" ); string tmp = LibStorage::DiskInfo::swig_udevId_get(dinfo); if( size(tmp)>0 ) d["udev_id"] = splitstring( tmp, " " ); else if( haskey( d, "udev_id" )) d = remove( d, "udev_id" ); tmp = LibStorage::DiskInfo::swig_udevPath_get(dinfo); if( size(tmp)>0 ) d["udev_path"] = tmp; else if( haskey( d, "udev_path" )) d = remove( d, "udev_path" ); y2milestone( "diskMap ret:%1", d ); return( d ); } map dmPartCoMap( any infos, map d ) { any dinfo = LibStorage::DmPartCoInfo::swig_d_get(infos); d = diskMap( dinfo, d ); list ls = splitstring( LibStorage::DmPartCoInfo::swig_devices_get(infos), " " ); y2milestone( "ls=%1", ls ); d["devices"] = ls; integer t = LibStorage::DmPartCoInfo::swig_minor_get(infos); d["minor"] = t; y2milestone( "dmPartCoMap ret:%1", d ); return( d ); } map volumeMap( any vinfo, map p ) { p["device"] = LibStorage::VolumeInfo::swig_device_get(vinfo); p["size_k"] = LibStorage::VolumeInfo::swig_sizeK_get(vinfo); p["name"] = LibStorage::VolumeInfo::swig_name_get(vinfo); integer t = LibStorage::VolumeInfo::swig_fs_get(vinfo); symbol fs = toSymbol( FileSystems::conv_fs, t ); p["detected_fs"] = fs; if( fs != `unknown ) p["used_fs"] = fs; boolean tbool = LibStorage::VolumeInfo::swig_format_get(vinfo); if( tbool ) p["format"] = true; tbool = LibStorage::VolumeInfo::swig_create_get(vinfo); if( tbool ) p["create"] = true; string tmp = LibStorage::VolumeInfo::swig_mount_get(vinfo); if( size(tmp)>0 ) { p["mount"] = tmp; tbool = LibStorage::VolumeInfo::swig_is_mounted_get(vinfo); if( !tbool ) p["inactive"] = true; t = LibStorage::VolumeInfo::swig_mount_by_get(vinfo); p["mountby"] = toSymbol( conv_mountby, t ); } t = LibStorage::VolumeInfo::swig_usedByType_get(vinfo); if( t!=LibStorage::UB_NONE() ) { p["used_by_type"] = toSymbol( conv_usedby, t ); p["used_by"] = LibStorage::VolumeInfo::swig_usedByName_get(vinfo); p["used_by_device"] = LibStorage::VolumeInfo::swig_usedByDevice_get(vinfo); } tmp = LibStorage::VolumeInfo::swig_fstab_options_get(vinfo); if( size(tmp)>0 ) { p["fstopt"] = tmp; if( find( string s, splitstring( tmp, "," ), ``(s=="noauto") )!=nil ) p["noauto"] = true; } tmp = LibStorage::VolumeInfo::swig_mkfs_options_get(vinfo); if( size(tmp)>0 ) { p["mkfs_opt"] = tmp; p["fs_options"] = convertStringToFsOptionMap( tmp, p["detected_fs"]:`unknown, `mkfs ); } else { if( haskey( p, "fs_options" )) p = remove( p, "fs_options" ); } tmp = LibStorage::VolumeInfo::swig_tunefs_options_get(vinfo); if( size(tmp)>0 ) { p["tunefs_opt"] = tmp; p["fs_options"] = union(p["fs_options"]:$[], convertStringToFsOptionMap( tmp, p["detected_fs"]:`unknown, `tunefs )); } tmp = LibStorage::VolumeInfo::swig_dtxt_get(vinfo); if( size(tmp)>0 ) p["dtxt"] = tmp; tmp = LibStorage::VolumeInfo::swig_uuid_get(vinfo); if( size(tmp)>0 ) p["uuid"] = tmp; tmp = LibStorage::VolumeInfo::swig_label_get(vinfo); if( size(tmp)>0 ) p["label"] = tmp; t = LibStorage::VolumeInfo::swig_encryption_get(vinfo); if( t!=LibStorage::ENC_NONE() ) { p["enc_type"] = toSymbol( conv_encryption, t ); } tbool = LibStorage::VolumeInfo::swig_resize_get(vinfo); if( tbool ) { p["resize"] = true; p["orig_size_k"] = LibStorage::VolumeInfo::swig_OrigSizeK_get(vinfo); } tbool = LibStorage::VolumeInfo::swig_ignore_fs_get(vinfo); if( tbool ) p["ignore_fs"] = true; tmp = LibStorage::VolumeInfo::swig_loop_get(vinfo); if( size(tmp)>0 ) p["loop"] = tmp; return( p ); } map partAddMap( any info, map p ) { p["nr"] = LibStorage::PartitionAddInfo::swig_nr_get(info); p["fsid"] = LibStorage::PartitionAddInfo::swig_id_get(info); p["fstype"] = Partitions::FsIdToString( p["fsid"]:0 ); p["region"] = [ LibStorage::PartitionAddInfo::swig_cylStart_get(info), LibStorage::PartitionAddInfo::swig_cylSize_get(info) ]; integer t = LibStorage::PartitionAddInfo::swig_partitionType_get(info); p["type"] = toSymbol( conv_ptype, t ); boolean boot = LibStorage::PartitionAddInfo::swig_boot_get(info); if( boot ) p["boot"] = true; string tmp = LibStorage::PartitionAddInfo::swig_udevId_get(info); if( size(tmp)>0 ) p["udev_id"] = splitstring( tmp, " " ); tmp = LibStorage::PartitionAddInfo::swig_udevPath_get(info); if( size(tmp)>0 ) p["udev_path"] = tmp; y2milestone( "partAddMap ret:%1", p ); return( p ); } map dmPartMap( any info, map p ) { any vinfo = LibStorage::DmPartInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["nr"] = 0; boolean part = LibStorage::DmPartInfo::swig_part_get(info); if( part ) { any pinfo = LibStorage::DmPartInfo::swig_p_get(info); p = partAddMap( pinfo, p ); } y2milestone( "dmPartMap ret:%1", p ); return( p ); } map mdPartMap(any info, map p) { any vinfo = LibStorage::MdPartInfo::swig_v_get(info); p = volumeMap(vinfo, p); p["nr"] = 0; boolean part = LibStorage::MdPartInfo::swig_part_get(info); if (part) { any pinfo = LibStorage::MdPartInfo::swig_p_get(info); p = partAddMap(pinfo, p); } y2milestone("mdPartMap ret:%1", p); return p; } map getContainerInfo( map c ) { y2milestone( "getContainerInfo %1", c ); integer ret = 0; integer t = 0; any vinfo = LibStorage::VolumeInfo::new("LibStorage::VolumeInfo"); if( c["type"]:`CT_UNKNOWN == `CT_DISK ) { list pinfos = []; any infos = LibStorage::DiskInfo::new("LibStorage::DiskInfo"); string d = c["device"]:""; ret = LibStorage::StorageInterface::getDiskInfo( sint, d, infos ); if( ret==0 ) { c = diskMap( infos, c ); } else y2warning( "disk \"%1\" ret:%2", c["device"]:"", ret ); c["partitions"] = []; ret = LibStorage::StorageInterface::getPartitionInfo( sint, d, pinfos ); foreach( any info, pinfos, ``{ string tmp = ""; map p = $[]; vinfo = LibStorage::PartitionInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["nr"] = LibStorage::PartitionInfo::swig_nr_get(info); p["fsid"] = LibStorage::PartitionInfo::swig_id_get(info); p["fstype"] = Partitions::FsIdToString( p["fsid"]:0 ); p["region"] = [ LibStorage::PartitionInfo::swig_cylStart_get(info), LibStorage::PartitionInfo::swig_cylSize_get(info) ]; t = LibStorage::PartitionInfo::swig_partitionType_get(info); p["type"] = toSymbol( conv_ptype, t ); boolean boot = LibStorage::PartitionInfo::swig_boot_get(info); if( boot ) p["boot"] = true; tmp = LibStorage::PartitionInfo::swig_udevId_get(info); if( size(tmp)>0 ) p["udev_id"] = splitstring( tmp, " " ); tmp = LibStorage::PartitionInfo::swig_udevPath_get(info); if( size(tmp)>0 ) p["udev_path"] = tmp; c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_DMRAID ) { list pinfos = []; any infos = LibStorage::DmraidCoInfo::new("LibStorage::DmraidCoInfo"); string d = c["device"]:""; ret = LibStorage::StorageInterface::getDmraidCoInfo( sint, d, infos ); if( ret==0 ) { any pinfo = LibStorage::DmraidCoInfo::swig_p_get( infos ); c = dmPartCoMap( pinfo, c ); } else y2warning( "disk \"%1\" ret:%2", c["device"]:"", ret ); c["partitions"] = []; ret = LibStorage::StorageInterface::getDmraidInfo( sint, d, pinfos ); foreach( any info, pinfos, ``{ any pinfo = LibStorage::DmraidInfo::swig_p_get( info ); map p = $[]; p = dmPartMap( pinfo, p ); p["fstype"] = Partitions::dmraid_name; if( p["nr"]:-1 != 0 ) c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_DMMULTIPATH ) { list pinfos = []; any infos = LibStorage::DmmultipathCoInfo::new("LibStorage::DmmultipathCoInfo"); string d = c["device"]:""; ret = LibStorage::StorageInterface::getDmmultipathCoInfo( sint, d, infos ); if( ret==0 ) { any pinfo = LibStorage::DmmultipathCoInfo::swig_p_get( infos ); c = dmPartCoMap( pinfo, c ); } else y2warning( "disk \"%1\" ret:%2", c["device"]:"", ret ); c["partitions"] = []; ret = LibStorage::StorageInterface::getDmmultipathInfo( sint, d, pinfos ); foreach( any info, pinfos, ``{ any pinfo = LibStorage::DmmultipathInfo::swig_p_get( info ); map p = $[]; p = dmPartMap( pinfo, p ); p["fstype"] = Partitions::dmmultipath_name; if( p["nr"]:-1 != 0 ) c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_MDPART ) { list pinfos = []; any infos = LibStorage::MdPartCoInfo::new("LibStorage::MdPartCoInfo"); string d = c["device"]:""; ret = LibStorage::StorageInterface::getMdPartCoInfo(sint, d, infos); if (ret == 0) { any dinfo = LibStorage::MdPartCoInfo::swig_d_get(infos); c = diskMap(dinfo, c); } else y2warning( "disk \"%1\" ret:%2", c["device"]:"", ret ); list ls = splitstring(LibStorage::MdPartCoInfo::swig_devices_get(infos), " "); y2milestone( "ls=%1", ls ); c["devices"] = ls; integer t = LibStorage::MdPartCoInfo::swig_level_get(infos); c["raid_type"] = substring(sformat("%1", toSymbol(conv_mdtype, t)), 1); if (c["raid_type"]:"" == "raid5") { t = LibStorage::MdPartCoInfo::swig_parity_get(infos); symbol pt = toSymbol(conv_mdparity, t); if (pt != `par_none) c["parity_algorithm"] = substring(sformat("%1", pt), 1); } t = LibStorage::MdPartCoInfo::swig_chunk_get(infos); if (t > 0) { c["chunk_size"] = t; } c["sb_ver"] = LibStorage::MdPartCoInfo::swig_sb_ver_get(infos); c["partitions"] = []; ret = LibStorage::StorageInterface::getMdPartInfo(sint, d, pinfos); foreach(any info, pinfos, { map p = $[]; p = mdPartMap(info, p); p["fstype"] = Partitions::raid_name; if (p["nr"]:-1 != 0) c["partitions"] = add(c["partitions"]:[], p); }); } else if( c["type"]:`CT_UNKNOWN == `CT_LVM ) { list pinfos = []; any infos = LibStorage::LvmVgInfo::new("LibStorage::LvmVgInfo"); string n = c["name"]:""; ret = LibStorage::StorageInterface::getLvmVgInfo( sint, n, infos ); if( ret==0 ) { c["create"] = LibStorage::LvmVgInfo::swig_create_get(infos); c["size_k"] = LibStorage::LvmVgInfo::swig_sizeK_get(infos); c["cyl_size"] = 1024*LibStorage::LvmVgInfo::swig_peSize_get(infos); c["pesize"] = 1024*LibStorage::LvmVgInfo::swig_peSize_get(infos); c["cyl_count"] = LibStorage::LvmVgInfo::swig_peCount_get(infos); c["pe_free"] = LibStorage::LvmVgInfo::swig_peFree_get(infos); c["lvm2"] = LibStorage::LvmVgInfo::swig_lvm2_get(infos); list ls = splitstring( LibStorage::LvmVgInfo::swig_devices_get(infos), " " ); y2milestone( "ls=%1", ls ); c["devices"] = ls; ls = splitstring( LibStorage::LvmVgInfo::swig_devices_add_get(infos), " " ); if( size(ls)>0 ) c["devices_add"] = ls; ls = splitstring( LibStorage::LvmVgInfo::swig_devices_rem_get(infos), " " ); if( size(ls)>0 ) c["devices_rem"] = ls; } else y2warning( "LVM Vg \"%1\" ret:%2", c["name"]:"", ret ); ret = LibStorage::StorageInterface::getLvmLvInfo( sint, n, pinfos ); foreach( any info, pinfos, ``{ map p = $[]; vinfo = LibStorage::LvmLvInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["stripes"] = LibStorage::LvmLvInfo::swig_stripe_get(info); t = LibStorage::LvmLvInfo::swig_stripe_size_get(info); if( t>0 ) p["stripesize"] = t; p["type"] = `lvm; p["fstype"] = Partitions::lv_name; c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_MD ) { list pinfos = []; ret = LibStorage::StorageInterface::getMdInfo( sint, pinfos ); if( ret<0 ) y2warning( "getMdInfo ret:%1", ret ); foreach( any info, pinfos, ``{ map p = $[]; vinfo = LibStorage::MdInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["nr"] = LibStorage::MdInfo::swig_nr_get(info); integer t = LibStorage::MdInfo::swig_type_get(info); p["raid_type"] = substring( sformat( "%1", toSymbol( conv_mdtype, t )), 1 ); if( p["raid_type"]:""=="raid5" ) { t = LibStorage::MdInfo::swig_parity_get(info); symbol pt = toSymbol( conv_mdparity, t ); if( pt != `par_none ) p["parity_algorithm"] = substring( sformat( "%1", pt), 1 ); } p["type"] = `sw_raid; p["fstype"] = Partitions::raid_name; t = LibStorage::MdInfo::swig_chunk_get(info); if( t>0 ) { p["chunk_size"] = t; } string d = LibStorage::MdInfo::swig_sb_ver_get(info); p["sb_ver"] = d; list ls = splitstring( LibStorage::MdInfo::swig_devices_get(info), " " ); p["devices"] = ls; c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_LOOP ) { list pinfos = []; ret = LibStorage::StorageInterface::getLoopInfo( sint, pinfos ); if( ret<0 ) y2warning( "getLoopInfo ret:%1", ret ); foreach( any info, pinfos, ``{ map p = $[]; vinfo = LibStorage::LoopInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["nr"] = LibStorage::LoopInfo::swig_nr_get(info); p["type"] = `loop; p["fstype"] = Partitions::loop_name; p["fpath"] = LibStorage::LoopInfo::swig_file_get(info); p["create_file"] = !LibStorage::LoopInfo::swig_reuseFile_get(info); if( p["enc_type"]:`unknown != `luks ) p["device"] = p["loop"]:""; c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_DM ) { list pinfos = []; ret = LibStorage::StorageInterface::getDmInfo( sint, pinfos ); if( ret<0 ) y2warning( "getDmInfo ret:%1", ret ); foreach( any info, pinfos, ``{ map p = $[]; vinfo = LibStorage::DmInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["nr"] = LibStorage::DmInfo::swig_nr_get(info); p["type"] = `dm; p["fstype"] = Partitions::dm_name; c["partitions"] = add( c["partitions"]:[], p ); }); } else if( c["type"]:`CT_UNKNOWN == `CT_NFS ) { list pinfos = []; y2milestone( "before getNfsInfo" ); ret = LibStorage::StorageInterface::getNfsInfo( sint, pinfos ); y2milestone( "after getNfsInfo" ); if( ret<0 ) y2warning( "getNfsInfo ret:%1", ret ); foreach( any info, pinfos, ``{ map p = $[]; vinfo = LibStorage::NfsInfo::swig_v_get(info); p = volumeMap( vinfo, p ); p["type"] = `nfs; p["fstype"] = Partitions::nfs_name; c["partitions"] = add( c["partitions"]:[], p ); }); } //y2milestone ("getContainerInfo container %1", remove( c, "partitions" ) ); y2milestone ("getContainerInfo container %1", c ); return( c ); } map toDiskMap( map disk, map cinfo ) { list l = [ "size_k", "cyl_size", "cyl_count", "label", "max_logical", "max_primary", "type", "readonly", "used_by_type", "used_by", "used_by_device", "partitions", "dasdfmt", "udev_id", "udev_path" ]; foreach( string s, l, ``{ if( haskey( cinfo, s ) ) disk[s] = cinfo[s]:(any)0; else if( haskey( disk, s )) disk = remove( disk, s ); }); return( disk ); } list getContainers() ``{ list ret = []; list cinfos = []; LibStorage::StorageInterface::getContainers( sint, cinfos ); foreach( any info, cinfos, ``{ map c = $[]; c["name"] = LibStorage::ContainerInfo::swig_name_get(info); c["device"] = LibStorage::ContainerInfo::swig_device_get(info); integer t = LibStorage::ContainerInfo::swig_type_get(info); c["type"] = toSymbol( conv_ctype, t ); t = LibStorage::ContainerInfo::swig_usedByType_get(info); if( t!=LibStorage::UB_NONE() ) { c["used_by_type"] = toSymbol( conv_usedby, t ); c["used_by"] = LibStorage::ContainerInfo::swig_usedByName_get(info); c["used_by_device"] = LibStorage::ContainerInfo::swig_usedByDevice_get(info); } boolean b = LibStorage::ContainerInfo::swig_readonly_get(info); if( b ) c["readonly"] = true; ret = add( ret, c ); }); y2milestone( "getContainers ret:%1", ret ); return( ret ); }; integer count=0; global boolean IsDiskType(symbol t) { return contains([ `CT_DISK, `CT_DMRAID, `CT_DMMULTIPATH, `CT_MDPART ], t); } /** * Updates target map * * @see GetTargetMap() */ global void UpdateTargetMap() { conts = getContainers(); list rem_keys = []; map tg = StorageMap[targets_key]:$[]; //SCR::Write(.target.ycp, "/tmp/upd_all_bef_"+sformat("%1",count), StorageMap[targets_key]:$[] ); foreach( string dev, map disk, tg, ``{ map c = $[]; c = find( map c, conts, ``(c["device"]:""==dev) ); if( c==nil ) rem_keys = add( rem_keys, dev ); else if (IsDiskType(c["type"]:`CT_UNKNOWN)) { tg[dev] = toDiskMap( tg[dev]:$[], getContainerInfo( c ) ); } else { tg[dev] = getContainerInfo(c); } y2milestone( "UpdateTargetMap dev:%1 is:%2", dev, tg[dev]:$[] ); }); y2milestone( "UpdateTargetMap rem_keys:%1", rem_keys ); foreach( string dev, rem_keys, ``{tg=remove(tg,dev);}); foreach( map c, conts, ``{ if( c["type"]:`CT_UNKNOWN!=`CT_DISK && !haskey( tg, c["device"]:"" )) { tg[c["device"]:""] = getContainerInfo(c); y2milestone( "UpdateTargetMap dev:%1 is:%2", c["device"]:"", tg[c["device"]:""]:$[] ); } }); StorageMap[targets_key] = tg; //SCR::Write(.target.ycp, "/tmp/upd_all_aft_"+sformat("%1",count), StorageMap[targets_key]:$[] ); //count = count+1; } define void UpdateTargetMapDisk( string dev ) { y2milestone( "UpdateTargetMapDisk" ); conts = getContainers(); map c = $[]; c = find( map c, conts, ``(c["device"]:""==dev) ); map tg = StorageMap[targets_key]:$[]; //SCR::Write(.target.ycp, "/tmp/upd_disk_bef_"+sformat("%1",count), StorageMap[targets_key]:$[] ); if( c==nil ) { if( haskey( tg, dev ) ) tg = remove( tg, dev ); } else if (IsDiskType(c["type"]:`CT_UNKNOWN)) { tg[dev] = toDiskMap( tg[dev]:$[], getContainerInfo( c ) ); } else { tg[dev] = getContainerInfo(c); } StorageMap[targets_key] = tg; //SCR::Write(.target.ycp, "/tmp/upd_disk_aft_"+sformat("%1",count), StorageMap[targets_key]:$[] ); //count = count+1; } define void UpdateTargetMapDev( string dev ) { y2milestone( "UpdateTargetMapDev %1", dev ); map tg = StorageMap[targets_key]:$[]; //SCR::Write(.target.ycp, "/tmp/upd_dev_bef_"+sformat("%1",count), tg ); string cdev=""; foreach( string key, map d, tg, ``{ if( size(cdev)==0 && find( map p, d["partitions"]:[], ``(p["device"]:""==dev))!=nil ) cdev = d["device"]:""; }); y2milestone( "UpdateTargetMapDev cdev %1", cdev ); map c = $[]; c = find( map c, conts, ``(c["device"]:""==cdev) ); map disk = $[]; if( c!=nil ) { disk = getContainerInfo( c ); } if( c!=nil && haskey( tg, cdev )) { list partitions = tg[cdev,"partitions"]:[]; boolean found = false; partitions = maplist( map p, partitions, ``{ if( p["device"]:"" == dev ) { map pp = find( map q, disk["partitions"]:[], ``(q["device"]:""==dev)); if( pp!=nil ) { found = true; p = pp; } } return( p ); }); tg[disk["device"]:"","partitions"] = partitions; if( !found ) y2error( "UpdateTargetMapDev not found %1", dev ); } else y2error( "UpdateTargetMapDev key %1 not found in target", disk["device"]:"" ); StorageMap[targets_key] = tg; //SCR::Write(.target.ycp, "/tmp/upd_dev_aft_"+sformat("%1",count), StorageMap[targets_key]:$[] ); //count = count+1; } /** * Returns map with disk info * * @param string device * @param map disk * @return map disk info */ global define map getDiskInfo( string device, map disk ) { map c = $[]; c = find( map p, conts, ``(p["device"]:""==device )); if( c==nil ) { map tmp = GetDiskPartition( device ); y2milestone( "getDiskInfo map %1", tmp ); if( tmp["disk"]:"" != device ) c = find( map p, conts, ``(p["device"]:""==tmp["disk"]:"" )); } y2milestone( "getDiskInfo c:%1", c ); if( c!=nil ) { disk = toDiskMap( disk, getContainerInfo( c ) ); y2milestone( "getDiskInfo ret:%1", haskey(disk,"partitions")?remove(disk,"partitions"):disk ); } return( disk ); } global define void SaveExitKey( symbol key ) ``{ if( key == `next || key == `back ) { exit_key = key; y2milestone( "Exit Key %1", exit_key ); } }; global define symbol GetExitKey() ``{ return( exit_key ); }; /** * Finds and returns fstab entry * * @param map fstab * @param string mount * @param string device * @param string uuid * @param string label * @return map fstab entry * * @example * FindFstabEntry ($[], "", "", "", "") * * @struct * $[ * "spec" : "...", * "file" : "...", * "vfstype" : "...", * "mntops" : "...", * "freq" : ..., * "passno" : ..., * ] */ /* global define map FindFstabEntry( map fstab, string mount, string device, string uuid, string label ) { map ret = $[]; list lines = []; lines = FindFstabLines( fstab, mount, device, uuid, label ); y2milestone( "mount=%1 device=%2 uuid=%3 label=%4", mount, device, uuid, label ); if( size(lines)>0 ) { map entry = AsciiFile::GetLine( fstab, lines[0]:-1 ); ret = $[ "spec" : entry["fields",0]:"", "file" : entry["fields",1]:"", "vfstype" : entry["fields",2]:"", "mntops" : entry["fields",3]:"", "freq" : entry["fields",4]:0, "passno" : entry["fields",5]:0 ]; } y2milestone( "ret:%1", ret ); return( ret ); } */ /** * Returns map describing the disk target * * @return map */ global define map< string, map > GetOndiskTarget() { list keys = [ "mount", "enc_type", "mountby", "fstopt", "used_fs", "format" ]; map ret = GetTargetMap(); foreach( string d, map disk, ret, ``{ list pl = maplist( map p, disk["partitions"]:[], ``( filter( string k, any e, p, ``(!contains(keys,k))))); pl = maplist( map p, pl, ``({ if( p["detected_fs"]:`unknown!=`unknown ) p["used_fs"] = p["detected_fs"]:`unknown; return(p); })); ret[d,"partitions"] = pl; }); return( ret ); } global define void CreateTargetBackup(string who) { string t = "targetMap_s_" + who + "_" + sformat("%1",count); count = count+1; SCR::Write(.target.ycp, Storage::SaveDumpPath(t), GetTargetMap() ); y2milestone( "CreateTargetBackup who:%1", who ); integer ret = LibStorage::StorageInterface::createBackupState( sint, who ); if( ret<0 ) y2error( "CreateTargetBackup sint ret:%1", ret ); } global define void DisposeTargetBackup(string who) { y2milestone( "DisposeTargetBackup who:%1", who ); integer ret = LibStorage::StorageInterface::removeBackupState( sint, who ); if( ret<0 ) y2error( "DisposeTargetBackup sint ret:%1", ret ); } global define boolean EqualBackupStates( string s1, string s2, boolean vb ) { y2milestone( "EqualBackupStates s1:\"%1\" s2:\"%2\" verbose:%3", s1, s2, vb ); boolean ret = LibStorage::StorageInterface::equalBackupStates( sint, s1, s2, vb ); y2milestone( "EqualBackupStates ret:%1", ret ); return( ret ); } global define void RestoreTargetBackup( string who ) { y2milestone( "RestoreTargetBackup who:%1", who ); integer ret = LibStorage::StorageInterface::restoreBackupState( sint, who ); if( ret<0 ) y2error( "RestoreTargetBackup sint ret:%1", ret ); UpdateTargetMap(); string t = "targetMap_r_" + who; SCR::Write(.target.ycp, Storage::SaveDumpPath(t), GetTargetMap() ); } global define void ResetOndiskTarget() { RestoreTargetBackup( "initial" ); } global define integer GetTargetChangeTime() { return( StorageMap["targets_time"]:0 ); } global define boolean GetPartProposalActive() { return StorageMap[part_proposal_active_key]:true; }; global define void SetPartProposalActive( boolean value ) { StorageMap[part_proposal_active_key] = value; }; global define string GetPartMode() { y2milestone( "GetPartMode %1", StorageMap[part_mode_key]:"" ); return StorageMap[part_mode_key]:""; }; global define void SetPartMode( string value ) { y2milestone( "SetPartMode %1", value ); StorageMap[part_mode_key] = value; }; global define boolean GetCustomDisplay() { return StorageMap[custom_display_key]:false; }; global define void SetCustomDisplay( boolean value ) { StorageMap[custom_display_key] = value; }; global define string GetPartDisk() { return StorageMap[part_disk_key]:""; }; global define void SetPartDisk( string value ) { StorageMap[part_disk_key] = value; }; global define boolean GetTestsuite()``{ return StorageMap[testsuite_key]:false; } global define void SetTestsuite( boolean value ) ``{ StorageMap = add( StorageMap, testsuite_key, value ); } global define string GetDoResize()``{ return StorageMap[do_resize_key]:"NO"; } global define void SetDoResize( string value ) ``{ StorageMap = add( StorageMap, do_resize_key, value ); } global define string GetPartProposalMode()``{ return StorageMap[part_proposal_mode_key]:"accept"; } global define void SetPartProposalMode( string value ) ``{ StorageMap = add( StorageMap, part_proposal_mode_key, value ); } global define boolean GetPartProposalFirst()``{ return StorageMap[part_proposal_first_key]:true; } global define void SetPartProposalFirst( boolean value ) ``{ StorageMap = add( StorageMap, part_proposal_first_key, value ); } global define boolean GetWinDevice()``{ return StorageMap[win_device_key]:false; } global define void SetWinDevice( boolean value ) ``{ StorageMap = add( StorageMap, win_device_key, value ); } global define void InstallCallbacks() { StorageClients::InstallCallbacks(); } // Constructor global define void Storage() ``{ map m = (map)SCR::Execute(.target.bash_output, "date +%s.%N" ); y2milestone( "constructor Storage() time:%1", m["stdout"]:"" ); if( Mode::normal() ) { Storage::SetPartMode( "CUSTOM" ); Storage::SetPartProposalActive( false ); } if( Stage::initial() ) { string inst = (string) SCR::Read( .etc.install_inf.Partition ); if( inst!=nil && size(inst)>0 ) { part_insts = "/dev/" + inst; y2milestone( "Storage .etc.install_inf.Partition \"%1\" part_insts:%2", inst, part_insts ); } Storage::SetPartMode( "CUSTOM" ); Storage::SetPartProposalActive( false ); } InstallCallbacks(); m = (map)SCR::Execute(.target.bash_output, "date +%s.%N" ); y2milestone( "constructor Storage() end time:%1", m["stdout"]:"" ); } /* Dev definitions dev = maindev | subdev maindev = "disk" | "vg" | "md" (raiddev) subdev = "part" | "lv" | "raid" e.g.: "disk" = "/dev/hda" | "dev/sda" | "/dev/hdd" | ... "vg" = "/dev/system" | "dev/group" | ... "md" = "/dev/md" (only) "part" = "1//dev/hda" | "2//dev/sda" | .. "lv" = "usr//dev/system" | "home//dev/system" */ /* Key definitions key = maindevkey | subdevkey + maindevkey maindevkey = key( disk | vg | md ) subdevkey = key( part | lv | raid ) subdevkey = maindevkey + subdevindex | "all" subdevindex = 1 | 2 | "home" | "usr" | .. e.g.: maindevkey = "/dev/hda" | "/dev/md" | "/dev/system" | "all" subdevkey = "1//dev/hda" | "1//dev/md" | "home//dev/system" | "all" */ /* MainDev defines ------------------------------------------------------------------ /* partition_defines -> isDisk */ /* partition_defines -> isRaid */ /* partition_defines -> isLVM */ symbol sw_raid_type_key = `sw_raid; symbol lvm_type_key = `lvm; symbol extended_type_key= `extended; global map NextPartition( string disk, symbol ptype ) { y2milestone( "NextPartition disk:%1 ptype:%2", disk, ptype ); map ret = $[]; integer pt = fromSymbol(conv_ptype,ptype); y2milestone( "NextPartition type:%1 pt:%2", ptype, pt ); integer num = 0; string dev = ""; integer r = LibStorage::StorageInterface::nextFreePartition( sint, disk, pt, num, dev ); if( r<0 ) y2error( "NextPartition ret %1", r ); ret["device"] = dev; ret["nr"] = num; y2milestone( "NextPartition sint ret:%1 map:%2", r, ret ); return( ret ); } global map NextMd() { y2milestone("NextMd"); integer num = 0; string dev = ""; integer r = LibStorage::StorageInterface::nextFreeMd(sint, num, dev); if( r<0 ) y2error("NextMd ret %1", r); map ret = $[ "device" : dev, "nr" : num ]; y2milestone( "NextMd sint ret:%1 map:%2", r, ret ); return ret; } global integer MaxSizeLabelK( map disk ) { integer ret = 0; string tmp = disk["label"]:""; ret = LibStorage::StorageInterface::maxSizeLabelK( sint, tmp ); y2milestone( "MaxSizeLabelK %1 is %2", disk["label"]:"", ret ); return( ret ); } global integer MaxCylLabel( map disk, integer start_cyl ) { integer ret = MaxSizeLabelK(disk); y2milestone( "MaxCylLabel val_k:%1 cyl_size:%2", ret, disk["cyl_size"]:1 ); integer cylk2 = disk["cyl_size"]:1/512; if( cylk2<2 ) cylk2 = 2; y2milestone( "MaxCylLabel val_k:%1 cylk2:%2", ret, cylk2 ); ret = ret*2 / cylk2 - 1; ret = ret + start_cyl; y2milestone( "MaxCylLabel ret:%1", ret ); return( ret ); } /** * Creates a new partition * * @param string disk * @param string device * @param symbol ptype (types?) * @param integer id * @param integer start * @param integer len (bytes|cyls?) * @param symbol mby (one of?) * @return boolean if successful */ global boolean CreatePartition( string disk, string device, symbol ptype, integer id, integer start, integer len, symbol mby ) { y2milestone( "CreatePartition disk:%1 device:%2 ptype:%3 id:%4 start:%5 len:%6 mby:%7", disk, device, ptype, id, start, len, mby ); string cdev = ""; integer pt = fromSymbol(conv_ptype,ptype); y2milestone( "CreatePartition type:%1 pt:%2", ptype, pt ); integer ret = LibStorage::StorageInterface::createPartition( sint, disk, pt, start, len, cdev ); if( device!=cdev ) y2error( "CreatePartition device:%1 cdev:%2", device, cdev ); if( ret<0 ) y2error( "CreatePartition ret %1", ret ); ret = LibStorage::StorageInterface::changePartitionId( sint, device, id ); if( ret<0 ) y2error( "CreatePartition ret %1", ret ); integer tmp = fromSymbol( conv_mountby, mby ); LibStorage::StorageInterface::changeMountBy( sint, device, tmp ); y2milestone( "CreatePartition sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean UpdatePartition( string device, integer start, integer len ) { y2milestone( "UpdatePartition device:%1 start:%2 len:%3", device, start, len ); integer ret = 0; ret = LibStorage::StorageInterface::updatePartitionArea( sint, device, start, len ); if( ret<0 ) y2error( "UpdatePartition sint ret:%1", ret ); UpdateTargetMapDev( device ); return( ret==0 ); } /** * Sets a mountpoint for partition * * @param string device name * @param string mount point * @return boolean if successful */ global boolean SetPartitionMount( string device, string mp ) { y2milestone( "SetPartitionMount device:%1 mp:%2", device, mp ); integer ret = 0; ret = LibStorage::StorageInterface::changeMountPoint( sint, device, mp ); if( ret<0 ) y2error( "SetPartitionMount sint ret:%1", ret ); UpdateTargetMapDev( device ); return( ret==0 ); } /** * Sets whether a partition should be formatted * * @param string device name * @param boolean format (yes,no) * @param symbol filesystem * @return boolean if successful */ global boolean SetPartitionFormat( string device, boolean format, symbol fs ) { y2milestone( "SetPartitionFormat device:%1 format:%2 fs:%3", device, format, fs ); integer ret = 0; integer tmp = fromSymbol( FileSystems::conv_fs, fs ); y2milestone( "SetPartitionFormat fs:%1", tmp ); ret = LibStorage::StorageInterface::changeFormatVolume( sint, device, format, tmp ); if( ret<0 ) y2error( "SetPartitionFormat sint ret:%1", ret ); UpdateTargetMapDev( device ); return( ret==0 ); } /** * Sets partition ID * * @param string device name * @param integer ID * @return boolean if successful * * @see UnchangePartitionId() */ global boolean SetPartitionId( string device, integer id ) { y2milestone( "SetPartitionId device:%1 id:%2", device, id ); integer ret = 0; ret = LibStorage::StorageInterface::changePartitionId( sint, device, id ); if( ret<0 ) y2error( "SetPartitionId sint ret:%1", ret ); UpdateTargetMapDev( device ); return( ret==0 ); } /** * Restores the original partition ID * * @param string device name * @return boolean if succesful * * @see SetPartitionId() */ global boolean UnchangePartitionId( string device ) { y2milestone( "UnchangePartitionId device:%1", device ); integer ret = 0; ret = LibStorage::StorageInterface::forgetChangePartitionId( sint, device ); if( ret<0 ) y2error( "UnchangePartitionId sint ret:%1", ret ); UpdateTargetMapDev( device ); return( ret==0 ); } /** * Sets a new size for volume * * @param string device name * @param string disk * @param integer new_cyls (in cylinders) * @return boolean if successfull */ global boolean ResizePartition(string device, string disk, integer new_cyls) { y2milestone("ResizePartition device:%1 disk:%2 new_cyls:%3", device, disk, new_cyls); integer ret = 0; ret = LibStorage::StorageInterface::resizePartition(sint, device, new_cyls); if (ret < 0) y2error("ResizePartition sint ret:%1", ret); UpdateTargetMapDisk (disk); return ret == 0; } /** * Sets a new size for volume * * @param string device name * @param string disk * @param integer new_size (in kBytes) * @return boolean if successfull */ global boolean ResizeVolume(string device, string disk, integer new_size_k) { y2milestone("ResizeVolume device:%1 disk:%2 new_size_k:%3", device, disk, new_size_k); integer ret = 0; ret = LibStorage::StorageInterface::resizeVolume(sint, device, (new_size_k+1023)/1024); if (ret < 0) y2error("ResizeVolume sint ret:%1", ret); UpdateTargetMapDisk(disk); return ret == 0; } global boolean SetCrypt( string device, boolean crpt, boolean format ) { y2milestone( "SetCrypt device:%1 val:%2 format:%3", device, crpt, format ); boolean is_crypt = false; integer ret = LibStorage::StorageInterface::getCrypt( sint, device, is_crypt ); if( ret==0 && !format && is_crypt==crpt ) y2milestone( "SetCrypt crypt already set" ); else { ret = LibStorage::StorageInterface::setCrypt( sint, device, crpt ); if( ret<0 ) { y2error( "SetCrypt sint ret:%1", ret ); if( !format && crpt ) Popup::Error( sformat(_("Could not set encryption. System error code is %1. The crypt password provided could be incorrect. "), ret )); LibStorage::StorageInterface::forgetCryptPassword( sint, device ); } else y2milestone( "SetCrypt sint ret:%1", ret ); } return( ret==0 ); } integer ChangeDescText( string dev, string txt ) { integer ret = LibStorage::StorageInterface::changeDescText( sint, dev, txt ); return( ret ); } global boolean ChangeVolumeProperties( map part ) { integer ret = 0; integer tmp = 0; boolean changed = false; string ts = ""; string dev = part["device"]:""; any vinfo = LibStorage::VolumeInfo::new("LibStorage::VolumeInfo"); ret = LibStorage::StorageInterface::getVolume( sint, dev, vinfo ); if( ret!=0 ) y2error( "ChangeVolumeProperties device:%1 not found", dev ); map curr = $[]; if( ret==0 ) { curr = volumeMap( vinfo, curr ); } if( ret==0 && part["mount"]:"" != curr["mount"]:"" ) { changed = true; ts = part["mount"]:""; ret = LibStorage::StorageInterface::changeMountPoint( sint, dev, ts ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && part["type"]:`unknown != `extended && (part["format"]:false != curr["format"]:false || part["used_fs"]:`none != curr["used_fs"]:`none) ) { changed = true; tmp = fromSymbol(FileSystems::conv_fs,part["used_fs"]:`none); y2milestone( "ChangeVolumeProperties fs:%1 symbol:%2", tmp, part["used_fs"]:`none ); ret = LibStorage::StorageInterface::changeFormatVolume( sint, dev, part["format"]:false, tmp ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && size(part["mount"]:"")>0 && part["fstopt"]:"" != curr["fstopt"]:"" ) { changed = true; ts = part["fstopt"]:""; ret = LibStorage::StorageInterface::changeFstabOptions( sint, dev, ts ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && size(part["mount"]:"")>0 && part["mountby"]:`id != curr["mountby"]:`id ) { changed = true; tmp = fromSymbol(conv_mountby,part["mountby"]:`device); y2milestone( "ChangeVolumeProperties mby:%1", tmp ); ret = LibStorage::StorageInterface::changeMountBy( sint, dev, tmp ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && part["label"]:"" != curr["label"]:"" ) { changed = true; ts = part["label"]:""; ret = LibStorage::StorageInterface::changeLabelVolume( sint, dev, ts ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && part["format"]:false && convertFsOptionMapToString(part["fs_options"]:$[], `mkfs) != curr["mkfs_opt"]:"" ) { changed = true; ts = convertFsOptionMapToString(part["fs_options"]:$[], `mkfs); y2milestone( "FsOption ts:%1", ts ); ret = LibStorage::StorageInterface::changeMkfsOptVolume( sint, dev, ts ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && part["format"]:false && convertFsOptionMapToString(part["fs_options"]:$[], `tunefs) != curr["tunefs_opt"]:"" ) { changed = true; ts = convertFsOptionMapToString(part["fs_options"]:$[], `tunefs); y2milestone( "FsOption ts:%1", ts ); ret = LibStorage::StorageInterface::changeTunefsOptVolume( sint, dev, ts ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && part["enc_type"]:`none != curr["enc_type"]:`none ) { changed = true; SetCrypt( dev, part["enc_type"]:`none!=`none, part["format"]:false ); } if( ret==0 && part["dtxt"]:"" != curr["dtxt"]:"" ) { changed = true; ret = ChangeDescText( dev, part["dtxt"]:"" ); } if( ret==0 && ((part["resize"]:false && part["region",1]:0 != curr["region",1]:0) || (part["resize"]:false != curr["resize"]:false)) ) { changed = true; string d = part["device"]:""; integer i = part["region",1]:0; if( part["resize"]:false ) { y2milestone( "ChangeVolumeProperties resize to %1 cyl", i ); if( part["ignore_fs"]:false ) ret = LibStorage::StorageInterface::resizePartitionNoFs( sint, d, i ); else ret = LibStorage::StorageInterface::resizePartition( sint, d, i ); } else ret = LibStorage::StorageInterface::forgetResizeVolume( sint, d ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 && part["change_fsid"]:false && part["fsid"]:0 != curr["fsid"]:0) { changed = true; string d = part["device"]:""; integer i = part["fsid"]:0; y2milestone( "ChangeVolumeProperties fsid to %1", i ); ret = LibStorage::StorageInterface::changePartitionId( sint, d, i ); if( ret<0 ) y2error( "ChangeVolumeProperties sint ret:%1", ret ); else y2milestone( "ChangeVolumeProperties sint ret:%1", ret ); } if( ret==0 ) { y2debug( "ChangeVolumeProperties changed:%1 part:%2", changed, part ); if( changed ) UpdateTargetMapDev( dev ); } return( ret==0 ); } global boolean DeleteDevice( string disk, string device ) { y2milestone( "DeleteDevice disk:%1 device:%2", disk, device ); integer ret = LibStorage::StorageInterface::removeVolume( sint, device ); if( ret<0 ) y2error( "DeleteDevice sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean DeleteLvmVg( string name ) { y2milestone( "DeleteLvmVg name:%1", name ); integer ret = LibStorage::StorageInterface::removeLvmVg( sint, name ); if( ret<0 ) y2error( "DeleteLvmVg sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean DeleteDmraid( string name ) { y2milestone( "DeleteDmraid name:%1", name ); integer ret = LibStorage::StorageInterface::removeDmraid( sint, name ); if( ret<0 ) y2error( "DeleteDmraid sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean DeleteMdPartCo( string name ) { y2milestone( "DeleteMdPartCo name:%1", name ); integer ret = LibStorage::StorageInterface::removeMdPartCo( sint, name, true ); if( ret<0 ) y2error( "DeleteMdPartCo sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean CreateLvmVg( string name, integer pesize, boolean lvm2 ) { y2milestone( "CreateLvmVg name:%1 pesize:%2 lvm2:%3", name, pesize, lvm2 ); list devs = []; integer ret = 0; ret = LibStorage::StorageInterface::createLvmVg( sint, name, pesize/1024, !lvm2, devs ); if( ret<0 ) y2error( "CreateLvmVg sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean CreateLvmVgWithDevs( string name, integer pesize, boolean lvm2, list devs ) { y2milestone( "CreateLvmVgWithDevs name:%1 pesize:%2 lvm2:%3 devs:%4", name, pesize, lvm2, devs ); integer ret = 0; ret = LibStorage::StorageInterface::createLvmVg( sint, name, pesize/1024, !lvm2, devs ); if( ret<0 ) y2error( "CreateLvmVgWithDevs sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean ExtendLvmVg( string name, string device ) { y2milestone( "ExtendLvmVg name:%1 device:%2", name, device ); integer ret = 0; list devs = [ device ]; ret = LibStorage::StorageInterface::extendLvmVg( sint, name, devs ); if( ret<0 ) y2error( "ExtendLvmVg sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean ReduceLvmVg( string name, string device ) { y2milestone( "ReduceLvmVg name:%1 device:%2", name, device ); integer ret = 0; list devs = [ device ]; ret = LibStorage::StorageInterface::shrinkLvmVg( sint, name, devs ); if( ret<0 ) y2error( "ReduceLvmVg sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean CreateLvmLv( string vgname, string lvname, integer sizeK, integer stripe ) { y2milestone( "CreateLvmLv vg:%1 name:%2 sizeK:%3 stripe:%4", vgname, lvname, sizeK, stripe ); integer ret = 0; string dummy = ""; ret = LibStorage::StorageInterface::createLvmLv( sint, vgname, lvname, (sizeK+1023)/1024, stripe, dummy ); if( ret<0 ) y2error( "CreateLvmLv sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/"+vgname ); return( ret==0 ); } global boolean ChangeLvStripeSize( string vgname, string lvname, integer stripeSize ) { y2milestone( "ChangeLvStripeSize vg:%1 name:%2 stripeSize:%3", vgname, lvname, stripeSize ); integer ret = 0; string dummy = ""; ret = LibStorage::StorageInterface::changeLvStripeSize( sint, vgname, lvname, stripeSize ); if( ret<0 ) y2error( "ChangeLvStripeSize sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/"+vgname ); return( ret==0 ); } global boolean ChangeLvStripeCount( string vgname, string lvname, integer stripes ) { y2milestone( "ChangeLvStripeCount vg:%1 name:%2 stripes:%3", vgname, lvname, stripes ); integer ret = 0; string dummy = ""; ret = LibStorage::StorageInterface::changeLvStripeCount( sint, vgname, lvname, stripes ); if( ret<0 ) y2error( "ChangeLvStripeCount sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/"+vgname ); return( ret==0 ); } global boolean AddNfsVolume( string nfsdev, string opts, integer sz, string mp ) { y2milestone( "AddNfsVolume dev:%1 opts:%2 size:%3 mp:%4", nfsdev, opts, sz, mp ); integer ret = 0; string dummy = ""; ret = LibStorage::StorageInterface::addNfsDevice( sint, nfsdev, opts, sz, mp ); if( ret<0 ) y2error( "AddNfsVolume sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/nfs" ); return( ret==0 ); } global integer CheckNfsVolume( string nfsdev, string opts ) { y2milestone( "CheckNfsVolume dev:%1 opts:%2", nfsdev, opts ); integer ret = 0; integer sz = 0; string dummy = ""; ret = LibStorage::StorageInterface::checkNfsDevice( sint, nfsdev, opts, sz ); if( ret<0 ) y2error( "CheckNfsVolume sint ret:%1", ret ); else ret = sz; y2milestone( "CheckNfsVolume ret:%1", ret ); return( ret ); } global boolean CreateMd( integer nr, string type ) { y2milestone( "CreateMd nr:%1 type:%2", nr, type ); integer ret = 0; integer tmp = conv_mdstring[type]:0; list dummy = []; string rd = sformat("/dev/md%1", nr ); ret = LibStorage::StorageInterface::createMd( sint, rd, tmp, dummy ); if( ret<0 ) y2error( "CreateMd sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/md" ); return( ret==0 ); } global boolean CreateMdWithDevs(integer nr, symbol type, list devices) { y2milestone( "CreateMdWithDevs nr:%1 type:%2 devices:%3", nr, type, devices ); integer ret = 0; integer tmp = LibStorage::RAID_UNK(); foreach(integer k, symbol v, conv_mdtype["m"]:$[], { if (v == type) tmp = k; }); string rd = sformat("/dev/md%1", nr ); ret = LibStorage::StorageInterface::createMd(sint, rd, tmp, devices); if( ret<0 ) y2error( "CreateMdWithDevs sint ret:%1", ret ); UpdateTargetMap(); return ret==0; } global boolean ExtendMd( integer nr, string dev ) { y2milestone( "ExtendMd nr:%1 dev:%2", nr, dev ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); ret = LibStorage::StorageInterface::extendMd( sint, rd, dev ); if( ret<0 ) y2error( "ExtendMd sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean ShrinkMd( integer nr, string dev ) { y2milestone( "ShrinkMd nr:%1 dev:%2", nr, dev ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); ret = LibStorage::StorageInterface::shrinkMd( sint, rd, dev ); if( ret<0 ) y2error( "ShrinkMd sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean ChangeMdType( integer nr, string mdtype ) { y2milestone( "ChangeMdType nr:%1 mdtype:%2", nr, mdtype ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); integer tmp = conv_mdstring[mdtype]:0; ret = LibStorage::StorageInterface::changeMdType( sint, rd, tmp ); if( ret<0 ) y2error( "ChangeMdType sint ret:%1", ret ); UpdateTargetMapDev( rd ); return( ret==0 ); } global boolean ChangeMdParity( integer nr, string ptype ) { y2milestone( "ChangeMdParity nr:%1 parity:%2", nr, ptype ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); integer tmp = conv_parstring[ptype]:0; ret = LibStorage::StorageInterface::changeMdParity( sint, rd, tmp ); if( ret<0 ) y2error( "ChangeMdParity sint ret:%1", ret ); UpdateTargetMapDev( rd ); return( ret==0 ); } global boolean ChangeMdParitySymbol( integer nr, symbol ptype ) { y2milestone( "ChangeMdParitySymbol nr:%1 parity:%2", nr, ptype ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); integer tmp = fromSymbol(conv_mdparity, ptype); ret = LibStorage::StorageInterface::changeMdParity(sint, rd, tmp); if( ret<0 ) y2error( "ChangeMdParitySymbol sint ret:%1", ret ); UpdateTargetMapDev( rd ); return( ret==0 ); } global boolean ChangeMdChunk( integer nr, integer chunk ) { y2milestone( "ChangeMdChunk nr:%1 chunk:%2", nr, chunk ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); ret = LibStorage::StorageInterface::changeMdChunk( sint, rd, chunk ); if( ret<0 ) y2error( "ChangeMdChunk sint ret:%1", ret ); UpdateTargetMapDev( rd ); return( ret==0 ); } global integer CheckMd( integer nr ) { y2milestone( "CheckMd nr:%1", nr ); integer ret = 0; string rd = sformat("/dev/md%1", nr ); ret = LibStorage::StorageInterface::checkMd( sint, rd ); if( ret!=0 ) y2milestone( "CheckMd sint ret:%1", ret ); return( ret ); } global integer ComputeMdSize(symbol md_type, list devices, integer& sizeK) { integer ret = 0; integer tmp = LibStorage::RAID_UNK(); foreach(integer k, symbol v, conv_mdtype["m"]:$[], { if (v == md_type) tmp = k; }); ret = LibStorage::StorageInterface::computeMdSize(sint, tmp, devices, sizeK); if( ret!=0 ) y2milestone( "ComputeMdSize sint ret:%1", ret ); return ret; } global string GetCryptPwd( string device ) { string pwd=""; y2milestone( "GetCryptPwd device:%1", device ); integer ret = 0; ret = LibStorage::StorageInterface::getCryptPassword( sint, device, pwd ); if( ret<0 ) y2error( "GetCryptPwd sint ret:%1", ret ); else y2milestone( "GetCryptPwd empty:%1", size(pwd)==0 ); return( pwd ); } global boolean SetCryptPwd( string device, string pwd ) { y2milestone( "SetCryptPwd device:%1", device ); integer ret = 0; ret = LibStorage::StorageInterface::setCryptPassword( sint, device, pwd ); if( ret<0 ) y2error( "SetCryptPwd sint ret:%1", ret ); else y2milestone( "SetCryptPwd sint ret:%1", ret ); return( ret==0 ); } global boolean NeedCryptPwd( string device ) { boolean ret = false; ret = LibStorage::StorageInterface::needCryptPassword( sint, device ); y2milestone( "NeedCryptPwd device:%1 ret:%2", device, ret ); return( ret ); } global string CreateLoop( string file, boolean create, integer sizeK, string mp ) { y2milestone( "CreateLoop file:%1 create:%2 sizeK:%3 mp:%4", file, create, sizeK, mp ); string dev = ""; integer ret = 0; string pwd = GetCryptPwd( file ); ret = LibStorage::StorageInterface::createFileLoop( sint, file, !create, sizeK, mp, pwd, dev ); if( ret<0 ) y2error( "CreateLoop sint ret:%1", ret ); LibStorage::StorageInterface::forgetCryptPassword( sint, file ); UpdateTargetMapDisk( "/dev/loop" ); y2milestone( "CreateLoop dev:%1", dev ); return( dev ); } /* integer loop_count = 0; global string GetLoopDevice() { y2milestone( "GetLoopDevice" ); string file = Directory::tmpdir + sformat("/dfile_%1", loop_count); string mp = Directory::tmpdir + sformat("/loopmp_%1", loop_count); loop_count = loop_count + 1; string dev = ""; string pwd = "emilemil"; integer ret = LibStorage::StorageInterface::createFileLoop( sint, file, true, 50*1024, mp, pwd, dev ); if( ret<0 ) y2error( "GetLoopDevice sint ret:%1", ret ); LibStorage::StorageInterface::forgetCryptPassword( sint, dev ); y2milestone( "GetLoopDevice dev:%1", dev ); return( dev ); } */ global void UpdateClassified( string key, string pwd ) { LibStorage::StorageInterface::setCryptPassword( sint, key, pwd ); } define void HandleModulesOnBoot( map targetMap ); global boolean UpdateLoop( string dev, string file, boolean create, integer sizeK ) { y2milestone( "UpdateLoop device:%1 file:%2 create:%3 sizeK:%4", dev, file, create, sizeK ); integer ret = LibStorage::StorageInterface::modifyFileLoop( sint, dev, file, !create, sizeK ); if( ret<0 ) y2error( "UpdateLoop sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/loop" ); HandleModulesOnBoot( GetTargetMap() ); return( ret==0 ); } global boolean DeleteLoop( string disk, string file, boolean remove_file ) { y2milestone( "DeleteLoop disk:%1 file:%2 remove_file:%3", disk, file, remove_file ); integer ret = LibStorage::StorageInterface::removeFileLoop( sint, file, remove_file ); if( ret<0 ) y2error( "DeleteLoop sint ret:%1", ret ); UpdateTargetMapDisk( disk ); return( ret==0 ); } global string DefaultDiskLabel(integer size_k) { y2milestone("DefaultDiskLabel size_k:%1", size_k ); string label = LibStorage::StorageInterface::defaultDiskLabelSize(sint, size_k); y2milestone("DefaultDiskLabel label:%1", label); return label; } /** * Delete the partition table and disk label of device * @param string the disk to deleted the partition table from * @return boolean */ global define boolean DeletePartitionTable(string disk, integer size_k) ``{ y2milestone( "DeletePartitionTable %1 size_k:%2", disk, size_k ); string label = LibStorage::StorageInterface::defaultDiskLabelSize( sint, size_k ); y2milestone( "DeletePartitionTable label:%1", label ); integer ret = LibStorage::StorageInterface::destroyPartitionTable( sint, disk, label ); if( ret<0 ) y2error( "DeletePartitionTable sint ret:%1", ret ); UpdateTargetMap(); return( ret==0 ); } global boolean CreatePartitionTable(string disk, string label) { y2milestone("CreatePartitionTable %1 label:%2", disk, label); integer ret = LibStorage::StorageInterface::destroyPartitionTable(sint, disk, label); if (ret < 0) y2error("CreatePartitionTable sint ret:%1", ret); UpdateTargetMap(); return ret == 0; } global symbol GetMountBy( string device ); /** * Set the flag if a disk needs to be initialized * @param string the disk to be changed * @return boolean */ global define boolean InitializeDisk(string disk, boolean value) ``{ boolean rbool = true; y2milestone( "InitializeDisk %1 value %2", disk, value ); integer ret = LibStorage::StorageInterface::initializeDisk( sint, disk, value ); if( ret<0 ) { y2error( "InitializeDisk sint ret:%1", ret ); rbool = false; } if( rbool && value ) { map d = GetDisk( GetTargetMap(), disk ); y2milestone( "d:%1", d ); rbool = CreatePartition( disk, disk+"1", `primary, Partitions::fsid_native, 0, d["cyl_count"]:1, GetMountBy( disk+"1" ) ); if( !rbool ) y2error( "InitializeDisk create failed" ); } UpdateTargetMapDisk( disk ); return( rbool ); } global boolean IsPartType(symbol t) { return t == `CT_DMRAID || t == `CT_DMMULTIPATH || t == `CT_DISK || t == `CT_MDPART; } boolean CreateAny( symbol ctype, map d, map& p ) { boolean ret = true; if( IsPartType(ctype) ) { ret = Storage::CreatePartition( d["device"]:"", p["device"]:"", p["type"]:`primary, p["fsid"]:Partitions::fsid_native, p["region",0]:0, p["region",1]:0, p["mountby"]:GetMountBy( p["device"]:"" ) ); } else if( ctype == `CT_MD ) { ret = Storage::CreateMd( p["nr"]:0, p["raid_type"]:"raid1" ); if( ret && haskey( p, "chunk_size" )) Storage::ChangeMdChunk( p["nr"]:0, p["chunk_size"]:4 ); if( ret && p["raid_type"]:""=="raid5" && haskey( p, "parity_algorithm" )) Storage::ChangeMdParity( p["nr"]:0, p["parity_algorithm"]:"" ); foreach( string d, p["devices"]:[], ``{ret=Storage::ExtendMd( p["nr"]:0, d )&&ret;}); } else if( ctype == `CT_LOOP ) { y2milestone( "CreateAny Loop p:%1", p ); string dev = Storage::CreateLoop( p["fpath"]:"", p["create_file"]:false, p["size_k"]:0, p["mount"]:"" ); ret = size(dev)>0; if( ret ) p["device"] = dev; } else if( ctype == `CT_LVM ) { ret = Storage::CreateLvmLv( d["name"]:"", p["name"]:"", p["size_k"]:0, p["stripes"]:1 ); if( ret && p["stripes"]:1>1 && p["stripesize"]:0>0 ) { Storage::ChangeLvStripeSize( d["name"]:"", p["name"]:"", p["stripesize"]:0 ); } } else if( ctype == `CT_NFS ) { ret = Storage::AddNfsVolume( p["device"]:"", p["fstopt"]:"", p["size_k"]:0, p["mount"]:"" ); } y2milestone( "CreateAny ret:%1", ret ); return( ret ); } define boolean IsEfiPartition( map p ) { map m = GetFreeSpace( p["device"]:"", 0, p["used_fs"]:`none, false ); boolean ret = m["efi"]:false; y2milestone( "IsEfiPartition ret:%1", ret ); return( ret ); } /** * Search in the list partitions for windows partitions and add the key * "mount" to the found windows partitions. * @parm partitions the partitions list * @parm primary handle primary or logical partitions * @return list new partitions with windows mountpoints */ define void AddMountPointsForWinParts( list partitions, boolean primary, integer max_prim, integer& foreign_nr ) ``{ if( !Arch::i386 () && !Arch::ia64 () && !Arch::x86_64 () ) return; string foreign_ids = "CDEFGHIJKLMNOPQRSTUVW"; list new_partitions = []; foreach(map partition, partitions, ``{ map new_partition = partition; integer fsid = partition["fsid"]:Partitions::fsid_native; integer partnum = 0; if( haskey( partition, "nr") && is( partition["nr"]:(any)0, integer ) ) { partnum = partition["nr"]:0; } if( !haskey( partition, "mount") && !partition["delete"]:false && ((partnum<=max_prim)==primary) && foreign_nr < 24 && Partitions::IsDosWinNtPartition(fsid) && (!Arch::ia64() || (!IsEfiPartition(partition) && partition["size_k"]:0 >= 1024*1024)) && contains( [`vfat, `ntfs], partition["used_fs"]:`none )) { new_partition["fstopt"] = FileSystems::DefaultFstabOptions(partition); if( contains( Partitions::fsid_dostypes, fsid )) { new_partition["mount"] = "/dos/" + substring (foreign_ids, foreign_nr, 1); foreign_nr = foreign_nr + 1; } else { new_partition["mount"] = "/windows/" + substring (foreign_ids, foreign_nr, 1); foreign_nr = foreign_nr + 1; } ChangeVolumeProperties( new_partition ); y2milestone( "win part %1", new_partition ); } }); }; global define void AddMountPointsForWin( map targets ) ``{ y2milestone( "AddMountPointsForWin called" ); integer foreign_nr = 0; foreach(string disk, map data, targets, ``{ if( !data["hotpluggable"]:false && data["used_by_type"]:`UB_NONE == `UB_NONE ) AddMountPointsForWinParts( data["partitions"]:[], true, data["max_primary"]:4, foreign_nr ); }); foreach(string disk, map data, targets, ``{ if( !data["hotpluggable"]:false && data["used_by_type"]:`UB_NONE == `UB_NONE ) AddMountPointsForWinParts( data["partitions"]:[], false, data["max_primary"]:4, foreign_nr ); }); } /** * Removes ... maps to ... * * @param string device name */ global void RemoveDmMapsTo( string device ) { y2milestone( "RemoveDmMapsTo device:%1", device ); if (!InitLibstorage(false)) return; LibStorage::StorageInterface::removeDmTableTo( sint, device ); } global define boolean CheckSwapable( string dev ) { string cmd = "/sbin/swapon --fixpgsz " + dev; boolean ok = (integer)SCR::Execute(.target.bash, cmd )==0; if( ok ) { cmd = "/sbin/swapoff " + dev; SCR::Execute(.target.bash, cmd ); } y2milestone( "CheckSwapable dev:%1 ret:%2", dev, ok ); return( ok ); } /** * mark swap-partitions with pseudo Mountpoint swap in targetMap * @param target Disk map * @return map modified target */ global define map AddSwapMp( map target ) ``{ list swaps = SwappingPartitions(); y2milestone( "AddSwapMp swaps %1", swaps ); foreach(string diskdev, map disk, target, ``{ disk["partitions"] = maplist(map part, disk["partitions"]:[], ``{ if( (Stage::initial() && !Partitions::IsDosWinNtPartition(part["fsid"]:0) && part["detected_fs"]:`unknown==`swap && !part["old_swap"]:false && search( diskdev, "/dev/evms" )!=0 ) || (contains( swaps, part["device"]:"" ))) { boolean ok = true; if( !contains( swaps, part["device"]:"" )) { ok = CheckSwapable( part["device"]:"" ); y2milestone( "AddSwapMp initial ok:%1", ok ); } if( ok ) { part["mount"] = "swap"; ChangeVolumeProperties( part ); y2milestone( "AddSwapMp %1", part ); } } return( part ); }); target[diskdev] = disk; }); return( target ); } /** * Returns a system target map. * * @return map target map * * @struct * $[ * ... ? * ] */ global map GetTargetMap() { if (!InitLibstorage(false)) return nil; map tmp = $[]; boolean changed = false; if( !probe_done && !Mode::config() ) { map bios_id_raid = $[]; y2milestone ("probing StorageDevices" ); map rename = $[]; tmp = (map)StorageDevices::Probe(true); foreach( string dev, map disk, tmp, ``{ map dtmp = Storage::GetDiskPartitionTg( dev, $[] )[0]:$[]; y2milestone( "probing dev %1 disk %2", dev, dtmp ); if( search( dev, "/dev/dm-" )==0 || search( dev, "/dev/md" )==0 ) { if( size(disk["bios_id"]:"")>0 ) bios_id_raid[dev] = disk["bios_id"]:""; } else if( size(dtmp["disk"]:"")>0 && dev != dtmp["disk"]:"" ) { rename[dev] = dtmp["disk"]:""; y2milestone( "probing rename %1", rename ); } }); tmp = filter( string dev, map disk, tmp, ``(search( dev, "/dev/dm-" )!=0)); tmp = filter( string dev, map disk, tmp, ``(search( dev, "/dev/md" )!=0)); if( size(rename)>0 ) { foreach( string old, string new, rename, ``{ if( haskey( tmp, old )) { tmp[new] = tmp[old]:$[]; tmp = remove( tmp, old ); tmp[new,"device"] = new; y2milestone( "probing old:%1 new:%2", old, tmp[new]:$[] ); } }); } y2milestone ("probing done" ); if( size(tmp)>0 ) { probe_done = true; changed = true; foreach( string dev, map disk, tmp, ``{ disk = getDiskInfo( dev, disk ); integer s = disk["size_k"]:0 * 1024; disk["name"] = disk["dname"]:"" + Storage::ByteToHumanString( s ) + ", " + disk["device"]:"" + ", "; if( size( disk["vendor"]:"")>0 ) disk["name"] = disk["name"]:"" + disk["vendor"]:"" + "-"; disk["name"] = disk["name"]:"" + disk["model"]:""; if( haskey( disk, "dname" )) disk = remove( disk, "dname" ); tmp[dev] = disk; if( disk["dasdfmt"]:false ) Storage::InitializeDisk( dev, true ); }); foreach( map c, conts, ``{ if( c["type"]:`CT_UNKNOWN!=`CT_DISK ) tmp[c["device"]:""] = getContainerInfo( c ); }); if( size(bios_id_raid)>0 ) { y2milestone( "bios_id_raid:%1", bios_id_raid ); foreach( string dm, string bios, bios_id_raid, { integer pos = findfirstof( dm, "0123456789" ); integer minor = tointeger( substring( dm, pos )); y2milestone( "pos:%1 minor:%2", pos, minor ); foreach (string dev, map c, tmp, { if (c["type"]:`CT_UNKNOWN == `CT_DMRAID && c["minor"]:0 == minor) { y2milestone("addind bios_id %1 to %2", bios, dev); tmp[dev, "bios_id"] = bios; } if (c["type"]:`CT_UNKNOWN == `CT_MDPART && c["device"]:"" == dm) { y2milestone("addind bios_id %1 to %2", bios, dev); tmp[dev, "bios_id"] = bios; } }); }); } StorageMap[targets_key] = tmp; } } if( changed ) { tmp = StorageMap[targets_key]:$[]; SCR::Write(.target.ycp, Storage::SaveDumpPath("targetMap_i"), tmp ); y2milestone ("AddSwapMp" ); tmp = AddSwapMp( tmp ); CreateTargetBackup( "initial" ); if( (Stage::initial() || Mode::repair()) && !Mode::autoinst() ) { AddMountPointsForWin( tmp ); } StorageMap[targets_key] = GetTargetMap(); SCR::Write(.target.ycp, Storage::SaveDumpPath("targetMap_ii"), tmp ); y2milestone ("changed done" ); } map ret = StorageMap[targets_key]:$[]; if (changed) y2milestone("GetTargetMap changed:%1 ret:%2", changed, ret); else y2debug("GetTargetMap changed:%1 ret:%2", changed, ret); return ret; } global void SetRecursiveRemoval( boolean val ) { y2milestone( "SetRecursiveRemoval val:%1", val ); LibStorage::StorageInterface::setRecursiveRemoval( sint, val ); } global boolean GetRecursiveRemoval() { return( LibStorage::StorageInterface::getRecursiveRemoval( sint )); } global define void SetTargetMap( map target ) { y2milestone( "SetTargetMap" ); if( !GetRecursiveRemoval() ) SetRecursiveRemoval(true); //SCR::Write(.target.ycp, Storage::SaveDumpPath("targetMap_set_"+sformat("%1",count)), target ); //count = count+1; CreateTargetBackup("tmp_set"); map tg = GetTargetMap(); list keys = maplist( string k, any e, target, ``(k)); foreach( string k, keys, ``{ if( target[k,"delete"]:false && haskey( tg, k ) ) { if( target[k,"type"]:`CT_UNKNOWN==`CT_LVM ) { DeleteLvmVg( target[k,"name"]:"" ); target[k,"delete"] = false; } else if( target[k,"type"]:`CT_UNKNOWN==`CT_DMRAID ) { DeleteDmraid( k ); target[k,"delete"] = false; } } }); keys = maplist( string k, any e, target, ``(k)); y2milestone( "SetTargetMap keys %1", keys ); list t1 = filter( string k, keys, ``(!target[k,"delete"]:false&& !target[k,"create"]:false)); foreach( string k, t1, ``{ list dps = filter( map p, target[k,"partitions"]:[], ``(!p["create"]:false&&!p["delete"]:false)); if( size(dps)>0 ) { foreach( map p, dps, ``{ if( p["type"]:`primary != `extended || p["resize"]:false ) ChangeVolumeProperties( p ); }); } }); keys = maplist( string k, any e, tg, ``(k)); keys = sort( string a, string b, keys, ``( type_order[tg[a,"type"]:`CT_UNKNOWN]:9 > type_order[tg[b,"type"]:`CT_UNKNOWN]:9 )); y2milestone( "SetTargetMap keys %1", keys ); foreach( string k, keys, ``{ list dps = filter( map p, tg[k,"partitions"]:[], ``(p["create"]:false)); if( size(dps)>1 && haskey( dps[0]:$[], "nr" )) { dps = sort( map a, map b, dps, ``(a["nr"]:0>b["nr"]:0)); y2milestone( "SetTargetMap dps:%1", dps ); } foreach( map p, dps, ``{DeleteDevice( k, p["device"]:"" );}); if( tg[k,"create"]:false ) { if( tg[k,"type"]:`CT_UNKNOWN==`CT_LVM ) DeleteLvmVg( tg[k,"name"]:"" ); } else if( !tg[k,"delete"]:false ) { if( tg[k,"type"]:`CT_UNKNOWN==`CT_LVM && size(target[k,"devices_add"]:[])>0 ) { list ls = target[k,"devices_add"]:[]; foreach( string d, ls, ``{Storage::ReduceLvmVg( target[k,"name"]:"", d );}); } } }); keys = maplist( string k, any e, target, ``(k)); keys = sort( string a, string b, keys, ``( type_order[target[a,"type"]:`CT_UNKNOWN]:9 > type_order[target[b,"type"]:`CT_UNKNOWN]:9 )); y2milestone( "SetTargetMap keys %1", keys ); foreach( string k, keys, ``{ list dps = filter( map p, target[k,"partitions"]:[], ``(p["delete"]:false)); if( size(dps)>1 && haskey( dps[0]:$[], "nr" )) { dps = sort( map a, map b, dps, ``(a["nr"]:0>b["nr"]:0)); } foreach( map p, dps, ``{ if( size(p["dtxt"]:"")>0 ) ChangeDescText( p["device"]:"", p["dtxt"]:"" ); DeleteDevice( k, p["device"]:"" ); }); if( target[k,"delete"]:false ) { if( target[k,"type"]:`CT_UNKNOWN==`CT_LVM ) DeleteLvmVg( target[k,"name"]:"" ); else if( target[k,"type"]:`CT_UNKNOWN==`CT_DISK ) DeletePartitionTable( k, target[k,"size_k"]:0 ); else if( target[k,"type"]:`CT_UNKNOWN==`CT_DMRAID ) DeleteDmraid( k ); } if( target[k,"del_ptable"]:false && IsPartType( target[k,"type"]:`CT_UNKNOWN ) ) { DeletePartitionTable( k, target[k,"size_k"]:0 ); } }); keys = maplist( string k, any e, target, ``(k)); keys = sort( string a, string b, keys, ``( type_order[target[a,"type"]:`CT_UNKNOWN]:9 < type_order[target[b,"type"]:`CT_UNKNOWN]:9 )); y2milestone( "SetTargetMap keys %1", keys ); foreach( string k, keys, ``{ if( target[k,"create"]:false ) { if( target[k,"type"]:`CT_UNKNOWN==`CT_LVM ) { CreateLvmVg( target[k,"name"]:"", target[k,"pesize"]:0, target[k,"lvm2"]:true ); list ls = (list)union( target[k,"devices"]:[], target[k,"devices_add"]:[] ); foreach( string d, ls, ``{Storage::ExtendLvmVg( target[k,"name"]:"", d );}); } } if( !target[k,"delete"]:false && !target[k,"create"]:false ) { if( target[k,"type"]:`CT_UNKNOWN==`CT_LVM && size(target[k,"devices_add"]:[])>0 ) { list ls = target[k,"devices_add"]:[]; foreach( string d, ls, ``{Storage::ExtendLvmVg( target[k,"name"]:"", d );}); } } list dps = filter( map p, target[k,"partitions"]:[], ``(!p["delete"]:false&&p["create"]:false) ); if( size(dps)>1 && haskey( dps[0]:$[], "nr" )) dps = sort( map a, map b, dps, ``(a["nr"]:0 target map * * @see GetTargetMap(); */ global map ReReadTargetMap() { boolean need_reread = sint != nil; if (!InitLibstorage(false)) return nil; y2milestone("start reread need_reread:%1", need_reread); probe_done = false; if (need_reread) LibStorage::StorageInterface::rescanEverything(sint); conts = getContainers(); return GetTargetMap(); } /** * Apply storage changes * * @return integer */ global integer CommitChanges() { y2milestone( "CommitChanges" ); integer ret = LibStorage::StorageInterface::commit( sint ); if( ret<0 ) y2error( "CommitChanges sint ret:%1", ret ); return( ret ); } global string DeviceMounted( string dev ) { string ret = ""; LibStorage::StorageInterface::checkDeviceMounted( sint, dev, ret ); if( size(ret)>0 ) y2milestone( "DeviceMounted %1 at %2", dev, ret ); return( ret ); } /** * Umounts a device * * @param string device name * @return boolean if successful * * @see Mount() */ global boolean Umount( string dev ) { boolean ret = LibStorage::StorageInterface::umountDevice( sint, dev ); y2milestone( "Umount %1 ret %2", dev, ret ); return( ret ); } /** * Mounts a device * * @param string device name * @param string mount point * @param fstopt mount options * @return boolean if successful * * @see Umount() */ global boolean MountOpt( string dev, string mp, string fstopt ) { boolean ret = LibStorage::StorageInterface::mountDeviceRo( sint, dev, mp, fstopt ); y2milestone( "MountOpt %1 to %2 with %3 ret %4", dev, mp, fstopt, ret ); return( ret ); } /** * Mounts a device * * @param string device name * @param string mount point * @return boolean if successful * * @see Umount() */ global boolean Mount( string dev, string mp ) { return( MountOpt( dev, mp, "" ) ); } global define map DetectHomeFs( map p ) { y2milestone( "DetectHomeFs p:%1", p ); map ret = $[]; boolean home = false; list poss_fs = [ `ext2, `ext3, `reiser, `xfs, `jfs ]; if( !p["created"]:false && contains( poss_fs, p["detected_fs"]:`unknown ) && size(p["device"]:"")>0 ) { boolean mount_ok = false; string tmpdir = (string)SCR::Read(.target.tmpdir) + "/hmp"; SCR::Execute(.target.mkdir, tmpdir ); string fsto = FileSystems::DefaultFstabOptions( p ); mount_ok = Storage::MountOpt( p["device"]:"", tmpdir, fsto ); if( !mount_ok ) mount_ok = Storage::Mount( p["device"]:"", tmpdir ); else ret["fstopt"] = fsto; if( mount_ok ) { list skip = [ ".", "..", "root" ]; list tfile = [ ".profile", ".ssh", ".bashrc", ".kde2", ".gnome2", ".kde", ".gnome" ]; list files = (list)SCR::Read (.target.dir, tmpdir); y2milestone( "DetectHomeFs files:%1", files ); integer count=0; while( !home && count0; i = i+1; } } count = count+1; } Storage::Umount( p["device"]:"" ); } SCR::Execute( .target.bash, "rmdir " + tmpdir ); } ret["ishome"] = home; y2milestone( "DetectHomeFs ret:%1", ret ); return( ret ); } global define map SetVolOptions( map p, string mnt, symbol fs, string fs_opts, string fstab_opts, string label ) { y2milestone( "SetVolOptions p:%1", p ); y2milestone( "SetVolOptions mount:%1 fs:%2 fs_opt:%3 fst_opt:%4 label:%5", mnt, fs, fs_opts, fstab_opts, label ); map ret = p; if( size(mnt)>0 ) ret["mount"] = mnt; if( fs!=nil && fs!=`unknown ) ret["used_fs"] = fs; else { if( mnt==Partitions::BootMount() ) ret["used_fs"] = Partitions::DefaultBootFs(); else ret["used_fs"] = Partitions::DefaultFs(); } if( ret["used_fs"]:`unknown == `unknown || ret["used_fs"]:`unknown == `none ) ret["format"] = false; else ret["format"] = true; if( ret["format"]:false && !ret["create"]:false && ret["detected_fs"]:`unknown != `unknown && mnt=="/home" ) { boolean lvm = p["type"]:`primary == `lvm; map h = DetectHomeFs( ret ); if( ( lvm && ret["name"]:""=="home") || (!lvm && h["ishome"]:false ) ) { ret["format"] = false; ret["used_fs"] = ret["detected_fs"]:`unknown; if( size(fstab_opts)==0 ) fstab_opts = h["fstopt"]:""; } } if( ret["format"]:false && !ret["create"]:false && ret["detected_fs"]:`unknown == `swap && mnt=="swap" ) { ret["format"] = false; ret["used_fs"] = `swap; } if( size(fstab_opts)>0 ) ret["fstopt"] = fstab_opts; else ret["fstopt"] = FileSystems::DefaultFstabOptions( ret ); if( size(fs_opts)>0 ) ret["fs_options"] = convertStringToFsOptionMap( fs_opts, ret["used_fs"]:`unknown, `mkfs ); else ret["fs_options"] = FileSystems::DefaultFormatOptions( ret ); if( size(label)>0 ) ret["label"] = label; else if( size(ret["label"]:"")>0 && ret["format"]:false ) ret["label"] = ""; y2milestone( "SetVolOptions ret:%1", ret ); return( ret ); } global boolean CanEdit( map p, boolean verbose ) { boolean ret = true; if( Stage::initial() ) { if( !p["created"]:false && !p["inactive"]:false && p["mount"]:""=="swap" ) { ret = false; y2milestone( "CanEdit p:%1", p ); if( verbose ) { string txt = sformat( _(" Device %1 cannot be modified because it contains activated swap that is needed to run the installation. "), p["device"]:"" ); Popup::Message( txt ); } } if( size(part_insts)>0 && p["device"]:""==part_insts ) { ret = false; y2milestone( "CanEdit part_insts:%1 p:%2", part_insts, p ); if( verbose ) { string txt = sformat( _(" Device %1 cannot be modified because it contains the installation data needed to perform the installation. "), p["device"]:"" ); Popup::Message( txt ); } } } y2milestone( "CanEdit dev:%1 verbose:%2 ret:%3", p["device"]:"", verbose, ret ); return( ret ); } global boolean CanDelete( map p, map disk, boolean verbose ) { string txt = ""; boolean ret = CanEdit( p, false ); if( !ret && verbose ) { if( p["mount"]:""=="swap" ) { txt = sformat( _(" Device %1 cannot be removed because it contains activated swap that is needed to run the installation. "), p["device"]:"" ); } else { txt = sformat( _(" Device %1 cannot be removed because it contains the installation data needed to perform the installation. "), p["device"]:"" ); } Popup::Message( txt ); } if( ret && (p["type"]:`unknown == `logical|| p["type"]:`unknown == `extended) ) { integer num = p["type"]:`unknown == `extended ? 4 : p["nr"]:4; list pl = filter( map q, disk["partitions"]:[], ``( q["type"]:`unknown==`logical && q["nr"]:0 > num )); y2milestone( "CanDelete pl:%1", pl ); integer pos = 0; while( ret && pos vinfos = []; boolean r = LibStorage::StorageInterface::readFstab( sint, dir, vinfos ); if( !r ) y2error( "ReadFstab sint dir %1 ret %2", dir, r ); else { foreach( any info, vinfos, ``{ map p = $[]; p = volumeMap( info, p ); ret = add( ret, p ); }); } y2milestone( "ReadFstab from %1 ret %2", dir, ret ); return( ret ); } global list mountedPartitionsOnDisk( string disk ) { map d = GetDisk( GetTargetMap(), disk ); list ret = filter( map p, d["partitions"]:[], ``(size(DeviceMounted(p["device"]:""))>0)); return( ret ); } global map GetCommitInfo() { any info = LibStorage::CommitInfo::new("LibStorage::CommitInfo"); LibStorage::StorageInterface::getCommitInfo(sint, true, info); map ret = $[ `destructive : LibStorage::CommitInfo::swig_destructive_get(info) ]; return ret; } string save_chtxt = ""; global string ChangeText() { list l = LibStorage::StorageInterface::getCommitActions( sint, true ); string ret = ""; if( size(l)>0 ) ret = HTML::List( l ); if( ret != save_chtxt ) { foreach( string s, l, ``{ y2milestone( "ChangeText %1", s ); }); save_chtxt = ret; } return( ret ); } global string LastAction() { string ret = LibStorage::StorageInterface::getLastAction( sint ); return( ret ); } global string ExtendedErrorMsg() { string ret = LibStorage::StorageInterface::getExtendedErrorMessage( sint ); return( ret ); } global void SetZeroNewPartitions( boolean val ) { y2milestone( "SetZeroNewPartitions val:%1", val ); LibStorage::StorageInterface::setZeroNewPartitions( sint, val ); } /** * GetMountPoints() * collect mountpoint:device as map to get a sorted list * @returns: map of lists, the map key is the mount point, * usually starting with a "/". Exception is "swap" * For directory mount points (key starting with /) the value * is a list [partitionName, fsid, targetdevice, raid_type] * For swap mount points, the value is a list of lists: * [[partitionName, fsid, targetdevice, raid_type], ...] * */ global define map GetMountPoints() ``{ map mountPoints = $[]; list swapPoints = []; map tg = GetTargetMap(); foreach ( string targetdevice, map target, tg, ``{ list partitions = target["partitions"]:[]; foreach (map partition, partitions, ``{ string partitionName = partition["device"]:""; string mountPoint = partition["mount"]:""; integer fsid = partition["fsid"]:0; if (mountPoint != "") { string raid_type = ""; if( partition["type"]:`undefined == `sw_raid ) { raid_type = partition["raid_type"]:""; } // partition has a mount point if (mountPoint == "swap") { swapPoints = add( swapPoints, [partitionName, fsid, targetdevice, raid_type]); } else { mountPoints = add( mountPoints, mountPoint, [partitionName, fsid, targetdevice, raid_type]); } } }); }); if (size (swapPoints) > 0) mountPoints = add (mountPoints, "swap", swapPoints); if( !Stage::initial () ) { list cm = filter(map e, Partitions::CurMounted(), ``(search(e["spec"]:"","/dev/")==0)); foreach(map e, cm, ``{ if( !haskey( mountPoints, e["file"]:"" ) ) { map p = GetPartition( tg, e["spec"]:"" ); if( size(p)>0 ) { string raid_type = ""; if( p["type"]:`undefined == `sw_raid ) { raid_type = p["raid_type"]:""; } map d = GetDiskPartition( e["spec"]:"" ); mountPoints[e["file"]:""] = [ p["device"]:"", p["fsid"]:0, d["disk"]:"", raid_type ]; } } }); } y2milestone( "ret %1", mountPoints ); return mountPoints; } global define string GetIdSmaller( string disk, integer delim ) ``{ string ret = disk; map tg = GetTargetMap(); if( haskey( tg[disk,"partitions",0]:$[], "nr" )) { list ps = filter( map p, tg[disk,"partitions"]:[], ``(p["nr"]:01 ) ps = sort( map a, map b, ps, ``(a["nr"]:0>b["nr"]:0)); if( size(ps)>0 ) ret = ps[0,"device"]:""; } else ret = tg[disk,"partitions",0,"device"]:disk; y2milestone( "GetIdSmaller disk:%1 delim:%2 ret:%3", disk, delim, ret ); return( ret ); } /** * Set in partition to the given and return changed map * * @param map tg * @param string device name * @string key * @string value * @return map changed target map */ global define map SetPartitionData( map tg, string device, string key, any value ) ``{ y2milestone( "SetPartitionData device=%1 key=%2 value=%3", device, key, value ); map tmp = GetDiskPartitionTg( device, tg )[0]:$[]; string disk = tmp["disk"]:""; string dev = GetDeviceName( tmp["disk"]:"", tmp["nr"]:(any)0 ); list r_part = filter(map part, tg[disk,"partitions"]:[], ``(part["device"]:"" != dev )); if( size(r_part)!=size(tg[disk,"partitions"]:[]) ) { map p = filter( map part, tg[disk,"partitions"]:[], ``(part["device"]:"" == dev ))[0]:$[]; if( size(p)>0 ) { p[key] = value; r_part = add( r_part, p ); tg[disk,"partitions"] = r_part; } } return( tg ); } /* remove in partition and return changed map */ global define map DelPartitionData( map tg, string device, string key) ``{ y2debug( "device=%1, key=%2", device, key ); map tmp = GetDiskPartitionTg( device, tg )[0]:$[]; string disk = tmp["disk"]:""; string dev = GetDeviceName( tmp["disk"]:"", tmp["nr"]:(any)0 ); list r_part = filter(map part, tg[disk,"partitions"]:[], ``(part["device"]:"" != dev )); if( size(r_part)!=size(tg[disk,"partitions"]:[]) ) { map p = filter( map part, tg[disk,"partitions"]:[], ``(part["device"]:"" == dev ))[0]:$[]; if( size(p)>0 ) { p = filter(string k, any e, (map)p, ``(k != key) ); r_part = add( r_part, p ); tg[disk,"partitions"] = r_part; } } return( tg ); } /** * Check if a disk is a real disk and not RAID or LVM * * @param map entry (disk) * @return boolean true if real disk * * @struct entry ~ $[ * "type":`CT_DISK, * "driver" : "?", * "readonly" : false / true, * ] */ global define boolean IsRealDisk( map entry ) ``{ return( entry["type"]:`CT_UNKNOWN==`CT_DISK && !(entry["type"]:`CT_UNKNOWN==`CT_DISK && entry["readonly"]:false && entry["driver"]:""=="vbd") ); } /** * Checks if a container is partitionable * * @param map entry * @return boolean true if partitionable * * @struct entry ~ $[ "type" : ... ? ] */ global boolean IsPartitionable( map entry ) { return entry["type"]:`CT_UNKNOWN==`CT_DMRAID || entry["type"]:`CT_UNKNOWN==`CT_DMMULTIPATH || entry["type"]:`CT_UNKNOWN==`CT_MDPART || IsRealDisk( entry ); } global define boolean DeviceRealDisk( string device ) ``{ boolean ret = false; if( search( device, "LABEL" )!=0 && search( device, "UUID" )!=0 ) { map dev = $[]; dev = GetDiskPartition( device ); ret = dev["disk"]:"" != "/dev/md" && dev["disk"]:"" != "/dev/loop" && search( dev["disk"]:"", "/dev/evms")!=0 && is( dev["nr"]:(any)0, integer ); if( !ret && dev["disk"]:"" != "/dev/md" ) { map st = (map)SCR::Read( .target.stat, dev["disk"]:"" ); ret = !st["isdir"]:false; } } y2milestone( "DeviceRealDisk %1 ret %2", device, ret ); return ret; } /*** * Determine if there is any Linux partition on this system. * * If there is none, we don't need to ask if the user wants to update or * boot an installed system - he can only do a new installation anyway. * No time-consuming or dangerous operations should be performed here, * only simple checks for existence of a Linux (type 83) partition. * * @return boolean true if there is anything that might be a Linux partition **/ global define boolean HaveLinuxPartitions() ``{ boolean ret = false; foreach ( string dev, map disk, GetTargetMap(), ``{ if( !ret ) { if( IsPartitionable( disk ) ) { foreach( map e, disk["partitions"]:[], ``{ ret = ret || Partitions::IsLinuxPartition( e["fsid"]:Partitions::fsid_native ); }); } } }); y2milestone( "HaveLinuxPartitions ret=%1", ret ); return( ret ); }; /** * Get list of all Partitions on all real disks * @return list Partition list */ /* global define list GetPartitionList()``{ list ret = []; foreach ( string dev, map disk, GetTargetMap(), ``{ if( IsPartitionable( disk ) ) { list l = disk["partitions"]:[]; ret = union( ret, maplist( map p, l, ``(p["device"]:""))); } }); ret = sort( ret ); y2debug( "GetPartitionList ret=%1", ret ); return( ret ); } */ /** * Get list of all Linux Partitions on all real disks * @return list Partition list */ global define list GetOtherLinuxPartitions()``{ list ret = []; foreach ( string dev, map disk, GetTargetMap(), ``{ if( IsPartitionable( disk ) ) { list l = (list) filter( map p, disk["partitions"]:[], ``(!p["format"]:false && Partitions::IsLinuxPartition(p["fsid"]:0)) ); l = filter(map p, l, ``(contains( [`xfs, `ext2, `ext3, `jfs, `reiser], p["used_fs"]:`unknown))); l = filter(map p, l, ``(!FileSystems::IsSystemMp( p["mount"]:"", false ))); if( size(l)>0 ) { ret = union( ret, l ); } } }); y2milestone( "GetOtherLinuxPartitions ret=%1", ret ); return( ret ); } /** * Check if swap paritition is availbe on a disk * @param disk Disk to be checked * @return boolean true if swap available. */ global define boolean CheckSwapOn( string disk )``{ boolean ret = false; list swaps = SwappingPartitions(); while( size(swaps)>0 && !ret ) { if( search( swaps[0]:"", disk )==0) { ret = true; } swaps = remove( swaps, 0 ); } y2milestone( "CheckSwapOn %1 ret %2", disk, ret ); return( ret ); } /** * Returns list of primary partitions found * * @param map targets * @param boolean foreign_os * @return list of primary partitions */ global define list GetPrimPartitions( map targets, boolean foreign_os ) ``{ list ret = []; map entry = $[]; string text = ""; integer num_dos = 0; integer num_win = 0; integer num_os2 = 0; integer num_linux = 0; string linux_text = "Linux other"; string dos_text = "dos"; string win_text = "windows"; string os2_text = "OS/2 Boot Manager"; foreach(string disk, map data, targets, ``{ foreach(map part, data["partitions"]:[], ``{ string device = part["device"]:""; if( part["type"]:`unknown == `primary && SCR::Execute (.target.bash, "/usr/lib/YaST2/bin/check.boot "+device) == 0) { text = ""; if( Partitions::IsDosWinNtPartition( part["fsid"]:0 ) && data["used_by_type"]:`UB_NONE==`UB_NONE && GetFreeSpace( device, 0, part["used_fs"]:`none, false )["win_disk"]:false ) { if( contains( Partitions::fsid_dostypes, part["fsid"]:0 ) ) { num_dos = num_dos+1; text = dos_text; } else { num_win = num_win+1; text = win_text; } } else if( part["fsid"]:0 == 0x12 && !foreign_os ) { text = "Vendor diagnostic"; } else if( part["fsid"]:0 == 0x0a ) { text = os2_text; num_os2 = num_os2+1; } else if( part["fsid"]:0 == Partitions::fsid_native && size(part["mount"]:"")==0 && !foreign_os ) { text = linux_text; num_linux = num_linux+1; } if( size(text)>0 ) { entry["device"] = device; entry["string"] = text; ret = add( ret, eval(entry) ); y2milestone( "new entry %1", entry ); } } }); }); y2milestone( "GetPrimPartitions foreign_os:%5 num_linux %1 num_win %2 num_dos %3 num_os2 %4", num_linux, num_win, num_dos, num_os2, foreign_os ); integer num = 1; if( num_linux>1 ) { ret = maplist( map entry, ret, ``{ if( entry["string"]:""==linux_text ) { entry["string"] = linux_text + sformat( " %1", num ); num = num+1; } return( entry ); }); } num = 1; if( num_dos>1 ) { ret = maplist( map entry, ret, ``{ if( entry["string"]:""==dos_text ) { entry["string"] = dos_text + sformat( " %1", num ); num = num+1; } return( entry ); }); } num = 1; if( num_win>1 ) { ret = maplist( map entry, ret, ``{ if( entry["string"]:""==win_text ) { entry["string"] = win_text + sformat( " %1", num ); num = num+1; } return( entry ); }); } num = 1; if( num_os2>1 ) { ret = maplist( map entry, ret, ``{ if( entry["string"]:""==os2_text ) { entry["string"] = os2_text + sformat( " %1", num ); num = num+1; } return( entry ); }); } y2milestone( "GetPrimPartitions ret %1", ret ); return( ret ); } global define list GetWinPrimPartitions( map targets ) ``{ list ret = GetPrimPartitions( targets, true ); y2milestone( "GetWinPrimPartitions ret %1", ret ); return( ret ); } global list GetUsedFs() { if (!InitLibstorage(false)) return nil; list r = LibStorage::StorageInterface::getAllUsedFs(sint); y2milestone("GetUsedFs ret:%1", r); return r; } global void SaveUsedFs() { y2milestone("SaveUsedFs"); SCR::Write(.sysconfig.storage.USED_FS_LIST, mergestring(GetUsedFs(), " ")); SCR::Write(.sysconfig.storage, nil); } global list AddPackageList() { list pl = hw_packages; map tg = GetTargetMap(); boolean need_lvm = false; boolean need_nfs = false; boolean need_quota = false; boolean need_crypt = false; foreach( string k, map e, tg, { if (e["type"]:`CT_UNKNOWN == `CT_LVM) need_lvm = true; if (e["type"]:`CT_UNKNOWN == `CT_NFS) need_nfs = true; if( size(filter( map p, e["partitions"]:[], ``(FileSystems::HasQuota(p))))>0 ) need_quota = true; if( size(filter( map p, e["partitions"]:[], ``(p["enc_type"]:`none != `none)))>0 ) need_crypt = true; }); y2milestone("AddPackageList need lvm:%1 need nfs: %2 quota:%3 crypt:%4", need_lvm, need_nfs, need_quota, need_crypt); if (need_lvm) { pl = add(pl, "lvm2"); } //nfs-client needs to be marked for installation if we have //some NFS shares. It will pull in portmapper package(#436897) if (need_nfs) { pl = add(pl, "nfs-client"); pl = add(pl, "yast2-nfs-client"); } if( need_quota ) { pl = add( pl, "quota" ); } if( need_crypt ) { pl = add( pl, "cryptsetup" ); pl = add( pl, "pam_mount" ); } y2milestone("AddPackageList ret %1", pl); return pl; } /** * Takes care of selecting packages needed by storage * in installation * (replacement for HandlePackages in *_proposal clients) */ global void HandleProposalPackages() { //Use PackagesProposal to ensure that package selection //does not get reset by this module (#433001) import "PackagesProposal"; string proposal_ID = "storage_proposal"; list pkgs = AddPackageList(); //Set rather than Add, there might be some packs left over //from previous 'MakeProposal' we don't need now //This also covers the case when AddPackagesList returns [] or nil PackagesProposal::SetResolvables( proposal_ID, `package, pkgs ); if( Stage::initial() ) { SaveUsedFs(); } } global define list GetForeignPrimary() ``{ list ret = []; if( Arch::i386 () || Arch::ia64 () || Arch::x86_64 () ) { foreach(map e, (list)GetPrimPartitions( GetTargetMap(), false ), ``{ ret = add( ret, sformat( "%1 %2", e["device"]:"", e["string"]:"" )); }); } y2milestone( "ret=%1", ret ); return( ret ); } /** * Returns whether a partition is resizable * * @param map partition * @return map resizable ? */ global define map IsResizable( map part ) ``{ map ret = FileSystems::IsResizable(`unknown); if ((!Arch::s390() && Partitions::IsResizable(part["fsid"]:0)) || part["type"]:`none == `lvm) { if( part["fsid"]:0==Partitions::fsid_swap ) { ret = FileSystems::IsResizable(`swap); } else { ret = FileSystems::IsResizable(part["used_fs"]:`unknown); } } y2milestone( "IsResizable part:%1 ret:%2", part, ret ); return( ret ); } global integer FreeCylindersAfterPartition(string device) { integer ret = 0; if (LibStorage::StorageInterface::freeCylindersAfterPartition(sint, device, ret) != 0) ret = 0; y2milestone("FreeCylindersAfterPartition ret:%1", ret); return ret; } global define boolean CheckNextCreated( map disk, list region ) ``{ boolean ret = false; integer cylinder = region[0]:0 + region[1]:0; foreach(map part, disk["partitions"]:[], ``{ if( part["region",0]:0 == cylinder && part["create"]:false ) { ret = true; } }); y2milestone( "CheckNextCreated region:%1 ret:%2", region, ret ); return( ret ); } global define string PathToDestdir( string pt ) ``{ if( Installation::scr_destdir != "/" ) { pt = Installation::scr_destdir + pt; } return( pt ); } define void HandleModulesOnBoot( map targetMap ) ``{ list ml = filter( string e, (list) splitstring( Misc::SysconfigRead( .sysconfig.kernel.MODULES_LOADED_ON_BOOT, "" ), " \t"), ``(size(e)>0)); y2milestone( "HandleModulesOnBoot ml %1", ml ); boolean need_cryptoloop = false; boolean need_fish2 = false; foreach( string disk, map e, targetMap, ``{ foreach( map p, e["partitions"]:[], ``{ if( p["noauto"]:false && p["enc_type"]:`none!=`none ) { if( p["enc_type"]:`none == `twofish ) need_cryptoloop = true; else if( p["enc_type"]:`none == `twofish_old || p["enc_type"]:`none == `twofish_256_old ) need_fish2 = true; } }); }); y2milestone( "HandleModulesOnBoot need_fish2 %1 need_cryptoloop %2", need_fish2, need_cryptoloop ); if( need_fish2 && find( string e, ml, ``(e=="loop_fish2"))==nil ) { ml = add( ml, "loop_fish2" ); SCR::Write( .sysconfig.kernel.MODULES_LOADED_ON_BOOT, mergestring( ml, " " ) ); } if( need_cryptoloop && find( string e, ml, ``(e=="cryptoloop"))==nil ) { ml = add( ml, "cryptoloop" ); SCR::Write( .sysconfig.kernel.MODULES_LOADED_ON_BOOT, mergestring( ml, " " ) ); } if( need_cryptoloop && find( string e, ml, ``(e=="twofish"))==nil ) { ml = add( ml, "twofish" ); SCR::Write( .sysconfig.kernel.MODULES_LOADED_ON_BOOT, mergestring( ml, " " ) ); } } /** * Adds an entry into the fstab * * @param map entry * @return integer (0 and higher == OK, otherwise error) */ global define integer AddFstabEntry( map e ) { y2milestone( "AddFstabEntry entry:%1", e ); integer ret = 0; integer freq = e["freq"]:0; integer passno = e["passno"]:0; string dev = e["spec"]:""; string m = e["mount"]:""; string vfs = e["vfstype"]:"auto"; string opts = e["mntops"]:"defaults"; ret = LibStorage::StorageInterface::addFstabEntry( sint, dev, m, vfs, opts, freq, passno ); if( ret<0 ) y2error( "ret:%1 entry:%2", ret, e ); return( ret ); } global void ActivateHld(boolean val) { y2milestone("ActivateHld val:%1", val); LibStorage::StorageInterface::activateHld(sint, val); } global void ActivateMultipath(boolean val) { y2milestone("ActivateMultipath val:%1", val); LibStorage::StorageInterface::activateMultipath(sint, val); } /** * Writes fstab to the disk */ global define void WriteFstab() ``{ y2milestone( "WriteFstab called" ); Storage::AddFstabEntry( FileSystems::GetFstabDefaultMap( "proc" ) ); Storage::AddFstabEntry( FileSystems::GetFstabDefaultMap( "sys" ) ); Storage::AddFstabEntry( FileSystems::GetFstabDefaultMap( "debug" ) ); if( Hotplug::haveUSB ) Storage::AddFstabEntry( FileSystems::GetFstabDefaultMap( "usb" ) ); Storage::AddFstabEntry( FileSystems::GetFstabDefaultMap( "pts" ) ); map m = $[]; integer num = 0; foreach( string tdevice, any tdata, StorageDevices::ZipDrives(), ``{ m = FileSystems::GetFstabDefaultMap( "zip" ); string zfile = "/zip"; if( num > 0 ) zfile = zfile + sformat( "%1", num ); m["mount"] = "/media"+zfile; m["spec"] = tdevice+"4"; Storage::AddFstabEntry( m ); num = num+1; }); HandleModulesOnBoot( GetTargetMap() ); } global define map SpecialBootHandling( map tg ) ``{ boolean have_ppc_boot = false; foreach( string dev, map disk, tg, ``{ foreach(map part, disk["partitions"]:[], ``{ if( !have_ppc_boot && part["fsid"]:0 == Partitions::fsid_prep_chrp_boot && size(part["mount"]:"")==0 && part["create"]:false ) { have_ppc_boot = true; } }); }); y2milestone( "SpecialBootHandling: have_ppc_boot:%1", have_ppc_boot ); foreach( string dev, map disk, tg, ``{ list new_part = []; foreach(map part, disk["partitions"]:[], ``{ // convert a mount point of /boot to a 41 PReP boot partition if( Partitions::PrepBoot() && part["mount"]:"" == Partitions::BootMount() && !have_ppc_boot ) { integer id = Partitions::fsid_prep_chrp_boot; part["format"] = false; part["mount"] = ""; part["fstype"] = Partitions::FsIdToString( id ); part["prep_install"] = true; if( !part["create"]:false && part["fsid"]:0 != id ) { part["ori_fsid"] = part["fsid"]:0; part["change_fsid"] = true; } part["fsid"] = id; y2milestone( "SpecialBootHandling modified Prep part=%1", part ); } if( Arch::board_mac () && part["mount"]:"" == Partitions::BootMount() ) { integer id = Partitions::fsid_mac_hfs; part["mount"] = ""; part["fstype"] = Partitions::FsIdToString( id ); part["fsid"] = id; part["used_fs"] = `hfs; part["detected_fs"] = `hfs; y2milestone( "SpecialBootHandling modified hfs part=%1", part ); } if( Arch::ia64 () && part["mount"]:"" == Partitions::BootMount() ) { integer id = Partitions::fsid_gpt_boot; part["fsid"] = id; part["fstype"] = Partitions::FsIdToString( id ); if( !part["create"]:false && part["detected_fs"]:`none==`vfat ) { part["format"] = false; } y2milestone( "SpecialBootHandling modified GPT boot part=%1", part ); } new_part = add( new_part, part ); }); tg[dev,"partitions"] = new_part; }); return( tg ); } global define boolean PerformLosetup( map& loop, boolean format ) ``{ boolean crypt_ok = false; string pwd = loop["passwd"]:""; string device = loop["partitionName"]:""; string mdir = Storage::SaveDumpPath("tmp_mp" ); y2milestone( "PerformLosetup mdir:%1", mdir ); if( (integer)SCR::Read(.target.size, mdir ) >= 0 ) { SCR::Execute(.target.bash, "rm -f " + mdir ); } SCR::Execute(.target.mkdir, mdir ); crypt_ok = Storage::SetCryptPwd( device, pwd ) && Storage::SetCrypt( device, true, false ) && Storage::Mount( device, mdir ); if( crypt_ok ) { any vinfo = LibStorage::VolumeInfo::new("LibStorage::VolumeInfo"); integer ret = LibStorage::StorageInterface::getVolume( sint, device, vinfo ); if( ret!=0 ) { y2error( "PerformLosetup device:%1 not found (ret:%2)", device, ret ); crypt_ok = false; } else { loop["loop_dev"] = "/dev/mapper/cr_" + substring( device, findlastof( device, "/" )+1 ); y2milestone( "PerformLosetup crdev:%1", loop["loop_dev"]:"" ); } SCR::Execute(.target.bash, "umount " + mdir ); } y2milestone( "PerformLosetup ret %1", crypt_ok ); return( crypt_ok ); } /** * Detects a filesystem on a device * * @param device name * @return symbol filesystem */ global define symbol DetectFs( string device ) ``{ symbol ret = `unknown; y2milestone( "DetectFs:%1", device ); any vinfo = LibStorage::VolumeInfo::new("LibStorage::VolumeInfo"); integer r = LibStorage::StorageInterface::getVolume( sint, device, vinfo ); if( r!=0 ) { y2error( "DetectFs device:%1 not found (ret:%2)", device, r ); } else { map curr = $[]; curr = volumeMap( vinfo, curr ); ret = curr["detected_fs"]:`unknown; } y2milestone( "DetectFs ret %1", ret ); return( ret ); } /* global define boolean DiskmapNeeded() ``{ boolean ret = false; map real_disks = filter( string k, map e, GetTargetMap(), ``(IsRealDisk( e )) ); list disks = (list) maplist( string k, map e, real_disks, ``(k)); y2milestone( "disks %1", disks ); boolean scsi_disk = false; boolean ide_disk = false; foreach( string k, disks, ``{ if( search( k, "/dev/sd" )==0 ) { scsi_disk = true; } else if( search( k, "/dev/hd" )==0 ) { ide_disk = true; } else { ret = true; } }); ret = ret || (scsi_disk && ide_disk); if( !ret && ide_disk ) { string abc = "abcdefghijklmnopqrstuvwxyz"; integer idx = 0; foreach( string k, disks, ``{ y2milestone( "dev %1 abc %2", substring(k, 7, 1), substring(abc, idx, 1)); if( substring(k, 7, 1) != substring(abc, idx, 1) ) { ret = true; } idx = idx+1; }); } y2milestone( "ret %1 disks %2 ide %3 scsi %4", ret, size(disks), ide_disk, scsi_disk ); return( ret ); }; */ /* global define list GetDirPatterns( string dir, list patterns ) ``{ list ret = []; string cmd = sformat( "cd %1 && (ls %2 2>/dev/null)", dir, mergestring( (list)patterns, " ")); map out = (map) SCR::Execute( .target.bash_output, cmd ); ret = splitstring( out["stdout"]:"", "\n" ); ret = filter( string e, ret, ``(size(e)>0) ); ret = maplist( string e, ret, ``(dir+"/"+e)); y2milestone( "dir %1 pat %2", dir, patterns ); y2milestone( "ret %1", ret ); return( ret ); } */ global define map GetBootPartition( string disk ) ``{ map ret = $[]; map tg = GetTargetMap(); ret = filter( map p, tg[disk,"partitions"]:[], ``(p["boot"]:false))[0]:$[]; y2milestone( "disk:%1 ret:%2", disk, ret ); return( ret ); } global define void UpdateFstabSubfs() ``{ y2milestone( "UpdateFstabSubfs removing fstab entries for cdrom and floppy" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; list rem_lines = []; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); if( search( l["fields",1]:"", "/media/floppy" )==0 ) { rem_lines = add( rem_lines, line ); } else if( search( l["fields",1]:"", "/media/cdrom" )==0 || search( l["fields",1]:"", "/media/dvd" )==0 || search( l["fields",1]:"", "/media/cdrecorder" )==0 || search( l["fields",1]:"", "/media/dvdrecorder" )==0 || search( l["fields",1]:"", "/cdrom" )==0 || search( l["fields",1]:"", "/dvd" )==0 || search( l["fields",1]:"", "/cdrecorder" )==0 || search( l["fields",1]:"", "/dvdrecorder" )==0 ) { rem_lines = add( rem_lines, line ); } line = line+1; } y2milestone( "UpdateFstabSubfs %1", rem_lines ); if( size(rem_lines)>0 ) { rem_lines = sort(rem_lines); AsciiFile::RemoveLines( fstab, rem_lines ); } AsciiFile::RewriteFile( fstab, tabpath ); } global define void UpdateFstabSysfs() ``{ y2milestone( "UpdateFstabSysfs called" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; boolean have_sysfs = false; while( !have_sysfs && line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); have_sysfs = l["fields",1]:"" == "/sys"; line = line+1; } if( !have_sysfs ) { map entry = FileSystems::GetFstabDefaultMap( "sys" ); list fstlist = [ entry["spec"]:"", entry["mount"]:"", entry["vfstype"]:"", entry["mntops"]:"", sformat("%1",entry["freq"]:0), sformat("%1",entry["passno"]:0) ]; y2milestone( "UpdateFstabSysfs entry %1", entry ); y2milestone( "UpdateFstabSysfs fstlist %1", fstlist ); AsciiFile::AppendLine( fstab, fstlist ); AsciiFile::RewriteFile( fstab, tabpath ); } } global define void UpdateFstabOptions() { y2milestone( "UpdateFstabOptions" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; string n = ""; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); string options = l["fields", 3]:""; if (regexpmatch (options, "^\(.*,\)\?hotplug\(,.*\)\?$")) { options = regexpsub (options, "^\(.*,\)\?hotplug\(,.*\)\?$", "\\1nofail\\2"); AsciiFile::ChangeLineField( fstab, line, 3, options ); } line = line+1; } AsciiFile::RewriteFile( fstab, tabpath ); } global string HdToIseries( string input ) ``{ string ret = input; string regex = "/dev/hd[a-z][0-9]*"; if( regexpmatch( input, regex )) { ret = "/dev/iseries/vd" + substring( ret, 7 ); } y2milestone( "HdToIseries input:%1 ret:%2", input, ret ); return( ret ); } global string SLES9PersistentDevNames( string input ) ``{ string ret = input; string regex1 = "/dev/disk/by-id/.*"; string regex2 = "/dev/disk/by-path/.*"; string prefix = "scsi-"; string tmpdev = ""; if( regexpmatch( input, ".*-part[0-9]*$" )) { return input; } if( regexpmatch( input, ".*/by-id/(scsi|ccw|usb|ata)-.*$" )) { return input; } if( regexpmatch( input, regex1 )) { if (regexpmatch ( input, ".*/by-id/0X.{4}p?[0-9]?$" ) ) { prefix = "ccw-"; } tmpdev = "/dev/disk/by-id/" + prefix + substring( input, findlastof(input, "/")+1 ); y2milestone( "by id tmp %1", tmpdev ); ret = tmpdev; } else if( regexpmatch( input, regex2 )) { tmpdev = input; y2milestone( "by path tmp %1", tmpdev ); } if( size(tmpdev)>0 ) { if( regexpmatch( tmpdev, ".*p[0-9]*$" ) ) { ret = regexpsub( tmpdev, "(.*)p([0-9]*)$", "\\1-part\\2" ); } else { ret = regexpsub( tmpdev, "(.*[[:alpha:][:punct:]])([0-9]*)$", "\\1-part\\2" ); } } y2milestone( "SLES9PersistentDevNames input:%1 ret:%2", input, ret ); return( ret ); } global string HdDiskMap( string input, map diskmap ) ``{ string ret = input; if (IsKernelDeviceName(input)) { map d = GetDiskPartition( input ); if( haskey( diskmap, d["disk"]:"" )) { ret = GetDeviceName( diskmap[d["disk"]:""]:"", d["nr"]:(any)0 ); } } y2milestone( "HdDiskMap input:%1 ret:%2", input, ret ); return( ret ); } global define void UpdateFstabIseriesVd() ``{ y2milestone( "UpdateFstabIseriesVd updating hdx to iseries/vdx" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; string n = ""; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); n = HdToIseries( l["fields",0]:"" ); if( n != l["fields",0]:"" ) { AsciiFile::ChangeLineField( fstab, line, 0, n ); } line = line+1; } AsciiFile::RewriteFile( fstab, tabpath ); tabpath = PathToDestdir( "/etc/cryptotab" ); map crtab = Partitions::GetCrypto( tabpath ); line = 0; while( line<=AsciiFile::NumLines( crtab ) ) { map l = AsciiFile::GetLine( crtab, line ); n = HdToIseries( l["fields",1]:"" ); if( n != l["fields",1]:"" ) { AsciiFile::ChangeLineField( crtab, line, 1, n ); } line = line+1; } AsciiFile::RewriteFile( crtab, tabpath ); } global define void UpdateCdromLinks( map diskmap ) ``{ y2milestone( "UpdateCdromLinks map %1", diskmap ); foreach( string link, StorageDevices::TypeNames, ``{ string dev = "/dev/" + link; string cont = (string)SCR::Read( .target.symlink, dev ); if( cont!=nil && search( cont, "/dev/") != 0 ) cont = "/dev/" + cont; y2milestone( "UpdateCdromLinks dev %1 cont %2", dev, cont ); if( cont!=nil && haskey( diskmap, cont ) && size(diskmap[cont]:"")>0 ) { y2milestone( "Change symlink %1 from %2 -> %3", dev, cont, diskmap[cont]:"" ); SCR::Execute( .target.remove, dev ); SCR::Execute( .target.symlink, substring(diskmap[cont]:"",5), dev ); } }); } global define void UpdateFstabPersistentNames() ``{ y2milestone( "UpdateFstabPersistentDevNames updating to SLES10 names" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; string n = ""; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); n = SLES9PersistentDevNames( l["fields",0]:"" ); if( n != l["fields",0]:"" ) { AsciiFile::ChangeLineField( fstab, line, 0, n ); } line = line+1; } AsciiFile::RewriteFile( fstab, tabpath ); } global void UpdateFstabEvms2Lvm() { y2milestone( "UpdateFstabEvms2Lvm migrating EVMS to LVM" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; string n = ""; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); n = l["fields",0]:""; if (substring (n, 0, 15) == "/dev/evms/lvm2/") { n = "/dev/" + substring (n, 15); AsciiFile::ChangeLineField( fstab, line, 0, n ); } line = line+1; } AsciiFile::RewriteFile( fstab, tabpath ); } global define void UpdateFstabDiskmap( map diskmap ) ``{ y2milestone( "UpdateFstabDiskmap map %1", diskmap ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; string n = ""; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); n = HdDiskMap( l["fields",0]:"", diskmap ); if( n != l["fields",0]:"" ) { AsciiFile::ChangeLineField( fstab, line, 0, n ); } line = line+1; } AsciiFile::RewriteFile( fstab, tabpath ); tabpath = PathToDestdir( "/etc/cryptotab" ); map crtab = Partitions::GetCrypto( tabpath ); line = 0; while( line<=AsciiFile::NumLines( crtab ) ) { map l = AsciiFile::GetLine( crtab, line ); n = HdDiskMap( l["fields",1]:"", diskmap ); if( n != l["fields",1]:"" ) { AsciiFile::ChangeLineField( crtab, line, 1, n ); } line = line+1; } AsciiFile::RewriteFile( crtab, tabpath ); } global define void UpdateMdadm() ``{ y2milestone( "UpdateMdadm" ); string cpath = PathToDestdir( "/etc/mdadm.conf" ); map file = $[]; AsciiFile::SetComment( file, "^[ \t]*#" ); AsciiFile::ReadFile( file, cpath ); integer line = 0; boolean changed = false; while( line<=AsciiFile::NumLines( file ) ) { if( search( file["l",line,"line"]:"", "DEVICE" )!=nil && search( file["l",line,"line"]:"", "/dev/" )!=nil ) { changed = true; file["l",line,"line"] = "DEVICE partitions"; y2milestone( "UpdateMdadm %1", file["l",line]:$[] ); } line = line+1; } if( changed ) AsciiFile::RewriteFile( file, cpath ); } global define void UpdateCryptoType() ``{ y2milestone( "UpdateCryptoType" ); string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; integer pos = 0; string searchstr = "encryption=twofish256"; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); pos = search( l["fields",3]:"", searchstr ); if( pos != nil ) { string new = substring( l["fields",3]:"", 0, pos ); new = new + "encryption=twofishSL92"; new = new + substring( l["fields",3]:"", pos+size(searchstr) ); y2milestone( "new options line in %1 is %2", l, new ); AsciiFile::ChangeLineField( fstab, line, 3, new ); } line = line+1; } AsciiFile::RewriteFile( fstab, tabpath ); tabpath = PathToDestdir( "/etc/cryptotab" ); map crtab = Partitions::GetCrypto( tabpath ); line = 0; while( line<=AsciiFile::NumLines( crtab ) ) { map l = AsciiFile::GetLine( crtab, line ); if( l["fields",4]:"" == "twofish256" ) { y2milestone( "set twofishSL92 in line %1", l ); AsciiFile::ChangeLineField( crtab, line, 4, "twofishSL92" ); } line = line+1; } AsciiFile::RewriteFile( crtab, tabpath ); } global define void UpdateFstabUsbdevfs() ``{ y2milestone( "UpdateFstabUsbdevfs updating usbdevfs to usbfs" ); boolean changed = false; string tabpath = PathToDestdir( "/etc/fstab" ); map fstab = Partitions::GetFstab( tabpath ); integer line = 0; while( line<=AsciiFile::NumLines( fstab ) ) { map l = AsciiFile::GetLine( fstab, line ); if( l["fields",2]:"" == "usbdevfs" ) { AsciiFile::ChangeLineField( fstab, line, 2, "usbfs" ); AsciiFile::ChangeLineField( fstab, line, 0, "usbfs" ); changed = true; } line = line+1; } if( changed ) { y2milestone( "UpdateFstabUsbdevfs changed" ); AsciiFile::RewriteFile( fstab, tabpath ); } } global define map BuildDiskmap( map oldv ) ``{ map d = (map)SCR::Read( .target.stat, Installation::destdir + "/var/lib/hardware" ); y2milestone( "BuildDiskmap oldv:%1 Vers:%2", oldv, DiskMapVersion ); y2milestone( "dir:%1 d:%2", Installation::destdir+"/var/lib/hardware", d ); if( d["isdir"]:false && (oldv != DiskMapVersion || size(oldv)==0) ) { DiskMap = $[]; string cmd = ""; cmd = "LIBHD_HDDB_DIR=" + Installation::destdir + "/var/lib/hardware " + "hwinfo --verbose --map"; y2milestone( "BuildDiskmap cmd %1", cmd ); map bo = (map)SCR::Execute (.target.bash_output, cmd ); y2milestone( "BuildDiskmap bo %1", bo ); if( bo["exit"]:1==0 && size(bo["stdout"]:"")>0 ) { list lines = splitstring( bo["stdout"]:"", "\n" ); foreach( string line, lines, ``{ list disks = filter( string d, splitstring( line, " \t" ), ``(size(d)>0)); if( size(disks)>1 ) { integer index = 1; while( index0 ) { UpdateFstabDiskmap( dm ); UpdateMdadm(); } if( oldv["major"]:0<9 || (oldv["major"]:0==9 && oldv["minor"]:0<=2)) { Storage::UpdateCryptoType(); } if( oldv["major"]:0<10 || (oldv["major"]:0==10 && oldv["minor"]:0==0) ) { string of = "/etc/udev/rules.d/20-cdrom.rules"; y2milestone( "removing obsolete %1", of ); SCR::Execute( .target.remove, of ); of = "/etc/udev/rules.d/55-cdrom.rules"; y2milestone( "removing obsolete %1", of ); SCR::Execute( .target.remove, of ); } if( oldv["major"]:0<10 || (oldv["major"]:0==10 && oldv["minor"]:0<=2) ) { string of = "/etc/udev/rules.d/65-cdrom.rules"; y2milestone( "removing obsolete %1", of ); SCR::Execute( .target.remove, of ); } if( oldv["major"]:0<10 || (oldv["major"]:0==10 && oldv["minor"]:0==0)) UpdateFstabSubfs(); if( oldv["major"]:0<9 || (oldv["major"]:0==9 && oldv["minor"]:0==0)) { if( Arch::board_iseries () ) { UpdateFstabIseriesVd(); } string cmd = "cd / && /sbin/insserv -r /etc/init.d/boot.evms"; y2milestone( "Update cmd %1", cmd ); map bo = (map)SCR::Execute (.target.bash_output, cmd ); y2milestone( "Update bo %1", bo ); } if( oldv["major"]:0<10 || (oldv["major"]:0==10 && oldv["minor"]:0<=2)) { string cmd = "cd / && /sbin/insserv /etc/init.d/boot.crypto"; map bo = (map)SCR::Execute (.target.bash_output, cmd ); y2milestone( "Update bo %1", bo ); cmd = "cd / && /sbin/insserv /etc/init.d/boot.crypto-early"; bo = (map)SCR::Execute (.target.bash_output, cmd ); y2milestone( "Update bo %1", bo ); } // set flag -> it indicates that Update was already called called_update = true; } else { y2milestone("Skip calling Update() -> It was already called"); } } global define list GetTranslatedDevices( map oldv, map newv, list names ) { y2milestone( "GetTranslatedDevices old:%1 new:%2", oldv, newv ); y2milestone( "GetTranslatedDevices names %1", names ); list ret = names; map dm = BuildDiskmap( oldv ); if( size(dm)>0 ) { ret = maplist( string n, ret, ``(HdDiskMap( n, dm ))); } if( (oldv["major"]:0<9 || (oldv["major"]:0==9 && oldv["minor"]:0==0)) && Arch::board_iseries () ) { ret = maplist( string n, ret, ``(HdToIseries( n ))); } if( oldv["major"]:0==9 ) { ret = maplist( string n, ret, ``(SLES9PersistentDevNames( n ))); } // convert EVMS names to LVM // FIXME: add version checking, but does not seem necessary, since non-LVM // installations will not be affected by this conversion at all ret = maplist (string n, ret, { if (substring (n, 0, 15) == "/dev/evms/lvm2/") n = "/dev/" + substring (n, 15); return n; }); y2milestone( "GetTranslatedDevices ret %1", ret ); return( ret ); } /* global define list GetUsedLvmGroups( map tg ) ``{ list groups = []; foreach( string disk, map data, tg, ``{ if( data["type"]:`CT_UNKNOWN==`CT_LVM && size( filter( map p, data["partitions"]:[], ``(size(p["mount"]:"")>0 ) )) > 0 ) { y2milestone( "GetUsedLvmGroups %1", filter( map p, data["partitions"]:[], ``(size(p["mount"]:"")>0 ) ) ); groups = add( groups, substring( disk, 5 ) ); } }); y2milestone( "GetUsedLvmGroups ret %1", groups ); return( groups ); }; */ /** * Get used real disks * * @param map tg Target map * @param boolean ignore boot * @return list disks List of disks */ /* global define list GetUsedRealDisksNew( map tg, boolean ignore_boot ) ``{ list disks = []; list lvmgr = GetUsedLvmGroups( tg ); list mdlist = []; foreach( map p, tg["/dev/md","partitions"]:[], ``{ if( size(p["mount"]:"")>0 || contains( lvmgr, p["used_by"]:"" ) ) { mdlist = add( mdlist, p["device"]:"" ); } }); foreach( string disk, map data, tg, ``{ if( IsRealDisk( data ) && size( filter( map p, data["partitions"]:[], ``( (size(p["mount"]:"")>0 && (!ignore_boot || p["mount"]:""!=Partitions::BootMount())) || contains( mdlist, p["used_by"]:"" ) || contains( lvmgr, p["used_by"]:"" ) ) )) > 0 ) { disks = add( disks, disk ); } }); y2milestone( "GetUsedRealDisksNew ignore_boot %1 ret %2", ignore_boot, disks ); return( disks ); }; */ /* global define list GetUsedRealDisks( map tg ) { return( GetUsedRealDisksNew( tg, false )); }; */ /* global define list GetEvmsRealDisk( map tg, map p ) ``{ list rdisk = []; string name = ""; string namel = ""; if( size(p["device"]:"")>10 ) name = substring( p["device"]:"", 10 ); if( search( name, "lvm/" ) == 0 || search( name, "lvm2/" ) == 0) { name = substring( name, 0, findlastof( name, "/" )); } namel = name; integer pos = search( namel, "/" ); if( pos != nil ) { namel = substring( namel, pos+1 ); } y2milestone( "GetEvmsRealDisk name is %1 namel is %2", name, namel ); foreach( string disk, map data, tg, ``{ if( size(name)>0 && (IsRealDisk( data ) || disk=="/dev/md") && ((size( filter( map p, data["partitions"]:[], ``(p["used_by_type"]:`UB_NONE==`UB_EVMS && p["used_by"]:""==name)))>0) || (size( filter( map p, data["partitions"]:[], ``(p["used_by_type"]:`UB_NONE==`UB_LVM && p["used_by"]:""==namel)))>0) )) { list dl = [ disk ]; if( disk=="/dev/md" ) { list tl = []; tl = filter( map p, data["partitions"]:[], ``((p["used_by_type"]:`UB_NONE==`UB_EVMS && p["used_by"]:""==name)|| (p["used_by_type"]:`UB_NONE==`UB_LVM && p["used_by"]:""==namel))); dl = maplist( map p, tl, ``(p["device"]:"")); dl = (list)sort( dl ); dl = (list)toset( dl ); y2milestone( "GetEvmsRealDisk dl %1", dl ); } rdisk = (list)union( rdisk, dl ); } }); if( size(rdisk)==0 && !p["evms_native"]:false ) { map d = GetDiskPartitionTg( EvmsDevDisk( p["device"]:"" ), tg )[0]:$[]; if( haskey( tg, d["disk"]:"" )) { rdisk = [ d["disk"]:"" ]; } } y2milestone( "GetEvmsRealDisk %1 is %2", p["device"]:"", rdisk ); return( rdisk ); } */ /* global define list GetUsedEvmsDisks( map tg ) ``{ list disks = []; list mdlist = []; foreach( string disk, map data, tg, ``{ if( search( disk, "/dev/evms" )==0 ) { foreach( map p, data["partitions"]:[], ``{ if( size(p["mount"]:"")>0 ) { list dl = GetEvmsRealDisk( tg, p ); foreach( string d, dl, ``{ y2milestone( "GetUsedEvmsDisks d %1", d ); if( search( d, "/dev/md" ) == 0 ) { list ndl = []; foreach( string dd, map pp, tg, ``{ map pu = find( map p, pp["partitions"]:[], ``(p["used_by"]:""==substring(d,5)) ); y2milestone( "GetUsedEvmsDisks disk:%1 used:%2", dd, pu ); if( pu!=nil && size(pu)>0 ) { ndl = add( ndl, dd ); } }); disks = (list)union( disks, ndl ); } else { disks = (list)union( disks, [d] ); } }); } }); } }); disks = sort( disks ); y2milestone( "GetUsedEvmsDisks ret %1", disks ); return( disks ); }; */ /* global list GetPrepBoot( map tg ) { list ret = []; list cl = [ 0x06, 0x41 ]; foreach( string s, map e, tg, ``{ if( IsRealDisk( e ) && Partitions::PrepBoot() ) ret = (list)merge( ret, filter( map p, e["partitions"]:[], ``( size(p["mount"]:"")==0 && contains( cl, p["fsid"]:0 ) && !p["delete"]:false ))); }); y2milestone( "GetPrepBoot ret:%1", ret ); return( ret ); } */ void CallInsserv( boolean on, string name ) { y2milestone( "CallInsserv on:%1 name:%2", on, name ); string scrname = "/etc/init.d/" + name; if( SCR::Read( .target.size, scrname )>0 ) { string cmd = "cd / && /sbin/insserv "; if( !on ) cmd = cmd + "-r "; cmd = cmd + scrname; y2milestone( "CallInsserv cmd %1", cmd ); map bo = (map)SCR::Execute (.target.bash_output, cmd ); y2milestone( "CallInsserv bo %1", bo ); } } global void FinishInstall() { y2milestone("FinishInstall initial:%1", Stage::initial()); map tg = GetTargetMap(); if( Stage::initial() ) { HandleModulesOnBoot( tg ); /* list evms = GetUsedEvmsDisks( tg ); y2milestone( "FinishInstall evms %1", evms ); if( size(evms)>0 ) CallInsserv( true, "evms" ); list nonevms = GetUsedRealDisks( tg ); nonevms = filter( string d, nonevms, ``(!contains( evms, d ))); nonevms = maplist( string d, nonevms, ``(substring(d,5))); y2milestone( "FinishInstall nonevms %1", nonevms ); nonevms = (list)merge( nonevms, maplist( map p, GetPrepBoot(tg), ``(substring(p["device"]:"",5)))); y2milestone( "FinishInstall nonevms %1", nonevms ); if( size(nonevms)>0 && SCR::Read( .target.size, "/etc/evms.conf" )>=0 ) { map evmsconf = $[]; AsciiFile::ReadFile( evmsconf, "/etc/evms.conf" ); boolean found = false; integer i = 1; string regex1 = "^[ \t]*activate[ \t]*\\{"; string regex2 = "^[ \t]*exclude[ \t]*="; string regex3 = "^[ \t]*\\}"; while( i<=AsciiFile::NumLines(evmsconf) && !found ) { found = regexpmatch( evmsconf["l",i,"line"]:"", regex1 ); i = i+1; } found = false; boolean found2 = false; while( i<=AsciiFile::NumLines(evmsconf) && !found && !found2) { found = regexpmatch( evmsconf["l",i,"line"]:"", regex2 ); found2 = regexpmatch( evmsconf["l",i,"line"]:"", regex3 ); if( found ) { string co = evmsconf["l",i,"line"]:""; integer pos = search( co, "[" ); if( pos!=nil ) co = substring( co, pos+1 ); pos = search( co, "]" ); if( pos!=nil ) co = substring( co, 0, pos ); y2milestone( "FinishInstall co = \"%1\"", co ); string li = "\texclude = [ " + co + mergestring( nonevms, " " ) + " ]"; y2milestone( "FinishInstall li = %1", li ); evmsconf["l",i,"line"] = li; evmsconf["l",i,"buildline"] = false; AsciiFile::RewriteFile( evmsconf, "/etc/evms.conf" ); } i = i+1; } } */ } boolean need_crypt = false; boolean need_md = false; boolean need_lvm = false; boolean need_dmraid = false; boolean need_dmmultipath = false; foreach( string k, map e, tg, { if( size(filter( map p, e["partitions"]:[], ``(p["enc_type"]:`none != `none)))>0 ) need_crypt = true; if( e["type"]:`CT_UNKNOWN==`CT_MD && size(e["partitions"]:[])>0 ) need_md = true; if( e["type"]:`CT_UNKNOWN==`CT_MDPART ) need_md = true; if( e["type"]:`CT_UNKNOWN==`CT_LVM ) need_lvm = true; if( e["type"]:`CT_UNKNOWN==`CT_DMRAID ) need_dmraid = true; if( e["type"]:`CT_UNKNOWN==`CT_DMMULTIPATH ) need_dmmultipath = true; }); y2milestone( "FinishInstall need crypto:%1 md:%2 lvm:%3 dmraid:%4 dmmultipath:%5", need_crypt, need_md, need_lvm, need_dmraid, need_dmmultipath ); if( need_crypt ) { CallInsserv( true, "boot.crypto" ); CallInsserv( true, "boot.crypto-early" ); } CallInsserv( need_md, "boot.md" ); CallInsserv( need_lvm, "boot.lvm" ); CallInsserv( need_dmraid, "boot.dmraid" ); CallInsserv( need_dmmultipath, "boot.multipath" ); CallInsserv( need_dmmultipath, "multipathd" ); y2milestone("FinishInstall done"); } global define map GetEntryForMountpoint( string mp ) ``{ list all_partitions = []; foreach( string dev, map disk, GetTargetMap(), ``{ all_partitions = (list)union( all_partitions, disk["partitions"]:[] ); }); map partition = find( map part, all_partitions, ``(part["mount"]:""==mp) ); if( partition==nil || partition["mount"]:"" != mp ) { partition = $[]; } return partition; } global define list GetRootInitrdModules() ``{ map partition = GetEntryForMountpoint( "/" ); y2milestone("GetRootInitrdModules root partition %1", partition ); map tg = GetTargetMap(); map disk = $[]; foreach( string k, map d, tg, ``{ if( size(disk)==0 && find( map p, d["partitions"]:[], ``(!p["delete"]:false && p["device"]:""==partition["device"]:""))!=nil ) disk = d; }); y2milestone( "GetRootInitrdModules disk %1", haskey(disk,"partitions")?remove(disk,"partitions"):disk ); list initrdmodules = FileSystems::GetNeededModules( partition["used_fs"]:`ext2 ); if( partition["type"]:`unknown == `sw_raid ) { string t = partition["raid_type"]:""; if (!contains (initrdmodules, t)) { initrdmodules = add (initrdmodules, t); } } if( partition["type"]:`unknown == `lvm ) { string vgname = substring( partition["device"]:"", 5 ); vgname = substring( vgname, 0, findfirstof( vgname, "/" )); list mod = (list) maplist(map k, filter(map e, tg["/dev/md","partitions"]:[], ``(e["used_by"]:""==vgname) ), ``(k["raid_type"]:"")); y2milestone( "GetRootInitrdModules mod %1", mod ); foreach(string e, mod, ``{ if( size(e)>0 && !contains( initrdmodules, e ) ) { initrdmodules = add( initrdmodules, e ); } }); if( !contains( initrdmodules, "dm_mod" ) ) { initrdmodules = add( initrdmodules, "dm_mod" ); } } if( partition["type"]:`unknown == `evms ) { string evmsco = partition["device"]:""; evmsco = substring( evmsco, 0, findlastof( evmsco, "/" )); y2milestone( "GetRootInitrdModules evmsco %1", evmsco ); y2milestone( "GetRootInitrdModules evms %1", tg[evmsco]:$[] ); list md = filter( string s, tg[evmsco,"devices"]:[], ``(search(s,"/dev/md")==0)); y2milestone( "GetRootInitrdModules mddev %1", md ); list mod = (list) maplist(map k, filter(map e, tg["/dev/md","partitions"]:[], ``(contains(md,e["device"]:""))), ``(k["raid_type"]:"")); y2milestone( "GetRootInitrdModules mod %1", mod ); foreach(string e, mod, ``{ if( size(e)>0 && !contains( initrdmodules, e ) ) { initrdmodules = add( initrdmodules, e ); } }); if( !contains( initrdmodules, "dm_mod" ) ) { initrdmodules = add( initrdmodules, "dm_mod" ); } } if( size(disk["modules"]:[])>0 ) { y2milestone( "adding disk modules %1", disk["modules"]:[] ); foreach( string m, disk["modules"]:[], ``{ if( !contains( initrdmodules, m )) { initrdmodules = add( initrdmodules, m ); } }); } if( size(disk["driver_module"]:"")>0 ) { string m = disk["driver_module"]:""; y2milestone( "adding driver modules %1", m ); if( !contains( initrdmodules, m )) { initrdmodules = add( initrdmodules, m ); } } SCR::UnmountAgent (.proc.modules); map lmod = (map) SCR::Read(.proc.modules); y2milestone( "GetRootInitrdModules lmod:%1", lmod ); if( size(lmod["edd"]:$[])>0 ) initrdmodules = add( initrdmodules, "edd" ); y2milestone( "GetRootInitrdModules ret %1", initrdmodules ); return initrdmodules; }; /** * CheckForLvmRootFs *--------------------------------------------------------------------- * check if the root filesystem is a lvm logical volume * **/ global define boolean CheckForLvmRootFs() ``{ map part = GetEntryForMountpoint( "/" ); y2milestone( "CheckForLvmRootFs root=%1", part ); boolean ret = part["type"]:`primary==`lvm; y2milestone( "CheckForLvmRootFs ret=%1", ret ); return ret; }; /*--------------------------------------------------------------------- * checkForMdRootFs *--------------------------------------------------------------------- * check if the root filesystem is a md device *--------------------------------------------------------------------- */ global define boolean CheckForMdRootFs() ``{ map part = GetEntryForMountpoint( "/" ); boolean ret = part["type"]:`primary==`sw_raid; y2milestone( "CheckForMdRootFs root=%1", part ); y2milestone( "CheckForMdRootFs ret=%1", ret ); return ret; }; global define void AdaptResize( string maindev, list region, integer schange ) ``{ map tg = GetTargetMap(); list partitions = tg[maindev,"partitions"]:[]; integer cylinder = region[0]:0 + region[1]:0; boolean found = false; integer index = -1; integer e_idx = -1; list idx_list = []; map part = (map) find(map p, partitions, ``(p["region",0]:0 == cylinder && p["create"]:false)); y2milestone( "AdaptResize %1 reg %2 change %3", maindev, region, schange ); if( part != nil ) { found = false; index = 0; foreach(map p, partitions, ``{ if( p["region",0]:0 == cylinder && p["create"]:false ) { found = true; } else if( !found ) { index = index + 1; } }); if( partitions[index,"type"]:`primary == `extended ) { e_idx = index; found = false; index = 0; foreach(map p, partitions, ``{ if( p["region",0]:0 == cylinder && p["create"]:false && p["type"]:`primary != `extended ) { found = true; part = p; } else if( !found ) { index = index + 1; } }); } cylinder = part["region",0]:0 + part["region",1]:0; y2milestone( "AdaptResize part:%1", part ); y2milestone( "AdaptResize index:%1 e_idx:%2 cylinder:%3", index, e_idx, cylinder ); map pnew = (map) find( map p, partitions, ``( p["region",0]:0 == cylinder && p["create"]:false )); y2milestone( "AdaptResize pnew:%1", pnew ); while( pnew != nil && (part["mount"]:"" == Partitions::BootMount() || part["fsid"]:0==Partitions::fsid_swap || part["region",1]:0 < (schange<0?(-1*schange):schange)) ) { y2milestone( "AdaptResize pnew:%1", pnew ); part = pnew; idx_list = add( idx_list, index ); y2milestone( "AdaptResize index:%1 idx_list:%2", index, idx_list ); found = false; index = 0; foreach(map p, partitions, ``{ y2milestone( "found:%1 index:%2 p=%3", found, index, p ); if( p["nr"]:0 == pnew["nr"]:0 ) { found = true; } else if( !found ) { index = index + 1; } }); cylinder = part["region",0]:0 + part["region",1]:0; pnew = (map) find( map p, partitions, ``( p["region",0]:0 == cylinder && p["create"]:false )); } y2milestone( "AdaptResize idx:%1 list:%2", index, idx_list ); foreach(integer num, idx_list, ``{ partitions[num,"region",0] = partitions[num,"region",0]:0 - schange; UpdatePartition( partitions[num,"device"]:"", partitions[num,"region",0]:0, partitions[num,"region",1]:1 ); }); partitions[index,"region",0] = partitions[index,"region",0]:0 - schange; partitions[index,"region",1] = partitions[index,"region",1]:0 + schange; if( partitions[index,"region",1]:0 <= 0 ) { partitions[index,"region",1] = 1; } y2milestone( "AdaptResize increase p:%1", partitions[index]:$[] ); UpdatePartition( partitions[index,"device"]:"", partitions[index,"region",0]:0, partitions[index,"region",1]:1 ); if( e_idx>=0 ) { partitions[e_idx,"region",0] = partitions[e_idx,"region",0]:0 - schange; partitions[e_idx,"region",1] = partitions[e_idx,"region",1]:0 + schange; if( partitions[e_idx,"region",1]:0 <= 0 ) { partitions[e_idx,"region",1] = 1; } UpdatePartition( partitions[e_idx,"device"]:"", partitions[e_idx,"region",0]:0, partitions[e_idx,"region",1]:1 ); } } else { y2error( "AdaptResize this should not happen %1", partitions ); } y2milestone( "AdaptResize partitions:%1", partitions ); y2milestone( "AdaptResize maindev:%1 region:%2 change:%3", maindev, region, schange ); } global define integer NumLoopDevices() { map bo = (map)WFM::Execute (.local.bash_output, "losetup -a" ); list sl = splitstring( bo["stdout"]:"", "\n" ); sl = filter( string s, sl, ``(search( s, "/dev/loop" )==0 )); sl = maplist( string s, sl, ``(substring( s, 0, search( s, ":" )))); sl = maplist( string s, sl, ``(substring( s, 9 ))); list il = sort( maplist( string s, sl, ``(tointeger(s)))); integer ret = il[size(sl)-1]:-1 + 1; y2milestone( "NumLoopDevices ret:%1", ret ); return( ret ); } //----------------------------------------------------- // convert partitions to fstab entries // return map (might be empty) global define map onepartition2fstab (map part, integer& other_nr) ``{ y2milestone( "onepartition2fstab part=%1", part ); if (part["delete"]:false || part["type"]:`unknown == `extended || (contains( [ `lvm, `sw_raid, `evms ], part["type"]:`unknown ) && size(part["mount"]:"")==0) || (part["enc_type"]:`none!=`none && !part["noauto"]:false) || part["used_by_type"]:`UB_NONE != `UB_NONE || (contains( [ Partitions::fsid_prep_chrp_boot, Partitions::fsid_lvm, Partitions::fsid_raid ], part["fsid"]:0 ) && size(part["mount"]:"")==0)) { return $[]; } string spec = part["device"]:""; if( part["mountby"]:`device == `label && size(part["label"]:"")>0 ) { spec = sformat("LABEL=%1", part["label"]:"" ); } else if( part["mountby"]:`device == `uuid && size(part["uuid"]:"")>0 ) { spec = sformat("UUID=%1", part["uuid"]:"" ); } y2debug( "onepartition2fstab spec=%1", spec ); string mount_point = part["mount"]:""; integer fsid = part["fsid"]:0; symbol used_fs = part["used_fs"]:`ext2; boolean format = part["format"]:false; string vfstype = "unknown"; // keep "unknown", used again below integer freq = 0; integer passno = 0; string mntops = part["fstopt"]:""; if( mount_point == "swap" ) { vfstype = "swap"; if( size(mntops) == 0 ) { mntops = FileSystems::GetFstabDefaultMntops( "swap" ); } passno = 0; } else if( fsid==Partitions::fsid_native || fsid==Partitions::fsid_lvm || (part["type"]:`unknown == `evms && part["detected_fs"]:`none!=`unknown) ) { vfstype = FileSystems::GetMountString( used_fs, (format ? "ext2" : "auto")); freq = 1; if( mount_point == "/" ) { passno = 1; } else if( mount_point != "" ) { passno = 2; } else if( Stage::initial () && !Arch::s390 () ) { mount_point = "/data" + other_nr; // Don't mount and fsck this filesystem during boot, its // state is unknown. mntops = "noauto,user"; vfstype = "auto"; freq = 0; passno = 0; other_nr = other_nr + 1; y2milestone( "TT add MountPoint %1", mount_point ); } } else if( (Arch::i386()||Arch::ia64()||Arch::x86_64()) && size(mount_point)>0 && (used_fs==`vfat || used_fs==`ntfs) && (contains(union(union(Partitions::fsid_dostypes, Partitions::fsid_ntfstypes), Partitions::fsid_wintypes), fsid ) || fsid==Partitions::fsid_gpt_boot)) { freq = 0; passno = 0; string lower_point = tolower( mount_point ); if( lower_point != "" && mount_point != lower_point) { if( Installation::scr_destdir != "/" ) { lower_point = Installation::scr_destdir + lower_point; } y2milestone( "symlink %1 -> %2", substring(mount_point,(findlastof(mount_point,"/")+1)), lower_point ); SCR::Execute(.target.symlink, substring(mount_point,(findlastof(mount_point,"/")+1)), lower_point); } vfstype = FileSystems::GetMountString( used_fs, "auto" ); } else if( (Arch::sparc () || Arch::alpha ()) && contains (Partitions::fsid_skipped, fsid)) { return $[]; // skip "whole disk" partition } else { return $[]; // unknown type } if( part["detected_fs"]:`unknown == `unknown || part["noauto"]:false ) { passno = 0; } map ret = $[ "spec":spec, "mount":mount_point, "vfstype":vfstype, "mntops":mntops, "freq":freq, "device":part["device"]:"", "passno":passno ]; if( size(ret["mntops"]:"")==0 ) { ret["mntops"] = "defaults"; } y2milestone( "onepartition2fstab ret=%1", ret ); return( ret ); }; global boolean ProposalHome() { return( proposal_home ); } global void SetProposalHome(boolean val) { proposal_home = val; y2milestone( "SetProposalHome val:%1", proposal_home ); } global boolean ProposalLvm() { return proposal_lvm; } global void SetProposalLvm(boolean val) { proposal_lvm = val; y2milestone("SetProposalLvm val:%1", proposal_lvm); } global boolean ProposalEncrypt() { return proposal_encrypt; } global void SetProposalEncrypt(boolean val) { proposal_encrypt = val; y2milestone("SetProposalEncrypt val:%1", val); } global string ProposalPassword() { return proposal_password; } global void SetProposalPassword(string val) { proposal_password = val; y2milestone("SetProposalPassword"); } global boolean ProposalEvms() { return false; } global void SetProposalDefault( boolean home_only ) { SetProposalHome( cfg_xml["home"]:false ); if( !home_only ) { if( cfg_xml["prop_lvm"]:false ) { SetProposalLvm(true); SetProposalEncrypt(false); SetProposalPassword(""); } else { SetProposalLvm(false); } } y2milestone("SetProposalDefault home:%1 lvm:%2 encypt:%3 home_only:%4", proposal_home, proposal_lvm, proposal_encrypt, home_only); } global map GetControlCfg() { integer StrToByte(string str) { integer bytes = 0; if (!LibStorage::StorageInterface::humanStringToByte(sint, str, true, bytes)) y2error("cannot parse %1", str); return bytes; } if (size(cfg_xml) == 0) { boolean bt = ProductFeatures::GetBooleanFeature( "partitioning", "try_separate_home" ); cfg_xml["home"] = bt?true:false; cfg_xml["root_percent"] = tointeger(ProductFeatures::GetStringFeature( "partitioning", "root_space_percent")); if( cfg_xml["root_percent"]:0 == nil || cfg_xml["root_percent"]:0 <= 0 ) cfg_xml["root_percent"] = 40; string tmp = ProductFeatures::GetStringFeature( "partitioning", "limit_try_home"); cfg_xml["home_limit"] = StrToByte(tmp) / (1024*1024); if( cfg_xml["home_limit"]:0 <= 0 ) cfg_xml["home_limit"] = 5*1024; tmp = ProductFeatures::GetStringFeature( "partitioning", "root_base_size"); cfg_xml["root_base"] = StrToByte(tmp) / (1024*1024); if( cfg_xml["root_base"]:0 <= 0 ) cfg_xml["root_base"] = 3*1024; tmp = ProductFeatures::GetStringFeature( "partitioning", "root_max_size"); cfg_xml["root_max"] = StrToByte(tmp) / (1024*1024); if( cfg_xml["root_max"]:0 <= 0 ) cfg_xml["root_max"] = 10*1024; tmp = ProductFeatures::GetStringFeature( "partitioning", "vm_desired_size"); cfg_xml["vm_want"] = StrToByte(tmp) / (1024*1024); if( cfg_xml["vm_want"]:0 <= 0 ) cfg_xml["vm_want"] = 15*1024; tmp = ProductFeatures::GetStringFeature( "partitioning", "vm_home_max_size"); cfg_xml["home_max"] = StrToByte(tmp) / (1024*1024); if( cfg_xml["home_max"]:0 <= 0 ) cfg_xml["home_max"] = 25*1024; bt = ProductFeatures::GetBooleanFeature( "partitioning", "proposal_lvm" ); cfg_xml["prop_lvm"] = bt?true:false; SetProposalDefault(false); y2milestone("GetControlCfg cfg_xml:%1", cfg_xml); } return cfg_xml; } global boolean BootEvms() { return false; } global string ProposalVM() { string ret = ""; map xml = GetControlCfg(); if (proposal_lvm) { ret = "system"; } y2milestone("ProposalVM lvm:%1 ret:%2", proposal_lvm, ret); return ret; } global void AddHwPackage( string name ) { y2milestone( "AddHwPackage name %1 list:%2", name, hw_packages ); if( find( string s, hw_packages, ``(s==name)) == nil ) hw_packages = add( hw_packages, name ); y2milestone( "AddHwPackage list:%1", hw_packages ); } global void SwitchUiAutomounter(boolean on) { y2milestone("SwitchUiAutomounter on:%1", on); if (!on) { SCR::Execute(.dbus.method, $[ `destination : "org.freedesktop.Hal", `path : "/org/freedesktop/Hal/Manager", `interface : "org.freedesktop.Hal.Manager", `method : "AcquireGlobalInterfaceLock" ], [ "org.freedesktop.Hal.Device.Storage", true ]); } else { SCR::Execute(.dbus.method, $[ `destination : "org.freedesktop.Hal", `path : "/org/freedesktop/Hal/Manager", `interface : "org.freedesktop.Hal.Manager", `method : "ReleaseGlobalInterfaceLock" ], [ "org.freedesktop.Hal.Device.Storage" ]); } y2milestone("SwitchUiAutomounter exit"); } global void DumpObjectList() { if (!InitLibstorage(false)) return; LibStorage::StorageInterface::dumpObjectList(sint); } global define list NoProposeDisks() { if( no_propose_disks == nil ) { no_propose_disks = []; if( Stage::initial() && SCR::Read( .target.size, "/etc/install.inf" )>0 ) { string inst = (string) SCR::Read( .etc.install_inf.Partition ); y2milestone( "NoProposeDisks .etc.install_inf.Partition \"%1\"", inst ); if( inst!=nil && size(inst)>0 ) { if( search( inst, "/dev/" )!=0 ) inst = "/dev/" + inst; map d = GetDiskPartition( inst ); y2milestone( "NoProposeDisks inst:%1 disk:%2", inst, d ); if( size(d["disk"]:"")>0 ) no_propose_disks = add( no_propose_disks, d["disk"]:"" ); } inst = (string) SCR::Read( .etc.install_inf.Cdrom ); y2milestone( "NoProposeDisks .etc.install_inf.Cdrom \"%1\"", inst ); if( inst!=nil && size(inst)>0 ) { if( search( inst, "/dev/" )!=0 ) inst = "/dev/" + inst; map d = GetDiskPartition( inst ); y2milestone( "NoProposeDisks inst:%1 disk:%2", inst, d ); if( size(d["disk"]:"")>0 ) no_propose_disks = add( no_propose_disks, d["disk"]:"" ); } } if( Stage::initial() ) { map ret = (map)SCR::Execute( .target.bash_output, "echo $YAST2_STORAGE_NO_PROPOSE_DISKS" ); y2milestone( "NoProposeDisks ret \"%1\"", ret["stdout"]:"" ); list ls = filter( string e, splitstring( ret["stdout"]:"", " \t\n" ), ``(size(e)>0) ); no_propose_disks = (list)merge( no_propose_disks, ls ); } y2milestone( "NoProposeDisks \"%1\"", no_propose_disks ); } return( no_propose_disks ); } global void SetDefaultMountBy(symbol mby) { integer val = fromSymbol( conv_mountby, mby ); LibStorage::StorageInterface::setDefaultMountBy(sint, val); } global symbol GetDefaultMountBy() { integer val = LibStorage::StorageInterface::getDefaultMountBy(sint); symbol ret = toSymbol(conv_mountby, val); return ret; } global symbol GetMountBy( string device ) { integer val = 0; integer r = LibStorage::StorageInterface::getMountBy( sint, device, val ); symbol ret = toSymbol( conv_mountby, val ); return( ret ); } global boolean DeviceMatchFstab( string device, string fstab_spec ) { boolean ret = false; map tg = GetTargetMap(); string ts = fstab_spec; if (IsKernelDeviceName(fstab_spec)) { // translate fstab_spec from old to new kernel device name ts = GetTranslatedDevices( $[], $[], [ fstab_spec ] )[0]:""; if( ts!=fstab_spec ) y2milestone( "DeviceMatchFstab translate %1 --> %2", fstab_spec, ts ); } list pl = GetPartitionLst( tg, ts ); ret = find( map p, pl, ``(p["device"]:"" == device) )!=nil; y2milestone( "DeviceMatchFstab device:%1 fstab:%2 ret:%3", device, fstab_spec, ret ); return( ret ); } global boolean IsPersistent( map p ) { boolean ret = contains( [ `lvm, `sw_raid, `dm ], p["type"]:`unknown ); if( !ret && contains( [ `evms, `primary, `logical, `extended ], p["type"]:`unknown )) { map d = GetDisk( GetTargetMap(), p["device"]:"" ); if( p["type"]:`unknown==`evms ) ret = d["is_container"]:false || p["evms_native"]:false; else ret = d["type"]:`CT_UNKNONW==`CT_DMRAID || d["type"]:`CT_UNKNONW==`CT_DMMULTIPATH || size(d["udev_id"]:[])>0; } y2milestone( "IsPersistent device:%1 ret:%2", p["device"]:"", ret ); return( ret ); } global integer ActionsCount() { return size(LibStorage::StorageInterface::getCommitActions( sint, true )); } global boolean CheckEncryptionPasswords(string pw1, string pw2, integer min_length, boolean empty_allowed) { if (pw1 != pw2) { // popup text Popup::Message(_("The first and the second version\nof the password do not match. Try again.")); return false; } if (size(pw1) == 0 && !empty_allowed) { // popup text Popup::Message(_("You did not enter a password. Try again. ")); return false; } if (size(pw1) < min_length && !empty_allowed) { // popup text Popup::Message(sformat(_("The password must have at least %1 characters. Try again. "), min_length)); return false; } if (size(pw1) >= min_length || empty_allowed) { any tmp = findfirstnotof( pw1, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#* ,.;:._-+!$%&/|\?{[()]}@^\\<>" ); if (tmp != nil && size(pw1) > 0) { // popup text Popup::Message(_("The password may only contain the following characters: 0..9, a..z, A..Z, and any of \"@#* ,.;:._-+!$%&/|\?{[()]}^\\<>\". Try again.")); return false; } } return true; } global boolean CheckCryptOk( string dev, string fs_passwd ) { integer i = LibStorage::StorageInterface::verifyCryptPassword( sint, dev, fs_passwd ); if( i!=0 ) Popup::Error( sformat(_("Could not set encryption. System error code is %1. The crypt password provided could be incorrect. "), i )); y2milestone( "CheckCryptOk dev:%1 pwlen:%2 ret:%3", dev, size(fs_passwd), i==0 ); return( i==0 ); } } 0707010006A319000081A40000018F0000018F000000014F1023BB0003E33D000000080000000100000000000000000000004700000000linux/suse/x86_64-sles11/inst-sys/usr/share/YaST2/modules/RootPart.ybcYaST bytecode 1.4.0RootPartv RootPart.ycp  DirectoryModeLinuxrcStoragePopup ModuleLoading FileSystemsUpdate  SuSERelease  FileUtils Arch String  InstallationReportLabelStageWizard$partitioning/custom_part_dialogs.ycp  PartitionsPackage"partitioning/partition_defines.ycp kmgt_str_to_byte notUsedMountpoints   PartedSizeToClySingleMountPointProposal &partitioning/custom_part_helptexts.ycp GetCreateCryptFsHelptext GetUpdateCryptFsHelptext getEditOrCreateHelptext getCreateEditExtendedHelptext getMainHelptext  getMainHelptextS390 ! ia64_gpt_text ",partitioning/custom_part_check_generated.ycp #Product$ AutoinstData%check_created_partition_table &check_devices_used 'check_device_edit(check_device_delete)check_extended_delete*check_unique_label +CheckFstabOptions,DlgCreateCryptFs  -QueryProposalPassword.DlgUpdateCryptFs   / DoInputChecks  0FileSystemOptions  1PopupNoSlashLabel 2 FstabOptions   3FileSystemsComboBox  4 CryptButton 5 FsidComboBox  6 FormatDlg  7ChangeExistingSymbolsState 8MountDlg 9&UseChangedPartitionContinueCancelPopup:#ModifyPartitionInSystemWarningPopup  ;FsysCannotShrinkPopup<FsysCannotGrowPopup=FsysCannotResizeMountPopup  >FsysShrinkReiserWarning?FstabAddDialog@ReallyInstPrepdisk AdeleteAllDevPartitions Bpossible_root_fsCselectedRootPartition DpreviousRootPartition ErootPartitions FnumberOfValidRootPartitionsGshowAllPartitionsHdidSearchForRootPartitionsItargetOkJdid_try_mount_partitionsKalready_checked_jfs_partitions Lnon_modular_fs M activated  NMountedOsdb PGetInfoOfSelected  QSetSelectedToValid RAddToTargetMap SRemoveFromTargetMap TUnmountPartitions UAddMountedPartition   V FSCKPartition  WAnyQuestionAnyButtonsDetails     X RunFSCKonJFS   YMountPartition    Z FsckAndMount    [check_root_device  \FindPartitionInFstab  ]backward_translation  ^update_mount_options  _TranslateFsOrCryptoTab  ` readFsTab a readCryptoTab bFstabHasSeparateVarc%FstabUsesKernelDeviceNameForHarddisksdMountVarIfRequired  eread_fstab_and_cryptotab fPrepareCryptoTabg IsMounted h CheckBootSize i MountFSTab jMountVarPartition  kMountUserDefinedVarPartitionlMountPartitions mSetFormatPartitionsn GetArchOfELF  oIncompleteInstallationDetected pCheckPartitionqFindRootPartitions r GetDistroArch s mount_targettDetect uPropose """#"""$"BB%CC(DD+EE/FF2GG5HH8II;JJ>NNWPPgwhat QQTTkeep_in_targetWW,headline question  button_yes  button_no details llYroot_device_current mm fstabpartoo mounted_to qqrrss ttuu/ force_reset3UI UserInput OpenDialog   CloseDialog ChangeWidget   QueryWidget   ReplaceWidget  SetFocus  WidgetExists 3WFM SCRGetDefaultcall Execute3SCRReadExecute RegisterAgent UnregisterAgent3UI UserInput OpenDialog   CloseDialog ChangeWidget   QueryWidget   ReplaceWidget  SetFocus  WidgetExists 0update3 Directoryybindir logdir 3Modenormal autoupgradeconfigtest3Linuxrcmanual3Storage GetDeviceName  GetOndiskTarget IsKernelDeviceName  GetTargetMap GetDiskPartition  GetPartition    DeleteDevice   GetMountBy  RemoveDmMapsTo   SetTargetMap   DeviceMounted  Umount CanEdit CanDeletemountedPartitionsOnDisk  ChangeText SetPartitionData    DeviceRealDisk PerformLosetupDetectFs  GetTranslatedDevices  ProposalPassword SetProposalPassword  DeviceMatchFstab  CheckEncryptionPasswords  3PopupError  ContinueCancelHeadline  ContinueCancel YesNo  AnyQuestion3       Message  Warning   TimedWarning  3 ModuleLoadingLoad     3 FileSystemsnchars SuggestMPoints GetGeneralFstabOptions GetArbitraryOptionField GetFstabOptWidgets  GetMountString    MountUuid  MountLabel  LabelLength  IsSystemMp RemoveCryptOpts   CanDoQuotaHasQuotaRemoveQuotaOpts   AddQuotaOpts  3UpdateGetProductName3 SuSEReleaseReleaseInformation  3 FileUtilsExists 3Arch board_iseriessparc32sparc board_preps390ia64 board_mac board_chrp3StringQuote   FormatSize 3 Installationdestdir mountlog run_yast_at_boot installedVersion  updateVersion 3ReportError  3LabelContinueButton  CancelButton  YesButton NoButton  FinishButton OKButton  HelpButton  WarningMsg 3Stageinitial3 Wizard SetContents    1"$partitioning/custom_part_dialogs.ycp0storage3 Partitions  fsid_swapfsid_prep_chrp_boot no_fsid_menuEfiBoot DefaultFs  BootMount BootCylPrepBoot ToHexString  FsIdToString 3Package InstallAll 1""partitioning/partition_defines.ycp0!storage%-input ""numberpos""$/$0  findfirstnotof   +(2&&43""&4   substring  (7 size     filterchars   0123456789kKmMgGtTbBoO . size 48""-9&<    filterchars   0123456789kKmMgGtTbBoO.(>&& size   findfirstnotof   0123456789.4? last_char  number_str ""$A   substring  - size (C||||||bBoO4E""&F   substring  - size &H   substring  - size $K   substring  - size (M  findfirstnotof   0123456789.4N""(O||kK4P""&Q tointeger*tofloat1024.(S||mM4T""&U tointeger**tofloat1024.1024.(W||gG4X""&Y tointeger***tofloat1024.1024.1024.(\||tT4]""&^ tointeger****tofloat1024.1024.1024.1024.4b""&c4g""&h(k size 4l""&m4p""&q tointeger-s% targetMap all_mountpoints "" mountpointsnot_used_mountpoints ""(|| 4""& $  maplistdevdevmap""    maplistpart""  partitions  mount&flatten&union $   filtermnt "" !contains-% win_size_fcyl_size"" new_length_f new_length_i""$/tofloat$ tointeger,   y2debug   'new_length_f: <%1> - new_length_i: <%2>(tofloattofloat4""&+-%""(-4 free_list""$ - 2$partitioning/custom_part_dialogs.ycp1#&partitioning/custom_part_helptexts.ycp0storage%minpwlenformattmpcrypt#"helptext #"$!(#4$#"&&*

Create an encrypted file system.

storage4,#"&.*

Access an encrypted file system.

storage&5+   

Keep in mind that this file system is only protected when it is not mounted. Once it is mounted, it is as secure as every other Linux file system.

storage(=4>#"(?4@#"&A+   !

This mount point corresponds to a temporary filesystem like /tmp or /var/tmp. You may leave the crypt password empty. If you do this, the system will create a random password at system startup for you. This means, you will lose all data on these filesystems at system shutdown.

storage&J+   

If you forget your password, you will lose access to the data on your file system. Choose your password carefully. A combination of letters and numbers is recommended. To ensure the password was entered correctly, enter it twice.

storage&S+      sformat   

You must distinguish between uppercase and lowercase. A password should have at least %1 characters and, as a rule, not contain any special characters (e.g., letters with accents or umlauts).

storage&[+      sformat   

Possible characters are %1, blanks, uppercase and lowercase letters (A-Za-Z), and digits 0 to 9.

storage"#*,.;:._-+!$%&/|?{[()]}^\<>!&d+   %

Do not forget this password!

storage-h%lhelptext #"$o7

You will need to enter your crypt fs password.

storage&t+   

If the encrypted file system does not contain any system file and therefore is not needed for the update, you may select Skip. In this case, the file system is not accessed during update.

storage-{%new_val edit_format#" helptextCR #"$(4#"&l

On already-existing partitions, you can change everything except the start and size of the partition.

storage4#"&^

First, choose the type of the partition and whether this partition should be formatted.

storage&+   @

Then, enter the mount point ( /, /boot, /usr, /var, etc.)

storage(!create4#"&+   

To change the start or end cylinder, delete this partition then create a new one with the new parameters. All data on this partition will be lost.

storage4#"&+   G

Now, enter the location of the new partition on your hard disk.

storage&+   C

Please enter the starting cylinder number of the partition.

storage&+   m

After that, either specify an ending cylinder number or an offset from the first cylinder (e.g., +66).

storage&+   b

It is also possible to specify the size of the partition directly (e.g., +100M or +20000K).

storage-% helptextCR #"$

Enter the starting cylinder number of the partition. After that, either specify an ending cylinder number or an offset from the first cylinder (e.g., +66). It is also possible to specify the size of the partition directly (e.g., +2G, +100M, or +20000K).

storage-% installation#" help_text #"$&%

Partition your hard disks...

storage&+   

This is intended for experts. If you are not familiar with the concepts of hard disk partitions and how to use them, you might want to go back and select automatic partitioning.

storage(4#"&+   

Please note that nothing will be written to your hard disk until you confirm the entire installation in the last installation dialog. Until that point, you can safely abort the installation.

storage4#"&+   

Nothing will be written to your hard disk until you confirm all your changes with the "Apply" button. Until that point, you can safely abort.

storage&+   

For LVM setup, using a non-LVM boot partition is necessary. Other than the boot partition, you should have partitions managed by LVM.

storage&+   U

The table to the right shows the current partitions on all your hard disks.

storage&+   +   +   +   2

Hard disks are designated like this

storageX/dev/sda 1st disk
/dev/sdb 2nd disk
/dev/sdc 3rd diskstorage

etc.

storage8

This notation always refers to the entire disk.

storage&+   4

Partitions are designated like this:

storage&+   +   +   +   @

/dev/sda1 1st primary partition on the 1st disk.

storage@

/dev/sda2 2nd primary partition on the 1st disk.

storage

...



/dev/sda5 1st logical partition within the extended partition on the first disk. Note: this is always #5, even if there are less than four primary partitions.

storage&+   +   /

/dev/sda6 2nd logical partition

storage

...

&+   

On the i386 platform (i.e., normal PCs), there cannot be more than four primary partitions on any hard disk, because the respective table in the master boot record cannot contain more than four entries.

storage&+   x

Older PCs may have a BIOS limitation that restricts bootable partitions to cylinders below 1024.

storage& +    

If you have an older PC and want to boot from a partition, make sure it ends below this 1024 cylinder boundary. Create a separate partition and mount it as /boot, if necessary. A partition consisting of one single cylinder (at least 64 MB) is usually sufficient for that.

storage&+   

One of the four primary partitions may be an extended partition. This extended partition can contain one or more logical partitions.

storage&+   

The extended partition itself cannot hold any data. To use its space, create logical partitions. These logical partitions may contain any kind of Linux partition (Linux file systems or Linux swap partition) or partitions for other operating systems.

storage&!+   

In connection with advanced boot managers such as GRUB, you can even boot your computer from a logical partition.

storage&&+   

The extended partition will overlap with the logical partitions: for an extended partition from cylinder 200 to 500, logical partitions could range from, for example, 200 to 250, 251 to 400, and 401 to 500.

storage&-+   

An asterisk (*) after the mount point indicates a file system that is currently not mounted (for example, because it has the noauto option set in /etc/fstab).

storage&3+   

The column labeled F contains flags. C means the partition is encrypted. F means the partition is selected to be formatted.

storage&9+   

Used By tells if a device is used by LVM or RAID. If you do not use such things, it is perfectly normal for this column to be empty.

storage&?+   

Mount By indicates how the file system is mounted: (K) by Kernel Name, (L) by Label, (U) by UUID, (I) by Device ID, and (P) by Device Path.

storage-G%J  help_text #"$L&O\

For a root file system on SCSI disks, add a /boot partition on DASD to use for IPL.

storage&U+   

The table to the right shows the current partitions on all your hard disks. Nothing will be written to your hard disk until you confirm the entire installation in the last installation dialog. Until that point, you can safely abort the installation.

storage&\+   

Hard disks are designated like this:

/dev/dasda First DASD disk /dev/dasdb Second DASD disk /dev/dasdc Third DASD disk

- or -

/dev/sda First SCSI disk /dev/sdb Second SCSI disk /dev/sdc Third SCSI disk

storage&g+   7

This notation always refers to the entire disk.

storage&k+   

If a DASD disk is selected for low level formatting with the dasdfmt command, an X appears in the third column of the line corresponding to the disk.

storage&s+   ,

Partitions are designated like this:

/dev/dasda1 First partition on the first DASD disk.

/dev/dasda2 Second partition on the first DASD disk.

/dev/dasda3 Third partition on the first DASD disk.

/dev/sda1, etc., for SCSI.

storage-{%~!#"-VWarning: With your current setup, your installation will encounter problems when booting, because the disk you have your /boot partition on does not contain a GPT disk label. It will probably not be possible to boot such a setup. If you need to use this disk for installation, you should destroy the disk label in the expert partitioner.storage2$partitioning/custom_part_dialogs.ycp1$,partitioning/custom_part_check_generated.ycp3Productname 3 AutoinstDataBootCylWarningBootRaidWarningBootLVMWarning1!&partitioning/custom_part_helptexts.ycp0#storage%0% targetMap  installation"$"show_all_popupsdiskless"partition_mounted_but_not_formated have_swapretval sparc_first_is_swapsparc_first_dev  swap_found boot_found  root_found  gpt_warning  gpt_boot_ia64 boot_end root_end root_raid boot_raidroot_lvmroot_fs boot_fs  boot_size_kboot_size_checkroot_cyl_for_gbboot_cyl_for_gbfat_system_mountfat_system_boot dmraid_root raid_type "$"/,2    y2milestone   1now checking generated target map installation:%1$4$6$8$9$:next$;$<$=$>$? $@ $A $B $C $D$E$F$Gunknown$Hunknown$I$J!||||||$K$L$M$N$O$P,R    foreachdisk diskinfo"$"   part_infocyl_size"$"$T partitions $Ucyl_size@B(W  contains CT_DISK CT_DMRAIDCT_DMMULTIPATH CT_MDPART type CT_UNKNOWN&X,Z  foreachpart"$" fsid mountpoint "$"$\fsid$] mount(c/4d"$" (e labelgpt4f"$"&g &i &j type CT_UNKNOWN CT_DMRAID&k -+regionregion(l!  contains primarylogical typeunknown4m"$"&o &q used_fsunknown&r/@cyl_size@B(t typeunknownsw_raid&t(u!&u  raid_type(v typeunknownlvm&v(x4y"$"(z labelgpt4{"$"&| (~&&|| labelgptgpt4"$"& &( type CT_UNKNOWNCT_DISK4"$"& -+regionregion&/@cyl_size@B4"$"& && used_fsunknown&size_k( typeunknownsw_raid&&  raid_type(4"$"(&&||4"$"&& -+regionregion& used_fsunknown&/@cyl_size@B&size_k(&& used_fsunknownhfs4"$"&& -+regionregion& used_fsunknown&/@cyl_size@B&size_k(swap4"$"&(&&&& typeunknownprimarynr4"$"&&(&& used_fsunknownvfatformat4"$"(&&!  contains /usr//home/var/opt4"$"&(&&&&!|| used_fsunknownvfatformat4"$"(&&!/boot4"$"&(&&&&!format used_fsunknownnfs  mount4"$"&,    y2milestone    diskless:%1,    y2milestone   root_found:%1 boot_found %2 ,    y2milestone   5dmraid_root:%1 root_raid %2 boot_raid %3 raid_type:%4(||&&&&! 4ret"$"$    sformat   The disk label type on your system disk is GPT. Linux can handle a GPT partition table fine, but most BIOS versions cannot handle this disk label. To remove the GPT disk label from a disk, use the menu entry "%1" of the "%2" button. Change your partitioning? storage    deletechars   Create New Partition Tablestorage&    deletechars   Expert..storage&(&again(||&&! 4"$", Z YaST2 needs a root partition to install. Assign the root mount point "/" to a partition. storage&again(||4"$", You tried to mount a fat partition to one of the following mount points: / /usr /home /opt /var. Use a Linux file system, such as ext3 or reiserfs, for these mount points. storage& again(||4"$", You tried to mount a fat partition to the mount point /boot. Use a Linux file system, such as ext2, ext3 or reiserfs, for this mount point. storage&again(||&&4"$"(|| 4ret"$"$    sformat   Warning: Your boot partition ends above cylinder %1. Your BIOS does not seem able to boot partitions above cylinder %1. With the current setup, your %2 installation might not be directly bootable. Change this? storage((&(again(-||&& 4.ret"$"$0    sformat   Warning: With the current setup, your %1 installation might not be directly bootable. Some PROM versions have problems with a boot partition with an end cylinder above 1 GB. Change this? storage(:&:again(>||&&* 4?ret"$"$A zWarning: Your boot partition is less than 12MB. It is recommended to increase the size of /boot. Do you want to do this? storage(H&Hagain(N||&&!4O"$"(S||&&&&!!4Tret"$"$X Warning: There is no partition mounted as /boot. To boot from your hard disk, a small /boot partition (approx. 4MB) is required. Consider creating one. (Partitions assigned to /boot will automatically be changed to type 0x41 PReP/CHRP). Do you want to change your setup? storage(a&aagain(g&&|| 4hret"$"$j    sformat   8Warning: According to your setup, you intend to boot your machine from the root partition (/), which, unfortunately, has an end cylinder above %1. Your BIOS does not seem capable of booting partitions beyond the %1 cylinder boundary, which means your %2 installation will not be directly bootable. Change this? storage(t&tagain(w||&& 4xret"$"$z    sformat   Warning: With your current setup, your %1 installation might not be directly bootable, because some PROM versions have problems with a boot partition ending above the 1 GB boundary. Change this? storage(&again(||&&ext24ret"$"$    sformat   Warning: With your current setup, your %1 installation might not be directly bootable, because some PROM versions have problems with a boot partition ending above the 1 GB boundary. Change this? storage(&again(&&&&&&!||&&||&&!raid14ret"$"$    sformat   Warning: With your current setup, your %1 installation might not be directly bootable, because your files below "/boot" are on a software RAID device. The boot loader setup sometimes fails in this configuration. Change this? storage(&again(&&&&&&!||&&!4ret"$"$    sformat   <Warning: With your current setup, your %1 installation will encounter problems when booting, because you have no "boot" partition and your "root" partition is an LVM logical volume. This does not work. If you do not know exactly what you are doing, use a normal partition for your files below /boot. Change this? storage(&again(||&&&&||||!vfat4ret"$"$    sformat   >Warning: With your current setup, your %2 installation will encounter problems when booting, because you have no FAT partition mounted onto %1. This will give severe problems with the normal boot setup. If you do not know exactly what you are doing, use a normal FAT partition for your files below %1. Change this? storage(&again(||&&!4ret"$"$    sformat   KWarning: With your current setup, your installation will probably encounter problems when booting, because you have no separate %1 partition on your RAID disk. This will give severe problems with the normal boot setup. If you do not know exactly what you are doing, use a normal partition for your files below %1. Change this? storage(&again(||&&&&&&|| 4ret"$"$ +   +   !  Change this?storage(&again(||&&&&!nfs4ret"$"$  You have not assigned a swap partition. There is nothing wrong with that, but in most cases it is highly recommended to create and assign a swap partition. Swap partitions on your system are listed in the main window with the type "Linux Swap". An assigned swap partition has the mount point "swap". You can assign more than one swap partition, if desired. Do you want to change this? storage(&again(||4"$",    sformat    Your swap partition is the first partition of %1. It is strongly recommended to change this, because the disk label will be deleted. storage&again( ||&&4 message ret"$"$ +   +   +    WARNING: You chose to install onto an existing partition that will not be formatted. YaST2 cannot guarantee your installation will succeed, particularly in any of the following cases: storage- if this is an existing ReiserFS partition - if this partition already contains a Linux distribution that will be overwritten - if this partition does not yet contain a file system storageIf in doubt, you might want to go back and mark this partition for formatting, especially if it is assigned to one of the standard mount points like /, /boot, /usr, /opt, or /var. storagegIf you decide to format the partition, all data on it will be lost. Do you want to change your setup? storage$$ (&&&again-)next%-& partitionsnot_cr"$"ret pl"$"$/UB_NONE$0filterp"$"   used_by_typeUB_NONEUB_NONE(2&&size43tg ppl"$"$4$5 ,6  foreachp"$" "$"(8||  used_by_typeUB_NONEUB_MD  used_by_typeUB_NONEUB_DM4:dev pa"$"$; used_by(<&&  used_by_typeUB_NONEUB_MD  search  /dev/&>+   /dev/(?&&  used_by_typeUB_NONEUB_DM  search   /dev/mapper/&A+    /dev/mapper/$B(C||size!create&Dadd(F  used_by_typeUB_NONEUB_LVM4G"$"(H!+   /dev/ used_bycreate&Iadd&L(Nsize&O  used_by_typeUB_NONE-P%U' curr_part bsd_label"$"used ret"$"([&&&& typeunknownprimarynr4]"$",_ +Partition 3 "Entire Disk" is not changeablestorage-`$c&(eUB_MD4f"$",h    sformat   YThe selected device belongs to the RAID (%1). Remove it from the RAID before editing it. storage used_by-k(mUB_LVM4n"$",p    sformat   gThe selected device belongs to a volume group (%1). Remove it from the volume group before editing it. storage used_by(tUB_NONE4u"$",w    sformat   QThe selected device is used by volume (%1). Remove the volume before editing it. storage used_by${UB_NONE(|&}-~%( curr_part bsd_label installationdisk"$" part_name used ret"$" $ device(4"$"(&&&& typeunknownprimarynr4"$", +Partition 3 "Entire Disk" is not changeablestorage-$&(UB_NONE4"$"(UB_LVM4"$",    sformat   dThe device (%2) belongs to a volume group (%1). Remove it from the volume group before deleting it. storage used_by(UB_MD4"$",    sformat   VThe device (%2) belongs to the RAID (%1). Remove it from the RAID before deleting it. storage used_by4"$",    sformat   =The device (%2) is used by %1. Remove %1 before deleting it. storage used_by-(!4mounts "$"$(4message "$"$   sformat   The selected device is currently mounted on %1. It is *strongly* recommended to unmount it manually before deleting it. Click Cancel unless you know exactly what you are doing. If you proceed, YaST2 will try unmounting before deleting it. storage(! 4"$"-4ret "$"$none*"$"(!4"$"&   sformat   0Unmount of %1 failed. Remove the device anyway? storage&  &Retry umountstorage focus_yesretry(no-(&&! typeunknownlogical4okppl"$"$$filterp"$"  partitions nrnr(&&size&UB_NONE&(&&&&!size4i"$"$)&&size4"$"( size  device&&+(!4"$",    sformat   The device (%1) cannot be removed Since it is a logical partition and another logical partition with higher number is in use. storage-$UB_NONE(&-%) curr_disk installation"$" partitionsdel_dev  logical_partslogical_parts_namesused ret"$"$ partitions $ device$ filterpart"$"  typeprimarylogical,     y2milestone   &check_extended_delete logical_parts %1$  &  maplistp"$"  device,    y2milestone   ,check_extended_delete logical_parts_names %1( -(!4mounts"$"$,    y2milestone   check_extended_delete mounts:%1&filtermount"$" contains device,    y2milestone   check_extended_delete mounts:%1(size4 mounted_parts message "$"$#,$  foreachmount"$" "$"&'+   +      sformat    %1 --> %2 device mount $-   sformat   The selected extended partition contains partitions which are currently mounted: %1 It is *strongly* recommended to unmount these partitions before you delete the extended partition. Please choose Cancel unless you know exactly what you are doing. storage(3! 44"$"-5$:&(<UB_LVM4="$",?  The selected extended partition contains at least one LVM partition assigned to a volume group. Remove all partitions from their respective volume groups before deleting the extended partition. storage(FUB_MD4G"$",I  The selected extended partition contains at least one partition that is part of a RAID system. Unassign the partitions from their respective RAID systems before deleting the extended partition. storage(PUB_NONE4Q"$",S  The selected extended partition contains at least one partition that is in use. Remove the used volume before deleting the extended partition. storage$YUB_NONE(Z4[extd"$"$\findp"$"  typeprimaryextended(^&&size&_-a2$partitioning/custom_part_dialogs.ycp%,,device minpwlenformattmpcrypt"helptext h label password widget " $/,0    y2milestone   <DlgCreateCryptFs device:%1 minpwlen:%2 format:%3 tmpcrypt:%4$42Enter your password for the encrypted file system.storage$6!Don't forget what you enter here!storage(748"&9+    &:+   Empty password allowed.(= size &?   sformat   (Password for Encrypted File System on %1storage,A opt decoratedHBoxHWeightRichTextHWeightVBoxVSpacing0.3HBoxHSpacingHeadingHSpacingVSpacingHBoxHSpacingVBoxLabelVSpacingHBoxPasswordidpw1'&Enter a password for your file system:storageHSpacingVSpacing0.5HBoxPasswordidpw2'Reenter the password for &verification:storageHSpacingHSpacingVSpacing ButtonBox PushButtonidokoptdefault PushButtonidcancelVSpacing0.5$p$q+s",vidpw1Value,widpw2Value,yidpw1&{ 5oktmp "& idpw1Value$ idpw2Value(!&again.||cancelok,(ok4"-4"-%-password widget "( size -,VBoxLabel0Enter your password for the proposal encryption.storageMinWidth(Passwordidpw1 Password:storageVSpacing0.5MinWidth(Passwordidpw2&Reenter the password for verification:storageLabel!Don't forget what you enter here!storage ButtonBox PushButtonidokoptdefault PushButtonidcancel$$+",idpw1Value,idpw2Value,idpw1& 5oktmp "& idpw1Value$ idpw2Value(!&again.||cancelok,(ok4",-4"-%.device mount "helptext enter ret  input_is_okpw1 pw2 " $$   sformat   7Enter your crypt password for device %1 mounted on %2. storage, opt decoratedHBoxHWeightRichTextHWeightVBoxVSpacing0.3HBoxHSpacingHeading1Enter your password for the encrypted file systemstorageHSpacingVSpacingHBoxHSpacingVBoxLabelVSpacingHBoxPasswordidpw1'&Enter a password for your file system:storageHSpacingVSpacing0.5HBoxPasswordidpw2'Reenter the password for &verification:storageHSpacingHSpacingVSpacingHBox PushButtonidokoptdefault PushButtonidcancel&SkipstorageVSpacing0.5$$$$ +"",%idpw1Value,&idpw2Value,(idpw1&* (-cancel4."&/ idpw1Value&0 idpw2Value(243",5 PThe first and the second version of the password do not match! Please try again.storage(748",: )You did not enter a password. Try again. storage(> size 4?"&@4C",E    sformat   :The password must have at least %1 characters. Try again. storage||cancel,M(Ocancel4P"-Q4T"-U%Z/entryquery "ret between valid_chars  str_length" $\ok$]between $^  valid_chars$_ str_length(a&& || size ! empty_allowed4b",c    y2milestone   !DoInputChecks entry:%1 query:"%2"(d|| tointeger&& tointeger4f",g   error_text&herror(l&&&& size error4m"(n  findfirstnotof  4o",p   error_text&qerror(u&&&& size error4v",w   error_text&xerror,z    y2milestone   DoInputChecks value %1 ret %2-{%0org_fs_options  fs_define" fs_options contents helptext iglistret ",    y2milestone   0FileSystemOptions org_fs_options:%1 fs_define:%2$$VBoxVSpacing$,  foreachoption" options  emptyterm add_help "$Empty&  add   widget$  help_text(&+   , opt decoratedVBoxHSpacing2LeftHeadingFile system options:storageVStretchVSpacingHBoxHStretchHSpacingHStretchHSpacingVSpacingVStretchHBoxLeft PushButtonidhelpopt helpButtonRightHBox PushButtonidokoptdefault PushButtonidcancel,helpHelpText,    foreach query_key option_map "  ",idValue option_value$ autononedefault$ok+"& (ok4",  foreachentry" options ",    y2milestone   FileSystemOptions entry %1(error4query fs_option "$ id query_keyValue,    y2milestone   FileSystemOptions query %1 $  option_str  option_str option_cmd  option_cmdmkfs option_value ,    y2milestone   FileSystemOptions fs_option %1 ( option_blank4"'  option_blank(&&  !contains 4"&/  (error4"(&& default!contains 4"' query_key (haskey query_key4"&  remove query_key,    y2milestone   FileSystemOptions fs_options %1||okcancel,(ok&,    y2milestone   FileSystemOptions ret %1-%1", The character '/' is no longer permitted in a volume label. Change your volume label so that it does not contain this character. storage%2old new " helptext contents  emptyterm opt_listentryfstopt opt_lstr  old_statepos arb_opt  ret"*$$VBox$Empty( enc_typenonenone4"&+   S

Mount in /etc/fstab By: Normally, a file system to mount is identified in /etc/fstab by the device name. This identification can be changed so the file system to mount is found by searching for a UUID or a volume label. Not all file systems can be mounted by UUID or a volume label. If an option is disabled, it is not possible. storage& +   

Volume Label: The name entered in this field is used as the volume label. This usually makes sense only when you activate the option for mounting by volume label. A volume label cannot contain the / character or spaces. storage&  add  VBoxRadioButtonGroupidmt_groupVBoxLeftLabelMount in /etc/fstab bystorageHBoxVBoxLeft RadioButtoniddevice &Device namestorageLeft RadioButtonidlabel Volume &labelstorageLeft RadioButtoniduuidU&UIDTopVBoxLeft RadioButtonidid Device &IDstorageLeft RadioButtonidpath Device &Pathstorage TextEntryid vol_labelopthstretch Volume &LabelstorageVSpacing$5 (6 mountswap47",8  foreachentry"  "&:add&<  add   widget&=+     help_text&?  add  VSpacing,A  foreachentry"   used_fsext2"&Cadd&D  add   widget&E+     help_text&G  add  VSpacing$H &Iadd&J  add   widget&K+     help_text$M    deletechars    fstopt (Ndefaults&O$Q    splitstring   ,$R $S,T  foreachopt" "(V typetextboolean4Wvalue"$Xdefault&Y)Zsize4[",\  foreachlist_el"  str_scan "(^   4_"&` 'a&d+'f  query_key4ivalue pos"$j default$k)lsize4m"(n&& size  str_scan   regexpmatch    str_scan4p"&q     regexpsub      str_scan\1's&u+'w  query_key&{-size)|4}"(~ size  4"&  remove&-,    y2milestone   FstabOptions key=%1 val:%2 -size query_key    mergestring   ,$     mergestring   ,(&&!noauto enc_typenonenone4"&   (&&  ' opt_quota&   ' -size query_key ,    y2milestone   FstabOptions old_state=%1, opt decoratedVBoxHSpacing2LeftHeadingFstab options:storageVStretchVSpacingHBoxHStretchHSpacingHStretchHSpacingVSpacingVStretchHBoxLeft PushButtonidhelpopt helpButtonRightHBox PushButtonidokoptdefault PushButtonidcancel,helpHelpText(-idmt_group4no_mountby_typemountby_id_path_typedefmb " $ loop$ primarylogical$! devicedevice,    y2milestone   FstabOptions defmb %1,idmt_group CurrentButton mountby,idlabelEnabled&&&&  used_fsunknown enc_typenonenone!contains typeprimary,iduuidEnabled&&&&||format size  uuid  used_fsunknown!contains typeprimary,ididEnabledcontains typenone,idpathEnabledcontains typenone(-id vol_label4",id vol_labelEnabled&&  used_fsunknown enc_typenonenone,id vol_label ValidChars+    -._:/,id vol_labelValue label,    y2milestone   FstabOptions Exists opt_user %1-idopt_user,    y2milestone   FstabOptions new=%1(-idopt_user4",idopt_userEnabled|| enc_typenonenonenoauto(-id opt_noauto4",id opt_noautoEnabled|| enc_typenonenonenoauto(-id opt_quota4",id opt_quotaEnabled ,  foreachkeyvalue"  ",idValue$ ok+"& ,    y2milestone   FstabOptions ret %1 (  opt_noauto4"(-idopt_user4val"$id opt_noautoValue,idopt_userEnabled|| enc_typenonenone( ok4 new_statetext  new_fstopt " (-idmt_group4"'mountbyidmt_group CurrentButton(&&&&!format!create mountbydevice mountbydevice4"(!haskey ori_mountby' ori_mountby mountbydevice'labelid vol_labelValue( label label4max_len"$  used_fsunknown( size  label4"'label   substring   label,    sformat   o Maximum volume label length for the selected file system is %1. Your volume label was truncated to this size. storage(   search   label/4 ", 1&  again(&&&&!format!create!haskey ori_label4"' ori_label label(&& mountbydevicelabel size  label4"& again, )Provide a volume label to mount by label.storage/(&& size  label!*4"& again, <This volume label is already in use. Select a different one.storage/ ("&& mountbydevicelabel  search   label/4$"&% again,&1/'(*-id opt_noauto4+"',noautoid opt_noautoValue$. $/$0,1  foreachentry" value"&3$4id  query_keyValue'6  query_key(7 typetextboolean48"&9 str_optdefault(:&&haskeystr_opt 4;"&< str_opt(>&&haskeystr_opt 4?"&@ str_opt4D"(E/ ok4F"&G again(I size  4J"&K   sformat    str_opt%1(N data=ordered4O"&P(S size 4T"(U size &V+   ,&W+   (Z&&-id opt_quotaid opt_quotaValue4\"&] (^&&! opt_quota4_",` quota,c    y2milestone   FstabOptions new_state=%1,d    y2milestone   (FstabOptions old_fstopt=%1 new_fstopt=%2 fstopt(f&& fstopt4g"(h&&&&!format!create!haskey ori_fstopt4j"'k ori_fstopt fstopt'mfstopt(o!+4p"'qfstopt fstopt&r again|| ok cancel,w,x    y2milestone   *FstabOptions fstopt %1 mountby:%2 label:%3 fstopt mountbydevice label-{%3new_val file_systems "fs_sel  filesystemsis_swapufs " $ $ $fsid,   y2debug   "FileSystemsComboBox new=%1 swap=%2$ used_fs,    foreachfile_system_name file_system_map"  "(&&real_fs||supports_format4"' 'text nameExt2('selectedswap'selected,    y2milestone   FileSystemsComboBox fs_sel=%1,    y2milestone   FileSystemsComboBox DefFs=%1(&&haskeysizefilterke"  selected4"'selected,    y2milestone   FileSystemsComboBox fs_sel=%1,    foreachfs_type entry"  "(swap&additemid textExt2selected(haskeyswap4"&additemidswap swaptextSwapswapselected-VBoxComboBoxidfsopthstretchnotify File &systemstorage PushButtonid fs_optionsopthstretch O&ptions...storage%4new_val"cr"(-Empty$ enc_typenonenone-VBoxLeftCheckBoxidcrypt_fsoptnotify&Encrypt devicestorage%5new_val file_systems "items  added_items added_fsidsidso val " $ $ $ ,  foreachfs_namefs_map"   fsid_item "$  fsid_item (!contains4"&   additemidfsidfsid&addfsid&add$fsid(&&!contains4part_id "$+   +    &   additemid$ 0x00x100x80x830xF$ ,    foreacht " "' ,    foreachs i"  ",    foreachmatch w"  found"$(&&!  search  4"'&&    sorta b "    -ComboBoxid fsid_pointoptnotifyeditablehstretchFile system &ID:storage%6new_val file_systems "fsid ",   y2debug   FormatDlg val:%1$Empty(&&&&&&&& typeprimarylvm typeprimarysw_raid typeprimaryevms typeprimaryloop!4 "& VBoxHBoxHSpacing ReplacePointid fsid_dlg_rp5VSpacing0.5VStretch4"&VSpacing0.5-FrameFormatstorageRadioButtonGroupidformatVBoxVSpacingLeft RadioButtonid format_falseoptnotifyDo ¬ formatstorage!formatLeft RadioButtonid format_trueoptnotify&FormatstorageformatHBoxHSpacing34VSpacing0.5%77symbolswhat"",9  foreachsym" ",:idEnabled%E8new_val mountpoints"mount dlg "(G&H//usr/var/home/opt(K&&!contains enc_typenonenone&Ladd$M mount(O!contains&Punion$RVBox PushButtonid fstab_optionsopthstretchFs&tab OptionsstorageVSpacingComboBoxid mount_pointopteditablehstretchnotify &Mount Pointstorage-\%b9"(e You have changed the parameters of a partition currently mounted. In some cases, this can damage your Linux installation. Proceed only if you know what you are doing. If you are unsure, press Cancel. storage-l-n%q:part mount "warning ret"$u   sformat   H The selected partition (%1) is currently mounted on %2. If you change parameters (such as the mount point or the file system type), your Linux installation might be damaged. Unmount the partition if possible. If you are unsure, it is recommended to abort. Do not proceed unless you know exactly what you are doing. Continue? storage$& -%;asklvm"rettxt "$$(!& The file system on the partition cannot be shrunk by YaST2. Only fat, ext2, ext3, and reiser allow shrinking of a file system.storage& The file system on the logical volume cannot be shrunk by YaST2. Only fat, ext2, ext3, and reiser allow shrinking of a file system.storage(4"&+    (!&+   2You risk losing data if you shrink this partition.storage&+   7You risk losing data if you shrink this logical volume.storage&+    &+    Continue?storage(4"& 4", &-%<asklvm"rettxt "$$(!& The file system on the selected partition cannot be extended by YaST2. Only fat, ext2, ext3, xfs, and reiser allow extending a file system.storage& The file system on the selected logical volume cannot be extended by YaST2. Only fat, ext2, ext3, xfs, and reiser allow extending a file system.storage(4"&+    &+   Continue resizing?storage(4"& 4", &-%=lvmmount "txt "$   sformat    The file system is currently mounted on %1. It is not possible to resize the file system while it is mounted. Unmount the file system and retry resizing. storage, %>lvm"rettxt "$$(!&:You decreased a partition with a reiser file system on it.storage&?You decreased a logical volume with a reiser file system on it.storage&+    &+    It is possible to shrink a reiser file system, but this feature is not very thoroughly tested. A backup of your data is recommended. Shrink the file system now?storage& -%? table_input"header  help_text  userinput idxret" ,    y2milestone   FstabAddDialog start %1(|| 4", 2No previous system with mount points was detected.storage-$header Device storage Mount storage$ +   +   

Attention:
YaST2 has scanned your hard disks and found an old Linux system with mount points. On the right, see a list with the mount points found.

storage7

To use these mount points,
press Yes.

storage:

To ignore these mount points,
press No.

storage, opt decoratedHBoxVBoxHSpacingRichTextVBoxVSpacing ReplacePointidheadingEmptyHBoxHSpacing3.VSpacingVBoxVSpacingTableidtable HSpacing3.VSpacingHeadingCWould you like to use these mount points for your new installation?storageVSpacing ReplacePointidbboxEmpty$)none$*++tmp bbox " $.   sformat   VA previous system with the following mount points was detected: /etc/fstab found on %1storage root /dev/emil,1idheadingHeading,3idtableItemstbl $5HBox PushButtonidokoptdefault PushButtonidcancel(9size4:"&;  add  HSpacing(<4="&>  add   PushButtonidshow_pShow &Previousstorage(A-size4B"&C  add   PushButtonidshow_n Show &Nextstorage,G    y2milestone   userinput UI::ReplaceWidget,Hidbbox,I    y2milestone   after UI::ReplaceWidget&K ,L    y2milestone    userinput %1(Nshow_n4O"&P+(Rshow_p4S"&T-,V    y2milestone   idx %1||okcancel,Y$[ok,\    y2milestone   ret %1-]%b@ret doto "$dnone$f,g    y2milestone   ReallyInstPrepdisk doto:%1(i size 4j",l No unsaved changes exist.storage&mback4pdlg "$qVBoxVSpacingHSpacing<LeftHeadingChanges:storageRichText,w opt decorated warncolorHBoxHSpacingVBoxVSpacingHeading- Do you really want to execute these changes?storageVSpacingHBox PushButtonidbackHStretch PushButtonidapply&Applystorage PushButtonidfinishVSpacing0.2HSpacing& ,,    y2milestone   ReallyInstPrepdisk ret=%1-%Adisk  installation bsd_label"go_ondel_dev "$$ device,    y2milestone   deleteAllDevPartitions disk:%1   remove partitions(!4mounts"$(size4 mounted_parts message "$,  foreachmount" "&+   +      sformat   %1 on %2 device mount $   sformat   The selected device contains partitions that are currently mounted: %1 It is *strongly* recommended to unmount these partitions before deleting the partition table. Choose Cancel unless you know exactly what you are doing. storage(! 4"&(4 partitionsused "$ partitions $&&UB_NONE(UB_LVM4",  The selected device contains at least one LVM partition assigned to a volume group. Remove all partitions from their respective volume groups before deleting the device. storage(UB_MD4",  The selected device contains at least one partition that is part of a RAID system. Unassign the partitions from their respective RAID systems before deleting the device. storage(UB_NONE4",  The selected device contains at least one partition that is used by another volume. Delete the volume using it before deleting the device. storage(&& type CT_UNKNONW CT_DMRAID4dp"$filterpart" nr max_primary,    y2milestone   deleteAllDevPartitions dp:%1&sortab"  nrnr,    y2milestone   deleteAllDevPartitions dp:%1,  foreachpart" "&&& device,    y2milestone   deleteAllDevPartitions ret:%1-2 RootPart.ycp$%B ext2ext3reiserxfsjfs$(C$+D$/E $2F$5G$8H$;I$>J$@K $BL procsysfs$UM %WN-XsizeM$_O   sformat   FSee the SDB article at %1 for details about how to solve this problem.updateThttp://support.novell.com/techcenter/sdb/en/2003/03/fhassel_update_not_possible.html%gPi$iEC (kname4k(m 4m-n (qcontainsB fsnil4q-sUnknown Linux Systemupdate4v-xNon-Linux Systemupdate4z-|Unknownupdate%Q&C,    foreachp i  E(&&validC&C%R target_map tmp$,    y2milestone   On disk target map: %1$filtere M typemount,  foreache ,    y2milestone   2Setting partition data: Device: %1, MountPoint: %2 device mntpt& devicemount mntpt(   issubstring   device/dev/disk/by-id& devicemountbyid(   issubstring   device/dev/& devicemountbydevice& devicemountbylabel&filtere M typeswap,  foreache ,    y2milestone   'Setting swap partition data: Device: %1 device& devicemountswap(   issubstring   device/dev/disk/by-id& devicemountbyid(   issubstring   device/dev/& devicemountbydevice& devicemountbylabel,    y2milestone   Setting target map: %1,%S target_map tmp$$filtere M typemount,  foreache & devicemount,%T,    y2milestone   UnmountPartitions: %1&J,  foreachinfo Mtype ,    y2milestone    Unmounting %1$ type(4(mount4file $+    mntpt(! SCR::Execute.target.umount4,   sformat   Cannot unmount partition %1. It is currently in use. If the partition stays mounted, the data may be lost. Unmount the partition manually or restart your computer. update(swap4device $ device( SCR::Execute .target.bash+   /sbin/swapoff 4,   y2error   Cannot deactivate swap %1(crypt4dmname $ device&+   cr_   substring  +   findlastof  /( WFM::Execute .local.bash+   cryptsetup remove 4,   y2error   Cannot remove dm device %1(!,S&M %Upartinfo  & M      prependM,    y2debug   adding %1 yields %2M%V partition (!4 detected_fs $(ext24out $   sformat   Checking partition %1update, opt decoratedLabel,    y2milestone   command: /sbin/e2fsck -y %1, SCR::Execute .target.bash+   /sbin/e2fsck -y , %,W has_details has_headingheading  popup_def details_checkbox  popup_buttons  userinputret$/(0||&0$2(3||&3$5VBoxLeftHeadingEmpty$=LeftLabel$?VBoxVSpacingLeftCheckBoxiddetailsoptnotify Show &DetailsupdateEmpty$HVBoxVSpacingHBoxHSpacing PushButtonidyesVSpacing PushButtonidcancelHSpacingVSpacing0.5,T opt decoratedVSquashVBoxLeftopthstretch ReplacePointid rp_detailsEmpty,_idyes$a$b)d4d&e(gyes4g&h.i(jdetails4j curr_status$kiddetailsValue(m4m,nid rp_detailsEmpty4o,pid rp_detailsMinSize< RichTextid details_textopt plainTexthstretch4{&|.},-%X mount_type device  error_message (&&jfs4cmd(  containsK4,    y2milestone   %Device %1 has been already checked...-,Label   sformat   Checking file system on %1...update,    y2milestone   Running fsck on %1$ SCR::Execute.target.bash_output   sformat   fsck.jfs -n %1,(exit4details ,   y2error    Result: %1& tostring stderr$( stdout4&+    stdout( stderr4&+   +     stderr-WFile System Check Failedupdate   sformat   fThe file system check of device %1 has failed. Would you like to continue in the mounting the device?update&Skip Mountingupdate4&K   addK,    y2milestone    Result: %1--%Y mount_point device  mount_type  error_message ret(& (4,    y2warning   (Unknown filesystem, skipping modprobe...(!  containsL4,    y2milestone   Calling 'modprobe %1', SCR::Execute.target.modprobe4,    y2milestone   /FS type %1 is not modular, skipping modprobe...$(!X 4-(&+   -t $ SCR::Execute .target.mount+   (--  SCR::Read.target.string%Z mount_point device  mount_type ret ,V$Y(,Utypemountdevicemntpt,     y2milestone   mounting (%1, %2, %3) yield %4+   - %[ partition fstabfound_partition tmproot$filterentry  file/(size4,   y2error   -not exactly one root partition found in fstab&none-$  ("! spec4#-&-D%M\fstab mountpoint tmp(N   substring  - size /&O   substring  - size $Qfilterentry || file file+   /(Vsize-W-Y spec$^] %`^options (a   regexpmatch  ^(.*,)?hotplug(,.*)?$-b     regexpsub    ^(.*,)?hotplug(,.*)?$ \1nofail\2-c%q_ translatekey_to_translate key_preserve_as  check_command cmd old_names  new_names i $s   sformat   $/usr/bin/find '%1/var/lib/hardware/'$t SCR::Execute.target.bash_output(vexit4vfiles  files_count$w    splitstring    stdout $xsize(y||4y,z   y2error   HThere are only %1 files in /var/lib/hardware/, translation needn't work!4{,|    y2milestone   (There are %1 files in /var/lib/hardware/$ ,  foreachm &   add $$)size4 default_val new_val $ $ ''']'mntops^ mntops&+,    y2milestone   !Current backward translations: %1]-%`fstab fstab_file $+    /etc/fstab(4, SCR::RegisterAgent .target.etc.fstab ag_anyagent DescriptionFile# ListTuple specString^  Separator fileString^  Separator vfstypeString^  Separator mntopsString^ Optional WhitespaceOptionalfreqNumberOptional WhitespaceOptionalpassnoNumberOptional WhitespaceOptionalthe_restString^  & SCR::Read.target.etc.fstab,SCR::UnregisterAgent.target.etc.fstab4,   y2error   !No such file %1. Not using fstab.%acrtab crtab_file $+   /etc/cryptotab(4, SCR::RegisterAgent .target.etc.cryptotab ag_anyagent DescriptionFile# ListTuple loopString^  Separator fileString^  Separator mountString^  Separator vfstypeString^  Separator opt1String^  Separator opt2String^ Optional WhitespaceOptionalthe_restString^  & SCR::Read.target.etc.cryptotab,SCR::UnregisterAgent.target.etc.cryptotab4,    y2milestone   %No such file %1. Not using cryptotab.%bfstabvar_device_fstab $\ /var,    y2milestone   /var partition is %1-%cfstab-findline spec $ specerror(   regexpmatch  ^/dev/sd[a-z]+[0-9]+$- (    regexpmatch  ^/dev/hd[a-z]+[0-9]+$- (    regexpmatch  ^/dev/dasd[a-z]+[0-9]+$- -%efstabcrtabroot_device_current  default_scrnew_scrfstab_has_separate_var$WFM::SCRGetDefault$&] (!4",#` ,$a 4'&( SCR::Read .etc.fstab&) SCR::Read.etc.cryptotab,, $.b (040,1    y2warning   Separate /var partition!,2d43,4    y2milestone    No separate /var partition found,7    y2milestone    fstab: %1&8_specspec_old,9    y2milestone   fstab: (translated) %1,;    y2milestone    crtab: %1&<_filefile_old,=    y2milestone   crtab: (translated) %1(@4@,A SCR::Execute.target.umount+   /var-D%Kfcrtabfstabcrypt_nb$M,O  foreachmounts vfstype mntops loop fspath device $Q vfstype$R opt2$S loop$T mount$U file,W    y2milestone   0vfstype:%1 mntops:%2 loop:%3 fspath:%4 device:%5(Z!   issubstring  noauto4[again$\)]4^crypt_ok crypt_passwd $_$`.(b||4c&d&e,h    y2milestone   crypt pwd ok:%1(j4ksetloop$l  encryptiontwofishpasswdloop_dev partitionName&q  ,r    y2milestone    crypt ok: %1(s&t  loop_dev4v&x Incorrect password. Try again?update(|4}add_fs$~ filemntopsspecfreqpassnovfstype&prepend ,Utypecryptdevice&-%g mountpoint ret(   substring  - size /&   substring  - size $,  foreache M(&& typemount|| mntpt mntpt+   /4&-%hbootpart min_suggested_bootsizebootsizecmd  bootsizeout $(4& $$   sformat   X/bin/df --portability --no-sync -k '%1/boot' | grep -v '^Filesystem' | sed 's/[ ]\+/ /g'$ SCR::Execute.target.bash_output(exit4,   y2error   Error: '%1' -> %24 scriptout $    splitstring    stdout ,    y2milestone    Scriptout: %1& tointeger0 (||4,   y2error   !Cannot find out bootpart size: %1-,    y2milestone   %Boot size is: %1 recommended min.: %2(4-4 current_bs suggested_bscont$/$/$ Warningupdate   sformat   Your /boot partition is too small (%1 MB). We recommend a size not less than %2 MB. It might happen, that the new Kernel does not fit, so it would be safer to either enlarge that partition or not to use the /boot partition at all. Would you like to continue updating the current system?update(4,    y2warning   8User decided to continue despite small a /boot partition-4,    y2milestone   7User decided not to continue with small /boot partition-%ifstabmessage  allowed_fsret success raidMounted$  extext2ext3minixreiserfsjfsxfsxiafshpfsvfatautoproc$Y/syssysfssysfs(,U devicesysfsmntpt/systypemount$$,  foreachmounts vfstype mntops spec fspath $ vfstype$ mntops$ spec$ file(&&&&&&contains/||/var!g/var!   issubstring  noauto4,    y2milestone   mounting %1 to %2( !4  mount_type  mount_err $ ( proc4 &$)4&Z(4act ,   y2error   "mounting %1 (type %2) on %3 failed+   ,VBoxLabel   sformat   The partition %1 could not be mounted. %2 If you are sure that the partition is not necessary for the update (it is not any system partition), click Continue. To check or fix the mount options, click Specify Mount Options. To abort update, click Cancel.updateVSpacingHBox PushButtonidcont PushButtonidcmd&Specify Mount Optionsupdate PushButtonidcancel$.! ,/(0!cancel41&2&3(5!cont46&7(9!cmd4:,;VBox Heading Mount OptionsupdateVSpacing0.6 TextEntryidmp &Mount PointupdateVSpacing0.4 TextEntryiddevice&DeviceupdateVSpacing0.4 TextEntryidfs&&File System (empty for autodetection)updateVSpacingHBox PushButtonidok PushButtonidcancel&N! (O!ok4P&Q idmpValue&R iddeviceValue&S idfsValue,U(Z||/boot/boot/4Z checkspec $[ (_] 4_&` ] (c!h 4c&d(i&&swapswap4j,k    y2milestone   mounting %1 to %2(m!4ncommand $o /sbin/swapon (p4qret_from_shell&s+   $v  SCR::Execute .target.bash(w 4x,y   y2error   swapon failed: %14|,}Utypeswapdevice-%jdevice  mount_err  err_message $Z/var$(4,   y2error   failed to mount /var&+   +   +   +      sformat   ,The /var partition %1 could not be mounted. update  O-%kmanual_mount_successfullist_of_devices  device_info  $$ $ ,    foreachdevice  description  ,  foreach partition  partitions (  detected_fsunknownswap-( typeunknownextended-(!haskeydevice-&   add device' device   sformat   File system: %1, Type: %2,
Label: %3, Size: %4,
udev IDs: %5,
udev path: %6update   substring   tostring   detected_fsunknownfstypeUnknownupdatelabelNoneupdate*size_k    mergestring   udev_id ,  udev_pathUnknownupdate&  sort,    y2milestone   Known devices: %1)4ret var_device ,VBox MarginBoxVBoxLeftHeading/Unable to find the /var partition automaticallyupdateLeftLabelYour system uses a separate /var partition which is required for the upgrade process to detect the disk-naming changes. Select the /var partition manually to continue the upgrade process.updateVSpacingLeftComboBoxid var_deviceoptnotify&Select /var Partition DeviceupdateVSpacing0.5LeftLabel Device Infoupdate MinHeightRichTextid device_infoVSpacing MarginBox ButtonBox PushButtonidokoptokButton PushButtonidcancelopt cancelButton$$ id var_deviceValue,id device_infoValue )4&& id var_deviceValue( var_device4,id device_infoValue 4.,(ok4 mount_error ,    y2milestone   Trying to mount %1 as /var$j(4,/4,    y2milestone   Manual mount (/var) successful&.4,    y2warning   4User doesn't want to enter the /var partition device. - %dfstabroot_device_current manual_var_mountvar_device_fstab tmp1root_device_fstab  root_infovar_info realdisks  other_disk var_partition_current $\ /var(4,    y2milestone   Not a separate /var...-(!!4!,"    y2milestone   )Device %1 is not a real disk, mounting...-#j('!4',(    y2milestone   2Device %1 is not a Kernel device name, mounting...-)j$,filterentry  file/$- spec(.!-/j$1$2(4 disk disk45tmp2var_partition_current $6$7 disknr-9j$< ,=    foreachs m  (?&&&@   add(Csize4D(F&&k4F-G,J   y2error   :don't know how to handle more than two disks at this point-L+   =Unable to mount /var partition with this disk configuration. updateO$O  disk $Pnr-Rj%Ylsuccessmessage ret_boolfstabcrtab,[    y2milestone   mount partitions: %1(]J-^&`J$b$e   sformat   8Partitions could not be mounted. Check the log file %1.update+   /y2log,g    y2milestone   selected partition: %1$i$k $l (o!4p&qZ/(t4u(y4y,z  WFM::call rootpart_check_keyboarddestdir,}e  (c4warning ,    y2warning   2fstab on %1 uses kernel device name for hard disks$   sformat    Some partitions in the system on %1 are mounted by kernel-device name. This is not reliable for the update since kernel-device names are unfortunately not persistent. It is strongly recommended to start the old system and change the mount-by method to any other method for all partitions.update(4,  4, (size4,   y2error   no or empty fstab found!&No fstab found.update&4tmp_msg $d(4,   y2error   failed to mount /var!&&4tmp $(![ 4,   y2error   fstab has wrong root device!&+   +   =The root partition in /etc/fstab has an invalid root device. update   sformat   0It is currently mounted as %1 but listed as %2. updateO&4,    y2milestone    cryptotab %1,f ,    y2milestone   fstab %1(!i &4,   y2error   !Could not mount root '%1' to '%2'&,    y2milestone   MountPartition (%1) = %2,    y2milestone    activated %1M(!4, ,T&J4,R-%m target_map fstabtmp$$ ,` $filtere M|| typemount typeswap,  foreache mntpt part p mount_options  $ typeswapswap mntpt$ device$ ,  foreachpp ( mount4&.$,  foreachentry ( file4& mntops.&mount&formatformat&delete&create(&& size !haskeyfstopt&fstopt(haskeyfstopt&fstopt fstopt(haskeymountby&mountby mountbydevice,-%nfilename bash_out$  SCR::Execute.target.bash_output+   +    /elf-arch ( exit- unknown-    deletechars    stdoutunknown %oret$,    foreach check_this  &   sformat   %1/%2(4,    y2milestone   *File %1 exists, installation is incomplete& .!-%%,p partitionfreshmanp_dev p_fsidp_type  p_detect_fs $.validnameunknownarchunknownlabel labelfs  detected_fsunknownfstype fstypeunknown$7 deviceerror$8fsid$9 typeprimary$:  detected_fsunknown(=containsB4>mt_map   mount_type  error_message $? ext2ext2ext3ext3jfsjfsreiserreiserfsxfsxfs$F $H(I!X 4I'Jvalid-K(O&&!  containsL,P SCR::Execute.target.modprobe,R(S SCR::Execute .target.mount-o ro4U(W SCR::Read .target.size+    /etc/fstab4Xfstabcrtabrelease  instsys_arch ,Y    y2milestone   found fstab on %1$[ $\ ,^e  &`filterp  file/(b size  spec4b,c    y2warning   Cannot find / entry in fstab %1'fvalid&& size  spec spec_old spec(ovalid4o,p    y2warning   *Device does not match fstab: '%1' vs. '%2' spec$t ,v   y2debug    release: %1(w?4w&yUnknownupdate'{name'~archn+    /bin/bash$n /bin/bash( archunknown4,    y2milestone   Architecture (%1) is valid' arch_valid(&&  contains ppcppc64 archunknown  contains ppcppc644,    y2milestone   1Architecture for partition %1 is %2, upgrading %3 archunknown' arch_valid4,    y2milestone   1Architecture for partition %1 is %2, upgrading %3 archunknown' arch_valid( arch_valid4,    y2milestone   =Architecture is not valid -> the whole partition is not valid'valid(o4,    y2milestone   8Incomplete installation detected, partition is not valid'valid,    y2milestone   )Partition is valid: %1, arch is valid: %2valid arch_valid, SCR::Execute.target.umount,    y2milestone   %1 %2-%q target_map  max_stepscounter(H-, reiserfsLinux Reiser FS, jfsLinuxJFS, xfsLinuxXFS, ext3LinuxExt3, raid0LinuxRaid 0, raid1LinuxRaid 1, raid5LinuxRaid 5,  multipathLinux Multipath, dm-modLinuxDM, SCR::Execute .target.bash/sbin/devmap_mknod.sh,  dm-snapshotLinuxDM(4,  SCR::Read .target.yast2test_target_map.ycp$,    y2milestone   target_map: %1(-idsearch_progress,idsearch_progress ProgressBarid search_pb/Evaluating root partition. One moment please...updated&E &F$,    foreachdevice  description  &+size partitions $,    foreachdevice  description  ,  foreach partition  partitions &+(-idsearch_progress,id search_pbValue/*d(&&  detected_fsunknownswap typeprimaryextended4freshman$ (& archi286labelLabelnameSuSE Linux 4.2valid&p&E   addE deviceerror(valid&F+F(-idsearch_progress,id search_pbValued&H,    y2milestone   rootPartitions: %1E%r- n /bin/bash% stmp, opt decoratedLabel)Mounting partitions. One moment please...update$lC,-%t(!H4,Update ConfigurationupdateVBox ReplacePointidsearch_progressEmpty,(q&*C,+    y2milestone   Detected root partitions: %1E%/u,0    y2milestone   Proposing root partition,1t(243&4C(7&&FC49&:I4=(>C4?,@Q07070100069FEA000081A40000018F0000018F000000014F1023BB00001A46000000080000000100000000000000000000004C00000000linux/suse/x86_64-sles11/inst-sys/usr/share/YaST2/modules/ModuleLoading.ycp/** * Module: ModuleLoading.ycp * * Authors: Klaus Kaempf (initial) * * Purpose: * This module does all module loading stuff. * * $Id: ModuleLoading.ycp 62597 2010-10-12 09:23:09Z jsrain $ */ { module "ModuleLoading"; textdomain "base"; import "Mode"; import "Label"; import "Icon"; string vendor_name = ""; string device_name = ""; /** * @param map controller * @returns list [string vendor, string device] * Convert internal probing data to user readable string * for module loading. * @see ModuleLoading::Load */ global define list prepareVendorDeviceInfo (map controller) ``{ // build up vendor/device information // if vendor not given, try sub_vendor string controller_vendor = controller["vendor"]:(controller["sub_vendor"]:""); if (controller_vendor != "") { string controller_sub_vendor = controller["sub_vendor"]:""; if (controller_sub_vendor != "") { controller_vendor = controller_vendor + "\n(" + controller_sub_vendor + ")"; } } // if device not given, try sub_device string controller_device = controller["device"]:(controller["sub_device"]:""); if (controller_device != "") { string controller_sub_device = controller["sub_device"]:""; if (controller_sub_device != "") { controller_device = controller_device + "\n(" + controller_sub_device + ")"; } } return [controller_vendor, controller_device]; }; /** * Cache for MarkedAsBroken */ list broken_modules = nil; /** * Is the module marked as broken in install.inf? (BrokenModules) * #97655 * @param mod module * @return broken? */ boolean MarkedAsBroken (string mod) { if (broken_modules == nil) { string bms = (string)SCR::Read (.etc.install_inf.BrokenModules); if (bms == nil) { bms = ""; } broken_modules = splitstring (bms, " "); } return contains (broken_modules, mod); } /** * @param string modulename * @param string moduleargs * @param string vendorname * @param string devicename * @param boolean ask_before_loading * @param boolean with_modprobe * * @returns symbol: `dont user choose *not* to load module * `ok module loaded ok * `fail module loading failed * * load a module if not already loaded by linuxrc */ global define symbol Load (string modulename, string moduleargs, string vendorname, string devicename, boolean ask_before_loading, boolean with_modprobe) ``{ if ((modulename != "") // there is no reason for checking initrd, if I need the module to get loaded, I just need to // check if it isn't already loaded // && (!contains (Initrd::ListModules (), modulename)) && !Mode::test ()) { // always look whether the module is already loaded map loaded_modules = (map) SCR::Read(.proc.modules); if (size (loaded_modules[modulename]:$[]) > 0) { // already loaded return `ok; } // sformat( _("Loading module %1"), modulename); // #97655 if (MarkedAsBroken (modulename)) { y2milestone ("In BrokenModules, skipping: %1", modulename); return `dont; } if (ask_before_loading && (!Mode::autoinst()) && (!Mode::autoupgrade())) { UI::OpenDialog(`opt(`decorated, `centered), `HBox ( `HSpacing(1), `HCenter ( `HSquash( `VBox ( `HCenter ( `HSquash( `VBox( // Popup-Box for manual driver installation. // If the user selects 'manual installation' when // booting from CD, YaST2 does not load any modules // automatically, but asks the user for confirmation // about every module. // The popup box informs the user about the detected // hardware and suggests a module to load. // The user can confirm the module or change // the suggested load command // // This is the heading of the popup box `HBox ( // bnc #421002 Icon::Simple ("question"), `Heading(_("Confirm driver activation")), `HStretch() ), `VSpacing(0.2), // This is in information message. Next come the // vendor and device information strings as stored // in the hardware-probing database. `Left(`Label(_("YaST2 detected the following device"))), `Left(`Label(vendorname)), `Left(`Label(devicename)), `VSpacing(0.1), `Left ( // Caption for Textentry with module information `InputField ( `id(`mod_name), `opt(`hstretch), _("&Driver/Module to load"), modulename+" "+moduleargs) ) ) ) ), `ButtonBox ( `PushButton (`id (`ok_msg), `opt (`default, `okButton, `key_F10), Label::OKButton()), `PushButton (`id (`cancel_msg), `opt (`cancelButton, `key_F9), Label::CancelButton()) ), `VSpacing(0.2) ) ) ), `HSpacing(1) ) ); UI::SetFocus (`id(`ok_msg)); symbol ret = (symbol) UI::UserInput(); if (ret == `ok_msg) { string module_data = (string) UI::QueryWidget(`id(`mod_name), `Value); if (size (module_data) > 0) { // skip leading spaces integer firstspace = findfirstnotof (module_data, " "); if (firstspace != nil) { module_data = substring (module_data, firstspace); } // split name and args firstspace = findfirstof (module_data, " "); if (firstspace == nil) { modulename = module_data; moduleargs = ""; } else { modulename = substring (module_data, 0, firstspace); moduleargs = substring (module_data, firstspace+1); } } } UI::CloseDialog(); if (ret == `cancel_msg) { y2milestone ("NOT loaded module %1 %2", modulename, moduleargs); return `dont; } } // ask_before_loading } boolean load_success = false; if (with_modprobe) { load_success = (boolean) SCR::Execute(.target.modprobe, modulename, moduleargs); } else { load_success = (boolean) SCR::Execute(.target.insmod, modulename, moduleargs); } if (load_success == nil) load_success = false; y2milestone ("Loaded module %1 %2 %3", modulename, moduleargs, load_success?"Ok":"Failed"); return (load_success?`ok:`fail); }; } 0707010006A322000081A40000018F0000018F000000014F1023BB00076B9B000000080000000100000000000000000000004600000000linux/suse/x86_64-sles11/inst-sys/usr/share/YaST2/modules/Storage.ybcYaST bytecode 1.4.0StorageB Storage.ycp Arch AsciiFileEncoding Directory FileSystems FileUtils InstallationLabel Mode  Partitions Popup Misc HTMLStorageDevicesStorageClientsProductFeaturesStageStringRegionHotplug LibStorageLibStorage::StorageInterfaceLibStorage::VolumeInfoLibStorage::PartitionInfoLibStorage::LvmLvInfoLibStorage::MdInfoLibStorage::LoopInfoLibStorage::DmInfoLibStorage::DmPartInfoLibStorage::DmraidInfoLibStorage::DmmultipathInfo LibStorage::MdPartCoInfo!LibStorage::MdPartInfo"LibStorage::NfsInfo#LibStorage::ContainerInfo$LibStorage::DiskInfo%LibStorage::LvmVgInfo&LibStorage::PartitionAddInfo'LibStorage::DmPartCoInfo(LibStorage::DmraidCoInfo)LibStorage::DmmultipathCoInfo*LibStorage::PartitionSlotInfo+LibStorage::CommitInfo,LibStorage::Environment- conv_ctype . conv_usedby / conv_ptype 0 conv_mountby 1conv_encryption 2 conv_mdtype 3 conv_mdstring 4 conv_mdparity 5conv_parstring 6conv_imsm_driver 7DiskMapVersion8DiskMap9 type_order: hw_packages ;no_propose_disks < proposal_home= proposal_lvm>proposal_encrypt?proposal_password @cfg_xml A part_insts B called_updateC GetDeviceName  DIsKernelDeviceName E StorageMapF targets_key G part_mode_key H part_disk_key I testsuite_key J do_resize_key Kwin_device_key Lcustom_display_key Mpart_proposal_mode_key Npart_proposal_first_key Opart_proposal_active_key P probe_doneQexit_key RsintScontsTGetProcessName UCreateInterfaceV imsm_driver W SetImsmDriver  X getContainersYInitLibstorageZByteToHumanString [KByteToHumanString \ByteToHumanStringWithPrecision ]KByteToHumanStringWithPrecision ^HumanStringToByte _HumanStringToKByte ` HumanStringToKByteWithRangeCheck a GetTargetMap bGetDiskPartitionTg  cGetDiskPartition dUpdateChangeTime eGetPartitionLst  f GetPartition   gGetDisk   hSwappingPartitionsiGetDestroyedLvmVgs jDeleteDestroyedLvmVgs  k GetFreeSpace  lGetUnusedPartitionSlots m AddWinInfo  n SaveDumpPath  oAddMountPointInfo  pconvertFsOptionMapToString  qconvertStringToFsOptionMap   rtoSymbol  s fromSymbol  tCheckBackupState udiskMapv dmPartCoMapw volumeMapx partAddMapy dmPartMapz mdPartMap{getContainerInfo| toDiskMap}count~ IsDiskType UpdateTargetMap UpdateTargetMapDisk  UpdateTargetMapDev   getDiskInfo  SaveExitKey   GetExitKey GetOndiskTarget CreateTargetBackup  DisposeTargetBackup  EqualBackupStates  RestoreTargetBackup  ResetOndiskTarget GetTargetChangeTimeGetPartProposalActiveSetPartProposalActive  GetPartMode  SetPartMode  GetCustomDisplaySetCustomDisplay  GetPartDisk  SetPartDisk   GetTestsuite SetTestsuite  GetDoResize  SetDoResize  GetPartProposalMode SetPartProposalMode  GetPartProposalFirstSetPartProposalFirst  GetWinDevice SetWinDevice InstallCallbacks Storage sw_raid_type_key  lvm_type_key extended_type_key  NextPartition  NextMd  MaxSizeLabelK MaxCylLabelCreatePartition    UpdatePartition SetPartitionMount  SetPartitionFormat  SetPartitionId UnchangePartitionId ResizePartition   ResizeVolume  SetCrypt ChangeDescText  ChangeVolumeProperties DeleteDevice   DeleteLvmVg  DeleteDmraid DeleteMdPartCo  CreateLvmVg CreateLvmVgWithDevs   ExtendLvmVg   ReduceLvmVg   CreateLvmLv  ChangeLvStripeSize  ChangeLvStripeCount   AddNfsVolume   CheckNfsVolume  CreateMd CreateMdWithDevs  ExtendMd ShrinkMd  ChangeMdType ChangeMdParity ChangeMdParitySymbol  ChangeMdChunkCheckMd ComputeMdSize   GetCryptPwd   SetCryptPwd   NeedCryptPwd  CreateLoop   UpdateClassified   HandleModulesOnBoot   UpdateLoop   DeleteLoop  DefaultDiskLabel DeletePartitionTable CreatePartitionTable   GetMountBy  InitializeDisk  IsPartType  CreateAny IsEfiPartitionAddMountPointsForWinParts AddMountPointsForWin  RemoveDmMapsTo   CheckSwapable  AddSwapMp  SetRecursiveRemoval GetRecursiveRemoval SetTargetMap  ReReadTargetMap  CommitChanges DeviceMounted  Umount MountOpt   Mount   DetectHomeFs SetVolOptions     CanEdit CanDelete ReadFstab mountedPartitionsOnDisk  GetCommitInfo  save_chtxt  ChangeText  LastAction ExtendedErrorMsg SetZeroNewPartitions GetMountPoints GetIdSmaller  SetPartitionData    DelPartitionData     IsRealDiskIsPartitionableDeviceRealDisk HaveLinuxPartitionsGetOtherLinuxPartitions CheckSwapOn GetPrimPartitions GetWinPrimPartitions  GetUsedFs  SaveUsedFs AddPackageList HandleProposalPackages GetForeignPrimary IsResizableFreeCylindersAfterPartition CheckNextCreated PathToDestdir   AddFstabEntry  ActivateHld  ActivateMultipath   WriteFstab  SpecialBootHandling   PerformLosetupDetectFs  GetBootPartition UpdateFstabSubfs UpdateFstabSysfs UpdateFstabOptions  HdToIseries  SLES9PersistentDevNames   HdDiskMap  UpdateFstabIseriesVd UpdateCdromLinks UpdateFstabPersistentNames UpdateFstabEvms2Lvm UpdateFstabDiskmap  UpdateMdadm UpdateCryptoType UpdateFstabUsbdevfs  BuildDiskmapUpdate  GetTranslatedDevices  ! CallInsserv  " FinishInstall #GetEntryForMountpoint $GetRootInitrdModules%CheckForLvmRootFs&CheckForMdRootFs' AdaptResize  (NumLoopDevices)onepartition2fstab* ProposalHome+SetProposalHome , ProposalLvm-SetProposalLvm .ProposalEncrypt/SetProposalEncrypt 0ProposalPassword 1SetProposalPassword  2 ProposalEvms3SetProposalDefault 4 GetControlCfg 5BootEvms6 ProposalVM 7 AddHwPackage  8SwitchUiAutomounter 9DumpObjectList :NoProposeDisks ;SetDefaultMountBy  <GetDefaultMountBy =DeviceMatchFstab  > IsPersistent? ActionsCount@CheckEncryptionPasswords  A CheckCryptOk  CCdisk  partitionDDdevice WWaval YYireadonlyZZbytes[[kbytes\\bytes precision omit_zeroes]]kbytes precision omit_zeroes^^str bytes__str kbytes``str bytes_kmin_kmax_kaa ccdevice ddff tg device ggtg device hhnii|target jjtarget kkdevice testsizeused_fs verboselldevice slotsmm:targets nnOname oo\target ttwho ~~t  device disk"key +eywho who s1 s2 vbwho valuevalue valuevalue valuevalue value valuevalue I disk ptype \ i diskr disk start_cyl disk device ptype idstartlenmby  device startlen device mp  device formatfs  device id device  device disk new_cyls! device disk  new_size_k- device crptformatO part disk device  name  name  name  name pesizelvm2 name pesizelvm2devs ' name device 3 name device ? vgname lvname sizeKstripeO vgname lvname  stripeSize_ vgname lvname stripeso nfsdev opts szmp | nfsdev opts  nrtype  nrtype devices  nrdev  nrdev  nrmdtype  nrptype  nrptype  nrchunk nr md_type devices sizeK device  device pwd , device 4 file createsizeKmp \ key pwd c dev file createsizeKr disk file  remove_file~ size_k disk size_k disk label device  disk value t B targets \ device d dev v target val"'target dev dev  dev mp fstopt dev mp !pTpmnt fs fs_opts  fstab_opts label pverbosepdiskverbose dir disk (7HNTvaledisk delimtg device key valuetg device key entryentrydevice 4^ydisk targets  foreign_os targets %_tpartdevice diskregionpt e  val   val    0tg   uloopformatdevice disk "=Pinput \input input diskmapdiskmapdiskmap4[uoldvoldvnewv  oldvnewvnames ""##mmp $$}%%&&''maindev regionschange(({))partother_nr**++val,,--!val..'//,val002117val 22>33D home_only44Y556677name 88on99::;;mby << ==device  fstab_spec >>0p??A@@Fpw1 pw2  min_length empty_allowedAArdev  fs_passwd D3WFMExecute3SCRReadWriteExecute UnmountAgent0storage3Archi386sparc board_iseriesalphas390ia64x86_64 board_mac3 AsciiFile SetComment  ReadFile  GetLineNumLinesChangeLineField   AppendLine  RemoveLines  RewriteFile  3Encoding3 Directorytmpdir 3  FileSystems conv_fs DefaultFstabOptions InitSlib  GetOptions GetMountString   GetNeededModules   IsResizable  IsSystemMp DefaultFormatOptions  GetFstabDefaultMap GetFstabDefaultMntops  HasQuota3! FileUtilsGetSize  IsDirectory 3" Installationdestdir  scr_destdir 3#LabelContinueButton  CancelButton ErrorMsg 3$Modenormalrepairautoinstconfigtest3% Partitions IsResizablefsid_prep_chrp_bootlv_name  fsid_native fsid_swapfsid_lvm fsid_mac_hfs fsid_raiddm_name  loop_name  fsid_gpt_boot raid_name IsDosWinNtPartition dmraid_name dmmultipath_name nfs_name  fsid_wintypes fsid_dostypesfsid_ntfstypes fsid_skippedEfiBoot DefaultFs  DefaultBootFs  BootMount PrepBootIsLinuxPartitionTranslateMapperName   CurMountedGetFstab  GetCrypto  FsIdToString 3&PopupError   AnyQuestion     Message  3'Misc SysconfigRead  3(HTMLList  3)StorageDevices TypeNames  ZipDrives Probe3*StorageClientsInstallCallbacks 3+ProductFeaturesGetStringFeature   GetBooleanFeature  3,Stageinitial3-String3.Region3/HotplughaveUSB31 LibStorage/RAID10MDLVMcreateStorageInterfacePidLOOPLOGICALLEFT_SYMMETRICLEFT_ASYMMETRICIMSM_UNDECIDED IMSM_MDADM IMSM_DMRAIDEXTENDED ENC_UNKNOWNENC_TWOFISH_OLDENC_TWOFISH256_OLD ENC_TWOFISHENC_NONEENC_LUKSUB_NONE UB_MDPARTUB_MDUB_LVM UB_DMRAIDUB_DMMULTIPATHUB_DMRIGHT_SYMMETRICRIGHT_ASYMMETRICRAID_UNKRAID6RAID5RAID1RAID0DMRAIDPRIMARY DMMULTIPATHDMPAR_NONENFSC MULTIPATHDISK MOUNTBY_UUIDCUNKNOWN MOUNTBY_PATH MOUNTBY_LABEL MOUNTBY_IDMOUNTBY_DEVICEMDPART32LibStorage::StorageInterfacegremoveBackupState forgetResizeVolume initializeDisk humanStringToByte  getCommitInfo  maxSizeLabelK defaultDiskLabelSize createPartition  modifyFileLoop   getVolume getUnusedPartitionSlots  resizeVolume removeDmTableTo   getContainers  removeLvmVg freeCylindersAfterPartition  getAllUsedFs getCommitActions  removeDmraid resizePartitionNoFs createMd   createLvmLv   getRecursiveRemovaldumpObjectList checkNfsDevice  removeFileLoop changeLabelVolume  removeMdPartCo  addNfsDevice   createFileLoop    changeMkfsOptVolume  activateMultipath  removeVolume checkBackupState rescanEverything resizePartition forgetChangePartitionId getCrypt  getNfsInfoequalBackupStates  forgetCryptPassword restoreBackupState getCryptPassword  getDefaultMountBydestroyPartitionTable   changeMountBy setCrypt changeLvStripeCount   mountDeviceRo    getDiskInfo  activateHld  extendLvmVg   readFstab  getDmInfosetCryptPassword  checkDeviceMounted  setDefaultMountBy changeMountPoint  setDetectMountedVolumes getDmmultipathCoInfo byteToHumanString  setEfiBoot commitgetDmmultipathInfo changeFormatVolume getDmraidCoInfo  getDmraidInfo setRecursiveRemoval  setRootPrefix  getExtendedErrorMessage setZeroNewPartitions  getFreeInfo changePartitionId  changeMdChunk  shrinkLvmVg  extendMd  shrinkMd  changeDescText   umountDevice updatePartitionArea getPartitionInfo checkMd needCryptPassword changeFstabOptions  changeLvStripeSize   nextFreeMd verifyCryptPassword   computeMdSize changeMdParity  getLastAction  createLvmVg   getLoopInfo getLvmLvInfo  getLvmVgInfo  addFstabEntry     getMountBy  getMdInfogetMdPartCoInfo changeTunefsOptVolume  nextFreePartition  createBackupState  changeMdType  getMdPartInfo 33LibStorage::VolumeInfoswig_sizeK_getnew swig_usedByType_getswig_create_getswig_device_get swig_usedByName_get  swig_dtxt_get swig_usedByDevice_get swig_format_getswig_tunefs_options_get  swig_fs_getswig_label_get  swig_loop_get  swig_uuid_get swig_mount_by_getswig_OrigSizeK_getswig_mkfs_options_get swig_mount_get  swig_name_get swig_is_mounted_getswig_resize_getswig_ignore_fs_getswig_fstab_options_get swig_encryption_get34LibStorage::PartitionInfo  swig_nr_getswig_udevId_get swig_udevPath_get  swig_boot_getswig_cylSize_getswig_partitionType_getswig_cylStart_get swig_id_get swig_v_get35LibStorage::LvmLvInfoswig_stripe_get swig_v_getswig_stripe_size_get36LibStorage::MdInfo swig_nr_get swig_type_getswig_devices_get swig_chunk_get swig_v_getswig_sb_ver_get swig_parity_get37LibStorage::LoopInfo swig_nr_get swig_v_getswig_reuseFile_get swig_file_get 38LibStorage::DmInfo swig_nr_get swig_v_get39LibStorage::DmPartInfo swig_v_get swig_p_get swig_part_get3:LibStorage::DmraidInfo swig_p_get3;LibStorage::DmmultipathInfo swig_p_get3<LibStorage::MdPartCoInfonew swig_devices_get swig_chunk_getswig_sb_ver_get swig_parity_get swig_d_getswig_level_get3=LibStorage::MdPartInfo swig_v_get swig_p_get swig_part_get3>LibStorage::NfsInfo swig_v_get3?LibStorage::ContainerInfo swig_type_getswig_usedByType_getswig_device_get swig_usedByName_get swig_usedByDevice_get  swig_name_get swig_readonly_get3@LibStorage::DiskInfo  swig_cyl_getswig_iscsi_getswig_maxPrimary_getswig_initDisk_getswig_udevId_get swig_sizeK_getswig_cylSizeB_getswig_maxLogical_getnew swig_udevPath_get swig_disklabel_get 3ALibStorage::LvmVgInfo swig_sizeK_getnew swig_devices_get swig_create_get swig_lvm2_getswig_peFree_getswig_peSize_getswig_peCount_getswig_devices_add_get swig_devices_rem_get 3BLibStorage::PartitionAddInfo swig_nr_getswig_udevId_get swig_udevPath_get  swig_boot_getswig_cylSize_getswig_partitionType_getswig_cylStart_get swig_id_get3CLibStorage::DmPartCoInfoswig_devices_get swig_minor_get swig_d_get3DLibStorage::DmraidCoInfonew  swig_p_get3ELibStorage::DmmultipathCoInfonew  swig_p_get3FLibStorage::PartitionSlotInfoswig_cylSize_getswig_cylStart_getswig_primarySlot_getswig_primaryPossible_getswig_logicalSlot_getswig_logicalPossible_getswig_extendedSlot_getswig_extendedPossible_get3GLibStorage::CommitInfonew swig_destructive_get3HLibStorage::Environmentnew swig_autodetect_set swig_testmode_set swig_instsys_set $K-def_sym CT_UNKNOWNdef_intm CT_DISKCT_MDCT_LOOPCT_LVM CT_DMRAIDCT_DMMULTIPATHCT_DM CT_MDPARTCT_NFS$Z.def_symUB_NONEdef_intmUB_LVMUB_MD UB_DMRAIDUB_DMMULTIPATH UB_MDPARTUB_DM$f/def_symprimarydef_intmlogicalextended$n0def_symdevicedef_intmuuidlabelidpath$x1def_symnonedef_intmtwofish twofish_oldtwofish_256_oldluksunknown$2def_sym raid_unknowndef_intmraid0raid1raid5raid6raid10 multipath$3raid0raid1raid5raid6raid10 multipath$4def_sympar_nonedef_intmleft_asymmetricleft_symmetricright_asymmetricright_symmetric$5left_asymmetricleft_symmetricright_asymmetricright_symmetric$6IMSM_UNDECIDED IMSM_DMRAID IMSM_MDADM$7 $8 $9  CT_DISKCT_DMCT_DMMULTIPATH CT_DMRAIDCT_LOOPCT_LVMCT_MD CT_MDPARTCT_NFS$: $;$<$=$>$?$@ $A$B%Cret $0/(/4(||||||||||  search  / /dev/cciss/  search  / /dev/ida/  search  / /dev/ataraid/  search  / /dev/etherd/&&  search  //dev/md//dev/md  search  //dev/rd/4&0+   0p(  search  / /dev/mapper/4&0+   0_part&0+   0   sformat   %1/( size  /4&0+   +   0/ /-0%D-&&&&   substring  /LABEL=   substring  /UUID=   substring  /  /dev/disk/by-$E $Ftargets$G part_mode$H part_disk$I testsuite$J do_resize$K win_device$Lcustom_display$Mpart_proposal_mode$Npart_proposal_first$Opart_proposal_active$P$ Qnext$!R$"S %%Tpidname pos$'0  SCR::Read.target.symlink+   +   /proc/ tostring //exe((0-)$+0   findlastof  0/(,0--0-/   substring  0+0%3Ureadonly)5R46env locker_pid$71.LibStorage::Environment/,8.1 ,9.1,:.1|| $<1&=R1 1(?R4@ locker_name $A2T1,B    y2milestone   locker_pid:%1 locker_name:%212(D24E(F!  rThe storage subsystem is locked by an unknown application. You must quit that application before you can continue.storage  focus_no.K4N(O!     sformat   uThe storage subsystem is locked by the application "%1" (%2). You must quit that application before you can continue.storage21  focus_no.U,Z    y2milestone   sint:%1R-[R$_VIMSM_UNDECIDED%aW&cV/%iY (kR-l,n    y2milestone   InitLibstorage&oRU/(pR4p,q   y2error   Storage::CreateInterface failed-r(u4v,wR,xR  ,{R &SX,    y2milestone   InitLibstorage conts:%1S,R-%Z-R/%[-R*/%\-R///%]-R*///%^iret$0&/0$0R / /,    y2milestone   (HumanStringToByte ret:%1 str:%2 bytes:%30//-0%_bytesret$0$0R / 0&//0,    y2milestone   *HumanStringToKByte ret:%1 str:%2 kbytes:%30//-0%`(!_/ /-(&&///4([/[/-&//(&&///4([/[/-&//-%bdevice tg retdlen as_stringls  $0 $0$0$0   filters  1    splitstring   // size 1(||  search  /LABEL=  search  /UUID=4tl $1    splitstring   /=&0devdisk1 '0  search  /LABEL=by-labelby-uuid,    y2milestone   GetDiskPartitionTg ls:%10,   y2debug    GetDiskPartitionTg size:%1 ls:%2size00(&&&&size00 disk  contains by-idby-pathby-uuidby-label0 4partregex $1 $1 -part[0-9]+$(0 by-label4,    foreachdev disk 3 3/&1findp 53 partitions  5label0 (14tmp$5 '5disk3(haskey1nr'5nr1nr'5nr 1name&0add05(0 by-uuid4,    foreachdev disk 3 3/&1findp 53 partitions  5uuid0 (14tmp$5 '5disk3(haskey1nr'5nr1nr'5nr 1name&0add05( 0 by-id4 id numl$ 20 $2$2   regexppos  21(size24&2 tointeger   substring  2+2&2   substring  22,   y2debug   GetDiskPartitionTg id:%1 num:%222,    foreachdev disk 3 3/(&&size0   finds  53udev_id 524&1findp 63 partitions 6nr2(||214tmp$6 ' 6disk3(!2'"6nr2'$6nr&%06(*0 by-path4+id numl$,20 $-2$.2   regexppos  21(/size240&12 tointeger   substring  2+2&22   substring  22,3   y2debug   GetDiskPartitionTg id:%1 num:%222,5    foreachdev disk 3 3/(7&&size0 3 udev_path248&91findp 63 partitions 6nr2(;||214<tmp$=6 '>6disk3(?2'@6nr2'B6nr&C06(I  search  //4Jtmp (K||||||  search  //dev/hd  search  //dev/sd  search  //dev/ed  search  //dev/iseries/vd4O&P0   findfirstof  / 0123456789(Q04R&S0 size /(V&&  search  //dev/mdsize04Wpos$X2  find  /p,Y    y2milestone   device:%1 pos:%2/2(Z2&[0&]02(_  search  / /dev/loop4`&a0 (c  search  / /dev/i2o/hd4d&e0 (g||||||||  search  //dev/rd/  search  / /dev/cciss/  search  / /dev/ataraid/  search  / /dev/etherd/  search  / /dev/ida/4lpos$m2   findlastof  /p&n0 size /(o24p&q02(t  search  / /dev/dasd4u&v0 size /(w   findfirstof  / 01234567894x&y0-0(|  search  / /dev/mapper/4}regex l$~2[_-]part[0-9]+$$2   regexppos  /2(size2&02&0 size /4&0(size04pos$3   findlastof  //(34&034nonzero&0 size /$3   findlastnotof  / 0123456789(&&33-04&0+3&0$1 '1disk   substring  /0&/   substring  /0(  search  /_part&/   substring  /(&& size /   findfirstof  //p4&/   substring  /'1nr(04'1nr/4( size /4'1nr tointeger/(&& size  1disk1nr4'1nr&014&0disk/dev/nfsnr/(size04ab$1filterm 20  search   2disk /dev/evms$1filterm 20  search   2disk /dev/evms&0merge11,   y2debug   #GetDiskPartitionTg device:%1 ret:%2/0-0%c-b/a %d change_time$/time,    y2milestone   UpdateChangeTime time %1/'E targets_time/%etg device rettmp$0 $0b//,    y2milestone   GetPartitionLst tmp:%10,  foreachm 10disk partpa $2 1disk(&&  search  / /dev/evms!haskey/24&2 /dev/evms,   y2debug   !GetPartitionLst device=%1 disk=%2/2$2filterp 3/2 partitions  3device/&2filterp 32!3delete(size24&2filterp 4/2 partitions 4nr1nr&2filterp 42!4delete(size24&2filterp 4/2 partitions  4name 1nr&2filterp 42!4delete$22 (&&size2  search  / /dev/mapper/4&2filterp 4/ /dev/mapper partitions  4device/&22 (&&size2  search  / /dev/mapper/4&2filterp 4/ /dev/loop partitions  4device/&22 (size2&0add02,    y2debug   GetPartitionLst ret=%10- 0% f- e// %gret tmpdisk $0 $0b// $0 0disk(&&  search  / /dev/evms!haskey/04&0 /dev/evms,!   y2debug   GetDisk disk=%10-" /0 %nhswapsret,pSCR::UnmountAgent .proc.swaps$q/ SCR::Read .proc.swaps(r/4r,s   y2error   #SCR::Read(.proc.swaps) returned nil&t/ &v/filtere 0/ 0type partition$w/  mapliste 0/  0file,x    y2milestone   SwappingPartitions %1/-y/%|ivgs$~0 ,    foreachdiskdev disk 1 1/,  foreachp 31 partitions (&& 3 used_by_typeUB_NONEUB_LVM3format4&0union0 3used_by&0sort0,    y2milestone   GetDestroyedLvmVgs %10-0%jvgs $0    maplists  1 i/+   /dev/1,    y2milestone   DeleteDestroyedLvmVgs %10,    foreachdev  10(haskey/1'/1delete'/1 partitionsmaplistp 3/1 partitions (haskey3mount&3remove3mount-3,    y2milestone   DeleteDestroyedLvmVgs %1: %21/1 -/%k used resize_freedf_freewin_diskefir linux_sizemin_linux_sizeadd_free new_size ret( 4wfwuls$1 tointeger*tofloat/0.6$1 tointeger*tofloat/0.4$1 tointeger*tofloat/0.5-free1used1 linux_size1new_size-+111$0$0$0$0$0$0&0R / 0 0 0 0 0/ntfs&0*0&0*0&0*0(&&&&/ntfs!0/4cmd bcalltmp $1   sformat   /usr/sbin/ntfsresize -f -i '%1'/,    y2milestone   GetFreeSpace Executing cmd:%11$1 SCR::Execute.target.bash_output1  LC_MESSAGESPOSIX,    y2milestone   GetFreeSpace Executing ret:%11$1+   Resize Not Possible:storage &1+   +   1 1stdout 1stderr, 1- $0$0$0-00,    y2milestone   'GetFreeSpace resize_free %1 add_free %200(||0**,!04&0&0(0**X4&00(0**K4&0+-0**K0&00(0**4&00(0**4&0+-0**0&0**,(0***4&00(0**,4&0+-0**,0&0**(0***4&00(0** 4&0+-0** 0&0**4&00(0/04&0+-0/00& 0**$ 0 -++0000$0  free00df_free0used0win_disk0efi0 linux_size0 max_win_size-++0000ntfs/ntfsnew_size0 '0 ok0,    y2milestone   GetFreeSpace %1 ret %2/0 -0 %l swig_slotsret$0 $!0R / 0&#/  maplist swig_slot 10region,1,1 primary_slot,1primary_possible,1 extended_slot,1extended_possible,1 logical_Slot,1logical_possible,1-00%:m,<    y2milestone   AddWinInfo called,=    foreachdisk data 1 1/'?/1 partitionsmaplistp 31 partitions (B&& 3fsid  contains ntfsvfat 3used_fsnone4D'E3winfok 3device 3used_fsnone,G    y2milestone    AddWinInfo %13-I3-L/%Onret $P0+   +   //,Q   y2debug   name=%1 path=%2/0-R0%\omounts$^0 ,_    foreachdiskdev disk 1 1/tmp2$b21 partitions &c2maplistpart 32mt$e4findmp 50|| 5spec  3device 5loop_on  3device(g44h'i3mount 4file(j3noauto4k'l3active-o3'q1 partitions2'r/11-t/%pfsoptcmd ret $0(||// 4ignore$1 autodefaultnone,  foreach option_keyoption 2 2/ option_str  option_value option_blank option_cmd $3 2 option_str$32 option_value$32 option_blank$3 2 option_cmdmkfs,    y2milestone   4convertFsOptionMapToString k:%1 opt:%2 val:%3 cmd:%42233(/34 ( && 334 ( !contains134 ( size 0&0+   0 &0+   03(3&0+   0 &0+   0 3(&&334(34( size 0&0+   0 &0+   03(&&334 (! size 0&"0+   0 &#0+   03($3&%0+   0 &&0+   0   sformat   %13(+||size/ size 0,,    y2milestone   *convertFsOptionMapToString fsopt:%1 ret:%2/0--0%0qopts fs cmd retposop $20 ,3    y2milestone   1convertStringToFsOptionMap opts:"%1" fs:%2 cmd:%3///$40  findfirstnotof  / (50&6/   substring  /0$80/&90filtero 10 1 option_cmdmkfs/); size /4<found$=1,>  foreacho 20mos $@3 $A3 2 option_str(B&&&&!1 size 3  search  /34C &D1'E3 option_str3'F3 option_cmd 2 option_cmdmkfs(G 2typetextboolean4H'I3 option_value'J0 2 query_key3&L/   substring  / size 3&M0  findfirstnotof  / (N0&O/   substring  /0(P&&&& 2typetextboolean size /  search  /-4R(S0'T3 option_blank&U0   findfirstof  / (V04W'X3 option_value/&Y/4\']3 option_value   substring  /0&^/   substring  /0'`0 2 query_key3&b0  findfirstnotof  / (c0&d/   substring  /0(g!14h&i0  findfirstnotof  / (j0&k/   substring  /0&m/,o    y2milestone   )convertStringToFsOptionMap opts:%1 ret:%2/0,q    y2milestone   !convertStringToFsOptionMap ret:%10-r0%urconv val-w /m/ /def_syminvalid_conv_map%zsconv val ret$|0/def_int,}    foreachis  1 1/m (1/&01-0%tret,    y2milestone   CheckBackupStates who:%1/(!Y-$0R /,    y2milestone   CheckBackupStates ret:%10-0%udinfodbttmp '/size_k&/'/cyl_size&/'/ cyl_count&/'/label&/'/ max_logical&/'/ max_primary&/$0&/(0'/iscsi(haskey/iscsi&/remove/iscsi&0&/(0'/dasdfmt(haskey/dasdfmt&/remove/dasdfmt$0&/( size 0'/udev_id    splitstring   0 (haskey/udev_id&/remove/udev_id&0&/( size 0'/ udev_path0(haskey/ udev_path&/remove/ udev_path,    y2milestone   diskMap ret:%1/-/%vinfosddinfols t $0)/&/u0/$0    splitstring   )/ ,    y2milestone   ls=%10'/devices0$0)/'/minor0,    y2milestone   dmPartCoMap ret:%1/-/%wvinfoptfs tbooltmp $'/device/'/size_k/'/name/$0/$0r0'/ detected_fs0(0unknown'/used_fs0$0/(0'/format&0/(0'/create$0/( size 04'/mount0&0/(!0'/inactive&0/'/mountbyr00&0/(04'/ used_by_typer.0'/used_by/'/used_by_device/&0/( size 04'/fstopt0(   finds  2    splitstring   0,2noauto'/noauto&0/( size 04'/mkfs_opt0'/ fs_optionsq0 / detected_fsunknownmkfs4(haskey/ fs_options&/remove/ fs_options&0/( size 04'/ tunefs_opt0'/ fs_optionsunion/ fs_options q0 / detected_fsunknowntunefs&0/( size 0'/dtxt0&0/( size 0'/uuid0&0/( size 0'/label0&0/(04'/enc_typer10&0/(04'/resize' / orig_size_k/& 0/( 0' / ignore_fs&0/( size 0'/loop0-/%xinfoptboottmp '/nr(/'/fsid(/'/fstype /fsid'/region(/(/$0(/'/typer/0$0(/(0'/boot$ 0(/(! size 0'"/udev_id    splitstring   0 &#0(/($ size 0'%/ udev_path0,&    y2milestone   partAddMap ret:%1/-'/%*yinfopvinfopart$,0/&-/w0/'./nr$/0/(0041pinfo$21/&3/x1/,5    y2milestone   dmPartMap ret:%1/-6/%9zinfopvinfopart$;0#/&</w0/'=/nr$>0#/(?04@pinfo$A1#/&B/x1/,D    y2milestone   mdPartMap ret:%1/-E/%H{crettvinfo,J    y2milestone   getContainerInfo %1/$K0$L0$M0LibStorage::VolumeInfo(N /type CT_UNKNOWNCT_DISK4Opinfosinfosd $P1 $Q1&LibStorage::DiskInfo$R1 /device&S0R 11(T04U&V/u1/,Y    y2warning   disk "%1" ret:%2 /device0'Z/ partitions &[0R 1 1,\  foreachinfo 21tmp pboot$^3$_3 &`02&a3w03'b3nr2'c3fsid2'd3fstype 3fsid'e3region22&g02'h3typer/0$i32(j3'k3boot&l32(m size 3'n3udev_id    splitstring   3 &o32(p size 3'q3 udev_path3'r/ partitionsadd/ partitions 3(u /type CT_UNKNOWN CT_DMRAID4vpinfosinfosd $w1 $x1*LibStorage::DmraidCoInfo$y1 /device&z0R 11({04|pinfo$}2*1&~/v2/,    y2warning   disk "%1" ret:%2 /device0'/ partitions &0R 1 1,  foreachinfo 21pinfop$3 2$3 &3y33'3fstype (3nr'/ partitionsadd/ partitions 3( /type CT_UNKNOWNCT_DMMULTIPATH4pinfosinfosd $1 $1+LibStorage::DmmultipathCoInfo$1 /device&0R 11(04pinfo$2+1&/v2/,    y2warning   disk "%1" ret:%2 /device0'/ partitions &0R 1 1,  foreachinfo 21pinfop$3!2$3 &3y33'3fstype (3nr'/ partitionsadd/ partitions 3( /type CT_UNKNOWN CT_MDPART4pinfosinfosd ls t$1 $1"LibStorage::MdPartCoInfo$1 /device&0R 11(04dinfo$2"1&/u2/,    y2warning   disk "%1" ret:%2 /device0$1    splitstring   "1 ,    y2milestone   ls=%11'/devices1$1"1'/ raid_type   substring     sformat   %1r21( / raid_typeraid54pt &1"1$2r41(2par_none'/parity_algorithm   substring     sformat   %12&1"1(14'/ chunk_size1'/sb_ver"1'/ partitions &0R 1 1,  foreachinfo 21p$3 &3z23'3fstype (3nr'/ partitionsadd/ partitions 3( /type CT_UNKNOWNCT_LVM4pinfosinfosn $1 $1'LibStorage::LvmVgInfo$1 /name&0R 11(04ls '/create'1'/size_k'1'/cyl_size*'1'/pesize*'1'/ cyl_count'1'/pe_free'1'/lvm2'1$2    splitstring   '1 ,    y2milestone   ls=%12'/devices2&2    splitstring   '1 (size2'/ devices_add2&2    splitstring   '1 (size2'/ devices_rem2,    y2warning   LVM Vg "%1" ret:%2 /name0&0R 1 1,  foreachinfo 21p $3 &02&3w03'3stripes2&02(0'3 stripesize0'3typelvm'3fstype '/ partitionsadd/ partitions 3( /type CT_UNKNOWNCT_MD4pinfos$1 &0R 1(0,    y2warning   getMdInfo ret:%10,  foreachinfo 21ptd ls $3 &02&3w03'3nr2$ 32' 3 raid_type   substring     sformat   %1r23(  3 raid_typeraid54 pt & 32$4r43(4par_none'3parity_algorithm   substring     sformat   %14'3typesw_raid'3fstype &32(34'3 chunk_size3$32'3sb_ver3$3    splitstring   2 '3devices3'/ partitionsadd/ partitions 3(  /type CT_UNKNOWNCT_LOOP4!pinfos$"1 &#0R 1($0,%    y2warning   getLoopInfo ret:%10,&  foreachinfo 21p $(3 &)02&*3w03'+3nr2',3typeloop'-3fstype '.3fpath2'/3 create_file!2(0 3enc_typeunknownluks'13device 3loop'2/ partitionsadd/ partitions 3(5 /type CT_UNKNOWNCT_DM46pinfos$71 &80R 1(90,:    y2warning   getDmInfo ret:%10,;  foreachinfo 21p$=3 &>02&?3w03'@3nr2'A3typedm'B3fstype 'C/ partitionsadd/ partitions 3(F /type CT_UNKNOWNCT_NFS4Gpinfos$H1 ,I    y2milestone   before getNfsInfo&J0R 1,K    y2milestone   after getNfsInfo(L0,M    y2warning   getNfsInfo ret:%10,N  foreachinfo 21p$P3 &Q0$2&R3w03'S3typenfs'T3fstype 'U/ partitionsadd/ partitions 3,Y    y2milestone   getContainerInfo container %1/-Z/%]|diskcinfol $_0 size_kcyl_size cyl_countlabel max_logical max_primarytypereadonly used_by_typeused_byused_by_device partitionsdasdfmtudev_id udev_path,c    foreachs  10(ehaskey/1'f/1/1(ghaskey/1&h/remove/1-j/%mXretcinfos$o/ $p/ ,qR /,r  foreachinfo 0/ctb $t1 'u1name%0'v1device%0$w1%0'x1typer-1&y1%0(z14{'|1 used_by_typer.1'}1used_by%0'~1used_by_device%0$1%0(1'1readonly&/add/1,    y2milestone   getContainers ret:%1/-/$}%~-  contains CT_DISK CT_DMRAIDCT_DMMULTIPATH CT_MDPART/%rem_keys tg &SX$/ $/EF ,    foreachdev disk 0 0/c$1 &1findc 2S 2device0(1&/   add/0(~ 1type CT_UNKNOWN4'/0|/0 {14'/0{1,    y2milestone   UpdateTargetMap dev:%1 is:%20/0 ,    y2milestone   UpdateTargetMap rem_keys:%1/,    foreachdev  0/&/   remove/0,  foreachc 0S(&& 0type CT_UNKNOWNCT_DISK!haskey/ 0device4'/ 0device{0,    y2milestone   UpdateTargetMap dev:%1 is:%2 0device/ 0device 'EF/%dev ctg,    y2milestone   UpdateTargetMapDisk&SX$0 &0findc 1S 1device/$0EF (04(haskey0/&0remove0/(~ 0type CT_UNKNOWN4'0/|0/ {04'0/{0'EF0%dev tg cdev cdisk ,    y2milestone   UpdateTargetMapDev %1/$0EF $0,    foreachkey d 1 10(&& size 0findp 31 partitions  3device/&0 1device,    y2milestone   UpdateTargetMapDev cdev %10$0 &0findc 1S 1device0$0 (04&0{0(&&0haskey004 partitionsfound$100 partitions $1&1maplistp 21( 2device/4pp$4findq 50 partitions  5device/(44&1&24-2'0 0device partitions1(!1,   y2error   UpdateTargetMapDev not found %1/,   y2error   -UpdateTargetMapDev key %1 not found in target 0device'EF0% c$0 &0findp 1S 1device/(04tmp$1c/,    y2milestone   getDiskInfo map %11( 1disk/&0