Author: aschnell
Date: Tue Mar 3 17:06:59 2009
New Revision: 55902
URL: http://svn.opensuse.org/viewcvs/yast?rev=55902&view=rev
Log:
- removed unused code
Modified:
trunk/storage/storage/src/include/custom_part_dialogs.ycp
trunk/storage/storage/src/include/custom_part_lib.ycp
trunk/storage/storage/src/include/lvm_lv_lib.ycp
trunk/storage/storage/src/include/lvm_pv_lib.ycp
trunk/storage/storage/src/include/lvm_ui_dialogs.ycp
trunk/storage/storage/src/modules/FileSystems.ycp
trunk/storage/storage/src/modules/Storage.ycp
Modified: trunk/storage/storage/src/include/custom_part_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_dialogs.ycp?rev=55902&r1=55901&r2=55902&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_dialogs.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_dialogs.ycp Tue Mar 3 17:06:59 2009
@@ -1072,24 +1072,6 @@
}
-
-/*
-define boolean UseChangedPartitionContinueCancelPopup()
- ``{
- // popup text
- if( Popup::ContinueCancel(_("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.
-
-")))
- return true;
-
- return false;
- };
-*/
-
define boolean ModifyPartitionInSystemWarningPopup( string part, string mount )
``{
Modified: trunk/storage/storage/src/include/custom_part_lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_lib.ycp?rev=55902&r1=55901&r2=55902&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_lib.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_lib.ycp Tue Mar 3 17:06:59 2009
@@ -189,39 +189,6 @@
};
-
-
- /**
- * Only for check in installed system.
- * Please do not use this define by installation.
- * @parm part1 partition 1
- * @parm part2 partition 2
- * @return boolean
- */
-/*
-define boolean arePartitionsEqual( map part1, map part2 )
- ``{
- if( part1["create"]:false )
- return true;
-
- // -> not all keys
- if( part1["nr"]:0 == part2["nr"]:0 &&
- part1["fsid"]:0 == part2["fsid"]:0 &&
- part1["region"]:[] == part2["region"]:[] &&
- part1["create"]:false == part2["create"]:false &&
- part1["format"]:false == part2["format"]:false &&
- part1["used_fs"]:`unknown == part2["used_fs"]:`unknown &&
- part1["enc_type"]:`none == part2["enc_type"]:`none &&
- part1["fstab_mnt"]:`device == part2["fstab_mnt"]:`device &&
- part1["label"]:"" == part2["label"]:"" &&
- part1["mount"]:"" == part2["mount"]:"" )
- {
- return true;
- }
- return false;
- }
-*/
-
/**
* Check lvm mount points
* @param mount mount point
@@ -1137,39 +1104,6 @@
return [ new_targetMap, table_input ];
};
-/*
-define boolean check_max_size( integer byte_size, integer max_size )
- ``{
- y2milestone( "icheck_lv_size byte_size=%1 max_size=%2", byte_size,
- max_size );
-
- if( byte_size == 0 )
- {
- if( max_size>0 )
- // error popup text
- Popup::Error(sformat(_("The size entered is invalid.
-Enter a size from 1M to %1. For example, 40M or 1G."),
- Storage::ByteToHumanString(max_size)) );
- else
- // error popup text
- Popup::Error(_("The size entered is invalid.
-Enter a valid size, such as 500k, 40M, or 1G.
-"));
- return( false );
- }
-
- if( max_size>0 && byte_size>max_size )
- {
- // error popup text
- Popup::Error(sformat(_("The size entered is too large.
-Enter a size from 1M to %1."),
- Storage::ByteToHumanString(max_size)) );
- return( false );
- }
-
- return( true );
- };
-*/
define boolean CheckResizePossible( boolean ask, boolean lvm, integer resize,
symbol fsys, string mount )
Modified: trunk/storage/storage/src/include/lvm_lv_lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/lvm_lv_lib.ycp?rev=55902&r1=55901&r2=55902&view=diff
==============================================================================
--- trunk/storage/storage/src/include/lvm_lv_lib.ycp (original)
+++ trunk/storage/storage/src/include/lvm_lv_lib.ycp Tue Mar 3 17:06:59 2009
@@ -64,61 +64,7 @@
}
return( ret );
};
-
-/*
-define boolean editLogicalVolume( map Lv, string current_vg)
- ``{
- y2milestone( "editLogicalVolume Lv:%1", Lv );
- boolean ret = Storage::ChangeVolumeProperties( Lv );
- ret = Storage::ResizeVolume( Lv["device"]:"", "/dev/"+current_vg,
- Lv["size_k"]:0 ) && ret;
- if( Lv["create"]:false )
- {
- if( !Storage::ChangeLvStripeCount( current_vg, Lv["name"]:"",
- Lv["stripes"]:1 ))
- {
- popupText( Lv["stripes"]:1 );
- ret = false;
- }
- else if( Lv["stripes"]:1 > 1 )
- Storage::ChangeLvStripeSize( current_vg, Lv["name"]:"",
- Lv["stripesize"]:64 );
- }
- return( ret );
- };
-*/
-
- //////////////////////////////////////////////////////////////////////
- //
- // !!!! input: partition_list: must be aready those lvs that belong to current_vg
- //
- // [ $["fsid":Partitions::fsid_lvm,
- // "fstype":"LVM",
- // "nr":"var",
- // "region":[255, 16],
- // "type":`primary],
- // $[
- // "fsid":131,
- // "fstype":"Linux native",
- // "nr":4, "region":[271, 844],
- // ...
- //
- // out: [ 10344343, 2223333 ] [ used, avail ]
-
-/*
-define list get_lv_size_info( map targetMap, string current_vg )
- ``{
- list ret = [];
- integer sum_byte_vg = targetMap["/dev/"+current_vg,"size_k"]:0*1024;
- integer free_byte_vg = targetMap["/dev/"+current_vg,"pe_free"]:0*
- targetMap["/dev/"+current_vg,"cyl_size"]:0;
- ret = [ sum_byte_vg-free_byte_vg, free_byte_vg ];
-
- y2milestone( "get_lv_size_info vg=%1 ret=%2", current_vg, ret );
- return( ret );
- };
-*/
////////////////////////////////////////////////////////////////////////////////
// Get all existing lv names of a volume group
@@ -130,58 +76,5 @@
return ret;
};
- //////////////////////////////////////////////////////////////////////
- // partition list to widget table
- // in:
- // [ $["fsid":Partitions::fsid_lvm,
- // "fstype":"LVM",
- // "nr":"var",
- // "region":[255, 16],
- // "type":`primary],
- // $[
- // "fsid":131,
- // "fstype":"Linux native",
- // "nr":4, "region":[271, 844],
- // ...
- //
- // out:
- // [
- // `item(`id(1//dev/hda), "/dev/hda1 ", " /var ", "system", " 1G ", " LVM "),
- // `item(`id(2//dev/hda), "/dev/hda2 ", " /usr ", "system", " 2G ", " Linux ")
- // ];
-
-/*
-define list get_lv_widget_table( list<map> possPvList )
- ``{
- list ret = [];
-
- possPvList =
- sort( map x, map y, possPvList,
- ``{
- if( x["maindev"]:"" == y["maindev"]:"" )
- {
- return( x["nr"]:(any)"" < y["nr"]:(any)"" );
- }
- else
- {
- return( x["maindev"]:"" < y["maindev"]:"" );
- }
- });
-
-
- return( maplist( map partition, possPvList,
- ``{
- return(`item( `id(partition["device"]:"--"),
- partition["device"]:"--",
- partition["mount"]:"",
- partition["lvm_name"]:"",
- partition["size_str"]:"--",
- partition["fstype"]:"--"
- ));
- }
- ));
- };
-*/
-
-
+
}
Modified: trunk/storage/storage/src/include/lvm_pv_lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/lvm_pv_lib.ycp?rev=55902&r1=55901&r2=55902&view=diff
==============================================================================
--- trunk/storage/storage/src/include/lvm_pv_lib.ycp (original)
+++ trunk/storage/storage/src/include/lvm_pv_lib.ycp Tue Mar 3 17:06:59 2009
@@ -56,111 +56,6 @@
};
-/*
-define boolean removePhysicalVolume( map targetMap, string id,
- string current_vg )
- ``{
- map partition = Storage::GetPartition( targetMap, id );
-
- if( partition["fsid"]:0 == Partitions::fsid_lvm &&
- contains( [`primary, `logical], partition["type"]:`none ) )
- {
- Storage::UnchangePartitionId( id );
- }
- boolean ret = Storage::ReduceLvmVg( current_vg, id );
- if( !ret )
- {
- // message popup
- Popup::Error(_("If you remove the selected device from the volume group,
-there will not be enough space for all logical volumes in
-this group. To delete the volume group completely, remove
-its logical volumes first.
-"));
- }
- return( ret );
- };
-*/
-
-//////////////////////////////////////////////////////////////////////
-// belongs the the partition "id" already to a volume group
-//////////////////////////////////////////////////////////////////////
-
-/*
-define boolean isItemPv( map tg, string id )
- ``{
- map part = $[];
- if( haskey( tg, id ))
- part = tg[id]:$[];
- else
- part = Storage::GetPartition( tg, id );
- return( part["used_by_type"]:`UB_NONE == `UB_LVM ||
- part["used_by_type"]:`UB_NONE == `UB_EVMS );
- };
-*/
-
-//////////////////////////////////////////////////////////////////////
-// belongs the the partition "id" already to a volume group
-// if YES: popup a proper Message and return(false)
-//////////////////////////////////////////////////////////////////////
-/*
-define boolean CheckItemIsNotPv( map tg, string id )
- ``{
- if( !isItemPv(tg,id) )
- {
- //////////////
- return( true );
- //////////////
- }
-
- // error case:
- if( id != nil )
- {
- // message popup
- Popup::Message(sformat(_("The item %1 is already a physical volume.
-To add it to a different volume group,
-remove it from its current volume group
-then add it to the new group.
-"), id ));
- }
- else
- {
- // message popup
- Popup::Message(_("You have to select one device in the table"));
- }
- return( false );
- };
-
- //////////////////////////////////////////////////////////////////////
- // belongs the the partition "id" already to a volume group?
- // if NO: popup a proper Message and return(false)
- //////////////////////////////////////////////////////////////////////
-
-define boolean CheckItemIsPv( map tg, string id )
- ``{
- if ( isItemPv(tg,id) )
- {
- //////////////
- return( true );
- //////////////
- }
-
- // error case:
- if ( id != nil )
- {
- // Message popup
- Popup::Message(sformat(_("The item %1 cannot be removed.
-It does not belong to a volume group.
-"), id ));
- }
- else
- {
- //Message popup
- Popup::Message(_("You have to select one device in the table"));
- }
- return( false );
- };
-*/
-
/////////////////////////////////////////////////////////////////
// Get all partitions, we can probably use as physical volumes
// Add needed information: disksize
@@ -237,35 +132,6 @@
};
-/**
- * Check if the user can delete the partition.
- * -> Existing LVM partition with volume group
- * -> size of volume group to small for all logical partition
- */
-/*
-define boolean check_pv_delete( map targetMap, string id,
- string current_vg )
- ``{
- boolean ret = true;
- y2milestone( "check_pv_delete id %1 current_vg: %2", id, current_vg );
- integer num_pvs = size( filter( map p, get_possible_pvs(targetMap),
- ``(p["used_by"]:""==current_vg)));
- y2milestone( "check_pv_delete num_pvs:%1", num_pvs );
- if( num_pvs<=1 )
- {
- // message popup
- Popup::Error(_("You cannot remove the last PV from a volume group.
-Delete the volume group completely instead.
-"));
- y2milestone( "check_pv_delete `nodelete" );
- ret = false;
- }
-
- y2milestone( "check_pv_delete ret:%1", ret );
- return( ret );
- }
-*/
-
boolean check_vgname_dev( string vgname )
{
boolean ret = true;
Modified: trunk/storage/storage/src/include/lvm_ui_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/lvm_ui_dialogs.ycp?rev=55902&r1=55901&r2=55902&view=diff
==============================================================================
--- trunk/storage/storage/src/include/lvm_ui_dialogs.ycp (original)
+++ trunk/storage/storage/src/include/lvm_ui_dialogs.ycp Tue Mar 3 17:06:59 2009
@@ -33,396 +33,6 @@
include "partitioning/custom_part_lib.ycp";
include "partitioning/lvm_lv_lib.ycp";
-/*
-define void handle_max( integer stripe, string max_text )
- ``{
- y2milestone( "stripe %1", stripe );
- UI::ChangeWidget(`id("max_size"), `Enabled, stripe==1 );
- UI::ChangeWidget(`id("max_text"), `Value, stripe==1?max_text:"" );
- }
-*/
-
-/*
-define map DlgCreateEditLogicaVolume( symbol create_or_edit, map Lv,
- integer max_size, string vgname,
- list lvs, map file_systems,
- string dev, integer pesize )
-
- ``{
- y2milestone( "DlgCreateEditLogicaVolume %4 dev=%1 pesize=%2 max_size=%3",
- dev, pesize, max_size, create_or_edit );
- y2milestone( "DlgCreateEditLogicaVolume lvs %1", lvs );
-
- integer new_size = Lv["size_k"]:0 * 1024;
- integer old_size = new_size;
- string curr_size = ByteToHumanStringWithZero(new_size);
- old_size = kmgt_str_to_byte(curr_size);
- string volume_name = Lv["name"]:"";
- integer stripes = Lv["stripes"]:1;
- integer stripesize = Lv["stripesize"]:64;
-
- list stripes_poss = [
- `item(`id(1), "1", stripes == 1 ),
- `item(`id(2), "2", stripes == 2 ),
- `item(`id(3), "3", stripes == 3 ),
- `item(`id(4), "4", stripes == 4 ),
- `item(`id(5), "5", stripes == 5 ),
- `item(`id(6), "6", stripes == 6 ),
- `item(`id(7), "7", stripes == 7 ),
- `item(`id(8), "8", stripes == 8 )
- ];
-
- list stripe_size = [
- `item(`id(4), "4", stripesize == 4 ),
- `item(`id(8), "8", stripesize == 8 ),
- `item(`id(16), "16", stripesize == 16 ),
- `item(`id(32), "32", stripesize == 32 ),
- `item(`id(64), "64", stripesize == 64 ),
- `item(`id(128), "128", stripesize == 128 ),
- `item(`id(256), "256", stripesize == 256 ),
- `item(`id(512), "512", stripesize == 512 ),
- ];
-
- string lv_size = "";
-
- string heading = "";
- boolean is_create_mode = false;
- boolean is_resize_mode = false;
- term ui_volume_name = `Dummy();
- any c_ret = `cancel;
-
- // header for input field size of Logical volume
- string size_txt = sformat(_("&Size: (e.g., %1 %2)"),
- ByteToHumanStringWithZero(4196*1024*1024),
- ByteToHumanStringWithZero(210*1024*1024));
- if( create_or_edit != `create )
- {
- max_size = max_size+new_size;
- y2milestone( "new max_size=%1", max_size );
- }
- y2milestone( "new_size %1", new_size );
- // header for input field maximum allowd size
- string max_text = sformat(_("max = %1 "),
- ByteToHumanStringWithZero(max_size));
-
-
- if( create_or_edit == `create )
- {
- // popup heading
- heading = _("Create Logical Volume");
- is_create_mode = true;
- ui_volume_name = `VBox( `TextEntry(`id("volume_name"),
- // label text
- _("Logical volume &name "),
- volume_name),
- // label text
- `Left(`Label(_("(e.g. var, opt)")))
- );
- }
- else if( create_or_edit == `edit )
- {
- // popup heading
- heading = _("Edit Logical Volume");
- is_create_mode = false;
- // display name of current volume group
- // display name of current volume group
- ui_volume_name = `VBox( `Label(""),
- // label text
- `HBox(`Label( _("Logical volume name: ")),
- `Heading(`opt(`outputField), volume_name ),
- `HStretch()
- ));
- }
- else if( create_or_edit == `resize )
- {
- // popup heading
- heading = _("Edit Logical Volume");
- is_create_mode = false;
- is_resize_mode = true;
- // display name of current volume group
- ui_volume_name = `VBox( `Label(""),
- // label text
- `HBox(`Label( _("Logical volume name: ")),
- `Heading(`opt(`outputField), volume_name ),
- `HStretch()
- )
- );
- }
- else
- {
- // internal error message
- heading = _("INTERNAL ERROR");
- }
-
- y2milestone( "is_create_mode %1 is_resize_mode %2", is_create_mode,
- is_resize_mode );
-
- UI::OpenDialog(
- `opt(`decorated ),
- `HBox(`HWeight(30,
- `HBox(
- `HSpacing(1),
- `HStretch(),
- `VBox(
- `Heading(heading),
- `VStretch(),
- `VSpacing(1),
- `HBox(
- FormatDlg( Lv, file_systems ),
- `HStretch(),
- `HSpacing(2),
- `VBox(
- `Top(`Left(ui_volume_name)),
- `Top(`VBox( `TextEntry(`id("size"), size_txt, curr_size),
- `HBox(
- // set size to maxsize
- `Left(`Label( `id("max_text"), max_text )),
- // button text
- `PushButton( `id("max_size"), _("ma&x")))
-
- )),
- `VStretch(),
- `Left(`ComboBox( `id("stripes"), `opt(`hstretch,`notify),
- // button text
- _("Stri&pes"), stripes_poss )),
- `VStretch(),
- `Left(`ComboBox( `id("stripesize"), `opt(`hstretch,`notify),
- // button text
- _("Stripe &Size"), stripe_size )),
- `VStretch(),
- `VSpacing(1),
- `ReplacePoint( `id(`mount_dlg_rp),
- MountDlg(Lv, []))
- )
- ),
- `VStretch(),
- `VSpacing(1),
- `HBox(
- // Ok button
- `PushButton(`id(`ok), `opt(`default), Label::OKButton() ),
- // Cancel button
- `PushButton(`id(`cancel), Label::CancelButton() )
- )
- ),
- `HStretch(),
- `HSpacing(1)
- )
- )));
-
-
- // configure main dialog for the first call
-
- if( is_create_mode )
- {
- UI::ChangeWidget( `id("volume_name"), `ValidChars,
- FileSystems::nchars + "-._:" );
- }
- UI::ChangeWidget( `id("stripes"), `Enabled, !is_resize_mode );
- UI::ChangeWidget( `id("stripesize"), `Enabled,
- !is_resize_mode && stripes>1 );
- handle_max( stripes, max_text );
-
- ////////////////////////////////////////////////////////////////////
- // User mainloop for dialog
- ////////////////////////////////////////////////////////////////////
-
- boolean input_is_ok = true;
- map retval = eval(Lv);
-
- retval = HandlePartWidgetChanges( true, `ok, file_systems, Lv, retval );
-
- repeat
- {
- input_is_ok = true;
-
- c_ret = UI::UserInput();
-
- /////////////////////////////////////////////////////////
- if( c_ret == "stripes")
- {
- stripes = (integer)UI::QueryWidget(`id("stripes"), `Value);
- UI::ChangeWidget( `id("stripesize"), `Enabled,
- !is_resize_mode && stripes>1 );
- handle_max( stripes, max_text );
- c_ret = `again;
- continue;
- }
-
- /////////////////////////////////////////////////////////
- // stripes
- if( c_ret == "max_size")
- {
- UI::ChangeWidget(`id("size"), `Value, ByteToHumanStringWithZero(max_size));
- c_ret = `again;
- continue;
- }
-
- if( c_ret != `cancel )
- {
- retval = HandlePartWidgetChanges( false, c_ret, file_systems,
- Lv, retval );
- }
-
- if( is_create_mode )
- {
- volume_name = (string)UI::QueryWidget( `id("volume_name"),
- `Value );
- volume_name = deletechars( volume_name, " \t" );
- }
-
- stripes = (integer)UI::QueryWidget(`id("stripes"), `Value);
- stripesize = (integer)UI::QueryWidget(`id("stripesize"), `Value);
- lv_size = (string)UI::QueryWidget(`id("size"), `Value);
-
- y2debug("STRI ---- i%1i", stripes);
- if( c_ret==`ok )
- {
- new_size = kmgt_str_to_byte(lv_size);
-
- if( !check_max_size(new_size, max_size) )
- {
- input_is_ok = false;
- c_ret = `again;
- continue;
- }
- y2milestone( "new_size %1 old_size %2", new_size, old_size );
-
- if( !check_ok_fssize(new_size, retval) )
- {
- input_is_ok = false;
- c_ret = `again;
- continue;
- }
-
- if( is_resize_mode && !retval["format"]:false &&
- new_size!=old_size )
- {
- string mp = retval["inactive"]:false ? "" : retval["mount"]:"";
- if( !CheckResizePossible( true, true, new_size-old_size,
- retval["used_fs"]:`unknown, mp ))
- {
- UI::ChangeWidget(`id("size"), `Value, curr_size );
- c_ret = `again;
- continue;
- }
- }
-
- if( is_create_mode )
- {
- if( !icheck_volume_name(volume_name) )
- {
- input_is_ok = false;
- // error popup text
- // xgettext:no-c-format
- Popup::Error(_("Check your volume name.
-Use names like \"opt\" or \"var\" ...
-Do not use ;/\`',!\"%#"));
- UI::SetFocus(`id("volume_name"));
- c_ret = `again;
- continue;
- }
- else
- {
- if( contains( lvs, volume_name ) )
- {
- input_is_ok = false;
- // error popup text
- Popup::Error(sformat(_("A logical volume named \"%1\" already exists
-in volume group \"%2\". Choose another name
-or cancel this dialog.
-"), volume_name, vgname ));
- UI::SetFocus(`id("volume_name"));
- c_ret = `again;
- continue;
- }
- }
- }
-
- map ret_mp = CheckOkMount( dev, Lv, retval );
- retval = ret_mp["map"]:$[];
- if( !ret_mp["ok"]:false )
- {
- if( ret_mp["field"]:`none != `none )
- UI::SetFocus(`id( ret_mp["field"]:`none ));
- input_is_ok = false;
- c_ret = `again;
- continue;
- }
-
- retval["device"] = "/dev/"+vgname+"/"+volume_name;
- ret_mp = CheckDeviceFinalOk( retval );
- if( !ret_mp["ok"]:false )
- input_is_ok = false;
- else
- retval = ret_mp["map"]:$[];
- }
-
- /////////////////////////////////////////////////////////
- retval["stripes"] = stripes;
- if( stripes>1 )
- {
- retval["stripesize"] = stripesize;
- }
- retval["name"] = volume_name;
- if( new_size!=old_size )
- {
- retval["size_k"] = (new_size+1023)/1024;
- }
- } until ( (c_ret==`ok&&input_is_ok) || c_ret == `cancel );
-
- UI::CloseDialog();
-
- y2milestone( "retval=%1", retval );
-
- if( c_ret != `cancel && input_is_ok )
- {
- return( retval );
- }
- else
- {
- return( nil );
- }
- };
-*/
-
-
- //////////////////////////////////////////////////////////////////////////////
- // Dialog "Create a Volume Group
- //////////////////////////////////////////////////////////////////////////////
-/*
-define boolean HandleEditLv( map targetMap, string device )
- ``{
- boolean ret = false;
- map disk = Storage::GetDisk( targetMap, device );
- integer pesize = disk["cyl_size"]:(4*1024*1024);
-
- map fs = FileSystems::GetAllFileSystems(true, true);
- map Lv = Storage::GetPartition( targetMap, device );
-
- // if Lv is a lvm partition
- if( size(Lv)>0 && Lv["type"]:`primary==`lvm )
- {
- string tmp_vg = disk["name"]:"";
- list size_list = get_lv_size_info( targetMap, tmp_vg );
- integer max_size = size_list[1]:0;
- symbol what = (Lv["create"]:false)?`edit:`resize;
- map createLv = DlgCreateEditLogicaVolume( what, Lv, max_size, tmp_vg,
- [], fs, device, pesize );
- // has an error occured
- if( size(createLv)>0 )
- {
- ret = editLogicalVolume( createLv, tmp_vg );
- }
- }
- else
- {
- // Popup text
- Popup::Error(_("You can only edit logical volumes."));
- }
- y2milestone( "ret %1", ret );
- return( ret );
- }
-*/
define boolean HandleRemoveLv( map targetMap, string id )
``{
@@ -449,135 +59,4 @@
}
-/*
-define boolean HandleRemoveVg( map targetMap, string current_vg )
- ``{
- boolean ret = false;
- integer count = size(get_lv_names(targetMap, current_vg));
- if( count > 0 )
- {
- // Message popup
- Popup::Message(sformat(
-_("The volume group \"%1\" contains at least one logical
-volume. It cannot be removed. Remove all logical volumes then
-remove the volume group.
-"), current_vg));
- }
- else
- {
- // popup text
- if( Popup::ContinueCancel( sformat( _("Really remove the volume group \"%1\"?"), current_vg)))
- {
- ret = removeVolumeGroup( current_vg );
- }
- }
- return( ret );
- }
-
-define map DlgCreateVolumeGroup( list vgm_list )
- ``{
- string vgname = "";
- string pesize = "";
-
- UI::OpenDialog(
- `opt(`decorated ),
- `HBox(
- `HSpacing(2),
- `VBox(
- // popup header
- `Heading(_("Create a Volume Group")),
- // popup description
- `Label( _("Now we have to create a volume group.
-Typically you don't have to change anything,
-but if you are an expert, feel free to change
-our defaults:")),
- // label text
- `TextEntry( `id("vgname"), _("Volume Group &Name:"),
- size(vgm_list)==0?"system":""),
- // label text
- `TextEntry(`id("pesize"), _("&Physical Extent Size"), "4M"),
- `VSpacing(1),
- `HBox(
- // Ok button
- `PushButton(`id(`ok), `opt(`default),
- Label::OKButton() ),
- // Cancel button
- `PushButton(`id(`cancel), Label::CancelButton() )
- ),
- `VSpacing(0.5)
- ),
- `HSpacing(2)
- )
- );
-
- any ret = nil;
- boolean input_is_ok = false;
-
- repeat
- {
- ret = UI::UserInput();
-
- vgname = (string)UI::QueryWidget(`id("vgname"), `Value);
- vgname = deletechars( vgname, " \t" );
- pesize = (string)UI::QueryWidget(`id("pesize"), `Value);
-
- if( ret != `cancel )
- {
- input_is_ok = true;
-
- if( !icheck_pesize(pesize) )
- {
- // error popup text
- Popup::Error(_("The data entered is invalid.
-Insert a physical extent size from
-8KB to 512MB in powers of 2, for example, \"4M\" or \"512K\"
-"));
- input_is_ok = false;
- }
-
- if( !icheck_vgname(vgname) )
- {
- // error popup text
- Popup::Error(_("The data entered is invalid.
-Insert a group name like \"system\" or \"test\".
-Do not use ;/`, in your group name.
-"));
- input_is_ok = false;
- }
-
- if( contains( vgm_list, vgname ) )
- {
- // error popup text
- Popup::Error(sformat(_("The volume group \"%1\" already exists.
-Choose a different name
-or cancel this dialog.
-"), vgname ));
- input_is_ok = false;
- }
- if( !check_vgname_dev( vgname ) )
- {
- // error popup text
- Popup::Error(sformat(_("The volume group name \"%1\" conflicts
-with another entry in the /dev directory.\n"), vgname ));
- input_is_ok = false;
- }
- }
-
- } until( input_is_ok || ret == `cancel );
-
- UI::CloseDialog();
-
- if (ret == `ok )
- {
- map ret = $[ "vgname" : vgname, "pesize" : pesize_str_to_byte (pesize) ];
- ret["lvm2"] = true;
- return( ret );
- }
- else
- {
- return( $[] );
- }
- };
-*/
-
}
Modified: trunk/storage/storage/src/modules/FileSystems.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/FileSystems.ycp?rev=55902&r1=55901&r2=55902&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/FileSystems.ycp (original)
+++ trunk/storage/storage/src/modules/FileSystems.ycp Tue Mar 3 17:06:59 2009
@@ -1089,49 +1089,6 @@
}
-/*
- global define string GetMakeFsType( symbol used_fs , string defaultv )``{
- map fsmap = GetFsMap( used_fs);
- string ret = fsmap[`makefstype ]:"";
- if( ret == "" ) ret = defaultv;
- return ret;
- }
-*/
-
-
- /**
- * Load the kernel module which is necessary to mount a partition with used_fs!
- * @param used_fs filesystem
- * @return boolean
- * old load_fs_module
- */
-/*
-global define boolean LoadModule( symbol used_fs )
- ``{
-
- list<string> all_needed_modules = GetNeededModules( used_fs );
- y2milestone("all needed modules for %1: %2", used_fs, all_needed_modules );
- boolean load_success = true;
-
- SCR::UnmountAgent (.proc.modules);
- map loaded_modules = (map) SCR::Read(.proc.modules);
- y2milestone( "loaded_modules %1", loaded_modules );
-
- foreach( string modulename, all_needed_modules,
- ``{
- if( modulename != "" && size (loaded_modules[modulename]:$[])==0 )
- {
- if( load_success )
- load_success = (boolean) SCR::Execute(.target.modprobe, modulename , "" );
-
- y2milestone ("Loaded fs module %1 %2", modulename, load_success?"Ok":"Failed");
- }
- });
- return load_success;
- };
-*/
-
-
global define integer MinFsSizeK( symbol fsys )
``{
map cap = capabilities[`unknown]:$[];
@@ -1233,60 +1190,6 @@
}
-/*
-global define boolean SetVolumeLabel( string dev, map part )
- ``{
- boolean ret = false;
- string cmd = "";
- symbol fs = part["used_fs"]:`unknown;
- string label = part["label"]:"";
- y2milestone( "SetVolumeLabel dev:%1 fs:%2 label:%3", dev, fs, label );
- if( fs == `ext2 || fs == `ext3 )
- {
- cmd = sformat("/sbin/tune2fs -L \"%1\" %2", label, dev );
- }
- else if( fs == `xfs )
- {
- if( size(label)==0 )
- label = "--";
- cmd = sformat("/usr/sbin/xfs_admin -L %1 %2", label, dev );
- }
- else if( fs == `reiser )
- {
- cmd = sformat("/sbin/reiserfstune -l \"%1\" %2", label, dev );
- }
- if( size(cmd)>0 )
- {
- y2milestone( "Excuting cmd:%1", cmd );
- ret = SCR::Execute(.target.bash, cmd ) == 0;
- // /sbin/reiserfstune always seems to return 1 even on success
- if( fs == `reiser )
- ret = true;
- }
- y2milestone( "SetVolumeLabel ret:%1", ret );
- return( ret );
- };
-
-global define void DoChangedFsDefaults( map part )
- ``{
- string cmd = "";
- symbol fs = part["used_fs"]:`unknown;
- string dev = part["device"]:"";
- if( haskey( part, "loop_dev" ))
- {
- dev = part["loop_dev"]:"";
- }
- if( fs == `ext3 )
- {
- y2milestone( "dev:%1 fs:%2", dev, fs );
- cmd = sformat("/sbin/tune2fs -c %1 -i %2 %3", 500, "2m", dev );
- y2milestone( "Excuting cmd:%1", cmd );
- SCR::Execute(.target.bash, cmd );
- }
- };
-*/
-
-
global define boolean IsCryptMp( string mount, boolean prefix )
``{
boolean ret = contains( crypt_m_points, mount );
Modified: trunk/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=55902&r1=55901&r2=55902&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Tue Mar 3 17:06:59 2009
@@ -229,27 +229,6 @@
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" : $[],
@@ -775,74 +754,6 @@
/**
- * 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
*/
@@ -1111,132 +1022,6 @@
return( target );
}
-/*
-global define list FindFstabLines( map fstab, string mount, string device,
- string uuid, string label )
- ``{
- list<integer> 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<string> 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 )
{
@@ -2007,53 +1792,6 @@
/**
- * 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
@@ -3027,27 +2765,6 @@
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 )
{
@@ -4316,25 +4033,6 @@
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<map> 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
@@ -4939,70 +4637,6 @@
}
-/*
-global define boolean DiskmapNeeded()
- ``{
- boolean ret = false;
- map real_disks = filter( string k, map e, GetTargetMap(), ``(IsRealDisk( e )) );
- list<string> disks = (list<string>) 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<string> GetDirPatterns( string dir, list patterns )
- ``{
- list<string> ret = [];
- string cmd = sformat( "cd %1 && (ls %2 2>/dev/null)", dir,
- mergestring( (list<string>)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 = $[];
@@ -5539,199 +5173,6 @@
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 <string> disks List of disks
- */
-/*
-global define list<string> GetUsedRealDisksNew( map tg,
- boolean ignore_boot )
- ``{
- list<string> 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<string> GetUsedRealDisks( map tg )
- {
- return( GetUsedRealDisksNew( tg, false ));
- };
-*/
-
-/*
-global define list<string> GetEvmsRealDisk( map tg, map p )
- ``{
- list<string> 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<string> dl = [ disk ];
- if( disk=="/dev/md" )
- {
- list<map> 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<string>)sort( dl );
- dl = (list<string>)toset( dl );
- y2milestone( "GetEvmsRealDisk dl %1", dl );
- }
- rdisk = (list<string>)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<string> GetUsedEvmsDisks( map tg )
- ``{
- list<string> 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<string> dl = GetEvmsRealDisk( tg, p );
- foreach( string d, dl,
- ``{
- y2milestone( "GetUsedEvmsDisks d %1", d );
- if( search( d, "/dev/md" ) == 0 )
- {
- list<string> 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<string>)union( disks, ndl );
- }
- else
- {
- disks = (list<string>)union( disks, [d] );
- }
- });
- }
- });
- }
- });
- disks = sort( disks );
- y2milestone( "GetUsedEvmsDisks ret %1", disks );
- return( disks );
- };
-*/
-
-/*
-global list<map> GetPrepBoot( map tg )
- {
- list<map> ret = [];
- list cl = [ 0x06, 0x41 ];
- foreach( string s, map e, tg,
- ``{
- if( IsRealDisk( e ) && Partitions::PrepBoot() )
- ret = (list<map>)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 )
{
@@ -5758,59 +5199,6 @@
if( Stage::initial() )
{
HandleModulesOnBoot( tg );
-/*
- list evms = GetUsedEvmsDisks( tg );
- y2milestone( "FinishInstall evms %1", evms );
- if( size(evms)>0 )
- CallInsserv( true, "evms" );
- list<string> 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<string>)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;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org