* Merge boot-i386 and boot-amd64 into boot-x86.

This commit is contained in:
Joey Hess 2007-08-02 03:47:50 +00:00
parent 0b03aad504
commit 6560eb096d
4 changed files with 264 additions and 438 deletions

3
debian/changelog vendored
View File

@ -55,8 +55,9 @@ debian-cd (3.0.3) UNRELEASED; urgency=low
* Drop old with26 cruft for lenny.
* Update lenny's isolinux.bin to the one from syslinux 3.51-1
* Parse isolinux.cfg case-insensatively.
* Merge boot-i386 and boot-amd64 into boot-x86.
-- Joey Hess <joeyh@debian.org> Wed, 01 Aug 2007 22:42:56 -0400
-- Joey Hess <joeyh@debian.org> Wed, 01 Aug 2007 23:47:14 -0400
debian-cd (3.0.2) unstable; urgency=high

View File

@ -1,186 +1,2 @@
#!/bin/bash
#
# Do install stuff for amd64, 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
set -e
#set -x
N=$1
CDDIR=$2
BOOTDIR=
#echo "DI_WWW_HOME is $DI_WWW_HOME"
#echo "DI_DIR is $DI_DIR"
if [ "$DI_WWW_HOME" = "default" ];then
DI_WWW_HOME="http://people.debian.org/~aba/d-i/images/daily"
if [ -n "$DI_DIR" ];then
DI_DIR="$DI_DIR/~${DI_WWW_HOME#*~}"
DI_WWW_HOME=""
echo "Using images from $DI_DIR"
fi
fi
if [ ! "$DI_DIST" ]; then
DI_DIST="$DI_CODENAME"
fi
cd $CDDIR/..
# 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.
# 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//'`
if [ "$NN" != "1" ]; then
echo "CD$NN is not bootable"
exit 0
fi
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
# 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
echo " Using ISOLINUX boot-disks image on CD$N"
mkdir -p boot$N/isolinux boot$N/isolinux-amd64 $CDDIR/install.amd
cp -lf cdrom/vmlinuz $CDDIR/install.amd/
cp -lf cdrom/initrd.gz $CDDIR/install.amd/
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
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"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-boot-load-size 4"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-boot-info-table"
syslinux_files () {
type=$1
mv boot$N/isolinux-amd64/f3.txt.$type boot$N/isolinux-amd64/f3.txt
mv boot$N/isolinux-amd64/f4.txt.$type boot$N/isolinux-amd64/f4.txt
mv boot$N/isolinux-amd64/isolinux.cfg.$type boot$N/isolinux-amd64/isolinux.cfg
}
extra_image () {
image=$1
dir=$(dirname "$image")
mkdir -p $CDDIR/install.amd/$dir
if [ ! -e $CDDIR/install.amd/"$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/install.amd/"$image"
else
wget "$DI_WWW_HOME/cdrom/$image" -O $CDDIR/install.amd/"$image"
fi
fi
}
# Include Smart Boot Manager image for people where isolinux fails
gzip -dc $BASEDIR/data/$DI_CODENAME/sbm.bin.gz > $CDDIR/install/sbm.bin
# Keep the original file timestamp
touch -r $BASEDIR/data/$DI_CODENAME/sbm.bin.gz $CDDIR/install/sbm.bin
cp -p $BASEDIR/data/$DI_CODENAME/README.sbm $CDDIR/install
# Isolinux setup including config and help files comes from d-i.
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/isolinux-amd64/; tar zx)
if [ -e boot$N/isolinux-amd64/f3.txt.withgtk ]; then
extra_image gtk/initrd.gz
syslinux_files withgtk
fi
rm -f boot$N/isolinux-amd64/isolinux.cfg.with* 2>/dev/null || true
sed -i "s|/install/|/install.amd/|" boot$N/isolinux-amd64/isolinux.cfg
cp -f $BASEDIR/data/$DI_CODENAME/isolinux.bin boot$N/isolinux/
if [ -n "$KERNEL_PARAMS" ]; then
# Substitute custom kernel params into the isolinux config
# file.
sed -i "s|append |append $KERNEL_PARAMS |" boot$N/isolinux-amd64/isolinux.cfg
fi
if [ -n "$ISOLINUX_DEFAULT" ]; then
sed -i "s/^DEFAULT .*$/DEFAULT $ISOLINUX_DEFAULT/" boot$N/isolinux-amd64/isolinux.cfg
fi
# If the isolinux dir already exists, then we also have i386 and
# should merge. Otherwise, simply rename isolinux-amd64 into place
if [ -e boot$N/isolinux/isolinux.cfg ] ; then
for file in boot$N/isolinux/f3.txt* boot$N/isolinux/f4.txt*
do
cat $file | awk '
NR==3 { next }
NR==5 { printf " (i386 is default; prepend 'amd64-' to use an amd64 kernel instead)\n" }
/.*/ { print $0 }' > $file.tmp
mv $file.tmp $file
done
cat boot$N/isolinux-amd64/isolinux.cfg | awk '
/^[Ll][Aa][Bb][Ee][Ll]/ { printf("LABEL amd64-%s\n", $2) }
/^[Dd][Ee][Ff][Aa][Uu][Ll][Tt]/ { printf("default64 amd64-%s\n", $2) }
/[Kk][Ee][Rr][Nn][Ee][Ll]/ { print $0 }
/[Aa][Pp][Pp][Ee][Nn][Dd]/ { print $0 }' >> boot$N/isolinux/isolinux.cfg
else
mv -f boot$N/isolinux-amd64/* boot$N/isolinux
fi
rm -rf boot$N/isolinux-amd64
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
fi
rm -rf cdrom
sed -i "s|built on|built $BUILD_DATE; d-i|" boot$N/isolinux/f1.txt
# Add autorun if we have README.html
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
add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot$N"
# th,th, thats all
. $BASEDIR/tools/boot/$DI_CODENAME/boot-x86

View File

@ -1,253 +1,2 @@
#!/bin/bash
#
# Do install stuff for i386, 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
set -e
N=$1
CDDIR=$2
BOOTDIR=
if [ "$DI_WWW_HOME" = "default" ];then
DI_WWW_HOME="http://people.debian.org/~joeyh/d-i/images/daily"
if [ -n "$DI_DIR" ];then
DI_DIR="$DI_DIR/~${DI_WWW_HOME#*~}"
DI_WWW_HOME=""
echo "Using images from $DI_DIR"
fi
fi
if [ ! "$DI_DIST" ]; then
DI_DIST="$DI_CODENAME"
fi
cd $CDDIR/..
# 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.
# 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//'`
# List of boot image for each CD
KTYPE[1]="" #isolinux multiboot in fact
# Disable el-torito boot CD for Etch Beta 3
#KTYPE[2]="cdrom"
KTYPE[2]=""
# XXX add net-image back when it's fixed
KTYPE[3]=""
KTYPE[4]=""
KTYPE[5]=""
KTYPE[6]=""
KTYPE[7]=""
KTYPE[8]=""
KTYPE[9]=""
KTYPE[10]=""
THISTYPE=${KTYPE[$NN]}
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
# Only include disk images on full CDs, not on smaller images.
if [ "$INSTALLER_CD" != 1 ] && [ "$INSTALLER_CD" != 2 ]; then
DISK_IMAGES="floppy/cd-drivers.img floppy/boot.img floppy/root.img"
#EXTRA_DISK_IMAGES="cdrom/boot.img"
fi
# Download boot images and floppies.
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
if [ "$NN" = "1" ]; then
echo " Using ISOLINUX boot-disks image on CD$N"
mkdir -p boot$N/isolinux $CDDIR/install.386
cp -lf cdrom/vmlinuz $CDDIR/install.386/
cp -lf cdrom/initrd.gz $CDDIR/install.386/
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
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"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-boot-load-size 4"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-boot-info-table"
else
if [ -n "$THISTYPE" ]; then
echo " Using $THISTYPE boot-disks image on CD$N"
mkdir -p boot$N/boot
cp $THISTYPE/boot.img boot$N/boot/
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-b boot/boot.img"
else
mkdir boot$N
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
fi
fi
syslinux_files () {
type=$1
mv boot$N/isolinux/f3.txt.$type boot$N/isolinux/f3.txt
mv boot$N/isolinux/f4.txt.$type boot$N/isolinux/f4.txt
mv boot$N/isolinux/isolinux.cfg.$type boot$N/isolinux/isolinux.cfg
}
extra_image () {
image=$1
dir=$(dirname "$image")
mkdir -p $CDDIR/install.386/$dir
if [ ! -e $CDDIR/install.386/"$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/install.386/"$image"
else
wget "$DI_WWW_HOME/cdrom/$image" -O $CDDIR/install.386/"$image"
fi
fi
}
# 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/install.386/$dir
cp -lf $disk $CDDIR/install.386/$dir
fi
done
# Include Smart Boot Manager image for people where isolinux fails
gzip -dc $BASEDIR/data/$DI_CODENAME/sbm.bin.gz > $CDDIR/install/sbm.bin
# Keep the original file timestamp
touch -r $BASEDIR/data/$DI_CODENAME/sbm.bin.gz $CDDIR/install/sbm.bin
cp -p $BASEDIR/data/$DI_CODENAME/README.sbm $CDDIR/install/
# If the isolinux dir already exists, rename it aside for now
if [ -e boot$N/isolinux/isolinux.cfg ] ; then
mv boot$N/isolinux boot$N/isolinux-amd64
mkdir boot$N/isolinux
fi
# Isolinux setup including config and help files comes from d-i.
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/isolinux/; tar zx)
if [ -e boot$N/isolinux/f3.txt.withgtk ]; then
extra_image gtk/initrd.gz
syslinux_files withgtk
fi
rm -f boot$N/isolinux/isolinux.cfg.with* 2>/dev/null || true
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
fi
sed -i "s|/install/|/install.386/|" boot$N/isolinux/isolinux.cfg
if [ -e boot$N/isolinux-amd64/isolinux.cfg ] ; then
for file in boot$N/isolinux/f3.txt* boot$N/isolinux/f4.txt*
do
cat $file | awk '
NR==3 { next }
NR==5 { printf " (i386 is default; prepend 'amd64-' to use an amd64 kernel instead)\n" }
/.*/ { print $0 }' > $file.tmp
mv $file.tmp $file
done
cat boot$N/isolinux-amd64/isolinux.cfg | awk '
/^[Ll][Aa][Bb][Ee][Ll]/ { printf("label amd64-%s\n", $2) }
/^[Dd][Ee][Ff][Aa][Uu][Ll][Tt]/ { printf("default64 amd64-%s\n", $2) }
/[Kk][Ee][Rr][Nn][Ee][Ll]/ { print $0 }
/[Aa][Pp][Pp][Ee][Nn][Dd]/ { print $0 }' >> boot$N/isolinux/isolinux.cfg
rm -rf boot$N/isolinux-amd64
fi
cp -f $BASEDIR/data/$DI_CODENAME/isolinux.bin boot$N/isolinux/
if [ -n "$KERNEL_PARAMS" ]; then
# Substitute custom kernel params into the isolinux config
# file.
sed -i "s|append |append $KERNEL_PARAMS |" boot$N/isolinux/isolinux.cfg
fi
if [ -n "$ISOLINUX_DEFAULT" ]; then
sed -i "s/^DEFAULT .*$/DEFAULT $ISOLINUX_DEFAULT/" boot$N/isolinux/isolinux.cfg
fi
sed -i "s|built on|built $BUILD_DATE; d-i|" boot$N/isolinux/f1.txt
fi
rm -rf cdrom
# Add autorun if we have README.html
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
if [ "$NN" = "1" ]; then
add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot$N"
else
if [ -n "$THISTYPE" ]; then
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-c boot/boot.catalog"
add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot$N"
fi
fi
# th,th, thats all
. $BASEDIR/tools/boot/$DI_CODENAME/boot-x86

