~tsimonq2/debian-cd/lubuntu-cosmic-changes

« back to all changes in this revision

Viewing changes to tools/boot/yakkety/boot-i386

  • Committer: Adam Conrad
  • Date: 2016-04-22 11:40:33 UTC
  • Revision ID: adconrad@0c3.net-20160422114033-vom9id9ph274tf6b
Copy xenial -> yakkety, and add yakkety to CONF.sh

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
3
# Do install stuff for i386, including making bootable CDs
 
4
# Works with debian-installer
 
5
#
 
6
# $1 is the CD number
 
7
# $2 is the temporary CD build dir
 
8
 
 
9
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
 
10
 
 
11
set -e
 
12
 
 
13
N=$1
 
14
CDDIR=$2
 
15
BOOTDIR=
 
16
if [ "$DI_WWW_HOME" = "default" ];then
 
17
   DI_WWW_HOME="http://people.debian.org/~joeyh/d-i/images/daily"
 
18
fi
 
19
if [ ! "$DI_DIST" ]; then
 
20
   export DI_DIST="$DI_CODENAME"
 
21
fi
 
22
if [ -z "$DI_PATH" ]; then
 
23
   DI_PATH="$($BASEDIR/tools/find-newest-installer)"
 
24
fi
 
25
 
 
26
default_preseed
 
27
default_language
 
28
 
 
29
cd $CDDIR/..
 
30
 
 
31
#
 
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.
 
35
 
 
36
# Strip NONUS part of disk number
 
37
# NN will be 1...N so it can be used as an index
 
38
#
 
39
NN=`echo $N | sed -e 's/_NONUS//'`
 
40
 
 
41
if [ "$CDIMAGE_ADDON" ]; then
 
42
    # second disk, at least in spirit
 
43
    NN=2
 
44
fi
 
45
 
 
46
> $N.mkisofs_opts
 
47
 
 
48
case "$MKISOFS" in
 
49
    *xorriso*)
 
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
 
55
        ;;
 
56
esac
 
57
 
 
58
# List of boot image for each CD
 
59
KTYPE[1]="" #isolinux multiboot in fact
 
60
KTYPE[2]=""
 
61
# XXX add net-image back when it's fixed
 
62
KTYPE[3]=""
 
63
KTYPE[4]=""
 
64
KTYPE[5]=""
 
65
KTYPE[6]=""
 
66
KTYPE[7]=""
 
67
KTYPE[8]=""
 
68
KTYPE[9]=""
 
69
KTYPE[10]=""
 
70
 
 
71
THISTYPE=${KTYPE[$NN]}
 
72
 
 
73
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
 
74
DISK_IMAGES=""
 
75
TAR_IMAGES="netboot/netboot.tar.gz"
 
76
 
 
77
case $PROJECT in
 
78
    xubuntu|lubuntu)
 
79
        FLAVOUR=generic
 
80
        ;;
 
81
    ubuntustudio)
 
82
        if [ "$CDIMAGE_LIVE" ]; then
 
83
            FLAVOUR=lowlatency
 
84
        else
 
85
            FLAVOUR=generic
 
86
        fi
 
87
        ;;
 
88
    *)
 
89
        FLAVOUR=generic
 
90
        ;;
 
91
esac
 
92
 
 
93
# Download boot images
 
94
for image in MANIFEST.udebs $BOOT_IMAGES $DISK_IMAGES $TAR_IMAGES; do
 
95
    if [ ! -e "$image" ]; then
 
96
        dir=$(dirname $image)
 
97
        mkdir -p $dir
 
98
        if [ ! "$DI_WWW_HOME" ];then
 
99
                cp "$DI_PATH/current/images/$image" "$image"
 
100
        else
 
101
                wget "$DI_WWW_HOME/$image" -O "$image"
 
102
        fi
 
103
    fi
 
104
done
 
105
 
 
106
if [ "$NN" = "1" ]; then
 
107
    list_kernel_abis $BOOT_IMAGES | check_kernel_sync $FLAVOUR
 
108
 
 
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/
 
126
 
 
127
    GFXBOOT=
 
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
 
