2010-08-20 15:04:23 +00: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
|
2013-12-16 13:05:35 -01:00
|
|
|
# Tempting as it might be to merge these two definitions using $ARCH,
|
|
|
|
# do *not* do that - these defs are parsed out by other scripts that
|
|
|
|
# won't cope with that
|
2010-08-20 15:52:56 +00:00
|
|
|
if [ "$ARCH" = kfreebsd-i386 ]; then
|
2010-08-20 15:58:15 +00:00
|
|
|
DI_WWW_HOME="http://d-i.debian.org/daily-images/kfreebsd-i386/daily/"
|
2010-08-20 15:52:56 +00:00
|
|
|
else
|
2010-08-20 15:58:15 +00:00
|
|
|
DI_WWW_HOME="http://d-i.debian.org/daily-images/kfreebsd-amd64/daily/"
|
2010-08-20 15:52:56 +00:00
|
|
|
fi
|
2013-12-16 13:05:35 -01:00
|
|
|
try_di_image_cache
|
2010-08-20 15:04:23 +00:00
|
|
|
fi
|
|
|
|
|
2014-02-18 23:03:19 -01:00
|
|
|
case "$MKISOFS" in
|
|
|
|
*xorriso*)
|
2014-04-08 17:32:13 +00:00
|
|
|
XORRISO_VER=$(xorriso_version)
|
2014-02-18 23:03:19 -01:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "ERROR: debian-cd now depends on xorriso for making x86 bootable CDs."
|
|
|
|
exit 1;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2010-08-20 15:04:23 +00:00
|
|
|
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.
|
2014-05-12 14:45:39 +00:00
|
|
|
BOOT_IMAGES="cdrom/debian-cd_info.tar.gz cdrom/kfreebsd-10.gz cdrom/initrd.gz"
|
2013-05-06 22:26:50 +00:00
|
|
|
|
|
|
|
if [ "$ARCH" = kfreebsd-amd64 ]; then
|
|
|
|
BOOT_IMAGES="$BOOT_IMAGES cdrom/gtk/initrd.gz"
|
|
|
|
fi
|
2010-08-20 15:04:23 +00: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
|
2013-05-06 22:26:50 +00:00
|
|
|
cp "$DI_DIR/$image" $image || true
|
2010-08-20 15:04:23 +00:00
|
|
|
else
|
|
|
|
wget "$DI_WWW_HOME/$image" -O $image
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Install kernel and initrd
|
|
|
|
mkdir -p $CDDIR/boot/kernel/
|
2014-05-12 14:45:39 +00:00
|
|
|
if [ -f cdrom/kfreebsd-10.gz ] ; then
|
|
|
|
cp "cdrom/kfreebsd-10.gz" "$CDDIR/boot/kernel/kfreebsd-10.gz"
|
2013-05-06 22:26:50 +00:00
|
|
|
fi
|
2010-08-20 15:04:23 +00:00
|
|
|
cp "cdrom/initrd.gz" "$CDDIR/boot/mfsroot.gz"
|
|
|
|
|
2013-05-06 22:26:50 +00:00
|
|
|
if [ "$ARCH" = kfreebsd-amd64 ] && [ -f cdrom/gtk/initrd.gz ] ; then
|
|
|
|
mkdir -p $CDDIR/boot/gtk/
|
|
|
|
cp "cdrom/gtk/initrd.gz" "$CDDIR/boot/gtk/mfsroot.gz"
|
|
|
|
fi
|
|
|
|
|
2010-08-20 15:04:23 +00:00
|
|
|
# Install bootloader
|
2010-09-15 12:16:35 +00:00
|
|
|
mkdir -p boot$N
|
|
|
|
tar -C boot$N -zxf cdrom/debian-cd_info.tar.gz
|
2010-08-20 15:04:23 +00:00
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long"
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-b boot/grub/grub_eltorito"
|
2014-02-18 23:03:19 -01:00
|
|
|
[ -f boot$N/boot/grub/grub_embed ] && add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "--embedded-boot boot$N/boot/grub/grub_embed"
|
2010-08-20 15:04:23 +00:00
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-c boot/boot.cat"
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-no-emul-boot"
|
2013-05-06 22:26:50 +00:00
|
|
|
|
|
|
|
bls=4 # Specify 4 for BIOS boot, don't calculate it
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-boot-load-size $bls"
|
2010-08-20 15:04:23 +00:00
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-boot-info-table"
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
|
2010-09-15 12:16:35 +00:00
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot$N"
|
2010-08-20 15:04:23 +00:00
|
|
|
|
|
|
|
# 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
|