From 6daec98aafaa63a9442dda8332bc939871edb950 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 9 Sep 2019 12:47:54 -0400 Subject: [PATCH 1/2] make: Move comment about dracut --no-kernel The current placement is confusing IMO, let's move it close to the code it's describing Signed-off-by: Cole Robinson --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index aa515dee17..34fb0fd173 100644 --- a/Makefile +++ b/Makefile @@ -43,10 +43,10 @@ ifeq (dracut,$(BUILD_METHOD)) DRACUT_OPTIONS := --no-compress --conf /dev/null --confdir $(DRACUT_CONF_DIR) ifneq (,$(DRACUT_KVERSION)) - # If a kernel version is not specified, do not make systemd load modules - # at startup DRACUT_KMODULES := $(shell grep "^drivers=" $(DRACUT_CONF_DIR)/10-drivers.conf | sed -E "s,^drivers=\"(.*)\"$$,\1,") else + # If a kernel version is not specified, do not make systemd load modules + # at startup DRACUT_OPTIONS += --no-kernel endif From dec801374803d6d2b486c19c70ce14b796959fa5 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 9 Sep 2019 12:49:56 -0400 Subject: [PATCH 2/2] make: use bash to fetch dracut conf 'drivers' list dracut will process conf files with bash, and in fact it's common to use idioms like += in conf files for string concatenation. The current grep usage in the Makefile won't catch all possible valid 'drivers' variable cases. Instead, use bash to parse and echo the 'drivers' content Fixes: #356 Signed-off-by: Cole Robinson --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 34fb0fd173..d9bdda032e 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,8 @@ ifeq (dracut,$(BUILD_METHOD)) DRACUT_OPTIONS := --no-compress --conf /dev/null --confdir $(DRACUT_CONF_DIR) ifneq (,$(DRACUT_KVERSION)) - DRACUT_KMODULES := $(shell grep "^drivers=" $(DRACUT_CONF_DIR)/10-drivers.conf | sed -E "s,^drivers=\"(.*)\"$$,\1,") + # Explicitly use bash, which is what dracut uses to process conf files + DRACUT_KMODULES := $(shell bash -c 'source $(DRACUT_CONF_DIR)/10-drivers.conf; echo "$$drivers"') else # If a kernel version is not specified, do not make systemd load modules # at startup