Browse Source

Ensure that we have a current kernel package installed

If no upgrades were available, the existing package needs to be
reinstalled, because the images in /boot were erased as part of the
original live CD build process, and we rely on them being present to
fix up the ISO later.
tags/nilmbuntu-5
Jim Paris 7 years ago
parent
commit
b3bcec51f8
1 changed files with 10 additions and 3 deletions
  1. +10
    -3
      customize-inner.sh

+ 10
- 3
customize-inner.sh View File

@@ -31,13 +31,20 @@ EOF
# And copy it for now (although it will get overwritten at boot) # And copy it for now (although it will get overwritten at boot)
cat /etc/hosts.nilm >> /etc/hosts cat /etc/hosts.nilm >> /etc/hosts


# Upgrade packages and remove old kernels
# Upgrade packages
apt update apt update
apt -y dist-upgrade apt -y dist-upgrade
apt -y --purge autoremove apt -y --purge autoremove
for VER in $(ls --sort=version /lib/modules/ | head -n -1) ; do
apt -y --purge remove "linux-.*$VER"

# Remove old kernels, and reinstall the latest one (to make sure
# it's present in /boot)
LATEST_KERNEL=$(ls --sort=version /lib/modules/ | tail -n 1)
for VER in $(ls --sort=version /lib/modules/) ; do
if [ $VER != $LATEST_KERNEL ] ; then
apt -y --purge remove "linux-.*$VER"
fi
done done
apt -y --reinstall install linux-{,signed-}image-${LATEST_KERNEL}


# Disable upgrade popups # Disable upgrade popups
sed -i -s -e 's/Prompt=.*/Prompt=never/g' \ sed -i -s -e 's/Prompt=.*/Prompt=never/g' \


Loading…
Cancel
Save