3
# Do install stuff for armel+dove, including making bootable CDs
4
# Works with debian-installer
7
# $2 is the temporary CD build dir
12
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
19
if [ "$DI_WWW_HOME" = "default" ];then
20
DI_WWW_HOME="http://people.debian.org/~joeyh/d-i/images/daily"
22
if [ ! "$DI_DIST" ]; then
23
export DI_DIST="$DI_CODENAME"
25
if [ -z "$DI_PATH" ]; then
26
DI_PATH="$($BASEDIR/tools/find-newest-installer)"
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.
38
# Strip NONUS part of disk number
39
# NN will be 1...N so it can be used as an index
41
NN=`echo $N | sed -e 's/_NONUS//'`
43
if [ "$CDIMAGE_ADDON" ]; then
44
# second disk, at least in spirit
48
if [ "$IMAGE_FORMAT" = iso ]; then
49
echo -n "-J -joliet-long " > $N.mkisofs_opts
51
"$BASEDIR/tools/sorting_weights" "$N"
52
echo -n "-sort $(pwd)/$N.weights " >> $N.mkisofs_opts
55
if [ "$IMAGE_FORMAT" != vfat ]; then
56
echo "armel booting for image format '$IMAGE_FORMAT' disabled for now"
60
# XXX hardcodes SUBARCH / FLAVOUR
64
BOOT_IMAGES="udeb.list $SUBARCH/cdrom/initrd.gz"
68
if [ "$DI_WWW_HOME" ]; then
69
echo "boot-armel does not support DI_WWW_HOME mode at the moment" >&2
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
77
BOOT_IMAGES="$BOOT_IMAGES $BOOT_IMAGE_KERNEL"
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
85
if [ ! "$DI_WWW_HOME" ];then
86
cp "$DI_PATH/current/images/$image" "$image"
88
wget "$DI_WWW_HOME/$image" -O "$image"
93
if [ "$BOOT_IMAGE_KERNEL" != "$SUBARCH/cdrom/vmlinuz" ]; then
94
mv "$BOOT_IMAGE_KERNEL" "$SUBARCH/cdrom/vmlinuz"
97
if [ "$NN" = "1" ]; then
98
check_kernel_sync udeb.list $FLAVOUR
101
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
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"
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"
115
if [ "$CDIMAGE_LIVE" = 1 ]; then
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"
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"
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
141
echo boot information not recieved from u-boot, scanning for startup device
143
if test -n \${reinitalize_devices}; then
150
for l in / /boot/; do
151
for m in fat ext2; do
152
setenv interface \$i;
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
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
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;
178
echo No boot device found.;
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"
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"
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"