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

« back to all changes in this revision

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

  • Committer: Colin Watson
  • Date: 2011-04-30 16:06:44 UTC
  • Revision ID: cjwatson@canonical.com-20110430160644-0g6ldw3d4rpilkin
add CONF.sh bits for oneiric; copy natty -> oneiric elsewhere

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
 
 
28
cd $CDDIR/..
 
29
 
 
30
#
 
31
# This script is called with $1 (now $N) as the CD to 
 
32
# make bootable.  N may be in the form "n" or "n_NONUS"
 
33
# There may be more than 4 disks...support extras.
 
34
 
 
35
# Strip NONUS part of disk number
 
36
# NN will be 1...N so it can be used as an index
 
37
#
 
38
NN=`echo $N | sed -e 's/_NONUS//'`
 
39
 
 
40
if [ "$CDIMAGE_ADDON" ]; then
 
41
    # second disk, at least in spirit
 
42
    NN=2
 
43
fi
 
44
 
 
45
# List of boot image for each CD
 
46
KTYPE[1]="" #isolinux multiboot in fact
 
47
KTYPE[2]=""
 
48
# XXX add net-image back when it's fixed
 
49
KTYPE[3]=""
 
50
KTYPE[4]=""
 
51
KTYPE[5]=""
 
52
KTYPE[6]=""
 
53
KTYPE[7]=""
 
54
KTYPE[8]=""
 
55
KTYPE[9]=""
 
56
KTYPE[10]=""
 
57
 
 
58
THISTYPE=${KTYPE[$NN]}
 
59
 
 
60
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
 
61
DISK_IMAGES=""
 
62
TAR_IMAGES="netboot/netboot.tar.gz"
 
63
 
 
64
# Download boot images
 
65
for image in MANIFEST.udebs $BOOT_IMAGES $DISK_IMAGES $TAR_IMAGES; do
 
66
    if [ ! -e "$image" ]; then
 
67
        dir=$(dirname $image)
 
68
        mkdir -p $dir
 
69
        if [ ! "$DI_WWW_HOME" ];then
 
70
                cp "$DI_PATH/current/images/$image" "$image"
 
71
        else
 
72
                wget "$DI_WWW_HOME/$image" -O "$image"
 
73
        fi
 
74
    fi
 
75
done
 
76
 
 
77
if [ "$NN" = "1" ]; then
 
78
    list_kernel_abis $BOOT_IMAGES | check_kernel_sync
 
79
 
 
80
    echo "Using ISOLINUX boot-disks image on CD$N"
 
81
    mkdir -p boot$N/isolinux
 
82
    SYSLINUXDEB="$($BASEDIR/tools/apt-selection cache show syslinux-common | \
 
83
        grep ^Filename | awk '{print $2}')"
 
84
    (ar p "$MIRROR/$SYSLINUXDEB" data.tar.gz | \
 
85
        tar zxf - -C . ./usr/lib/syslinux/isolinux.bin \
 
86
            ./usr/lib/syslinux/vesamenu.c32 \
 
87
            ./usr/lib/syslinux/gfxboot.c32)
 
88
    mv usr/lib/syslinux/isolinux.bin boot$N/isolinux/
 
89
    mv usr/lib/syslinux/vesamenu.c32 boot$N/isolinux/
 
90
    mv usr/lib/syslinux/gfxboot.c32 boot$N/isolinux/
 
91
 
 
92
    GFXBOOT=
 
93
    if THEMEDEB="$($BASEDIR/tools/apt-selection cache show gfxboot-theme-ubuntu)"; then
 
94
        THEMEDEB="$(echo "$THEMEDEB" | grep ^Filename | awk '{print $2}')"
 
95
        ar p "$MIRROR/$THEMEDEB" data.tar.gz | tar zxf - -C . ./usr/share/gfxboot-theme-ubuntu/bootlogo.tar.gz
 
96
        tar zxf usr/share/gfxboot-theme-ubuntu/bootlogo.tar.gz -C boot$N/isolinux
 
97
        GFXBOOT=1
 
98
    fi
 
99
 
 
100
    # Extract GRUB EFI files.
 
101
    # Cloned-and-hacked from debian-installer/build/config/x86.cfg for now.
 
102
    mkdir -p grub-efi
 
