diff options
author | Archit Gupta <archit@accelbread.com> | 2023-06-29 21:24:14 -0700 |
---|---|---|
committer | Archit Gupta <archit@accelbread.com> | 2023-11-06 09:50:11 -0800 |
commit | 2a4b82c46141a91ca0c4c1401a7b2eb698d7c1c2 (patch) | |
tree | 0fbbe093b6726c4cc333c188d35b13f111651dd5 /nixos/modules/system/boot/stage-1-init.sh | |
parent | 85f1ba3e51676fa8cc604a3d863d729026a6b8eb (diff) | |
download | nixlib-2a4b82c46141a91ca0c4c1401a7b2eb698d7c1c2.tar nixlib-2a4b82c46141a91ca0c4c1401a7b2eb698d7c1c2.tar.gz nixlib-2a4b82c46141a91ca0c4c1401a7b2eb698d7c1c2.tar.bz2 nixlib-2a4b82c46141a91ca0c4c1401a7b2eb698d7c1c2.tar.lz nixlib-2a4b82c46141a91ca0c4c1401a7b2eb698d7c1c2.tar.xz nixlib-2a4b82c46141a91ca0c4c1401a7b2eb698d7c1c2.tar.zst nixlib-2a4b82c46141a91ca0c4c1401a7b2eb698d7c1c2.zip |
nixos/boot: add postResumeCommands option
Adds a postResumeCommands option to the initramfs to allow inserting code to execute after the device has attempted to resume, and before filesystems are mounted. This allows to inject code for operations like wiping the rootfs on boot; if those were instead put in postDeviceCommands, on a hibernated device, they would execute before the device resumes from hibernation.
Diffstat (limited to 'nixos/modules/system/boot/stage-1-init.sh')
-rw-r--r-- | nixos/modules/system/boot/stage-1-init.sh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh index bc2fc7f7b108..06b6aff23272 100644 --- a/nixos/modules/system/boot/stage-1-init.sh +++ b/nixos/modules/system/boot/stage-1-init.sh @@ -498,6 +498,8 @@ if test -e /sys/power/resume -a -e /sys/power/disk; then fi fi +@postResumeCommands@ + # If we have a path to an iso file, find the iso and link it to /dev/root if [ -n "$isoPath" ]; then mkdir -p /findiso |