docs: align lid-hibernate spec with PARTUUID-based resume
Spec said `findmnt -no UUID /` and `resume=UUID=` but the script correctly uses PARTUUID throughout (matches the system's existing root=PARTUUID= convention). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -50,10 +50,10 @@ Hibernation prerequisites are NOT met: only zram swap (4 GiB, RAM-backed, can't
|
|||||||
1. **Swap file.** `btrfs filesystem mkswapfile --size 16g /swapfile` (handles NOCOW, alignment, mkswap in one). Skip if `/swapfile` exists with size ≥14 GiB.
|
1. **Swap file.** `btrfs filesystem mkswapfile --size 16g /swapfile` (handles NOCOW, alignment, mkswap in one). Skip if `/swapfile` exists with size ≥14 GiB.
|
||||||
2. **Activate.** `swapon /swapfile`. Append `/swapfile none swap defaults 0 0` to `/etc/fstab` if absent.
|
2. **Activate.** `swapon /swapfile`. Append `/swapfile none swap defaults 0 0` to `/etc/fstab` if absent.
|
||||||
3. **Compute resume params.**
|
3. **Compute resume params.**
|
||||||
- `RESUME_UUID=$(findmnt -no UUID /)` → root filesystem UUID (currently `60cbc9b9-3631-4f9a-925c-a45e0920eb17`)
|
- `ROOT_PARTUUID=$(findmnt -no PARTUUID /)` → root partition's GPT PARTUUID (matches the existing `root=PARTUUID=…` convention in `/etc/kernel/cmdline`)
|
||||||
- `RESUME_OFFSET=$(btrfs inspect-internal map-swapfile -r /swapfile)` → physical offset of swap file
|
- `RESUME_OFFSET=$(btrfs inspect-internal map-swapfile -r /swapfile)` → physical offset of swap file
|
||||||
4. **mkinitcpio hook.** Edit `/etc/mkinitcpio.conf` HOOKS array to insert `resume` between `block` and `filesystems`. `sed` guarded so a re-run is a no-op.
|
4. **mkinitcpio hook.** Edit `/etc/mkinitcpio.conf` HOOKS array to insert `resume` between `block` and `filesystems`. `sed` guarded so a re-run is a no-op.
|
||||||
5. **Kernel cmdline.** Append `resume=UUID=$RESUME_UUID resume_offset=$RESUME_OFFSET` to `/etc/kernel/cmdline` if not already present.
|
5. **Kernel cmdline.** Append `resume=PARTUUID=$ROOT_PARTUUID resume_offset=$RESUME_OFFSET` to `/etc/kernel/cmdline` if not already present.
|
||||||
6. **Regenerate UKI.** `mkinitcpio -P` → produces `/boot/EFI/Linux/arch-linux-zen.efi` with new HOOKS + cmdline baked in.
|
6. **Regenerate UKI.** `mkinitcpio -P` → produces `/boot/EFI/Linux/arch-linux-zen.efi` with new HOOKS + cmdline baked in.
|
||||||
7. **Reboot.** Print explicit instruction; do not auto-reboot.
|
7. **Reboot.** Print explicit instruction; do not auto-reboot.
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ After running `scripts/enable-hibernation.sh` and rebooting:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
swapon --show # /swapfile, ≥14 GiB, prio low
|
swapon --show # /swapfile, ≥14 GiB, prio low
|
||||||
cat /proc/cmdline # contains resume=UUID=… resume_offset=…
|
cat /proc/cmdline # contains resume=PARTUUID=… resume_offset=…
|
||||||
systemctl status systemd-hibernate.service
|
systemctl status systemd-hibernate.service
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user