[SCM] debian-live/live-helper branch, master, updated. 1.0_a40-1-13-g32f6dcd

Chris Lamb chris at chris-lamb.co.uk
Sat Mar 22 18:58:13 UTC 2008


The following commit has been merged in the master branch:
commit 32f6dcd3a32d0d17292d48ce5871622604aceb60
Author: Chris Lamb <chris at chris-lamb.co.uk>
Date:   Sat Mar 22 18:13:03 2008 +0000

    lh_binary_debian-installer: Preseed by repacking initrd in some situations
    
    This patch repacks the initrd when using the d-i netboot images in order
    to incorporate a preseed.cfg if it exists. Before this patch, preseeding
    of d-i netboot images was not possible.
    
    Repacking the initrd has the additional advantage of being able to preseed
    the first few questions of the installation process.
    
    Signed-off-by: Chris Lamb <chris at chris-lamb.co.uk>

diff --git a/helpers/lh_binary_debian-installer b/helpers/lh_binary_debian-installer
index d1913fa..257d786 100755
--- a/helpers/lh_binary_debian-installer
+++ b/helpers/lh_binary_debian-installer
@@ -453,5 +453,33 @@ then
 	fi
 fi
 
+repack_initrd() {
+	local TARGET_INITRD
+	TARGET_INITRD="${1}"
+	REPACK_TMPDIR="unpacked-initrd"
+	
+	# cpio does not have a "extract to directory", so we must change directory
+	mkdir -p ${REPACK_TMPDIR}
+	cd ${REPACK_TMPDIR}
+
+	gzip -d < ../${TARGET_INITRD} | cpio -i --make-directories --no-absolute-filenames
+	cp ../config/binary_debian-installer/preseed.cfg .
+	find | cpio -H newc -o | gzip -9 > ../${TARGET_INITRD} 
+
+	cd ..
+	rm -rf ${REPACK_TMPDIR}
+}
+
+# Preseed d-i by repacking the initrd in certain situations
+if [ "${USE_NETBOOT_DI}" = "yes" ] && [ -e config/binary_debian-installer/preseed.cfg ]
+then
+	repack_initrd "${DESTDIR}"/"${INITRD_DI}"
+
+	if [ -e "${DESTDIR}"/"${INITRD_GI}" ]
+	then
+		repack_initrd "${DESTDIR}"/"${INITRD_GI}"
+	fi
+fi
+
 # Creating stage file
 Create_stagefile .stage/binary_debian-installer

-- 
debian-live/live-helper



More information about the debian-live-changes mailing list