103
    GRUB_RESCUE_EFI_AMD64_DEB="$($BASEDIR/tools/apt-selection cache show grub-rescue-efi-amd64 | \
 
104
        grep ^Filename | awk '{print $2}')"
 
105
    (ar p "$MIRROR/$GRUB_RESCUE_EFI_AMD64_DEB" data.tar.gz | \
 
106
        tar xzf - -C . ./usr/lib/grub-rescue-efi-amd64/grub-rescue-cdrom.iso)
 
107
    # Repack efi.img more efficiently
 
108
    isoinfo -R -i usr/lib/grub-rescue-efi-amd64/grub-rescue-cdrom.iso \
 
109
        -x /efi.img >grub-efi/efi.img
 
110
    mcopy -i grub-efi/efi.img ::efi/boot/bootx64.efi grub-efi/bootx64.efi
 
111
    # 24KiB headroom seems to be enough; (x+31)/32*32 rounds up to
 
112
    # multiple of 32
 
113
    mkfs.msdos -C grub-efi/efi-small.img \
 
114
        $(( ($(stat -c %s grub-efi/bootx64.efi) / 1024 + 55) / 32 * 32 ))
 
115
    mmd -i grub-efi/efi-small.img ::efi
 
116
    mmd -i grub-efi/efi-small.img ::efi/boot
 
117
    mcopy -i grub-efi/efi-small.img grub-efi/bootx64.efi ::efi/boot/bootx64.efi
 
118
    # Extract GRUB modules, except for those already built in.
 
119
    # TODO: This is based on reading grub-mkrescue and moddep.lst, and
 
120
    # is thus unstable; the exclusions really belong in grub-mkrescue
 
121
    # instead.
 
122
    mkdir -p grub-efi/boot/grub/x86_64-efi
 
123
    for x in $(isoinfo -R -i usr/lib/grub-rescue-efi-amd64/grub-rescue-cdrom.iso -f | \
 
124
               grep ^/boot/grub/x86_64-efi/); do
 
125
        case $(basename $x) in
 
126
            configfile.mod|extcmd.mod|fshelp.mod|iso9660.mod|memdisk.mod|normal.mod|search.mod|search_fs_file.mod|search_fs_uuid.mod|search_label.mod|tar.mod)
 
127
                # included in bootx64.efi
 
128
                ;;
 
129
            affs.mod|afs.mod|afs_be.mod|befs.mod|befs_be.mod|minix.mod|nilfs2.mod|sfs.mod|zfs.mod|zfsinfo.mod)
 
130
                # unnecessary filesystem modules
 
131
                ;;
 
132
            example_functional_test.mod|functional_test.mod|hello.mod)
 
133
                # other cruft
 
134
                ;;
 
135
            *)
 
136
                isoinfo -R -i usr/lib/grub-rescue-efi-amd64/grub-rescue-cdrom.iso -x $x \
 
137
                    >grub-efi$x
 
138
                ;;
 
139
        esac
 
140
    done
 
141
 
 
142
    rm -rf usr
 
143
    if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
144
        cp -lf cdrom/vmlinuz $CDDIR/install/
 
145
        cp -lf cdrom/initrd.gz $CDDIR/install/
 
146
    fi
 
147
    if [ "$CDIMAGE_LIVE" = 1 ]; then
 
148
        mv $CDDIR/casper/filesystem.kernel-generic $CDDIR/casper/vmlinuz
 
149
        CASPER_INITRD="/casper/initrd$(initrd_suffix "$CDDIR/casper/filesystem.initrd-generic")"
 
150
        mv $CDDIR/casper/filesystem.initrd-generic "$CDDIR$CASPER_INITRD"
 
151
    fi
 
152
    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
 
153
    echo -n "-eltorito-alt-boot -efi-boot boot/grub/efi.img -no-emul-boot " >> $N.mkisofs_opts
 
154
else
 
155
    if [ -n "$THISTYPE" ]; then
 
156
        echo "Using $THISTYPE boot-disks image on CD$N"
 
157
        mkdir -p boot$N/boot
 
158
        cp $THISTYPE/boot.img boot$N/boot/
 
159
        echo -n "-cache-inodes -J -l -b boot/boot.img "  > $N.mkisofs_opts
 
160
    else
 
161
        mkdir boot$N
 
162
        echo -n "-cache-inodes -J -l " > $N.mkisofs_opts
 
163
    fi
 
