|
|
|
@ -640,7 +640,7 @@ snap_preseed() {
|
|
|
|
|
# Seed from the specified channel (e.g. core18 latest/stable)
|
|
|
|
|
# Or Channel endcoded in the snap name (e.g. lxd=4.0/stable/ubuntu-20.04)
|
|
|
|
|
# Or Ubuntu policy default channel latest/stable/ubuntu-$(release_ver)
|
|
|
|
|
local CHANNEL=$3
|
|
|
|
|
local CHANNEL=${3:-}
|
|
|
|
|
if [ -z "$CHANNEL" ]; then
|
|
|
|
|
case $2 in
|
|
|
|
|
*=*)
|
|
|
|
@ -944,4 +944,20 @@ replace_kernel () {
|
|
|
|
|
install --assume-yes "${new_kernel}"
|
|
|
|
|
env DEBIAN_FRONTEND=noninteractive chroot "${mountpoint}" apt-get \
|
|
|
|
|
autoremove --purge --assume-yes
|
|
|
|
|
|
|
|
|
|
# If running a custom kernel, we should try to boot without an initramfs
|
|
|
|
|
# We do this by setting GRUB_FORCE_PARTUUID, which forces initramfs-less boot
|
|
|
|
|
partuuid=$(blkid -s PARTUUID -o value $(findmnt -n -o SOURCE --target "${mountpoint}"))
|
|
|
|
|
if [ -n "${partuuid}" ]; then
|
|
|
|
|
echo "Force booting without an initramfs..."
|
|
|
|
|
mkdir -p "${mountpoint}/etc/default/grub.d"
|
|
|
|
|
cat << EOF >> "${mountpoint}/etc/default/grub.d/40-force-partuuid.cfg"
|
|
|
|
|
# Force boot without an initramfs by setting GRUB_FORCE_PARTUUID
|
|
|
|
|
# Remove this line to enable boot with an initramfs
|
|
|
|
|
GRUB_FORCE_PARTUUID=${partuuid}
|
|
|
|
|
EOF
|
|
|
|
|
divert_grub "${mountpoint}"
|
|
|
|
|
chroot "${mountpoint}" update-grub
|
|
|
|
|
undivert_grub "${mountpoint}"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|