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

« back to all changes in this revision

Viewing changes to tools/boot/maverick/boot-powerpc

  • 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 powerpc, 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
INSTALLDIR=$CDDIR/install
 
16
if [ "$DI_WWW_HOME" = "default" ];then
 
17
   DI_WWW_HOME="http://people.debian.org/~luther/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
# Only disk 1* bootable
 
31
if [ $N != 1 ] && [ $N != 1_NONUS ] && [ -z "$CDIMAGE_ADDON" ]; then
 
32
    # we don't need HFS cruft on anything but CD 1
 
33
        :> $N.mkisofs_opts
 
34
        exit 0
 
35
fi
 
36
 
 
37
install_languages $CDDIR
 
38
 
 
39
echo -n "--netatalk -hfs -probe -map $BASEDIR/data/hfs.map" \
 
40
        > $N.mkisofs_opts
 
41
# We are still missing this for prep
 
42
#echo -n " -prep-boot install/powerpc/vmlinuz-prep.initrd" >> $N.mkisofs_opts
 
43
echo -n " -chrp-boot -iso-level 2" >> $N.mkisofs_opts
 
44
# For newworld Mac booting  - Note, no spaces in volid!
 
45
echo -n " -part -no-desktop -hfs-bless CD$N/install -hfs-volid ${CAPPROJECT}_PowerPC_${CODENAME} " \
 
46
        >> $N.mkisofs_opts
 
47
# Recommended size for a HFS Catalog is 4 megas per giga, defaults to 4 megas
 
48
if [ "$CDIMAGE_DVD" = 1 ]; then
 
49
  if [ -n "$SIZELIMIT1" ];then
 
50
    if [ "$SIZELIMIT1" -gt 1000000000 ];then
 
51
      let newsize="$SIZELIMIT1"/256
 
52
      echo -n " -hfs-parms MAX_XTCSIZE=$newsize" >> $N.mkisofs_opts
 
53
    fi
 
54
  else
 
55
    if [ -n "$SIZELIMIT" ];then
 
56
      if [ "$SIZELIMIT" -gt 1000000000 ];then
 
57
        let newsize="$SIZELIMIT"/256
 
58
        echo -n " -hfs-parms MAX_XTCSIZE=$newsize" >> $N.mkisofs_opts
 
59
      fi
 
60
    else
 
61
      if [ -n "$DEFBINSIZE" ] && [ "$DEFBINSIZE" -gt 1000 ];then
 
62
        let newsize="$DEFBINSIZE"*4096
 
63
        echo -n " -hfs-parms MAX_XTCSIZE=$newsize" >> $N.mkisofs_opts
 
64
      fi
 
65
    fi
 
66
  fi
 
67
fi
 
68
 
 
69
"$BASEDIR/tools/sorting_weights" "$N"
 
70
echo -n " -sort $(pwd)/$N.weights " >> $N.mkisofs_opts
 
71
 
 
72
cd $INSTALLDIR
 
73
# Extract yaboot from the archive
 
74
if [ -z "$YABOOT_DEBUG" ]; then
 
75
    YADEB="$($BASEDIR/tools/apt-selection cache show yaboot | \
 
76
           grep ^Filename | awk '{print $2}')"
 
77
    (ar p "${MIRROR}/${YADEB}" data.tar.gz | \
 
78
        tar zxf - -C . ./usr/lib/yaboot/yaboot)
 
79
    mv usr/lib/yaboot/yaboot .
 
80
    rm -rf usr
 
81
else
 
82
 cp -f $YABOOT_DEBUG yaboot
 
83
fi
 
84
 
 
85
if [ ! "$DI_WWW_HOME" ]; then
 
86
  cp -a "$DI_PATH/current/images/udeb.list" .
 
87
else
 
88
  wget "$DI_WWW_HOME/udeb.list"
 
89
fi
 
90
(cd $CDDIR/..; check_kernel_sync udeb.list)
 
91
 
 
92
for subarch in powerpc powerpc64
 
93
do
 
