-
Notifications
You must be signed in to change notification settings - Fork 1
V0.4.1 rework #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v0.4.0
Are you sure you want to change the base?
Changes from all commits
322413b
0f4a194
688f8bb
aae402a
8063139
d2db7cd
f1db876
f810cff
cd33866
f1dab63
595b807
e72f6da
891b1e4
8066ca3
31b1f81
a8f5c99
f1fb4d1
acf8f3d
a195e0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| debian/files |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| disable snapper-boot.timer | ||
| disable snapper-timeline.timer |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| DO NOT REMOVE THIS FILE! | ||
| It is required by the siduction_btrfs systemd units. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # subvolume to snapshot | ||
| SUBVOLUME="/home" | ||
|
|
||
| # filesystem type | ||
| FSTYPE="btrfs" | ||
|
|
||
|
|
||
| # btrfs qgroup for space aware cleanup algorithms | ||
| QGROUP="" | ||
|
|
||
|
|
||
| # fraction or absolute size of the filesystems space the snapshots may use | ||
| SPACE_LIMIT="0.5" | ||
|
|
||
| # fraction or absolute size of the filesystems space that should be free | ||
| FREE_LIMIT="0.2" | ||
|
|
||
|
|
||
| # users and groups allowed to work with config | ||
| ALLOW_USERS="" | ||
| ALLOW_GROUPS="" | ||
|
|
||
| # sync users and groups from ALLOW_USERS and ALLOW_GROUPS to .snapshots | ||
| # directory | ||
| SYNC_ACL="yes" | ||
|
|
||
|
|
||
| # start comparing pre- and post-snapshot in background after creating | ||
| # post-snapshot | ||
| BACKGROUND_COMPARISON="yes" | ||
|
|
||
|
|
||
| # run daily number cleanup | ||
| NUMBER_CLEANUP="yes" | ||
|
|
||
| # limit for number cleanup | ||
| NUMBER_MIN_AGE="1800" | ||
| NUMBER_LIMIT="20" | ||
| NUMBER_LIMIT_IMPORTANT="5" | ||
|
|
||
|
|
||
| # create hourly snapshots | ||
| TIMELINE_CREATE="yes" | ||
|
|
||
| # cleanup hourly snapshots after some time | ||
| TIMELINE_CLEANUP="yes" | ||
|
|
||
| # limits for timeline cleanup | ||
| TIMELINE_MIN_AGE="1800" | ||
| TIMELINE_LIMIT_HOURLY="11" | ||
| TIMELINE_LIMIT_DAILY="6" | ||
| TIMELINE_LIMIT_WEEKLY="1" | ||
| TIMELINE_LIMIT_MONTHLY="" | ||
| TIMELINE_LIMIT_YEARLY="" | ||
|
|
||
|
|
||
| # cleanup empty pre-post-pairs | ||
| EMPTY_PRE_POST_CLEANUP="yes" | ||
|
|
||
| # limits for empty pre-post-pair cleanup | ||
| EMPTY_PRE_POST_MIN_AGE="1800" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # subvolume to snapshot | ||
| SUBVOLUME="/" | ||
|
|
||
| # filesystem type | ||
| FSTYPE="btrfs" | ||
|
|
||
|
|
||
| # btrfs qgroup for space aware cleanup algorithms | ||
| QGROUP="" | ||
|
|
||
|
|
||
| # fraction or absolute size of the filesystems space the snapshots may use | ||
| SPACE_LIMIT="0.5" | ||
|
|
||
| # fraction or absolute size of the filesystems space that should be free | ||
| FREE_LIMIT="0.2" | ||
|
|
||
|
|
||
| # users and groups allowed to work with config | ||
| ALLOW_USERS="" | ||
| ALLOW_GROUPS="" | ||
|
|
||
| # sync users and groups from ALLOW_USERS and ALLOW_GROUPS to .snapshots | ||
| # directory | ||
| SYNC_ACL="yes" | ||
|
|
||
|
|
||
| # start comparing pre- and post-snapshot in background after creating | ||
| # post-snapshot | ||
| BACKGROUND_COMPARISON="yes" | ||
|
|
||
|
|
||
| # run daily number cleanup | ||
| NUMBER_CLEANUP="yes" | ||
|
|
||
| # limit for number cleanup | ||
| NUMBER_MIN_AGE="1800" | ||
| NUMBER_LIMIT="20" | ||
| NUMBER_LIMIT_IMPORTANT="5" | ||
|
|
||
|
|
||
| # create hourly snapshots | ||
| TIMELINE_CREATE="no" | ||
|
|
||
| # cleanup hourly snapshots after some time | ||
| TIMELINE_CLEANUP="yes" | ||
|
|
||
| # limits for timeline cleanup | ||
| TIMELINE_MIN_AGE="1800" | ||
| TIMELINE_LIMIT_HOURLY="" | ||
| TIMELINE_LIMIT_DAILY="6" | ||
| TIMELINE_LIMIT_WEEKLY="2" | ||
| TIMELINE_LIMIT_MONTHLY="1" | ||
| TIMELINE_LIMIT_YEARLY="" | ||
|
|
||
|
|
||
| # cleanup empty pre-post-pairs | ||
| EMPTY_PRE_POST_CLEANUP="yes" | ||
|
|
||
| # limits for empty pre-post-pair cleanup | ||
| EMPTY_PRE_POST_MIN_AGE="1800" |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,14 @@ | ||
| 50-siduction.sh /usr/lib/snapper/plugins/ | ||
| 91-siduction-entry-key.install /usr/lib/kernel/install.d/ | ||
| rollback-grub.sh /usr/share/siduction/ | ||
| rollback-sd-boot.sh /usr/share/siduction/ | ||
| snapshot-description.sh /usr/share/siduction/ | ||
| grub-menu-title.sh /usr/share/siduction/ | ||
| siduction_btrfs.service /usr/lib/systemd/system/ | ||
| siduction_btrfs.path /usr/lib/systemd/system/ | ||
| rolling /usr/share/snapper/config-templates/ | ||
| 50-siduction.sh /usr/lib/snapper/plugins/ | ||
| 91-siduction-entry-key.install /usr/lib/kernel/install.d/ | ||
| btrfs /usr/share/siduction-btrfs/ | ||
| rollback-grub.sh /usr/share/siduction-btrfs/ | ||
| rollback-sd-boot.sh /usr/share/siduction-btrfs/ | ||
| snapshot-description.sh /usr/share/siduction-btrfs/ | ||
| grub-menu-title.sh /usr/share/siduction-btrfs/ | ||
| configs/* /usr/share/snapper/config-templates/ | ||
| siduction_btrfs.service /usr/lib/systemd/system/ | ||
| siduction_btrfs.path /usr/lib/systemd/system/ | ||
| 60-siduction-btrfs.preset /usr/lib/systemd/system-preset/ | ||
| Info.md /usr/share/docs/siduction-btrfs/ | ||
| LICENSE /usr/share/docs/siduction-btrfs/ | ||
| README.md /usr/share/docs/siduction-btrfs/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,9 +5,60 @@ | |
|
|
||
| set -e | ||
|
|
||
| exec $(systemctl daemon-reload) | ||
| case "$1" in | ||
| configure) | ||
| if ! snapper list-configs | grep -q "^root " 2>/dev/null; then | ||
| echo "Create snapper-configuration for root..." | ||
| snapper --no-dbus create-config -f btrfs / || true | ||
| rm -f /etc/snapper/configs/root | ||
| fi | ||
| if ! snapper list-configs | grep -q "^home " 2>/dev/null; then | ||
| echo "Create snapper-configuration for home..." | ||
| if [ -d /home ]; then | ||
| snapper --no-dbus -c home create-config -f btrfs /home || true | ||
| rm -f /etc/snapper/configs/home | ||
| fi | ||
| fi | ||
| # register existing snapper configs with UCF | ||
| if [ -x "/usr/bin/ucf" ]; then | ||
| echo "check for existing snapper-configurations..." | ||
| ucf --three-way /usr/share/siduction-btrfs/configs/root /etc/snapper/configs/root | ||
| ucf --three-way /usr/share/siduction-btrfs/configs/home /etc/snapper/configs/home | ||
|
|
||
| ucfr siduction-btrfs /etc/snapper/configs/root | ||
| ucfr siduction-btrfs /etc/snapper/configs/home | ||
| else | ||
| # Fallback force copy default configs | ||
| cp -an /usr/share/siduction-btrfs/configs/root /etc/snapper/configs/root | ||
| cp -an /usr/share/siduction-btrfs/configs/home /etc/snapper/configs/home | ||
| fi | ||
| # checking chroot | ||
| if systemd-detect-virt --chroot >/dev/null 2>&1; then | ||
| echo "Running in chroot. Force deactivating snapper-timera ..." | ||
| rm -f /etc/systemd/system/timers.target.wants/snapper-boot.timer | ||
| rm -f /etc/systemd/system/timers.target.wants/snapper-timeline.timer | ||
|
|
||
| if [ -x "/usr/bin/deb-systemd-helper" ]; then | ||
| deb-systemd-helper disable snapper-boot.timer >/dev/null 2>&1 || true | ||
| deb-systemd-helper disable snapper-timeline.timer >/dev/null 2>&1 || true | ||
| fi | ||
| else | ||
| if [ -d /run/systemd/system ]; then | ||
| echo "Set siduction systemd-presets for snapper ..." | ||
| systemctl --system daemon-reload || true | ||
| systemctl --system preset snapper-boot.timer || true | ||
| systemctl --system preset snapper-timeline.timer || true | ||
| fi | ||
| fi | ||
| ;; | ||
| abort-upgrade|abort-remove|abort-deconfigure) | ||
| ;; | ||
|
|
||
| exec $(systemctl enable --now siduction_btrfs.path) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Die systemd Unit müsste auch aktiviert werden. Sonst können keine Booteinträge erstellt werden.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. siduction_btrfs.path ist enabled, wenn man dieses Paket installiert, dafür sogt der Debhelper.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Einzig, wenn man von 0.4.0 auf dieses Paket upgraden würde, ist das danach nicht anabled (auf Grund des alten codes).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wie wäre es mit diesen Code innerhalb 'configure)' um ein Upgrade von 0.4.0 sicher zu gestalten? |
||
| *) | ||
| echo "postinst called with unknown argument \`$1'" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| #DEBHELPER# | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.