3
# Do install stuff for i386/mac, including making bootable CDs
4
# Works with debian-installer
7
# $2 is the temporary CD build dir
9
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
16
if [ "$DI_WWW_HOME" = "default" ];then
17
DI_WWW_HOME="http://people.debian.org/~joeyh/d-i/images/daily"
19
if [ ! "$DI_DIST" ]; then
20
export DI_DIST="$DI_CODENAME"
22
if [ -z "$DI_PATH" ]; then
23
DI_PATH="$($BASEDIR/tools/find-newest-installer)"
31
# This script is called with $1 (now $N) as the CD to
32
# make bootable. N may be in the form "n" or "n_NONUS"
33
# There may be more than 4 disks...support extras.
35
# Strip NONUS part of disk number
36
# NN will be 1...N so it can be used as an index
38
NN=`echo $N | sed -e 's/_NONUS//'`
44
echo -n "-isohybrid-mbr syslinux/usr/lib/ISOLINUX/isohdpfx.bin " >> $N.mkisofs_opts
45
echo -n "-partition_offset 16 " >> $N.mkisofs_opts
46
# uncomment to add a small FAT partition on the media
47
# /sbin/mkfs.msdos -n Bla -C test.fat 8192
48
# echo -n "-append_partition 2 0x01 test.fat " >> $N.mkisofs_opts
52
# List of boot image for each CD
53
KTYPE[1]="" #elilo multiboot in fact
55
# XXX add net-image back when it's fixed
65
THISTYPE=${KTYPE[$NN]}
67
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
69
TAR_IMAGES="netboot/netboot.tar.gz"
71
# Download boot images
72
for image in MANIFEST.udebs $BOOT_IMAGES $DISK_IMAGES $TAR_IMAGES; do
73
if [ ! -e "$image" ]; then
76
if [ ! "$DI_WWW_HOME" ];then
77
cp "$DI_PATH/current/images/$image" "$image"
79
wget "$DI_WWW_HOME/$image" -O "$image"
84
if [ "$NN" = "1" ]; then
85
list_kernel_abis $BOOT_IMAGES | check_kernel_sync
87
mkdir -p $CDDIR/../syslinux
88
SYSLINUXDEB="$($BASEDIR/tools/apt-selection cache show syslinux-common | \
89
grep ^Filename | awk '{print $2}')"
90
(dpkg --fsys-tarfile "$MIRROR/$SYSLINUXDEB" | \
91
tar xf - -C $CDDIR/../syslinux ./usr/lib)
92
ISOLINUXDEB="$($BASEDIR/tools/apt-selection cache show isolinux | \
93
grep ^Filename | awk '{print $2}')"
94
(dpkg --fsys-tarfile "$MIRROR/$ISOLINUXDEB" | \
95
tar xf - -C $CDDIR/../syslinux ./usr/lib)
97
echo "Using elilo boot-disks image on CD$N"
98
mkdir -p boot$N/install
99
ELILODEB="$($BASEDIR/tools/apt-selection cache show elilo | \
100
grep ^Filename | awk '{print $2}')"
101
(dpkg --fsys-tarfile "$MIRROR/$ELILODEB" | \
102
tar xf - -C . ./usr/lib/elilo/elilo.efi)
103
mv usr/lib/elilo/elilo.efi boot$N/install/
106
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
107
cp -lf cdrom/vmlinuz $CDDIR/install/
108
cp -lf cdrom/initrd.gz $CDDIR/install/
110
if [ "$CDIMAGE_LIVE" = 1 ]; then
111
mv $CDDIR/casper/filesystem.kernel-386 $CDDIR/casper/vmlinuz
112
CASPER_INITRD="/casper/initrd$(initrd_suffix "$CDDIR/casper/filesystem.initrd-386")"
113
mv $CDDIR/casper/filesystem.initrd-386 "$CDDIR$CASPER_INITRD"
115
echo -n "-cache-inodes -J -l " >> $N.mkisofs_opts
116
# HFS hybrid filesystem for booting on Intel-based Macs
117
echo -n "--netatalk -hfs -probe -map $BASEDIR/data/hfs.map " >> $N.mkisofs_opts
118
echo -n "-part -no-desktop -hfs-bless CD$N/install -hfs-bless-file CD$N/install/elilo.efi -hfs-volid ${CAPPROJECT}_i386_${CODENAME} " >> $N.mkisofs_opts
119
# Recommended size for an HFS catalog is 4 MB per GB, defaults to 4 MB
120
if [ "$SIZELIMIT1" ]; then
121
if [ "$SIZELIMIT1" -gt 1000000000 ]; then
122
echo -n "-hfs-parms MAX_XTCSIZE=$(($SIZELIMIT1 / 256)) " >> $N.mkisofs_opts
124
elif [ "$SIZELIMIT" ]; then
125
if [ "$SIZELIMIT" -gt 1000000000 ]; then
126
echo -n "-hfs-parms MAX_XTCSIZE=$(($SIZELIMIT / 256)) " >> $N.mkisofs_opts
128
elif [ "$DEFBINSIZE" ]; then
129
if [ "$DEFBINSIZE" -gt 1000 ]; then
130
echo -n "-hfs-parms MAX_XTCSIZE=$(($DEFBINSIZE * 4096)) " >> $N.mkisofs_opts
139
"$BASEDIR/tools/sorting_weights" "$N"
140
echo -n "-sort $(pwd)/$N.weights " >> $N.mkisofs_opts
144
#install_languages $CDDIR
146
# Only disk one gets the extra files installed
148
if [ "$NN" = "1" ]; then
151
# populate the install directory as well
152
for disk in $DISK_IMAGES; do
154
mkdir -p $CDDIR/install/$dir
155
cp -lf $disk $CDDIR/install/$dir
158
if [ "$CDIMAGE_INSTALL" = 1 ]; then
159
for tar in $TAR_IMAGES; do
161
mkdir -p $CDDIR/install/$dir
162
tar -C $CDDIR/install/$dir -xzpf $tar
168
# Extract memtest86+ from the archive
169
MEMTEST86DEB="$($BASEDIR/tools/apt-selection cache show memtest86+ | \
170
grep ^Filename | awk '{print $2}')"
171
dpkg --fsys-tarfile "$MIRROR/$MEMTEST86DEB" | \
172
tar xf - -C $CDDIR/install/ ./boot/memtest86+.bin
173
mv $CDDIR/install/boot/memtest86+.bin $CDDIR/install/mt86plus
174
rm -rf $CDDIR/install/boot
175
# elilo help files come from d-i.
176
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/install/; tar zx)
177
# Remove ISOLINUX configuration; only for non-Macs.
178
rm -f boot$N/install/isolinux*
179
rm -f boot$N/install/*.txt*
180
rm -f boot$N/install/*.hlp*
181
# Override splash screen.
182
if [ "$SPLASHRLE" ] && [ -e "$SPLASHRLE" ]; then
183
cp -p "$SPLASHRLE" boot$N/install/splash.rle
185
if [ "$GFXSPLASH" ] && [ -e "$GFXSPLASH" ]; then
186
cp -p "$GFXSPLASH" boot$N/install/splash.pcx
188
if [ "$CDIMAGE_INSTALL" = 1 ]; then
189
rm -f boot$N/install/*.msg.live
191
for x in boot$N/install/*.msg.live; do
192
[ -f "$x" ] || continue
195
for x in boot$N/install/*.msg.live; do
196
[ -f "$x" ] || continue
203
# write final lines to mkisofs_opts
204
if [ "$NN" = "1" ]; then
205
echo -n "boot$N " >> $N.mkisofs_opts
207
if [ -n "$THISTYPE" ]; then
208
echo -n "-c boot/boot.catalog boot$N " >> $N.mkisofs_opts