94
  if [ ! "$DI_WWW_HOME" ];then
 
95
        DI_DIR="$DI_PATH/current/images/$subarch/cdrom"
 
96
  else
 
97
        DI_DIR="di_stuff"
 
98
        for image in initrd.gz vmlinux; do
 
99
                dir="$(dirname "$image")"
 
100
                mkdir -p "$DI_DIR/$dir"
 
101
                wget "$DI_WWW_HOME/$subarch/cdrom/$image" -O "$DI_DIR/$image"
 
102
        done
 
103
  fi
 
104
  if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
105
    cp -dR --preserve=mode,timestamps "$DI_DIR" "$subarch"
 
106
    rm -rf di_stuff
 
107
    # Remove special initrds we don't want. OldWorld isn't supported due to
 
108
    # the lack of boot support, and space restrictions are too tight to
 
109
    # support CHRP (including Pegasos) and PReP except on DVDs.
 
110
    rm -f "$subarch/vmlinuz-coff.initrd"
 
111
    if [ "$CDIMAGE_DVD" != 1 ]; then
 
112
      rm -f "$subarch/vmlinuz-chrp.initrd"
 
113
      rm -f "$subarch/vmlinuz-prep.initrd" "$subarch/vmlinuz-ppcbug.initrd"
 
114
    fi
 
115
  fi
 
116
  if [ "$CDIMAGE_LIVE" = 1 ]; then
 
117
    case $subarch in
 
118
      powerpc)
 
119
        casper_subarch=powerpc
 
120
        casper_initrd_var=CASPER_POWERPC_INITRD
 
121
        ;;
 
122
      powerpc64)
 
123
        casper_subarch=powerpc64-smp
 
124
        casper_initrd_var=CASPER_POWERPC64_INITRD
 
125
        ;;
 
126
    esac
 
127
    mkdir -p "$CDDIR/casper/$subarch"
 
128
    mv "$CDDIR/casper/filesystem.kernel-$casper_subarch" \
 
129
       "$CDDIR/casper/$subarch/vmlinux"
 
130
    eval "$casper_initrd_var=/casper/$subarch/initrd$(initrd_suffix "$CDDIR/casper/filesystem.kernel-$casper_subarch")"
 
131
    eval mv "$CDDIR/casper/filesystem.initrd-$casper_subarch" \
 
132
            "$CDDIR\$$casper_initrd_var"
 
133
  fi
 
134
done
 
135
 
 
136
if [ "$CDIMAGE_LIVE" = 1 ]; then
 
137
    timeout='timeout=300'
 
138
else
 
139
    timeout=
 
140
fi
 
141
 
 
142
#
 
143
# generate/download images for "powerpc"
 
144
# (missing: bootvars1.3b.sit.hqx, BootX_1.2.2.sit, boot-floppy-hfs.img)
 
145
BUILD_DATE="${CDIMAGE_DATE:-$(date +%Y%m%d)}"
 
146
(if [ "$CDIMAGE_DVD" = 1 ] && [ "$CDIMAGE_LIVE" = 1 ]; then
 
147
     cat $BASEDIR/data/$CODENAME/yaboot/boot.msg.dvd
 
148
 elif [ "$CDIMAGE_INSTALL" = 1 ]; then
 
149
     cat $BASEDIR/data/$CODENAME/yaboot/boot.msg.install
 
150
 elif [ "$CDIMAGE_LIVE" = 1 ]; then
 
151
     cat $BASEDIR/data/$CODENAME/yaboot/boot.msg.live
 
152
 fi) \
 
153
 | sed "s/\${MEDIA_TYPE}/CDROM/" \
 
154
 | sed "s/\${DEBIAN_VERSION}/${DEBVERSION}/g" \
 
155
 | sed "s/\${CODENAME}/${CAPCODENAME}/g" \
 
156
 | sed "s/\${BUILD_DATE}/${BUILD_DATE}/g" \
 
157
 | sed "s#Ubuntu#$HUMANPROJECT#g" \
 
158
 > boot.msg
 
