-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core/dracut/ignition-ostree: add ignition-ostree-sysusers service
This introduces a new `ignition-ostree-sysusers.service`, which takes care of poulating users and groups on the target sysroot before the Ignition `files` stage.
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-sysusers
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 @@ | ||
#!/usr/bin/env bash | ||
# Run systemd-sysusers for the target OSTree sysroot. | ||
|
||
set -euo pipefail | ||
|
||
main() { | ||
coreos-sysroot-bwrap systemd-sysusers | ||
coreos-relabel \ | ||
/etc/group \ | ||
/etc/group- \ | ||
/etc/gshadow \ | ||
/etc/gshadow- \ | ||
/etc/passwd \ | ||
/etc/passwd- \ | ||
/etc/shadow \ | ||
/etc/shadow- | ||
} | ||
|
||
main "$@" |
16 changes: 16 additions & 0 deletions
16
overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-sysusers.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,16 @@ | ||
[Unit] | ||
Description=Populate OSTree sysusers | ||
DefaultDependencies=false | ||
ConditionKernelCommandLine=|ostree | ||
|
||
# Need to do this with all mount points active | ||
After=ignition-mount.service | ||
|
||
# But *before* we start dumping files in there | ||
Before=ignition-files.service | ||
Before=ignition-ostree-populate-var.service | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=/usr/sbin/ignition-ostree-sysusers |
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