ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Konstantin Lepikhov <lakostis@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] Q: postinst hook for firmware-*
Date: Thu, 7 Sep 2017 09:47:27 +0200
Message-ID: <20170907074727.GA5493@lks.home> (raw)
In-Reply-To: <20170906133734.GE13205@altlinux.org>

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

Hi Dmitry!

On 09/06/2017, at 04:37:35 PM you wrote:

<skip>
> Получается, что здесь достаточно написать ucode_detected=1,
> 
> > +			;;
> >  	esac
> >  done
> 
> А сюда поместить сброс ucode_detected в случае, если он уже был обработан.
> 
> > -if [ -n "$kernel_versions_handled" -a "$INITRD_AUTOUPDATE" = all ]; then
> > +if [ -n "$kernel_versions_handled" -o -n "$ucode_handled" ] && [ "$INITRD_AUTOUPDATE" = all ]; then
> >  	set +f
> >  	ls -c $VMLINUZ_PREFIX-[0-9].*-*-* 2> /dev/null | while read f; do
> >  		[ "$f" != "$(readlink -e /boot/vmlinuz)" ] ||
> 
> 
Тогда все можно сделать еще проще, см. патч.

-- 
WBR et al.

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

>From 2c6c138d7240ccd2301bcd25270e37379033f79f 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 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/kernel.filetrigger b/kernel.filetrigger
index 9cdf01e..3f14faf 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,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
 	module_versions_handled="$(printf '%s\n' "$module_versions_handled" |sort -u)"
 	for m in $module_versions_handled; do
-- 
2.10.4


  parent reply	other threads:[~2017-09-07  7:47 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 [this message]
2017-09-07  9:28             ` Dmitry V. Levin
2017-09-07 10:17               ` Konstantin Lepikhov
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=20170907074727.GA5493@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