2011-02-07 21:30:21 -01:00
|
|
|
# This script gets sourced from boot-kfreebsd-i386 and boot-kfreebsd-amd64.
|
|
|
|
#
|
|
|
|
# Do install stuff for kfreebsd, 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
|
|
|
|
BOOTDIR=
|
|
|
|
if [ "$DI_WWW_HOME" = "default" ];then
|
|
|
|
if [ "$ARCH" = kfreebsd-i386 ]; then
|
|
|
|
DI_WWW_HOME="http://d-i.debian.org/daily-images/kfreebsd-i386/daily/"
|
|
|
|
else
|
|
|
|
DI_WWW_HOME="http://d-i.debian.org/daily-images/kfreebsd-amd64/daily/"
|
|
|
|
fi
|
|
|
|
if [ -n "$DI_DIR" ];then
|
|
|
|
DI_DIR="$DI_DIR/${DI_WWW_HOME#*http://}"
|
|
|
|
DI_WWW_HOME=""
|
|
|
|
echo "Using images from $DI_DIR"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ ! "$DI_DIST" ]; then
|
|
|
|
DI_DIST="$DI_CODENAME"
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $CDDIR/..
|
|
|
|
|
|
|
|
# Only disc 1 bootable
|
|
|
|
if [ $N != 1 ]; then
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Download boot images.
|
2011-12-08 14:34:14 -01:00
|
|
|
BOOT_IMAGES="cdrom/debian-cd_info.tar.gz cdrom/kfreebsd.gz cdrom/kfreebsd-9.gz cdrom/initrd.gz"
|
2011-02-07 21:30:21 -01:00
|
|
|
|
2012-03-03 21:50:10 -01:00
|
|
|
if [ "$ARCH" = kfreebsd-amd64 ]; then
|
2012-03-15 14:46:19 -01:00
|
|
|
BOOT_IMAGES="$BOOT_IMAGES cdrom/gtk/initrd.gz"
|
2012-03-03 21:50:10 -01:00
|
|
|
fi
|
|
|
|
|
2011-02-07 21:30:21 -01:00
|
|
|
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
|
2011-12-14 14:40:46 -01:00
|
|
|
cp "$DI_DIR/$image" $image || true
|
2011-02-07 21:30:21 -01:00
|
|
|
else
|
|
|
|
wget "$DI_WWW_HOME/$image" -O $image
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Install kernel and initrd
|
|
|
|
mkdir -p $CDDIR/boot/kernel/
|
|
|
|
cp "cdrom/kfreebsd.gz" "$CDDIR/boot/kernel/kfreebsd.gz"
|
2012-03-15 14:46:19 -01:00
|
|
|
if [ -f cdrom/kfreebsd-9.gz ] ; then
|
|
|
|
cp "cdrom/kfreebsd-9.gz" "$CDDIR/boot/kernel/kfreebsd-9.gz"
|
|
|
|
fi
|
2011-02-07 21:30:21 -01:00
|
|
|
cp "cdrom/initrd.gz" "$CDDIR/boot/mfsroot.gz"
|
|
|
|
|
2012-03-15 14:46:19 -01:00
|
|
|
if [ "$ARCH" = kfreebsd-amd64 ] && [ -f cdrom/gtk/initrd.gz ] ; then
|
2012-03-03 21:50:10 -01:00
|
|
|
mkdir -p $CDDIR/boot/gtk/
|
|
|
|
cp "cdrom/gtk/initrd.gz" "$CDDIR/boot/gtk/mfsroot.gz"
|
|
|
|
fi
|
|
|
|
|
2011-02-07 21:30:21 -01:00
|
|
|
# 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"
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-c boot/boot.cat"
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-no-emul-boot"
|
2012-08-13 13:06:04 +00:00
|
|
|
|
2012-09-20 11:46:46 +00:00
|
|
|
bls=4 # Specify 4 for BIOS boot, don't calculate it
|
2012-08-13 13:06:04 +00:00
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-boot-load-size $bls"
|
2011-02-07 21:30:21 -01:00
|
|
|
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
|
|
|
|
EOF
|
|
|
|
todos > $CDDIR/autorun.bat <<EOF
|
|
|
|
@echo Starting "README.html"...
|
|
|
|
@start README.html
|
|
|
|
@exit
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Install languages
|
|
|
|
install_languages $CDDIR
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
rm -rf cdrom
|
|
|
|
|
|
|
|
# done
|