~cyphermox/debian-cd/default-language

« back to all changes in this revision

Viewing changes to tools/boot/wily/boot-i386+mac

  • Committer: Adam Conrad
  • Date: 2015-05-08 05:28:37 UTC
  • Revision ID: adconrad@0c3.net-20150508052837-5ju3owc7o0evjcy3
Copy vivid -> wily, and add wily to CONF.sh

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
3
# Do install stuff for i386/mac, 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://people.debian.org/~joeyh/d-i/images/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
> $N.mkisofs_opts
 
41
 
 
42
case "$MKISOFS" in
 
43
    *xorriso*)
 
44
        echo -n "-isohybrid-mbr syslinux/usr/lib/ISOLINUX/isohdpfx.bin " >> $N.mkisofs_opts
 
45
        echo -n "-partition_offset 16 " >> $N.mkisofs_opts
 
46
        # uncomment to add a small FAT partition on the media
 
47
        # /sbin/mkfs.msdos -n Bla -C test.fat 8192
 
48
        # echo -n "-append_partition 2 0x01 test.fat " >> $N.mkisofs_opts
 
49
        ;;
 
50
esac
 
51
 
 
52
# List of boot image for each CD
 
53
KTYPE[1]="" #elilo multiboot in fact
 
54
KTYPE[2]="cdrom"
 
55
# XXX add net-image back when it's fixed
 
56
KTYPE[3]=""
 
57
KTYPE[4]=""
 
58
KTYPE[5]=""
 
59
KTYPE[6]=""
 
60
KTYPE[7]=""
 
61
KTYPE[8]=""
 
62
KTYPE[9]=""
 
63
KTYPE[10]=""
 
64
 
 
65
THISTYPE=${KTYPE[$NN]}
 
66
 
 
67
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
 
68
DISK_IMAGES=""
 
69
TAR_IMAGES="netboot/netboot.tar.gz"
 
70
 
 
71
# Download boot images
 
72
for image in MANIFEST.udebs $BOOT_IMAGES $DISK_IMAGES $TAR_IMAGES; do
 
73
    if [ ! -e "$image" ]; then
 
74
        dir=$(dirname $image)
 
75
        mkdir -p $dir
 
76
        if [ ! "$DI_WWW_HOME" ];then
 
77
                cp "$DI_PATH/current/images/$image" "$image"
 
78
        else
 
79
                wget "$DI_WWW_HOME/$image" -O "$image"
 
80
        fi
 
81
    fi
 
82
done
 
83
 
 
84
if [ "$NN" = "1" ]; then
 
85
    list_kernel_abis $BOOT_IMAGES | check_kernel_sync
 
86
 
 
87
    mkdir -p $CDDIR/../syslinux
 
88
    SYSLINUXDEB="$($BASEDIR/tools/apt-selection cache show syslinux-common | \
 
89
        grep ^Filename | awk '{print $2}')"
 
90
    (dpkg --fsys-tarfile "$MIRROR/$SYSLINUXDEB" | \
 
91
        tar xf - -C $CDDIR/../syslinux ./usr/lib)
 
92
    ISOLINUXDEB="$($BASEDIR/tools/apt-selection cache show isolinux | \
 
93
        grep ^Filename | awk '{print $2}')"
 
94
    (dpkg --fsys-tarfile "$MIRROR/$ISOLINUXDEB" | \
 
95
        tar xf - -C $CDDIR/../syslinux ./usr/lib)
 
96
 
 
97
    echo "Using elilo boot-disks image on CD$N"
 
98
    mkdir -p boot$N/install
 
99
    ELILODEB="$($BASEDIR/tools/apt-selection cache show elilo | \
 
100
        grep ^Filename | awk '{print $2}')"
 
101
    (dpkg --fsys-tarfile "$MIRROR/$ELILODEB" | \
 
102
        tar xf - -C . ./usr/lib/elilo/elilo.efi)
 
103
    mv usr/lib/elilo/elilo.efi boot$N/install/
 
104
 
 
105
    rm -rf usr
 
106
    if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
107
        cp -lf cdrom/vmlinuz $CDDIR/install/
 
108
        cp -lf cdrom/initrd.gz $CDDIR/install/
 
109
    fi
 
110
    if [ "$CDIMAGE_LIVE" = 1 ]; then
 
111
        mv $CDDIR/casper/filesystem.kernel-386 $CDDIR/casper/vmlinuz
 
112
        CASPER_INITRD="/casper/initrd$(initrd_suffix "$CDDIR/casper/filesystem.initrd-386")"
 
113
        mv $CDDIR/casper/filesystem.initrd-386 "$CDDIR$CASPER_INITRD"
 
114
    fi
 
115
    echo -n "-cache-inodes -J -l " >> $N.mkisofs_opts
 
116
    # HFS hybrid filesystem for booting on Intel-based Macs
 
117
    echo -n "--netatalk -hfs -probe -map $BASEDIR/data/hfs.map " >> $N.mkisofs_opts
 
