From d0f86c0bceb4585554f90c56111832ee3e2ca870 Mon Sep 17 00:00:00 2001
From: Ian Reinhart Geiser <geiseri@yahoo.com>
Date: Sat, 28 Apr 2012 09:38:29 -0400
Subject: [PATCH 1/6] Added ability to parse the liveboot configuration files as defined in the liveboot documentation.
 Before anything is done we parse /etc/live/boot.conf and /etc/live/boot.d/*.conf from the initramfs
 After the live filesystem has been mounted but before any unions are setup then the
 live/boot.conf and live/boot.d/*.conf files are parsed.

---
 scripts/live         |    9 +++++++++
 scripts/live-helpers |   17 +++++++++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/scripts/live b/scripts/live
index 780c5de..dd24ecd 100755
--- a/scripts/live
+++ b/scripts/live
@@ -34,6 +34,11 @@ then
 	touch /live.vars
 fi
 
+if [ -f /etc/live/boot.conf ]
+then
+	. /etc/boot.conf
+if
+
 is_live_path ()
 {
 	DIRECTORY="${1}"
@@ -1507,6 +1512,8 @@ mountroot ()
 	# Ensure 'panic' function is overridden
 	. /scripts/live-functions
 
+	parse_configs /etc/live
+	
 	Arguments
 
 	maybe_break live-premount
@@ -1570,6 +1577,8 @@ mountroot ()
 		panic "Unable to find a medium containing a live file system"
 	fi
 
+	parse_configs ${mountpoint}/${LIVE_MEDIA_PATH}
+
 	if [ "${INTEGRITY_CHECK}" ]
 	then
 		integrity_check "${livefs_root}"
diff --git a/scripts/live-helpers b/scripts/live-helpers
index b5739fa..b04b392 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -1621,3 +1621,20 @@ is_mountpoint ()
 
 	[ $(stat -fc%d:%D "${directory}") != $(stat -fc%d:%D "${directory}/..") ]
 }
+
+parse_configs ()
+{
+	local confdir=${1}
+	if [ -f ${confdir}/boot.conf ]
+	then
+		. ${confdir}/boot.conf
+	fi
+
+	if ls ${confdir}/boot.d/*.conf > /dev/null 2>&1
+	then
+		for conf in ${confdir}/boot.d/*.conf
+		do
+			. ${conf}
+		done
+	fi
+}
\ No newline at end of file
-- 
1.7.0.4