164
fi
 
165
 
 
166
"$BASEDIR/tools/sorting_weights" "$N" boot$N/isolinux/isolinux.bin boot$N/isolinux/boot.cat
 
167
echo -n "-sort $(pwd)/$N.weights " >> $N.mkisofs_opts
 
168
 
 
169
#install_languages $CDDIR
 
170
 
 
171
# Only disk one gets the extra files installed
 
172
#
 
173
if [ "$NN" = "1" ]; then
 
174
 
 
175
 
 
176
HIDDEN_TIMEOUT=
 
177
if [ "$CDIMAGE_LIVE" = 1 ] && [ "$CDIMAGE_DVD" != 1 ]; then
 
178
    if [ "$PROJECT" = ubuntu ] || [ "$PROJECT" = ubuntu-netbook ]; then
 
179
        HIDDEN_TIMEOUT=2
 
180
    elif [ "$PROJECT" = mythbuntu ]; then
 
181
        HIDDEN_TIMEOUT=1
 
182
    fi
 
183
    ACCESSPCX=access-new.pcx
 
184
fi
 
185
 
 
186
# populate the install directory as well
 
187
for disk in $DISK_IMAGES; do
 
188
        dir=$(dirname $disk)
 
189
        mkdir -p $CDDIR/install/$dir
 
190
        cp -lf $disk $CDDIR/install/$dir
 
191
done
 
192
 
 
193
if [ "$CDIMAGE_INSTALL" = 1 ]; then
 
194
        for tar in $TAR_IMAGES; do
 
195
                dir=$(dirname $tar)
 
196
                mkdir -p $CDDIR/install/$dir
 
197
                tar -C $CDDIR/install/$dir -xzpf $tar
 
198
        done
 
199
fi
 
200
 
 
201
# ISOLINUX setup
 
202
 
 
203
if [ "$CDIMAGE_INSTALL" = 1 ]; then
 
204
    # Include Smart Boot Manager image for people where isolinux fails
 
205
    gzip -dc $BASEDIR/data/$DI_CODENAME/sbm.bin.gz > $CDDIR/install/sbm.bin
 
206
    # Keep the original file timestamp
 
207
    touch -r $BASEDIR/data/$DI_CODENAME/sbm.bin.gz $CDDIR/install/sbm.bin
 
208
    cp -p $BASEDIR/data/$DI_CODENAME/README.sbm $CDDIR/install/
 
209
fi
 
210
# Extract memtest86+ from the archive
 
211
MEMTEST86DEB="$($BASEDIR/tools/apt-selection cache show memtest86+ | \
 
212
        grep ^Filename | awk '{print $2}')"
 
213
ar p "$MIRROR/$MEMTEST86DEB" data.tar.gz | \
 
214
        tar xzf - -C $CDDIR/install/ ./boot/memtest86+.bin
 
215
mv $CDDIR/install/boot/memtest86+.bin $CDDIR/install/mt86plus
 
216
rm -rf $CDDIR/install/boot
 
217
# Isolinux help files come from d-i.
 
218
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/isolinux/; tar zx)
 
219
# Override splash screen.
 
220
if [ "$SPLASHRLE" ] && [ -e "$SPLASHRLE" ]; then
 
221
    cp -p "$SPLASHRLE" boot$N/isolinux/splash.rle
 
222
fi
 
223
if [ "$GFXSPLASH" ] && [ -e "$GFXSPLASH" ]; then
 
224
    cp -p "$GFXSPLASH" boot$N/isolinux/splash.pcx
 
225
fi
 
226
if [ "$SPLASHPNG" ] && [ -e "$SPLASHPNG" ]; then
 
227
    cp -p "$SPLASHPNG" boot$N/isolinux/splash.png
 
228
fi
 
229
if [ "$HIDDEN_TIMEOUT" ] && [ "$ACCESSPCX" ]; then
 
230
    cp -p "$BASEDIR/data/$DI_CODENAME/$ACCESSPCX" boot$N/isolinux/access.pcx
 
231
fi
 
232
if [ "$HIDDEN_TIMEOUT" = 2 ]; then
 
233
    cp -p "$BASEDIR/data/$DI_CODENAME/blank.pcx" boot$N/isolinux/blank.pcx
 
234
fi
 
235
if [ "$PROJECT" = kubuntu ]; then
 
