1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
|
#!/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
N=$1
CDDIR=$2
BOOTDIR=
if [ "$DI_WWW_HOME" = "default" ];then
DI_WWW_HOME="http://debian-amd64.alioth.debian.org/debian-installer/daily"
fi
if [ ! "$DI_DIST" ]; then
export DI_DIST="$DI_CODENAME"
fi
if [ -z "$DI_PATH" ]; then
DI_PATH="$($BASEDIR/tools/find-newest-installer)"
fi
default_preseed
default_language
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 [ "$CDIMAGE_ADDON" ]; then
# second disk, at least in spirit
NN=2
fi
> $N.mkisofs_opts
case "$MKISOFS" in
*xorriso*)
echo -n "-isohybrid-mbr syslinux/usr/lib/ISOLINUX/isohdpfx.bin " >> $N.mkisofs_opts
# uncomment to add a small FAT partition on the media
# /sbin/mkfs.msdos -n Bla -C test.fat 8192
# echo -n "-append_partition 2 0x01 test.fat " >> $N.mkisofs_opts
;;
esac
# List of boot image for each CD
KTYPE[1]="" #isolinux multiboot in fact
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"
DISK_IMAGES=""
TAR_IMAGES="netboot/netboot.tar.gz"
case $PROJECT in
ubuntustudio)
if [ "$CDIMAGE_LIVE" ]; then
FLAVOUR=lowlatency
else
FLAVOUR=generic
fi
;;
*)
FLAVOUR=generic
;;
esac
# Download boot images
for image in MANIFEST.udebs $BOOT_IMAGES $DISK_IMAGES $TAR_IMAGES; do
if [ ! -e "$image" ]; then
dir=$(dirname $image)
mkdir -p $dir
if [ ! "$DI_WWW_HOME" ];then
cp "$DI_PATH/current/images/$image" "$image"
else
wget "$DI_WWW_HOME/$image" -O "$image"
fi
fi
done
if [ "$NN" = "1" ]; then
list_kernel_abis $BOOT_IMAGES | check_kernel_sync $FLAVOUR
echo "Using ISOLINUX boot-disks image on CD$N"
mkdir -p $CDDIR/../syslinux boot$N/isolinux
SYSLINUXDEB="$($BASEDIR/tools/apt-selection cache show syslinux-common | \
grep ^Filename | awk '{print $2}')"
(dpkg --fsys-tarfile "$MIRROR/$SYSLINUXDEB" | \
tar xf - -C $CDDIR/../syslinux ./usr/lib)
ISOLINUXDEB="$($BASEDIR/tools/apt-selection cache show isolinux | \
grep ^Filename | awk '{print $2}')"
(dpkg --fsys-tarfile "$MIRROR/$ISOLINUXDEB" | \
tar xf - -C $CDDIR/../syslinux ./usr/lib)
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/
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/gfxboot.c32 boot$N/isolinux/
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/chain.c32 boot$N/isolinux/
GFXBOOT=
if THEMEDEB="$($BASEDIR/tools/apt-selection cache show gfxboot-theme-ubuntu)"; then
THEMEDEB="$(echo "$THEMEDEB" | grep ^Filename | awk '{print $2}')"
dpkg --fsys-tarfile "$MIRROR/$THEMEDEB" | tar xf - -C . ./usr/share/gfxboot-theme-ubuntu/bootlogo.tar.gz
tar zxf usr/share/gfxboot-theme-ubuntu/bootlogo.tar.gz -C boot$N/isolinux
GFXBOOT=1
fi
rm -rf usr
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
cp -lf cdrom/vmlinuz $CDDIR/install/
cp -lf cdrom/initrd.gz $CDDIR/install/
fi
if [ "$CDIMAGE_LIVE" = 1 ]; then
if [ -e "$CDDIR/casper/filesystem.kernel-$FLAVOUR.efi.signed" ]; then
mv $CDDIR/casper/filesystem.kernel-$FLAVOUR.efi.signed $CDDIR/casper/vmlinuz.efi
rm -f $CDDIR/casper/filesystem.kernel-$FLAVOUR
CASPER_KERNEL=/casper/vmlinuz.efi
else
mv $CDDIR/casper/filesystem.kernel-$FLAVOUR $CDDIR/casper/vmlinuz
CASPER_KERNEL=/casper/vmlinuz
fi
CASPER_INITRD="/casper/initrd$(initrd_suffix "$CDDIR/casper/filesystem.initrd-$FLAVOUR")"
mv $CDDIR/casper/filesystem.initrd-$FLAVOUR "$CDDIR$CASPER_INITRD"
fi
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
case "$MKISOFS" in
*xorriso*)
echo -n "-eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -isohybrid-apm-hfsplus " >> $N.mkisofs_opts
;;
*)
echo -n "-eltorito-alt-boot -efi-boot boot/grub/efi.img -no-emul-boot " >> $N.mkisofs_opts
;;
esac
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/
echo -n "-cache-inodes -J -l -b boot/boot.img " >> $N.mkisofs_opts
else
mkdir boot$N
echo -n "-cache-inodes -J -l " >> $N.mkisofs_opts
fi
fi
case "$MKISOFS" in
*xorriso*)
;;
*)
"$BASEDIR/tools/sorting_weights" "$N" boot$N/isolinux/isolinux.bin boot$N/isolinux/boot.cat
echo -n "-sort $(pwd)/$N.weights " >> $N.mkisofs_opts
;;
esac
#install_languages $CDDIR
# Only disk one gets the extra files installed
#
if [ "$NN" = "1" ]; then
HIDDEN_TIMEOUT=
if [ "$CDIMAGE_LIVE" = 1 ] && [ "$CDIMAGE_DVD" != 1 ]; then
case $PROJECT in
ubuntu|ubuntu-netbook|xubuntu|ubuntukylin|kubuntu|kubuntu-plasma5|ubuntu-gnome|ubuntu-desktop-next|ubuntu-mate)
HIDDEN_TIMEOUT=2
;;
mythbuntu)
HIDDEN_TIMEOUT=1
;;
esac
if [ -e "$BASEDIR/data/$DI_CODENAME/$PROJECT-access.pcx" ]; then
ACCESSPCX="$PROJECT-access.pcx"
else
ACCESSPCX=access-new.pcx
fi
if [ -e "$BASEDIR/data/$DI_CODENAME/$PROJECT-blank.pcx" ]; then
BLANKPCX="$PROJECT-blank.pcx"
else
BLANKPCX=blank.pcx
fi
fi
# populate the install directory as well
for disk in $DISK_IMAGES; do
dir=$(dirname $disk)
mkdir -p $CDDIR/install/$dir
cp -lf $disk $CDDIR/install/$dir
done
if [ "$CDIMAGE_INSTALL" = 1 ]; then
for tar in $TAR_IMAGES; do
dir=$(dirname $tar)
mkdir -p $CDDIR/install/$dir
tar -C $CDDIR/install/$dir -xzpf $tar
done
fi
# ISOLINUX setup
if [ "$CDIMAGE_INSTALL" = 1 ]; then
# 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
# Extract memtest86+ from the archive
MEMTEST86DEB="$($BASEDIR/tools/apt-selection cache show memtest86+ | \
grep ^Filename | awk '{print $2}')"
dpkg --fsys-tarfile "$MIRROR/$MEMTEST86DEB" | \
tar xf - -C $CDDIR/install/ ./boot/memtest86+.bin
mv $CDDIR/install/boot/memtest86+.bin $CDDIR/install/mt86plus
rm -rf $CDDIR/install/boot
# Isolinux help files come from d-i.
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/isolinux/; tar zx)
# Override splash screen.
if [ "$SPLASHRLE" ] && [ -e "$SPLASHRLE" ]; then
cp -p "$SPLASHRLE" boot$N/isolinux/splash.rle
fi
if [ "$GFXSPLASH" ] && [ -e "$GFXSPLASH" ]; then
cp -p "$GFXSPLASH" boot$N/isolinux/splash.pcx
fi
if [ "$SPLASHPNG" ] && [ -e "$SPLASHPNG" ]; then
cp -p "$SPLASHPNG" boot$N/isolinux/splash.png
fi
if [ "$HIDDEN_TIMEOUT" ] && [ "$ACCESSPCX" ]; then
cp -p "$BASEDIR/data/$DI_CODENAME/$ACCESSPCX" boot$N/isolinux/access.pcx
fi
if [ "$HIDDEN_TIMEOUT" = 2 ]; then
cp -p "$BASEDIR/data/$DI_CODENAME/$BLANKPCX" boot$N/isolinux/blank.pcx
fi
if [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
# No language menu.
echo en >boot$N/isolinux/lang
elif [ "$PROJECT" = ubuntukylin ]; then
echo zh_CN >boot$N/isolinux/lang
fi
# Remove elilo configuration; only for Macs.
rm -f boot$N/isolinux/elilo*
rm -f boot$N/isolinux/*.msg*
if [ "$CDIMAGE_INSTALL" = 1 ]; then
rm -f boot$N/isolinux/*.txt.live
rm -f boot$N/isolinux/*.hlp.live
else
for x in boot$N/isolinux/*.txt.live; do
[ -f "$x" ] || continue
mv "$x" "${x%.live}"
done
for x in boot$N/isolinux/*.hlp.live; do
[ -f "$x" ] || continue
mv "$x" "${x%.live}"
done
fi
# Nuke the GTK menu items for now.
rm -f boot$N/isolinux/*gtk.cfg
rm -f boot$N/isolinux/*.txt.withgtk
# We only support single-architecture images.
sed -i 's|%install%|install|' boot$N/isolinux/*.cfg
# Move GRUB files to the right place.
mkdir -p $CDDIR/EFI/BOOT
mcopy -i boot$N/isolinux/grub/efi.img ::EFI/BOOT/BOOTx64.EFI $CDDIR/EFI/BOOT/BOOTx64.EFI
mcopy -i boot$N/isolinux/grub/efi.img ::EFI/BOOT/grubx64.efi $CDDIR/EFI/BOOT/grubx64.efi
mkdir -p $CDDIR/boot/grub
mv boot$N/isolinux/grub/* $CDDIR/boot/grub/
rmdir boot$N/isolinux/grub
sed -i '/^menuentry/Q' $CDDIR/boot/grub/grub.cfg
# Set up-to-date build dates. Kludgy because d-i sets its own version as
# the build date.
DI_VERSION="$(perl -lne 'if (/built on ([0-9a-z]*)/) { print $1 }' \
"boot$N/isolinux/f1.txt")"
if [ "$DI_VERSION" ]; then
: "${CDIMAGE_DATE:=$(date +%Y%m%d)}"
sed -i "s/$DI_VERSION/$CDIMAGE_DATE/g" \
"boot$N"/isolinux/*.txt "boot$N"/isolinux/*.hlp
fi
if [ "$HIDDEN_TIMEOUT" ]; then
timeout=50
elif [ "$CDIMAGE_LIVE" = 1 ]; then
timeout=300
else
timeout=0
fi
sed -i "s/^timeout .*/timeout $timeout/" \
boot$N/isolinux/isolinux.cfg boot$N/isolinux/prompt.cfg
# Isolinux config file.
if [ "$CDIMAGE_LIVE" = 1 ]; then
DEFAULT_LABEL=live
else
DEFAULT_LABEL=install
fi
cat > boot$N/isolinux/txt.cfg <<EOF
default $DEFAULT_LABEL
EOF
> boot$N/isolinux/adtxt.cfg
if [ "$GFXBOOT" ]; then
cat >> boot$N/isolinux/isolinux.cfg <<EOF
ui gfxboot bootlogo
EOF
fi
if [ "$PROJECT" = ubuntu ] || [ "$PROJECT" = ubuntu-server ] || \
[ "$PROJECT" = ubuntu-mid ] || [ "$PROJECT" = ubuntu-netbook ] || \
[ "$PROJECT" = mythbuntu ] || [ "$PROJECT" = ubuntukylin ] || \
[ "$PROJECT" = ubuntu-desktop-next ]; then
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
foreground=0xFFFFFF
background=0x958490
screen-colour=0x270A1E
EOF
fi
if [ "$PROJECT" = ubuntu-gnome ]; then
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
screen-colour=0x2D3335
EOF
fi
if [ "$PROJECT" = ubuntu-mate ]; then
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
foreground=0xffffff
background=0x87a556
screen-colour=0x3c3b37
EOF
fi
if [ "$HIDDEN_TIMEOUT" ]; then
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
hidden-timeout=$HIDDEN_TIMEOUT
EOF
fi
# access-options default: v1 v2 v3 brltty m1 m2
# d-i only supports v1 and brltty right now.
if [ "$CDIMAGE_LIVE" != 1 ]; then
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
access-options=v1 brltty
access-options-v1=access=v1 FRONTEND_BACKGROUND=dark
EOF
elif [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
access-options=v1 v2 brltty m1
EOF
elif [ "$PROJECT" = xubuntu ]; then
# v1 and m1 don't have the necessary sed calls for Xubuntu yet.
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
access-options=v2 v3 brltty m2
EOF
fi
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
label normal=Normal
append normal=
EOF
if [ "$CDIMAGE_LIVE" = 1 ]; then
if [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
livelabel="^Start $HUMANPROJECT"
liveparams=' maybe-ubiquity'
else
livelabel="^Try $HUMANPROJECT without installing"
liveparams=
fi
cat >> boot$N/isolinux/txt.cfg <<EOF
label live
menu label $livelabel
kernel $CASPER_KERNEL
append $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper$liveparams initrd=$CASPER_INITRD quiet splash ---
EOF
cat >> $CDDIR/boot/grub/grub.cfg <<EOF
menuentry "${livelabel#^}" {
set gfxpayload=keep
linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper$liveparams quiet splash ---
initrd $CASPER_INITRD
}
EOF
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
menuentry "${livelabel#^}" {
set gfxpayload=keep
linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper$liveparams iso-scan/filename=\${iso_path} quiet splash ---
initrd $CASPER_INITRD
}
EOF
if [ "$PROJECT" != ubuntu-mid ] && [ "$PROJECT" != kubuntu ] && [ "$PROJECT" != kubuntu-plasma5 ]; then
cat >> boot$N/isolinux/txt.cfg <<EOF
label live-install
menu label ^Install $HUMANPROJECT
kernel $CASPER_KERNEL
append $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper only-ubiquity initrd=$CASPER_INITRD quiet splash ---
EOF
cat >> $CDDIR/boot/grub/grub.cfg <<EOF
menuentry "Install $HUMANPROJECT" {
set gfxpayload=keep
linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper only-ubiquity quiet splash ---
initrd $CASPER_INITRD
}
EOF
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
menuentry "Install $HUMANPROJECT" {
linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper only-ubiquity iso-scan/filename=\${iso_path} quiet splash ---
initrd $CASPER_INITRD
}
EOF
fi
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
label driverupdates=Use driver update disc
append driverupdates=debian-installer/driver-update=true
applies driverupdates=live live-install
EOF
fi
if [ "$CDIMAGE_INSTALL" = 1 ]; then
if [ "$CDIMAGE_LIVE" != 1 ]; then
cat >> boot$N/isolinux/txt.cfg <<EOF
label install
menu label ^Install $HUMANPROJECT
kernel /install/vmlinuz
append $KERNEL_PARAMS $DEFAULT_PRESEED vga=788 initrd=/install/initrd.gz quiet ---
EOF
cat >> $CDDIR/boot/grub/grub.cfg <<EOF
menuentry "Install $HUMANPROJECT" {
set gfxpayload=keep
linux /install/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED quiet ---
initrd /install/initrd.gz
}
EOF
else
cat >> boot$N/isolinux/txt.cfg <<EOF
label install
menu label ^Install $HUMANPROJECT in text mode
kernel /install/vmlinuz
append $KERNEL_PARAMS $DEFAULT_PRESEED vga=788 initrd=/install/initrd.gz quiet ---
EOF
cat >> $CDDIR/boot/grub/grub.cfg <<EOF
menuentry "Install $HUMANPROJECT in text mode" {
set gfxpayload=keep
linux /install/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED quiet ---
initrd /install/initrd.gz
}
EOF
fi
cat >> boot$N/isolinux/adtxt.cfg <<EOF
label expert
menu hide
kernel /install/vmlinuz
append $KERNEL_PARAMS $DEFAULT_PRESEED priority=low vga=788 initrd=/install/initrd.gz ---
EOF
if [ "$PROJECT" = edubuntu ]; then
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
label workstation=Install a workstation
replace workstation=file=/cdrom/preseed/workstation.seed
applies workstation=install
EOF
fi
if [ "$CDIMAGE_DVD" = 1 ] && [ "$PROJECT" != edubuntu ] && [ "$PROJECT" != ubuntu-server ]; then
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
label server=Install a server
replace server=file=/cdrom/preseed/ubuntu-server.seed
applies server=install
EOF
fi
fi
# The GRUB versions of this only correspond to single isolinux labels,
# because we don't yet have the necessary technology in our GRUB menu stack
# to have a two-dimensional set of boot options, as is implemented for
# isolinux using the gfxboot "applies" keyword.
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
label oem=OEM install (for manufacturers)
append oem=oem-config/enable=true
EOF
if [ "$CDIMAGE_LIVE" = 1 ]; then
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
applies oem=live live-install install
EOF
cat >> $CDDIR/boot/grub/grub.cfg <<EOF
menuentry "OEM install (for manufacturers)" {
set gfxpayload=keep
linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper only-ubiquity quiet splash oem-config/enable=true ---
initrd $CASPER_INITRD
}
EOF
else
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
applies oem=install
EOF
cat >> $CDDIR/boot/grub/grub.cfg <<EOF
menuentry "OEM install (for manufacturers)" {
set gfxpayload=keep
linux /install/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED quiet oem-config/enable=true ---
initrd /install/initrd.gz
}
EOF
fi
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
if [ "$PROJECT" != ubuntu-server ]; then
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
label cli=Install a command-line system
replace cli=file=/cdrom/preseed/cli.seed
applies cli=install
EOF
else
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
label minimal=Install a minimal system
replace minimal=file=/cdrom/preseed/ubuntu-server-minimal.seed
applies minimal=install
label minimalvm=Install a minimal virtual machine
replace minimalvm=file=/cdrom/preseed/ubuntu-server-minimalvm.seed
applies minimalvm=install
EOF
# This really ought to be in gfxboot.cfg instead, but we want to
# make it particularly prominent.
cat >> boot$N/isolinux/txt.cfg <<EOF
label cloud
menu label ^Multiple server install with MAAS
kernel /install/vmlinuz
append $KERNEL_PARAMS $FRONTEND_BACKGROUND modules=maas-enlist-udeb vga=788 initrd=/install/initrd.gz quiet ---
EOF
cat >> $CDDIR/boot/grub/grub.cfg <<EOF
menuentry "Multiple server install with MAAS" {
set gfxpayload=keep
linux /install/vmlinuz $KERNEL_PARAMS modules=maas-enlist-udeb vga=788 initrd=/install/initrd.gz quiet ---
initrd /install/initrd.gz
}
EOF
fi
fi
if [ "$CDIMAGE_INSTALL" = 1 ] && ([ "$PROJECT" = ubuntu ] || [ "$PROJECT" = xubuntu ] || [ "$PROJECT" = edubuntu ] || [ "$PROJECT" = ubuntu-mate ]); then
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
label ltsp=Install an LTSP server
replace ltsp=file=/cdrom/preseed/ltsp.seed
applies ltsp=install
EOF
fi
if [ "$CDIMAGE_INSTALL" = 1 ] && [ "$PROJECT" = mythbuntu ]; then
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
label ltsp=Install a Diskless Image Server
replace ltsp=file=/cdrom/preseed/ltsp.seed
applies ltsp=install
EOF
fi
if [ "$CDIMAGE_LIVE" = 1 ]; then
cat >> boot$N/isolinux/txt.cfg <<EOF
label check
menu label ^Check disc for defects
kernel $CASPER_KERNEL
append $KERNEL_PARAMS boot=casper integrity-check initrd=$CASPER_INITRD quiet splash ---
EOF
cat >> $CDDIR/boot/grub/grub.cfg <<EOF
menuentry "Check disc for defects" {
set gfxpayload=keep
linux $CASPER_KERNEL $KERNEL_PARAMS boot=casper integrity-check quiet splash ---
initrd $CASPER_INITRD
}
EOF
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
menuentry "Check disc for defects" {
linux $CASPER_KERNEL $KERNEL_PARAMS boot=casper integrity-check iso-scan/filename=\${iso_path} quiet splash ---
initrd $CASPER_INITRD
}
EOF
elif [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
cat >> boot$N/isolinux/txt.cfg <<EOF
label check
menu label ^Check disc for defects
kernel /install/vmlinuz
append $KERNEL_PARAMS $FRONTEND_BACKGROUND MENU=/bin/cdrom-checker-menu vga=788 initrd=/install/initrd.gz quiet ---
EOF
cat >> $CDDIR/boot/grub/grub.cfg <<EOF
menuentry "Check disc for defects" {
set gfxpayload=keep
linux /install/vmlinuz $KERNEL_PARAMS MENU=/bin/cdrom-checker-menu quiet ---
initrd /install/initrd.gz
}
EOF
fi
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
cat >> boot$N/isolinux/adtxt.cfg <<EOF
label rescue
menu label ^Rescue a broken system
kernel /install/vmlinuz
append $KERNEL_PARAMS $FRONTEND_BACKGROUND rescue/enable=true vga=788 initrd=/install/initrd.gz ---
EOF
cat >> $CDDIR/boot/grub/grub.cfg <<EOF
menuentry "Rescue a broken system" {
set gfxpayload=keep
linux /install/vmlinuz $KERNEL_PARAMS rescue/enable=true ---
initrd /install/initrd.gz
}
EOF
fi
cat >> boot$N/isolinux/txt.cfg <<EOF
label memtest
menu label Test ^memory
kernel /install/mt86plus
label hd
menu label ^Boot from first hard disk
localboot 0x80
EOF
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
menuentry "Test memory" {
linux16 /install/mt86plus
}
EOF
fi
# write final lines to mkisofs_opts
if [ "$NN" = "1" ]; then
echo -n "boot$N " >> $N.mkisofs_opts
else
if [ -n "$THISTYPE" ]; then
echo -n "-c boot/boot.catalog boot$N " >> $N.mkisofs_opts
fi
fi
# Hack around the removal of support in gfxboot for reading from outside
# the bootlogo archive. This makes customisation harder and is not ideal.
tmpdir="$(mktemp -d)"
(cd "$tmpdir" && cpio -i) < boot$N/isolinux/bootlogo
cp -a boot$N/isolinux/*.fnt \
boot$N/isolinux/*.hlp \
boot$N/isolinux/*.jpg \
boot$N/isolinux/*.pcx \
boot$N/isolinux/*.tr \
boot$N/isolinux/*.cfg \
$(test -e boot$N/isolinux/lang && echo boot$N/isolinux/lang) \
boot$N/isolinux/langlist \
"$tmpdir/"
(cd "$tmpdir" && ls -1 | cpio --quiet -o) > boot$N/isolinux/bootlogo
rm -rf "$tmpdir"
# th,th, thats all
|