-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework initrd usr mount to start Ignition/Afterburn from there
The size of the unified kernel image grew so much that we almost hit the limit of the fixed /boot partition. While we could tweak which kernel modules are present the largest contributors are actually Ignition and Afterburn (coreos-metadata). Since we also ship Afterburn on the /usr partition and have Ignition installed there, too (but currently masked), we could do what was done for Torcx and directly call it from there (but with LD_LIBRARY_PATH instead of chroot). There are a few corner cases where this was not directly possible due to the order of events in the initrd and these had to be reworked. This establishes a structure that allows the /sysusr/usr mount to be used for calling Ignition and Afterburn. This mount point was set up by systemd already but since we have a legacy generator, this needed adaption, too. The final /usr mount in /sysroot/usr is still set up. In the case of the systemd generator it is a bind mount, for the legacy generator it is a separate mount, both work but we could align this to also use a bind mount. The afterburn-network-kargs.service starts a bit later now because it depends on the /sysusr mount and this also means that the parse-ip-for-networkd dracut hook needed to run at a later stage, here solved with an own service but since the dracut hook mechanism with sourcing is complicated, the script still runs as hook to serialize the environment. The fsck check for /usr was also in the way and thus we write out a dummy systemd-fsck-usr.service since we don't need to check /usr as it's verity-protected. In the end with these changes we significantly reduce the unified kernel image size and have more breathing room for the next years. If we have to move some other binaries or even kernel modules that are not essential for loading /usr itself, we can move them out of the initrd based on this work. Size reduction for arm64 is 58 MB -> 52 MB, for amd64 it is 55 MB -> 49MB.
- Loading branch information
Showing
15 changed files
with
159 additions
and
11 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
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
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,18 @@ | ||
[Unit] | ||
Description=Write systemd-networkd units from cmdline | ||
DefaultDependencies=false | ||
|
||
After=afterburn-network-kargs.service | ||
PartOf=systemd-networkd.service | ||
Before=systemd-networkd.service initrd-switch-root.target | ||
# Switching the root filesystem terminates all running services with binaries from the initramfs, we need to finish before that happens | ||
Conflicts=initrd-switch-root.target | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=true | ||
Environment="APPLY=1" | ||
ExecStart=/lib/dracut/hooks/cmdline/99-parse-ip-for-networkd.sh | ||
|
||
[Install] | ||
WantedBy=systemd-networkd.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
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
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
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
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,2 @@ | ||
#!/bin/sh | ||
LD_LIBRARY_PATH=/sysusr/usr/lib64 exec /sysusr/usr/bin/coreos-metadata "$@" |
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
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
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
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
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
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,2 @@ | ||
#!/bin/sh | ||
LD_LIBRARY_PATH=/sysusr/usr/lib64 exec /sysusr/usr/bin/ignition "$@" |
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