Fix kernel panic after unattended kernel upgrade#3
Open
pnc wants to merge 7 commits into
Open
Conversation
The update-initramfs diversion (to /bin/true) was permanent — applied in bootcmd with no restore. When unattended-upgrades installed a new kernel, its postinst called update-initramfs which silently did nothing. GRUB picked up the new vmlinuz but with no initrd line. On next boot the kernel couldn't load virtio_blk (module in initramfs), so the root disk was invisible and it panicked with "VFS: Unable to mount root fs". Fix: divert only during first-boot provisioning (guarded by boot-finished), then restore in runcmd so future kernel upgrades generate a working initramfs. Add e2e test that installs a second kernel flavor, verifies the initrd is created, reboots, and confirms the VM comes back on the new kernel. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
|
@ddellacosta I finally had a little time to dig into the kernel panic we both saw. The call was coming from inside the house (overzealous "speed" hack!) |
Member
Author
|
@ddellacosta You will probably want to undivert/unsymlink (per the "Undo" bit) your current VM and re-run update-initramfs so you don't lose your work again. |
|
Gotcha, will give it a shot! |
The cloud kernel package name includes the arch suffix (linux-image-cloud-arm64 vs linux-image-cloud-amd64). Use dpkg --print-architecture inside the guest to pick the right one. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Set MODULES=dep in initramfs-tools so only modules for detected hardware (virtio) are included, instead of hundreds of bare-metal drivers. Also bump the kernel install test timeout from 300s to 600s as a safety margin under TCG emulation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The kernel reboot test hardcoded a partition UUID specific to the current Debian cloud image. Query it from the running VM via grub-probe so the test survives base image updates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous /v2/* wildcard allowed pulling any Docker image — too broad for a security-focused sandbox. Scope to library/hello-world (used by the e2e test) and add the bare /v2/ endpoint required for registry version checks. Also add CloudFront CDN (some Docker blob redirects land there instead of R2) and the uv installer redirect path on releases.astral.sh. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The official install script runs `claude install` after downloading the binary, which maps ~70 GB of virtual memory and gets OOM-killed in 512 MB VMs. Download the binary directly via curl and create the symlink ourselves, bypassing the problematic subcommand. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verify that both tools are installed and on PATH after cloud-init provisioning. Also update CLAUDE.md to note that tests run inside this VM. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The update-initramfs symlink (to /bin/true) made the machine unbootable after updating the kernel (no real surprise there.)
Claude explanation:
When unattended-upgrades installed a new kernel, its postinst called update-initramfs which silently did nothing. GRUB picked up the new vmlinuz but with no initrd line. On next boot the kernel couldn't load virtio_blk (module in initramfs), so the root disk was invisible and it panicked with "VFS: Unable to mount root fs".
Fix: divert only during first-boot provisioning (guarded by boot-finished), then restore in runcmd so future kernel upgrades generate a working initramfs.
Add e2e test that installs a second kernel flavor, verifies the initrd is created, reboots, and confirms the VM comes back on the new kernel.