]> git.pld-linux.org Git - projects/geninitrd.git/commitdiff
Prepend cpu microcode to initrd image, so kernel will pick it up when LILO is in...
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 15 May 2019 19:04:45 +0000 (21:04 +0200)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 15 May 2019 19:04:45 +0000 (21:04 +0200)
geninitrd
geninitrd.sysconfig

index 118333c77f31b5f5ec9473588ebf3ed350684616..b5d405a7d37a022ed8964ce26c01622a8eecadaa 100755 (executable)
--- a/geninitrd
+++ b/geninitrd
@@ -17,6 +17,7 @@ PROGRAM=${0##*/}
 # list of geninitrd modules which need setup routine after commandline args parsing
 GENINITRD_MODS=""
 COMPRESS=yes
+LILO_MICROCODE=yes
 STRIP=/usr/bin/strip
 target=""
 kernel=""
@@ -1186,6 +1187,16 @@ compress_image() {
        mv -f "$tmp" "$target"
 }
 
+# prepend file to image
+prepend_file_to_image() {
+       local file="$1" target="$2" tmp
+       tmp=$(mktemp "$target".XXXXXX) || die "mktemp failed"
+
+       cat "$file" "$target" > "$tmp" || return $?
+
+       mv -f "$tmp" "$target"
+}
+
 if [ -r /etc/sysconfig/geninitrd ]; then
        . /etc/sysconfig/geninitrd
 fi
@@ -1801,6 +1812,14 @@ else
        cp -a "$IMAGE" "$target"
 fi
 
+# microcode support for lilo
+if ! is_no "$LILO_MICROCODE"; then
+       if [ -x /sbin/lilo -a -f "/boot/intel-ucode.img" ]; then
+               verbose "Prepending $target with microcode image /boot/intel-ucode.img for LILO"
+               prepend_file_to_image "/boot/intel-ucode.img" "$target"
+       fi
+fi
+
 # XXX. check if bootsplash can output data to tmp dir not directly to initramfs image.
 initrd_gen_bootsplash "$target"
 
index ccf177ce0dc35178890bf54c1c82cd29b1b56a0d..12683249c62b4e6fde889db91c84a56b0285e4eb 100644 (file)
@@ -18,6 +18,9 @@
 # Default is to use initramfs for >= 2.5.0.
 #INITRDFS=initramfs
 
+# Should we prepend cpu microcode when lilo is installed
+#LILO_MICROCODE=no
+
 ## Use udev to create /dev?
 USE_UDEV=yes
 
This page took 0.533018 seconds and 4 git commands to generate.