Author: fehr
Date: Mon May 30 19:06:15 2011
New Revision: 64155
URL: http://svn.opensuse.org/viewcvs/yast?rev=64155&view=rev
Log:
add default subvol list to root fs
Modified:
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc
branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/ep-dialogs.ycp
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp
Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc?rev=64155&r1=64154&r2=64155&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc Mon May 30 19:06:15 2011
@@ -117,7 +117,7 @@
list<Subvolume>::iterator i=subvol.begin();
while( i!=subvol.end() && !i->deleted() && i->path()!=name )
++i;
- if( i==subvol.end() )
+ if( i==subvol.end() || getFormat() )
{
Subvolume v( name );
v.setCreated();
Modified: branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes?rev=64155&r1=64154&r2=64155&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Mon May 30 19:06:15 2011
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Mon May 30 18:32:40 CEST 2011 - fehr@suse.de
+
+- add default subvol list to root fs
+
+-------------------------------------------------------------------
Mon May 30 15:18:54 CEST 2011 - aschnell@suse.de
- increased major version number of library (bnc#627422)
Modified: branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp?rev=64155&r1=64154&r2=64155&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp Mon May 30 19:06:15 2011
@@ -1266,7 +1266,13 @@
list<string> SubvolNames( map data )
{
list<string> items = maplist( map p,
- filter( map s, data["subvol"]:[], ``(!s["delete"]:false)),
+ filter( map s, data["subvol"]:[],
+ {
+ if( data["format"]:false )
+ return( s["create"]:false );
+ else
+ return( !s["delete"]:false );
+ }),
{return p["name"]:"";});
y2milestone( "items:%1", items );
return( items );
Modified: branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/ep-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/ep-dialogs.ycp?rev=64155&r1=64154&r2=64155&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/ep-dialogs.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/ep-dialogs.ycp Mon May 30 19:06:15 2011
@@ -449,6 +449,18 @@
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)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: branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp?rev=64155&r1=64154&r2=64155&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp Mon May 30 19:06:15 2011
@@ -514,6 +514,8 @@
global define void SetTargetMap( map target );
global define map SetPartitionData( map target, string device,
string key, any value );
+global define map DelPartitionData( map target, string device,
+ string key );
define list<map> GetDiskPartitionTg( string device, map tg )
@@ -1804,13 +1806,26 @@
filter( map p, tg["/dev/btrfs","partitions"]:[],
``(size(p["devices"]:[])>1));
y2milestone( "HandleBtrfsSimpleVolumes simple %1", simple );
- list<string> keys = [ "subvol", "uuid", "format", "fstype", "inactive", "mount", "mountby", "used_fs" ];
+ list<string> keys = [ "subvol", "uuid", "format", "inactive", "mount", "mountby", "used_fs" ];
foreach( map p, simple,
{
- y2milestone( "HandleBtrfsSimpleVolumes before %1", GetPartition( tg, p["device"]:"" ));
+ map mp = GetPartition( tg, p["device"]:"" );
+ y2milestone( "HandleBtrfsSimpleVolumes before %1", mp );
foreach( string k, keys,
{
- tg = SetPartitionData( tg, p["device"]:"", k, p[k]:(any)"" );
+ if( p[k]:nil!=nil )
+ {
+ y2milestone( "HandleBtrfsSimpleVolumes set key %1", k );
+ tg = SetPartitionData( tg, p["device"]:"", k, p[k]:nil );
+ }
+ else
+ {
+ if( haskey( mp, k ));
+ {
+ y2milestone( "HandleBtrfsSimpleVolumes remove key %1", k );
+ tg = DelPartitionData( tg, p["device"]:"", k );
+ }
+ }
});
y2milestone( "HandleBtrfsSimpleVolumes after %1", GetPartition( tg, p["device"]:"" ));
});
@@ -4233,6 +4248,15 @@
}
+global define map AddSubvolRoot( map part )
+ {
+ list<string> def_subvol = [ "tmp", "var/tmp", "var/run" ];
+ part["subvol"] = maplist( string s, def_subvol,
+ { return $[ "create":true, "name":s ]; });
+ y2milestone( "AddSubvolRoot part:%1", part );
+ return( part );
+ }
+
global define map SetVolOptions( map p, string mnt, symbol fs, string fs_opts,
string fstab_opts, string label )
{
@@ -4281,9 +4305,7 @@
}
if( ret["format"]:false && ret["used_fs"]:`unknown==`btrfs && mnt=="/" )
{
- list<string> def_subvol = [ "tmp", "var/tmp", "var/run" ];
- ret["subvol"] = maplist( string s, def_subvol,
- { return $[ "create" :true, "name" :s ]; });
+ ret = AddSubvolRoot( ret );
}
if( size(fstab_opts)>0 )
ret["fstopt"] = fstab_opts;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org