236
    # No language menu.
 
237
    echo en >boot$N/isolinux/lang
 
238
fi
 
239
# Remove elilo configuration; only for Macs.
 
240
rm -f boot$N/isolinux/elilo*
 
241
rm -f boot$N/isolinux/*.msg*
 
242
if [ "$CDIMAGE_INSTALL" = 1 ]; then
 
243
    rm -f boot$N/isolinux/*.txt.live
 
244
    rm -f boot$N/isolinux/*.hlp.live
 
245
else
 
246
    for x in boot$N/isolinux/*.txt.live; do
 
247
        [ -f "$x" ] || continue
 
248
        mv "$x" "${x%.live}"
 
249
    done
 
250
    for x in boot$N/isolinux/*.hlp.live; do
 
251
        [ -f "$x" ] || continue
 
252
        mv "$x" "${x%.live}"
 
253
    done
 
254
fi
 
255
# Nuke the GTK menu items for now.
 
256
rm -f boot$N/isolinux/*gtk.cfg
 
257
rm -f boot$N/isolinux/*.txt.withgtk
 
258
# We only support single-architecture images.
 
259
sed -i 's|%install%|install|' boot$N/isolinux/*.cfg
 
260
# Move GRUB files to the right place.
 
261
mkdir -p $CDDIR/efi/boot
 
262
mkdir -p $CDDIR/boot/grub/x86_64-efi
 
263
mv boot$N/isolinux/grub/* $CDDIR/boot/grub/
 
264
rmdir boot$N/isolinux/grub
 
265
sed -i '/^menuentry/Q' $CDDIR/boot/grub/grub.cfg
 
266
cp -a grub-efi/bootx64.efi $CDDIR/efi/boot/bootx64.efi
 
267
cp -a grub-efi/efi-small.img $CDDIR/boot/grub/efi.img
 
268
cp -a grub-efi/boot/grub/x86_64-efi/* $CDDIR/boot/grub/x86_64-efi/
 
269
 
 
270
# Set up-to-date build dates. Kludgy because d-i sets its own version as
 
271
# the build date.
 
272
DI_VERSION="$(perl -lne 'if (/built on ([0-9a-z]*)/) { print $1 }' \
 
273
                        "boot$N/isolinux/f1.txt")"
 
274
if [ "$DI_VERSION" ]; then
 
275
    : "${CDIMAGE_DATE:=$(date +%Y%m%d)}"
 
276
    sed -i "s/$DI_VERSION/$CDIMAGE_DATE/g" \
 
277
        "boot$N"/isolinux/*.txt "boot$N"/isolinux/*.hlp
 
278
fi
 
279
 
 
280
if [ "$HIDDEN_TIMEOUT" ]; then
 
281
    timeout=50
 
282
elif [ "$CDIMAGE_LIVE" = 1 ]; then
 
283
    timeout=300
 
284
else
 
285
    timeout=0
 
286
fi
 
287
sed -i "s/^timeout .*/timeout $timeout/" \
 
288
    boot$N/isolinux/isolinux.cfg boot$N/isolinux/prompt.cfg
 
289
# Isolinux config file.
 
290
if [ "$CDIMAGE_LIVE" = 1 ]; then
 
291
    DEFAULT_LABEL=live
 
292
else
 
293
    DEFAULT_LABEL=install
 
294
fi
 
295
cat > boot$N/isolinux/txt.cfg <<EOF
 
296
default $DEFAULT_LABEL
 
297
EOF
 
298
> boot$N/isolinux/adtxt.cfg
 
299
if [ "$GFXBOOT" ]; then
 
300
    cat >> boot$N/isolinux/isolinux.cfg <<EOF
 
301
ui gfxboot bootlogo
 
302
EOF
 
303
fi
 
304
if [ "$PROJECT" = ubuntu ] || [ "$PROJECT" = ubuntu-server ] || \
 
305
   [ "$PROJECT" = ubuntu-mid ] || [ "$PROJECT" = ubuntu-netbook ] || \
 
306
   [ "$PROJECT" = ubuntu-moblin-remix ] || [ "$PROJECT" = mythbuntu ]; then
 
307
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
308
foreground=0xFFFFFF
 
309
background=0x958490
 
310
screen-colour=0x270A1E
 
311
EOF
 
312
elif [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-netbook ]; then
 
313
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
314
foreground=0xFFFFFF
 
