forked from openSUSE/snapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added new workflow using only two steps to installation-helper
- Loading branch information
Showing
6 changed files
with
336 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
The "old" way using the steps 1 to 5 is deprecated. | ||
|
||
|
||
The "new" way is to use the two steps "filesystem" and "config". | ||
|
||
The step "filesystem" does the following: | ||
|
||
create btrfs subvolume /<root-prefix>/.snapshots | ||
create directory /<root-prefix>/.snapshots/1 | ||
create btrfs subvolume /<root-prefix>/.snapshots/1/snapshot | ||
set default btrfs subvolume to /<root-prefix>/.snapshots/1/snapshot | ||
create directory /<root-prefix>/.snapshots/1/snapshot/.snapshots | ||
|
||
The step "config" does the following: | ||
|
||
create snapper sysconfig /<root-prefix>/etc/sysconfig/snapper | ||
create snapper config /<root-prefix>/etc/snapper/configs/root | ||
create snapper info file /<root-prefix>/.snapshots/1/info.xml | ||
|
||
The installer has to mount the filesystem before the step | ||
"filesystem". Between the two steps the filesystem must be remounted | ||
(since the default subvolume was changes). Additionally the .snapshots | ||
subvolume must be mounted by the installer. | ||
|
||
The installer must also handle /etc/fstab or similar. | ||
|
||
Works with and without the optional "@" subvolume. | ||
|
||
No plugins are run. | ||
|
||
Example workflow can be seen in test1.sh and test2.sh. | ||
|
||
The "filesystem" step can of course be implemented somewhere | ||
else. E.g. libstorage-ng is capable of doing this (see example there). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/bash -x | ||
|
||
umount /test/.snapshots | ||
umount /test | ||
|
||
mkfs.btrfs -f /dev/sdc1 | ||
|
||
mount /dev/sdc1 /test | ||
|
||
/usr/lib/snapper/installation-helper --root-prefix /test --step filesystem | ||
|
||
umount /test | ||
|
||
mount /dev/sdc1 /test | ||
mount /dev/sdc1 -o subvol=.snapshots /test/.snapshots | ||
|
||
/usr/lib/snapper/installation-helper --root-prefix /test --step config --description initial --userdata a=1 | ||
|
||
snapper --no-dbus --root /test ls | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/bash -x | ||
|
||
umount /test/.snapshots | ||
umount /test | ||
|
||
mkfs.btrfs -f /dev/sdc1 | ||
|
||
mount /dev/sdc1 /test | ||
|
||
btrfs subvolume create /test/@ | ||
btrfs subvolume set-default /test/@ | ||
|
||
umount /test | ||
|
||
mount /dev/sdc1 /test | ||
|
||
/usr/lib/snapper/installation-helper --root-prefix /test --step filesystem | ||
|
||
umount /test | ||
|
||
mount /dev/sdc1 /test | ||
mount /dev/sdc1 -o subvol=@/.snapshots /test/.snapshots | ||
|
||
/usr/lib/snapper/installation-helper --root-prefix /test --step config --description initial --userdata a=1 | ||
|
||
snapper --no-dbus --root /test ls | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
------------------------------------------------------------------- | ||
Mon Dec 02 16:51:50 CET 2024 - [email protected] | ||
|
||
- added new workflow using only two steps to installation-helper | ||
(gh#openSUSE/snapper#944) | ||
|
||
------------------------------------------------------------------- | ||
Tue Nov 05 10:50:50 CET 2024 - [email protected] | ||
|
||
|