[Midnightbsd-cvs] src [11846] trunk/release/powerpc: add ppc

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Jul 12 20:52:09 EDT 2018


Revision: 11846
          http://svnweb.midnightbsd.org/src/?rev=11846
Author:   laffer1
Date:     2018-07-12 20:52:09 -0400 (Thu, 12 Jul 2018)
Log Message:
-----------
add ppc

Added Paths:
-----------
    trunk/release/powerpc/
    trunk/release/powerpc/boot.tbxi
    trunk/release/powerpc/generate-hfs.sh
    trunk/release/powerpc/hfs-boot.bz2.uu
    trunk/release/powerpc/make-memstick.sh
    trunk/release/powerpc/mkisoimages.sh
    trunk/release/powerpc/powerpc.conf
    trunk/release/powerpc/powerpc64.conf

Added: trunk/release/powerpc/boot.tbxi
===================================================================
--- trunk/release/powerpc/boot.tbxi	                        (rev 0)
+++ trunk/release/powerpc/boot.tbxi	2018-07-13 00:52:09 UTC (rev 11846)
@@ -0,0 +1,15 @@
+<CHRP-BOOT>
+<LICENSE>
+$MidnightBSD$
+</LICENSE>
+<COMPATIBLE>
+MacRISC MacRISC3 MacRISC4
+</COMPATIBLE>
+<DESCRIPTION>
+MidnightBSD/PPC bootloader
+</DESCRIPTION>
+<BOOT-SCRIPT>
+" screen" output
+boot cd:,\boot\loader cd:0
+</BOOT-SCRIPT>
+</CHRP-BOOT>


Property changes on: trunk/release/powerpc/boot.tbxi
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: trunk/release/powerpc/generate-hfs.sh
===================================================================
--- trunk/release/powerpc/generate-hfs.sh	                        (rev 0)
+++ trunk/release/powerpc/generate-hfs.sh	2018-07-13 00:52:09 UTC (rev 11846)
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+# 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.
+
+# $MidnightBSD$
+
+HFS_SIZE=400		#Size in 2048-byte blocks of the produced image
+LOADER_SIZE=300k
+
+# Generate 800K HFS image
+OUTPUT_FILE=hfs-boot
+
+dd if=/dev/zero of=$OUTPUT_FILE bs=2048 count=$HFS_SIZE
+hformat -l "MidnightBSD 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
+<CHRP-BOOT>
+<DESCRIPTION>MidnightBSD/powerpc bootloader</DESCRIPTION>
+<OS-NAME>MidnightBSD</OS-NAME>
+<VERSION> $MidnightBSD: head/sys/boot/powerpc/boot1.chrp/bootinfo.txt 184490 2008-10
+-31 00:52:31Z nwhitehorn $ </VERSION>
+
+<COMPATIBLE>
+MacRISC MacRISC3 MacRISC4
+</COMPATIBLE>
+<BOOT-SCRIPT>
+" screen" output
+boot &device;:,\ppc\loader &device;:0
+</BOOT-SCRIPT>
+</CHRP-BOOT>
+EOF
+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
+humount
+
+rm bootinfo.txt
+rm loader.tmp
+
+bzip2 $OUTPUT_FILE
+echo 'HFS boot filesystem created by generate-hfs.sh' > $OUTPUT_FILE.bz2.uu
+echo 'DO NOT EDIT' >> $OUTPUT_FILE.bz2.uu
+echo '$MidnightBSD$' >> $OUTPUT_FILE.bz2.uu
+
+uuencode $OUTPUT_FILE.bz2 $OUTPUT_FILE.bz2 >> $OUTPUT_FILE.bz2.uu
+rm $OUTPUT_FILE.bz2
+


Property changes on: trunk/release/powerpc/generate-hfs.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/release/powerpc/hfs-boot.bz2.uu
===================================================================
--- trunk/release/powerpc/hfs-boot.bz2.uu	                        (rev 0)
+++ trunk/release/powerpc/hfs-boot.bz2.uu	2018-07-13 00:52:09 UTC (rev 11846)
@@ -0,0 +1,23 @@
+HFS boot filesystem created by generate-hfs.sh
+DO NOT EDIT
+$MidnightBSD$
+begin 644 hfs-boot.bz2
+M0EIH.3%!62936=#$Y.(``"___?_O_G)7!_Y]OW??5#]U_^!`0`, at 1`!!``!@
+M(0!`3,`"L"4.2U"2(H9%/:*>TFDVU3RGZID'J&C3U, at T-&@`/1!H>IZC1D#(
+M`D24TTRFC1D]*;$@!IZ at Q!IH-````#0&33":?J@<:&AH:`:`Q`T!D``&F@`:
+M`9````PDI1J>0Q,H/1J&@```!D-`````T-``#SZHHR(+Y*Y9J*Z:4KK=T]W@
+M4RV\LG/;0XDPC7^`9DO3/3&*].462T,NO#AA9C,O\0!)^Q@@S6";2`!);<W\
+MM\)T,GR:I$-V("3$9$B"&8,,*RS at L++(8KPP)-C!L0(22AH:=29JC18OSD at O
+M&&`F8 at M#$H:5#;%`Q)(22DF(/IB46IH0H?):$7!BU_SU=DL`+E*J,;0?%AW6
+M#\-_#^NL++6(CI"!)*#8N/S2"7!C_QAB8[(ZW3G$\`G81HL8.H^M8?#(Z"JL
+M;J^PI=+>?8(B6BR1(-7Q*8?>>HPQSBQE>M$A9K6FFW<:#6[D931J%U.F8*`0
+MD(,M80A(0;]K'X'SI]G(C)Y).AK_/0)D(2$$]JB$]]F').M4RF8O%[IHK[0O
+MMQ?'>O[U8EM;>U<P%^7)&#;>",KY^*%FO9C05_435?.4*F[6AIL%&9C<9W&&
+M[ZMP(TG!'*4Z>@6TM)0BS.D._O,WR9OJ728V48I;DD=8QGBE7J-&L^?=0JEF
+MV2`B/)/D\)83IS at 32(;!P,152U()0VGQH>2F$UC:M!D5`F#1W$\:KKDR[TQB
+MN;N<J=4-1'[HLG,!L^IJG53+[IORM_L7JB/:/<+:634`XD.R'",=M$A;C4E.
+M$RRHL2;B)D:_ZJVK$Z*40?H'TATSF5$$%L@<LB4`\2$P90.50PWE:'REG6\D
+ML%>5B1;P!7:AG#1BP2%-Q$7I6QE,Y?NHIK_LR+HA]22HW0.8(^G4/X`Z@!Z6
+8#PQ(0))/`A(0.'VUG_\7<D4X4)#0Q.3B
+`
+end


Property changes on: trunk/release/powerpc/hfs-boot.bz2.uu
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: trunk/release/powerpc/make-memstick.sh
===================================================================
--- trunk/release/powerpc/make-memstick.sh	                        (rev 0)
+++ trunk/release/powerpc/make-memstick.sh	2018-07-13 00:52:09 UTC (rev 11846)
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# This script generates a "memstick image" (image that can be copied to a
+# USB memory stick) from a directory tree.  Note that the script does not
+# clean up after itself very well for error conditions on purpose so the
+# problem can be diagnosed (full filesystem most likely but ...).
+#
+# Usage: make-memstick.sh <directory tree> <image filename>
+#
+# $MidnightBSD$
+#
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+export PATH
+
+BLOCKSIZE=10240
+
+if [ $# -ne 2 ]; then
+  echo "make-memstick.sh /path/to/directory /path/to/image/file"
+  exit 1
+fi
+
+tempfile="${2}.$$"
+
+if [ ! -d ${1} ]; then
+  echo "${1} must be a directory"
+  exit 1
+fi
+
+if [ -e ${2} ]; then
+  echo "won't overwrite ${2}"
+  exit 1
+fi
+
+echo '/dev/da0s3 / ufs ro,noatime 1 1' > ${1}/etc/fstab
+echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local
+rm -f ${tempfile}
+makefs -B big ${tempfile} ${1}
+if [ $? -ne 0 ]; then
+  echo "makefs failed"
+  exit 1
+fi
+rm ${1}/etc/fstab
+rm ${1}/etc/rc.conf.local
+
+mkimg -s apm -p mnbsd-boot:=${1}/boot/boot1.hfs -p mnbsd-ufs/MidnightBSD_Install:=${tempfile} -o ${2}
+
+rm -f ${tempfile}
+


Property changes on: trunk/release/powerpc/make-memstick.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/release/powerpc/mkisoimages.sh
===================================================================
--- trunk/release/powerpc/mkisoimages.sh	                        (rev 0)
+++ trunk/release/powerpc/mkisoimages.sh	2018-07-13 00:52:09 UTC (rev 11846)
@@ -0,0 +1,69 @@
+#!/bin/sh
+#
+# Module: mkisoimages.sh
+# Author: Jordan K Hubbard
+# Date:   22 June 2001
+#
+# $MidnightBSD$
+#
+# This script is used by release/Makefile to build the (optional) ISO images
+# for a MidnightBSD release.  It is considered architecture dependent since each
+# platform has a slightly unique way of making bootable CDs.  This script
+# is also allowed to generate any number of images since that is more of
+# publishing decision than anything else.
+#
+# Usage:
+#
+# mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir]
+#
+# Where -b is passed if the ISO image should be made "bootable" by
+# whatever standards this architecture supports (may be unsupported),
+# image-label is the ISO image label, image-name is the filename of the
+# resulting ISO image, base-bits-dir contains the image contents and
+# extra-bits-dir, if provided, contains additional files to be merged
+# into base-bits-dir as part of making the image.
+
+if [ "x$1" = "x-b" ]; then
+	# Apple boot code
+	uudecode -o /tmp/hfs-boot-block.bz2 "`dirname "$0"`/hfs-boot.bz2.uu"
+	bzip2 -d /tmp/hfs-boot-block.bz2
+	OFFSET=$(hd /tmp/hfs-boot-block | grep 'Loader START' | cut -f 1 -d ' ')
+	OFFSET=0x$(echo 0x$OFFSET | awk '{printf("%x\n",$1/512);}')
+	dd if="$4/boot/loader" of=/tmp/hfs-boot-block seek=$OFFSET conv=notrunc
+
+	bootable="-o bootimage=macppc;/tmp/hfs-boot-block -o no-emul-boot"
+
+	# pSeries/PAPR boot code
+	mkdir -p "$4/ppc/chrp"
+	cp "$4/boot/loader" "$4/ppc/chrp"
+	cat > "$4/ppc/bootinfo.txt" << EOF
+<chrp-boot>
+<description>MidnightBSD Install</description>
+<os-name>MidnightBSD</os-name>
+<boot-script>boot &device;:,\ppc\chrp\loader</boot-script>
+</chrp-boot>
+EOF
+	bootable="$bootable -o chrp-boot"
+
+	# Playstation 3 boot code
+	echo "MidnightBSD Install='/boot/loader.ps3'" > "$4/etc/kboot.conf"
+
+	shift
+else
+	bootable=""
+fi
+
+if [ $# -lt 3 ]; then
+	echo "Usage: $0 [-b] image-label image-name base-bits-dir [extra-bits-dir]"
+	exit 1
+fi
+
+LABEL=`echo "$1" | tr '[:lower:]' '[:upper:]'`; shift
+NAME="$1"; shift
+
+publisher="The MidnightBSD Project.  http://www.MidnightBSD.org/"
+echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab"
+makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@"
+rm "$1/etc/fstab"
+rm /tmp/hfs-boot-block
+rm -rf "$1/ppc"


Property changes on: trunk/release/powerpc/mkisoimages.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/release/powerpc/powerpc.conf
===================================================================
--- trunk/release/powerpc/powerpc.conf	                        (rev 0)
+++ trunk/release/powerpc/powerpc.conf	2018-07-13 00:52:09 UTC (rev 11846)
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# $MidnightBSD$
+#
+
+# Configuration file for release/release.sh to build powerpc/powerpc.
+
+TARGET="powerpc"
+TARGET_ARCH="powerpc"
+KERNEL="GENERIC"


Property changes on: trunk/release/powerpc/powerpc.conf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/release/powerpc/powerpc64.conf
===================================================================
--- trunk/release/powerpc/powerpc64.conf	                        (rev 0)
+++ trunk/release/powerpc/powerpc64.conf	2018-07-13 00:52:09 UTC (rev 11846)
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# $MidnightBSD$
+#
+
+# Configuration file for release/release.sh to build powerpc/powerpc64.
+
+TARGET="powerpc"
+TARGET_ARCH="powerpc64"
+KERNEL="GENERIC64"


Property changes on: trunk/release/powerpc/powerpc64.conf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list