- Add ACPI table override ability - Adjust mkinitrd-dracut.sh to SUSE mkinitrd: <none> : Before gives a "usage" error -> now scans /boot for kernels and builds corresponding inirtrds for them -i -k : Pass a list of kernels and initrd targets (not sure it was worth the hassle to be able to pass) -b : Boot directory to search for kernel images -d : Change root file system. Not tested whether dracut's behavior matches exactly what our mkinitrd does. -s : Dummy (should even be obsolete in latest mkinitrd) - Write caller and used parameters to syslog if mkinitrd is called. So that those can easily be fixed and checked for correctness. This should get reverted again before a bigger release. OBS-URL: https://build.opensuse.org/request/show/201877 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=56
63 lines
2.6 KiB
Diff
63 lines
2.6 KiB
Diff
dracut: Generlize microcode early cpio usage
|
|
|
|
ACPI early table override also may need to place files into an early cpio.
|
|
Reflect this in variable and file names.
|
|
This change is renaming only and does not introduce any real change.
|
|
|
|
Signed-off-by: Thomas Renninger <trenn@suse.de>
|
|
|
|
Index: dracut-033/dracut.sh
|
|
===================================================================
|
|
--- dracut-033.orig/dracut.sh
|
|
+++ dracut-033/dracut.sh
|
|
@@ -696,9 +696,9 @@ readonly initdir="$(mktemp --tmpdir="$TM
|
|
}
|
|
|
|
if [[ $early_microcode = yes ]]; then
|
|
- readonly microcode_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_microcode.XXXXXX)"
|
|
- [ -d "$microcode_dir" ] || {
|
|
- printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_microcode.XXXXXX failed." >&2
|
|
+ readonly early_cpio_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_cpio.XXXXXX)"
|
|
+ [ -d "$early_cpio_dir" ] || {
|
|
+ printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_cpio.XXXXXX failed." >&2
|
|
exit 1
|
|
}
|
|
fi
|
|
@@ -707,7 +707,7 @@ trap '
|
|
ret=$?;
|
|
[[ $outfile ]] && [[ -f $outfile.$$ ]] && rm -f -- "$outfile.$$";
|
|
[[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf -- "$initdir"; };
|
|
- [[ $keep ]] && echo "Not removing $microcode_dir." >&2 || { [[ $microcode_dir ]] && rm -Rf -- "$microcode_dir"; };
|
|
+ [[ $keep ]] && echo "Not removing $early_cpio_dir." >&2 || { [[ $early_cpio_dir ]] && rm -Rf -- "$early_cpio_dir"; };
|
|
[[ $_dlogdir ]] && rm -Rf -- "$_dlogdir";
|
|
exit $ret;
|
|
' EXIT
|
|
@@ -1296,7 +1296,7 @@ if [[ $early_microcode = yes ]]; then
|
|
dinfo "*** Generating early-microcode cpio image ***"
|
|
ucode_dir=(amd-ucode intel-ucode)
|
|
ucode_dest=(AuthenticAMD.bin GenuineIntel.bin)
|
|
- _dest_dir="$microcode_dir/d/kernel/x86/microcode"
|
|
+ _dest_dir="$early_cpio_dir/d/kernel/x86/microcode"
|
|
_dest_idx="0 1"
|
|
mkdir -p $_dest_dir
|
|
if [[ $hostonly ]]; then
|
|
@@ -1316,14 +1316,15 @@ if [[ $early_microcode = yes ]]; then
|
|
fi
|
|
done
|
|
done
|
|
- (cd "$microcode_dir/d"; find . -print0 | cpio --null -o -H newc --quiet >../ucode.cpio)
|
|
+ create_early_cpio="yes"
|
|
fi
|
|
|
|
rm -f -- "$outfile"
|
|
dinfo "*** Creating image file ***"
|
|
-if [[ $early_microcode = yes ]]; then
|
|
+if [[ $create_early_cpio = yes ]]; then
|
|
# The microcode blob is _before_ the initramfs blob, not after
|
|
- mv $microcode_dir/ucode.cpio $outfile.$$
|
|
+ (cd "$early_cpio_dir/d"; find . -print0 | cpio --null -o -H newc --quiet >../early.cpio)
|
|
+ mv $early_cpio_dir/early.cpio $outfile.$$
|
|
fi
|
|
if ! ( umask 077; cd "$initdir"; find . -print0 | cpio --null -R 0:0 -H newc -o --quiet| \
|
|
$compress >> "$outfile.$$"; ); then
|