Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libstorage-ng for openSUSE:Factory 
checked in at 2022-06-23 10:22:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old)
 and      /work/SRC/openSUSE:Factory/.libstorage-ng.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libstorage-ng"

Thu Jun 23 10:22:29 2022 rev:171 rq:984483 version:4.5.23

Changes:
--------
--- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes      
2022-06-18 22:05:42.315614801 +0200
+++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.1548/libstorage-ng.changes    
2022-06-23 10:22:30.947625595 +0200
@@ -1,0 +2,15 @@
+Wed Jun 22 11:32:28 UTC 2022 - aschn...@suse.com
+
+- merge gh#openSUSE/libstorage-ng#884
+- handle rootprefix when reading fstab, crypttab and mdadm.conf
+- 4.5.23
+
+--------------------------------------------------------------------
+Tue Jun 21 07:49:17 UTC 2022 - aschn...@suse.com
+
+- merge gh#openSUSE/libstorage-ng#883
+- coding style
+- fixed typos and coding style
+- 4.5.22
+
+--------------------------------------------------------------------

Old:
----
  libstorage-ng-4.5.21.tar.xz

New:
----
  libstorage-ng-4.5.23.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libstorage-ng.spec ++++++
--- /var/tmp/diff_new_pack.aY4bVo/_old  2022-06-23 10:22:31.407626095 +0200
+++ /var/tmp/diff_new_pack.aY4bVo/_new  2022-06-23 10:22:31.411626099 +0200
@@ -18,7 +18,7 @@
 
 %define libname %{name}1
 Name:           libstorage-ng
-Version:        4.5.21
+Version:        4.5.23
 Release:        0
 Summary:        Library for storage management
 License:        GPL-2.0-only

++++++ libstorage-ng-4.5.21.tar.xz -> libstorage-ng-4.5.23.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/LIBVERSION 
new/libstorage-ng-4.5.23/LIBVERSION
--- old/libstorage-ng-4.5.21/LIBVERSION 2022-06-17 15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/LIBVERSION 2022-06-22 13:32:28.000000000 +0200
@@ -1 +1 @@
-1.76.0
+1.77.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/VERSION 
new/libstorage-ng-4.5.23/VERSION
--- old/libstorage-ng-4.5.21/VERSION    2022-06-17 15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/VERSION    2022-06-22 13:32:28.000000000 +0200
@@ -1 +1 @@
-4.5.21
+4.5.23
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/ActiongraphImpl.cc 
new/libstorage-ng-4.5.23/storage/ActiongraphImpl.cc
--- old/libstorage-ng-4.5.21/storage/ActiongraphImpl.cc 2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/ActiongraphImpl.cc 2022-06-22 
13:32:28.000000000 +0200
@@ -73,7 +73,7 @@
        if (!etc_fstab)
        {
            const Storage& storage = actiongraph.get_storage();
-           string filename = storage.get_impl().prepend_rootprefix(ETC_FSTAB);
+           string filename = storage.prepend_rootprefix(ETC_FSTAB);
 
            etc_fstab = make_unique<EtcFstab>(filename);
        }
@@ -88,7 +88,7 @@
        if (!etc_crypttab)
        {
            const Storage& storage = actiongraph.get_storage();
-           string filename = 
storage.get_impl().prepend_rootprefix(ETC_CRYPTTAB);
+           string filename = storage.prepend_rootprefix(ETC_CRYPTTAB);
 
            etc_crypttab = make_unique<EtcCrypttab>(filename);
        }
@@ -103,7 +103,7 @@
        if (!etc_mdadm)
        {
            const Storage& storage = actiongraph.get_storage();
-           string filename = storage.get_impl().prepend_rootprefix(ETC_MDADM);
+           string filename = storage.prepend_rootprefix(ETC_MDADM);
 
            etc_mdadm = make_unique<EtcMdadm>(filename);
        }
@@ -772,6 +772,7 @@
        y2mil("commit begin");
 
        y2mil("used features: " << get_used_features_names(used_features()));
+       y2mil("rootprefix: " << storage.get_rootprefix());
 
        CommitData commit_data(*this, Tense::PRESENT_CONTINUOUS);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.21/storage/Devices/BitlockerV2Impl.cc 
new/libstorage-ng-4.5.23/storage/Devices/BitlockerV2Impl.cc
--- old/libstorage-ng-4.5.21/storage/Devices/BitlockerV2Impl.cc 2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Devices/BitlockerV2Impl.cc 2022-06-22 
13:32:28.000000000 +0200
@@ -148,8 +148,8 @@
 
 
     bool
-    BitlockerV2::Impl::activate_bitlocker(const ActivateCallbacksV3* 
activate_callbacks, SystemInfo::Impl& system_info,
-                                         const string& name, const string& 
uuid)
+    BitlockerV2::Impl::activate_bitlocker(const ActivateCallbacksV3* 
activate_callbacks, const Storage& storage,
+                                         SystemInfo::Impl& system_info, const 
string& name, const string& uuid)
     {
        BitlockerInfo bitlocker_info;
        bitlocker_info.get_impl().device_name = name;
@@ -158,7 +158,7 @@
 
        dev_t majorminor = system_info.getCmdUdevadmInfo(name).get_majorminor();
 
-       const EtcCrypttab& etc_crypttab = system_info.getEtcCrypttab();
+       const EtcCrypttab& etc_crypttab = 
system_info.getEtcCrypttab(storage.prepend_rootprefix(ETC_CRYPTTAB));
        const CrypttabEntry* crypttab_entry = 
etc_crypttab.find_by_any_block_device(system_info, uuid,
                                                                                
    "", majorminor);
 
@@ -171,7 +171,7 @@
        }
        else
        {
-           dm_table_name = bitlocker_info.get_impl().dm_table_name = 
next_free_cr_auto_name(system_info);
+           dm_table_name = bitlocker_info.get_impl().dm_table_name = 
next_free_cr_auto_name(storage, system_info);
            bitlocker_info.get_impl().is_dm_table_name_generated = true;
        }
 
@@ -253,7 +253,7 @@
 
 
     bool
