All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@suse.de>
To: Michal Marek <mmarek@suse.cz>
Cc: "Markus Trippelsdorf" <markus@trippelsdorf.de>,
	"Måns Rullgård" <mans@mansr.com>, "Thomas Voegtle" <tv@lio96.de>,
	linux-kernel@vger.kernel.org
Subject: Re: x86/microcode update on systems without INITRD
Date: Mon, 11 Jan 2016 20:43:11 +0100	[thread overview]
Message-ID: <20160111194311.GF4686@pd.tnic> (raw)
In-Reply-To: <568FCC45.1010301@suse.cz>

On Fri, Jan 08, 2016 at 03:48:37PM +0100, Michal Marek wrote:
> The comments are printed during make oldconfig if a symbol in the
> current menu needs updating. Which is probably not the case here, both
> MICROCODE and BLK_DEV_INITRD are existing symbols.

Right, and the problem is that "make oldconfig" sees that BLK_DEV_INITRD
is not enabled in that case and disables CONFIG_MICROCODE too. So by the time
the comment gets evaluated, CONFIG_MICROCODE is off so no workie.

I tried a different thing, see below. It is a bit lengthly but it does
what it should and we can always extend it for other stuff later as it
might turn useful, according to my suspicion :-)

With Thomas' config it says:

$ make oldconfig
You have CONFIG_MICROCODE enabled without BLK_DEV_INITRD. Enable
it and make sure microcode is added to your initrd as explained in
Documentation/x86/early-microcode.txt

scripts/kconfig/Makefile:85: recipe for target 'oldconfig' failed
make[1]: *** [oldconfig] Error 1
Makefile:531: recipe for target 'oldconfig' failed
make: *** [oldconfig] Error 2


It needs to be made to look at CONFIG_MODULES and make that warning just
a hint. I'll have to think about it more...

Thoughts?

---
 arch/x86/scripts/check-configs.sh | 41 +++++++++++++++++++++++++++++++++++++++
 scripts/kconfig/Makefile          |  3 +++
 2 files changed, 44 insertions(+)
 create mode 100644 arch/x86/scripts/check-configs.sh

diff --git a/arch/x86/scripts/check-configs.sh b/arch/x86/scripts/check-configs.sh
new file mode 100644
index 000000000000..51ae9bde6965
--- /dev/null
+++ b/arch/x86/scripts/check-configs.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+if [ "$1" != "oldconfig" ]; then
+	exit 0
+fi
+
+srctree=$2
+ARCH="$3"
+UNAME_RELEASE=$(uname -r)
+
+KCONFIGS=".config /lib/modules/$UNAME_RELEASE/.config /etc/kernel-config /boot/config-$UNAME_RELEASE"
+
+if [ "$ARCH" = "X86_32" ]; then
+	KCONFIGS="$KCONFIGS $srctree/arch/x86/configs/i386_defconfig"
+else
+	KCONFIGS="$KCONFIGS $srctree/arch/x86/configs/x86_64_defconfig"
+fi
+
+for k in $KCONFIGS;
+do
+	if [ -e $k ]; then
+		OLD_CONFIG=$k
+		break
+	fi
+done
+
+if [ -z "$OLD_CONFIG" ]; then exit 0; fi
+
+# Check optimal microcode loader .config settings
+if ! grep -q MICROCODE $OLD_CONFIG; then
+	exit 0
+fi
+
+MSG="You have CONFIG_MICROCODE enabled without BLK_DEV_INITRD. Enable\n\
+it and make sure microcode is added to your initrd as explained in\n\
+Documentation/x86/early-microcode.txt\n"
+
+if ! grep -v "^#" $OLD_CONFIG | grep -q BLK_DEV_INITRD; then
+	echo -e $MSG
+	exit 1
+fi
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index d79cba4ce3eb..136ae9744efc 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -81,6 +81,9 @@ simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \
 PHONY += $(simple-targets)
 
 $(simple-targets): $(obj)/conf
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/scripts/check-configs.sh),)
+	$(Q)$(CONFIG_SHELL) $(srctree)/arch/$(SRCARCH)/scripts/check-configs.sh $@ $(srctree) $(ARCH)
+endif
 	$< $(silent) --$@ $(Kconfig)
 
 PHONY += oldnoconfig savedefconfig defconfig
