3
# Do install stuff for i386, 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)"
32
# This script is called with $1 (now $N) as the CD to
33
# make bootable. N may be in the form "n" or "n_NONUS"
34
# There may be more than 4 disks...support extras.
36
# Strip NONUS part of disk number
37
# NN will be 1...N so it can be used as an index
39
NN=`echo $N | sed -e 's/_NONUS//'`
41
if [ "$CDIMAGE_ADDON" ]; then
42
# second disk, at least in spirit
50
echo -n "-isohybrid-mbr syslinux/usr/lib/ISOLINUX/isohdpfx.bin " >> $N.mkisofs_opts
51
echo -n "-partition_offset 16 " >> $N.mkisofs_opts
52
# uncomment to add a small FAT partition on the media
53
# /sbin/mkfs.msdos -n Bla -C test.fat 8192
54
# echo -n "-append_partition 2 0x01 test.fat " >> $N.mkisofs_opts
58
# List of boot image for each CD
59
KTYPE[1]="" #isolinux multiboot in fact
61
# XXX add net-image back when it's fixed
71
THISTYPE=${KTYPE[$NN]}
73
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
75
TAR_IMAGES="netboot/netboot.tar.gz"
82
if [ "$CDIMAGE_LIVE" ]; then
93
# Download boot images
94
for image in MANIFEST.udebs $BOOT_IMAGES $DISK_IMAGES $TAR_IMAGES; do
95
if [ ! -e "$image" ]; then
98
if [ ! "$DI_WWW_HOME" ];then
99
cp "$DI_PATH/current/images/$image" "$image"
101
wget "$DI_WWW_HOME/$image" -O "$image"
106
if [ "$NN" = "1" ]; then
107
list_kernel_abis $BOOT_IMAGES | check_kernel_sync $FLAVOUR
109
echo "Using ISOLINUX boot-disks image on CD$N"
110
mkdir -p $CDDIR/../syslinux boot$N/isolinux
111
SYSLINUXDEB="$($BASEDIR/tools/apt-selection cache show syslinux-common | \
112
grep ^Filename | awk '{print $2}')"
113
(dpkg --fsys-tarfile "$MIRROR/$SYSLINUXDEB" | \
114
tar xf - -C $CDDIR/../syslinux ./usr/lib)
115
ISOLINUXDEB="$($BASEDIR/tools/apt-selection cache show isolinux | \
116
grep ^Filename | awk '{print $2}')"
117
(dpkg --fsys-tarfile "$MIRROR/$ISOLINUXDEB" | \
118
tar xf - -C $CDDIR/../syslinux ./usr/lib)
119
cp -f $CDDIR/../syslinux/usr/lib/ISOLINUX/isolinux.bin boot$N/isolinux/
120
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/vesamenu.c32 boot$N/isolinux/
121
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/ldlinux.c32 boot$N/isolinux/
122
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/libcom32.c32 boot$N/isolinux/
123
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/libutil.c32 boot$N/isolinux/
124
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/gfxboot.c32 boot$N/isolinux/
125
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/chain.c32 boot$N/isolinux/
128
if THEMEDEB="$($BASEDIR/tools/apt-selection cache show gfxboot-theme-ubuntu)"; then
129
THEMEDEB="$(echo "$THEMEDEB" | grep ^Filename | awk '{print $2}')"
130
dpkg --fsys-tarfile "$MIRROR/$THEMEDEB" | tar xf - -C . ./usr/share/gfxboot-theme-ubuntu/bootlogo.tar.gz
131
tar zxf usr/share/gfxboot-theme-ubuntu/bootlogo.tar.gz -C boot$N/isolinux
136
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
137
cp -lf cdrom/vmlinuz $CDDIR/install/
138
cp -lf cdrom/initrd.gz $CDDIR/install/
140
if [ "$CDIMAGE_LIVE" = 1 ]; then
141
mv $CDDIR/casper/filesystem.kernel-$FLAVOUR $CDDIR/casper/vmlinuz
142
CASPER_INITRD="/casper/initrd$(initrd_suffix "$CDDIR/casper/filesystem.initrd-$FLAVOUR")"
143
mv $CDDIR/casper/filesystem.initrd-$FLAVOUR "$CDDIR$CASPER_INITRD"
145
echo -n "-cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table " >> $N.mkisofs_opts
147
if [ -n "$THISTYPE" ]; then
148
echo "Using $THISTYPE boot-disks image on CD$N"
150
cp $THISTYPE/boot.img boot$N/boot/
151
echo -n "-cache-inodes -J -l -b boot/boot.img " >> $N.mkisofs_opts
154
echo -n "-cache-inodes -J -l " >> $N.mkisofs_opts
162
"$BASEDIR/tools/sorting_weights" "$N" boot$N/isolinux/isolinux.bin boot$N/isolinux/boot.cat
163
echo -n "-sort $(pwd)/$N.weights " >> $N.mkisofs_opts
167
#install_languages $CDDIR
169
# Only disk one gets the extra files installed
171
if [ "$NN" = "1" ]; then
175
if [ "$CDIMAGE_LIVE" = 1 ] && [ "$CDIMAGE_DVD" != 1 ]; then
177
ubuntu|ubuntu-netbook|xubuntu|ubuntukylin|kubuntu|kubuntu-plasma5|ubuntu-gnome|ubuntu-desktop-next|ubuntu-mate)
184
if [ -e "$BASEDIR/data/$DI_CODENAME/$PROJECT-access.pcx" ]; then
185
ACCESSPCX="$PROJECT-access.pcx"
187
ACCESSPCX=access-new.pcx
189
if [ -e "$BASEDIR/data/$DI_CODENAME/$PROJECT-blank.pcx" ]; then
190
BLANKPCX="$PROJECT-blank.pcx"
196
# populate the install directory as well
197
for disk in $DISK_IMAGES; do
199
mkdir -p $CDDIR/install/$dir
200
cp -lf $disk $CDDIR/install/$dir
203
if [ "$CDIMAGE_INSTALL" = 1 ]; then
204
for tar in $TAR_IMAGES; do
206
mkdir -p $CDDIR/install/$dir
207
tar -C $CDDIR/install/$dir -xzpf $tar
213
# Include Smart Boot Manager image for people where isolinux fails
214
gzip -dc $BASEDIR/data/$DI_CODENAME/sbm.bin.gz > $CDDIR/install/sbm.bin
215
# Keep the original file timestamp
216
touch -r $BASEDIR/data/$DI_CODENAME/sbm.bin.gz $CDDIR/install/sbm.bin
217
cp -p $BASEDIR/data/$DI_CODENAME/README.sbm $CDDIR/install/
218
# Extract memtest86+ from the archive
219
MEMTEST86DEB="$($BASEDIR/tools/apt-selection cache show memtest86+ | \
220
grep ^Filename | awk '{print $2}')"
221
dpkg --fsys-tarfile "$MIRROR/$MEMTEST86DEB" | \
222
tar xf - -C $CDDIR/install/ ./boot/memtest86+.bin
223
mv $CDDIR/install/boot/memtest86+.bin $CDDIR/install/mt86plus
224
rm -rf $CDDIR/install/boot
225
# Isolinux help files come from d-i.
226
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/isolinux/; tar zx)
227
# Override splash screen.
228
if [ "$SPLASHRLE" ] && [ -e "$SPLASHRLE" ]; then
229
cp -p "$SPLASHRLE" boot$N/isolinux/splash.rle
231
if [ "$GFXSPLASH" ] && [ -e "$GFXSPLASH" ]; then
232
cp -p "$GFXSPLASH" boot$N/isolinux/splash.pcx
234
if [ "$SPLASHPNG" ] && [ -e "$SPLASHPNG" ]; then
235
cp -p "$SPLASHPNG" boot$N/isolinux/splash.png
237
if [ "$HIDDEN_TIMEOUT" ] && [ "$ACCESSPCX" ]; then
238
cp -p "$BASEDIR/data/$DI_CODENAME/$ACCESSPCX" boot$N/isolinux/access.pcx
240
if [ "$HIDDEN_TIMEOUT" = 2 ]; then
241
cp -p "$BASEDIR/data/$DI_CODENAME/$BLANKPCX" boot$N/isolinux/blank.pcx
243
if [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
245
echo en >boot$N/isolinux/lang
246
elif [ "$PROJECT" = ubuntukylin ]; then
247
echo zh_CN >boot$N/isolinux/lang
249
# Remove elilo configuration; only for Macs.
250
rm -f boot$N/isolinux/elilo*
251
rm -f boot$N/isolinux/*.msg*
252
if [ "$CDIMAGE_INSTALL" = 1 ]; then
253
rm -f boot$N/isolinux/*.txt.live
254
rm -f boot$N/isolinux/*.hlp.live
256
for x in boot$N/isolinux/*.txt.live; do
257
[ -f "$x" ] || continue
260
for x in boot$N/isolinux/*.hlp.live; do
261
[ -f "$x" ] || continue
265
# Nuke the GTK menu items for now.
266
rm -f boot$N/isolinux/*gtk.cfg
267
rm -f boot$N/isolinux/*.txt.withgtk
268
# We only support single-architecture images.
269
sed -i 's|%install%|install|' boot$N/isolinux/*.cfg
270
mkdir -p $CDDIR/boot/grub
272
# Set up-to-date build dates. Kludgy because d-i sets its own version as
274
DI_VERSION="$(perl -lne 'if (/built on ([0-9a-z]*)/) { print $1 }' \
275
"boot$N/isolinux/f1.txt")"
276
if [ "$DI_VERSION" ]; then
277
: "${CDIMAGE_DATE:=$(date +%Y%m%d)}"
278
sed -i "s/$DI_VERSION/$CDIMAGE_DATE/g" \
279
"boot$N"/isolinux/*.txt "boot$N"/isolinux/*.hlp
282
if [ "$HIDDEN_TIMEOUT" ]; then
284
elif [ "$CDIMAGE_LIVE" = 1 ]; then
289
sed -i "s/^timeout .*/timeout $timeout/" \
290
boot$N/isolinux/isolinux.cfg boot$N/isolinux/prompt.cfg
291
# Isolinux config file.
292
if [ "$CDIMAGE_LIVE" = 1 ]; then
295
DEFAULT_LABEL=install
297
cat > boot$N/isolinux/txt.cfg <<EOF
298
default $DEFAULT_LABEL
300
> boot$N/isolinux/adtxt.cfg
301
if [ "$GFXBOOT" ]; then
302
cat >> boot$N/isolinux/isolinux.cfg <<EOF
306
if [ "$PROJECT" = ubuntu ] || [ "$PROJECT" = ubuntu-server ] || \
307
[ "$PROJECT" = ubuntu-mid ] || [ "$PROJECT" = ubuntu-netbook ] || \
308
[ "$PROJECT" = mythbuntu ] || [ "$PROJECT" = ubuntukylin ] || \
309
[ "$PROJECT" = ubuntu-desktop-next ]; then
310
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
313
screen-colour=0x270A1E
316
if [ "$PROJECT" = ubuntu-gnome ]; then
317
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
318
screen-colour=0x2D3335
321
if [ "$PROJECT" = ubuntu-mate ]; then
322
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
325
screen-colour=0x3c3b37
328
if [ "$HIDDEN_TIMEOUT" ]; then
329
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
330
hidden-timeout=$HIDDEN_TIMEOUT
333
# access-options default: v1 v2 v3 brltty m1 m2
334
# d-i only supports v1 and brltty right now.
335
if [ "$CDIMAGE_LIVE" != 1 ]; then
336
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
337
access-options=v1 brltty
338
access-options-v1=access=v1 FRONTEND_BACKGROUND=dark
340
elif [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
341
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
342
access-options=v1 v2 brltty m1
344
elif [ "$PROJECT" = xubuntu ]; then
345
# v1 and m1 don't have the necessary sed calls for Xubuntu yet.
346
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
347
access-options=v2 v3 brltty m2
350
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
354
if [ "$CDIMAGE_LIVE" = 1 ]; then
355
if [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
356
livelabel="^Start $HUMANPROJECT"
357
liveparams=' maybe-ubiquity'
359
livelabel="^Try $HUMANPROJECT without installing"
362
cat >> boot$N/isolinux/txt.cfg <<EOF
364
menu label $livelabel
365
kernel /casper/vmlinuz
366
append $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper$liveparams initrd=$CASPER_INITRD quiet splash ---
368
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
369
menuentry "${livelabel#^}" {
370
linux /casper/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper$liveparams iso-scan/filename=\${iso_path} quiet splash ---
371
initrd $CASPER_INITRD
374
if [ "$PROJECT" != ubuntu-mid ] && [ "$PROJECT" != kubuntu ] && [ "$PROJECT" != kubuntu-plasma5 ]; then
375
cat >> boot$N/isolinux/txt.cfg <<EOF
377
menu label ^Install $HUMANPROJECT
378
kernel /casper/vmlinuz
379
append $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper only-ubiquity initrd=$CASPER_INITRD quiet splash ---
381
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
382
menuentry "Install $HUMANPROJECT" {
383
linux /casper/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper only-ubiquity iso-scan/filename=\${iso_path} quiet splash ---
384
initrd $CASPER_INITRD
388
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
389
label driverupdates=Use driver update disc
390
append driverupdates=debian-installer/driver-update=true
391
applies driverupdates=live live-install
394
if [ "$CDIMAGE_INSTALL" = 1 ]; then
395
if [ "$CDIMAGE_LIVE" != 1 ]; then
396
cat >> boot$N/isolinux/txt.cfg <<EOF
398
menu label ^Install $HUMANPROJECT
399
kernel /install/vmlinuz
400
append $KERNEL_PARAMS $DEFAULT_PRESEED vga=788 initrd=/install/initrd.gz quiet ---
403
cat >> boot$N/isolinux/txt.cfg <<EOF
405
menu label ^Install $HUMANPROJECT in text mode
406
kernel /install/vmlinuz
407
append $KERNEL_PARAMS $DEFAULT_PRESEED vga=788 initrd=/install/initrd.gz quiet ---
410
cat >> boot$N/isolinux/adtxt.cfg <<EOF
413
kernel /install/vmlinuz
414
append $KERNEL_PARAMS $DEFAULT_PRESEED priority=low vga=788 initrd=/install/initrd.gz ---
416
if [ "$PROJECT" = edubuntu ]; then
417
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
418
label workstation=Install a workstation
419
replace workstation=file=/cdrom/preseed/workstation.seed
420
applies workstation=install
423
if [ "$CDIMAGE_DVD" = 1 ] && [ "$PROJECT" != edubuntu ] && [ "$PROJECT" != ubuntu-server ]; then
424
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
425
label server=Install a server
426
replace server=file=/cdrom/preseed/ubuntu-server.seed
427
applies server=install
431
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
432
label oem=OEM install (for manufacturers)
433
append oem=oem-config/enable=true
435
if [ "$CDIMAGE_LIVE" = 1 ]; then
436
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
437
applies oem=live live-install install
440
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
444
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
445
if [ "$PROJECT" != ubuntu-server ]; then
446
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
447
label cli=Install a command-line system
448
replace cli=file=/cdrom/preseed/cli.seed
452
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
453
label minimal=Install a minimal system
454
replace minimal=file=/cdrom/preseed/ubuntu-server-minimal.seed
455
applies minimal=install
456
label minimalvm=Install a minimal virtual machine
457
replace minimalvm=file=/cdrom/preseed/ubuntu-server-minimalvm.seed
458
applies minimalvm=install
460
# This really ought to be in gfxboot.cfg instead, but we want to
461
# make it particularly prominent.
462
cat >> boot$N/isolinux/txt.cfg <<EOF
464
menu label ^Multiple server install with MAAS
465
kernel /install/vmlinuz
466
append $KERNEL_PARAMS $FRONTEND_BACKGROUND modules=maas-enlist-udeb vga=788 initrd=/install/initrd.gz quiet ---
470
if [ "$CDIMAGE_INSTALL" = 1 ] && ([ "$PROJECT" = ubuntu ] || [ "$PROJECT" = xubuntu ] || [ "$PROJECT" = edubuntu ] || [ "$PROJECT" = ubuntu-mate ]); then
471
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
472
label ltsp=Install an LTSP server
473
replace ltsp=file=/cdrom/preseed/ltsp.seed
477
if [ "$CDIMAGE_INSTALL" = 1 ] && [ "$PROJECT" = mythbuntu ]; then
478
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
479
label ltsp=Install a Diskless Image Server
480
replace ltsp=file=/cdrom/preseed/ltsp.seed
484
if [ "$CDIMAGE_LIVE" = 1 ]; then
485
cat >> boot$N/isolinux/txt.cfg <<EOF
487
menu label ^Check disc for defects
488
kernel /casper/vmlinuz
489
append $KERNEL_PARAMS boot=casper integrity-check initrd=$CASPER_INITRD quiet splash ---
491
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
492
menuentry "Check disc for defects" {
493
linux /casper/vmlinuz $KERNEL_PARAMS boot=casper integrity-check iso-scan/filename=\${iso_path} quiet splash ---
494
initrd $CASPER_INITRD
497
elif [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
498
cat >> boot$N/isolinux/txt.cfg <<EOF
500
menu label ^Check disc for defects
501
kernel /install/vmlinuz
502
append $KERNEL_PARAMS $FRONTEND_BACKGROUND MENU=/bin/cdrom-checker-menu vga=788 initrd=/install/initrd.gz quiet ---
505
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
506
cat >> boot$N/isolinux/adtxt.cfg <<EOF
508
menu label ^Rescue a broken system
509
kernel /install/vmlinuz
510
append $KERNEL_PARAMS $FRONTEND_BACKGROUND rescue/enable=true vga=788 initrd=/install/initrd.gz ---
513
cat >> boot$N/isolinux/txt.cfg <<EOF
515
menu label Test ^memory
516
kernel /install/mt86plus
518
menu label ^Boot from first hard disk
521
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
522
menuentry "Test memory" {
523
linux16 /install/mt86plus
529
# write final lines to mkisofs_opts
530
if [ "$NN" = "1" ]; then
531
echo -n "boot$N " >> $N.mkisofs_opts
533
if [ -n "$THISTYPE" ]; then
534
echo -n "-c boot/boot.catalog boot$N " >> $N.mkisofs_opts
538
if [ "$IMAGE_FORMAT" = "vfat" ]; then
539
mv boot$N/isolinux boot$N/syslinux
540
mv boot$N/syslinux/isolinux.cfg boot$N/syslinux/syslinux.cfg
543
# Hack around the removal of support in gfxboot for reading from outside
544
# the bootlogo archive. This makes customisation harder and is not ideal.
545
tmpdir="$(mktemp -d)"
546
if [ "$IMAGE_FORMAT" = "vfat" ]; then
547
SYSLINUX_NAME=syslinux
549
SYSLINUX_NAME=isolinux
551
(cd "$tmpdir" && cpio -i) < boot$N/$SYSLINUX_NAME/bootlogo
552
cp -a boot$N/$SYSLINUX_NAME/*.fnt \
553
boot$N/$SYSLINUX_NAME/*.hlp \
554
boot$N/$SYSLINUX_NAME/*.jpg \
555
boot$N/$SYSLINUX_NAME/*.pcx \
556
boot$N/$SYSLINUX_NAME/*.tr \
557
boot$N/$SYSLINUX_NAME/*.cfg \
558
$(test -e boot$N/$SYSLINUX_NAME/lang && echo boot$N/$SYSLINUX_NAME/lang) \
559
boot$N/$SYSLINUX_NAME/langlist \
561
(cd "$tmpdir" && ls -1 | cpio --quiet -o) > boot$N/$SYSLINUX_NAME/bootlogo