3
# Do install stuff for amd64/mac, including making bootable CDs
4
# (UEFI support makes Macs unbootable; see
5
# https://bugs.launchpad.net/bugs/633983)
6
# Works with debian-installer
9
# $2 is the temporary CD build dir
11
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
18
if [ "$DI_WWW_HOME" = "default" ];then
19
DI_WWW_HOME="http://debian-amd64.alioth.debian.org/debian-installer/daily"
21
if [ ! "$DI_DIST" ]; then
22
export DI_DIST="$DI_CODENAME"
24
if [ -z "$DI_PATH" ]; then
25
DI_PATH="$($BASEDIR/tools/find-newest-installer)"
34
# This script is called with $1 (now $N) as the CD to
35
# make bootable. N may be in the form "n" or "n_NONUS"
36
# There may be more than 4 disks...support extras.
38
# Strip NONUS part of disk number
39
# NN will be 1...N so it can be used as an index
41
NN=`echo $N | sed -e 's/_NONUS//'`
43
if [ "$CDIMAGE_ADDON" ]; then
44
# second disk, at least in spirit
52
echo -n "-isohybrid-mbr syslinux/usr/lib/ISOLINUX/isohdpfx.bin " >> $N.mkisofs_opts
53
echo -n "-partition_offset 16 " >> $N.mkisofs_opts
54
# uncomment to add a small FAT partition on the media
55
# /sbin/mkfs.msdos -n Bla -C test.fat 8192
56
# echo -n "-append_partition 2 0x01 test.fat " >> $N.mkisofs_opts
60
# List of boot image for each CD
61
KTYPE[1]="" #isolinux multiboot in fact
63
# XXX add net-image back when it's fixed
73
THISTYPE=${KTYPE[$NN]}
75
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
77
TAR_IMAGES="netboot/netboot.tar.gz"
81
if [ "$CDIMAGE_LIVE" ]; then
92
# Download boot images
93
for image in MANIFEST.udebs $BOOT_IMAGES $DISK_IMAGES $TAR_IMAGES; do
94
if [ ! -e "$image" ]; then
97
if [ ! "$DI_WWW_HOME" ];then
98
cp "$DI_PATH/current/images/$image" "$image"
100
wget "$DI_WWW_HOME/$image" -O "$image"
105
if [ "$NN" = "1" ]; then
106
list_kernel_abis $BOOT_IMAGES | check_kernel_sync $FLAVOUR
108
echo "Using ISOLINUX boot-disks image on CD$N"
109
mkdir -p $CDDIR/../syslinux boot$N/isolinux
110
SYSLINUXDEB="$($BASEDIR/tools/apt-selection cache show syslinux-common | \
111
grep ^Filename | awk '{print $2}')"
112
(dpkg --fsys-tarfile "$MIRROR/$SYSLINUXDEB" | \
113
tar xf - -C $CDDIR/../syslinux ./usr/lib)
114
ISOLINUXDEB="$($BASEDIR/tools/apt-selection cache show isolinux | \
115
grep ^Filename | awk '{print $2}')"
116
(dpkg --fsys-tarfile "$MIRROR/$ISOLINUXDEB" | \
117
tar xf - -C $CDDIR/../syslinux ./usr/lib)
118
cp -f $CDDIR/../syslinux/usr/lib/ISOLINUX/isolinux.bin boot$N/isolinux/
119
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/vesamenu.c32 boot$N/isolinux/
120
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/ldlinux.c32 boot$N/isolinux/
121
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/libcom32.c32 boot$N/isolinux/
122
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/libutil.c32 boot$N/isolinux/
123
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/gfxboot.c32 boot$N/isolinux/
124
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/chain.c32 boot$N/isolinux/
127
if THEMEDEB="$($BASEDIR/tools/apt-selection cache show gfxboot-theme-ubuntu)"; then
128
THEMEDEB="$(echo "$THEMEDEB" | grep ^Filename | awk '{print $2}')"
129
dpkg --fsys-tarfile "$MIRROR/$THEMEDEB" | tar xf - -C . ./usr/share/gfxboot-theme-ubuntu/bootlogo.tar.gz
130
tar zxf usr/share/gfxboot-theme-ubuntu/bootlogo.tar.gz -C boot$N/isolinux
135
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
136
cp -lf cdrom/vmlinuz $CDDIR/install/
137
cp -lf cdrom/initrd.gz $CDDIR/install/
139
if [ "$CDIMAGE_LIVE" = 1 ]; then
140
mv $CDDIR/casper/filesystem.kernel-$FLAVOUR $CDDIR/casper/vmlinuz
141
CASPER_INITRD="/casper/initrd$(initrd_suffix "$CDDIR/casper/filesystem.initrd-$FLAVOUR")"
142
mv $CDDIR/casper/filesystem.initrd-$FLAVOUR "$CDDIR$CASPER_INITRD"
144
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
146
if [ -n "$THISTYPE" ]; then
147
echo "Using $THISTYPE boot-disks image on CD$N"
149
cp $THISTYPE/boot.img boot$N/boot/
150
echo -n "-cache-inodes -J -l -b boot/boot.img " >> $N.mkisofs_opts
153
echo -n "-cache-inodes -J -l " >> $N.mkisofs_opts
161
"$BASEDIR/tools/sorting_weights" "$N" boot$N/isolinux/isolinux.bin boot$N/isolinux/boot.cat
162
echo -n "-sort $(pwd)/$N.weights " >> $N.mkisofs_opts
166
#install_languages $CDDIR
168
# Only disk one gets the extra files installed
170
if [ "$NN" = "1" ]; then
174
if [ "$CDIMAGE_LIVE" = 1 ] && [ "$CDIMAGE_DVD" != 1 ]; then
176
ubuntu|ubuntu-netbook|xubuntu|ubuntukylin|kubuntu|kubuntu-plasma5|ubuntu-gnome|ubuntu-mate|ubuntu-budgie)
183
if [ -e "$BASEDIR/data/$DI_CODENAME/$PROJECT-access.pcx" ]; then
184
ACCESSPCX="$PROJECT-access.pcx"
186
ACCESSPCX=access-new.pcx
188
if [ -e "$BASEDIR/data/$DI_CODENAME/$PROJECT-blank.pcx" ]; then
189
BLANKPCX="$PROJECT-blank.pcx"
195
# populate the install directory as well
196
for disk in $DISK_IMAGES; do
198
mkdir -p $CDDIR/install/$dir
199
cp -lf $disk $CDDIR/install/$dir
202
if [ "$CDIMAGE_INSTALL" = 1 ]; then
203
for tar in $TAR_IMAGES; do
205
mkdir -p $CDDIR/install/$dir
206
tar -C $CDDIR/install/$dir -xzpf $tar
212
if [ "$CDIMAGE_INSTALL" = 1 ]; then
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/
219
# Extract memtest86+ from the archive
220
MEMTEST86DEB="$($BASEDIR/tools/apt-selection cache show memtest86+ | \
221
grep ^Filename | awk '{print $2}')"
222
dpkg --fsys-tarfile "$MIRROR/$MEMTEST86DEB" | \
223
tar xf - -C $CDDIR/install/ ./boot/memtest86+.bin
224
mv $CDDIR/install/boot/memtest86+.bin $CDDIR/install/mt86plus
225
rm -rf $CDDIR/install/boot
226
# Isolinux help files come from d-i.
227
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/isolinux/; tar zx)
228
# Override splash screen.
229
if [ "$SPLASHRLE" ] && [ -e "$SPLASHRLE" ]; then
230
cp -p "$SPLASHRLE" boot$N/isolinux/splash.rle
232
if [ "$GFXSPLASH" ] && [ -e "$GFXSPLASH" ]; then
233
cp -p "$GFXSPLASH" boot$N/isolinux/splash.pcx
235
if [ "$SPLASHPNG" ] && [ -e "$SPLASHPNG" ]; then
236
cp -p "$SPLASHPNG" boot$N/isolinux/splash.png
238
if [ "$HIDDEN_TIMEOUT" ] && [ "$ACCESSPCX" ]; then
239
cp -p "$BASEDIR/data/$DI_CODENAME/$ACCESSPCX" boot$N/isolinux/access.pcx
241
if [ "$HIDDEN_TIMEOUT" = 2 ]; then
242
cp -p "$BASEDIR/data/$DI_CODENAME/$BLANKPCX" boot$N/isolinux/blank.pcx
244
if [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
246
echo en >boot$N/isolinux/lang
247
elif [ "$PROJECT" = ubuntukylin ]; then
248
echo zh_CN >boot$N/isolinux/lang
250
# Remove elilo configuration; only for Macs.
251
rm -f boot$N/isolinux/elilo*
252
rm -f boot$N/isolinux/*.msg*
253
if [ "$CDIMAGE_INSTALL" = 1 ]; then
254
rm -f boot$N/isolinux/*.txt.live
255
rm -f boot$N/isolinux/*.hlp.live
257
for x in boot$N/isolinux/*.txt.live; do
258
[ -f "$x" ] || continue
261
for x in boot$N/isolinux/*.hlp.live; do
262
[ -f "$x" ] || continue
266
# Nuke the GTK menu items for now.
267
rm -f boot$N/isolinux/*gtk.cfg
268
rm -f boot$N/isolinux/*.txt.withgtk
269
# We only support single-architecture images.
270
sed -i 's|%install%|install|' boot$N/isolinux/*.cfg
271
mkdir -p $CDDIR/boot/grub
273
# Set up-to-date build dates. Kludgy because d-i sets its own version as
275
DI_VERSION="$(perl -lne 'if (/built on ([0-9a-z]*)/) { print $1 }' \
276
"boot$N/isolinux/f1.txt")"
277
if [ "$DI_VERSION" ]; then
278
: "${CDIMAGE_DATE:=$(date +%Y%m%d)}"
279
sed -i "s/$DI_VERSION/$CDIMAGE_DATE/g" \
280
"boot$N"/isolinux/*.txt "boot$N"/isolinux/*.hlp
283
if [ "$HIDDEN_TIMEOUT" ]; then
285
elif [ "$CDIMAGE_LIVE" = 1 ]; then
290
sed -i "s/^timeout .*/timeout $timeout/" \
291
boot$N/isolinux/isolinux.cfg boot$N/isolinux/prompt.cfg
292
# Isolinux config file.
293
if [ "$CDIMAGE_LIVE" = 1 ]; then
296
DEFAULT_LABEL=install
298
cat > boot$N/isolinux/txt.cfg <<EOF
299
default $DEFAULT_LABEL
301
> boot$N/isolinux/adtxt.cfg
302
if [ "$GFXBOOT" ]; then
303
cat >> boot$N/isolinux/isolinux.cfg <<EOF
307
if [ "$PROJECT" = ubuntu ] || [ "$PROJECT" = ubuntu-server ] || \
308
[ "$PROJECT" = ubuntu-mid ] || [ "$PROJECT" = ubuntu-netbook ] || \
309
[ "$PROJECT" = mythbuntu ] || [ "$PROJECT" = ubuntukylin ]; then
310
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
313
screen-colour=0x270A1E
316
if [ "$PROJECT" = ubuntu-budgie ]; then
317
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
320
screen-colour=0x383c4a
323
if [ "$PROJECT" = ubuntu-mate ]; then
324
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
327
screen-colour=0x3c3b37
330
if [ "$HIDDEN_TIMEOUT" ]; then
331
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
332
hidden-timeout=$HIDDEN_TIMEOUT
335
# access-options default: v1 v2 v3 brltty m1 m2
336
# d-i only supports v1 and brltty right now.
337
if [ "$CDIMAGE_LIVE" != 1 ]; then
338
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
339
access-options=v1 brltty
340
access-options-v1=access=v1 FRONTEND_BACKGROUND=dark
342
elif [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
343
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
344
access-options=v1 v2 brltty m1
346
elif [ "$PROJECT" = xubuntu ]; then
347
# v1 and m1 don't have the necessary sed calls for Xubuntu yet.
348
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
349
access-options=v2 v3 brltty m2
352
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
356
if [ "$CDIMAGE_LIVE" = 1 ]; then
357
if [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
358
livelabel="^Start $HUMANPROJECT"
359
liveparams=' maybe-ubiquity'
361
livelabel="^Try $HUMANPROJECT without installing"
364
cat >> boot$N/isolinux/txt.cfg <<EOF
366
menu label $livelabel
367
kernel /casper/vmlinuz
368
append $KERNEL_PARAMS $DEFAULT_PRESEED$liveparams initrd=$CASPER_INITRD quiet splash ---
370
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
371
menuentry "${livelabel#^}" {
373
linux /casper/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED$liveparams iso-scan/filename=\${iso_path} quiet splash ---
374
initrd $CASPER_INITRD
377
if [ "$PROJECT" != ubuntu-mid ] && [ "$PROJECT" != kubuntu ] && [ "$PROJECT" != kubuntu-plasma5 ]; then
378
cat >> boot$N/isolinux/txt.cfg <<EOF
380
menu label ^Install $HUMANPROJECT
381
kernel /casper/vmlinuz
382
append $KERNEL_PARAMS $DEFAULT_PRESEED only-ubiquity initrd=$CASPER_INITRD quiet splash ---
384
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
385
menuentry "Install $HUMANPROJECT" {
386
linux /casper/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED only-ubiquity iso-scan/filename=\${iso_path} quiet splash ---
387
initrd $CASPER_INITRD
391
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
392
label driverupdates=Use driver update disc
393
append driverupdates=debian-installer/driver-update=true
394
applies driverupdates=live live-install
397
if [ "$CDIMAGE_INSTALL" = 1 ]; then
398
if [ "$CDIMAGE_LIVE" != 1 ]; then
399
cat >> boot$N/isolinux/txt.cfg <<EOF
401
menu label ^Install $HUMANPROJECT
402
kernel /install/vmlinuz
403
append $KERNEL_PARAMS $DEFAULT_PRESEED vga=788 initrd=/install/initrd.gz quiet ---
406
cat >> boot$N/isolinux/txt.cfg <<EOF
408
menu label ^Install $HUMANPROJECT in text mode
409
kernel /install/vmlinuz
410
append $KERNEL_PARAMS $DEFAULT_PRESEED vga=788 initrd=/install/initrd.gz quiet ---
413
cat >> boot$N/isolinux/adtxt.cfg <<EOF
416
kernel /install/vmlinuz
417
append $KERNEL_PARAMS $DEFAULT_PRESEED priority=low vga=788 initrd=/install/initrd.gz ---
419
if [ "$PROJECT" = edubuntu ]; then
420
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
421
label workstation=Install a workstation
422
replace workstation=file=/cdrom/preseed/workstation.seed
423
applies workstation=install
426
if [ "$CDIMAGE_DVD" = 1 ] && [ "$PROJECT" != edubuntu ] && [ "$PROJECT" != ubuntu-server ]; then
427
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
428
label server=Install a server
429
replace server=file=/cdrom/preseed/ubuntu-server.seed
430
applies server=install
434
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
435
label oem=OEM install (for manufacturers)
436
append oem=oem-config/enable=true
438
if [ "$CDIMAGE_LIVE" = 1 ]; then
439
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
440
applies oem=live live-install install
443
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
447
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
448
if [ "$PROJECT" != ubuntu-server ]; then
449
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
450
label cli=Install a command-line system
451
replace cli=file=/cdrom/preseed/cli.seed
455
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
456
label minimal=Install a minimal system
457
replace minimal=file=/cdrom/preseed/ubuntu-server-minimal.seed
458
applies minimal=install
459
label minimalvm=Install a minimal virtual machine
460
replace minimalvm=file=/cdrom/preseed/ubuntu-server-minimalvm.seed
461
applies minimalvm=install
465
if [ "$CDIMAGE_INSTALL" = 1 ] && ([ "$PROJECT" = ubuntu ] || [ "$PROJECT" = xubuntu ] || [ "$PROJECT" = edubuntu ] || [ "$PROJECT" = ubuntu-mate ]); then
466
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
467
label ltsp=Install an LTSP server
468
replace ltsp=file=/cdrom/preseed/ltsp.seed
472
if [ "$CDIMAGE_INSTALL" = 1 ] && [ "$PROJECT" = mythbuntu ]; then
473
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
474
label ltsp=Install a Diskless Image Server
475
replace ltsp=file=/cdrom/preseed/ltsp.seed
479
if [ "$CDIMAGE_LIVE" = 1 ]; then
480
cat >> boot$N/isolinux/txt.cfg <<EOF
482
menu label ^Check disc for defects
483
kernel /casper/vmlinuz
484
append $KERNEL_PARAMS integrity-check initrd=$CASPER_INITRD quiet splash ---
486
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
487
menuentry "Check disc for defects" {
488
linux /casper/vmlinuz $KERNEL_PARAMS integrity-check iso-scan/filename=\${iso_path} quiet splash ---
489
initrd $CASPER_INITRD
492
elif [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
493
cat >> boot$N/isolinux/txt.cfg <<EOF
495
menu label ^Check disc for defects
496
kernel /install/vmlinuz
497
append $KERNEL_PARAMS $FRONTEND_BACKGROUND MENU=/bin/cdrom-checker-menu vga=788 initrd=/install/initrd.gz quiet ---
500
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
501
cat >> boot$N/isolinux/adtxt.cfg <<EOF
503
menu label ^Rescue a broken system
504
kernel /install/vmlinuz
505
append $KERNEL_PARAMS $FRONTEND_BACKGROUND rescue/enable=true vga=788 initrd=/install/initrd.gz ---
508
cat >> boot$N/isolinux/txt.cfg <<EOF
510
menu label Test ^memory
511
kernel /install/mt86plus
513
menu label ^Boot from first hard disk
516
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
517
menuentry "Test memory" {
518
linux16 /install/mt86plus
524
# write final lines to mkisofs_opts
525
if [ "$NN" = "1" ]; then
526
echo -n "boot$N " >> $N.mkisofs_opts
528
if [ -n "$THISTYPE" ]; then
529
echo -n "-c boot/boot.catalog boot$N " >> $N.mkisofs_opts
533
# Hack around the removal of support in gfxboot for reading from outside
534
# the bootlogo archive. This makes customisation harder and is not ideal.
535
tmpdir="$(mktemp -d)"
536
(cd "$tmpdir" && cpio -i) < boot$N/isolinux/bootlogo
537
cp -a boot$N/isolinux/*.fnt \
538
boot$N/isolinux/*.hlp \
539
boot$N/isolinux/*.jpg \
540
boot$N/isolinux/*.pcx \
541
boot$N/isolinux/*.tr \
542
boot$N/isolinux/*.cfg \
543
$(test -e boot$N/isolinux/lang && echo boot$N/isolinux/lang) \
544
boot$N/isolinux/langlist \
546
(cd "$tmpdir" && ls -1 | cpio --quiet -o) > boot$N/isolinux/bootlogo