-- 
2.3.5

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

  reply	other threads:[~2016-01-11 19:43 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 21:43 x86/microcode update on systems without INITRD Markus Trippelsdorf
2015-11-19 21:55 ` Borislav Petkov
2015-11-19 22:58   ` Borislav Petkov
2015-11-20  7:19     ` Markus Trippelsdorf
2015-11-20  8:27       ` Borislav Petkov
2015-11-20  8:33         ` Markus Trippelsdorf
2015-11-20  8:48           ` Borislav Petkov
2015-11-20 11:24             ` [PATCH] x86/microcode: Initialize the driver late when facilities are up Borislav Petkov
2015-11-23 16:28               ` [tip:x86/urgent] " tip-bot for Borislav Petkov
2016-01-07 12:12         ` x86/microcode update on systems without INITRD Thomas Voegtle
2016-01-07 12:18           ` Borislav Petkov
2016-01-07 12:36             ` Thomas Voegtle
2016-01-07 12:41               ` Markus Trippelsdorf
2016-01-08  9:33                 ` Thomas Voegtle
2016-01-08 12:18                 ` Mike Keehan
2016-01-08 12:20                   ` Markus Trippelsdorf
2016-01-08 10:59               ` Borislav Petkov
2016-01-08 11:18                 ` Måns Rullgård
2016-01-08 11:36                   ` Borislav Petkov
2016-01-08 11:46                     ` Måns Rullgård
2016-01-08 12:08                       ` Borislav Petkov
2016-01-08 12:16                         ` Markus Trippelsdorf
2016-01-08 12:27                           ` Borislav Petkov
2016-01-08 12:28                             ` Måns Rullgård
2016-01-08 12:48                             ` Michal Marek
2016-01-08 13:37                               ` Borislav Petkov
2016-01-08 14:48                                 ` Michal Marek
2016-01-11 19:43                                   ` Borislav Petkov [this message]
2016-01-11 20:29                                     ` Måns Rullgård
2016-01-11 20:59                                       ` Borislav Petkov
2016-01-11 21:04                                         ` Måns Rullgård
2016-01-11 21:17                                           ` Borislav Petkov
2016-01-14 18:43                                             ` [RFC PATCH] x86/kconfig: Sanity-check config file during oldconfig Borislav Petkov
2016-01-18 13:36                                               ` Thomas Voegtle
2016-01-18 14:06                                                 ` Borislav Petkov
2016-01-18 14:11                                                   ` Måns Rullgård
2016-01-18 14:28                                                     ` Borislav Petkov
2016-01-18 14:41                                                     ` Borislav Petkov
2016-01-18 14:51                                                       ` Måns Rullgård
2016-01-18 15:39                                                         ` Borislav Petkov
2016-01-18 15:42                                                           ` Måns Rullgård
2016-01-19  8:20                                               ` [RFC] CONFIG_FORCE_MINIMALLY_SANE_CONFIG=y (was: Re: [RFC PATCH] x86/kconfig: Sanity-check config file during oldconfig) Ingo Molnar
2016-01-19  8:40                                                 ` Markus Trippelsdorf
2016-01-19  8:54                                                   ` Ingo Molnar
2016-01-19  9:45                                                     ` Borislav Petkov
2016-01-19  9:01                                                 ` Peter Zijlstra
2016-01-19  9:14                                                   ` Ingo Molnar
2016-01-19  9:43                                                 ` Borislav Petkov
2016-01-19  9:57                                                 ` [RFC] CONFIG_FORCE_MINIMALLY_SANE_CONFIG=y Michal Marek
2016-01-19 10:30                                                   ` [RFC] CONFIG_GENERIC_BOOTABLE_CONFIG=y Ingo Molnar
2016-01-19 17:22                                                     ` Linus Torvalds
2016-01-19 17:52                                                       ` Austin S. Hemmelgarn
2016-01-19 12:29                                                 ` [RFC] CONFIG_FORCE_MINIMALLY_SANE_CONFIG=y Måns Rullgård
2016-01-19 12:43                                                   ` Michal Marek
2016-01-19 12:57                                                     ` Måns Rullgård
2016-01-21 22:06                                                 ` [RFC] CONFIG_FORCE_MINIMALLY_SANE_CONFIG=y (was: Re: [RFC PATCH] x86/kconfig: Sanity-check config file during oldconfig) Kirill A. Shutemov
2016-03-09 13:08                                                   ` Ingo Molnar
2016-01-08 12:18                         ` x86/microcode update on systems without INITRD Måns Rullgård
2016-01-19 17:43           ` Borislav Petkov
2016-01-20  9:14             ` Thomas Voegtle
2016-01-20 11:15               ` Borislav Petkov

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=20160111194311.GF4686@pd.tnic \
    --to=bp@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mans@mansr.com \
    --cc=markus@trippelsdorf.de \
    --cc=mmarek@suse.cz \
    --cc=tv@lio96.de \
    /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.