From 0790dc35bc32a8f5f0fd0a641fab10b977d08f21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Fri, 28 Dec 2018 08:22:39 +0100 Subject: [PATCH] =?UTF-8?q?Small=20fix=20(forgot=20sleep,=E2=80=A6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- make.iso.preseed.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/make.iso.preseed.sh b/make.iso.preseed.sh index a31fe4f..c284c20 100755 --- a/make.iso.preseed.sh +++ b/make.iso.preseed.sh @@ -61,7 +61,7 @@ case $# in ;; * ) printf '%b\n' "Usage :" - printf '%b\n' "$(basename $0) PRESEED_FILE_PATH [TEMP_DIR]" + printf '%b\n' "$(basename ${0}) PRESEED_FILE_PATH [TEMP_DIR]" printf '%b\n' "-------" printf '%b\n' "PRESEED_FILE_PATH : Required" printf '%b\n' "Should be the absolut path to the preseed file you want to add to the ISO." @@ -93,18 +93,14 @@ INITRD_GZ_PATH=$(find "${TEMP_ISO_DIR}" -type f \( -path '*xen*' -o -path '*gtk* ## Copy it to a directory cp -- "${INITRD_GZ_PATH}" "${TEMP_INITRD_DIR}" || exit 2 -sleep 30 - cd -- "${TEMP_INITRD_DIR}" > /dev/null || exit 2 -## Uncompress initrd.gz and delete it +## Uncompress initrd.gz then delete it gunzip < initrd.gz | cpio --extract --quiet --make-directories --no-absolute-filenames >> /dev/null rm -f -- initrd.gz ## Add preseed file cp -- "${PRESEED_FILE}" preseed.cfg || exit 2 -sleep 30 - ## Recompress to initrd.gz and move it back to the extracted files for ISO find . -not -name initrd.gz | cpio --format=newc --create --quiet | gzip --best > initrd.gz cp -- initrd.gz "${INITRD_GZ_PATH}" || exit 2 @@ -127,10 +123,12 @@ xorriso -as mkisofs -o "${DEBIAN_PRESEED_ISO_PATH}" \ -quiet -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \ -c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot \ -boot-load-size 4 -boot-info-table "${TEMP_ISO_DIR}" + +## Then remove temp iso directory +rm -rf -- "${TEMP_ISO_DIR}" + # }}} printf '%b\n' "The new ISO image is available : ${DEBIAN_PRESEED_ISO_PATH}" -#rm -rf -- "${TEMP_ISO_DIR}" - exit 0