All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Guido Trentalancia
	<guido-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>,
	initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] dracut: add support for updating the CPU microcode
Date: Sat, 16 Apr 2016 09:01:06 +0300	[thread overview]
Message-ID: <5711D522.3090907@gmail.com> (raw)
In-Reply-To: <1460762332.3054.2.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>

16.04.2016 02:18, Guido Trentalancia пишет:
> This is the initial version of a new "microcode" dracut module
> that can be used to update the microcode on Intel(R) CPUs.
> 

??? dracut already supports early microcode loading, why it is not
enough and what problem this patch solves?

> Signed-off-by: Guido Trentalancia <guido-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
> ---
>  modules.d/00microcode/module-setup.sh |   26 ++++++++++++++++++++++++++
>  modules.d/99base/init.sh              |    9 +++++++++
>  2 files changed, 35 insertions(+)
> 
> diff -pruN dracut-git/modules.d/00microcode/module-setup.sh dracut-git-microcode-update/modules.d/00microcode/module-setup.sh
> --- dracut-git/modules.d/00microcode/module-setup.sh	1970-01-01 01:00:00.000000000 +0100
> +++ dracut-git-microcode-update/modules.d/00microcode/module-setup.sh	2016-04-16 01:11:20.719287468 +0200
> @@ -0,0 +1,26 @@
> +#!/bin/bash
> +
> +# Dracut module to update the microcode on Intel(R) CPUs
> +# Copyright 2016 Guido Trentalancia <guido-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
> +
> +# called by dracut
> +check() {
> +    [[ "$mount_needs" ]] && return 1
> +
> +    require_binaries microcode_ctl || return 1
> +
> +    return 0
> +}
> +
> +# called by dracut
> +depends() {
> +    return 0
> +}
> +
> +# called by dracut
> +install() {
> +    inst microcode_ctl
> +
> +    inst_dir /lib/firmware
> +    inst /lib/firmware/microcode.dat
> +}
> diff -pruN dracut-git/modules.d/99base/init.sh dracut-git-microcode-update/modules.d/99base/init.sh
> --- dracut-git/modules.d/99base/init.sh	2016-04-14 22:21:22.681548895 +0200
> +++ dracut-git-microcode-update/modules.d/99base/init.sh	2016-04-16 01:09:58.517080944 +0200
> @@ -62,6 +62,15 @@ if ! ismounted /dev/shm; then
>      mount -t tmpfs -o mode=1777,noexec,nosuid,nodev,strictatime tmpfs /dev/shm >/dev/null
>  fi
>  
> +# Update CPU microcode
> +if [ -x /usr/sbin/microcode_ctl ]; then
> +    MICROCODE_CTL=/usr/sbin/microcode_ctl
> +elif [ -x /sbin/microcode_ctl ]; then
> +    MICROCODE_CTL=/sbin/microcode_ctl
> +fi
> +[ $MICROCODE_CTL ] && [ ! -e /dev/cpu/microcode ] && echo "Creating microcode update device..." && mknod /dev/cpu/microcode c 10 184
> +[ $MICROCODE_CTL ] && [ -e /lib/firmware/microcode.dat ] && $MICROCODE_CTL -u
> +
>  if ! ismounted /run; then
>      mkdir -m 0755 /newrun
>      if ! str_starts "$(readlink -f /bin/sh)" "/run/"; then
> --
> To unsubscribe from this list: send the line "unsubscribe initramfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  parent reply	other threads:[~2016-04-16  6:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 23:18 [PATCH] dracut: add support for updating the CPU microcode Guido Trentalancia
     [not found] ` <1460762332.3054.2.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
2016-04-16  6:01   ` Andrei Borzenkov [this message]
     [not found]     ` <5711D522.3090907-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-16 13:54       ` Guido Trentalancia
     [not found]         ` <1460814862.4296.4.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
2016-04-16 15:20           ` Alexander E. Patrakov
     [not found]             ` <5712582A.2090502-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-16 21:05               ` Guido Trentalancia

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=5711D522.3090907@gmail.com \
    --to=arvidjaar-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=guido-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.