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

« back to all changes in this revision

Viewing changes to tools/boot/artful/boot-amd64

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