Debian Codegraph @

tools/boot/forky/boot-powerpc

raw
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 #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 # mkisofs options specific to powerpc
24 add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-hfsplus -apm-block-size 2048"
25 add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-hfsplus-file-creator-type chrp tbxi /System/Library/CoreServices/BootX"
26 add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-hfs-bless-by p /System/Library/CoreServices"
27 add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-sysid PPC -graft-points"
28 add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "/System/Library/CoreServices/BootX=$CDDIR/../CD1/boot/grub/powerpc-ieee1275/grub.chrp"
29 add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "/System/Library/CoreServices/grub.elf=$CDDIR/../CD1/boot/grub/powerpc.elf"
30
31 # Exit if this is not CD#1/DVD#1
32 if [ $N != "1" ]; then
33 exit 0
34 fi
35
36 if [ "$DI_WWW_HOME" = "default" ]; then
37 DI_WWW_HOME="https://d-i.debian.org/daily-images/powerpc/daily"
38 try_di_image_cache
39 else
40 DI_WWW_HOME=$(echo $DI_WWW_HOME | sed "s,%ARCH%,$ARCH,")
41 fi
42
43 case "$MKISOFS" in
44 *xorriso*)
45 XORRISO_VER=$(xorriso_version)
46 ;;
47 *)
48 echo "ERROR: debian-cd now depends on xorriso for making powerpc bootable CDs."
49 exit 1;
50 ;;
51 esac
52
53 cd $CDDIR/..
54
55 BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinux cdrom/debian-cd_info.tar.gz"
56
57 # Download boot images.
58 for image in $BOOT_IMAGES; do
59 if [ ! -e "$image" ]; then
60 dir=$(dirname $image)
61 mkdir -p $dir
62 if [ -n "$LOCAL" -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
63 cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
64 elif [ ! "$DI_WWW_HOME" ];then
65 if [ ! "$DI_DIR" ];then
66 DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
67 fi
68 cp "$DI_DIR/$image" "$image"
69 else
70 $WGET "$DI_WWW_HOME/$image" -O "$image"
71 fi
72 fi
73 done
74
75 # Boot setup including config and help files comes from d-i.
76 mkdir -pv $PWD/CD$N
77 cat cdrom/debian-cd_info.tar.gz | (cd CD$N/; tar zx)
78
79 # Copy kernel and initrd
80 mkdir -p $INSTALLDIR
81 cp -lf cdrom/vmlinux $INSTALLDIR/
82 cp -lf cdrom/initrd.gz $INSTALLDIR/
83
84 # Add CHRP boot header
85 if [ -f CD$N/ppc/bootinfo.txt ] ; then
86 add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-chrp-boot-part"
87 fi
88
89 exit 0