315
background=0x000000
 
316
screen-colour=0x005082
 
317
EOF
 
318
fi
 
319
if [ "$HIDDEN_TIMEOUT" ]; then
 
320
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
321
hidden-timeout=$HIDDEN_TIMEOUT
 
322
EOF
 
323
fi
 
324
# access-options default: v1 v2 v3 brltty m1 m2
 
325
# d-i only supports v1 and brltty right now.
 
326
if [ "$CDIMAGE_LIVE" != 1 ]; then
 
327
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
328
access-options=v1 brltty
 
329
access-options-v1=access=v1 FRONTEND_BACKGROUND=dark
 
330
EOF
 
331
elif [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-netbook ]; then
 
332
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
333
access-options=v1 v2 brltty m1
 
334
EOF
 
335
elif [ "$PROJECT" = xubuntu ]; then
 
336
    # v1 and m1 don't have the necessary sed calls for Xubuntu yet.
 
337
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
338
access-options=v2 v3 brltty m2
 
339
EOF
 
340
fi
 
341
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
342
label normal=Normal
 
343
append normal=
 
344
EOF
 
345
if [ "$CDIMAGE_LIVE" = 1 ]; then
 
346
    if [ "$PROJECT" = kubuntu ]; then
 
347
        livelabel="^Start $HUMANPROJECT"
 
348
        liveparams=' maybe-ubiquity'
 
349
    else
 
350
        livelabel="^Try $HUMANPROJECT without installing"
 
351
        liveparams=
 
352
    fi
 
353
    cat >> boot$N/isolinux/txt.cfg <<EOF
 
354
label live
 
355
  menu label $livelabel
 
356
  kernel /casper/vmlinuz
 
357
  append $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper$liveparams initrd=$CASPER_INITRD quiet splash --
 
358
EOF
 
359
    cat >> $CDDIR/boot/grub/grub.cfg <<EOF
 
360
menuentry "${livelabel#^}" {
 
361
        set gfxpayload=keep
 
362
        linux   /casper/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper$liveparams quiet splash --
 
363
        initrd  $CASPER_INITRD
 
364
}
 
365
EOF
 
366
    cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
 
367
menuentry "${livelabel#^}" {
 
368
        set gfxpayload=keep
 
369
        linux   /casper/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper$liveparams iso-scan/filename=\${iso_path} quiet splash --
 
370
        initrd  $CASPER_INITRD
 
371
}
 
372
EOF
 
373
    if [ "$PROJECT" != ubuntu-mid ] && [ "$PROJECT" != kubuntu ]; then
 
374
        cat >> boot$N/isolinux/txt.cfg <<EOF
 
375
label live-install
 
376
  menu label ^Install $HUMANPROJECT
 
377
  kernel /casper/vmlinuz
 
378
  append $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper only-ubiquity initrd=$CASPER_INITRD quiet splash --
 
379
EOF
 
380
        cat >> $CDDIR/boot/grub/grub.cfg <<EOF
 
381
menuentry "Install $HUMANPROJECT" {
 
382
        set gfxpayload=keep
 
383
        linux   /casper/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper only-ubiquity quiet splash --
 
384
        initrd  $CASPER_INITRD
 
385
}
 
386
EOF
 
387
        cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
 
388
menuentry "Install $HUMANPROJECT" {
 
389
        linux   /casper/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED boot=casper only-ubiquity iso-scan/filename=\${iso_path} quiet splash --
 
390
        initrd  $CASPER_INITRD
 
391
}
 
392
EOF
 
393
    fi
 
394
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
395
label driverupdates=Use driver update disc
 
396
append driverupdates=debian-installer/driver-update=true
 
397
applies driverupdates=live live-install
 
398
EOF
 
399
fi
 
400
if [ "$CDIMAGE_INSTALL" = 1 ]; then
 
401
    if [ "$CDIMAGE_LIVE" != 1 ]; then
 
402
        cat >> boot$N/isolinux/txt.cfg <<EOF
 
403
label install
 
404
  menu label ^Install $HUMANPROJECT
 
405
  kernel /install/vmlinuz
 
406
  append $KERNEL_PARAMS $DEFAULT_PRESEED vga=788 initrd=/install/initrd.gz quiet --
 
407
EOF
 
408
        cat >> $CDDIR/boot/grub/grub.cfg <<EOF
 
