Automation of a local dev environment to learn, self-document, save time and avoid to reinvent the wheel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
debian-unattended/regeniso.sh

35 lines
1.0 KiB

#!/bin/bash
7z x -oisofiles $1
# Adding a Preseed File to the Initrd:
# You now have the directory isofiles with all the ISO's files in it. Make
# initrd.gz writable by the user, uncompress it and append a preseed file to
# the initrd. Recompress the initrd and return initrd.gz to its original
# read-only state.
# 386, amd
ARCH='amd'
gunzip isofiles/install.${ARCH}/initrd.gz
echo preseed.cfg | cpio -H newc -o -A -F isofiles/install.${ARCH}/initrd
gzip isofiles/install.${ARCH}/initrd
# Regenerating md5sum.txt:
# Note: A warning will be issued because `./debian` is a symlink to `.`;
# The production of md5sum.txt is unaffected.
cd isofiles
chmod +w md5sum.txt
find -follow -type f ! -name md5sum.txt -print0 | xargs -0 md5sum > md5sum.txt
chmod -w md5sum.txt
cd ..
# Creating a New Bootable ISO Image:
# The following instructions suffice for i386 and amd64 in legacy BIOS mode.
genisoimage -r -J -b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-o preseed-$1 isofiles
rm -rf isofiles/