-
Notifications
You must be signed in to change notification settings - Fork 11
Miscellaneous changes needed to use newer Dracut with its sysroot feature #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f1b786a
flatcar-network: As of Dracut 100, net-lib has moved to its own module
chewi b484983
flatcar-network: Newer Dracut stopped installing network link files
chewi fe0af5b
dracut: Dracut prefers inst_multiple over dracut_install now
chewi 3d02f62
shadow: Install files from sysroot rather than /
chewi a080f15
setup-root: Dracut doesn't install chroot anymore, so add dependency
chewi 512ba90
ignition: Fix and improve wrapper creation
chewi 52c2f6b
ignition: Fix ignition-complete.target.requires symlinks
chewi b4cf30b
ignition: Ensure /sysusr/usr is mounted before decrypting root
chewi e7eb94e
update-bootengine: Newer Dracut defaults to requiring unlocked root
chewi 09772c5
update-bootengine: Omit fido2, pkcs11, tpm2-tss Dracut modules
chewi a2f9d40
update-bootengine: Use Dracut's --sysroot option rather than chrooting
chewi 8f808c1
flatcat-debloat: Add module to trim the initrd more aggressively
chewi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ install_ignition_unit() { | |
| local instantiated="${1:-$unit}"; shift | ||
| inst_simple "$moddir/$unit" "$systemdsystemunitdir/$unit" | ||
| mkdir -p "$initdir/$systemdsystemunitdir/$target.requires" | ||
| ln_r "../$unit" "$systemdsystemunitdir/$target.requires/$instantiated" | ||
| ln -sfn "../$unit" "$initdir/$systemdsystemunitdir/$target.requires/$instantiated" | ||
| } | ||
|
|
||
| install() { | ||
|
|
@@ -58,6 +58,8 @@ install() { | |
| clevis-luks-common-functions \ | ||
| clevis-luks-unlock \ | ||
| pwmake \ | ||
| sort \ | ||
| tail \ | ||
| tpm2_create | ||
|
|
||
| # Required by s390x's z/VM installation. | ||
|
|
@@ -93,6 +95,7 @@ install() { | |
| inst_simple "$moddir/ignition-generator" \ | ||
| "$systemdutildir/system-generators/ignition-generator" | ||
|
|
||
| local x | ||
| for x in "complete" "subsequent" "diskful" "diskful-subsequent"; do | ||
| inst_simple "$moddir/ignition-$x.target" \ | ||
| "$systemdsystemunitdir/ignition-$x.target" | ||
|
|
@@ -129,60 +132,41 @@ install() { | |
| # Flatcar: add 66-azure-storage.rules and 90-cloud-storage.rules | ||
| inst_rules 60-cdrom_id.rules 66-azure-storage.rules 90-cloud-storage.rules | ||
|
|
||
| # Flatcar: add symlinks for dependencies of Ignition, coreos-metadata (afterburn), and | ||
| # Flatcar: add symlinks for dependencies of Ignition, coreos-metadata (afterburn), and | ||
| # Clevis. This saves space in the initramfs image by replacing files with symlinks to | ||
| # the previously mounted /sysusr/. | ||
| for executable in \ | ||
| /usr/bin/clevis-decrypt-sss \ | ||
| /usr/bin/clevis-decrypt-tang \ | ||
| /usr/bin/clevis-decrypt-tpm2 \ | ||
| /usr/bin/clevis-decrypt \ | ||
| /usr/bin/clevis-encrypt-sss \ | ||
| /usr/bin/clevis-encrypt-tang \ | ||
| /usr/bin/clevis-encrypt-tpm2 \ | ||
| /usr/bin/clevis-luks-bind \ | ||
| /usr/bin/clevis-luks-common-functions \ | ||
| /usr/bin/clevis-luks-list \ | ||
| /usr/bin/clevis-luks-unlock \ | ||
| /usr/bin/clevis \ | ||
| /usr/bin/coreos-metadata \ | ||
| /usr/bin/curl \ | ||
| /usr/bin/ignition \ | ||
| /usr/bin/jose \ | ||
| /usr/bin/luksmeta \ | ||
| /usr/bin/mktemp \ | ||
| /usr/bin/pwmake \ | ||
| /usr/bin/sort \ | ||
| /usr/bin/tail \ | ||
| /usr/bin/tpm2_createprimary \ | ||
| /usr/bin/tpm2_create \ | ||
| /usr/bin/tpm2_flushcontext \ | ||
| /usr/bin/tpm2_load \ | ||
| /usr/bin/tpm2_pcrlist \ | ||
| /usr/bin/tpm2_pcrread \ | ||
| /usr/bin/tpm2_unseal \ | ||
| /usr/lib/systemd-reply-password \ | ||
| /usr/local/libexec/clevis-luks-askpass \ | ||
| /usr/libexec/clevis-luks-generic-unlocker \ | ||
| /usr/sbin/setfiles \ | ||
| ; do | ||
| directory="$(dirname "$executable")" | ||
| filename="$(basename "$executable")" | ||
|
|
||
| wrapper_name="${filename}-wrapper" | ||
| cat <<EOF > /tmp/${filename}-wrapper | ||
| local executable | ||
| for executable in "${dracutsysrootdir}"{\ | ||
| /usr/bin/clevis*,\ | ||
| /usr/bin/coreos-metadata,\ | ||
| /usr/bin/curl,\ | ||
| /usr/bin/ignition,\ | ||
| /usr/bin/jose,\ | ||
| /usr/bin/luksmeta,\ | ||
| /usr/bin/tpm2,\ | ||
| /usr/lib/systemd/systemd-reply-password,\ | ||
| /usr/libexec/clevis*\ | ||
| }; do | ||
| if [[ ! -f ${executable} ]]; then | ||
| dfatal "Cannot create wrapper for ${executable} because it is not found" | ||
| exit 1 | ||
| elif [[ ! -x ${executable} ]]; then | ||
| continue | ||
| fi | ||
|
|
||
| local wrapper="${DRACUT_TMPDIR}/${executable##*/}-wrapper" | ||
| cat <<EOF > "${wrapper}" | ||
| #!/bin/sh | ||
|
|
||
| LD_LIBRARY_PATH=/sysusr/usr/lib64 exec "/sysusr${executable}" "\$@" | ||
| LD_LIBRARY_PATH=/sysusr/usr/lib64 exec "/sysusr${executable#"$dracutsysrootdir"}" "\$@" | ||
| EOF | ||
| chmod +x /tmp/${filename}-wrapper | ||
|
|
||
| inst_script "/tmp/${filename}-wrapper" \ | ||
| "/usr/bin/$filename" | ||
|
|
||
| rm /tmp/${filename}-wrapper | ||
| chmod +x "${wrapper}" | ||
| inst_script "${wrapper}" "${executable#"$dracutsysrootdir"}" | ||
| rm "${wrapper}" | ||
| done | ||
|
|
||
| # Ensure /sysusr/usr is mounted before decrypting root. | ||
| inst_simple "$moddir/sysusr-usr-revdeps.conf" \ | ||
| "$systemdsystemunitdir/[email protected]/sysusr-usr.conf" | ||
| } | ||
|
|
||
| # See: https://github.com/coreos/ignition/commit/d304850c3d3696822bc05e0833ee4b27df9d7a38 | ||
|
|
||
This file contains hidden or 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,3 @@ | ||
| [Unit] | ||
| Requires=sysusr-usr.mount | ||
| After=sysusr-usr.mount |
This file contains hidden or 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,21 @@ | ||
| config() { | ||
| # gcrypt: Only needed for systemd-journal's FSS feature. | ||
| # lz4: Flatcar has never needed this for the journal or coredumps. | ||
| omit_dlopen_features+=" libsystemd-shared-*.so:gcrypt,lz4 " | ||
| } | ||
|
|
||
| # shellcheck disable=SC2064 | ||
| trap "$(shopt -p extglob)" RETURN | ||
| shopt -q -s extglob | ||
|
|
||
| install() { | ||
| # shellcheck disable=SC2064 | ||
| trap "$(shopt -p extglob)" RETURN | ||
| shopt -q -s extglob | ||
|
|
||
| # Remove the NSS modules we don't need. | ||
| rm "${initdir}"/usr/lib*/libnss_!(dns|files|myhostname|resolve|systemd).so* | ||
|
|
||
| # We maybe should include this, but more work is needed for compliance. | ||
| rm "${initdir}"/usr/lib*/ossl-modules/fips.so | ||
krnowak marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.