132
        GFXBOOT=1
 
133
    fi
 
134
 
 
135
    rm -rf usr
 
136
    if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
137
        cp -lf cdrom/vmlinuz $CDDIR/install/
 
138
        cp -lf cdrom/initrd.gz $CDDIR/install/
 
139
    fi
 
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"
 
144
    fi
 
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
 
146
else
 
147
    if [ -n "$THISTYPE" ]; then
 
148
        echo "Using $THISTYPE boot-disks image on CD$N"
 
149
        mkdir -p boot$N/boot
 
150
        cp $THISTYPE/boot.img boot$N/boot/
 
151
        echo -n "-cache-inodes -J -l -b boot/boot.img " >> $N.mkisofs_opts
 
152
    else
 
153
        mkdir boot$N
 
154
        echo -n "-cache-inodes -J -l " >> $N.mkisofs_opts
 
155
    fi
 
156
fi
 
157
 
 
158
case "$MKISOFS" in
 
159
    *xorriso*)
 
160
        ;;
 
161
    *)
 
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
 
164
        ;;
 
165
esac
 
166
 
 
167
#install_languages $CDDIR
 
168
 
 
169
# Only disk one gets the extra files installed
 
170
#
 
171
if [ "$NN" = "1" ]; then
 
172
 
 
173
 
 
174
HIDDEN_TIMEOUT=
 
175
if [ "$CDIMAGE_LIVE" = 1 ] && [ "$CDIMAGE_DVD" != 1 ]; then
 
176
    case $PROJECT in
 
177
        ubuntu|ubuntu-netbook|xubuntu|ubuntukylin|kubuntu|kubuntu-plasma5|ubuntu-gnome|ubuntu-desktop-next|ubuntu-mate)
 
178
            HIDDEN_TIMEOUT=2
 
179
            ;;
 
180
        mythbuntu)
 
181
            HIDDEN_TIMEOUT=1
 
182
            ;;
 
183
    esac
 
184
    if [ -e "$BASEDIR/data/$DI_CODENAME/$PROJECT-access.pcx" ]; then
 
185
        ACCESSPCX="$PROJECT-access.pcx"
 
186
    else
 
187
        ACCESSPCX=access-new.pcx
 
188
    fi
 
189
    if [ -e "$BASEDIR/data/$DI_CODENAME/$PROJECT-blank.pcx" ]; then
 
190
        BLANKPCX="$PROJECT-blank.pcx"
 
191
    else
 
192
        BLANKPCX=blank.pcx
 
193
    fi
 
194
fi
 
195
 
 
196
# populate the install directory as well
 
197
for disk in $DISK_IMAGES; do
 
198
        dir=$(dirname $disk)
 
199
        mkdir -p $CDDIR/install/$dir
 
200
        cp -lf $disk $CDDIR/install/$dir
 
201
done
 
202
 
 
203
if [ "$CDIMAGE_INSTALL" = 1 ]; then
 
204
        for tar in $TAR_IMAGES; do
 
205
                dir=$(dirname $tar)
 
206
                mkdir -p $CDDIR/install/$dir
 
207
                tar -C $CDDIR/install/$dir -xzpf $tar
 
208
        done
 
209
fi
 
210
 
 
211
# ISOLINUX setup
 
212
 
 
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
 
230
fi
 
231
if [ "$GFXSPLASH" ] && [ -e "$GFXSPLASH" ]; then
 
232
    cp -p "$GFXSPLASH" boot$N/isolinux/splash.pcx
 
233
fi
 
234
if [ "$SPLASHPNG" ] && [ -e "$SPLASHPNG" ]; then
 
235
    cp -p "$SPLASHPNG" boot$N/isolinux/splash.png
 
236
fi
 
237
if [ "$HIDDEN_TIMEOUT" ] && [ "$ACCESSPCX" ]; then
 
238
    cp -p "$BASEDIR/data/$DI_CODENAME/$ACCESSPCX" boot$N/isolinux/access.pcx
 
239
fi
 
240
if [ "$HIDDEN_TIMEOUT" = 2 ]; then
 
