ppcrcd: Makefile boot.dir/boot.msg.net boot.dir/prep-tftp-files.sh boot.dir/yaboot.conf.net doc/READ...

sparky cvs at pld-linux.org
Sat Sep 24 16:19:24 CEST 2005


Author: sparky
Date: Sat Sep 24 16:19:13 2005
New Revision: 6407

Added:
   ppcrcd/boot.dir/boot.msg.net
   ppcrcd/boot.dir/prep-tftp-files.sh   (contents, props changed)
   ppcrcd/boot.dir/yaboot.conf.net
   ppcrcd/doc/README.netbooting
Modified:
   ppcrcd/Makefile
Log:
- booting via tftp


Modified: ppcrcd/Makefile
==============================================================================
--- ppcrcd/Makefile	(original)
+++ ppcrcd/Makefile	Sat Sep 24 16:19:13 2005
@@ -1,6 +1,7 @@
 
 #         @_VERSION_@
-VERSION = XP(TM)     
+VERSION = XP(TM)
+VER13 = $(shell echo '"$(VERSION)"           ' | cut -c 1-13 )
 # XP means: same shit but with more features
 
 REVISION = HEAD
@@ -82,10 +83,12 @@
 
 boot:	root.installed initrd.sqf yaboot/yaboot
 	mkdir boot.work