118
    echo -n "-part -no-desktop -hfs-bless CD$N/install -hfs-bless-file CD$N/install/elilo.efi -hfs-volid ${CAPPROJECT}_i386_${CODENAME} " >> $N.mkisofs_opts
 
119
    # Recommended size for an HFS catalog is 4 MB per GB, defaults to 4 MB
 
120
    if [ "$SIZELIMIT1" ]; then
 
121
        if [ "$SIZELIMIT1" -gt 1000000000 ]; then
 
122
            echo -n "-hfs-parms MAX_XTCSIZE=$(($SIZELIMIT1 / 256)) " >> $N.mkisofs_opts
 
123
        fi
 
124
    elif [ "$SIZELIMIT" ]; then
 
125
        if [ "$SIZELIMIT" -gt 1000000000 ]; then
 
126
            echo -n "-hfs-parms MAX_XTCSIZE=$(($SIZELIMIT / 256)) " >> $N.mkisofs_opts
 
127
        fi
 
128
    elif [ "$DEFBINSIZE" ]; then
 
129
        if [ "$DEFBINSIZE" -gt 1000 ]; then
 
130
            echo -n "-hfs-parms MAX_XTCSIZE=$(($DEFBINSIZE * 4096)) " >> $N.mkisofs_opts
 
131
        fi
 
132
    fi
 
133
fi
 
134
 
 
135
case "$MKISOFS" in
 
136
    *xorriso*)
 
137
        ;;
 
138
    *)
 
139
        "$BASEDIR/tools/sorting_weights" "$N"
 
140
        echo -n "-sort $(pwd)/$N.weights " >> $N.mkisofs_opts
 
141
        ;;
 
142
esac
 
143
 
 
144
#install_languages $CDDIR
 
145
 
 
146
# Only disk one gets the extra files installed
 
147
#
 
148
if [ "$NN" = "1" ]; then
 
149
 
 
150
 
 
151
# populate the install directory as well
 
152
for disk in $DISK_IMAGES; do
 
153
        dir=$(dirname $disk)
 
154
        mkdir -p $CDDIR/install/$dir
 
155
        cp -lf $disk $CDDIR/install/$dir
 
156
done
 
157
 
 
158
if [ "$CDIMAGE_INSTALL" = 1 ]; then
 
159
        for tar in $TAR_IMAGES; do
 
160
                dir=$(dirname $tar)
 
161
                mkdir -p $CDDIR/install/$dir
 
162
                tar -C $CDDIR/install/$dir -xzpf $tar
 
163
        done
 
164
fi
 
165
 
 
166
# elilo setup
 
167
 
 
168
# Extract memtest86+ from the archive
 
169
MEMTEST86DEB="$($BASEDIR/tools/apt-selection cache show memtest86+ | \
 
170
        grep ^Filename | awk '{print $2}')"
 
171
dpkg --fsys-tarfile "$MIRROR/$MEMTEST86DEB" | \
 
172
        tar xf - -C $CDDIR/install/ ./boot/memtest86+.bin
 
173
mv $CDDIR/install/boot/memtest86+.bin $CDDIR/install/mt86plus
 
174
rm -rf $CDDIR/install/boot
 
175
# elilo help files come from d-i.
 
176
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/install/; tar zx)
 
177
# Remove ISOLINUX configuration; only for non-Macs.
 
178
rm -f boot$N/install/isolinux*
 
179
rm -f boot$N/install/*.txt*
 
180
rm -f boot$N/install/*.hlp*
 
181
# Override splash screen.
 
182
if [ "$SPLASHRLE" ] && [ -e "$SPLASHRLE" ]; then
 
183
    cp -p "$SPLASHRLE" boot$N/install/splash.rle
 
184
fi
 
185
if [ "$GFXSPLASH" ] && [ -e "$GFXSPLASH" ]; then
 
186
    cp -p "$GFXSPLASH" boot$N/install/splash.pcx
 
187
fi
 
188
if [ "$CDIMAGE_INSTALL" = 1 ]; then
 
189
    rm -f boot$N/install/*.msg.live
 
190
else
 
191
    for x in boot$N/install/*.msg.live; do
 
192
        [ -f "$x" ] || continue
 
193
        mv "$x" "${x%.live}"
 
194
    done
 
195
    for x in boot$N/install/*.msg.live; do
 
196
        [ -f "$x" ] || continue
 
197
        mv "$x" "${x%.live}"
 
198
    done
 
199
fi
 
200
 
 
201
fi
 
202
 
 
203
# write final lines to mkisofs_opts
 
204
if [ "$NN" = "1" ]; then
 
205
    echo -n "boot$N " >> $N.mkisofs_opts
 
206
else
 
207
    if [ -n "$THISTYPE" ]; then
 
208
        echo -n "-c boot/boot.catalog boot$N "  >> $N.mkisofs_opts
 
209
    fi
 
210
fi
 
211
 
 
212
# th,th, thats all