Hello community, here is the log from the commit of package libstorage for openSUSE:Factory checked in at 2015-02-20 12:42:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage (Old) and /work/SRC/openSUSE:Factory/.libstorage.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libstorage" Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage/libstorage.changes 2015-02-16 17:35:49.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libstorage.new/libstorage.changes 2015-02-20 12:42:58.000000000 +0100 @@ -1,0 +2,6 @@ +Tue Feb 17 14:55:58 CET 2015 - aschnell@suse.de + +- mount subvolumes of btrfs root filesystem during installation + (for fate#318392) + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-2.25.20.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.20/storage/Btrfs.cc new/libstorage-2.25.20/storage/Btrfs.cc --- old/libstorage-2.25.20/storage/Btrfs.cc 2014-12-09 14:39:38.000000000 +0100 +++ new/libstorage-2.25.20/storage/Btrfs.cc 2015-02-17 17:06:24.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) [2004-2014] Novell, Inc. + * Copyright (c) [2004-2015] Novell, Inc. * * All Rights Reserved. * @@ -848,20 +848,81 @@ } + int + Btrfs::extraMount() + { + y2mil("extraMount"); + + if (getMount() == "/") + { + string def_subvol = getStorage()->getDefaultSubvolName(); + + list<string> ign_opt(ignore_opt, ignore_opt + lengthof(ignore_opt)); + list<string> ign_beg(ignore_beg, ignore_beg + lengthof(ignore_beg)); + + if (getStorage()->instsys()) + ign_opt.push_back("ro"); + + ign_beg.push_back("subvol="); + + list<string> opts = splitString(fstab_opt, ","); + + y2mil("opts before:" << opts); + for (const string& tmp : ign_opt) + opts.remove(tmp); + for (const string& tmp : ign_beg) + opts.remove_if(string_starts_with(tmp)); + y2mil("opts after:" << opts); + + for (const Subvolume& subvolume : subvolumes) + { + // TODO workaround + if (boost::contains(subvolume.path(), "grub2")) + continue; + + string real_mount_point = subvolume.path(); + if (def_subvol.empty()) + real_mount_point = "/" + real_mount_point; + else + real_mount_point.erase(0, def_subvol.size()); + real_mount_point = getStorage()->prependRoot(real_mount_point); + + if (access(real_mount_point.c_str(), R_OK ) != 0) + createPath(real_mount_point); + + list<string> tmp_opts = opts; + tmp_opts.push_back("subvol=" + subvolume.path()); + + string cmdline = MOUNTBIN " -t btrfs -o " + boost::join(tmp_opts, ",") + " " + + quote(mountDevice()) + " " + quote(real_mount_point); + + SystemCmd cmd(cmdline); + if (cmd.retcode() != 0) + { + setExtError(cmd); + return VOLUME_MOUNT_FAILED; + } + } + } + + return 0; + } + + Text Btrfs::extendText(bool doing, const string& dev) const { Text txt; if( doing ) { - // displayed text during action, + // displayed text during action, // %1$s and %2$s are replaced by a device names (e.g. /dev/hda1) txt = sformat( _("Extending Btrfs volume %1$s by %2$s"), name().c_str(), dev.c_str() ); } else { - // displayed text before action, + // displayed text before action, // %1$s and %2$s are replaced by a device names (e.g. /dev/hda1) txt = sformat( _("Extend Btrfs volume %1$s by %2$s"), name().c_str(), dev.c_str() ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.20/storage/Btrfs.h new/libstorage-2.25.20/storage/Btrfs.h --- old/libstorage-2.25.20/storage/Btrfs.h 2014-07-21 15:21:12.000000000 +0200 +++ new/libstorage-2.25.20/storage/Btrfs.h 2015-02-17 17:06:24.000000000 +0100 @@ -107,6 +107,8 @@ virtual int extraFstabUpdate(EtcFstab* fstab, const FstabKey& key, const FstabChange& change) override; virtual int extraFstabRemove(EtcFstab* fstab, const FstabKey& key) override; + virtual int extraMount() override; + private: Btrfs& operator=(const Btrfs& v); // disallow diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.20/storage/Volume.cc new/libstorage-2.25.20/storage/Volume.cc --- old/libstorage-2.25.20/storage/Volume.cc 2015-02-13 10:01:49.000000000 +0100 +++ new/libstorage-2.25.20/storage/Volume.cc 2015-02-17 17:06:24.000000000 +0100 @@ -1565,6 +1565,8 @@ y2mil( "setting mode for " << lmount << " from:" << oct << omode << " to:" << mode << dec << " ok:" << ok ); } + if (ret == 0) + ret = extraMount(); } if (getMount() == "/") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.20/storage/Volume.h new/libstorage-2.25.20/storage/Volume.h --- old/libstorage-2.25.20/storage/Volume.h 2014-12-09 14:39:38.000000000 +0100 +++ new/libstorage-2.25.20/storage/Volume.h 2015-02-17 17:06:24.000000000 +0100 @@ -271,6 +271,8 @@ const FstabChange& change) { return 0; } virtual int extraFstabRemove(EtcFstab* fstab, const FstabKey& key) { return 0; } + virtual int extraMount() { return 0; } + const Container* const cont; bool numeric; bool format; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.20/storage/gen_md5sum.cc new/libstorage-2.25.20/storage/gen_md5sum.cc --- old/libstorage-2.25.20/storage/gen_md5sum.cc 2015-02-13 10:02:54.000000000 +0100 +++ new/libstorage-2.25.20/storage/gen_md5sum.cc 2015-02-17 17:07:32.000000000 +0100 @@ -1,5 +1,5 @@ -#define SOURCES_MD5SUM "6a13b6faa73ccc4f2ce6e39247c21380" -#define SOURCES_MD5_DATE " Fri 13 Feb 10:02:54 CET 2015 " +#define SOURCES_MD5SUM "801dacf7fc4555bf6d55fcfd7af2d787" +#define SOURCES_MD5_DATE " Tue 17 Feb 17:07:32 CET 2015 " namespace storage { const char* GetSourceMd5() { return SOURCES_MD5SUM; } -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de