[Bug 1983419] Re: cloud-init is always upgrading the kernel to latest
Launchpad Bug Tracker
1983419 at bugs.launchpad.net
Mon May 20 16:34:15 UTC 2024
Status changed to 'Confirmed' because the bug affects multiple users.
** Changed in: subiquity (Ubuntu)
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to subiquity in Ubuntu.
https://bugs.launchpad.net/bugs/1983419
Title:
cloud-init is always upgrading the kernel to latest
Status in subiquity package in Ubuntu:
Confirmed
Bug description:
Hi !
I've been using cloud-init to build Ubuntu 20.04 VM Images with Packer
from a the ISO file
https://releases.ubuntu.com/20.04/ubuntu-20.04.4-live-server-amd64.iso
that has been created couple of months ago, in February.
When starting an Ubuntu Server using this ISO file directly, we can
see that the Kernel version is the kernel of February, which makes
sense since that's the date of the ISO build.
Last month, in July, a bug has been detected in the latest version of
the Linux kernel, version 5.4.0-122.
Due to this kernel bug, I have been trying to build an Ubuntu Image
that would not use the latest kernel. My goal was then to later
upgrade the kernel up to the last known working kernel, which is
version 5.4.0-121.
Sadly, it seems like cloud-init is ignoring the option 'refresh-
installer' and the Image that is built is directly installing the
latest version of the kernel, which is the one that contains the bug.
I tried the following approach to disable the automatic upgrade of the kernel:
Test 1:
#cloud-config
autoinstall:
refresh-installer:
update: no
Test 2:
#cloud-config
autoinstall:
early-commands:
- apt-mark hold linux-generic linux-image-generic linux-header-generic
Test 3:
#cloud-config
autoinstall:
early-commands:
- echo "Unattended-Upgrade::Package-Blacklist {" > /target/etc/apt/apt.conf.d/50unattended-upgrades
- echo "\"linux-generic\";" >> /target/etc/apt/apt.conf.d/50unattended-upgrades
- echo "\"linux-image-generic\";" >> /target/etc/apt/apt.conf.d/50unattended-upgrades
- echo "\"linux-headers-generic\";" >> /target/etc/apt/apt.conf.d/50unattended-upgrades
- echo "};" >> /target/etc/apt/apt.conf.d/50unattended-upgrades
In Test 1 and 2, the kernel is anyway upgraded to version 5.4.0-122.
In test 3, the image fail to be built.
I believe there should be a way to avoid automatically upgrading the
kernel to the latest version when building the image, but for some
reason I have not been able to identify how to do that.
Any ideas ?
Thanks
Thomas
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1983419/+subscriptions
More information about the foundations-bugs
mailing list