Blame 0070-Don-t-create-lots-of-empty-cmdline-files-for-hostonl.patch

Harald Hoyer b94732
From fe116c1670c622fa117a7765abb17c976cc48333 Mon Sep 17 00:00:00 2001
Harald Hoyer b94732
From: Thorsten Behrens <tbehrens@suse.com>
Harald Hoyer b94732
Date: Thu, 11 Dec 2014 15:46:31 +0100
Harald Hoyer b94732
Subject: [PATCH] Don't create lots of empty cmdline files for hostonly-cmdline
Harald Hoyer b94732
 case
Harald Hoyer b94732
Harald Hoyer b94732
This aligns other places piping cmdline() output to cmdline.d files
Harald Hoyer b94732
with the earlier fix for 95rootfs-block.
Harald Hoyer b94732
Harald Hoyer b94732
Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Harald Hoyer b94732
Signed-off-by: Thomas Renninger <trenn@suse.de>
Harald Hoyer b94732
---
Harald Hoyer b94732
 modules.d/90crypt/module-setup.sh  | 4 ++--
Harald Hoyer b94732
 modules.d/90dmraid/module-setup.sh | 4 ++--
Harald Hoyer b94732
 modules.d/90lvm/module-setup.sh    | 4 ++--
Harald Hoyer b94732
 modules.d/90mdraid/module-setup.sh | 4 ++--
Harald Hoyer b94732
 modules.d/95resume/module-setup.sh | 4 ++--
Harald Hoyer b94732
 5 files changed, 10 insertions(+), 10 deletions(-)
Harald Hoyer b94732
Harald Hoyer b94732
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
Harald Hoyer b94732
index 37ae859..ea1e340 100755
Harald Hoyer b94732
--- a/modules.d/90crypt/module-setup.sh
Harald Hoyer b94732
+++ b/modules.d/90crypt/module-setup.sh
Harald Hoyer b94732
@@ -50,8 +50,8 @@ cmdline() {
Harald Hoyer b94732
 install() {
Harald Hoyer b94732
 
Harald Hoyer b94732
     if [[ $hostonly_cmdline == "yes" ]]; then
Harald Hoyer b94732
-        cmdline >> "${initdir}/etc/cmdline.d/90crypt.conf"
Harald Hoyer b94732
-        echo >> "${initdir}/etc/cmdline.d/90crypt.conf"
Harald Hoyer b94732
+        local _cryptconf=$(cmdline)
Harald Hoyer b94732
+        [[ $_cryptconf ]] && printf "%s\n" "$_cryptconf" >> "${initdir}/etc/cmdline.d/90crypt.conf"
Harald Hoyer b94732
     fi
Harald Hoyer b94732
 
Harald Hoyer b94732
     inst_multiple cryptsetup rmdir readlink umount
Harald Hoyer b94732
diff --git a/modules.d/90dmraid/module-setup.sh b/modules.d/90dmraid/module-setup.sh
Harald Hoyer b94732
index 508598b..044e01f 100755
Harald Hoyer b94732
--- a/modules.d/90dmraid/module-setup.sh
Harald Hoyer b94732
+++ b/modules.d/90dmraid/module-setup.sh
Harald Hoyer b94732
@@ -64,8 +64,8 @@ install() {
Harald Hoyer b94732
     local _i
Harald Hoyer b94732
 
Harald Hoyer b94732
     if [[ $hostonly_cmdline == "yes" ]]; then
Harald Hoyer b94732
-        cmdline >> "${initdir}/etc/cmdline.d/90dmraid.conf"
Harald Hoyer b94732
-        echo >> "${initdir}/etc/cmdline.d/90dmraid.conf"
Harald Hoyer b94732
+        local _raidconf=$(cmdline)
Harald Hoyer b94732
+        [[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90dmraid.conf"
Harald Hoyer b94732
     fi
Harald Hoyer b94732
 
Harald Hoyer b94732
     inst_multiple dmraid
Harald Hoyer b94732
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
Harald Hoyer b94732
index 5515ac0..592a2e2 100755
Harald Hoyer b94732
--- a/modules.d/90lvm/module-setup.sh
Harald Hoyer b94732
+++ b/modules.d/90lvm/module-setup.sh
Harald Hoyer b94732
@@ -53,8 +53,8 @@ install() {
Harald Hoyer b94732
     inst lvm
Harald Hoyer b94732
 
Harald Hoyer b94732
     if [[ $hostonly_cmdline == "yes" ]]; then
Harald Hoyer b94732
-        cmdline >> "${initdir}/etc/cmdline.d/90lvm.conf"
Harald Hoyer b94732
-        echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
Harald Hoyer b94732
+        local _lvmconf=$(cmdline)
Harald Hoyer b94732
+        [[ $_lvmconf ]] && printf "%s\n" "$_lvmconf" >> "${initdir}/etc/cmdline.d/90lvm.conf"
Harald Hoyer b94732
     fi
Harald Hoyer b94732
 
Harald Hoyer b94732
     inst_rules "$moddir/64-lvm.rules"
Harald Hoyer b94732
diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh
Harald Hoyer b94732
index ce3394a..747ea8a 100755
Harald Hoyer b94732
--- a/modules.d/90mdraid/module-setup.sh
Harald Hoyer b94732
+++ b/modules.d/90mdraid/module-setup.sh
Harald Hoyer b94732
@@ -71,8 +71,8 @@ install() {
Harald Hoyer b94732
     inst $(command -v mdadm) /sbin/mdadm
Harald Hoyer b94732
 
Harald Hoyer b94732
     if [[ $hostonly_cmdline == "yes" ]]; then
Harald Hoyer b94732
-        cmdline  >> "${initdir}/etc/cmdline.d/90mdraid.conf"
Harald Hoyer b94732
-        echo  >> "${initdir}/etc/cmdline.d/90mdraid.conf"
Harald Hoyer b94732
+        local _raidconf=$(cmdline)
Harald Hoyer b94732
+        [[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90mdraid.conf"
Harald Hoyer b94732
     fi
Harald Hoyer b94732
 
Harald Hoyer b94732
     # 
Harald Hoyer b94732
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
Harald Hoyer b94732
index 1ddb6e4..dfd4350 100755
Harald Hoyer b94732
--- a/modules.d/95resume/module-setup.sh
Harald Hoyer b94732
+++ b/modules.d/95resume/module-setup.sh
Harald Hoyer b94732
@@ -29,8 +29,8 @@ install() {
Harald Hoyer b94732
     local _bin
Harald Hoyer b94732
 
Harald Hoyer b94732
     if [[ $hostonly_cmdline == "yes" ]]; then
Harald Hoyer b94732
-        cmdline  >> "${initdir}/etc/cmdline.d/95resume.conf"
Harald Hoyer b94732
-        echo  >> "${initdir}/etc/cmdline.d/95resume.conf"
Harald Hoyer b94732
+	local _resumeconf=$(cmdline)
Harald Hoyer b94732
+	[[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf"
Harald Hoyer b94732
     fi
Harald Hoyer b94732
 
Harald Hoyer b94732
     # Optional uswsusp support