debugging

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

View file

@ -24,6 +24,7 @@ while read -r f; do
kernel_updated="yes"
fi
done
printf "Kernel updated: %s\n" $kernel_updated
declare -r SNAPPER_CONFIG_FILE=/etc/conf.d/snapper
declare -r DESC_LIMIT=48
@ -79,15 +80,17 @@ 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)
printf "==> Linking old kernels and modules...\n"
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)
ln -s /.snapshots/$x/snapshot/usr/lib/modules/$(uname -r) /usr/lib/modules/
fi
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...\n"
kver=$(pacman -Q linux | awk '{print $2}')-ARCH
mv /boot/vmlinuz-linux /boot/vmlinuz-linux-$kver
mv /boot/initramfs-linux.img /boot/initramfs-linux-$kver.img