Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-installation for 
openSUSE:Factory checked in at 2022-02-21 17:46:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-installation (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-installation.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-installation"

Mon Feb 21 17:46:04 2022 rev:495 rq:956465 version:4.4.42

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-installation/yast2-installation.changes    
2022-02-13 19:51:12.186238332 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-installation.new.1958/yast2-installation.changes
  2022-02-21 17:46:36.855594280 +0100
@@ -1,0 +2,14 @@
+Sun Feb 20 09:35:26 UTC 2022 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Do not create a Btrfs snapshot at the end of the installation
+  or upgrade when the root filesystem is mounted as read-only
+  (jsc#SLE-22560).
+- 4.4.42
+
+-------------------------------------------------------------------
+Fri Feb 18 08:47:35 UTC 2022 - Knut Anderssen <kanders...@suse.com>
+
+- LSM: Adjusted installation summary labels (bsc#1196013).
+- 4.4.41
+
+-------------------------------------------------------------------

Old:
----
  yast2-installation-4.4.40.tar.bz2

New:
----
  yast2-installation-4.4.42.tar.bz2

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

Other differences:
------------------
++++++ yast2-installation.spec ++++++
--- /var/tmp/diff_new_pack.G2CCoZ/_old  2022-02-21 17:46:37.551594488 +0100
+++ /var/tmp/diff_new_pack.G2CCoZ/_new  2022-02-21 17:46:37.559594490 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-installation
-Version:        4.4.40
+Version:        4.4.42
 Release:        0
 Summary:        YaST2 - Installation Parts
 License:        GPL-2.0-only

++++++ yast2-installation-4.4.40.tar.bz2 -> yast2-installation-4.4.42.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-installation-4.4.40/doc/snapshots.md 
new/yast2-installation-4.4.42/doc/snapshots.md
--- old/yast2-installation-4.4.40/doc/snapshots.md      1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-installation-4.4.42/doc/snapshots.md      2022-02-21 
13:05:03.000000000 +0100
@@ -0,0 +1,79 @@
+# Installation and upgrade snapshots
+
+This document tries to clarify how YaST, as an installer, creates snapshots 
during installation and
+offline upgrade when Snapper is enabled. In a nutshell, YaST creates these 
snapshots:
+
+* A *single* snapshot at the end of the installation (except for transactional 
systems, like
+  MicroOS).
+* A *pre* snapshot at the beginning of the upgrade and a *post* snapshot at 
the end.
+
+However, things are not that simple, so let's try to draw a full picture of 
this feature.
+
+## Non-transactional systems
+
+Let's start considering non transactional systems, like SUSE Linux Enterprise, 
openSUSE Leap or
+openSUSE Tumbleweed. Remember that you can use openSUSE Tumbleweed as a 
transactional system if
+you select the *Transactional Server* role during installation.
+
+### Installation
+
+YaST creates a snapshot after *finishing* the normal installation. If you are 
using AutoYaST, it
+takes the snapshot at the end of the 2nd stage *unless it is disabled*. If the 
2nd stage is
+disabled, YaST takes the snapshot at the end of the 1st stage, just like a 
normal installation.
+
+If you run `snapper list` in your just installed system, you should see 
something like this:
+
+```
+# snapper list
+ # | Type   | Pre # | Date                     | User | Used Space | Cleanup | 
Description           | Userdata     
+---+--------+-------+--------------------------+------+------------+---------+-----------------------+--------------
+0  | single |       |                          | root |            |         | 
current               |              
+1* | single |       | Fri Feb 18 06:06:17 2022 | root |  13.22 MiB |         | 
first root filesystem |              
+2  | single |       | Fri Feb 18 06:12:22 2022 | root |   3.01 MiB | number  | 
after installation    | important=yes
+```
+
+Which is the role of each "snapshot"?
+
+* Snapshot 0: it is created by Snapper during the initialization.
+* Snapshot 1: it is the *current snapshot*. It is mounted as read/write and it 
is where your system
+  lives.
+* Snapshot 2: YaST created this snapshot at the end of the installation.
+
+Your system runs on *snapshot 1*, and *snapshot 2* is just a way to travel 
back in time to the end
+of the installation. We usually think about snapshots as *pictures* of the 
system on a given time,
+but that is not an accurate definition.
+
+### Offline Upgrade
+
+During offline upgrade, YaST takes two different snapshots: one at the 
beginning of the installation
+and another one at the end. Both snapshots are related as you can see in the 
table below:
+
+```
+# snapper list
+ # | Type   | Pre # | Date                     | User | Used Space | Cleanup | 
Description           | Userdata     
+---+--------+-------+--------------------------+------+------------+---------+-----------------------+--------------
+0  | single |       |                          | root |            |         | 
current               |              
+1* | single |       | Fri Feb 18 06:06:17 2022 | root |  13.22 MiB |         | 
first root filesystem |              
+2  | single |       | Fri Feb 18 06:12:22 2022 | root |   3.01 MiB | number  | 
after installation    | important=yes
+3  | pre    |       | Fri Feb 18 10:40:05 2022 | root |  36.63 MiB | number  | 
zypp(zypper)          | important=yes
+4  | post   |     3 | Fri Feb 18 10:55:11 2022 | root |  16.11 MiB | number  | 
                      | important=yes
+5  | pre    |       | Fri Feb 18 13:36:49 2022 | root |  14.91 MiB | number  | 
before update         | important=yes
+6  | post   |     5 | Fri Feb 18 14:01:59 2022 | root |   2.45 MiB | number  | 
after update          | important=yes
+```
+
+According to the table above, YaST created snapshot 5 (*pre*) before starting 
the upgrade process
+and snapshot 6 (*post*) at the end. However, snapshot 1 is still the root file 
system.
+
+## Transactional systems
+
+Transactional systems, like MicroOS or the *Transactional Server* role of 
openSUSE Tumbleweed, take
+care of their own snapshots. In those cases, YaST does not perform any 
snapshot at the end of the
+installation. About the offline upgrade, using YaST to upgrade those systems 
is not supported.
+
+Starting in yast2-installation 4.3.45, YaST detects if it is installing a 
transactional system by
+checking whether the root filesystem is mounted as read-only.
+
+## Related features
+
+[FATE#317932](https://w3.suse.de/~lpechacek/fate-archive/317973.html) and
+[SLE-22560](https://jira.suse.com/browse/SLE-22560).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.4.40/package/yast2-installation.changes 
new/yast2-installation-4.4.42/package/yast2-installation.changes
--- old/yast2-installation-4.4.40/package/yast2-installation.changes    
2022-02-11 10:35:56.000000000 +0100
+++ new/yast2-installation-4.4.42/package/yast2-installation.changes    
2022-02-21 13:05:03.000000000 +0100
@@ -1,4 +1,18 @@
 -------------------------------------------------------------------
+Sun Feb 20 09:35:26 UTC 2022 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Do not create a Btrfs snapshot at the end of the installation
+  or upgrade when the root filesystem is mounted as read-only
+  (jsc#SLE-22560).
+- 4.4.42
+
+-------------------------------------------------------------------
+Fri Feb 18 08:47:35 UTC 2022 - Knut Anderssen <kanders...@suse.com>
+
+- LSM: Adjusted installation summary labels (bsc#1196013).
+- 4.4.41
+
+-------------------------------------------------------------------
 Wed Feb  9 15:05:32 UTC 2022 - Antonio Larrosa <alarr...@suse.com>
 
 - Set the Xft.dpi resource after running the X server,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.4.40/package/yast2-installation.spec 
new/yast2-installation-4.4.42/package/yast2-installation.spec
--- old/yast2-installation-4.4.40/package/yast2-installation.spec       
2022-02-11 10:35:56.000000000 +0100
+++ new/yast2-installation-4.4.42/package/yast2-installation.spec       
2022-02-21 13:05:03.000000000 +0100
@@ -15,9 +15,8 @@
 # Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
-
 Name:           yast2-installation
-Version:        4.4.40
+Version:        4.4.42
 Release:        0
 Summary:        YaST2 - Installation Parts
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.4.40/src/lib/installation/clients/security_proposal.rb 
new/yast2-installation-4.4.42/src/lib/installation/clients/security_proposal.rb
--- 
old/yast2-installation-4.4.40/src/lib/installation/clients/security_proposal.rb 
    2022-02-11 10:35:56.000000000 +0100
+++ 
new/yast2-installation-4.4.42/src/lib/installation/clients/security_proposal.rb 
    2022-02-21 13:05:03.000000000 +0100
@@ -257,16 +257,12 @@
           # after the installation will be SELinux running in the selected 
mode which could be
           # 'enforcing', 'permissive' or 'disabled'
           format(_(
-                   "Major Linux Security Module: Activate %{module} in 
'%{mode}' mode"
+                   "Major Linux Security Module: %{module} in '%{mode}' mode"
                  ), module: selected.label, mode: 
selected.mode.to_human_string)
-        when :apparmor
+        when :apparmor, :none
           # TRANSLATORS: Proposal's text describing that the active Linux 
Security Major Module
           # after the installation will be AppArmor
-          format(_("Major Linux Security Module: Activate %{module}"), module: 
selected.label)
-        when :none
-          # TRANSLATORS: Proposal's text describing that no Linux Security 
Major Module will be
-          # activated after the installation
-          _("Major Linux Security Module: No major module will be activated")
+          format(_("Major Linux Security Module: %{module}"), module: 
selected.label)
         end
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.4.40/src/lib/installation/snapshots_finish.rb 
new/yast2-installation-4.4.42/src/lib/installation/snapshots_finish.rb
--- old/yast2-installation-4.4.40/src/lib/installation/snapshots_finish.rb      
2022-02-11 10:35:56.000000000 +0100
+++ new/yast2-installation-4.4.42/src/lib/installation/snapshots_finish.rb      
2022-02-21 13:05:03.000000000 +0100
@@ -2,6 +2,7 @@
 require "yast2/fs_snapshot"
 require "yast2/fs_snapshot_store"
 require "installation/finish_client"
+require "y2storage"
 
 module Installation
   class SnapshotsFinish < ::Installation::FinishClient
@@ -29,16 +30,21 @@
     def write
       snapper_config
 
-      if !InstFunctions.second_stage_required? && Yast2::FsSnapshot.configured?
-        log.info("Creating root filesystem snapshot")
-        if Mode.update
-          create_post_snapshot
-        else
-          create_single_snapshot
-        end
+      skip_reason = nil
+      skip_reason = "no second stage" if InstFunctions.second_stage_required?
+      skip_reason = "snapper is not configured" unless 
Yast2::FsSnapshot.configured?
+      skip_reason = "root file system is read-only" if ro_root_fs?
+
+      if skip_reason
+        log.info("Skipping root filesystem snapshot creation: #{skip_reason}")
+        return false
+      end
+
+      log.info("Creating root filesystem snapshot")
+      if Mode.update
+        create_post_snapshot
       else
-        log.info("Skipping root filesystem snapshot creation")
-        false
+        create_single_snapshot
       end
     end
 
@@ -78,5 +84,17 @@
         log.info("There is no need to configure Snapper")
       end
     end
+
+    # Determines whether the root filesystem is mounted as read-only
+    #
+    # @return [Boolean] true if it is mounted as read-only; false if it is not
+    #   mounted as read-only or if it is not found
+    def ro_root_fs?
+      staging = Y2Storage::StorageManager.instance.staging
+      root_fs = Y2Storage::MountPoint.find_by_path(staging, "/").first
+      return false unless root_fs
+
+      root_fs.mount_options.include?("ro")
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.4.40/test/snapshots_finish_test.rb 
new/yast2-installation-4.4.42/test/snapshots_finish_test.rb
--- old/yast2-installation-4.4.40/test/snapshots_finish_test.rb 2022-02-11 
10:35:56.000000000 +0100
+++ new/yast2-installation-4.4.42/test/snapshots_finish_test.rb 2022-02-21 
13:05:03.000000000 +0100
@@ -17,12 +17,24 @@
       allow(Yast2::FsSnapshot).to 
receive(:configured?).and_return(snapper_configured)
       allow(Yast::Mode).to receive(:installation).and_return(mode == 
:installation)
       allow(Yast2::FsSnapshot).to receive(:configure_on_install?).and_return 
configure
+      allow(Y2Storage::StorageManager).to 
receive(:instance).and_return(storage_manager)
+      allow(Y2Storage::MountPoint).to receive(:find_by_path).with(staging, "/")
+        .and_return([root_fs])
     end
 
     let(:second_stage_required) { false }
     let(:snapper_configured) { false }
     let(:mode) { :normal }
     let(:configure) { false }
+    let(:staging) { instance_double(Y2Storage::Devicegraph) }
+    let(:storage_manager) { instance_double(Y2Storage::StorageManager, 
staging: staging) }
+    let(:root_fs_options) { [] }
+
+    let(:root_fs) do
+      instance_double(
+        Y2Storage::Filesystems::BlkFilesystem, mount_path: "/", mount_options: 
root_fs_options
+      )
+    end
 
     context "during a fresh installation" do
       let(:mode) { :installation }
@@ -110,6 +122,15 @@
             expect(subject.write).to eq(true)
           end
 
+          context "and root filesystem is read-only" do
+            let(:root_fs_options) { ["ro"] }
+
+            it "does not create any snapshot" do
+              expect(Yast2::FsSnapshot).to_not receive(:create_post)
+              expect(subject.write).to eq(false)
+            end
+          end
+
           context "and could not create the snapshot" do
             before do
               allow(Yast2::FsSnapshot).to receive(:create_post)
@@ -139,6 +160,15 @@
             expect(subject.write).to eq(true)
           end
 
+          context "and root filesystem is read-only" do
+            let(:root_fs_options) { ["ro"] }
+
+            it "does not create any snapshot" do
+              expect(Yast2::FsSnapshot).to_not receive(:create_single)
+              expect(subject.write).to eq(false)
+            end
+          end
+
           context "and could not create the snapshot" do
             before do
               allow(Yast2::FsSnapshot).to receive(:create_single)

Reply via email to