Hello community, here is the log from the commit of package yast2-update for openSUSE:Factory checked in at 2018-06-19 11:52:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-update (Old) and /work/SRC/openSUSE:Factory/.yast2-update.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-update" Tue Jun 19 11:52:05 2018 rev:120 rq:616302 version:4.0.16 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-update/yast2-update.changes 2018-03-26 12:12:15.235064434 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-update.new/yast2-update.changes 2018-06-19 11:52:10.023642618 +0200 @@ -1,0 +2,32 @@ +Thu Jun 7 17:10:49 UTC 2018 - [email protected] + +- Update encryption device names according to the values in the + crypttab file (bsc#1094963). +- 4.0.16 + +------------------------------------------------------------------- +Wed Jun 6 11:19:12 UTC 2018 - [email protected] + +- Flush the disk cache after restoring the backup to mitigate + risk of data loss after unexpected reboot/poweroff after aborting + upgrade (bsc#1089643) +- 4.0.15 + +------------------------------------------------------------------- +Wed May 9 10:20:03 UTC 2018 - [email protected] + +- Fixed unmounting /mnt/dev when going back to the partition + selection dialog (fix up for the bsc#1089643) +- 4.0.14 + +------------------------------------------------------------------- +Fri Apr 27 13:45:41 UTC 2018 - [email protected] + +- Copy the resolv.conf and bind mount /dev directory to the target + root, sort the restore scripts to run them in the expected + order (bsc#1089643) +- The bind mount also fixes the libzypp plugin service refresh + (bsc#1080693) +- 4.0.13 + +------------------------------------------------------------------- Old: ---- yast2-update-4.0.12.tar.bz2 New: ---- yast2-update-4.0.16.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-update.spec ++++++ --- /var/tmp/diff_new_pack.Nl960n/_old 2018-06-19 11:52:11.579584849 +0200 +++ /var/tmp/diff_new_pack.Nl960n/_new 2018-06-19 11:52:11.579584849 +0200 @@ -17,7 +17,7 @@ Name: yast2-update -Version: 4.0.12 +Version: 4.0.16 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -39,16 +39,16 @@ # Needed for tests BuildRequires: rubygem(rspec) -# Filesystems::Base#match_fstab_spec? and Filesystems::MountByType.from_fstab_spec -BuildRequires: yast2-storage-ng >= 4.0.137 -# Filesystems::Base#match_fstab_spec? and Filesystems::MountByType.from_fstab_spec -Requires: yast2-storage-ng >= 4.0.137 +# Encryption.use_crypttab_names +BuildRequires: yast2-storage-ng >= 4.0.186 +# Encryption.use_crypttab_names +Requires: yast2-storage-ng >= 4.0.186 # FSSnapshotStore Requires: yast2 >= 3.1.126 Requires: yast2-installation -# Packages#proposal_for_update -Requires: yast2-packager >= 3.2.13 +# handle bind mount at /mnt/dev +Requires: yast2-packager >= 4.0.61 # Pkg.TargetInitializeOptions() Requires: yast2-pkg-bindings >= 3.1.14 ++++++ yast2-update-4.0.12.tar.bz2 -> yast2-update-4.0.16.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-4.0.12/package/yast2-update.changes new/yast2-update-4.0.16/package/yast2-update.changes --- old/yast2-update-4.0.12/package/yast2-update.changes 2018-03-20 11:19:45.000000000 +0100 +++ new/yast2-update-4.0.16/package/yast2-update.changes 2018-06-12 13:35:38.000000000 +0200 @@ -1,4 +1,36 @@ ------------------------------------------------------------------- +Thu Jun 7 17:10:49 UTC 2018 - [email protected] + +- Update encryption device names according to the values in the + crypttab file (bsc#1094963). +- 4.0.16 + +------------------------------------------------------------------- +Wed Jun 6 11:19:12 UTC 2018 - [email protected] + +- Flush the disk cache after restoring the backup to mitigate + risk of data loss after unexpected reboot/poweroff after aborting + upgrade (bsc#1089643) +- 4.0.15 + +------------------------------------------------------------------- +Wed May 9 10:20:03 UTC 2018 - [email protected] + +- Fixed unmounting /mnt/dev when going back to the partition + selection dialog (fix up for the bsc#1089643) +- 4.0.14 + +------------------------------------------------------------------- +Fri Apr 27 13:45:41 UTC 2018 - [email protected] + +- Copy the resolv.conf and bind mount /dev directory to the target + root, sort the restore scripts to run them in the expected + order (bsc#1089643) +- The bind mount also fixes the libzypp plugin service refresh + (bsc#1080693) +- 4.0.13 + +------------------------------------------------------------------- Mon Mar 19 16:24:35 UTC 2018 - [email protected] - Fixed a crash when upgrading systems with a separate /var diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-4.0.12/package/yast2-update.spec new/yast2-update-4.0.16/package/yast2-update.spec --- old/yast2-update-4.0.12/package/yast2-update.spec 2018-03-20 11:19:45.000000000 +0100 +++ new/yast2-update-4.0.16/package/yast2-update.spec 2018-06-12 13:35:38.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-update -Version: 4.0.12 +Version: 4.0.16 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -41,16 +41,16 @@ # Needed for tests BuildRequires: rubygem(rspec) -# Filesystems::Base#match_fstab_spec? and Filesystems::MountByType.from_fstab_spec -BuildRequires: yast2-storage-ng >= 4.0.137 -# Filesystems::Base#match_fstab_spec? and Filesystems::MountByType.from_fstab_spec -Requires: yast2-storage-ng >= 4.0.137 +# Encryption.use_crypttab_names +BuildRequires: yast2-storage-ng >= 4.0.186 +# Encryption.use_crypttab_names +Requires: yast2-storage-ng >= 4.0.186 # FSSnapshotStore Requires: yast2 >= 3.1.126 Requires: yast2-installation -# Packages#proposal_for_update -Requires: yast2-packager >= 3.2.13 +# handle bind mount at /mnt/dev +Requires: yast2-packager >= 4.0.61 # Pkg.TargetInitializeOptions() Requires: yast2-pkg-bindings >= 3.1.14 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-4.0.12/src/modules/RootPart.rb new/yast2-update-4.0.16/src/modules/RootPart.rb --- old/yast2-update-4.0.12/src/modules/RootPart.rb 2018-03-20 11:19:45.000000000 +0100 +++ new/yast2-update-4.0.16/src/modules/RootPart.rb 2018-06-12 13:35:38.000000000 +0200 @@ -31,10 +31,12 @@ require "yast2/fs_snapshot_store" require "y2storage" +require "fileutils" + module Yast class RootPartClass < Module include Logger - NON_MODULAR_FS = ["proc", "sysfs"] + NON_MODULAR_FS = ["devtmpfs", "proc", "sysfs"] def main Yast.import "UI" @@ -1095,6 +1097,13 @@ ) end + # to have devices like /dev/cdrom and /dev/urandom in the chroot + if MountPartition("/dev", "devtmpfs", "devtmpfs") == nil + AddMountedPartition( + { :type => "mount", :device => "devtmpfs", :mntpt => "/dev" } + ) + end + success = true Builtins.foreach(fstab) do |mounts| @@ -1521,12 +1530,11 @@ read_fstab_and_cryptotab(fstab_ref, crtab_ref, root_device_current) fstab = fstab_ref.value crtab = crtab_ref.value - # storage-ng -=begin - Storage.ChangeDmNamesFromCrypttab( - Ops.add(Installation.destdir, "/etc/crypttab") - ) -=end + + # Update encryption devices with the names indicated in the crypttab file (bsc#1094963) + crypttab_path = File.join(Installation.destdir, "/etc/crypttab") + Y2Storage::Encryption.use_crypttab_names(probed, crypttab_path) + Update.GetProductName if FstabUsesKernelDeviceNameForHarddisks(fstab) @@ -1675,27 +1683,44 @@ end Update.clean_backup create_backup + inject_intsys_files end success end + RESOLV_CONF = "/etc/resolv.conf".freeze + # known configuration files that are changed during update, so we need to # backup them to restore if something goes wrong (bnc#882039) BACKUP_DIRS = { - "sw_mgmt" => [ + # use a number prefix to set the execution order + "0100-sw_mgmt" => [ "/var/lib/rpm", "/etc/zypp/repos.d", "/etc/zypp/services.d", "/etc/zypp/credentials.d" + ], + # this should be restored as the very last one, after restoring the original + # resolv.conf the network might not work properly in the chroot + "0999-resolv_conf" => [ + RESOLV_CONF ] } + def create_backup BACKUP_DIRS.each_pair do |name, paths| Update.create_backup(name, paths) end end + # inject the required files from the inst-sys to the chroot so + # the network connection works for the chrooted scripts + def inject_intsys_files + # the original file is backed up and restored later + ::FileUtils.cp(RESOLV_CONF, File.join(Installation.destdir, RESOLV_CONF)) if File.exist?(RESOLV_CONF) + end + # Get architecture of an elf file. def GetArchOfELF(filename) bash_out = Convert.to_map( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-4.0.12/src/modules/Update.rb new/yast2-update-4.0.16/src/modules/Update.rb --- old/yast2-update-4.0.12/src/modules/Update.rb 2018-03-20 11:19:45.000000000 +0100 +++ new/yast2-update-4.0.16/src/modules/Update.rb 2018-06-12 13:35:38.000000000 +0200 @@ -775,11 +775,12 @@ BACKUP_DIR = "var/adm/backup/system-upgrade" # Creates backup with name based on `name` contaings everything # matching globs in `paths`. - # @param name[String] name for backup file. Use bash friendly name ;) + # @param name[String] name for backup file. Use a number prefix to run + # the restore scripts in the expected order. Use a bash friendly name ;) # @note Can be called only after target root is mounted. # # @example to store repos file and credentials directory - # Update.create_backup("repos", ["/etc/zypp/repos.d/*", "/etc/zypp/credentials"]) + # Update.create_backup("0100-repos", ["/etc/zypp/repos.d/*", "/etc/zypp/credentials"]) def create_backup(name, paths) log.info "Creating tarball for #{name} including #{paths}" mounted_root = Installation.destdir @@ -805,7 +806,8 @@ log.info "Restoring backup" mounted_root = Installation.destdir script_glob = File.join(mounted_root, BACKUP_DIR,"restore-*.sh") - ::Dir.glob(script_glob).each do |path| + # sort the scripts to execute them in the expected order + ::Dir.glob(script_glob).sort.each do |path| cmd = "sh #{path} #{File.join("/", mounted_root)}" res = SCR.Execute(path(".target.bash_output"), cmd) log.info "Restoring with script #{cmd} result: #{res}" @@ -889,6 +891,10 @@ tar xvf #{tarball_path} --overwrite # return back to original dir cd - +# flush the caches +sync +# wait a bit to really write everything to disk (see "man sync") +sleep 3 EOF File.write(script_path, script_content) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-4.0.12/test/root_part_test.rb new/yast2-update-4.0.16/test/root_part_test.rb --- old/yast2-update-4.0.12/test/root_part_test.rb 2018-03-20 11:19:45.000000000 +0100 +++ new/yast2-update-4.0.16/test/root_part_test.rb 2018-06-12 13:35:38.000000000 +0200 @@ -234,4 +234,18 @@ end end end + + describe "#MountFSTab" do + it "mounts /dev, /proc and /sys" do + allow(subject).to receive(:AddMountedPartition) + + ["/dev", "/proc", "/sys"].each do |d| + expect(subject).to receive(:MountPartition).with(d, anything, anything) + end + + # call with empty list to only test the /dev, /proc and /sys mounting + fstab = [] + subject.MountFSTab(fstab, "") + end + end end
