-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #877 from Nordix/initrd_sdk_scripts
extending the initrd_sdk
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
jenkins/image_building/initrd_sdk/unseal-and-open-luks.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Unseal TPM key and open LUKS volume | ||
DefaultDependencies=no | ||
Before=initrd.target | ||
Wants=initrd-fs.target | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/bin/sh -c '/etc/unlock-mount-luks.sh' | ||
RemainAfterExit=yes | ||
|
||
[Install] | ||
WantedBy=initrd-switch-root.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
# This script is used to prvide a controlled wait loop in order to give time | ||
# to other systemd srvices to prepare the root file system. | ||
|
||
while true; do | ||
if [[ -e "/realroot/bin" ]]; then | ||
printf "INFO: Realroot mount point is present.\n" | ||
break | ||
else | ||
printf "INFO: Waiting for realroot!\n" | ||
# Introduce a 1-second delay using the read command | ||
# sleep might not be available but this way we stress | ||
# the CPU less | ||
read -r -t 1 || true | ||
fi | ||
done |