From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FSL_HELO_HOME autolearn=no autolearn_force=no version=3.4.1 Date: Wed, 6 Sep 2017 14:09:09 +0200 From: Konstantin Lepikhov To: devel@lists.altlinux.org Message-ID: <20170906120909.GA8403@lks.home> Mail-Followup-To: devel@lists.altlinux.org References: <20170904115640.GA30835@lks.home> <20170904160138.GC15438@altlinux.org> <20170904191842.GA24238@lks.home> <20170904213509.GA18856@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170904213509.GA18856@altlinux.org> X-Operation-System: ALT Linux starter kit (Trientalis) 4.12.0-lks-wks-alt0.3 User-Agent: Mutt/1.8.3 (2017-05-23) Subject: Re: [devel] Q: postinst hook for firmware-* X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Sep 2017 12:07:21 -0000 Archived-At: List-Archive: List-Post: --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi Dmitry! On 09/05/2017, at 12:35:09 AM you wrote: > > > Пакеты kernel-image не дёргают make-initrd самостоятельно, полагаясь на > > > /usr/lib/rpm/boot_kernel.filetrigger; если эти файлы склонны расползаться > > > по пакетам, может быть, лучше подойдёт файлтриггер? > > Так если мне нужно перегенерить initrd, то я не против дернуть тот же > > boot_kernel.filetrigger. Где это задается? Внутри rpm? > > Прямо в boot_kernel.filetrigger; это пакет bootloader-utils. Подойдет ли такое изменение? -- WBR et al. --UlVJffcvxoiEqYs2 Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="0001-kernel.filetrigger-ucode-support.patch" >>From c974d0d02c1275c600929b3590e6ef644a4e8159 Mon Sep 17 00:00:00 2001 From: "Konstantin A. Lepikhov" 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 | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/kernel.filetrigger b/kernel.filetrigger index 9cdf01e..38ea249 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,27 @@ $VERSION" last_added="$VERSION" } +ucode_handled= +handle_ucode() +{ + local f VENDOR VERSION + f="$1"; shift + # filename format: $UCODE_PREFIX/-ucode/* + VENDOR=${f#$UCODE_PREFIX/} + VENDOR=${VENDOR%%-ucode/*} + ucode_handled="$ucode_handled $VENDOR" + set +f + f="$(readlink -e /boot/vmlinuz)" + if [ -n "$f" -a -n "$kernel_versions_handled" ]; then + VERSION=${f#$VMLINUZ_PREFIX-} + case "$kernel_version_handled" in + "* $VERSION*") + ucode_handled= + ;; + esac + fi +} + while read f; do case "$f" in $VMLINUZ_PREFIX-[0-9].*-*-*) @@ -107,10 +129,13 @@ while read f; do $MODULES_PREFIX/*-*-*/*/*.ko*) handle_module "$f" ;; + $UCODE_PREFIX/*-ucode/*) + handle_ucode "$f" + ;; esac done -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)" ] || -- 2.10.4 --UlVJffcvxoiEqYs2--