3 # This script generates the dummy HFS filesystem used for the PowerPC boot
4 # blocks. It uses hfsutils (emulators/hfsutils) to generate a template
5 # filesystem with the relevant interesting files. These are then found by
6 # grep, and the offsets written to a Makefile snippet.
8 # Because of licensing concerns, and because it is overkill, we do not
9 # distribute hfsutils as a build tool. If you need to regenerate the HFS
10 # template (e.g. because the boot block or the CHRP script have grown),
11 # you must install it from ports.
15 HFS_SIZE=400 #Size in 2048-byte blocks of the produced image
18 # Generate 800K HFS image
21 dd if=/dev/zero of=$OUTPUT_FILE bs=2048 count=$HFS_SIZE
22 hformat -l "FreeBSD Install" $OUTPUT_FILE
25 # Create and bless a directory for the boot loader
30 # Make the CHRP boot script, which gets loader from the ISO9660 partition
31 cat > bootinfo.txt << EOF
33 <DESCRIPTION>FreeBSD/powerpc bootloader</DESCRIPTION>
34 <OS-NAME>FreeBSD</OS-NAME>
35 <VERSION> $FreeBSD: head/stand/powerpc/boot1.chrp/bootinfo.txt 184490 2008-10
36 -31 00:52:31Z nwhitehorn $ </VERSION>
39 MacRISC MacRISC3 MacRISC4
43 boot &device;:,\ppc\loader &device;:0
47 echo 'Loader START' | dd of=loader.tmp cbs=$LOADER_SIZE count=1 conv=block
49 hcopy bootinfo.txt :bootinfo.txt
50 hcopy loader.tmp :loader
51 hattrib -c chrp -t tbxi bootinfo.txt
58 echo 'HFS boot filesystem created by generate-hfs.sh' > $OUTPUT_FILE.bz2.uu
59 echo 'DO NOT EDIT' >> $OUTPUT_FILE.bz2.uu
60 echo '$FreeBSD$' >> $OUTPUT_FILE.bz2.uu
62 uuencode $OUTPUT_FILE.bz2 $OUTPUT_FILE.bz2 >> $OUTPUT_FILE.bz2.uu