debian-cd-clone/tools/boot/bullseye/boot-hurd-common

108 lines
3.0 KiB
Plaintext
Raw Normal View History

# This script gets sourced from boot-hurd-i386.
#
# Do install stuff for hurd, including making bootable CDs
# Works with debian-installer
#
# $1 is the CD number
# $2 is the temporary CD build dir
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
. $BASEDIR/tools/boot/$DI_CODENAME/x86-desktop.sh
set -e
#set -x
N=$1
CDDIR=$2
INSTALLDIR="install"
# Common options for all disks
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-l"
# Exit if this is not CD#1/DVD#1
if [ $N != "1" ]; then
exit 0
fi
if [ "$DI_WWW_HOME" = "default" ]; then
DI_WWW_HOME="https://d-i.debian.org/daily-images/hurd-i386/daily/"
try_di_image_cache
else
DI_WWW_HOME=$(echo $DI_WWW_HOME | sed "s,%ARCH%,$ARCH,")
fi
case "$MKISOFS" in
*xorriso*)
XORRISO_VER=$(xorriso_version)
;;
*)
echo "ERROR: debian-cd now depends on xorriso for making x86 bootable CDs."
exit 1;
;;
esac
cd $CDDIR/..
# Download boot images.
BOOT_IMAGES="cdrom/debian-cd_info.tar.gz cdrom/gnumach.gz cdrom/initrd.gz cdrom/gtk/initrd.gz cdrom/ext2fs.static cdrom/exec.static"
for image in $BOOT_IMAGES; do
if [ ! -e "$image" ]; then
dir=$(dirname $image)
mkdir -p $dir
if [ ! "$DI_WWW_HOME" ];then
if [ ! "$DI_DIR" ];then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
fi
cp "$DI_DIR/$image" $image
else
$WGET "$DI_WWW_HOME/$image" -O $image
fi
fi
done
# Install kernel and initrd
mkdir -p $CDDIR/boot/kernel/
mkdir -p $CDDIR/boot/gtk/
cp "cdrom/gnumach.gz" "$CDDIR/boot/kernel/gnumach.gz"
cp "cdrom/initrd.gz" "$CDDIR/boot/initrd.gz"
cp "cdrom/gtk/initrd.gz" "$CDDIR/boot/gtk/initrd.gz"
cp "cdrom/ext2fs.static" "$CDDIR/boot/kernel/ext2fs.static"
cp "cdrom/exec.static" "$CDDIR/boot/kernel/exec.static"
# Install bootloader
mkdir -p boot$N
tar -C boot$N -zxf cdrom/debian-cd_info.tar.gz
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-b boot/grub/grub_eltorito"
[ -f boot$N/boot/grub/grub_embed ] && add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "--embedded-boot boot$N/boot/grub/grub_embed"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-c boot/boot.cat"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-no-emul-boot"
bls=4 # Specify 4 for BIOS boot, don't calculate it
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-boot-load-size $bls"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-boot-info-table"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot$N"
# Add autorun
if [ -f $CDDIR/README.html ]; then
todos > $CDDIR/autorun.inf <<EOF
[autorun]
open=autorun.bat
label=Install Debian GNU/Hurd
EOF
todos > $CDDIR/autorun.bat <<EOF
@echo Starting "README.html"...
@start README.html
@exit
EOF
fi
# Cleanup
rm -rf cdrom
# done