#!/bin/bash # Kernel-lane spike (R-836, `09` §3 decision 164) — set up on a Proxmox host WITHOUT rebooting. Reversible: spike-undo.sh. # Usage: spike-setup.sh e.g. spike-setup.sh 7.0.2-6-pve 7.0.14-20-pve set -euo pipefail OLD=$1 NEW=$2 ROOTUUID=$(findmnt -n -o UUID /) ESPUUID=$(findmnt -n -o UUID /boot/efi) ROOTDEV=$(findmnt -n -o SOURCE /) ADV="gnulinux-advanced-$ROOTUUID" [ -f /etc/default/grub.felhom-spike-orig ] || cp -p /etc/default/grub /etc/default/grub.felhom-spike-orig # 1. the OLD kernel is the default (an install of a new kernel made the NEW one default — R-836) sed -i "s|^GRUB_DEFAULT=.*|GRUB_DEFAULT=\"$ADV>gnulinux-$OLD-advanced-$ROOTUUID\"|" /etc/default/grub # 2. candidate 2: a one-shot flag in a GRUB environment block on the ESP (vfat — GRUB can rewrite it in place) grub-editenv /boot/efi/EFI/proxmox/felhom-oneshot.env create cat > /etc/grub.d/01_felhom_oneshot < /etc/grub.d/41_felhom_spike chmod 0755 /etc/grub.d/41_felhom_spike update-grub 2>&1 | tail -2 grub-script-check /boot/grub/grub.cfg && echo "grub.cfg syntax OK" grep -n 'felhom_next\|felhom-spike-\|^set default' /boot/grub/grub.cfg | head -20 grub-editenv /boot/efi/EFI/proxmox/felhom-oneshot.env list; echo "(env listed above; empty = no one-shot)"