Author: aschnell Date: Mon May 4 14:25:37 2009 New Revision: 57051 URL: http://svn.opensuse.org/viewcvs/yast?rev=57051&view=rev Log: - work on ext4 support (fate #305691) Modified: trunk/autoinstallation/src/include/autopart.ycp trunk/packager/src/modules/SourceDialogs.ycp trunk/s390/src/xpram/ui.ycp trunk/storage/libstorage/examples/TestProbing.cc trunk/storage/libstorage/src/Storage.cc trunk/storage/libstorage/src/StorageInterface.h trunk/storage/libstorage/src/Volume.cc trunk/storage/libstorage/testsuite/format1.cc trunk/storage/package/yast2-storage.changes trunk/storage/storage/doc/README.part.info trunk/storage/storage/src/include/custom_part_dialogs.ycp trunk/storage/storage/src/include/custom_part_lib.ycp trunk/storage/storage/src/include/ep-settings.ycp trunk/storage/storage/src/modules/FileSystems.ycp trunk/storage/storage/src/modules/Partitions.ycp trunk/storage/storage/src/modules/Storage.ycp trunk/update/src/modules/RootPart.ycp Modified: trunk/autoinstallation/src/include/autopart.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/include/autopart.ycp?rev=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/autoinstallation/src/include/autopart.ycp (original) +++ trunk/autoinstallation/src/include/autopart.ycp Mon May 4 14:25:37 2009 @@ -37,7 +37,7 @@ !p["format"]:false && !Partitions::IsLinuxPartition(p["fsid"]:0)) ); - l = filter(map p, l, ``(!contains( [`xfs, `ext2, `ext3, `jfs, `reiser], + l = filter(map p, l, ``(!contains( [`xfs, `ext2, `ext3, `ext4, `jfs, `reiser], p["used_fs"]:`unknown))); l = filter(map p, l, ``(!FileSystems::IsSystemMp( p["mount"]:"", false ))); Modified: trunk/packager/src/modules/SourceDialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/SourceDialogs.ycp?rev=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/packager/src/modules/SourceDialogs.ycp (original) +++ trunk/packager/src/modules/SourceDialogs.ycp Mon May 4 14:25:37 2009 @@ -959,7 +959,7 @@ void SetFileSystems(string selected_fs) { - list<string> fs_list = ["auto", "vfat", "ntfs", "ntfs-3g", "ext2", "ext3", "reiserfs", "xfs", "jfs", "iso9660"]; + list<string> fs_list = ["auto", "vfat", "ntfs", "ntfs-3g", "ext2", "ext3", "ext4", "reiserfs", "xfs", "jfs", "iso9660"]; list<term> items = maplist(string fs, fs_list, { Modified: trunk/s390/src/xpram/ui.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/xpram/ui.ycp?rev=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/s390/src/xpram/ui.ycp (original) +++ trunk/s390/src/xpram/ui.ycp Mon May 4 14:25:37 2009 @@ -46,7 +46,7 @@ string fstype = Xpram::fstype; list m_points = [ "swap", "/home2" ]; - list f_types = [ "ext2", "ext3", "swap" ]; + list f_types = [ "ext2", "ext3", "ext4", "swap" ]; term con = `HBox (`HSpacing (3), `VBox ( `VSpacing (2), Modified: trunk/storage/libstorage/examples/TestProbing.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/examples/TestProbing.cc?rev=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/storage/libstorage/examples/TestProbing.cc (original) +++ trunk/storage/libstorage/examples/TestProbing.cc Mon May 4 14:25:37 2009 @@ -54,6 +54,7 @@ case REISERFS: cout << "REISERFS"; break; case EXT2: cout << "EXT2"; break; case EXT3: cout << "EXT3"; break; + case EXT4: cout << "EXT4"; break; case VFAT: cout << "VFAT"; break; case XFS: cout << "XFS"; break; case JFS: cout << "JFS"; break; Modified: trunk/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc?rev=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/storage/libstorage/src/Storage.cc (original) +++ trunk/storage/libstorage/src/Storage.cc Mon May 4 14:25:37 2009 @@ -4438,6 +4438,9 @@ static FsCapabilitiesX ext3Caps (true, true, true, false, true, true, true, 16, 10*1024); + static FsCapabilitiesX ext4Caps (true, true, true, false, true, true, + true, 16, 32*1024); + static FsCapabilitiesX xfsCaps (true, true, false, false, true, true, false, 12, 40*1024); @@ -4476,6 +4479,10 @@ fscapabilities = ext3Caps; return true; + case EXT4: + fscapabilities = ext4Caps; + return true; + case XFS: fscapabilities = xfsCaps; return true; Modified: trunk/storage/libstorage/src/StorageInterface.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageInterface.h?rev=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/storage/libstorage/src/StorageInterface.h (original) +++ trunk/storage/libstorage/src/StorageInterface.h Mon May 4 14:25:37 2009 @@ -96,7 +96,8 @@ namespace storage { - enum FsType { FSUNKNOWN, REISERFS, EXT2, EXT3, VFAT, XFS, JFS, HFS, NTFS, SWAP, HFSPLUS, NFS, FSNONE }; + enum FsType { FSUNKNOWN, REISERFS, EXT2, EXT3, EXT4, VFAT, XFS, JFS, HFS, NTFS, SWAP, HFSPLUS, + NFS, FSNONE }; enum PartitionType { PRIMARY, EXTENDED, LOGICAL, PTYPE_ANY }; Modified: trunk/storage/libstorage/src/Volume.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Volume.cc?rev=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/storage/libstorage/src/Volume.cc (original) +++ trunk/storage/libstorage/src/Volume.cc Mon May 4 14:25:37 2009 @@ -432,6 +432,10 @@ { fs = EXT3; } + else if( i->second == "ext4" ) + { + fs = EXT4; + } else if( i->second == "vfat" ) { fs = VFAT; @@ -729,10 +733,19 @@ switch( fs ) { - case EXT2: + case EXT2: + cmd = "/sbin/mke2fs"; + params = "-t ext2 -v"; + progressbar = new Mke2fsProgressBar( cb ); + break; case EXT3: cmd = "/sbin/mke2fs"; - params = (fs==EXT2) ? "-v" : "-j -v"; + params = "-t ext3 -v"; + progressbar = new Mke2fsProgressBar( cb ); + break; + case EXT4: + cmd = "/sbin/mke2fs"; + params = "-t ext4 -v"; progressbar = new Mke2fsProgressBar( cb ); break; case REISERFS: @@ -787,40 +800,64 @@ } delete progressbar; } - if( ret==0 && fs==EXT3 ) + + if (ret == 0) + { + switch (fs) { - if (!tunefs_opt.empty()) + case EXT3: { - string cmd = "/sbin/tune2fs " + tunefs_opt + " " + quote(mountDevice()); - SystemCmd c( cmd ); - if( c.retcode()!=0 ) - ret = VOLUME_TUNE2FS_FAILED; + if (!tunefs_opt.empty()) + { + string cmd = "/sbin/tune2fs " + tunefs_opt + " " + quote(mountDevice()); + SystemCmd c( cmd ); + if( c.retcode()!=0 ) + ret = VOLUME_TUNE2FS_FAILED; + } + + if( ret==0 && mp=="/" && + (fstab_opt.find( "data=writeback" )!=string::npos || + fstab_opt.find( "data=journal" )!=string::npos) ) + { + string cmd = "/sbin/tune2fs -o "; + if( fstab_opt.find( "data=writeback" )!=string::npos ) + cmd += "journal_data_writeback "; + else + cmd += "journal_data "; + cmd += quote(mountDevice()); + SystemCmd c( cmd ); + if( c.retcode()!=0 ) + ret = VOLUME_TUNE2FS_FAILED; + } } - if( ret==0 && mp=="/" && - (fstab_opt.find( "data=writeback" )!=string::npos || - fstab_opt.find( "data=journal" )!=string::npos) ) - { - string cmd = "/sbin/tune2fs -o "; - if( fstab_opt.find( "data=writeback" )!=string::npos ) - cmd += "journal_data_writeback "; - else - cmd += "journal_data "; - cmd += quote(mountDevice()); - SystemCmd c( cmd ); - if( c.retcode()!=0 ) - ret = VOLUME_TUNE2FS_FAILED; + break; + + case EXT4: + { + if (!tunefs_opt.empty()) + { + string cmd = "/sbin/tune2fs " + tunefs_opt + " " + quote(mountDevice()); + SystemCmd c( cmd ); + if( c.retcode()!=0 ) + ret = VOLUME_TUNE2FS_FAILED; + } } - } - if( ret==0 && fs==REISERFS ) - { - if (!tunefs_opt.empty()) + break; + + case REISERFS: { - string cmd = "/sbin/reiserfstune " + tunefs_opt + " " + quote(mountDevice()); - SystemCmd c( cmd ); - if( c.retcode()!=0 ) - ret = VOLUME_TUNEREISERFS_FAILED; + if (!tunefs_opt.empty()) + { + string cmd = "/sbin/reiserfstune " + tunefs_opt + " " + quote(mountDevice()); + SystemCmd c( cmd ); + if( c.retcode()!=0 ) + ret = VOLUME_TUNEREISERFS_FAILED; + } } + break; } + } + if( ret==0 ) { triggerUdevUpdate(); @@ -1212,6 +1249,7 @@ break; case EXT2: case EXT3: + case EXT4: cmd = "/sbin/resize2fs -f " + quote(mountDevice()); if( needShrink() ) cmd += " " + decString(size_k) + "K"; @@ -1657,8 +1695,13 @@ switch( detected_fs ) { case EXT2: + cmd = "/sbin/fsck.ext2 -n -f " + quote(use_dev); + break; case EXT3: - cmd = "fsck.ext2 -n -f " + quote(use_dev); + cmd = "/sbin/fsck.ext3 -n -f " + quote(use_dev); + break; + case EXT4: + cmd = "/sbin/fsck.ext4 -n -f " + quote(use_dev); break; case REISERFS: cmd = "reiserfsck --yes --check -q " + quote(use_dev); @@ -1991,6 +2034,7 @@ { case EXT2: case EXT3: + case EXT4: cmd = "/sbin/tune2fs -L " + quote(label) + " " + quote(mountDevice()); break; case REISERFS: @@ -3075,9 +3119,9 @@ return( find( tmp_mount, end, mp )!=end ); } -string Volume::fs_names[] = { "unknown", "reiserfs", "ext2", "ext3", "vfat", - "xfs", "jfs", "hfs", "ntfs", "swap", "hfsplus", - "nfs", "none" }; +string Volume::fs_names[] = { "unknown", "reiserfs", "ext2", "ext3", "ext4", "vfat", + "xfs", "jfs", "hfs", "ntfs", "swap", "hfsplus", "nfs", + "none" }; string Volume::mb_names[] = { "device", "uuid", "label", "id", "path" }; Modified: trunk/storage/libstorage/testsuite/format1.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/testsuite/format1.cc?rev=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/storage/libstorage/testsuite/format1.cc (original) +++ trunk/storage/libstorage/testsuite/format1.cc Mon May 4 14:25:37 2009 @@ -35,6 +35,7 @@ case REISERFS: cout << "REISERFS"; break; case EXT2: cout << "EXT2"; break; case EXT3: cout << "EXT3"; break; + case EXT4: cout << "EXT4"; break; case VFAT: cout << "VFAT"; break; case XFS: cout << "XFS"; break; case JFS: cout << "JFS"; break; Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Mon May 4 14:25:37 2009 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Mon May 04 14:25:00 CEST 2009 - aschnell@suse.de + +- work on ext4 support (fate #305691) + +------------------------------------------------------------------- Thu Apr 23 16:32:02 CEST 2009 - kmachalkova@suse.cz - Added functional equivalents (buttons) to context menus Modified: trunk/storage/storage/doc/README.part.info URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/doc/README.part.info?rev=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/storage/storage/doc/README.part.info (original) +++ trunk/storage/storage/doc/README.part.info Mon May 4 14:25:37 2009 @@ -35,7 +35,7 @@ KEEP_PARTITION_FSYS Possible values: comma separated list of - reiser, xfs, fat, vfat, ext2, ext3, jfs, ntfs, swap + reiser, xfs, fat, vfat, ext2, ext3, ext4, jfs, ntfs, swap Default value: Empty list Example: KEEP_PARTITION_FSYS=fat,ntfs 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=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/storage/storage/src/include/custom_part_dialogs.ycp (original) +++ trunk/storage/storage/src/include/custom_part_dialogs.ycp Mon May 4 14:25:37 2009 @@ -1104,12 +1104,12 @@ // Popup text txt = _(" The file system on the partition cannot be shrunk by YaST2. -Only fat, ext2, ext3, and reiser allow shrinking of a file system."); +Only fat, ext2, ext3, ext4, and reiser allow shrinking of a file system."); else // Popup text txt = _(" The file system on the logical volume cannot be shrunk by YaST2. -Only fat, ext2, ext3, and reiser allow shrinking of a file system."); +Only fat, ext2, ext3, ext4, and reiser allow shrinking of a file system."); if( ask ) { txt = txt + "\n"; @@ -1142,12 +1142,12 @@ // Popup text txt = _(" The file system on the selected partition cannot be extended by YaST2. -Only fat, ext2, ext3, xfs, and reiser allow extending a file system."); +Only fat, ext2, ext3, ext4, xfs, and reiser allow extending a file system."); else // Popup text txt = _(" 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."); +Only fat, ext2, ext3, ext4, xfs, and reiser allow extending a file system."); if( ask ) { txt = txt + "\n\n"; 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=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/storage/storage/src/include/custom_part_lib.ycp (original) +++ trunk/storage/storage/src/include/custom_part_lib.ycp Mon May 4 14:25:37 2009 @@ -638,6 +638,7 @@ map pkg_for_fs = $[ `ext2 : [ "e2fsprogs" ], `ext3 : [ "e2fsprogs" ], + `ext4 : [ "e2fsprogs" ], `reiser : [ "reiserfs" ], `vfat : [ "dosfstools" ], `ntfs : [ "ntfsprogs" ], Modified: trunk/storage/storage/src/include/ep-settings.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-settings.ycp?rev=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-settings.ycp (original) +++ trunk/storage/storage/src/include/ep-settings.ycp Mon May 4 14:25:37 2009 @@ -76,6 +76,8 @@ // combo box entry `item(`id(`ext3), "Ext3"), // combo box entry + `item(`id(`ext4), "Ext4"), + // combo box entry `item(`id(`reiser), "Reiser"), // combo box entry `item(`id(`xfs), "XFS") Modified: trunk/storage/storage/src/modules/FileSystems.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/FileSystems.ycp?rev=57051&r1=57050&r2=57051&view=diff ============================================================================== --- trunk/storage/storage/src/modules/FileSystems.ycp (original) +++ trunk/storage/storage/src/modules/FileSystems.ycp Mon May 4 14:25:37 2009 @@ -32,7 +32,8 @@ "def_int" : LibStorage::FSUNKNOWN(), "m" : $[ LibStorage::REISERFS() : `reiser, LibStorage::EXT2() : `ext2, - LibStorage::EXT3() : `ext3, + LibStorage::EXT3() : `ext3, + LibStorage::EXT4() : `ext4, LibStorage::VFAT() : `vfat, LibStorage::XFS() : `xfs, LibStorage::JFS() : `jfs, @@ -144,6 +145,7 @@ `xfs : true, `ext2 : true, `ext3 : true, + `ext4 : true, `jfs : true, `vfat : true, `ntfs : true, @@ -163,6 +165,7 @@ `xfs : $[ ], `ext2 : $[ ], `ext3 : $[ ], + `ext4 : $[ ], `jfs : $[ ], `hfs : $[ ], `vfat : $[ ], @@ -172,24 +175,6 @@ ]; - /** - * Return a map that contains the mount option for each used_fs (-t) - * @return map - */ - /* - to mount_string - global define used2typeMap() - ``{ - return $[ - `ext2 : "ext2", - `ext3 : "ext3", - `reiser : "reiserfs", - `xfs : "xfs", - `jfs : "jfs", - `vfat : "vfat" ]; - }; - */ - global define list