241
    cp -p "$BASEDIR/data/$DI_CODENAME/$BLANKPCX" boot$N/isolinux/blank.pcx
 
242
fi
 
243
if [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
 
244
    # No language menu.
 
245
    echo en >boot$N/isolinux/lang
 
246
elif [ "$PROJECT" = ubuntukylin ]; then
 
247
    echo zh_CN >boot$N/isolinux/lang
 
248
fi
 
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
 
255
else
 
256
    for x in boot$N/isolinux/*.txt.live; do
 
257
        [ -f "$x" ] || continue
 
258
        mv "$x" "${x%.live}"
 
259
    done
 
260
    for x in boot$N/isolinux/*.hlp.live; do
 
261
        [ -f "$x" ] || continue
 
262
        mv "$x" "${x%.live}"
 
263
    done
 
264
fi
 
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
 
271
 
 
272
# Set up-to-date build dates. Kludgy because d-i sets its own version as
 
273
# the build date.
 
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
 
280
fi
 
281
 
 
282
if [ "$HIDDEN_TIMEOUT" ]; then
 
283
    timeout=50
 
284
elif [ "$CDIMAGE_LIVE" = 1 ]; then
 
285
    timeout=300
 
286
else
 
287
    timeout=0
 
288
fi
 
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
 
293
    DEFAULT_LABEL=live
 
294
else
 
295
    DEFAULT_LABEL=install
 
296
fi
 
297
cat > boot$N/isolinux/txt.cfg <<EOF
 
298
default $DEFAULT_LABEL
 
299
EOF
 
300
> boot$N/isolinux/adtxt.cfg
 
301
if [ "$GFXBOOT" ]; then
 
302
    cat >> boot$N/isolinux/isolinux.cfg <<EOF
 
303
ui gfxboot bootlogo
 
304
EOF
 
305
fi
 
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
 
311
foreground=0xFFFFFF
 
312
background=0x958490
 
313
screen-colour=0x270A1E
 
314
EOF
 
315
fi
 
316
if [ "$PROJECT" = ubuntu-gnome ]; then
 
317
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
318
screen-colour=0x2D3335
 
319
EOF
 
320
fi
 
321
if [ "$PROJECT" = ubuntu-mate ]; then
 
322
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
323
foreground=0xffffff
 
324
background=0x87a556
 
325
screen-colour=0x3c3b37
 
326
EOF
 
327
fi
 
328
if [ "$HIDDEN_TIMEOUT" ]; then
 
329
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
330
hidden-timeout=$HIDDEN_TIMEOUT
 
331
EOF
 
332
fi
 
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
 
339
EOF
 
340
elif [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
 
341
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
342
access-options=v1 v2 brltty m1
 
343
EOF
 
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
 
348
EOF
 
349
fi
 
350
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
351
label normal=Normal
 
352
append normal=
 
353
EOF
 
354
if [ "$CDIMAGE_LIVE" = 1 ]; then
 
355
    if [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
 
356
        livelabel="^Start $HUMANPROJECT"
 
357
        liveparams=' maybe-ubiquity'
 
358
    else
 
359
        livelabel="^Try $HUMANPROJECT without installing"
 
360
        liveparams=
 
361
    fi
 
362
    cat >> boot$N/isolinux/txt.cfg <<EOF
 
363
label live
 
364
  menu label $livelabel
 
365
  kernel /casper/vmlinuz
 
366
  append $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper$liveparams initrd=$CASPER_INITRD quiet splash ---
 
367
EOF
 
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
 
372
}
 
373
EOF
 
374
    if [ "$PROJECT" != ubuntu-mid ] && [ "$PROJECT" != kubuntu ] && [ "$PROJECT" != kubuntu-plasma5 ]; then
 
375
        cat >> boot$N/isolinux/txt.cfg <<EOF
 
376
label live-install
 
377
  menu label ^Install $HUMANPROJECT
 
378
  kernel /casper/vmlinuz
 
379
  append $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper only-ubiquity initrd=$CASPER_INITRD quiet splash ---
 
380
EOF
 
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
 
385
}
 
386
EOF
 
387
    fi
 
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
 
392
EOF
 
393
fi
 
394
if [ "$CDIMAGE_INSTALL" = 1 ]; then
 
395
    if [ "$CDIMAGE_LIVE" != 1 ]; then
 
396
        cat >> boot$N/isolinux/txt.cfg <<EOF
 
397
label install
 
398
  menu label ^Install $HUMANPROJECT
 
399
  kernel /install/vmlinuz
 
400
  append $KERNEL_PARAMS $DEFAULT_PRESEED vga=788 initrd=/install/initrd.gz quiet ---
 
401
EOF
 
402
    else
 
403
        cat >> boot$N/isolinux/txt.cfg <<EOF
 
404
label install
 
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 ---
 
408
EOF
 
409
    fi
 
410
    cat >> boot$N/isolinux/adtxt.cfg <<EOF
 
411
label expert
 
412
  menu hide
 
413
  kernel /install/vmlinuz
 
414
  append $KERNEL_PARAMS $DEFAULT_PRESEED priority=low vga=788 initrd=/install/initrd.gz ---
 
415
EOF
 
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
 
421
EOF
 
422
    fi
 
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
 
428
EOF
 
429
    fi
 
430
fi
 
431
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
432
label oem=OEM install (for manufacturers)
 
433
append oem=oem-config/enable=true
 
434
EOF
 
435
if [ "$CDIMAGE_LIVE" = 1 ]; then
 
436
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
437
applies oem=live live-install install
 
438
EOF
 
439
else
 
440
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
441
applies oem=install
 
442
EOF
 
443
fi
 
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
 
449
applies cli=install
 
450
EOF
 
451
    else
 
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
 
459
EOF
 
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
 
463
label cloud
 
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 ---
 
467
EOF
 
468
    fi
 
469
fi
 
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
 
474
applies ltsp=install
 
475
EOF
 
476
fi
 
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
 
481
applies ltsp=install
 
482
EOF
 
483
fi
 
484
if [ "$CDIMAGE_LIVE" = 1 ]; then
 
485
    cat >> boot$N/isolinux/txt.cfg <<EOF
 
486
label check
 
487
  menu label ^Check disc for defects
 
488
  kernel /casper/vmlinuz
 
489
  append $KERNEL_PARAMS boot=casper integrity-check initrd=$CASPER_INITRD quiet splash ---
 
490
EOF
 
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
 
495
}
 
496
EOF
 
497
elif [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
498
    cat >> boot$N/isolinux/txt.cfg <<EOF
 
499
label check
 
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 ---
 
503
EOF
 
504
fi
 
505
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
506
    cat >> boot$N/isolinux/adtxt.cfg <<EOF
 
507
label rescue
 
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 ---
 
511
EOF
 
512
fi
 
513
cat >> boot$N/isolinux/txt.cfg <<EOF
 
514
label memtest
 
515
  menu label Test ^memory
 
516
  kernel /install/mt86plus
 
517
label hd
 
518
  menu label ^Boot from first hard disk
 
519
  localboot 0x80
 
520
EOF
 
521
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
 
522
menuentry "Test memory" {
 
523
        linux16 /install/mt86plus
 
524
}
 
525
EOF
 
526
 
 
527
fi
 
528
 
 
529
# write final lines to mkisofs_opts
 
530
if [ "$NN" = "1" ]; then
 
531
    echo -n "boot$N " >> $N.mkisofs_opts
 
532
else
 
533
    if [ -n "$THISTYPE" ]; then
 
534
        echo -n "-c boot/boot.catalog boot$N "  >> $N.mkisofs_opts
 
535
    fi
 
536
fi
 
537
 
 
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
 
541
fi
 
542
 
 
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
 
548
else
 
549
        SYSLINUX_NAME=isolinux
 
550
fi
 
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 \
 
560
      "$tmpdir/"
 
561
(cd "$tmpdir" && ls -1 | cpio --quiet -o) > boot$N/$SYSLINUX_NAME/bootlogo
 
562
rm -rf "$tmpdir"
 
563
 
 
564
# th,th, thats all