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 09:47:27 +0200 From: Konstantin Lepikhov To: ALT Linux Team development discussions Message-ID: <20170907074727.GA5493@lks.home> Mail-Followup-To: ALT Linux Team development discussions 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> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="aVD9QWMuhilNxW9f" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170906133734.GE13205@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 07:45:39 -0000 Archived-At: List-Archive: List-Post: --aVD9QWMuhilNxW9f Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi Dmitry! On 09/06/2017, at 04:37:35 PM you wrote: > Получается, что здесь достаточно написать 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. --aVD9QWMuhilNxW9f Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="0001-kernel.filetrigger-ucode-support.patch" >>From 2c6c138d7240ccd2301bcd25270e37379033f79f 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 | 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 --aVD9QWMuhilNxW9f--