2009-04-20 11:50:42 +00:00
|
|
|
# This script gets sourced from boot-i386 and boot-amd64.
|
2009-02-15 21:42:47 -01:00
|
|
|
#
|
|
|
|
# Do install stuff for x86, 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-05-06 22:26:50 +00: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
|
2013-12-16 13:05:35 -01:00
|
|
|
if [ "$ARCH" = i386 ]; then
|
|
|
|
DI_WWW_HOME="http://d-i.debian.org/daily-images/i386/daily"
|
|
|
|
else
|
|
|
|
DI_WWW_HOME="http://d-i.debian.org/daily-images/amd64/daily"
|
|
|
|
fi
|
|
|
|
try_di_image_cache
|
2009-02-15 21:42:47 -01:00
|
|
|
fi
|
|
|
|
|
2013-05-06 22:26:50 +00:00
|
|
|
case "$MKISOFS" in
|
|
|
|
*xorriso*)
|
2014-04-08 17:32:13 +00:00
|
|
|
XORRISO_VER=$(xorriso_version)
|
2013-05-06 22:26:50 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "ERROR: debian-cd now depends on xorriso for making x86 bootable CDs."
|
|
|
|
exit 1;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2009-02-15 21:42:47 -01:00
|
|
|
cd $CDDIR/..
|
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
# This script is called with $1 (now $N) as the CD to make bootable.
|
|
|
|
# N may be in the form "n" or "n_NONUS" There may be more than 4
|
|
|
|
# disks...support extras.
|
2009-02-15 21:42:47 -01:00
|
|
|
|
|
|
|
# Strip NONUS part of disk number
|
|
|
|
# NN will be 1...N so it can be used as an index
|
|
|
|
NN=`echo $N | sed -e 's/_NONUS//'`
|
|
|
|
|
2009-08-04 20:15:32 +00:00
|
|
|
# Exit if this is not a boot disk
|
2010-09-14 22:28:53 +00:00
|
|
|
if [ $NN != 1 ] ; then exit 0; fi
|
2009-08-04 20:15:32 +00:00
|
|
|
|
2010-12-26 18:24:30 -01:00
|
|
|
INSTALLDIR_i386="install.386"
|
|
|
|
INSTALLDIR_amd64="install.amd"
|
|
|
|
|
2009-02-15 21:42:47 -01:00
|
|
|
if [ "$ARCH" = i386 ]; then
|
|
|
|
INSTALLDIR="$INSTALLDIR_i386"
|
|
|
|
else
|
|
|
|
INSTALLDIR="$INSTALLDIR_amd64"
|
|
|
|
fi
|
|
|
|
|
|
|
|
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
|
|
|
|
# Only include disk images on full CDs, not on smaller images.
|
2010-05-27 13:33:26 +00:00
|
|
|
#if [ "$ARCH" = i386 ] && [ "$INSTALLER_CD" != 1 ] && [ "$INSTALLER_CD" != 2 ] && [ "$INSTALLER_CD" != C ]; then
|
2009-08-04 20:34:23 +00:00
|
|
|
#DISK_IMAGES="floppy/cd-drivers.img floppy/boot.img floppy/root.img"
|
2009-02-15 21:42:47 -01:00
|
|
|
#EXTRA_DISK_IMAGES="cdrom/boot.img"
|
2009-08-07 10:34:11 +00:00
|
|
|
#fi
|
2009-02-15 21:42:47 -01:00
|
|
|
|
|
|
|
# Download boot images.
|
|
|
|
for image in $BOOT_IMAGES; do
|
|
|
|
if [ ! -e "$image" ]; then
|
|
|
|
dir=$(dirname $image)
|
|
|
|
mkdir -p $dir
|
|
|
|
if [ -n "$LOCAL" -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
|
|
|
|
cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
|
|
|
|
elif [ ! "$DI_WWW_HOME" ];then
|
|
|
|
if [ ! "$DI_DIR" ];then
|
|
|
|
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
|
|
|
|
fi
|
|
|
|
# echo "Copying images from $DI_DIR"
|
|
|
|
cp "$DI_DIR/$image" "$image"
|
|
|
|
else
|
|
|
|
wget "$DI_WWW_HOME/$image" -O "$image"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Images that are not really required or may be unavailable.
|
|
|
|
for image in $DISK_IMAGES $EXTRA_DISK_IMAGES; do
|
|
|
|
if [ ! -e "$image" ]; then
|
|
|
|
dir=$(dirname $image)
|
|
|
|
mkdir -p $dir
|
|
|
|
if [ -n "$LOCAL" -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
|
|
|
|
cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
|
|
|
|
elif [ ! "$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" || rm -f "$image"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Only disk one gets the extra files installed
|
|
|
|
if [ "$NN" = "1" ]; then
|
|
|
|
# populate the install directory as well
|
|
|
|
for disk in $DISK_IMAGES $EXTRA_DISK_IMAGES; do
|
|
|
|
if [ -e "$disk" ]; then
|
|
|
|
dir=$(dirname $disk)
|
|
|
|
mkdir -p $CDDIR/$INSTALLDIR/$dir
|
|
|
|
cp -lf $disk $CDDIR/$INSTALLDIR/$dir
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2009-04-20 11:50:42 +00:00
|
|
|
if [ -e "$MIRROR/tools" ] && \
|
|
|
|
[ ! -e $CDDIR/tools ] && \
|
|
|
|
[ "$OMIT_DOC_TOOLS" != "1" ] ; then
|
|
|
|
echo " Adding tools to CD1"
|
|
|
|
$BASEDIR/tools/add_files $CDDIR $MIRROR tools
|
2011-02-22 19:52:44 -01:00
|
|
|
# Remove the win32-loader/ subdirectory from tools, as d-i already installs setup.exe
|
|
|
|
rm -Rf $CDDIR/tools/win32-loader
|
2009-04-20 11:50:42 +00:00
|
|
|
fi
|
2009-02-15 21:42:47 -01:00
|
|
|
fi
|
|
|
|
|
|
|
|
extra_image () {
|
|
|
|
image=$1
|
2010-07-07 23:49:46 +00:00
|
|
|
doppelgangers="$2"
|
2009-02-15 21:42:47 -01:00
|
|
|
dir=$(dirname "$image")
|
|
|
|
|
|
|
|
mkdir -p $CDDIR/$INSTALLDIR/$dir
|
|
|
|
if [ ! -e $CDDIR/$INSTALLDIR/"$image" ] ; then
|
|
|
|
if [ ! "$DI_WWW_HOME" ] ; then
|
|
|
|
if [ ! "$DI_DIR" ] ; then
|
|
|
|
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
|
|
|
|
fi
|
|
|
|
cp "$DI_DIR/cdrom/$image" $CDDIR/$INSTALLDIR/"$image"
|
|
|
|
else
|
|
|
|
wget "$DI_WWW_HOME/cdrom/$image" -O $CDDIR/$INSTALLDIR/"$image"
|
|
|
|
fi
|
|
|
|
fi
|
2010-07-07 23:49:46 +00:00
|
|
|
for doppelganger in $doppelgangers ; do
|
|
|
|
if [ -f "$CDDIR/$INSTALLDIR/$dir/$doppelganger" ] &&
|
|
|
|
cmp -s $CDDIR/$INSTALLDIR/"$image" $CDDIR/$INSTALLDIR/"$dir"/"$doppelganger" ; then
|
|
|
|
echo " $image identical to $doppelganger. Linking"
|
2010-07-08 10:23:51 +00:00
|
|
|
ln -nf $CDDIR/$INSTALLDIR/"$dir"/"$doppelganger" $CDDIR/$INSTALLDIR/"$image"
|
2010-07-07 23:49:46 +00:00
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2009-02-15 21:42:47 -01:00
|
|
|
}
|
|
|
|
|
|
|
|
case "$DESKTOP" in
|
2014-08-07 01:31:21 +00:00
|
|
|
$UNSPEC_DESKTOP_DEFAULT)
|
|
|
|
# default from tasksel
|
2009-02-15 21:42:47 -01:00
|
|
|
DESKTOP=
|
|
|
|
;;
|
|
|
|
all)
|
2014-09-26 20:14:33 +00:00
|
|
|
# default from tasksel
|
2009-02-15 21:42:47 -01:00
|
|
|
DESKTOP=
|
|
|
|
;;
|
|
|
|
light)
|
|
|
|
DESKTOP=xfce
|
|
|
|
;;
|
|
|
|
esac
|
2009-05-31 22:45:05 +00:00
|
|
|
# desktop boot parameter gets set separately through DESKTOP variable
|
|
|
|
KERNEL_PARAMS="$(echo "$KERNEL_PARAMS" | sed -r "s/desktop=[^ ]* ?//")"
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
echo " Using ISOLINUX boot-disks image on CD$N"
|
|
|
|
mkdir -p $CDDIR/$INSTALLDIR
|
|
|
|
cp -lf cdrom/vmlinuz $CDDIR/$INSTALLDIR/
|
|
|
|
cp -lf cdrom/initrd.gz $CDDIR/$INSTALLDIR/
|
2013-06-12 23:04:50 +00:00
|
|
|
if [ -e $CDDIR/tools/loadlin.exe ]; then
|
|
|
|
echo "\\tools\\loadlin.exe vmlinuz initrd=initrd.gz" | todos > $CDDIR/$INSTALLDIR/install.bat
|
|
|
|
fi
|
2010-09-18 00:56:54 +00:00
|
|
|
|
|
|
|
mkdir -p $CDDIR/../syslinux
|
|
|
|
SYSLINUXDEB=$(find_pkg_file syslinux)
|
|
|
|
if [ -z "$SYSLINUXDEB" ]; then
|
|
|
|
echo "ERROR: syslinux package is required" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
(dpkg --fsys-tarfile "$MIRROR/$SYSLINUXDEB" | \
|
|
|
|
tar xf - -C $CDDIR/../syslinux ./usr/lib)
|
|
|
|
|
2013-05-06 22:26:50 +00:00
|
|
|
if [ -n "$ARCHIVE_EXTRACTED_SOURCES" ]; then
|
|
|
|
echo $SYSLINUXDEB >> $CDDIR/../$N.pkgs_extracted
|
|
|
|
find_pkg_file syslinux source >> $CDDIR/../$N.pkgs_extracted
|
|
|
|
fi
|
2010-09-18 00:56:54 +00:00
|
|
|
|
2014-05-18 00:31:29 +00:00
|
|
|
# syslinux 6.x onwards uses different packaging layout. Deal with bold
|
|
|
|
# old and new layout for now.
|
|
|
|
|
|
|
|
if [ -f $CDDIR/../syslinux/usr/lib/syslinux/isolinux.bin ] ; then
|
|
|
|
SYSLINUX_LAYOUT=OLD
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-isohybrid-mbr syslinux/usr/lib/syslinux/isohdpfx.bin"
|
|
|
|
else
|
|
|
|
SYSLINUX_LAYOUT=NEW
|
|
|
|
ISOLINUXDEB=$(find_pkg_file isolinux)
|
|
|
|
if [ -z "$ISOLINUXDEB" ]; then
|
|
|
|
echo "ERROR: isolinux package is required" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
(dpkg --fsys-tarfile "$MIRROR/$ISOLINUXDEB" | \
|
|
|
|
tar xf - -C $CDDIR/../syslinux ./usr/lib)
|
|
|
|
|
|
|
|
if [ -n "$ARCHIVE_EXTRACTED_SOURCES" ]; then
|
|
|
|
echo $ISOLINUXDEB >> $CDDIR/../$N.pkgs_extracted
|
|
|
|
find_pkg_file isolinux source >> $CDDIR/../$N.pkgs_extracted
|
|
|
|
fi
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-isohybrid-mbr syslinux/usr/lib/ISOLINUX/isohdpfx.bin"
|
|
|
|
fi
|
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
|
|
|
|
# In case of a multi-arch CD the script will be called two times. The
|
|
|
|
# first time the isolinux dir gets set up for single arch; if it is
|
|
|
|
# called a second time the isolinux dir already exists and we know it
|
|
|
|
# will be multi-arch. We then throw away the first version and just
|
|
|
|
# configure things from scratch for multi-arch.
|
|
|
|
|
|
|
|
MULTIARCH=
|
|
|
|
if [ -e boot$N/isolinux/isolinux.cfg ]; then
|
|
|
|
MULTIARCH=1
|
|
|
|
rm -r boot$N/isolinux
|
|
|
|
fi
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
mkdir -p boot$N/isolinux
|
|
|
|
# Isolinux setup including config and help files comes from d-i.
|
|
|
|
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/isolinux/; tar zx)
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2013-05-06 22:26:50 +00:00
|
|
|
# If we don't have grub stuff from d-i, tell xorriso to add a
|
|
|
|
# partition offset for the isohybrid code
|
|
|
|
if [ ! -d boot$N/isolinux/grub ] ; then
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-partition_offset 16"
|
|
|
|
fi
|
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
di_syslinux_ver="$(di_syslinux_version)"
|
|
|
|
case "$di_syslinux_ver" in
|
|
|
|
2.0)
|
2009-05-31 23:53:55 +00:00
|
|
|
: ;;
|
2010-09-18 00:56:54 +00:00
|
|
|
1.*)
|
2009-05-31 23:53:55 +00:00
|
|
|
echo "Error: syslinux config versions before 2.0 are not supported"
|
|
|
|
exit 1 ;;
|
2010-09-18 00:56:54 +00:00
|
|
|
*)
|
2009-05-31 23:53:55 +00:00
|
|
|
echo "Error: unrecognized syslinux config version '$di_syslinux_ver'"
|
|
|
|
exit 1 ;;
|
2010-09-18 00:56:54 +00:00
|
|
|
esac
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
# Not everything in the tarball is isolinux stuff
|
|
|
|
if [ -e boot$N/isolinux/win32-loader.ini ] ; then
|
|
|
|
for file in boot$N/isolinux/g2ldr* boot$N/isolinux/setup.exe boot$N/isolinux/win32-loader.ini; do
|
|
|
|
if [ -e $file ] ; then
|
|
|
|
mv -v $file boot$N/
|
2009-02-15 21:42:47 -01:00
|
|
|
fi
|
2010-09-18 00:56:54 +00:00
|
|
|
done
|
|
|
|
fi
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
if [ -e boot$N/isolinux/f3.txt.withgtk ]; then
|
|
|
|
extra_image gtk/vmlinuz "../vmlinuz"
|
|
|
|
extra_image gtk/initrd.gz "../initrd.gz"
|
|
|
|
mv boot$N/isolinux/f3.txt.withgtk boot$N/isolinux/f3.txt
|
|
|
|
mv boot$N/isolinux/f4.txt.withgtk boot$N/isolinux/f4.txt
|
|
|
|
if [ -e boot$N/isolinux/isolinux.cfg.withgtk ]; then
|
|
|
|
mv boot$N/isolinux/isolinux.cfg.withgtk boot$N/isolinux/isolinux.cfg
|
2009-08-09 14:33:00 +00:00
|
|
|
fi
|
2013-06-12 23:04:50 +00:00
|
|
|
if [ -e $CDDIR/tools/loadlin.exe ]; then
|
|
|
|
echo "\\tools\\loadlin.exe \\$INSTALLDIR\\vmlinuz initrd=initrd.gz vga=788" | todos > $CDDIR/$INSTALLDIR/gtk/install.bat
|
|
|
|
fi
|
2010-09-18 00:56:54 +00:00
|
|
|
fi
|
|
|
|
rm -f boot$N/isolinux/isolinux.cfg.with*
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
if variant_enabled "xen" ; then
|
|
|
|
extra_image xen/vmlinuz "../vmlinuz ../gtk/vmlinuz"
|
|
|
|
extra_image xen/initrd.gz "../initrd.gz ../gtk/initrd.gz"
|
2013-05-06 22:26:50 +00:00
|
|
|
extra_image xen/debian.cfg || extra_image xen/xm-debian.cfg
|
2010-09-18 00:56:54 +00:00
|
|
|
fi
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
# Modify win32-loader.ini for the "current" arch
|
|
|
|
if [ -e boot$N/win32-loader.ini ]; then
|
|
|
|
sed -i "s|install/|$INSTALLDIR/|" boot$N/win32-loader.ini
|
|
|
|
if [ "${DESKTOP}" ] ; then
|
|
|
|
sed -i "s|^\(default_desktop\)=.*|\1=${DESKTOP}|" boot$N/win32-loader.ini
|
|
|
|
fi
|
|
|
|
fi
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2014-05-18 00:31:29 +00:00
|
|
|
if [ $SYSLINUX_LAYOUT = OLD ] ; then
|
|
|
|
cp -f $CDDIR/../syslinux/usr/lib/syslinux/isolinux.bin boot$N/isolinux/
|
|
|
|
cp -f $CDDIR/../syslinux/usr/lib/syslinux/vesamenu.c32 boot$N/isolinux/
|
|
|
|
if [ -e $CDDIR/../syslinux/usr/lib/syslinux/ldlinux.c32 ]; then
|
2013-05-06 22:26:50 +00:00
|
|
|
cp -f $CDDIR/../syslinux/usr/lib/syslinux/ldlinux.c32 boot$N/isolinux/
|
|
|
|
cp -f $CDDIR/../syslinux/usr/lib/syslinux/libcom32.c32 boot$N/isolinux/
|
|
|
|
cp -f $CDDIR/../syslinux/usr/lib/syslinux/libutil.c32 boot$N/isolinux/
|
2014-05-18 00:31:29 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
cp -f $CDDIR/../syslinux/usr/lib/ISOLINUX/isolinux.bin boot$N/isolinux/
|
|
|
|
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/vesamenu.c32 boot$N/isolinux/
|
|
|
|
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/ldlinux.c32 boot$N/isolinux/
|
|
|
|
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/libcom32.c32 boot$N/isolinux/
|
|
|
|
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/libutil.c32 boot$N/isolinux/
|
2013-05-06 22:26:50 +00:00
|
|
|
fi
|
2010-09-18 00:56:54 +00:00
|
|
|
|
|
|
|
if [ -z "$MULTIARCH" ]; then
|
|
|
|
# Set up isolinux dir for only the current arch
|
2013-06-12 22:59:33 +00:00
|
|
|
grep -lr '%install%' boot$N/isolinux/* | xargs -r sed -i "s|%install%|$INSTALLDIR|"
|
2010-09-18 00:56:54 +00:00
|
|
|
|
|
|
|
# Remove the amd*.cfg files to avoid them being loaded on a
|
|
|
|
# disc that does not have both amd64 and i386 dirs.
|
2013-06-12 22:59:33 +00:00
|
|
|
find boot$N/isolinux/ -name "amd*.cfg" -delete
|
2010-09-18 00:56:54 +00:00
|
|
|
else
|
|
|
|
# Set up isolinux dir for multi-arch
|
2013-06-12 22:59:33 +00:00
|
|
|
grep -lr '%install[-amd]*%' boot$N/isolinux/* | xargs -r sed -i -e "s|%install%|$INSTALLDIR_i386|" -e "s|%install-amd%|$INSTALLDIR_amd64|"
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
for file in boot$N/isolinux/f3.txt* boot$N/isolinux/f4.txt*; do
|
|
|
|
sed -i "4 s/^$/(note: i386 is default; prepend 'amd64-' to use an amd64 kernel instead)/" $file
|
|
|
|
done
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2013-04-19 14:52:21 +00:00
|
|
|
if [ -e boot$N/win32-loader.ini ]; then
|
|
|
|
# Modify win32-loader.ini to also cover the "other" arch
|
|
|
|
if [ "$ARCH" = i386 ]; then
|
|
|
|
sed -i -e "/^arch=/d
|
|
|
|
/^i386\//p; s/^i386/amd64/; s/=$INSTALLDIR_i386/=$INSTALLDIR_amd64/g" \
|
|
|
|
boot$N/win32-loader.ini
|
|
|
|
else
|
|
|
|
sed -i -e "/^arch=/d
|
|
|
|
/^amd64\//p; s/^amd64/i386/; s/=$INSTALLDIR_amd64/=$INSTALLDIR_i386/g" \
|
|
|
|
boot$N/win32-loader.ini
|
|
|
|
fi
|
2009-02-15 21:42:47 -01:00
|
|
|
fi
|
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
# Apply workaround for #505243
|
|
|
|
multiarch_workaround
|
|
|
|
fi
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
if [ "$SPLASHPNG" ] ; then
|
|
|
|
# Insert our own splash screen. Color index 0 is background, and
|
|
|
|
# index 7 is foreground. Set to black and white respecively
|
|
|
|
pngtopnm < $SPLASHPNG | ppmquant 16 | \
|
|
|
|
ppmtolss16 "#ffffff=7" "#000000=0" > boot$N/isolinux/splash.rle
|
|
|
|
pngtopnm < $SPLASHPNG | ppmquant 16 | pnmtopng > boot$N/isolinux/splash.png
|
|
|
|
fi
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2010-10-31 14:12:54 -01:00
|
|
|
# used by Debian Edu
|
|
|
|
if [ "$LOGOPNG" ] ; then
|
|
|
|
# Add custom logo to the initrd.gz file, replacing old image
|
|
|
|
GTKINITRD=$CDDIR/$INSTALLDIR/gtk/initrd
|
|
|
|
GTKINITRDGZ=$GTKINITRD.gz
|
|
|
|
echo "info: Adding $LOGOPNG to $GTKINITRD"
|
|
|
|
INITRDDIR=$TDIR/initrd-$$
|
|
|
|
# Repack initrd with new image
|
|
|
|
mkdir -p $INITRDDIR
|
|
|
|
(
|
|
|
|
cd $INITRDDIR
|
|
|
|
gunzip $GTKINITRDGZ
|
|
|
|
mkdir -p $INITRDDIR/usr/share/graphics
|
|
|
|
cp $LOGOPNG $INITRDDIR/usr/share/graphics/logo_debian.png
|
|
|
|
echo usr/share/graphics/logo_debian.png | \
|
|
|
|
cpio -oA -H newc -F $GTKINITRD
|
|
|
|
gzip -9 $GTKINITRD
|
|
|
|
)
|
|
|
|
rm -rf $INITRDDIR
|
|
|
|
fi
|
2010-10-26 18:33:22 +00:00
|
|
|
|
2010-09-18 00:56:54 +00:00
|
|
|
sed -i "s|built on|built $BUILD_DATE; d-i|" boot$N/isolinux/f1.txt
|
|
|
|
|
|
|
|
if [ -n "$KERNEL_PARAMS" ]; then
|
|
|
|
# Substitute custom kernel params into the isolinux config file(s)
|
2014-10-29 16:28:12 -01:00
|
|
|
for file in boot$N/isolinux/*.cfg; do
|
2010-09-18 00:56:54 +00:00
|
|
|
case "$(basename $file)" in
|
|
|
|
instsel.cfg)
|
2009-02-15 21:42:47 -01:00
|
|
|
continue ;;
|
2010-09-18 00:56:54 +00:00
|
|
|
esac
|
2014-11-06 11:55:59 -01:00
|
|
|
sed -i "/^[[:space:]]\+append .*---/ s|append|append $KERNEL_PARAMS|" \
|
2010-09-18 00:56:54 +00:00
|
|
|
$file
|
|
|
|
done
|
|
|
|
fi
|
2009-02-15 21:42:47 -01:00
|
|
|
|
2014-09-26 20:14:33 +00:00
|
|
|
set_default_desktop
|
2009-02-15 21:42:47 -01:00
|
|
|
|
|
|
|
# Add autorun
|
|
|
|
if [ -f boot$N/setup.exe ]; then
|
|
|
|
# when win32-loader is present, use that (it already checks for README.html)
|
|
|
|
todos > $CDDIR/autorun.inf <<EOF
|
|
|
|
[autorun]
|
|
|
|
open=setup.exe
|
|
|
|
EOF
|
|
|
|
elif [ -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
|
|
|
|
|
|
|
|
rm -rf cdrom floppy
|
|
|
|
|
2013-05-06 22:26:50 +00:00
|
|
|
# Common mkisofs options when creating CDs
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long"
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
|
|
|
|
|
|
|
|
# Add the normal options to make an ElTorito bootable CD/DVD
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-b isolinux/isolinux.bin"
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-c isolinux/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"
|
|
|
|
|
|
|
|
# We explicitly put the boot bits in boot$N (as opposed to CD$N) and
|
|
|
|
# list it first on the eventual mkisofs command line. That means
|
|
|
|
# they'll be placed nearer the front of the eventual image; some older
|
|
|
|
# BIOSes apparently have a limitation on what they'll boot here.
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot$N"
|
|
|
|
|
|
|
|
if [ -d boot$N/isolinux/grub ] ; then
|
|
|
|
echo " Adding EFI boot code for $ARCH on CD$N"
|
|
|
|
|
|
|
|
# Move GRUB files to the right place.
|
|
|
|
mkdir -p $CDDIR/efi/boot
|
2015-01-10 23:40:15 -01:00
|
|
|
mcopy -n -i boot$N/isolinux/grub/efi.img '::efi/boot/boot*.efi' $CDDIR/efi/boot
|
2013-05-06 22:26:50 +00:00
|
|
|
mkdir -p $CDDIR/boot/grub
|
|
|
|
mv boot$N/isolinux/grub/* $CDDIR/boot/grub/
|
|
|
|
rmdir boot$N/isolinux/grub
|
|
|
|
|
|
|
|
# Create grub menu entries to match the isolinux ones
|
|
|
|
sed -i '/^menuentry/Q' $CDDIR/boot/grub/grub.cfg;
|
|
|
|
$BASEDIR/tools/boot/$DI_CODENAME/parse_isolinux \
|
|
|
|
boot$N/isolinux $CDDIR $BASEDIR/data/$DI_CODENAME/grub-theme.in "$DISKINFO_DISTRO" "$DEBIAN_KERNEL" "$DEBVERSION" \
|
|
|
|
>> $CDDIR/boot/grub/grub.cfg
|
|
|
|
|
|
|
|
# Stuff the EFI boot files into a FAT filesystem, making it as
|
|
|
|
# small as possible. 24KiB headroom seems to be enough;
|
|
|
|
# (x+31)/32*32 rounds up to multiple of 32.
|
|
|
|
# This is the same as in efi-image, but we need to redo it here in
|
|
|
|
# the case of a multi-arch amd64/i386 image
|
|
|
|
|
|
|
|
size=0
|
|
|
|
for file in $CDDIR/efi/boot/boot*.efi; do
|
|
|
|
size=$(($size + $(stat -c %s "$file")))
|
|
|
|
done
|
|
|
|
|
|
|
|
blocks=$((($size / 1024 + 55) / 32 * 32 ))
|
|
|
|
|
|
|
|
rm -f $CDDIR/boot/grub/efi.img
|
|
|
|
mkfs.msdos -C "$CDDIR/boot/grub/efi.img" $blocks >/dev/null
|
|
|
|
mmd -i "$CDDIR/boot/grub/efi.img" ::efi
|
|
|
|
mmd -i "$CDDIR/boot/grub/efi.img" ::efi/boot
|
2015-01-10 23:41:31 -01:00
|
|
|
mcopy -o -i "$CDDIR/boot/grub/efi.img" $CDDIR/efi/boot/boot*.efi \
|
2013-05-06 22:26:50 +00:00
|
|
|
"::efi/boot"
|
|
|
|
|
|
|
|
# Ugh - different code here depending on the version of xorriso we've got
|
|
|
|
if [ $XORRISO_VER -le 10202 ] ; then
|
|
|
|
# 1.2.2 shipping in Wheezy
|
|
|
|
echo "Using older EFI command line for xorriso $XORRISO_VER"
|
|
|
|
# Tell xorriso to create a secondary ElTorito boot record for the
|
|
|
|
# EFI bootloader
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-eltorito-alt-boot --efi-boot boot/grub/efi.img"
|
|
|
|
# Add the efi image as a FAT partition too, so our CD image will
|
|
|
|
# also boot on a USB key (like isohybrid, just implemented
|
|
|
|
# differently)
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-append_partition 2 0x01 $CDDIR/boot/grub/efi.img"
|
|
|
|
|
|
|
|
elif [ $XORRISO_VER -gt 10202 ] ; then
|
|
|
|
echo "Using newer EFI support in xorriso $XORRISO_VER"
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot"
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-isohybrid-gpt-basdat -isohybrid-apm-hfsplus"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo " No EFI boot code for $ARCH on CD$N"
|
|
|
|
fi
|
|
|
|
|
2009-02-15 21:42:47 -01:00
|
|
|
# th,th, thats all
|
2013-05-06 22:26:50 +00:00
|
|
|
|