~xnox/debian-cd/missing-tools-groovy

« back to all changes in this revision

Viewing changes to tools/boot/groovy/boot-amd64+mac

  • Committer: Łukasz 'sil2100' Zemczak
  • Date: 2020-04-24 14:51:48 UTC
  • Revision ID: lukasz.zemczak@canonical.com-20200424145148-jfjvkc1rbiesofu4
Copy focal -> groovy, and add groovy to CONF.sh

Show diffs side-by-side

added added

removed removed

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