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

« back to all changes in this revision

Viewing changes to tools/boot/maverick/boot-armel+dove

  • Committer: Colin Watson
  • Date: 2010-05-04 15:13:12 UTC
  • Revision ID: cjwatson@canonical.com-20100504151312-664dfv9uibyk14fe
add CONF.sh bits for maverick; copy lucid -> maverick elsewhere

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
3
# Do install stuff for armel+dove, 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
# TODO
 
10
# - hardcodes flavour
 
11
 
 
12
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
 
13
 
 
14
set -e
 
15
 
 
16
N=$1
 
17
CDDIR=$2
 
18
BOOTDIR=
 
19
if [ "$DI_WWW_HOME" = "default" ];then
 
20
   DI_WWW_HOME="http://people.debian.org/~joeyh/d-i/images/daily"
 
21
fi
 
22
if [ ! "$DI_DIST" ]; then
 
23
   export DI_DIST="$DI_CODENAME"
 
24
fi
 
25
if [ -z "$DI_PATH" ]; then
 
26
   DI_PATH="$($BASEDIR/tools/find-newest-installer)"
 
27
fi
 
28
 
 
29
default_preseed
 
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
if [ "$IMAGE_FORMAT" = iso ]; then
 
49
    echo -n "-J -joliet-long " > $N.mkisofs_opts
 
50
 
 
51
    "$BASEDIR/tools/sorting_weights" "$N"
 
52
    echo -n "-sort $(pwd)/$N.weights " >> $N.mkisofs_opts
 
53
fi
 
54
 
 
55
if [ "$IMAGE_FORMAT" != vfat ]; then
 
56
    echo "armel booting for image format '$IMAGE_FORMAT' disabled for now"
 
57
    exit 0
 
58
fi
 
59
 
 
60
# XXX hardcodes SUBARCH / FLAVOUR
 
61
SUBARCH=dove
 
62
FLAVOUR=dove
 
63
 
 
64
BOOT_IMAGES="udeb.list $SUBARCH/cdrom/initrd.gz"
 
65
DISK_IMAGES=""
 
66
TAR_IMAGES=""
 
67
 
 
68
if [ "$DI_WWW_HOME" ]; then
 
69
    echo "boot-armel does not support DI_WWW_HOME mode at the moment" >&2
 
70
    exit 1
 
71
fi
 
72
BOOT_IMAGE_KERNEL=`cd "$DI_PATH/current/images" && ls $SUBARCH/cdrom/vmlinuz*`
 
73
if [ -z "$BOOT_IMAGE_KERNEL" ]; then
 
74
    echo "no kernel found in $DI_PATH/current/images/$SUBARCH/cdrom/!" >&2
 
75
    exit 1
 
76
fi
 
77
BOOT_IMAGES="$BOOT_IMAGES $BOOT_IMAGE_KERNEL"
 
78
 
 
79
#### the snippet below was copied from the i386 version
 
80
# Download boot images
 
81
for image in $BOOT_IMAGES $DISK_IMAGES $TAR_IMAGES; do
 
82
    if [ ! -e "$image" ]; then
 
83
        dir=$(dirname $image)
 
84
        mkdir -p $dir
 
85
        if [ ! "$DI_WWW_HOME" ];then
 
86
                cp "$DI_PATH/current/images/$image" "$image"
 
87
        else
 
88
                wget "$DI_WWW_HOME/$image" -O "$image"
 
89
        fi
 
90
    fi
 
91
done
 
92
 
 
93
if [ "$BOOT_IMAGE_KERNEL" != "$SUBARCH/cdrom/vmlinuz" ]; then
 
94
    mv "$BOOT_IMAGE_KERNEL" "$SUBARCH/cdrom/vmlinuz"
 
95
fi
 
96
 
 
97
if [ "$NN" = "1" ]; then
 
98
    check_kernel_sync udeb.list $FLAVOUR
 
99
 
 
100
    do_uboot=0
 
101
    if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
102
        do_uboot=1
 
103
        uboot_desc="Ubuntu Alternate Installer"
 
104
        uboot_input_kernel="$CDDIR/cdrom/uImage.in"
 
105
        uboot_input_initrd="$CDDIR/cdrom/uInitrd.in"
 
106
        uboot_kernel="/cdrom/uImage"
 
107
        uboot_initrd="/cdrom/uInitrd"
 
108
        uboot_extra_cmdline=" cdrom-detect/try-usb=true"
 
109
 
 
110
        mkdir -p "`dirname "$uboot_input_kernel"`"
 
