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) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user