409
menuentry "Install $HUMANPROJECT" {
 
410
        set gfxpayload=keep
 
411
        linux   /install/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED quiet --
 
412
        initrd  /install/initrd.gz
 
413
}
 
414
EOF
 
415
    else
 
416
        cat >> boot$N/isolinux/txt.cfg <<EOF
 
417
label install
 
418
  menu label ^Install $HUMANPROJECT in text mode
 
419
  kernel /install/vmlinuz
 
420
  append $KERNEL_PARAMS $DEFAULT_PRESEED vga=788 initrd=/install/initrd.gz quiet --
 
421
EOF
 
422
        cat >> $CDDIR/boot/grub/grub.cfg <<EOF
 
423
menuentry "Install $HUMANPROJECT in text mode" {
 
424
        set gfxpayload=keep
 
425
        linux   /install/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED quiet --
 
426
        initrd  /install/initrd.gz
 
427
}
 
428
EOF
 
429
    fi
 
430
    cat >> boot$N/isolinux/adtxt.cfg <<EOF
 
431
label expert
 
432
  menu hide
 
433
  kernel /install/vmlinuz
 
434
  append $KERNEL_PARAMS $DEFAULT_PRESEED priority=low vga=788 initrd=/install/initrd.gz --
 
435
EOF
 
436
    cat >> $CDDIR/boot/grub/grub.cfg <<EOF
 
437
menuentry "Install in expert mode" {
 
438
        set gfxpayload=keep
 
439
        linux   /install/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED priority=low --
 
440
        initrd  /install/initrd.gz
 
441
}
 
442
EOF
 
443
    if [ "$PROJECT" = edubuntu ]; then
 
444
        cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
445
label workstation=Install a workstation
 
446
replace workstation=file=/cdrom/preseed/workstation.seed
 
447
applies workstation=install
 
448
EOF
 
449
    fi
 
450
    if [ "$CDIMAGE_DVD" = 1 ] && [ "$PROJECT" != edubuntu ] && [ "$PROJECT" != ubuntu-server ]; then
 
451
        cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
452
label server=Install a server
 
453
replace server=file=/cdrom/preseed/ubuntu-server.seed
 
454
applies server=install
 
455
EOF
 
456
    fi
 
457
fi
 
458
cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
459
label oem=OEM install (for manufacturers)
 
460
append oem=oem-config/enable=true
 
461
EOF
 
462
if [ "$CDIMAGE_LIVE" = 1 ]; then
 
463
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
464
applies oem=live live-install install
 
465
EOF
 
466
else
 
467
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
468
applies oem=install
 
469
EOF
 
470
fi
 
471
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
472
    if [ "$PROJECT" != ubuntu-server ]; then
 
473
        cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
474
label cli=Install a command-line system
 
475
replace cli=file=/cdrom/preseed/cli.seed
 
476
applies cli=install
 
477
EOF
 
478
    else
 
479
        cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
480
label minimal=Install a minimal system
 
481
replace minimal=file=/cdrom/preseed/ubuntu-server-minimal.seed
 
482
applies minimal=install
 
483
label minimalvm=Install a minimal virtual machine
 
484
replace minimalvm=file=/cdrom/preseed/ubuntu-server-minimalvm.seed
 
485
applies minimalvm=install
 
486
EOF
 
487
        # This really ought to be in gfxboot.cfg instead, but we want to
 
488
        # make it particularly prominent.
 
489
        cat >> boot$N/isolinux/txt.cfg <<EOF
 
490
label cloud
 
491
  menu label Install Ubuntu ^Enterprise Cloud
 
492
  kernel /install/vmlinuz
 
493
  append $KERNEL_PARAMS file=/cdrom/preseed/cloud.seed vga=788 initrd=/install/initrd.gz quiet --
 
494
EOF
 
495
        cat >> $CDDIR/boot/grub/grub.cfg <<EOF
 
496
menuentry "Install Ubuntu Enterprise Cloud" {
 
497
        set gfxpayload=keep
 
498
        linux   /install/vmlinuz $KERNEL_PARAMS file=/cdrom/preseed/cloud.seed quiet --
 
499
        initrd  /install/initrd.gz
 
500
}
 
501
EOF
 
502
    fi
 
503
fi
 
