1 Patch for the Ubuntu (feisty) ps3-kboot package, to add petitboot support.
3 Just apply this patch, download libtwin-0.0.1.tar.gz and petitboot-0.0.1.tar.gz
4 to the dl/ directory, and build.
6 More info at http://ozlabs.org/~jk/projects/petitboot/
8 --- ps3-kboot.orig/ps3-kboot-0.1/Makefile 2007-04-05 20:10:44.000000000 +1000
9 +++ ps3-kboot/ps3-kboot-0.1/Makefile 2007-04-04 20:54:40.000000000 +1000
11 LOCAL_KERNEL_CONFIG=$(PWD)/config/kernel-config
12 LOCAL_KBOOT_CONF=$(PWD)/config/kboot.conf
13 LOCAL_FSTAB=$(PWD)/config/fstab
14 +LOCAL_UDEV_RULES=$(PWD)/config/65-persistent-storage.rules \
15 + $(PWD)/config/99-petitboot.rules
16 KBOOT_MESSAGE=$(PWD)/config/message
17 KBOOT_FEATURES=$(PWD)/config/kboot-features
20 BUSYBOX_DIR=busybox-$(BUSYBOX_VERSION)
21 BUSYBOX_PACKAGE=busybox-$(BUSYBOX_VERSION).tar.bz2
24 +TWIN_DIR=libtwin-$(TWIN_VERSION)
25 +TWIN_PACKAGE=libtwin-$(TWIN_VERSION).tar.gz
27 +PETITBOOT_VERSION=0.0.1
28 +PETITBOOT_DIR=petitboot-$(PETITBOOT_VERSION)
29 +PETITBOOT_PACKAGE=petitboot-$(PETITBOOT_VERSION).tar.gz
31 # ----- General settings ------------------------------------------------------
35 root: root-meta/installed/userspace \
36 root-meta/installed/kexec-tools \
37 root-meta/installed/busybox \
38 - Makefile scripts/kboot \
39 + root-meta/installed/twin \
40 + root-meta/installed/petitboot \
41 + Makefile scripts/kboot scripts/petitboot-init \
42 utils/readline utils/getctty \
43 $(LOCAL_KBOOT_CONF) $(KBOOT_MESSAGE) \
44 - $(KBOOT_FEATURES) $(LOCAL_FSTAB)
45 + $(KBOOT_FEATURES) $(LOCAL_FSTAB) \
47 rm -f root/etc/{hosts,passwd,kboot.conf,message}
48 rm -rf root/tmp root/dev
49 + rm -rf root/include root/usr/include
50 + find root/ -name '*.a' -o -name '*.la' -exec rm {} \;
51 mkdir -p root/etc root/tmp root/proc root/dev root/sys
52 mkdir -p root/mnt/tmp root/mnt/root root/bin root/sbin
53 + mkdir -p root/var/tmp
54 + mkdir -p root/etc/udev/rules.d
55 [ -e root/dev/console ] || mknod root/dev/console c 5 1
56 [ -e root/dev/null ] || mknod root/dev/null c 1 3
57 [ -e root/dev/tty ] || mknod root/dev/tty c 5 0
59 cp "$(KBOOT_MESSAGE)" root/etc/
60 cp "$(LOCAL_FSTAB)" root/etc/
61 cp "$(KBOOT_FEATURES)" root/etc/
62 + cp $(LOCAL_UDEV_RULES) root/etc/udev/rules.d/
64 install -D -m755 scripts/kboot root/sbin/kboot
65 + install -D -m755 scripts/petitboot-init root/sbin/petitboot-init
66 install -D -s -m755 utils/readline root/bin/readline
67 install -D -s -m755 utils/getctty root/sbin/getctty
68 - ln -sf /sbin/kboot root/init
69 - for FILE in $$( find root/bin root/sbin \
70 + ln -sf /sbin/petitboot-init root/init
71 + for FILE in $$( find root/bin root/sbin root/lib/udev \
72 -type f -perm -100 ) ; do \
73 LIBS=$$( ldd $$FILE | awk '/=>.*\.so/ { print $$3 }' | grep -v fakeroot ) ; \
74 for LIB in $$LIBS ; do \
75 + [ -e root/$$LIB ] && continue; \
76 LIB_PATH=$$( echo $$LIB | sed -e 's/[^/]*$$//' ) ; \
77 mkdir -p root/$$LIB_PATH ; \
78 cp $$LIB root/$$LIB_PATH ; \
80 install -m755 -D /sbin/udevtrigger root/sbin/udevtrigger
81 install -m755 -D /sbin/udevsettle root/sbin/udevsettle
82 install -m644 -D /etc/udev/udev.conf root/etc/udev/udev.conf
84 + while read helper; do install -m755 -D /lib/udev/$$helper \
85 + root/lib/udev/$$helper; done < config/udev-helpers
86 + cp -a /lib/udev/devices root/lib/udev/
88 install -m755 -D /sbin/other-os-flash-util \
89 $(PWD)/root/sbin/other-os-flash-util
94 +# ----- twin library ----------------------------------------------------------
96 +$(TWIN_DIR)/.twin-extracted: \
98 + tar xfz dl/$(TWIN_PACKAGE)
99 + for i in `ls patches/twin/$(TWIN_VERSION)/*patch*` ; do \
100 + patch -d $(TWIN_DIR) -p1 < $$i ; \
104 +$(TWIN_DIR)/.twin-configured: \
105 + $(TWIN_DIR)/.twin-extracted
106 + ( cd $(TWIN_DIR) && \
107 + ./configure --prefix=/ --disable-x11 $(GNU_ARCH); )
110 +$(TWIN_DIR)/.twin-built: \
111 + $(TWIN_DIR)/.twin-configured
112 + make -C $(TWIN_DIR)
115 +root-meta/installed/twin: \
116 + $(TWIN_DIR)/.twin-built
117 + mkdir -p root root-meta/installed
118 + make -C $(TWIN_DIR) DESTDIR=$(PWD)/root install
119 + strip root/lib/libtwin.so
120 + rm root/lib/libtwin.a
123 +# ----- petitboot GUI ----------------------------------------------------------
125 +$(PETITBOOT_DIR)/.petitboot-extracted: \
126 + dl/$(PETITBOOT_PACKAGE)
127 + tar xfz dl/$(PETITBOOT_PACKAGE)
128 + for i in `ls patches/petitboot/$(PETITBOOT_VERSION)/*patch*` ; do \
129 + patch -d $(PETITBOOT_DIR) -p1 < $$i ; \
133 +$(PETITBOOT_DIR)/.petitboot-built: \
134 + $(PETITBOOT_DIR)/.petitboot-extracted root-meta/installed/twin
135 + make -C $(PETITBOOT_DIR) PREFIX=/ "TWIN_CFLAGS=-I$(PWD)/root/include" \
136 + "TWIN_LDFLAGS=-L$(PWD)/root/lib -ltwin -ljpeg -lpng -lz"
139 +root-meta/installed/petitboot: \
140 + $(PETITBOOT_DIR)/.petitboot-built
141 + mkdir -p root root-meta/installed
142 + make -C $(PETITBOOT_DIR) PREFIX=/ DESTDIR=$(PWD)/root/ install
143 + strip root/sbin/petitboot root/sbin/udev-helper
146 # ----- kboot's utilities -----------------------------------------------------
149 # ---- Cleanup ----------------------------------------------------------------
152 - rm -rf $(KERNEL_DIR) $(KEXEC_TOOLS_DIR) $(BUSYBOX_DIR)
153 + rm -rf $(KERNEL_DIR) $(KEXEC_TOOLS_DIR) $(BUSYBOX_DIR) $(TWIN_DIR) \
155 rm -rf root root-meta otheros.bld initrd.bin
156 rm -f otheros.bld initrd.bin utils/getctty utils/readline
157 diff -urN ps3-kboot.orig/ps3-kboot-0.1/config/65-persistent-storage.rules ps3-kboot/ps3-kboot-0.1/config/65-persistent-storage.rules
158 --- ps3-kboot.orig/ps3-kboot-0.1/config/65-persistent-storage.rules 1970-01-01 10:00:00.000000000 +1000
159 +++ ps3-kboot/ps3-kboot-0.1/config/65-persistent-storage.rules 2007-04-03 10:08:03.000000000 +1000
161 +# persistent storage links: /dev/{disk,tape}/{by-id,by-uuid,by-label,by-path,by-name}
162 +# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>
164 +SUBSYSTEM!="block", GOTO="persistent_storage_end"
166 +KERNEL=="md*", ACTION=="add|change", PROGRAM="watershed -i udev-mdadm true", GOTO="persistent_storage_path_uuid"
168 +KERNEL=="dm-*", ACTION=="add|change", PROGRAM="devmap_name %M %m", NAME="mapper/$result", GOTO="persistent_storage_identify"
169 +KERNEL=="dm-*", ACTION=="add|change", NAME=""
171 +ACTION!="add", GOTO="persistent_storage_end"
173 +# skip rules for inappropriate block devices
174 +KERNEL=="ram*|loop*|fd*|nbd*|gnbd*", GOTO="persistent_storage_end"
176 +# never access non-cdrom removable ide devices, the drivers are causing event loops on open()
177 +KERNEL=="hd*[!0-9]", ATTRS{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end"
178 +KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end"
180 +# never add uuid information for whole disk
181 +ATTR{whole_disk}=="", GOTO="persistent_storage_end"
183 +# for partitions import parent information
184 +KERNEL=="*[0-9]", IMPORT{parent}="ID_*"
186 +# by-id (hardware serial number)
187 +KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
188 +KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
189 +KERNEL=="hd*[0-9]", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
191 +KERNEL=="sd*[!0-9]|sr*|st*", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
192 +KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x"
193 +KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
194 +KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
195 +KERNEL=="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode"
196 +KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
197 +KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
198 +KERNEL=="st*", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
200 +LABEL="persistent_storage_path_uuid"
202 +# by-path (shortest physical path)
203 +KERNEL=="*[!0-9]|sr*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
204 +KERNEL=="st*", IMPORT{program}="path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}"
205 +KERNEL=="sr*|st*", GOTO="persistent_storage_end"
206 +KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
208 +LABEL="persistent_storage_identify"
210 +# by-label/by-uuid (filesystem properties)
211 +KERNEL=="*[!0-9]", ATTR{removable}=="1", GOTO="persistent_storage_end"
212 +IMPORT{program}="vol_id --export $tempnode"
213 +ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
214 +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
216 +# BIOS Enhanced Disk Device
217 +KERNEL=="*[!0-9]", IMPORT{program}="edd_id --export $tempnode"
218 +KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
219 +KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
221 +LABEL="persistent_storage_end"
222 diff -urN ps3-kboot.orig/ps3-kboot-0.1/config/99-petitboot.rules ps3-kboot/ps3-kboot-0.1/config/99-petitboot.rules
223 --- ps3-kboot.orig/ps3-kboot-0.1/config/99-petitboot.rules 1970-01-01 10:00:00.000000000 +1000
224 +++ ps3-kboot/ps3-kboot-0.1/config/99-petitboot.rules 2007-04-03 16:07:23.000000000 +1000
226 +# tell petitboot when we see new block devices ...
227 +SUBSYSTEM=="block",RUN+="/sbin/udev-helper"
228 diff -urN ps3-kboot.orig/ps3-kboot-0.1/config/udev-helpers ps3-kboot/ps3-kboot-0.1/config/udev-helpers
229 --- ps3-kboot.orig/ps3-kboot-0.1/config/udev-helpers 1970-01-01 10:00:00.000000000 +1000
230 +++ ps3-kboot/ps3-kboot-0.1/config/udev-helpers 2007-04-05 14:21:52.000000000 +1000
244 diff -urN ps3-kboot.orig/ps3-kboot-0.1/scripts/petitboot-init ps3-kboot/ps3-kboot-0.1/scripts/petitboot-init
245 --- ps3-kboot.orig/ps3-kboot-0.1/scripts/petitboot-init 1970-01-01 10:00:00.000000000 +1000
246 +++ ps3-kboot/ps3-kboot-0.1/scripts/petitboot-init 2007-04-05 15:37:48.000000000 +1000
250 +# kboot - Kboot initialization and command-line interface
252 +# Written 2005, 2006 by Werner Almesberger
255 +if [ "x$0" = x/init ]; then
261 +###############################################################################
263 +# System setup and internal initialization
267 + if [ ! -f /proc/partitions ]; then
268 + mount -n -t proc none /proc
270 + if [ ! -d /sys/block ]; then
271 + mount -n -t sysfs none /sys
273 + # Borrowed from initramfs tools. No more hard coded sleep
274 + echo "" > /proc/sys/kernel/hotplug
277 + udevsettle --timeout=15
285 + # clean up after petitboot
286 + for dir in /var/tmp/mnt-*;
295 + /sbin/getctty /dev/console /bin/sh
297 --- ps3-kboot.orig/ps3-kboot-0.1/debian/control 2007-04-05 20:10:44.000000000 +1000
298 +++ ps3-kboot/ps3-kboot-0.1/debian/control 2007-04-03 15:54:04.000000000 +1000
302 Maintainer: Ben Collins <bcollins@ubuntu.com>
303 -Build-Depends: debhelper (>= 4.1.67), bzip2, cdbs, fakeroot, udev, ps3pf-utils, libc6-dev-ppc64, lib64z1-dev
304 +Build-Depends: debhelper (>= 4.1.67), bzip2, cdbs, fakeroot, udev, ps3pf-utils, libc6-dev-ppc64, lib64z1-dev, libpng12-dev, libjpeg62-dev, pkg-config
305 Standards-Version: 3.6.1