Mailinglist Archive: yast-commit (396 mails)

< Previous Next >
[yast-commit] r65294 - in /trunk/storage: package/ storage/src/include/ storage/src/modules/
Author: fehr
Date: Tue Aug 9 16:31:59 2011
New Revision: 65294

URL: http://svn.opensuse.org/viewcvs/yast?rev=65294&view=rev
Log:
fix bugs in subvolume handling during install

Modified:
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/custom_part_dialogs.ycp
trunk/storage/storage/src/include/custom_part_lib.ycp
trunk/storage/storage/src/include/ep-dialogs.ycp
trunk/storage/storage/src/modules/Storage.ycp

Modified: trunk/storage/package/yast2-storage.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=65294&r1=65293&r2=65294&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Tue Aug 9 16:31:59 2011
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Aug 9 16:29:08 CEST 2011 - fehr@xxxxxxx
+
+- fix bugs in subvolume handling during install
+
+-------------------------------------------------------------------
Fri Aug 5 12:35:24 CEST 2011 - tgoettlicher@xxxxxxx

- fixed .desktop file (bnc #681249)

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=65294&r1=65293&r2=65294&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_dialogs.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_dialogs.ycp Tue Aug 9
16:31:59 2011
@@ -1345,13 +1345,20 @@
{
string pth = (string)UI::QueryWidget(`id(`subvol), `CurrentItem);
y2milestone( "SubvolHandling remove path:%1", pth );
+ y2milestone( "SubvolHandling remove subvol:%1", new["subvol"]:[] );
new["subvol"] = maplist( map p, new["subvol"]:[],
{
if( p["name"]:""==pth )
+ {
p["delete"] = true;
+ if( haskey( p, "create" ))
+ p = remove( p, "create" );
+ }
return p;
});
+ y2milestone( "SubvolHandling remove subvol:%1", new["subvol"]:[] );
items = SubvolNames( new );
+ y2milestone( "SubvolHandling remove items:%1", items );
changed = true;
UI::ChangeWidget( `id(`subvol), `Items, items );
}
@@ -1359,9 +1366,10 @@
{
string pth = (string)UI::QueryWidget( `id(`new_path), `Value );
y2milestone( "SubvolHandling add path:%1", pth );
+ y2milestone( "SubvolHandling names:%1", SubvolNames( new ) );
if( pth==nil || size(pth)==0 )
Popup::Message(_("Empty subvolume name not allowed."));
- else if( size(filter( map p, new["subvol"]:[],
``(p["name"]:""==pth)))>0 )
+ else if( size(filter( string s, SubvolNames( new ), ``(s==pth)))>0 )
Popup::Message(sformat(_("Subvolume name %1 already
exists."),pth));
else
{

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=65294&r1=65293&r2=65294&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_lib.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_lib.ycp Tue Aug 9 16:31:59
2011
@@ -24,6 +24,7 @@
import "Partitions";
import "Product";
import "FileSystems";
+ import "Greasemonkey";

include "partitioning/partition_defines.ycp";

@@ -370,6 +371,49 @@
return( ret );
}

+define term SubvolPart( boolean can_do_subvol )
+ {
+ term subvol = `Empty();
+ if( can_do_subvol )
+ subvol = `FrameWithMarginBox("", `PushButton( `id(`subvol),
`opt(`hstretch),
+ // button text
+ _("Subvolume Handling")));
+ return( Greasemonkey::Transform(subvol) );
+ }
+
+map<string,any> HandleSubvol( map<string,any> data )
+ {
+ map<string,any> ret = data;
+ if( ret["mount"]:""=="/" )
+ {
+ y2milestone( "before HandleSubvol fs:%1", ret["used_fs"]:`unknown );
+ y2milestone( "before HandleSubvol subvol:%1", ret["subvol"]:[] );
+ if( ret["used_fs"]:`unknown==`btrfs )
+ {
+ if( ret["format"]:false )
+ {
+ list<map> lsc = filter( map s, ret["subvol"]:[],
+ ``(s["create"]:false));
+ y2milestone( "HandleSubvol list:%1", lsc );
+ if( size(lsc)==0 )
+ {
+ ret = (map<string,any>)Storage::AddSubvolRoot( ret );
+ y2milestone( "HandleSubvol AddSubvolRoot subvol:%1",
ret["subvol"]:[] );
+ }
+ }
+ else
+ ret["subvol"] = filter( map s, ret["subvol"]:[],
+
``(!s["create"]:false&&!s["delete"]:false));
+ }
+ else
+ ret["subvol"] = [];
+ y2milestone( "after HandleSubvol subvol:%1", ret["subvol"]:[] );
+ }
+ else
+ ret["subvol"] = [];
+ return( ret );
+ }
+
map pkg_for_fs = $[
`ext2 : [ "e2fsprogs" ],
`ext3 : [ "e2fsprogs" ],
@@ -432,7 +476,7 @@
if( apply_change && UI::WidgetExists( `id(`crypt_fs)) )
{
boolean cr = selected_fs[`crypt]:true &&
- new["type"]:`primary!=`btrfs;
+ new["used_fs"]:`unknown!=`btrfs;
y2milestone( "HandleFsChanged cr:%1", cr );

UI::ChangeWidget( `id(`crypt_fs), `Enabled, cr );
@@ -443,6 +487,15 @@
}
}

+ if( !init && apply_change && UI::WidgetExists( `id(`subvol_rp)) )
+ {
+ boolean sv = new["used_fs"]:`unknown==`btrfs;
+ y2milestone( "HandleFsChanged sv:%1", sv );
+ UI::ReplaceWidget( `id(`subvol_rp), SubvolPart(sv) );
+ if( UI::WidgetExists( `id(`subvol)) )
+ UI::ChangeWidget( `id(`subvol), `Enabled, sv );
+ }
+
if( apply_change )
{
////////////////////////////////////////////////
@@ -494,6 +547,8 @@
{
new["fs_options"] = FileSystems::DefaultFormatOptions(new);
new["fstopt"] = fstopt;
+ y2milestone( "HandleFsChanged fstopt:%1 new[\"fstopt\"]:%2",
+ fstopt, new["fstopt"]:"" );

integer max_len = FileSystems::LabelLength( used_fs );
if( size(new["label"]:"") > max_len )
@@ -510,6 +565,8 @@
{
new["label"] = "";
}
+ if( used_fs!=`btrfs )
+ new["subvol"] = [];
}
}
y2milestone( "HandleFsChanged new %1", new );
@@ -535,11 +592,16 @@
new = filter(string key, any value, new, ``( key != "fstopt"));
}
}
- if( !init && ret == `mount_point &&
- UI::WidgetExists( `id(`fstab_options) ))
+ if( !init && ret==`mount_point )
{
string mp = (string)UI::QueryWidget(`id(`mount_point), `Value);
- UI::ChangeWidget( `id(`fstab_options), `Enabled, !isempty(mp) );
+ if( new["mount"]:""!=mp )
+ {
+ new["mount"] = mp;
+ new = HandleSubvol( new );
+ }
+ if( UI::WidgetExists( `id(`fstab_options) ))
+ UI::ChangeWidget( `id(`fstab_options), `Enabled, !isempty(mp) );
}
if( (init && UI::WidgetExists( `id(`format))) ||
ret == `do_format || ret == `do_not_format)
@@ -577,6 +639,7 @@
if( new["used_fs"]:`unknown != old["used_fs"]:`unknown )
new = HandleFsChanged( init, new, old["used_fs"]:`unknown,
file_systems );
+ new = HandleSubvol( new );
if( format )
{
new["fs_options"] = FileSystems::DefaultFormatOptions(new);
@@ -644,6 +707,7 @@
UI::ChangeWidget( `id(`fsid_point), `Value,
selected_fs[`fsid_item]:"");
}
+ new = HandleSubvol( new );
}
}
}
@@ -709,7 +773,6 @@
}
if( ret == `fstab_options )
{
- new["mount"] = UI::QueryWidget( `id(`mount_point), `Value );
new = FstabOptions( old, new );
}
if( ret == `subvol )

Modified: trunk/storage/storage/src/include/ep-dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-dialogs.ycp?rev=65294&r1=65293&r2=65294&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-dialogs.ycp (original)
+++ trunk/storage/storage/src/include/ep-dialogs.ycp Tue Aug 9 16:31:59 2011
@@ -181,18 +181,16 @@
_("Do not mount partition"));
}

- term subvol = `Empty();
- if( data["used_fs"]:`unknown==`btrfs )
- {
- subvol = `FrameWithMarginBox("", `PushButton( `id(`subvol),
`opt(`hstretch),
- // button text
- _("Subvolume
Handling")));
- }
+ term subvol =
+ `ReplacePoint( `id(`subvol_rp),
+ SubvolPart(data["used_fs"]:`unknown==`btrfs) );

list mountpoints = ProposeMountpoints( used_fs, mount );

- term contents = `HVSquash(`VStackFrames(
- fmt,
+ term contents = `HVSquash(
+ `HBox( fmt,
+ `HSpacing(1),
+ `VStackFrames(
`FrameWithMarginBox(_("Mounting Options"),
`RadioButtonGroup(`id(`mount),
`VBox(
@@ -210,9 +208,10 @@
notmnt
))
),
- subvol
- )
- );
+ subvol,
+ `VStretch()
+ ))
+ );

MiniWorkflow::SetContents(Greasemonkey::Transform(contents),
MiniWorkflowStepFormatMountHelptext());

@@ -449,18 +448,6 @@

if (!data["format"]:false)
data = filter(string key, any value, data, { return key !=
"fs_options"; });
- if( data["mount"]:""=="/" && data["used_fs"]:`unknown==`btrfs &&
- data["format"]:false )
- {
- y2milestone( "before AddSubvolRoot subvol:%1",
data["subvol"]:[] );
- list<map> lsc = filter( map s, data["subvol"]:[],
``(s["create"]:false));
- y2milestone( "before AddSubvolRoot list:%1", lsc );
- if( size(lsc)==0 )
- {
- data = (map<string,any>)Storage::AddSubvolRoot( data );
- y2milestone( "after AddSubvolRoot subvol:%1",
data["subvol"]:[] );
- }
- }

if (contains([`primary, `extended, `logical],
data["type"]:`unknown))
if (data["fsid"]:0 != orig_data["fsid"]:0)

Modified: trunk/storage/storage/src/modules/Storage.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=65294&r1=65293&r2=65294&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Tue Aug 9 16:31:59 2011
@@ -1707,9 +1707,34 @@
ls = splitstring(
LibStorage::BtrfsInfo::swig_devices_rem_get(info), "\n" );
if( size(ls)>0 )
c["devices_rem"] = ls;
+ list<map> li = [];
+ p["subvol"] = li;
ls = splitstring(LibStorage::BtrfsInfo::swig_subvol_get(info),
"\n");
if( !isempty(ls) )
- p["subvol"] = maplist( string s, ls, ``{ map m = $[ "name" : s
]; return( m ); });
+ {
+ li = maplist( string s, ls,
+ ``{ map m = $[ "name" : s ]; return( m ); });
+ p["subvol"] = li;
+ y2milestone( "subvol:%1", p["subvol"]:[] );
+ }
+ ls = splitstring(LibStorage::BtrfsInfo::swig_subvol_add_get(info),
"\n");
+ if( !isempty(ls) )
+ {
+ li = maplist( string s, ls,
+ ``{ map m = $[ "create":true, "name" : s ];
+ return( m ); });
+ p["subvol"] = union( p["subvol"]:[], li );
+ y2milestone( "subvol:%1", p["subvol"]:[] );
+ }
+ ls = splitstring(LibStorage::BtrfsInfo::swig_subvol_rem_get(info),
"\n");
+ if( !isempty(ls) )
+ {
+ li = maplist( string s, ls,
+ ``{ map m = $[ "delete":true, "name" : s ];
+ return( m ); });
+ p["subvol"] = union( p["subvol"]:[], li );
+ y2milestone( "subvol:%1", p["subvol"]:[] );
+ }
if( size(p["devices"]:[])+size(p["devices_add"]:[])>1 )
p["device"] = "UUID=" + p["uuid"]:"";
c["partitions"] = add( c["partitions"]:[], p );
@@ -2647,29 +2672,35 @@
y2milestone( "ChangeVolumeProperties cre:%1", cre );
while( ret==0 && size(rem)>0 )
{
- changed = true;
string pth = rem[0,"name"]:"";
- ret = LibStorage::StorageInterface::removeSubvolume( sint, d, pth );
- if( ret<0 )
- y2error( "ChangeVolumeProperties sint ret:%1", ret );
- else
+ if( LibStorage::StorageInterface::existSubvolume( sint, d, pth ))
{
- y2milestone( "ChangeVolumeProperties sint ret:%1", ret );
- rem = remove( rem, 0 );
+ changed = true;
+ ret = LibStorage::StorageInterface::removeSubvolume( sint, d,
pth );
+ if( ret<0 )
+ y2error( "ChangeVolumeProperties sint ret:%1", ret );
+ else
+ {
+ y2milestone( "ChangeVolumeProperties sint ret:%1", ret );
+ }
}
+ rem = remove( rem, 0 );
}
while( ret==0 && size(cre)>0 )
{
- changed = true;
string pth = cre[0,"name"]:"";
- ret = LibStorage::StorageInterface::createSubvolume( sint, d, pth );
- if( ret<0 )
- y2error( "ChangeVolumeProperties sint ret:%1", ret );
- else
+ if( !LibStorage::StorageInterface::existSubvolume( sint, d, pth ))
{
- y2milestone( "ChangeVolumeProperties sint ret:%1", ret );
- cre = remove( cre, 0 );
+ changed = true;
+ ret = LibStorage::StorageInterface::createSubvolume( sint, d,
pth );
+ if( ret<0 )
+ y2error( "ChangeVolumeProperties sint ret:%1", ret );
+ else
+ {
+ y2milestone( "ChangeVolumeProperties sint ret:%1", ret );
+ }
}
+ cre = remove( cre, 0 );
}
}
if( ret==0 )

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages