[PATCH] kernel.filetrigger: ucode support
Konstantin A. Lepikhov
lakostis на altlinux.ru
Ср Сен 6 14:49:26 MSK 2017
We need to rebuild initramfs on CPU ucode changes otherwise everything
will continue use outdated version till next kernel update.
---
kernel.filetrigger | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/kernel.filetrigger b/kernel.filetrigger
index 9cdf01e..0a07292 100755
--- a/kernel.filetrigger
+++ b/kernel.filetrigger
@@ -9,6 +9,7 @@
BOOTDIR=/boot
VMLINUZ_PREFIX=/boot/vmlinuz
MODULES_PREFIX=/lib/modules
+UCODE_PREFIX=/lib/firmware
INITRD_AUTOUPDATE=
. /etc/sysconfig/installkernel
@@ -99,6 +100,7 @@ $VERSION"
last_added="$VERSION"
}
+ucode_detected=
while read f; do
case "$f" in
$VMLINUZ_PREFIX-[0-9].*-*-*)
@@ -107,6 +109,9 @@ while read f; do
$MODULES_PREFIX/*-*-*/*/*.ko*)
handle_module "$f"
;;
+ $UCODE_PREFIX/*-ucode/*)
+ ucode_detected=1
+ ;;
esac
done
@@ -119,7 +124,13 @@ if [ -n "$kernel_versions_handled" -a "$INITRD_AUTOUPDATE" = all ]; then
# regenerate initrd image without updating symlinks
/sbin/installkernel $INSTALLKERNEL_ARGS --nodefault --noflavour "$VERSION"
done
-elif [ -n "$module_versions_handled" ]; then
+elif [ -n "$module_versions_handled" -o -n "$ucode_detected" ]; then
+ if [ -n "$ucode_detected" ]; then
+ VERSION=$(uname -r)
+ # regenerate initrd image without updating symlinks
+ /sbin/installkernel $INSTALLKERNEL_ARGS --nodefault --noflavour "$VERSION"
+ fi
+ [ -n "$module_versions_handled" ] || exit 0
module_versions_handled="$(printf '%s\n' "$module_versions_handled" |sort -u)"
for m in $module_versions_handled; do
for k in $kernel_versions_handled; do
--
2.10.4
--OXfL5xGRrasGEqWY--
Подробная информация о списке рассылки Devel