~cyphermox/debian-cd/ubuntu-server-live

« back to all changes in this revision

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

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