504
if [ "$CDIMAGE_INSTALL" = 1 ] && ([ "$PROJECT" = ubuntu ] || [ "$PROJECT" = xubuntu ] || [ "$PROJECT" = edubuntu ]); then
 
505
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
506
label ltsp=Install an LTSP server
 
507
replace ltsp=file=/cdrom/preseed/ltsp.seed
 
508
applies ltsp=install
 
509
EOF
 
510
fi
 
511
if [ "$CDIMAGE_INSTALL" = 1 ] && [ "$PROJECT" = mythbuntu ]; then
 
512
    cat >> boot$N/isolinux/gfxboot.cfg <<EOF
 
513
label ltsp=Install a Diskless Image Server
 
514
replace ltsp=file=/cdrom/preseed/ltsp.seed
 
515
applies ltsp=install
 
516
EOF
 
517
fi
 
518
if [ "$CDIMAGE_LIVE" = 1 ]; then
 
519
    cat >> boot$N/isolinux/txt.cfg <<EOF
 
520
label check
 
521
  menu label ^Check disc for defects
 
522
  kernel /casper/vmlinuz
 
523
  append $KERNEL_PARAMS boot=casper integrity-check initrd=$CASPER_INITRD quiet splash --
 
524
EOF
 
525
    cat >> $CDDIR/boot/grub/grub.cfg <<EOF
 
526
menuentry "Check disc for defects" {
 
527
        set gfxpayload=keep
 
528
        linux   /casper/vmlinuz $KERNEL_PARAMS boot=casper integrity-check quiet splash --
 
529
        initrd  $CASPER_INITRD
 
530
}
 
531
EOF
 
532
    cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
 
533
menuentry "Check disc for defects" {
 
534
        linux   /casper/vmlinuz $KERNEL_PARAMS boot=casper integrity-check iso-scan/filename=\${iso_path} quiet splash --
 
535
        initrd  $CASPER_INITRD
 
536
}
 
537
EOF
 
538
elif [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
539
    cat >> boot$N/isolinux/txt.cfg <<EOF
 
540
label check
 
541
  menu label ^Check disc for defects
 
542
  kernel /install/vmlinuz
 
543
  append $KERNEL_PARAMS MENU=/bin/cdrom-checker-menu vga=788 initrd=/install/initrd.gz quiet --
 
544
EOF
 
545
    cat >> $CDDIR/boot/grub/grub.cfg <<EOF
 
546
menuentry "Check disc for defects" {
 
547
        set gfxpayload=keep
 
548
        linux   /install/vmlinuz $KERNEL_PARAMS MENU=/bin/cdrom-checker-menu quiet --
 
549
        initrd  /install/initrd.gz
 
550
}
 
551
EOF
 
552
fi
 
553
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
554
    cat >> boot$N/isolinux/adtxt.cfg <<EOF
 
555
label rescue
 
556
  menu label ^Rescue a broken system
 
557
  kernel /install/vmlinuz
 
558
  append $KERNEL_PARAMS rescue/enable=true vga=788 initrd=/install/initrd.gz --
 
559
EOF
 
560
    cat >> $CDDIR/boot/grub/grub.cfg <<EOF
 
561
menuentry "Rescue a broken system" {
 
562
        set gfxpayload=keep
 
563
        linux   /install/vmlinuz $KERNEL_PARAMS rescue/enable=true --
 
564
        initrd  /install/initrd.gz
 
565
}
 
566
EOF
 
567
fi
 
568
cat >> boot$N/isolinux/txt.cfg <<EOF
 
569
label memtest
 
570
  menu label Test ^memory
 
571
  kernel /install/mt86plus
 
572
label hd
 
573
  menu label ^Boot from first hard disk
 
574
  localboot 0x80
 
575
EOF
 
576
cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
 
577
menuentry "Test memory" {
 
578
        linux16 /install/mt86plus
 
579
}
 
580
EOF
 
581
 
 
582
fi
 
583
 
 
584
# write final lines to mkisofs_opts
 
585
if [ "$NN" = "1" ]; then
 
586
    echo -n "boot$N " >> $N.mkisofs_opts
 
587
else
 
588
    if [ -n "$THISTYPE" ]; then
 
589
        echo -n "-c boot/boot.catalog boot$N "  >> $N.mkisofs_opts
 
590
    fi
 
591
fi
 
592
 
 
593
# th,th, thats all