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

Bug#544516: netcfg/get_hostname isn't use with network preseed

Package: network-preseed
Version: 1.41

The idea is to run netcfg a second time if the parameter
netcfg/get_hostname is found into the preseed file and by the way set
the hostname to the correct value.

For the full storry, I created a another package called mac-preseed
taking the parameter preseed/url_prefix.
That package will build the preseed url dynamically preseed/url_prefix/$MAC .
On the web server a perl script parse the url and genrate a dynamic
preseed file with information comming from a database, including the
So the installation is fully unattended.

diff -Nru ../preseed-1.41ubuntu1/preseed.sh ./preseed.sh
--- ../preseed-1.41ubuntu1/preseed.sh	2008-10-20 13:06:32.000000000 +0000
+++ ./preseed.sh	2009-08-31 07:44:32.000000000 +0000
@@ -64,11 +64,16 @@
 	if ! debconf-set-selections $UNSEEN $tmp; then
 		error load_error "$location"
+        # if netcfg parameter are set into the preseed file
+        # then run netcfg again
+        if [ `grep -c "netcfg/get_hostname" $tmp` ]; then exec netcfg; fi
 	rm -f $tmp

 	log "successfully loaded preseed file from $location"
 	local last_location="$location"

Reply to: