PACMAN_KEEP_OLD_KERNELS goes in root snapper config

This commit is contained in:
James Barnett 2017-04-18 20:20:02 -05:00
parent 67a89013cd
commit ce7516c681
No known key found for this signature in database
GPG key ID: E4B5E45AA3B8C5C3

View file

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