move everything to post snapshot

This commit is contained in:
James Barnett 2017-04-18 20:07:53 -05:00
parent d3d4a40992
commit bc059a3f04
No known key found for this signature in database
GPG key ID: E4B5E45AA3B8C5C3

View file

@ -79,15 +79,14 @@ for CONFIG in $SNAPPER_CONFIGS; do
if [[ "$pre_or_post" == "pre" ]]; then
x=$($snapper_cmd "$(truncate_description $PACMAN_PRE_DESCRIPTION)")
printf "==> %s: $(echo $x | tee "$prefile")\n" "$CONFIG"
elif [[ -f $prefile && "$pre_or_post" == "post" ]]; then
if [[ $CONFIG == "root" && $PACMAN_KEEP_OLD_KERNELS == "yes" && $kernel_updated == "yes" ]]; then
[[ -d /boot/old ]] && mkdir -p /boot/old
printf "==> Linking old kernels and modules..."
x=$(<$prefile)
find /usr/lib/modules -xtype l -delete
find /boot/old -xtype l -delete
ln -s /.snapshots/$x/snapshot/boot/vmlinuz-linux/boot/old/vmlinuz-linux-$(uname -r)
fi
elif [[ -f $prefile && "$pre_or_post" == "post" ]]; then
if [[ $CONFIG == "root" && $PACMAN_KEEP_OLD_KERNELS == "yes" && $kernel_updated == "yes" ]]; then
x=$(<$prefile)
ln -s /.snapshots/$x/snapshot/usr/lib/modules/$(uname -r) /usr/lib/modules/
kver=$(pacman -Q linux | awk '{print $2}')-ARCH
mv /boot/vmlinuz-linux /boot/vmlinuz-linux-$kver