159
(if [ "$CDIMAGE_LIVE" = 1 ]; then
 
160
     sed 's/\${DEFAULT}/live/g' $BASEDIR/data/$CODENAME/yaboot/yaboot.conf
 
161
 else
 
162
     sed 's/\${DEFAULT}/install/g' $BASEDIR/data/$CODENAME/yaboot/yaboot.conf
 
163
 fi
 
164
 if [ "$CDIMAGE_LIVE" = 1 ]; then
 
165
     cat $BASEDIR/data/$CODENAME/yaboot/yaboot.conf.live
 
166
 fi
 
167
 if [ "$CDIMAGE_INSTALL" = 1 ]; then
 
168
     cat $BASEDIR/data/$CODENAME/yaboot/yaboot.conf.install
 
169
     if [ "$PROJECT" = edubuntu ]; then
 
170
         cat $BASEDIR/data/$CODENAME/yaboot/yaboot.conf.workstation
 
171
     fi
 
172
     if [ "$PROJECT" != edubuntu ]; then
 
173
         cat $BASEDIR/data/$CODENAME/yaboot/yaboot.conf.oem
 
174
     fi
 
175
 fi
 
176
 if [ "$CDIMAGE_INSTALL_BASE" = 1 ] && [ "$PROJECT" != ubuntu-server ]; then
 
177
     cat $BASEDIR/data/$CODENAME/yaboot/yaboot.conf.cli
 
178
 fi
 
179
 if [ "$CDIMAGE_INSTALL" = 1 ] && ([ "$PROJECT" = ubuntu ] || [ "$PROJECT" = xubuntu ]); then
 
180
     cat $BASEDIR/data/$CODENAME/yaboot/yaboot.conf.ltsp
 
181
 fi
 
182
 if [ "$CDIMAGE_LIVE" = 1 ]; then
 
183
     cat $BASEDIR/data/$CODENAME/yaboot/yaboot.conf.check-live
 
184
 elif [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
185
     cat $BASEDIR/data/$CODENAME/yaboot/yaboot.conf.check
 
186
 fi
 
187
 if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
188
     cat $BASEDIR/data/$CODENAME/yaboot/yaboot.conf.rescue
 
189
 fi) \
 
190
 | sed "s/CODENAME/${CODENAME}/g" \
 
191
 | sed "s,\${DEFAULT_PRESEED},${DEFAULT_PRESEED},g" \
 
192
 | sed "s,\${TIMEOUT},${timeout},g" \
 
193
 | sed "s,\${CASPER_POWERPC_INITRD},${CASPER_POWERPC_INITRD},g" \
 
194
 | sed "s,\${CASPER_POWERPC64_INITRD},${CASPER_POWERPC64_INITRD},g" \
 
195
 > yaboot.conf
 
196
cp $BASEDIR/data/$CODENAME/yaboot/ofboot.b ofboot.b
 
197
 
 
198
# for CHRP systems
 
199
mkdir "$CDDIR/etc"
 
200
cp -a "$CDDIR/install/yaboot.conf" "$CDDIR/etc/yaboot.conf"
 
201
mkdir "$CDDIR/ppc"
 
202
< $BASEDIR/data/$CODENAME/yaboot/bootinfo.txt \
 
203
    sed "s/\${HUMANPROJECT}/$HUMANPROJECT/g" \
 
204
  | sed "s/\${CODENAME}/$CODENAME/g" \
 
205
  > "$CDDIR/ppc/bootinfo.txt"
 
206
 
 
207
# Copy pegasos forth script, since pegasos machines don't support yaboot yet.
 
208
cat $BASEDIR/data/$DI_CODENAME/pegasos/pegasos \
 
209
 | sed "s/\${MEDIA_TYPE}/CDROM/" \
 
210
 | sed "s/\${DEBIAN_VERSION}/${CODENAME}/g" \
 
211
 | sed "s/\${BUILD_DATE}/${BUILD_DATE}/g" \
 
212
 > pegasos
 
213
 
 
214
exit 0