260
tools/boot/lenny/boot-x86 Normal file
View File

@ -0,0 +1,260 @@
#!/bin/bash
#
# 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
set -e
#xet -x
N=$1
CDDIR=$2
BOOTDIR=
if [ "$DI_WWW_HOME" = "default" ];then
if [ "$ARCH" = i386 ]; then
DI_WWW_HOME="http://people.debian.org/~joeyh/d-i/images/daily"
else
DI_WWW_HOME="http://people.debian.org/~aba/d-i/images/daily"
if [ -n "$DI_DIR" ];then
DI_DIR="$DI_DIR/~${DI_WWW_HOME#*~}"
DI_WWW_HOME=""
echo "Using images from $DI_DIR"
fi
fi
if [ ! "$DI_DIST" ]; then
DI_DIST="$DI_CODENAME"
fi
cd $CDDIR/..
# 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.
# 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//'`
# List of boot image types for each CD
KTYPE[1]="isolinux"
#KTYPE[2]="cdrom"
KTYPE[2]=""
KTYPE[3]=""
KTYPE[4]=""
KTYPE[5]=""
KTYPE[6]=""
KTYPE[7]=""
KTYPE[8]=""
KTYPE[9]=""
KTYPE[10]=""
THISTYPE=${KTYPE[$NN]}
if [ "$ARCH" = i386 ]; then
INSTALLDIR="install.386"
else
INSTALLDIR="install.amd"
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.
if [ "$ARCH" = i386 ] && [ "$INSTALLER_CD" != 1 ] && [ "$INSTALLER_CD" != 2 ]; then
DISK_IMAGES="floppy/cd-drivers.img floppy/boot.img floppy/root.img"
#EXTRA_DISK_IMAGES="cdrom/boot.img"
fi
# 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
# Include Smart Boot Manager image for people where isolinux fails
gzip -dc $BASEDIR/data/$DI_CODENAME/sbm.bin.gz > $CDDIR/install/sbm.bin
# Keep the original file timestamp
touch -r $BASEDIR/data/$DI_CODENAME/sbm.bin.gz $CDDIR/install/sbm.bin
cp -p $BASEDIR/data/$DI_CODENAME/README.sbm $CDDIR/install/
fi
extra_image () {
image=$1
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
}
if [ "$THISTYPE" = "isolinux" ]; then
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/
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
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"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-boot-load-size 4"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-boot-info-table"
add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot$N"
if [ "$ARCH" = i386 ]; then
ISOLINUXDIR=isolinux
# If the isolinux dir already exists, rename it aside for now
if [ -e boot$N/isolinux/isolinux.cfg ] ; then
mv boot$N/isolinux boot$N/isolinux-amd64
fi
else
ISOLINUXDIR=isolinux-"$ARCH"
fi
mkdir -p boot$N/$ISOLINUXDIR
# Isolinux setup including config and help files comes from d-i.
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/$ISOLINUXDIR/; tar zx)
if [ -e boot$N/$ISOLINUXDIR/f3.txt.withgtk ]; then
extra_image gtk/initrd.gz
mv boot$N/$ISOLINUXDIR/f3.txt.withgtk boot$N/$ISOLINUXDIR/f3.txt
mv boot$N/$ISOLINUXDIR/f4.txt.withgtk boot$N/$ISOLINUXDIR/f4.txt
mv boot$N/$ISOLINUXDIR/isolinux.cfg.withgtk boot$N/$ISOLINUXDIR/isolinux.cfg
fi
rm -f boot$N/$ISOLINUXDIR/isolinux.cfg.with* 2>/dev/null || true
sed -i "s|/install/|/$INSTALLDIR/|" boot$N/$ISOLINUXDIR/isolinux.cfg
cp -f $BASEDIR/data/$DI_CODENAME/isolinux.bin boot$N/$ISOLINUXDIR/
if [ -n "$KERNEL_PARAMS" ]; then
# Substitute custom kernel params into the isolinux config
# file.
sed -i "s|append |append $KERNEL_PARAMS |" boot$N/$ISOLINUXDIR/isolinux.cfg
fi
if [ -n "$ISOLINUX_DEFAULT" ]; then
sed -i "s/^DEFAULT .*$/DEFAULT $ISOLINUX_DEFAULT/" boot$N/$ISOLINUXDIR/isolinux.cfg
fi
# Handle merging amd64 and i386 isolinux dirs if both are present.
if [ -e boot$N/isolinux-amd64/isolinux.cfg ] && [ -e boot$N/isolinux/isolinux.cfg ]; then
for file in boot$N/isolinux/f3.txt* boot$N/isolinux/f4.txt*
do
cat $file | awk '
NR==3 { next }
NR==5 { printf " (i386 is default; prepend 'amd64-' to use an amd64 kernel instead)\n" }
/.*/ { print $0 }' > $file.tmp
mv $file.tmp $file
done
cat boot$N/isolinux-amd64/isolinux.cfg | awk '
/^[Ll][Aa][Bb][Ee][Ll]/ { printf("label amd64-%s\n", $2) }
/^[Dd][Ee][Ff][Aa][Uu][Ll][Tt]/ { printf("default64 amd64-%s\n", $2) }
/[Kk][Ee][Rr][Nn][Ee][Ll]/ { print $0 }
/[Aa][Pp][Pp][Ee][Nn][Dd]/ { print $0 }' >> boot$N/isolinux/isolinux.cfg
else
if [ "$ARCH" = amd64 ]; then
mv -f boot$N/isolinux-amd64/* boot$N/isolinux
rm -rf boot$N/isolinux-amd64
else
rm -rf boot$N/isolinux-amd64
fi
fi
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
fi
sed -i "s|built on|built $BUILD_DATE; d-i|" boot$N/isolinux/f1.txt
else
if [ -n "$THISTYPE" ]; then
echo "Using $THISTYPE boot-disks image on CD$N"
mkdir -p boot$N/boot
cp $THISTYPE/boot.img boot$N/boot/
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-b boot/boot.img"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-c boot/boot.catalog"
add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot$N"
else
mkdir boot$N
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
fi
fi
# Add autorun if we have README.html
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
rm -rf cdrom floppy
# th,th, thats all