-    BitlockerV2::Impl::activate_bitlockers(const ActivateCallbacksV3* 
activate_callbacks)
+    BitlockerV2::Impl::activate_bitlockers(const ActivateCallbacksV3* 
activate_callbacks, const Storage& storage)
     {
        y2mil("activate_bitlockers");
 
@@ -284,7 +284,7 @@
 
                y2mil("inactive bitlocker name:" << key_value1.first << " 
uuid:" << uuid);
 
-               if (activate_bitlocker(activate_callbacks, system_info, 
key_value1.first, uuid))
+               if (activate_bitlocker(activate_callbacks, storage, 
system_info, key_value1.first, uuid))
                    ret = true;
            }
 
@@ -340,8 +340,9 @@
     BitlockerV2::Impl::probe_bitlockers(Prober& prober)
     {
        SystemInfo::Impl& system_info = prober.get_system_info();
+       const Storage& storage = prober.get_storage();
        const CmdDmsetupTable& cmd_dmsetup_table = 
system_info.getCmdDmsetupTable();
-       const EtcCrypttab& etc_crypttab = system_info.getEtcCrypttab();
+       const EtcCrypttab& etc_crypttab = 
system_info.getEtcCrypttab(storage.prepend_rootprefix(ETC_CRYPTTAB));
        const Blkid& blkid = system_info.getBlkid();
 
        /*
@@ -387,7 +388,7 @@
            else if (crypttab_entry)
                dm_table_name = crypttab_entry->get_crypt_device();
            else
-               dm_table_name = next_free_cr_auto_name(system_info);
+               dm_table_name = next_free_cr_auto_name(storage, system_info);
 
            BitlockerV2* bitlocker = BitlockerV2::create(prober.get_system(), 
dm_table_name);
            bitlocker->get_impl().uuid = uuid;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.21/storage/Devices/BitlockerV2Impl.h 
new/libstorage-ng-4.5.23/storage/Devices/BitlockerV2Impl.h
--- old/libstorage-ng-4.5.21/storage/Devices/BitlockerV2Impl.h  2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Devices/BitlockerV2Impl.h  2022-06-22 
13:32:28.000000000 +0200
@@ -51,10 +51,10 @@
 
        virtual string get_pretty_classname() const override;
 
-       static bool activate_bitlocker(const ActivateCallbacksV3* 
activate_callbacks,
+       static bool activate_bitlocker(const ActivateCallbacksV3* 
activate_callbacks, const Storage& storage,
                                       SystemInfo::Impl& system_info, const 
string& name, const string& uuid);
 
-       static bool activate_bitlockers(const ActivateCallbacksV3* 
activate_callbacks);
+       static bool activate_bitlockers(const ActivateCallbacksV3* 
activate_callbacks, const Storage& storage);
 
        static bool deactivate_bitlockers();
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.21/storage/Devices/EncryptionImpl.cc 
new/libstorage-ng-4.5.23/storage/Devices/EncryptionImpl.cc
--- old/libstorage-ng-4.5.21/storage/Devices/EncryptionImpl.cc  2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Devices/EncryptionImpl.cc  2022-06-22 
13:32:28.000000000 +0200
@@ -111,10 +111,10 @@
 
 
     string
-    Encryption::Impl::next_free_cr_auto_name(SystemInfo::Impl& system_info)
+    Encryption::Impl::next_free_cr_auto_name(const Storage& storage, 
SystemInfo::Impl& system_info)
     {
        const CmdDmsetupInfo& cmd_dmsetup_info = 
system_info.getCmdDmsetupInfo();
-       const EtcCrypttab& etc_crypttab = system_info.getEtcCrypttab();
+       const EtcCrypttab& etc_crypttab = 
system_info.getEtcCrypttab(storage.prepend_rootprefix(ETC_CRYPTTAB));
 
        static int nr = 1;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.21/storage/Devices/EncryptionImpl.h 
new/libstorage-ng-4.5.23/storage/Devices/EncryptionImpl.h
--- old/libstorage-ng-4.5.21/storage/Devices/EncryptionImpl.h   2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Devices/EncryptionImpl.h   2022-06-22 
13:32:28.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) [2016-2021] SUSE LLC
+ * Copyright (c) [2016-2022] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -160,7 +160,7 @@
         * exist in the system and that the same name is never
         * returned twice.
         */
-       static string next_free_cr_auto_name(SystemInfo::Impl& system_info);
+       static string next_free_cr_auto_name(const Storage& storage, 
SystemInfo::Impl& system_info);
 
        void add_key_file_option_and_execute(const string& cmd_line) const;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/Devices/LuksImpl.cc 
new/libstorage-ng-4.5.23/storage/Devices/LuksImpl.cc
--- old/libstorage-ng-4.5.21/storage/Devices/LuksImpl.cc        2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Devices/LuksImpl.cc        2022-06-22 
13:32:28.000000000 +0200
@@ -184,8 +184,9 @@
 
 
     bool
-    Luks::Impl::activate_luks(const ActivateCallbacks* activate_callbacks, 
SystemInfo::Impl& system_info,
-                             const string& name, const string& uuid, const 
string& label)
+    Luks::Impl::activate_luks(const ActivateCallbacks* activate_callbacks, 
const Storage& storage,
+                             SystemInfo::Impl& system_info, const string& 
name, const string& uuid,
+                             const string& label)
     {
        LuksInfo luks_info;
        luks_info.get_impl().device_name = name;
@@ -195,7 +196,7 @@
 
        dev_t majorminor = system_info.getCmdUdevadmInfo(name).get_majorminor();
 
-       const EtcCrypttab& etc_crypttab = system_info.getEtcCrypttab();
+       const EtcCrypttab& etc_crypttab = 
system_info.getEtcCrypttab(storage.prepend_rootprefix(ETC_CRYPTTAB));
        const CrypttabEntry* crypttab_entry = 
etc_crypttab.find_by_any_block_device(system_info, uuid,
                                                                                
    label, majorminor);
 
@@ -208,7 +209,7 @@
        }
        else
        {
-           dm_table_name = luks_info.get_impl().dm_table_name = 
next_free_cr_auto_name(system_info);
+           dm_table_name = luks_info.get_impl().dm_table_name = 
next_free_cr_auto_name(storage, system_info);
            luks_info.get_impl().is_dm_table_name_generated = true;
        }
 
@@ -298,7 +299,7 @@
 
 
     bool
-    Luks::Impl::activate_lukses(const ActivateCallbacks* activate_callbacks)
+    Luks::Impl::activate_lukses(const ActivateCallbacks* activate_callbacks, 
const Storage& storage)
     {
        y2mil("activate_lukses");
 
@@ -325,7 +326,7 @@
                y2mil("inactive luks name:" << key_value1.first << " uuid:" <<
                      key_value1.second.luks_uuid << " label:" << 
key_value1.second.luks_label);
 
-               if (activate_luks(activate_callbacks, system_info, 
key_value1.first,
+               if (activate_luks(activate_callbacks, storage, system_info, 
key_value1.first,
                                  key_value1.second.luks_uuid, 
key_value1.second.luks_label))
                    ret = true;
            }
@@ -382,8 +383,9 @@
     Luks::Impl::probe_lukses(Prober& prober)
     {
        SystemInfo::Impl& system_info = prober.get_system_info();
+       const Storage& storage = prober.get_storage();
        const CmdDmsetupTable& cmd_dmsetup_table = 
system_info.getCmdDmsetupTable();
-       const EtcCrypttab& etc_crypttab = system_info.getEtcCrypttab();
+       const EtcCrypttab& etc_crypttab = 
system_info.getEtcCrypttab(storage.prepend_rootprefix(ETC_CRYPTTAB));
        const Blkid& blkid = system_info.getBlkid();
 
        /*
@@ -452,7 +454,7 @@
            else if (crypttab_entry)
                dm_table_name = crypttab_entry->get_crypt_device();
            else
-               dm_table_name = next_free_cr_auto_name(system_info);
+               dm_table_name = next_free_cr_auto_name(storage, system_info);
 
            Luks* luks = Luks::create(prober.get_system(), dm_table_name);
            luks->get_impl().uuid = uuid;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/Devices/LuksImpl.h 
new/libstorage-ng-4.5.23/storage/Devices/LuksImpl.h
--- old/libstorage-ng-4.5.21/storage/Devices/LuksImpl.h 2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Devices/LuksImpl.h 2022-06-22 
13:32:28.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) [2016-2021] SUSE LLC
+ * Copyright (c) [2016-2022] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -53,11 +53,11 @@
 
        virtual string get_pretty_classname() const override;
 
-       static bool activate_luks(const ActivateCallbacks* activate_callbacks,
+       static bool activate_luks(const ActivateCallbacks* activate_callbacks, 
const Storage& storage,
                                  SystemInfo::Impl& system_info, const string& 
name, const string& uuid,
                                  const string& label);
 
-       static bool activate_lukses(const ActivateCallbacks* 
activate_callbacks);
+       static bool activate_lukses(const ActivateCallbacks* 
activate_callbacks, const Storage& storage);
 
        static bool deactivate_lukses();
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/Devices/MdImpl.cc 
new/libstorage-ng-4.5.23/storage/Devices/MdImpl.cc
--- old/libstorage-ng-4.5.21/storage/Devices/MdImpl.cc  2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Devices/MdImpl.cc  2022-06-22 
13:32:28.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2014-2015] Novell, Inc.
- * Copyright (c) [2016-2021] SUSE LLC
+ * Copyright (c) [2016-2022] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -489,16 +489,19 @@
     {
        Partitionable::Impl::probe_pass_1a(prober);
 
-       const ProcMdstat::Entry& entry = 
prober.get_system_info().getProcMdstat().get_entry(get_sysfs_name());
+       SystemInfo::Impl& system_info = prober.get_system_info();
+
+       const ProcMdstat::Entry& entry = 
system_info.getProcMdstat().get_entry(get_sysfs_name());
        md_parity = entry.md_parity;
        chunk_size = entry.chunk_size;
 
-       const MdadmDetail& mdadm_detail = 
prober.get_system_info().getMdadmDetail(get_name());
+       const MdadmDetail& mdadm_detail = 
system_info.getMdadmDetail(get_name());
        uuid = mdadm_detail.uuid;
        metadata = mdadm_detail.metadata;
        md_level = mdadm_detail.level;
 
-       const EtcMdadm& etc_mdadm = prober.get_system_info().getEtcMdadm();
+       const Storage& storage = prober.get_storage();
+       const EtcMdadm& etc_mdadm = 
system_info.getEtcMdadm(storage.prepend_rootprefix(ETC_MDADM));
        in_etc_mdadm = etc_mdadm.has_entry(uuid);
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.21/storage/Devices/PlainEncryptionImpl.cc 
new/libstorage-ng-4.5.23/storage/Devices/PlainEncryptionImpl.cc
--- old/libstorage-ng-4.5.21/storage/Devices/PlainEncryptionImpl.cc     
2022-06-17 15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Devices/PlainEncryptionImpl.cc     
2022-06-22 13:32:28.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 SUSE LLC
+ * Copyright (c) [2019-2022] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -30,6 +30,7 @@
 #include "storage/EtcCrypttab.h"
 #include "storage/Prober.h"
 #include "storage/Utils/Format.h"
+#include "storage/Storage.h"
 
 
 namespace storage
@@ -69,8 +70,9 @@
     PlainEncryption::Impl::probe_plain_encryptions(Prober& prober)
     {
        SystemInfo::Impl& system_info = prober.get_system_info();
+       const Storage& storage = prober.get_storage();
        const CmdDmsetupTable& cmd_dmsetup_table = 
system_info.getCmdDmsetupTable();
-       const EtcCrypttab& etc_crypttab = system_info.getEtcCrypttab();
+       const EtcCrypttab& etc_crypttab = 
system_info.getEtcCrypttab(storage.prepend_rootprefix(ETC_CRYPTTAB));
        const Blkid& blkid = system_info.getBlkid();
 
        /*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/Environment.cc 
new/libstorage-ng-4.5.23/storage/Environment.cc
--- old/libstorage-ng-4.5.21/storage/Environment.cc     2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Environment.cc     2022-06-22 
13:32:28.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2014-2015] Novell, Inc.
- * Copyright (c) 2020 SUSE LLC
+ * Copyright (c) [2020-2022] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -74,6 +74,20 @@
     }
 
 
+    const std::string&
+    Environment::get_rootprefix() const
+    {
+       return get_impl().get_rootprefix();
+    }
+
+
+    void
+    Environment::set_rootprefix(const std::string& rootprefix)
+    {
+       get_impl().set_rootprefix(rootprefix);
+    }
+
+
     const string&
     Environment::get_devicegraph_filename() const
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/Environment.h 
new/libstorage-ng-4.5.23/storage/Environment.h
--- old/libstorage-ng-4.5.21/storage/Environment.h      2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Environment.h      2022-06-22 
13:32:28.000000000 +0200
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) [2014-2015] Novell, Inc.
+ * Copyright (c) 2022 SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -89,6 +90,26 @@
         */
        TargetMode get_target_mode() const;
 
+       /**
+        * Query the rootprefix.
+        *
+        * The rootprefix is prepended to certain paths when accessing the 
system,
+        * e.g. when opening files like /etc/fstab and when mounting 
filesystems (that
+        * have rootprefixed set).
+        *
+        * The rootprefix is at least used for activate(), probe() and commit().
+        */
+       const std::string& get_rootprefix() const;
+
+       /**
+        * Set the rootprefix.
+        *
+        * If a rootprefix is not needed it has to be empty.
+        *
+        * @see get_rootprefix()
+        */
+       void set_rootprefix(const std::string& rootprefix);
+
        const std::string& get_devicegraph_filename() const;
        void set_devicegraph_filename(const std::string& devicegraph_filename);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/EnvironmentImpl.cc 
new/libstorage-ng-4.5.23/storage/EnvironmentImpl.cc
--- old/libstorage-ng-4.5.21/storage/EnvironmentImpl.cc 2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/EnvironmentImpl.cc 2022-06-22 
13:32:28.000000000 +0200
@@ -38,6 +38,13 @@
 
 
     void
+    Environment::Impl::set_rootprefix(const string& rootprefix)
+    {
+       Impl::rootprefix = rootprefix;
+    }
+
+
+    void
     Environment::Impl::set_devicegraph_filename(const string& 
devicegraph_filename)
     {
        Impl::devicegraph_filename = devicegraph_filename;
@@ -83,7 +90,8 @@
     {
        return out << "read-only:" << environment.read_only << " probe-mode:"
                   << toString(environment.probe_mode) << " target-mode:"
-                  << toString(environment.target_mode);
+                  << toString(environment.target_mode) << " rootprefix:"
+                  << environment.rootprefix;
     }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/EnvironmentImpl.h 
new/libstorage-ng-4.5.23/storage/EnvironmentImpl.h
--- old/libstorage-ng-4.5.21/storage/EnvironmentImpl.h  2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/EnvironmentImpl.h  2022-06-22 
13:32:28.000000000 +0200
@@ -46,6 +46,9 @@
 
        TargetMode get_target_mode() const { return target_mode; }
 
+       const string& get_rootprefix() const { return rootprefix; }
+       void set_rootprefix(const string& rootprefix);
+
        const string& get_devicegraph_filename() const { return 
devicegraph_filename; }
        void set_devicegraph_filename(const string& devicegraph_filename);
 
@@ -69,6 +72,7 @@
        const ProbeMode probe_mode;
        const TargetMode target_mode;
 
+       string rootprefix;
        string devicegraph_filename;
        string arch_filename;
        string mockup_filename;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/EtcFstab.cc 
new/libstorage-ng-4.5.23/storage/EtcFstab.cc
--- old/libstorage-ng-4.5.21/storage/EtcFstab.cc        2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/EtcFstab.cc        2022-06-22 
13:32:28.000000000 +0200
@@ -713,8 +713,7 @@
            else
            {
                y2war("mount point for " << 
extended_fstab_entry.fstab_entry->get_spec() <<
-                     "only found in proc/mounts: " <<
-                     extended_fstab_entry.fstab_entry->get_mount_point());
+                     " only found in proc/mounts: " << 
extended_fstab_entry.fstab_entry->get_mount_point());
 
                joint_entries.push_back(JointEntry(nullptr, 
extended_fstab_entry.fstab_entry));
            }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/EtcFstab.h 
new/libstorage-ng-4.5.23/storage/EtcFstab.h
--- old/libstorage-ng-4.5.21/storage/EtcFstab.h 2022-06-17 15:13:07.000000000 
+0200
+++ new/libstorage-ng-4.5.23/storage/EtcFstab.h 2022-06-22 13:32:28.000000000 
+0200
@@ -430,8 +430,7 @@
      */
     struct ExtendedFstabEntry
     {
-       ExtendedFstabEntry(const FstabEntry* fstab_entry) : 
fstab_entry(fstab_entry), id(0) {}
-       ExtendedFstabEntry(const FstabEntry* fstab_entry, unsigned int id)
+       ExtendedFstabEntry(const FstabEntry* fstab_entry, unsigned int id = 0)
            : fstab_entry(fstab_entry), id(id) {}
 
        const FstabEntry* fstab_entry;
@@ -444,10 +443,7 @@
      */
     struct JointEntry
     {
-       JointEntry(const FstabEntry* fstab_entry, const FstabEntry* mount_entry)
-           : fstab_entry(fstab_entry), mount_entry(mount_entry), id(0) {}
-
-       JointEntry(const FstabEntry* fstab_entry, const FstabEntry* 
mount_entry, unsigned int id)
+       JointEntry(const FstabEntry* fstab_entry, const FstabEntry* 
mount_entry, unsigned int id = 0)
            : fstab_entry(fstab_entry), mount_entry(mount_entry), id(id) {}
 
        string get_mount_point() const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.21/storage/Filesystems/BlkFilesystemImpl.cc 
new/libstorage-ng-4.5.23/storage/Filesystems/BlkFilesystemImpl.cc
--- old/libstorage-ng-4.5.21/storage/Filesystems/BlkFilesystemImpl.cc   
2022-06-17 15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Filesystems/BlkFilesystemImpl.cc   
2022-06-22 13:32:28.000000000 +0200
@@ -712,7 +712,7 @@
     vector<ExtendedFstabEntry>
     BlkFilesystem::Impl::find_etc_fstab_entries_unfiltered(SystemInfo::Impl& 
system_info) const
     {
-       const EtcFstab& etc_fstab = system_info.getEtcFstab();
+       const EtcFstab& etc_fstab = 
system_info.getEtcFstab(get_storage()->prepend_rootprefix(ETC_FSTAB));
 
        vector<ExtendedFstabEntry> ret;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.21/storage/Filesystems/BtrfsImpl.cc 
new/libstorage-ng-4.5.23/storage/Filesystems/BtrfsImpl.cc
--- old/libstorage-ng-4.5.21/storage/Filesystems/BtrfsImpl.cc   2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Filesystems/BtrfsImpl.cc   2022-06-22 
13:32:28.000000000 +0200
@@ -126,9 +126,9 @@
     {
        vector<const BlkDevice*> devices = get_blk_devices();
 
-       // For some number of devies more RAID levels work, e.g. RAID5 with two
-       // devices, but are not recommended (warning in mkfs.btrfs output) and
-       // are also not mentioned in the btrfs wiki
+       // For some number of devices more RAID levels work, e.g. RAID5 with 
two devices,
+       // but are not recommended (warning in mkfs.btrfs output) and are also 
not
+       // mentioned in the btrfs wiki
        // 
(https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices).
 
        switch (devices.size())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.21/storage/Filesystems/MountPoint.h 
new/libstorage-ng-4.5.23/storage/Filesystems/MountPoint.h
--- old/libstorage-ng-4.5.21/storage/Filesystems/MountPoint.h   2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Filesystems/MountPoint.h   2022-06-22 
13:32:28.000000000 +0200
@@ -194,6 +194,8 @@
         * during mount operations.
         *
         * The default value is true (for historic reasons).
+        *
+        * @see Environment::get_rootprefix()
         */
        bool is_rootprefixed() const;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.21/storage/Filesystems/MountPointImpl.cc 
new/libstorage-ng-4.5.23/storage/Filesystems/MountPointImpl.cc
--- old/libstorage-ng-4.5.21/storage/Filesystems/MountPointImpl.cc      
2022-06-17 15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Filesystems/MountPointImpl.cc      
2022-06-22 13:32:28.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) [2017-2021] SUSE LLC
+ * Copyright (c) [2017-2022] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -302,7 +302,7 @@
     MountPoint::Impl::get_rootprefixed_path() const
     {
        if (rootprefixed)
-           return get_storage()->get_impl().prepend_rootprefix(path);
+           return get_storage()->prepend_rootprefix(path);
        else
            return path;
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/Filesystems/NfsImpl.cc 
new/libstorage-ng-4.5.23/storage/Filesystems/NfsImpl.cc
--- old/libstorage-ng-4.5.21/storage/Filesystems/NfsImpl.cc     2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Filesystems/NfsImpl.cc     2022-06-22 
13:32:28.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) [2017-2020] SUSE LLC
+ * Copyright (c) [2017-2022] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -116,6 +116,8 @@
        // TODO the old library filters the mount options
 
        SystemInfo::Impl& system_info = prober.get_system_info();
+       const Storage& storage = prober.get_storage();
+       const EtcFstab& etc_fstab = 
system_info.getEtcFstab(storage.prepend_rootprefix(ETC_FSTAB));
 
        /*
         * The key of the map is a pair of server and path of the NFS mounts.
@@ -126,7 +128,6 @@
 
        entries_t entries;
 
-       const EtcFstab& etc_fstab = system_info.getEtcFstab();
        for (int i = 0; i < etc_fstab.get_entry_count(); ++i)
        {
            const FstabEntry* fstab_entry = etc_fstab.get_entry(i);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.21/storage/Filesystems/TmpfsImpl.cc 
new/libstorage-ng-4.5.23/storage/Filesystems/TmpfsImpl.cc
--- old/libstorage-ng-4.5.21/storage/Filesystems/TmpfsImpl.cc   2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/Filesystems/TmpfsImpl.cc   2022-06-22 
13:32:28.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 SUSE LLC
+ * Copyright (c) [2020-2022] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -69,9 +69,10 @@
     Tmpfs::Impl::probe_tmpfses(Prober& prober)
     {
        SystemInfo::Impl& system_info = prober.get_system_info();
+       const Storage& storage = prober.get_storage();
+       const EtcFstab& etc_fstab = 
system_info.getEtcFstab(storage.prepend_rootprefix(ETC_FSTAB));
 
        vector<ExtendedFstabEntry> fstab_entries;
-       const EtcFstab& etc_fstab = system_info.getEtcFstab();
        for (int i = 0; i < etc_fstab.get_entry_count(); ++i)
        {
            const FstabEntry* fstab_entry = etc_fstab.get_entry(i);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/Prober.cc 
new/libstorage-ng-4.5.23/storage/Prober.cc
--- old/libstorage-ng-4.5.21/storage/Prober.cc  2022-06-17 15:13:07.000000000 
+0200
+++ new/libstorage-ng-4.5.23/storage/Prober.cc  2022-06-22 13:32:28.000000000 
+0200
@@ -157,8 +157,9 @@
     }
 
 
-    Prober::Prober(const ProbeCallbacks* probe_callbacks, Devicegraph* system, 
SystemInfo::Impl& system_info)
-       : probe_callbacks(probe_callbacks), system(system), 
system_info(system_info)
+    Prober::Prober(const Storage& storage, const ProbeCallbacks* 
probe_callbacks, Devicegraph* system,
+                  SystemInfo::Impl& system_info)
+       : storage(storage), probe_callbacks(probe_callbacks), system(system), 
system_info(system_info)
     {
        /**
         * Difficulties:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/Prober.h 
new/libstorage-ng-4.5.23/storage/Prober.h
--- old/libstorage-ng-4.5.21/storage/Prober.h   2022-06-17 15:13:07.000000000 
+0200
+++ new/libstorage-ng-4.5.23/storage/Prober.h   2022-06-22 13:32:28.000000000 
+0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) [2016-2020] SUSE LLC
+ * Copyright (c) [2016-2022] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -37,6 +37,7 @@
     using std::vector;
 
 
+    class Storage;
     class ProbeCallbacks;
     class Devicegraph;
     class Device;
@@ -76,7 +77,10 @@
        /**
         * The constructor probes the system and places the result in system.
         */
-       Prober(const ProbeCallbacks* probe_callbacks, Devicegraph* system, 
SystemInfo::Impl& system_info);
+       Prober(const Storage& storage, const ProbeCallbacks* probe_callbacks, 
Devicegraph* system,
+              SystemInfo::Impl& system_info);
+
+       const Storage& get_storage() const { return storage; }
 
        const ProbeCallbacks* get_probe_callbacks() const { return 
probe_callbacks; }
 
@@ -105,6 +109,8 @@
 
     private:
 
+       const Storage& storage;
+
        const ProbeCallbacks* probe_callbacks;
 
        Devicegraph* system;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/Storage.h 
new/libstorage-ng-4.5.23/storage/Storage.h
--- old/libstorage-ng-4.5.21/storage/Storage.h  2022-06-17 15:13:07.000000000 
+0200
+++ new/libstorage-ng-4.5.23/storage/Storage.h  2022-06-22 13:32:28.000000000 
+0200
@@ -546,8 +546,8 @@
         */
        void set_default_mount_by(MountByType default_mount_by);
 
-       const std::string& get_rootprefix() const;
-       void set_rootprefix(const std::string& rootprefix);
+       const std::string& get_rootprefix() const ST_DEPRECATED;
+       void set_rootprefix(const std::string& rootprefix) ST_DEPRECATED;
 
        /**
         * Prepends the root prefix to a mount point if necessary.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/storage/StorageImpl.cc 
new/libstorage-ng-4.5.23/storage/StorageImpl.cc
--- old/libstorage-ng-4.5.21/storage/StorageImpl.cc     2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/StorageImpl.cc     2022-06-22 
13:32:28.000000000 +0200
@@ -52,7 +52,8 @@
     Storage::Impl::Impl(Storage& storage, const Environment& environment)
        : storage(storage), environment(environment), arch(false),
          lock(environment.is_read_only(), 
!environment.get_impl().is_do_lock()),
-         default_mount_by(MountByType::UUID), tmp_dir("libstorage-XXXXXX")
+         default_mount_by(MountByType::UUID), 
rootprefix(environment.get_rootprefix()),
+         tmp_dir("libstorage-XXXXXX")
     {
        y2mil("constructed Storage with " << environment);
        y2mil("libstorage-ng version " VERSION);
@@ -97,6 +98,8 @@
 
        y2mil("activate begin");
 
+       y2mil("rootprefix: " << get_rootprefix());
+
        const ActivateCallbacksV3* activate_callbacks_v3 = dynamic_cast<const 
ActivateCallbacksV3*>(activate_callbacks);
 
        Multipath::Impl::activate_multipaths(activate_callbacks);
@@ -112,10 +115,10 @@
            if (LvmLv::Impl::activate_lvm_lvs(activate_callbacks))
                again = true;
 
-           if (Luks::Impl::activate_lukses(activate_callbacks))
+           if (Luks::Impl::activate_lukses(activate_callbacks, storage))
                again = true;
 
-           if (activate_callbacks_v3 && 
BitlockerV2::Impl::activate_bitlockers(activate_callbacks_v3))
+           if (activate_callbacks_v3 && 
BitlockerV2::Impl::activate_bitlockers(activate_callbacks_v3, storage))
                again = true;
 
            if (!again)
@@ -177,6 +180,8 @@
     {
        y2mil("probe begin");
 
+       y2mil("rootprefix: " << get_rootprefix());
+
        CallbacksGuard callbacks_guard(probe_callbacks);
 
        if (exist_devicegraph("probed"))
@@ -243,7 +248,7 @@
 
        arch = system_info.getArch();
 
-       Prober prober(probe_callbacks, probed, system_info);
+       Prober prober(storage, probe_callbacks, probed, system_info);
     }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.21/storage/SystemInfo/SystemInfoImpl.h 
new/libstorage-ng-4.5.23/storage/SystemInfo/SystemInfoImpl.h
--- old/libstorage-ng-4.5.21/storage/SystemInfo/SystemInfoImpl.h        
2022-06-17 15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/storage/SystemInfo/SystemInfoImpl.h        
2022-06-22 13:32:28.000000000 +0200
@@ -77,9 +77,9 @@
        Impl();
        ~Impl();
 
-       const EtcFstab& getEtcFstab() { return etc_fstab.get(); }
-       const EtcCrypttab& getEtcCrypttab() { return etc_crypttab.get(); }
-       const EtcMdadm& getEtcMdadm() { return etc_mdadm.get(); }
+       const EtcFstab& getEtcFstab(const string& path) { return 
etc_fstab.get(path); }
+       const EtcCrypttab& getEtcCrypttab(const string& path) { return 
etc_crypttab.get(path); }
+       const EtcMdadm& getEtcMdadm(const string& path) { return 
etc_mdadm.get(path); }
 
        const Arch& getArch() { return arch.get(); }
        const Dir& getDir(const string& path) { return dirs.get(path); }
@@ -232,9 +232,9 @@
 
        };
 
-       LazyObject<EtcFstab> etc_fstab;
-       LazyObject<EtcCrypttab> etc_crypttab;
-       LazyObject<EtcMdadm> etc_mdadm;
+       LazyObjects<EtcFstab> etc_fstab;
+       LazyObjects<EtcCrypttab> etc_crypttab;
+       LazyObjects<EtcMdadm> etc_mdadm;
 
        LazyObject<Arch> arch;
        LazyObjects<Dir> dirs;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.21/testsuite/probe/prefixed-mockup.xml 
new/libstorage-ng-4.5.23/testsuite/probe/prefixed-mockup.xml
--- old/libstorage-ng-4.5.21/testsuite/probe/prefixed-mockup.xml        
2022-06-17 15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/testsuite/probe/prefixed-mockup.xml        
2022-06-22 13:32:28.000000000 +0200
@@ -747,13 +747,10 @@
   </Commands>
   <Files>
     <File>
-      <name>/etc/crypttab</name>
+      <name>/mnt/etc/crypttab</name>
     </File>
     <File>
-      <name>/etc/fstab</name>
-      <content>proc  /proc         proc  defaults 0 0</content>
-      <content>sysfs /sys          sysfs  noauto  0 0</content>
-      <content>usbfs /proc/bus/usb usbfs  noauto  0 0</content>
+      <name>/mnt/etc/fstab</name>
     </File>
     <File>
       <name>/proc/mounts</name>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/testsuite/probe/prefixed.cc 
new/libstorage-ng-4.5.23/testsuite/probe/prefixed.cc
--- old/libstorage-ng-4.5.21/testsuite/probe/prefixed.cc        2022-06-17 
15:13:07.000000000 +0200
+++ new/libstorage-ng-4.5.23/testsuite/probe/prefixed.cc        2022-06-22 
13:32:28.000000000 +0200
@@ -20,11 +20,11 @@
 {
     set_logger(get_stdout_logger());
 
-    Environment environment(true, ProbeMode::READ_MOCKUP, TargetMode::DIRECT);
+    Environment environment(true, ProbeMode::READ_MOCKUP, TargetMode::CHROOT);
+    environment.set_rootprefix("/mnt");
     environment.set_mockup_filename("prefixed-mockup.xml");
 
     Storage storage(environment);
-    storage.set_rootprefix("/mnt");
     storage.probe();
 
     const Devicegraph* probed = storage.get_probed();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.21/utils/probe.cc 
new/libstorage-ng-4.5.23/utils/probe.cc
--- old/libstorage-ng-4.5.21/utils/probe.cc     2022-06-17 15:13:07.000000000 
+0200
+++ new/libstorage-ng-4.5.23/utils/probe.cc     2022-06-22 13:32:28.000000000 
+0200
@@ -24,6 +24,7 @@
 bool load_mockup = false;
 bool ignore_probe_errors = false;
 View view = View::ALL;
+string rootprefix;
 
 
 class MyProbeCallbacks : public ProbeCallbacks
@@ -60,7 +61,7 @@
        probe_mode = ProbeMode::READ_MOCKUP;
 
     Environment environment(true, probe_mode, TargetMode::DIRECT);
-
+    environment.set_rootprefix(rootprefix);
     environment.set_mockup_filename("mockup.xml");
 
     MyProbeCallbacks my_probe_callbacks;
@@ -116,6 +117,7 @@
        { "load-mockup",                no_argument,            0,      4 },
        { "ignore-probe-errors",        no_argument,            0,      5 },
        { "view",                       required_argument,      0,      6 },
+       { "rootprefix",                 required_argument,      0,      7 },
        { 0, 0, 0, 0 }
     };
 
@@ -165,6 +167,10 @@
                }
                break;
 
+           case 7:
+               rootprefix = optarg;
+               break;
+
            default:
                usage();
        }

Reply via email to