From 126b03ad26f7e0a98587c1e5ced684993dd406a7 Mon Sep 17 00:00:00 2001 From: funman300 Date: Sun, 10 May 2026 17:18:25 -0700 Subject: [PATCH] scripts: guard enable-hibernation against empty root PARTUUID If `findmnt -no PARTUUID /` returns nothing (root on LVM, no GPT, unusual mount state) the script would silently write a broken resume=PARTUUID= line to /etc/kernel/cmdline. Bail with an error message instead. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/enable-hibernation.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/enable-hibernation.sh b/scripts/enable-hibernation.sh index a1fe9a0..eba5fe5 100755 --- a/scripts/enable-hibernation.sh +++ b/scripts/enable-hibernation.sh @@ -13,6 +13,7 @@ fi SWAPFILE=/swapfile SWAPSIZE=16g ROOT_PARTUUID=$(findmnt -no PARTUUID /) +[ -n "$ROOT_PARTUUID" ] || { echo "ERROR: could not determine root PARTUUID via findmnt." >&2; exit 1; } echo "==> Step 1/6: ensure swap file exists at $SWAPFILE (size $SWAPSIZE)" if [ ! -f "$SWAPFILE" ]; then