-	cp boot.dir/{hfs.map,boot.msg,yaboot.conf,*.help} boot.work
+	cp boot.dir/{hfs.map,boot.msg,boot.msg.net,yaboot.conf,yaboot.conf.net,*.help} boot.work
 	rm -f boot.work/*~
-	sed -e 's/@_VERSION_@/$(VERSION)/g'	\
-		-i boot.work/boot.msg
+	sed -e 's/"@_VERSION_@"/$(VER13)/g'	\
+		-i boot.work/boot.msg		\
+		-i boot.work/boot.msg.net
+	cp root.inst/boot/vmlinux-* boot.work/vmlinux
 	cp root.inst/boot/vmlinux-* boot.work/vmlinux
 	strip boot.work/vmlinux
 	strip -R.comment boot.work/vmlinux

Added: ppcrcd/boot.dir/boot.msg.net
==============================================================================
--- (empty file)
+++ ppcrcd/boot.dir/boot.msg.net	Sat Sep 24 16:19:13 2005
@@ -0,0 +1,33 @@
+
+                                                   ÜÜŰŰŰÜ
+    ŰŰŰŰŰŰŰ  ŰŰ       ŰŰŰŰŰŰ                     ÜŰß   ŰŰÝ
+    ŰŰŰŰŰŰŰŰ ŰŰ       ŰŰŰŰŰŰŰ                   ÜŰß    ÜŰ
+   ŰŰ °°°ŰŰ°ŰŰ °°    ŰŰ °°°ŰŰ°                 ÜŰß    ÜŰ
+   ŰŰ °°°ŰŰ°ŰŰ °°    ŰŰ °°°ŰŰ°°              ÜŰß     ÜŰ
+  ŰŰŰŰŰŰŰŰ ŰŰ °°    ŰŰ °° ŰŰ °°             ŰŰ      Űß
+  ŰŰŰŰŰŰŰ  ŰŰ °°    ŰŰ °° ŰŰ °°           ÜŰß     ÜŰß
+ ŰŰ °°°°°°ŰŰ °°    ŰŰ °° ŰŰ °°           ÜŰß     ÜŰß
+ ŰŰ °°°°°°ŰŰ °°    ŰŰ °° ŰŰ °°          ÜŰ      Űß
+ŰŰ °°    ŰŰŰŰŰŰŰŰ ŰŰŰŰŰŰŰ  °°          Űß      ÜŰ   ÜŰ
+ŰŰ °°    ŰŰŰŰŰŰŰŰ ŰŰŰŰŰŰ   °°          ß      ÜŰß  ßŰŰŰÜ
+  °°       °°°°°°°° °°°°°°°                 ÜŰŰ      ßŰŰŰÜ
+  °°       °°°°°°°° °°°°°°                  ŰŰ         ßŰŰŰ
+                                            ŰŰ          ßŰŰŰ
+ Welcome to PPCRCD, version "@_VERSION_@"  ŢŰŰ           ßŰŰŰ
+  PLD Linux Distribution based RescueCD     ŰŰÜ           ßŰŰÜ
+   mainly for NewWorld PowerMac computers   ßŰŰŰÜ          ßŰŰ
+                                             ßŰŰŰÜ        ŰÜßŰÝ
+    maintaner: sparky at pld-linux.org           ßŰŰŰŰÜÜ     ßŰÜßŰ
+    weg page: http://ppcrcd.pld-linux.org          ŢŰ      ŰŰŢŰÜ
+                                                    ŢŰ     ŢŰÝŰß
+  defined images:                                    ŰÝ     ŰÝŰŰ
+   tomem (9) - load whole image to memory            ŰÝ     ŰŰŰÝ
+                                                     ŰÝ     ŢŰŰ
+                                                     ŰÝ      ŰŰ
+                                                     ŰÝ      ßŰ
+                                                     ŰÝ       ß
+                                                     ŰÝ
+                                                     ŰÝ
+                                                     ŰÝ
+ press '1' or type "pld" to get more help            ŰŰ
+

Added: ppcrcd/boot.dir/prep-tftp-files.sh
==============================================================================
--- (empty file)
+++ ppcrcd/boot.dir/prep-tftp-files.sh	Sat Sep 24 16:19:13 2005
@@ -0,0 +1,75 @@
+#!/bin/sh
+# $Id$
+#
+# prepare files for netboot'ing
+# this script should be compatible with other unices, but who cares...
+
+IN=$(cd "$(dirname "$0")/.."; pwd)
+OUT="/var/lib/tftp"
+
+usage() {
+cat << EOF
+$0 will help you to prepare files for tftp.
+Options:
+    --help          - this help message
+    --tftpdir <DIR> - dir where prepared files should be placed
+	              default is: $OUT
+    --rcddir <DIR>  - dir where ppcrcd is mounted
+                      default is: $IN
+EOF
+exit 0
+}
+
+while [ $# -gt 0 ]; do
+	case "$1" in
+		--tftpdir)
+			shift
+			OUT="$1"
+			;;
+		--rcddir)
+			shift
+			IN="$1"
+			;;
+		-h | -help | --help)
+			usage
+			;;
+		*)
+			echo "Unknown option: $1" >&1
+			usage
+			;;
+	esac
+	shift
+done
+
+if ! [ -w "$OUT" ]; then
+	echo "Error: write permission in \`$OUT' is required" >&2
+	exit 1
+fi
+
+cd "$OUT"
+SIZE=$(stat -c "%s" $IN/ppcrcd.sqf)
+MD5=$(md5sum "$IN/ppcrcd.sqf" | awk '{print $1}')
+
+# split to 3.5MB files
+for P in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
+	dd if="$IN/ppcrcd.sqf" of=p.$P bs=3584k count=1 skip=`expr $P - 1`
+	[ $(stat -c "%s" p.$P) == 0 ] && rm p.$P && break
+done
+
+FILES=$( cd $OUT; echo p.? p.?? | sed 's/p/\/p/g; s/ /|/g;' )
+MD5_2=$(cat p.? p.?? | md5sum | awk '{print $1}')
+
+if [ "$MD5" -ne "$MD5_2" ]; then
+	echo "Error: whole image md5 differs from parts md5!" >&2
+	exit 2
+fi
+
+mkdir ppc boot
+cp "$IN/ppc/bootinfo.txt" ppc
+cp "$IN/boot/"{yaboot,vmlinux.gz,boot.msg.net,*.help} boot
+sed -e "s/@SIZE@/$SIZE/; s_ at FILES@_${FILES}_;" \
+	"$IN/boot/yaboot.conf.net" > boot/yaboot.conf
+# setup all rw-r--r-- and add to dirs
+chmod -R "u=rw,g=r,o=r,a+X" .
+
+echo "DONE"

Added: ppcrcd/boot.dir/yaboot.conf.net
==============================================================================
--- (empty file)
+++ ppcrcd/boot.dir/yaboot.conf.net	Sat Sep 24 16:19:13 2005
@@ -0,0 +1,42 @@
+root=/dev/ram0
+timeout=1000
+
+message=/boot/boot.msg.net
+
+fgcolor=blue
+bgcolor=white
+
+
+text=/boot/pld.help
+	label=pld
+	alias=1
+	single-key
+
+text=/boot/images.help
+	label=images
+	alias=2
+	single-key
+
+text=/boot/options1.help
+	label=opts1
+	alias=3
+	single-key
+
+text=/boot/options2.help
+	label=opts2
+	alias=4
+	single-key
+
+text=/boot/ide.help
+	label=ide
+
+image=/boot/vmlinux.gz
+	initrd=@FILES@
+	initrd-size=@SIZE@
+	label=tomem
+	alias=9
+	append="init=/linuxrc"
+	read-only
+	single-key
+
+# vi:syntax=yaboot

Added: ppcrcd/doc/README.netbooting
==============================================================================
--- (empty file)
+++ ppcrcd/doc/README.netbooting	Sat Sep 24 16:19:13 2005
@@ -0,0 +1,18 @@
+
+1. install and prepare DHCP server
+in PLD you have only to add:
+next-server <server_pi>;
+in /etc/dhcpd.conf
+
+2. install and prepare tftp (tftp-hpa) server
+
+3. mount ppcrcd image and execute boot/prep-tftp-files.sh
+($ prep-tftp-files.sh --help) may help you
+remember you nead to have write permisions to tftp dir
+
+4. reboot your PPC to Open Firmware (Command+Option+O+F on most Mac's)
+type:
+boot enet:,\ppc\bootinfo.txt
+
+and wait until yaboot boots, in yaboot you should select 'tomem' image
+that's all (for now)



More information about the pld-cvs-commit mailing list