Commit 85d4cbd8 authored by Adrien Grellier's avatar Adrien Grellier
Browse files

Allow the use of xorriso to generate a iso-hybrid, to boot from a USB Key and with EFI.



Change-Id: Ia4dd44666c4253bf6e1f3f29420843014ea7a480
Signed-off-by: default avatarAdrien Grellier <adrien.grellier@ec-nantes.fr>
parent 605f3bd9
......@@ -2,6 +2,12 @@
Small script aimed to ease the creation of a preseeded Debian ISO image
## Prerequistes
In order to run the script, you need to install these packages:
apt install wget genisoimage xorriso isolinux
## How to use
Some packages like `genisoimage` need to be installed. Check the script to know which packages if it fails.
......
......@@ -8,6 +8,7 @@ Preseed Creator (c) Luc Didry 2017, WTFPL
-i <image.iso> ISO image to preseed. If not provided, the script will download and use the latest Debian amd64 netinst ISO image
-o <preseeded_image.iso> output preseeded ISO image. Default to preseed_creator/debian-netinst-latest-preseed.ISO
-p <preseed_file.cfg> preseed file. If not provided, the script will put "d-i debian-installer/locale string fr_BE" in the preseed.cfg file
-x Use xorriso instead of genisoimage, to create an iso-hybrid
-g download the latest Debian stable example preseed file into preseed_example.cfg and exit
-h print this help and exit
EOF
......@@ -18,7 +19,8 @@ INPUT=""
PRESEED=""
MYPWD=$(pwd)
OUTPUT=""
while getopts ":i:o:p:gh" opt; do
XORRISO=""
while getopts ":i:o:p:xgh" opt; do
case $opt in
i)
INPUT=$OPTARG
......@@ -29,6 +31,9 @@ while getopts ":i:o:p:gh" opt; do
p)
PRESEED=$OPTARG
;;
x)
XORRISO='yes'
;;
g)
echo "Downloading latest Debian stable example preseed file into preseed_example.cfg"
wget -q http://www.debian.org/releases/stable/example-preseed.txt -O preseed_example.cfg
......@@ -183,7 +188,24 @@ fi
cd ..
echo -ne 'Creating preseeded ISO image [==========================> ](90%)\r'
genisoimage -quiet -o $OUTPUT -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/boot.cat ./cd > /dev/null 2>&1
if [[ -z $XORRISO ]]
then
genisoimage -quiet -o $OUTPUT -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/boot.cat ./cd > /dev/null 2>&1
else
xorriso -as mkisofs \
-quiet \
-o $OUTPUT \
-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 \
-eltorito-alt-boot \
-e boot/grub/efi.img \
-no-emul-boot \
-isohybrid-gpt-basdat \
./cd /dev/null 2>$1
fi
if [ $? -ne 0 ]
then
echo "Error while creating the preseeded ISO image. Aborting"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment