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: Thu, 7 Sep 2017 12:17:43 +0200 From: Konstantin Lepikhov To: devel@lists.altlinux.org Message-ID: <20170907101743.GA19849@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> <20170906120909.GA8403@lks.home> <20170906133734.GE13205@altlinux.org> <20170907074727.GA5493@lks.home> <20170907092831.GA27490@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170907092831.GA27490@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: Thu, 07 Sep 2017 10:15:55 -0000 Archived-At: List-Archive: List-Post: --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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. --OXfL5xGRrasGEqWY Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="0001-kernel.filetrigger-ucode-support.patch" >>From aa8d4bf741fbb36c90231ec8a57a9d431c595dbe 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 | 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--