[Bug 1983419] [NEW] cloud-init is always upgrading the kernel to latest

Launchpad Bug Tracker 1983419 at bugs.launchpad.net
Thu Aug 4 09:44:22 UTC 2022


You have been subscribed to a public bug:

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

** Affects: subiquity (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: autoinstall cloud-init
-- 
cloud-init is always upgrading the kernel to latest
https://bugs.launchpad.net/bugs/1983419
You received this bug notification because you are a member of Ubuntu Foundations Bugs, which is subscribed to subiquity in Ubuntu.



More information about the foundations-bugs mailing list