[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] Add ability to parse conf files from /live/image



On 04/29/2012 06:43 PM, Ian Geiser wrote:
  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.

please submit patches atomically, means, one patch for adding parsing of the conffiles within initramfs (which also updates the manpage to reflect that also initramfs is respected), and one to add it from the rootfs, and one from the live media.

+if [ -f /etc/live/boot.conf ]
+then
+	. /etc/boot.conf
+if

don't use -f, but -e; otherwise symlinked configs do not work.
use the function here as well, and apart from the obvious typo (wrong path when sourcing), also respect the boot.d/*.conf files.

+	parse_configs /etc/live

function names start with a capital letter, and i suggest you name it 'Read_configuration'.

+parse_configs ()
+{
+	local confdir=${1}
+	if [ -f ${confdir}/boot.conf ]
+	then
+		. ${confdir}/boot.conf
+	fi

same as above; don't use local, and adhere to coding style guidelines as included in live-manual.

+
+	if ls ${confdir}/boot.d/*.conf>  /dev/null 2>&1
+	then
+		for conf in ${confdir}/boot.d/*.conf
+		do
+			. ${conf}
+		done
+	fi
+}

you'll find a much nicer variant in live-config:

http://live.debian.net/gitweb?p=live-config.git;a=commitdiff;h=07f78e12ce29ab388d51ff70c12cb38e371fa9c7

Regards,
Daniel

--
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          daniel.baumann@progress-technologies.net
Internet:       http://people.progress-technologies.net/~daniel.baumann/


Reply to: