path: root/release/powerpc/generate-hfs.sh
diff options
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>2011-05-04 23:34:10 +0000
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>2011-05-04 23:34:10 +0000
commitd16401694fb301f8fa6341077c2d3b11627365dd (patch)
tree96e3ca4ff727d1ea1ebdf482f3bc2df0bfae24cb /release/powerpc/generate-hfs.sh
parentb815af1b74e3dbefeda847a5753e5f04257a7943 (diff)
Change the way powerpc bootable CDs are generated to work around a bug
in hybrid image generation in cdrtools. This produces a small HFS partition containing loader, mapped in by an oddly-formed APM table using a new feature in makefs. This does not appear to work yet on early-model G3 systems, which will be fixed later, but produces bootable CDs on everything else.
Notes: svn path=/head/; revision=221465
Diffstat (limited to 'release/powerpc/generate-hfs.sh')
1 files changed, 64 insertions, 0 deletions
diff --git a/release/powerpc/generate-hfs.sh b/release/powerpc/generate-hfs.sh
new file mode 100755
index 000000000000..c445fea5df04
--- /dev/null
+++ b/release/powerpc/generate-hfs.sh
@@ -0,0 +1,64 @@
+# This script generates the dummy HFS filesystem used for the PowerPC boot
+# blocks. It uses hfsutils (emulators/hfsutils) to generate a template
+# filesystem with the relevant interesting files. These are then found by
+# grep, and the offsets written to a Makefile snippet.
+# Because of licensing concerns, and because it is overkill, we do not
+# distribute hfsutils as a build tool. If you need to regenerate the HFS
+# template (e.g. because the boot block or the CHRP script have grown),
+# you must install it from ports.
+# $FreeBSD$
+HFS_SIZE=400 #Size in 2048-byte blocks of the produced image
+# Generate 800K HFS image
+dd if=/dev/zero of=$OUTPUT_FILE bs=2048 count=$HFS_SIZE
+hformat -l "FreeBSD Install" $OUTPUT_FILE
+hmount $OUTPUT_FILE
+# Create and bless a directory for the boot loader
+hmkdir ppc
+hattrib -b ppc
+hcd ppc
+# Make the CHRP boot script, which gets loader from the ISO9660 partition
+cat > bootinfo.txt << EOF
+<DESCRIPTION>FreeBSD/powerpc bootloader</DESCRIPTION>
+<VERSION> $FreeBSD: head/sys/boot/powerpc/boot1.chrp/bootinfo.txt 184490 2008-10
+-31 00:52:31Z nwhitehorn $ </VERSION>
+" screen" output
+boot &device;:,\ppc\loader &device;:0
+echo 'Loader START' | dd of=loader.tmp cbs=$LOADER_SIZE count=1 conv=block
+hcopy bootinfo.txt :bootinfo.txt
+hcopy loader.tmp :loader
+hattrib -c chrp -t tbxi bootinfo.txt
+rm bootinfo.txt
+rm loader.tmp
+echo 'HFS boot filesystem created by generate-hfs.sh' > $OUTPUT_FILE.bz2.uu
+echo 'DO NOT EDIT' >> $OUTPUT_FILE.bz2.uu
+echo '$FreeBSD$' >> $OUTPUT_FILE.bz2.uu
+uuencode $OUTPUT_FILE.bz2 $OUTPUT_FILE.bz2 >> $OUTPUT_FILE.bz2.uu
+rm $OUTPUT_FILE.bz2