ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Konstantin Lepikhov <lakostis@altlinux.org>
To: devel@lists.altlinux.org
Subject: Re: [devel] Q: postinst hook for firmware-*
Date: Thu, 7 Sep 2017 12:17:43 +0200
Message-ID: <20170907101743.GA19849@lks.home> (raw)
In-Reply-To: <20170907092831.GA27490@altlinux.org>

[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]

Hi Dmitry!

On 09/07/2017, at 12:28:31 PM you wrote:

> On Thu, Sep 07, 2017 at 09:47:27AM +0200, Konstantin Lepikhov wrote:
> > Тогда все можно сделать еще проще, см. патч.
> [...]
> > @@ -119,6 +124,10 @@ 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 "$ucode_detected" ]; then
> > +	VERSION=$(uname -r)
> > +	# regenerate initrd image without updating symlinks
> > +	/sbin/installkernel $INSTALLKERNEL_ARGS --nodefault --noflavour "$VERSION"
> >  elif [ -n "$module_versions_handled" ]; then
> 
> Обработка варианта $ucode_detected не должна исключать обработку
> $module_versions_handled, в остальном выглядит правдоподобно.
Понял, прикладываю исправленный вариант.

-- 
WBR et al.

[-- Attachment #2: 0001-kernel.filetrigger-ucode-support.patch --]
[-- Type: text/x-patch, Size: 1823 bytes --]

>From aa8d4bf741fbb36c90231ec8a57a9d431c595dbe Mon Sep 17 00:00:00 2001
From: "Konstantin A. Lepikhov" <lakostis@altlinux.ru>
Date: Wed, 6 Sep 2017 13:49:26 +0200
Subject: [PATCH] kernel.filetrigger: ucode support

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


  reply	other threads:[~2017-09-07 10:17 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-04 11:56 Konstantin Lepikhov
2017-09-04 16:01 ` Dmitry V. Levin
2017-09-04 19:18   ` Konstantin Lepikhov
2017-09-04 21:35     ` Dmitry V. Levin
2017-09-06 12:09       ` Konstantin Lepikhov
2017-09-06 13:37         ` Dmitry V. Levin
2017-09-06 22:03           ` Konstantin Lepikhov
2017-09-07  6:37             ` Dmitry V. Levin
2017-09-07  7:47           ` Konstantin Lepikhov
2017-09-07  9:28             ` Dmitry V. Levin
2017-09-07 10:17               ` Konstantin Lepikhov [this message]
2017-09-08 21:01                 ` Dmitry V. Levin
2017-09-08 22:06                   ` Konstantin Lepikhov
2017-11-22 11:23                     ` Mikhail Efremov
2017-11-23 11:55                       ` Konstantin Lepikhov
2017-11-23 13:53                         ` Sergey Afonin
2017-11-23 13:56                         ` Mikhail Efremov
2017-11-23 14:22                           ` Konstantin Lepikhov
2017-11-23 16:19                             ` Mikhail Efremov
2017-11-23 18:15                               ` Dmitry V. Levin
2017-11-23 18:19                                 ` Michael Shigorin
2017-11-24  8:46                                 ` Sergey Afonin
2017-11-24  9:58                                   ` Alexey Gladkov
2017-11-23 17:10                             ` Sergey Y. Afonin
2017-11-23 18:08                             ` Michael Shigorin
2017-11-23 18:10                               ` Anton Farygin
2017-11-23 18:24                                 ` Sergey Y. Afonin
2017-11-23 23:06                               ` Konstantin Lepikhov
2017-11-23 23:41                                 ` Dmitry V. Levin
2017-11-24  0:43                                   ` Alexey Gladkov
2017-11-24  1:41                                     ` Dmitry V. Levin
2017-12-05 13:48                                       ` Alexey Gladkov
2017-11-24  4:37                                     ` [devel] Q: agp modules in initrd ? Anton Farygin
2017-11-24 10:06                                       ` Alexey Gladkov
2017-11-24 10:32                                         ` Anton Farygin
2017-11-24 11:15                                           ` Alexey Gladkov
2017-11-24 11:25                                             ` Anton Farygin
2017-11-24 12:44                                               ` Alexey Gladkov
2017-11-24 13:10                                                 ` Anton Farygin
2017-11-24 15:04                                                   ` Alexey Gladkov
2017-11-24 15:07                                                     ` Anton Farygin
2017-11-24 15:47                                                       ` Mikhail Efremov
2017-11-24 16:04                                                         ` Anton Farygin
2017-11-24 16:20                                                           ` Mikhail Efremov
2017-11-24 16:21                                                             ` Anton Farygin
2017-11-24 17:38                                                               ` Mikhail Efremov
2017-11-24 11:44                                       ` Konstantin Lepikhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170907101743.GA19849@lks.home \
    --to=lakostis@altlinux.org \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git