111
        cp -lf "$SUBARCH/cdrom/vmlinuz"   "$uboot_input_kernel"
 
112
        cp -lf "$SUBARCH/cdrom/initrd.gz" "$uboot_input_initrd"
 
113
    fi
 
114
 
 
115
    if [ "$CDIMAGE_LIVE" = 1 ]; then
 
116
        do_uboot=1
 
117
        uboot_desc="Ubuntu LiveCD"
 
118
        uboot_input_kernel="$CDDIR/casper/filesystem.kernel-$FLAVOUR"
 
119
        uboot_input_initrd="$CDDIR/casper/filesystem.initrd-$FLAVOUR"
 
120
        uboot_kernel="/casper/uImage"
 
121
        uboot_initrd="/casper/uInitrd"
 
122
        uboot_extra_cmdline=" -- boot=casper"
 
123
    fi
 
124
 
 
125
    if [ "$do_uboot" ]; then
 
126
        uboot_script_text="$CDDIR/boot.script"
 
127
        uboot_script_image="$CDDIR/boot.scr"
 
128
        uboot_kernel_addr="0x00200000"
 
129
        uboot_ramdisk_addr="0x01100000"
 
130
        uboot_script_addr="0x1000"
 
131
 
 
132
        rm -f "$uboot_script_text"
 
133
        cat >"$uboot_script_text" <<EOF
 
134
if test -n \${fs} && test -n \${interface} && test -n \${device}; then
 
135
        \${fs}load \${interface} \${device} $uboot_kernel_addr $uboot_kernel
 
136
        \${fs}load \${interface} \${device} $uboot_ramdisk_addr $uboot_initrd
 
137
        setenv bootargs quiet splash $DEFAULT_PRESEED $uboot_extra_cmdline
 
138
        bootm $uboot_kernel_addr $uboot_ramdisk_addr
 
139
fi
 
140
 
 
141
echo boot information not recieved from u-boot, scanning for startup device
 
142
 
 
143
if test -n \${reinitalize_devices}; then
 
144
        usb start;
 
145
        ide reset;
 
146
fi
 
147
 
 
148
for i in usb ide; do 
 
149
        for j in 0 1; do
 
150
                for l in / /boot/; do
 
151
                        for m in fat ext2; do
 
152
                                setenv interface \$i;
 
153
                                setenv device \$j;
 
154
                                setenv prefix \$l;
 
155
                                setenv fs \$m;
 
156
 
 
157
                                echo Scanning \${fs} \${interface} \${device} on prefix \${prefix} ...;
 
158
                                # This if will always return true on stock u-boot 1.3.4. Canonical u-boot 
 
159
                                # from October 1st or later backport a fix to make this if work as expected;
 
160
                                # This if prevents us from accidently loading an old image, and thus isn't
 
161
                                # essential, but it is nice to have
 
162
 
 
163
                                # This "if" avoids loading an old image but
 
164
                                # doesn't work in stock u-boot 1.3.4 and is
 
165
                                # only fixed in Canonical u-boot from October
 
166
                                # 1st or later
 
167
 
 
168
                                if \${fs}load \${interface} \${device} $uboot_script_addr \${prefix}boot.scr; then
 
169
                                        if imi $uboot_script_addr; then
 
170
                                                echo boot.scr found! Executing ...;
 
171
                                                autoscr $uboot_script_addr;
 
172
                                        fi;
 
173
                                fi
 
174
                        done;
 
175
                done;
 
176
        done;
 
177
done
 
178
echo No boot device found.;
 
179
EOF
 
180
        mkimage -A arm -T script -C none -n "Ubuntu boot script" -d "$uboot_script_text" "$uboot_script_image"
 
181
        rm -vf "$uboot_script_text"
 
182
 
 
183
        rm -f "$CDDIR/$uboot_kernel"
 
184
        mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Ubuntu Kernel" -d "$uboot_input_kernel" "$CDDIR/$uboot_kernel"
 
185
        rm -vf "$uboot_input_kernel"
 
186
 
 
187
        rm -f "$CDDIR/$uboot_initrd"
 
188
        mkimage -A arm -O linux -T ramdisk -C gzip -a 0x0 -e 0x0 -n "Ubuntu Initrd" -d "$uboot_input_initrd" "$CDDIR/$uboot_initrd"
 
189
        rm -vf "$uboot_input_initrd"
 
190
    fi
 
191
fi
 
192
 
 
193
# th,th, thats all