#!/bin/bash
#
-# Run xorriso to make a bootable ISO of bootimage.raw; a hybrid, nulti
+# Run xorriso to make a bootable ISO of bootimage.raw; a hybrid, multi
# mode bootable ISO.
set -e
ISO=tiniest.iso
P1=part1.raw # $ISOTREE/part1.raw
-echo "# Prepare ISO content tree"
-
+echo "# Prepare ISO content tree unless it's already set up"
if [ ! -d $ISOTREE ] ; then
mkdir $ISOTREE
- #touch $ISOTREE/catalog # Boot catalog
+
# Determine start and size of first parition
X=( $(sfdisk -l -ostart,sectors bootimage.raw | tail -n 2) )
dd if=bootimage.raw of=$P1 skip=${X[0]} count=${X[1]}
cp kernel/usr/lib/ISOLINUX/isolinux.bin $ISOTREE/boot/isolinux
cp syslinux-iso.cfg $ISOTREE/boot/isolinux/syslinux.cfg
mcopy -i $P1 ::/splash.png ::/vmlinuz $ISOTREE/
-
- #mkdir -p $ISOTREE/EFI/BOOT
- #cp kernel/usr/lib/SYSLINUX.EFI/efi64/syslinux.efi \
- # $ISOTREE/EFI/BOOT/bootia64.efi
- #cp $ISOTREE/boot/isolinux/*.* $ISOTREE/EFI/boot/
-
- #mcopy -i $P1 ::/ldlinux.sys ::/ldlinux.c32 $ISOTREE/
- #mcopy -i $P1 ::/initrd.gz $ISOTREE/
- #cp devuan/initrd.gz $ISOTREE/
fi
-[ ! -r $ISO ] || rm $ISO
+[ -r $ISO ] && rm $ISO
+
PREPID="'$(id -un), $(getent passwd $(id -un)|awk -F: '{print $5}')'"
XORRISO=(