1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
# 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
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
# 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
if [ "$ARCH" = kfreebsd-i386 ]; then
DI_WWW_HOME="https://d-i.debian.org/daily-images/kfreebsd-i386/daily/"
elif [ "$ARCH" = kfreebsd-amd64 ]; then
DI_WWW_HOME="https://d-i.debian.org/daily-images/kfreebsd-amd64/daily/"
else
echo "$0: unknown arch $ARCH; abort"
exit 1
fi
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/kfreebsd-10.gz cdrom/initrd.gz"
if [ "$ARCH" = kfreebsd-amd64 ]; then
BOOT_IMAGES="$BOOT_IMAGES cdrom/gtk/initrd.gz"
fi
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 || true
else
$WGET "$DI_WWW_HOME/$image" -O $image
fi
fi
done
# Install kernel and initrd
mkdir -p $CDDIR/boot/kernel/
if [ -f cdrom/kfreebsd-10.gz ] ; then
cp "cdrom/kfreebsd-10.gz" "$CDDIR/boot/kernel/kfreebsd-10.gz"
fi
cp "cdrom/initrd.gz" "$CDDIR/boot/mfsroot.gz"
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
# Install bootloader
mkdir -p boot$N
tar -C boot$N -zxf cdrom/debian-cd_info.tar.gz
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/kFreeBSD
EOF
todos > $CDDIR/autorun.bat <<EOF
@echo Starting "README.html"...
@start README.html
@exit
EOF
fi
# Cleanup
rm -rf cdrom
# done
|