Skip to content

feat: disable kernel updates in setup script#519

Merged
Alpaca233 merged 2 commits into
Cephla-Lab:masterfrom
Alpaca233:disable-kernel-update
Mar 23, 2026
Merged

feat: disable kernel updates in setup script#519
Alpaca233 merged 2 commits into
Cephla-Lab:masterfrom
Alpaca233:disable-kernel-update

Conversation

@Alpaca233
Copy link
Copy Markdown
Collaborator

Summary

  • Adds apt-mark hold to setup_22.04.sh to pin the current kernel and generic kernel metapackages, preventing automatic kernel updates that can break driver/module compatibility
  • Prints an unhold command for easy reversal

Test plan

  • Run setup_22.04.sh on a fresh Ubuntu 22.04 install and verify kernel packages are held
  • Verify apt-mark showhold lists the expected packages after setup
  • Verify the printed unhold command correctly removes the holds

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds kernel package holds to the Ubuntu 22.04 setup script to prevent automatic kernel upgrades that could break driver/module compatibility.

Changes:

  • Hold Ubuntu kernel metapackages (linux-image-generic, linux-headers-generic, linux-generic) via apt-mark hold.
  • Also hold the currently-running kernel image/headers packages and print an apt-mark unhold command for reversal.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread software/setup_22.04.sh Outdated
Comment on lines +76 to +79
sudo apt-mark hold \
linux-image-generic linux-headers-generic linux-generic \
"linux-image-$(uname -r)" "linux-headers-$(uname -r)" 2>/dev/null || true
echo "Kernel packages held. Run 'sudo apt-mark unhold linux-image-generic linux-headers-generic linux-generic linux-image-$(uname -r) linux-headers-$(uname -r)' to re-enable."
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The apt-mark hold call suppresses errors (2>/dev/null || true), but the next line always prints "Kernel packages held". If apt-mark fails (e.g., dpkg lock, missing package names, sudo issues), the script will claim success while not actually pinning the kernel. Consider removing the error suppression or checking the command exit status and printing a warning / aborting when the hold step fails; alternatively, validate with apt-mark showhold before printing the success message.

Suggested change
sudo apt-mark hold \
linux-image-generic linux-headers-generic linux-generic \
"linux-image-$(uname -r)" "linux-headers-$(uname -r)" 2>/dev/null || true
echo "Kernel packages held. Run 'sudo apt-mark unhold linux-image-generic linux-headers-generic linux-generic linux-image-$(uname -r) linux-headers-$(uname -r)' to re-enable."
if sudo apt-mark hold \
linux-image-generic linux-headers-generic linux-generic \
"linux-image-$(uname -r)" "linux-headers-$(uname -r)"; then
echo "Kernel packages held. Run 'sudo apt-mark unhold linux-image-generic linux-headers-generic linux-generic linux-image-$(uname -r) linux-headers-$(uname -r)' to re-enable."
else
echo "Warning: Failed to hold kernel packages; automatic kernel updates remain enabled." >&2
fi

Copilot uses AI. Check for mistakes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Alpaca233 Alpaca233 merged commit dda4c98 into Cephla-Lab:master Mar 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants