1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

Merge pull request #27941 from cvlc12/early_cpio

Define 'microcode' file type for the kernel-install staging area.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2023-06-19 18:49:31 +02:00 committed by GitHub
commit 72e7bfe02d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -112,7 +112,7 @@
<filename>$BOOT/<replaceable>ENTRY-TOKEN</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/linux</filename>.
If <replaceable>INITRD-FILE</replaceable>s are provided, it also copies them to
<filename>$BOOT/<replaceable>ENTRY-TOKEN</replaceable>/<replaceable>KERNEL_VERSION</replaceable>/<replaceable>INITRD-FILE</replaceable></filename>.
It also creates a boot loader entry according to the <ulink
This can also be used to prepend microcode before the actual initrd. It also creates a boot loader entry according to the <ulink
url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification</ulink> (Type #1) in
<filename>$BOOT/loader/entries/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>.
The title of the entry is the <replaceable>PRETTY_NAME</replaceable> parameter specified in
@ -351,7 +351,9 @@
<para><varname>$KERNEL_INSTALL_STAGING_AREA</varname> is set for plugins to a path to a directory.
Plugins may drop files in that directory, and they will be installed as part of the loader entry, based
on the file name and extension.</para>
on the file name and extension: Files named <filename>initrd*</filename> will be installed as <replaceable>INITRD-FILE</replaceable>s,
and files named <filename>microcode*</filename> will be prepended before <replaceable>INITRD-FILE</replaceable>s.</para>
</refsect2>
<refsect2>

View File

@ -117,10 +117,13 @@ chown root:root "$KERNEL_DEST" || :
shift "$INITRD_OPTIONS_SHIFT"
# All files listed as arguments, and staged files starting with "initrd" are installed as initrds.
for initrd in "$@" "${KERNEL_INSTALL_STAGING_AREA}"/initrd*; do
for initrd in "${KERNEL_INSTALL_STAGING_AREA}/microcode*" "${@}" "${KERNEL_INSTALL_STAGING_AREA}/initrd*"; do
[ -f "$initrd" ] || {
[ "$initrd" = "${KERNEL_INSTALL_STAGING_AREA}/initrd*" ] && continue
echo "Error: initrd '$initrd' not a file." >&2
case "$initrd" in
"${KERNEL_INSTALL_STAGING_AREA}/initrd*" | "${KERNEL_INSTALL_STAGING_AREA}/microcode*")
continue ;;
esac
echo "Error: '$initrd' is not a file." >&2
exit 1
}
@ -153,7 +156,7 @@ mkdir -p "${LOADER_ENTRY%/*}" || {
echo "linux $KERNEL_ENTRY"
have_initrd=
for initrd in "${@}" "${KERNEL_INSTALL_STAGING_AREA}"/initrd*; do
for initrd in "${KERNEL_INSTALL_STAGING_AREA}/microcode*" "${@}" "${KERNEL_INSTALL_STAGING_AREA}/initrd*"; do
[ -f "$initrd" ] || continue
echo "initrd $ENTRY_DIR/${initrd##*/}"
have_initrd=yes