I've used a script like the one appended below to build a customized
(Open-)Solaris
installation optical media. The attached script replaces stage2
stage2_eltorito and
multiboot on the installation CD; these three files are not included, but you
should get an
idea how to build a customized version of the Installation media.
========================================================================
#!/bin/sh
#
# Build an updated Solaris installation media, with some Intel iMac specific
# fixes.
#
USAGE="`basename $0` [-d tmp_dir] {sol_iso_image_file} {iso_image_for_imac}"
tmp_dir=/export
set -- `getopt d: $*`
if [ $? -ne 0 ]
then
echo "$USAGE"
exit 2
fi
for i in $*
do
case $i in
-d) tmp_dir=$2; shift 2;;
--) shift; break;;
esac
done
if [ $# -ne 2 ]
then
echo "$USAGE"
exit 2
fi
img="$1"
new_iso="$2"
dev_lofi=/dev/lofi/99
mnt=/tmp/mnt_iso_$$
tmp="$tmp_dir/sol_iso_$$"
#
# map the solaris installation cd/dvd image to a lofi device,
# and mount it as a iso9660 filesystem
#
lofiadm -a "$img" $dev_lofi
[ $? -ne 0 ] && exit 1
mkdir -p $mnt
mount -F hsfs $dev_lofi $mnt
[ $? -ne 0 ] && exit 1
#
# copy the cd/dvd image to a temporary directory so that we
# can modify it
#
echo "building iso in $tmp ..."
mkdir -p "$tmp"
(cd $mnt; tar cf - .) | (cd "$tmp"; tar xf -)
umount $mnt
rmdir $mnt
lofiadm -d $dev_lofi
#
# replace the stage2 grub boot code
# (fixes 6412224 GRUB hangs when no i8042 is present)
# replace multiboot
# (fixes 6412226 multiboot hangs when no i8042 is present)
#
cp -f stage2 stage2_eltorito "$tmp/boot/grub/"
cp -f multiboot "$tmp/boot/"
#
# and build a new iso image from the modified tree
#
mkisofs -eltorito-boot boot/grub/stage2_eltorito -no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
-r -ldots -disable-deep-relocation \
-full-iso9660-filenames -relaxed-filenames -omit-period \
-omit-version-number -o "$new_iso" "$tmp"
[ $? -ne 0 ] && exit 1
echo "clean up $tmp ..."
rm -rf "$tmp"
exit 0
========================================================================
This message posted from opensolaris.org