| 1 |
#!/bin/bash |
| 2 |
# |
| 3 |
# Do install stuff for ppc64el, 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 |
#set -x |
| 13 |
|
| 14 |
N=$1 |
| 15 |
CDDIR=$2 |
| 16 |
INSTALLDIR=$CDDIR/install |
| 17 |
|
| 18 |
# Common mkisofs options when creating CDs |
| 19 |
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long" |
| 20 |
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes" |
| 21 |
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-l" |
| 22 |
|
| 23 |
# Exit if this is not CD#1/DVD#1 |
| 24 |
if [ $N != "1" ]; then |
| 25 |
exit 0 |
| 26 |
fi |
| 27 |
|
| 28 |
if [ "$DI_WWW_HOME" = "default" ]; then |
| 29 |
DI_WWW_HOME="https://d-i.debian.org/daily-images/ppc64el/daily" |
| 30 |
try_di_image_cache |
| 31 |
else |
| 32 |
DI_WWW_HOME=$(echo $DI_WWW_HOME | sed "s,%ARCH%,$ARCH,") |
| 33 |
fi |
| 34 |
|
| 35 |
case "$MKISOFS" in |
| 36 |
*xorriso*) |
| 37 |
XORRISO_VER=$(xorriso_version) |
| 38 |
;; |
| 39 |
*) |
| 40 |
echo "ERROR: debian-cd now depends on xorriso for making ppc64el bootable CDs." |
| 41 |
exit 1; |
| 42 |
;; |
| 43 |
esac |
| 44 |
|
| 45 |
cd $CDDIR/.. |
| 46 |
|
| 47 |
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinux cdrom/debian-cd_info.tar.gz" |
| 48 |
|
| 49 |
# Download boot images. |
| 50 |
for image in $BOOT_IMAGES; do |
| 51 |
if [ ! -e "$image" ]; then |
| 52 |
dir=$(dirname $image) |
| 53 |
mkdir -p $dir |
| 54 |
if [ -n "$LOCAL" -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then |
| 55 |
cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image" |
| 56 |
elif [ ! "$DI_WWW_HOME" ];then |
| 57 |
if [ ! "$DI_DIR" ];then |
| 58 |
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images" |
| 59 |
fi |
| 60 |
cp "$DI_DIR/$image" "$image" |
| 61 |
else |
| 62 |
$WGET "$DI_WWW_HOME/$image" -O "$image" |
| 63 |
fi |
| 64 |
fi |
| 65 |
done |
| 66 |
|
| 67 |
# Boot setup including config and help files comes from d-i. |
| 68 |
mkdir -pv $PWD/CD$N |
| 69 |
cat cdrom/debian-cd_info.tar.gz | (cd CD$N/; tar zx) |
| 70 |
|
| 71 |
# Copy kernel and initrd |
| 72 |
mkdir -p $INSTALLDIR |
| 73 |
cp -lf cdrom/vmlinux $INSTALLDIR/ |
| 74 |
cp -lf cdrom/initrd.gz $INSTALLDIR/ |
| 75 |
|
| 76 |
# Add CHRP boot header |
| 77 |
if [ -f CD$N/ppc/bootinfo.txt ] ; then |
| 78 |
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-chrp-boot-part" |
| 79 |
fi |
| 80 |
|
| 81 |
exit 0 |