Skip to content

Commit

Permalink
Merge pull request #164 from yast/merge-sle-15-sp1
Browse files Browse the repository at this point in the history
Merge SLE-15-SP1
  • Loading branch information
imobachgs authored Feb 10, 2021
2 parents c090f6f + 5c4d318 commit 9005478
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
9 changes: 9 additions & 0 deletions package/yast2-update.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Feb 10 09:12:10 UTC 2021 - Imobach Gonzalez Sosa <[email protected]>

- Do not rely on the 'installation-helper' binary to create
snapshots after installation or offline upgrade (bsc#1180142).
- Do not crash when it is not possible to create a snapshot before
upgrading the system (related to bsc#1180142).
- 4.2.21

-------------------------------------------------------------------
Mon Dec 14 09:01:10 UTC 2020 - Ladislav Slezák <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-update.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-update
Version: 4.2.20
Version: 4.2.21
Release: 0
Summary: YaST2 - Update
Group: System/YaST
Expand Down
25 changes: 19 additions & 6 deletions src/modules/RootPart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1403,12 +1403,7 @@ def MountPartitions(root_device_current)
else
# enter the mount points of the newly mounted partitions
update_staging!
if Yast2::FsSnapshot.configured?
# as of bsc #1092757 snapshot descriptions are not translated
snapshot = Yast2::FsSnapshot.create_pre("before update", cleanup: :number,
important: true)
Yast2::FsSnapshotStore.save("update", snapshot.number)
end
create_pre_snapshot
Update.clean_backup
create_backup
inject_intsys_files
Expand Down Expand Up @@ -2030,6 +2025,24 @@ def mount_regular_fstab_entry?(entry)
# #MountVarIfRequired... except when /var is a subvolume
path != "/var" || mntops.include?("subvol=")
end

# Creates a pre-update snapshot and stores its number
#
# If something goes wrong, it reports the problem to the user.
def create_pre_snapshot
return unless Yast2::FsSnapshot.configured?

# as of bsc #1092757 snapshot descriptions are not translated
snapshot = Yast2::FsSnapshot.create_pre("before update", cleanup: :number, important: true)
Yast2::FsSnapshotStore.save("update", snapshot.number)
rescue Yast2::SnapshotCreationFailed => e
log.error("Error creating a pre-update snapshot: #{e}")
Yast::Report.Error(
_("A pre-update snapshot could not be created. You can continue with the \n" \
"installation, but beware that you cannot roll back to a pre-update state \n" \
"unless you have created a snapshot manually.")
)
end
end

RootPart = RootPartClass.new
Expand Down

0 comments on commit 9005478

Please sign in to comment.