Skip to content

Commit

Permalink
Configure custom-bootbackup.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
leomeinel authored Aug 28, 2022
1 parent 1e62b2a commit 790950c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ KEYLAYOUT="de"
# Fail on error
set -e

# Configure custom-bootbackup.sh
DISK1P1_UUID="$(lsblk -rno LABEL,MOUNTPOINT,UUID | grep "BOOT /boot" | sed 's/BOOT \/boot//' | tr -d "[:space:]")"
DISK2P1_UUID="$(lsblk -rno LABEL,MOUNTPOINT,UUID | grep "BOOT " | sed 's/BOOT //' | tr -d "[:space:]")"
doas sh -c '{
echo "#!/bin/sh"
echo ""
echo "/usr/bin/rsync -aq --delete --mkpath /.boot.bak/ /.boot.bak.old"
echo "/usr/bin/rsync -aq --delete --mkpath /boot/ /.boot.bak"
echo "if /usr/bin/mountpoint -q /boot"
echo "then"
echo " /usr/bin/umount -AR /boot"
echo "fi"
echo "/usr/bin/mount UUID=$DISK2P1_UUID /boot"
echo "/usr/bin/rsync -aq --delete --mkpath /.boot.bak/ /boot"
echo "/usr/bin/umount /boot"
echo "/usr/bin/mount UUID=$DISK1P1_UUID /boot"
} > /etc/pacman.d/hooks/scripts/custom-bootbackup.sh'
doas chmod 744 /etc/pacman.d/hooks/scripts/*.sh

# Configure clock
doas timedatectl set-ntp true

Expand Down

0 comments on commit 790950c

Please sign in to comment.