From f6f0bfd1150c1d04ff59ae76647ad59ee91f2b87 Mon Sep 17 00:00:00 2001 From: teldra Date: Mon, 12 Apr 2021 17:25:50 +0200 Subject: [PATCH] fixes and additions --- modules/40-basesystem/install | 81 +++++++++++++++++------------------ modules/60-de/config | 2 +- modules/disk/bios/postconfig | 6 ++- modules/disk/uefi/postconfig | 9 +++- 4 files changed, 52 insertions(+), 46 deletions(-) diff --git a/modules/40-basesystem/install b/modules/40-basesystem/install index 6558fac..91e26be 100644 --- a/modules/40-basesystem/install +++ b/modules/40-basesystem/install @@ -82,52 +82,49 @@ if [[ ! ${cfg[fde_key_store]} == "none" ]]; then echo "fi" >> /etc/runit/core-services/99-changepwuser.sh fi -mkdir -p /var/lib/backup/quelle/{rootfs,home} -echo "transaction_log /var/log/btrbk.log" > /etc/btrbk/btrbk.conf -echo "lockfile /tmp/btrbk.lock" >> /etc/btrbk/btrbk.conf -echo "incremental yes" >> /etc/btrbk/btrbk.conf -echo "btrfs_commit_delete after" >> /etc/btrbk/btrbk.conf -echo "timestamp_format long" >> /etc/btrbk/btrbk.conf -echo "noauto yes" >> /etc/btrbk/btrbk.conf +{ echo "transaction_log /var/log/btrbk.log"; +echo "lockfile /tmp/btrbk.lock"; +echo "incremental yes"; +echo "btrfs_commit_delete after"; +echo "timestamp_format long"; +echo "noauto yes"; } > /etc/btrbk/btrbk.conf if [[ ! ${cfg[fde_key_store]} == "once" ]]; then - mkdir -p /var/lib/backup/quelle/boot - echo "volume /var/lib/backup/quelle/boot" >> /etc/btrbk/btrbk.conf - echo " group snapshot all" >> /etc/btrbk/btrbk.conf - echo " snapshot_dir snapshot" >> /etc/btrbk/btrbk.conf - echo " snapshot_preserve_min 4h" >> /etc/btrbk/btrbk.conf - echo " snapshot_preserve no" >> /etc/btrbk/btrbk.conf - echo " subvolume void" >> /etc/btrbk/btrbk.conf + { echo "volume /var/lib/backup/quelle/boot"; + echo " group snapshot all"; + echo " snapshot_dir snapshot"; + echo " snapshot_preserve_min 4h"; + echo " snapshot_preserve no"; + echo " subvolume void"; } >> /etc/btrbk/btrbk.conf fi -echo "volume /var/lib/backup/quelle/rootfs" >> /etc/btrbk/btrbk.conf -echo " group snapshot all" >> /etc/btrbk/btrbk.conf -echo " snapshot_dir snapshot" >> /etc/btrbk/btrbk.conf -echo " snapshot_preserve_min 4h" >> /etc/btrbk/btrbk.conf -echo " snapshot_preserve no " >> /etc/btrbk/btrbk.conf -echo " subvolume void-rootfs" >> /etc/btrbk/btrbk.conf -echo " subvolume home" >> /etc/btrbk/btrbk.conf +{ echo "volume /var/lib/backup/quelle/rootfs"; +echo " group snapshot all"; +echo " snapshot_dir snapshot"; +echo " snapshot_preserve_min 4h"; +echo " snapshot_preserve no "; +echo " subvolume void-rootfs"; +echo " subvolume home"; } >> /etc/btrbk/btrbk.conf if [[ ! ${cfg[fde_key_store]} == "once" ]]; then - mkdir -p /var/lib/backup/ziel/void - echo "volume /var/lib/backup/quelle/boot" >> /etc/btrbk/btrbk.conf - echo " group backup all" >> /etc/btrbk/btrbk.conf - echo " snapshot_dir backup" >> /etc/btrbk/btrbk.conf - echo " snapshot_preserve_min 4h" >> /etc/btrbk/btrbk.conf - echo " snapshot_preserve no" >> /etc/btrbk/btrbk.conf - echo " target_preserve_min latest" >> /etc/btrbk/btrbk.conf - echo " target_preserve 20d 10w 2m" >> /etc/btrbk/btrbk.conf - echo " subvolume void" >> /etc/btrbk/btrbk.conf - echo " target send-receive /var/lib/backup/ziel/void/boot" >> /etc/btrbk/btrbk.conf + { echo "volume /var/lib/backup/quelle/boot"; + echo " group backup all"; + echo " snapshot_dir backup"; + echo " snapshot_preserve_min 4h"; + echo " snapshot_preserve no"; + echo " target_preserve_min latest"; + echo " target_preserve 20d 10w 2m"; + echo " subvolume void"; + echo " target send-receive /var/lib/backup/ziel/void/boot"; } >> /etc/btrbk/btrbk.conf fi -echo "volume /var/lib/backup/quelle/rootfs" >> /etc/btrbk/btrbk.conf -echo " group backup all" >> /etc/btrbk/btrbk.conf -echo " snapshot_dir backup" >> /etc/btrbk/btrbk.conf -echo " snapshot_preserve_min 4h" >> /etc/btrbk/btrbk.conf -echo " snapshot_preserve no" >> /etc/btrbk/btrbk.conf -echo " target_preserve_min latest" >> /etc/btrbk/btrbk.conf -echo " target_preserve 20d 10w 2m" >> /etc/btrbk/btrbk.conf -echo " subvolume rootfs" >> /etc/btrbk/btrbk.conf -echo " target send-receive /var/lib/backup/ziel/void/rootfs" >> /etc/btrbk/btrbk.conf -echo " subvolume home" >> /etc/btrbk/btrbk.conf -echo " target send-receive /var/lib/backup/ziel/void/homefs" >> /etc/btrbk/btrbk.conf +{ echo "volume /var/lib/backup/quelle/rootfs"; +echo " group backup all"; +echo " snapshot_dir backup"; +echo " snapshot_preserve_min 4h"; +echo " snapshot_preserve no"; +echo " target_preserve_min latest"; +echo " target_preserve 20d 10w 2m"; +echo " subvolume rootfs"; +echo " target send-receive /var/lib/backup/ziel/void/rootfs"; +echo " subvolume home"; +echo " target send-receive /var/lib/backup/ziel/void/homefs"; } >> /etc/btrbk/btrbk.conf mkdir -p /var/spool/cron/ echo "0 */2 * * * /usr/bin/btrbk -q run snapshot" >> /var/spool/cron/root diff --git a/modules/60-de/config b/modules/60-de/config index 5972602..43f7cc8 100644 --- a/modules/60-de/config +++ b/modules/60-de/config @@ -12,7 +12,7 @@ if [[ "${cfg[de]}" == "gnome" ]]; then addpkg "${cfg[dm]}" "gnome" "seahorse" "seahorse-nautilus" "evince" elif [[ "${cfg[de]}" == "kde5" ]]; then setconf add "dm" "sddm" - addpkg "${cfg[dm]}" kde5 kde5-baseapps kdegraphics-thumbnailers ffmpegthumbs ark gwenview kmail okular spectacle kalarm kcalc print-manager + addpkg "${cfg[dm]}" kde5 kde5-baseapps kdegraphics-thumbnailers ffmpegthumbs ark gwenview kmail okular spectacle kalarm kcalc print-manager plasma-browser-integration kwalletmanager elif [[ "${cfg[de]}" == "i3wm" ]]; then setconf add "dm" "lightdm" addpkg lightdm lightdm-gtk3-greeter i3-gaps i3lock-color i3status xfce4-terminal dmenu rofi pcmanfm dunst elogind gvfs gvfs-afc gvfs-afp gvfs-cdda paprefs pavucontrol gvfs-gphoto2 gvfs-mtp gvfs-smb xss-lock claws-mail galculator-gtk3 diff --git a/modules/disk/bios/postconfig b/modules/disk/bios/postconfig index 6401613..82308a6 100644 --- a/modules/disk/bios/postconfig +++ b/modules/disk/bios/postconfig @@ -101,12 +101,16 @@ mkdir -p "${dest}/snapshot" "${dest}/backup" umount "${dest}" mount "/dev/mapper/voidvg.${diskid}-root" "${dest}" -o subvol=void-rootfs -for i in boot home dev proc sys tmp etc var/lib/backup/quelle/rootfs var/db; do mkdir -p "${dest}/${i}"; done +for i in boot home dev proc sys tmp etc var/lib/backup/quelle/rootfs var/lib/backup/ziel var/db; do mkdir -p "${dest}/${i}"; done mount "/dev/mapper/voidvg.${diskid}-root" "${dest}"/home -o subvol=home if [[ "${cfg[fde_key_store]}" == "once" ]]; then mkdir -p "${dest}/var/lib/backup/quelle/boot" mkfs.btrfs -q -f "${target_boot}" mount "${target_boot}" "${dest}/boot" + btrfs subvol create "${dest}/boot/void" + mkdir -p "${dest}/boot/snapshot" "${dest}/boot/backup" + umount "${dest}/boot" + mount "${target_boot}" "${dest}/boot" -o subvol=void fi for dir in dev proc sys run; do mkdir -p "${dest}"/$dir ; mount --rbind /$dir "${dest}"/$dir ; mount --make-rslave "${dest}"/$dir ; done diff --git a/modules/disk/uefi/postconfig b/modules/disk/uefi/postconfig index d74a70a..c152591 100644 --- a/modules/disk/uefi/postconfig +++ b/modules/disk/uefi/postconfig @@ -97,15 +97,20 @@ mkswap "/dev/mapper/voidvg.${diskid}-swap" mount "/dev/mapper/voidvg.${diskid}-root" "${dest}" btrfs subvol create "${dest}/void-rootfs" btrfs subvol create "${dest}/home" -mkdir -p "${dest}/snapshot" +mkdir -p "${dest}/snapshot" "${dest}/backup" umount "${dest}" mount "/dev/mapper/voidvg.${diskid}-root" "${dest}" -o subvol=void-rootfs -for i in boot home dev proc sys tmp etc var/lib/backup/quelle var/db; do mkdir -p "${dest}/${i}"; done +for i in boot home dev proc sys tmp etc var/lib/backup/quelle/rootfs var/lib/backup/ziel var/db; do mkdir -p "${dest}/${i}"; done mount "/dev/mapper/voidvg.${diskid}-root" "${dest}"/home -o subvol=home if [[ "${cfg[fde_key_store]}" == "once" ]]; then + mkdir -p "${dest}/var/lib/backup/quelle/boot" mkfs.btrfs -q -f "${target_boot}" mount "${target_boot}" "${dest}/boot" + btrfs subvol create "${dest}/boot/void" + mkdir -p "${dest}/boot/snapshot" "${dest}/boot/backup" + umount "${dest}/boot" + mount "${target_boot}" "${dest}/boot" -o subvol=void fi for dir in dev proc sys run; do mkdir -p "${dest}"/$dir ; mount --rbind /$dir "${dest}"/$dir ; mount --make-rslave "${dest}"/$dir ; done