Hello community,
here is the log from the commit of package powerpc-utils
checked in at Mon Jan 7 12:38:31 CET 2008.
--------
--- arch/ppc/powerpc-utils/powerpc-utils.changes 2007-10-19 10:47:24.000000000 +0200
+++ /mounts/work_src_done/STABLE/powerpc-utils/powerpc-utils.changes 2008-01-07 09:03:22.359853000 +0100
@@ -1,0 +2,9 @@
+Fri Jan 4 14:36:33 CET 2008 - sassmann@suse.de
+
+- add sixaxis joypad support to petitboot
+- enable joystick support in kernel config
+- split petitboot patches into small components
+- patch libtwin to latest b9b2acf28d1ebad52de372a181dadf73455ad4de
+ snapshot from git://anongit.freedesktop.org/git/twin
+
+-------------------------------------------------------------------
Old:
----
libtwin.key-up-down.patch
petitboot-0.0.1.tar.bz2
petitboot.parsers.patch
New:
----
libtwin.patch2latest.patch
petitboot.add-default-entry.patch
petitboot.boot-game-os.patch
petitboot.continue-if-device-already-mounted.patch
petitboot.font.patch
petitboot.kboot-boot_args.patch
petitboot.kboot-conf-file-locations.patch
petitboot.kboot-no-root.patch
petitboot.tar.bz2
petitboot.videomode-switch.patch
petitboot.yaboot-suse.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ powerpc-utils.spec ++++++
--- /var/tmp/diff_new_pack.T10868/_old 2008-01-07 12:37:45.000000000 +0100
+++ /var/tmp/diff_new_pack.T10868/_new 2008-01-07 12:37:45.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package powerpc-utils (Version 1.0.6)
#
-# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@@ -11,12 +11,12 @@
# norootforbuild
Name: powerpc-utils
-BuildRequires: busybox dtc gcc41 glibc-devel grep kexec-tools libjpeg-devel libpng-devel librtas netcat pkg-config quilt udev util-linux zlib-devel
+BuildRequires: busybox dtc gcc41 glibc-devel grep kexec-tools libjpeg-devel libpng-devel librtas mingetty netcat pkg-config quilt udev util-linux zlib-devel
Obsoletes: powerpc-utils-papr
Obsoletes: ppc64-utils
Provides: ppc64-utils
Version: 1.0.6
-Release: 4
+Release: 24
License: IBM Public License
Url: http://powerpc-utils.ozlabs.org/
Group: System/Management
@@ -31,7 +31,7 @@
Source4: ps3config-2.6.22
Source5: geninitrd.sh
Source7: libtwin-0.0.2.tar.bz2
-Source8: petitboot-0.0.1.tar.bz2
+Source8: petitboot.tar.bz2
Source9: extract_from_elf.c
Source10: ps3-utils-19-05-2007.tar.bz2
Source11: ps3av.h
@@ -41,12 +41,20 @@
#Patch3, Patch4 obsolete with powerpc-utils 1.0.6
Patch5: powerpc-utils.nvram.short-write.patch
Patch6: powerpc-utils.ofpathname.flat-device-tree.patch
-Patch10: libtwin.key-up-down.patch
-Patch21: petitboot.pb_log.patch
-Patch22: petitboot.parsers.patch
-Patch23: petitboot.add-timeout.patch
-Patch24: petitboot.boot-screen.patch
-Patch25: petitboot.editor.patch
+Patch10: libtwin.patch2latest.patch
+Patch20: petitboot.pb_log.patch
+Patch21: petitboot.continue-if-device-already-mounted.patch
+Patch22: petitboot.kboot-conf-file-locations.patch
+Patch23: petitboot.kboot-no-root.patch
+Patch24: petitboot.kboot-boot_args.patch
+Patch25: petitboot.yaboot-suse.patch
+Patch26: petitboot.add-timeout.patch
+Patch27: petitboot.add-default-entry.patch
+Patch28: petitboot.boot-screen.patch
+Patch29: petitboot.font.patch
+Patch30: petitboot.editor.patch
+Patch31: petitboot.videomode-switch.patch
+Patch32: petitboot.boot-game-os.patch
%define build_kernel 1
%description
@@ -73,11 +81,19 @@
cd powerpc-utils-papr-%{papr_version}
cd ..
%patch10 -p1
+%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
+%patch26 -p1
+%patch27 -p1
+%patch28 -p1
+%patch29 -p1
+%patch30 -p1
+%patch31 -p1
+%patch32 -p1
%build
# workaround for using gcc41 to build
@@ -106,16 +122,16 @@
DESTDIR=`pwd`/../install-libtwin
cd ..
# make petitboot
-cd petitboot-0.0.1
+cd petitboot
make all \
CFLAGS="-Wall -I`pwd`/../install-libtwin%{_prefix}/include -I. -O -g" \
LDFLAGS=" -L`pwd`/../install-libtwin%{_libdir} -ltwin -lpng12 -ljpeg -lz"
make install \
DESTDIR=`pwd`/../install-petitboot
cd ..
-ln -sfn */petitboot petitboot
+#ln -sfn */petitboot petitboot
export LD_LIBRARY_PATH=`pwd`/install-libtwin%{_libdir}
-ldd petitboot
+#ldd petitboot
# make ps3-utils
cd ps3-utils
mkdir asm
@@ -184,7 +200,14 @@
%attr (755,root,root) /usr/lib/lib*
/usr/share/ps3/
%config %attr (755,root,root) /etc/init.d/ibmvscsis.sh
+
%changelog
+* Fri Jan 04 2008 - sassmann@suse.de
+- add sixaxis joypad support to petitboot
+- enable joystick support in kernel config
+- split petitboot patches into small components
+- patch libtwin to latest b9b2acf28d1ebad52de372a181dadf73455ad4de
+ snapshot from git://anongit.freedesktop.org/git/twin
* Thu Oct 18 2007 - sassmann@suse.de
- reapplied fixed patch powerpc-utils.ofpathname.show_of_path.patch
- patch powerpc-utils.ofpathname.correct-vscsi-scan.patch obsolete
++++++ geninitrd.sh ++++++
--- arch/ppc/powerpc-utils/geninitrd.sh 2007-10-19 10:47:24.000000000 +0200
+++ /mounts/work_src_done/STABLE/powerpc-utils/geninitrd.sh 2008-01-07 09:03:22.363852000 +0100
@@ -16,6 +16,7 @@
mkdir -p sbin bin lib lib64 usr etc var/tmp lib/udev
mkdir -p usr/share/petitboot/artwork/ usr/bin usr/sbin
cp -aL /sbin/kexec sbin/kexec.bin
+cp -aL /sbin/mingetty sbin/mingetty
cp -aL ../install-petitboot/usr/share usr
cp -aL ../install-petitboot/usr/sbin/udev-helper sbin
cp -aL ../install-petitboot/usr/sbin/petitboot bin
@@ -29,9 +30,11 @@
cp -avL /sbin/udevd /sbin/udevtrigger /sbin/udevsettle sbin
cp -avL /usr/bin/udevinfo usr/bin
cp -avL /lib/udev/*_id lib/udev
-#cp -avL /usr/bin/netcat bin
+cp -avL /usr/bin/netcat bin
pwd
mv ../extract_from_elf sbin/
+
+# create udev rules
cat > etc/udev/rules.d/00-petit.rules < /dev/null 2>&1
-# trigger events for all devices
/sbin/udevtrigger
-# wait for events to finish
-/sbin/udevsettle --timeout=10
+/sbin/udevsettle --timeout=5
# pipe syslog > /dev/tty10
tail -f /var/log > /dev/tty10 < /dev/tty10 &
@@ -125,9 +127,9 @@
udhcpc -i eth0 -n -q
# switch videomode to 720p
-#/usr/bin/ps3videomode -v 3
+#/usr/bin/ps3-video-mode -v 3
-petitboot -u
+petitboot -u
#echo "petitboot returned with $?"
# evaluating return code
@@ -138,8 +140,6 @@
umount $i
rm -rf $i
done
- /sbin/udevtrigger
- #/sbin/udevsettle --timeout=10
petitboot -u
done
++++++ libtwin.patch2latest.patch ++++++
Index: powerpc-utils-1.0.6/libtwin-0.0.2/Makefile.am
===================================================================
--- powerpc-utils-1.0.6.orig/libtwin-0.0.2/Makefile.am
+++ powerpc-utils-1.0.6/libtwin-0.0.2/Makefile.am
@@ -56,6 +56,11 @@ pkginclude_HEADERS += libtwin/twin_linux
libtwin_libtwin_la_SOURCES += libtwin/twin_linux_mouse.c
endif
+if TWIN_JOYSTICK
+pkginclude_HEADERS += libtwin/twin_linux_js.h
+libtwin_libtwin_la_SOURCES += libtwin/twin_linux_js.c
+endif
+
if TWIN_PNG
pkginclude_HEADERS += libtwin/twin_png.h
libtwin_libtwin_la_SOURCES += libtwin/twin_png.c
Index: powerpc-utils-1.0.6/libtwin-0.0.2/configure.ac
===================================================================
--- powerpc-utils-1.0.6.orig/libtwin-0.0.2/configure.ac
+++ powerpc-utils-1.0.6/libtwin-0.0.2/configure.ac
@@ -81,6 +81,12 @@ AC_ARG_ENABLE(linux-mouse,
[Disable linux mouse support (default=enabled)]),
twin_mouse="$enableval", twin_mouse="yes")
+# linux joystick
+AC_ARG_ENABLE(linux-joystick,
+ AC_HELP_STRING([--disable-linux-joystick],
+ [Disable linux joystick support (default=enabled)]),
+ twin_joystick="$enableval", twin_joystick="yes")
+
# zlib
AC_ARG_ENABLE(zlib,
AC_HELP_STRING([--disable-zlib],
@@ -174,7 +180,7 @@ AC_SUBST(ALTIVEC_CFLAGS)
# TWIN_DEP_*FLAGS define all flags required by dependencies of libtwin
-TWIN_DEP_LDFLAGS="$X_LIBS $PNG_LIBS $JPEG_LIBS $Z_LIBS -lm"
+TWIN_DEP_LDFLAGS="$X_LIBS $PNG_LIBS $JPEG_LIBS $Z_LIBS"
TWIN_DEPCFLAGS="$X_CFLAGS $PNG_CFLAGS"
AC_SUBST(TWIN_DEP_CFLAGS)
AC_SUBST(TWIN_DEP_LDFLAGS)
@@ -186,6 +192,7 @@ AM_CONDITIONAL(TWIN_PNG, test x$twin_png
AM_CONDITIONAL(TWIN_JPEG, test x$twin_jpeg = xyes)
AM_CONDITIONAL(TWIN_TTF, test x$twin_ttf = xyes)
AM_CONDITIONAL(TWIN_MOUSE, test x$twin_mouse = xyes)
+AM_CONDITIONAL(TWIN_JOYSTICK, test x$twin_joystick = xyes)
AC_MSG_NOTICE([x11 support: $twin_x11])
AC_MSG_NOTICE([fbdev support: $twin_fb])
@@ -194,6 +201,7 @@ AC_MSG_NOTICE([png support: $twin_png
AC_MSG_NOTICE([jpeg support: $twin_jpeg])
AC_MSG_NOTICE([twin_ttf tool: $twin_ttf])
AC_MSG_NOTICE([linux mouse: $twin_mouse])
+AC_MSG_NOTICE([linux joystick: $twin_joystick])
AC_MSG_NOTICE([altivec: $twin_altivec])
AC_OUTPUT([Makefile
Index: powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin.h
===================================================================
--- powerpc-utils-1.0.6.orig/libtwin-0.0.2/libtwin/twin.h
+++ powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin.h
@@ -35,6 +35,8 @@ typedef int16_t twin_coord_t;
typedef int16_t twin_style_t;
typedef int16_t twin_count_t;
typedef int16_t twin_keysym_t;
+typedef uint8_t twin_js_number_t;
+typedef int16_t twin_js_value_t;
typedef int32_t twin_area_t;
typedef int32_t twin_time_t;
typedef int16_t twin_stretch_t;
@@ -120,6 +122,10 @@ typedef enum _twin_event_kind {
TwinEventActivate = 0x0201,
TwinEventDeactivate = 0x0202,
+ /* Joystick */
+ TwinEventJoyButton = 0x0401,
+ TwinEventJoyAxis = 0x0402,
+
/* Widgets */
TwinEventPaint = 0x1001,
TwinEventQueryGeometry = 0x1002,
@@ -139,6 +145,10 @@ typedef struct _twin_event {
twin_keysym_t key;
} key;
struct {
+ twin_js_number_t control;
+ twin_js_value_t value;
+ } js;
+ struct {
twin_ucs4_t ucs4;
} ucs4;
struct {
Index: powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_fbdev.c
===================================================================
--- powerpc-utils-1.0.6.orig/libtwin-0.0.2/libtwin/twin_fbdev.c
+++ powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_fbdev.c
@@ -291,7 +291,7 @@ static twin_bool_t twin_fbdev_read_event
for (i = 0; i < count; i++) {
unsigned char e = events[i];
- down = !!(e & 0x80);
+ down = !(e & 0x80);
e &= 0x7f;
/* XXX Handle special keys (make more configurable) */
Index: powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_feature.c
===================================================================
--- powerpc-utils-1.0.6.orig/libtwin-0.0.2/libtwin/twin_feature.c
+++ powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_feature.c
@@ -55,7 +55,7 @@ static int _twin_have_altivec(void)
}
#else
-#define _twin_have_altivec()
+#define _twin_have_altivec() (0)
#endif /* HAVE_ALTIVEC */
int twin_has_feature(unsigned int feature)
Index: powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_fixed.c
===================================================================
--- powerpc-utils-1.0.6.orig/libtwin-0.0.2/libtwin/twin_fixed.c
+++ powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_fixed.c
@@ -109,6 +109,10 @@ twin_fixed_sqrt (twin_fixed_t a)
while (max > min)
{
mid = (max + min) >> 1;
+ if (mid >= 181*TWIN_FIXED_ONE) {
+ max = mid - 1;
+ continue;
+ }
sqr = twin_fixed_mul (mid, mid);
if (sqr == a)
return mid;
Index: powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_linux_js.c
===================================================================
--- /dev/null
+++ powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_linux_js.c
@@ -0,0 +1,144 @@
+/*
+ * Linux joystick driver for Twin
+ *
+ * Copyright 2007 Jeremy Kerr
+ *
+ * This Library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with the Twin Library; see the file COPYING. If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#include "twin.h"
+#include "twin_linux_js.h"
+
+#define DEBUG(fmt...) printf(fmt)
+
+struct twin_js_dev {
+ int fd;
+ twin_screen_t *screen;
+};
+
+static twin_bool_t twin_linux_js_events(int file, twin_file_op_t ops,
+ void *closure)
+{
+ struct twin_js_dev *js = closure;
+ struct js_event js_event;
+ int rc;
+ twin_event_t tev;
+
+ for (;;) {
+
+ rc = read(js->fd, &js_event, sizeof(js_event));
+ if (rc < 0 && errno == EAGAIN)
+ break;
+
+ if (rc < 0) {
+ DEBUG("Error reading from joystick device: %s\n",
+ strerror(errno));
+ return TWIN_FALSE;
+ }
+
+ if (rc != sizeof(js_event))
+ break;
+
+ if (js_event.type == JS_EVENT_BUTTON)
+ tev.kind = TwinEventJoyButton;
+ else if (js_event.type == JS_EVENT_AXIS)
+ tev.kind = TwinEventJoyAxis;
+ else
+ continue;
+
+ tev.u.js.control = js_event.number;
+ tev.u.js.value = js_event.value;
+ twin_screen_dispatch(js->screen, &tev);
+ }
+
+ return TWIN_TRUE;
+}
+
+
+static int nr_devs;
+struct twin_js_dev *js_devs;
+
+int twin_linux_js_create(twin_screen_t *screen)
+{
+ struct dirent *dirent;
+ DIR *dir;
+
+ dir = opendir("/dev/input");
+ if (dir == NULL) {
+ perror("opendir(/dev/input)");
+ return -1;
+ }
+
+ while ((dirent = readdir(dir))) {
+ /* buffer to hold dir.d_name, plus "/dev/input/" */
+ char dev_name[sizeof(dirent->d_name) + 12];
+ int dev_fd;
+ struct twin_js_dev *js_dev, *tmp;
+
+
+ if (strncmp(dirent->d_name, "js", 2))
+ continue;
+
+ strcpy(dev_name, "/dev/input/");
+ strcat(dev_name, dirent->d_name);
+
+ dev_fd = open(dev_name, O_RDONLY | O_NONBLOCK);
+ if (dev_fd < 0) {
+ perror("open");
+ continue;
+ }
+ DEBUG("Adding joystick device %s\n", dev_name);
+
+ tmp = realloc(js_devs, ++nr_devs * sizeof(*js_devs));
+ if (!tmp) {
+ close(dev_fd);
+ continue;
+ }
+ js_devs = tmp;
+
+ js_dev = js_devs + nr_devs - 1;
+ js_dev->fd = dev_fd;
+ js_dev->screen = screen;
+
+ twin_set_file(twin_linux_js_events, dev_fd, TWIN_READ, js_dev);
+ }
+ closedir(dir);
+
+ return 0;
+}
+
+void twin_linux_js_destroy()
+{
+ int i;
+
+ for (i = 0; i < nr_devs; i++)
+ close(js_devs[i].fd);
+
+ free(js_devs);
+ js_devs = NULL;
+}
+
Index: powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_linux_js.h
===================================================================
--- /dev/null
+++ powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_linux_js.h
@@ -0,0 +1,37 @@
+/*
+ * Linux joystick driver for Twin
+ *
+ * Copyright 2007 Jeremy Kerr
+ *
+ * This Library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with the Twin Library; see the file COPYING. If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#ifndef _TWIN_LINUX_JS_H_
+#define _TWIN_LINUX_JS_H_
+
+#include
+
+/**
+ * twin_linux_js_create - create the linux joystick driver
+ * @file: device file to open, pass NULL for default
+ */
+int twin_linux_js_create(twin_screen_t *screen);
+
+/**
+ * twin_linux_js_destroy - destroy the linux js driver
+ */
+void twin_linux_js_destroy(void);
+
+#endif /* _TWIN_LINUX_JS_H_ */
Index: powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_linux_mouse.c
===================================================================
--- powerpc-utils-1.0.6.orig/libtwin-0.0.2/libtwin/twin_linux_mouse.c
+++ powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_linux_mouse.c
@@ -32,9 +32,9 @@
#include "twin_linux_mouse.h"
#define QUADRATIC_ACCELERATION 1
-#define DEFAULT_ACC_NUMERATOR 2
-#define DEFAULT_ACC_DENOMINATOR 1
-#define DEFAULT_ACC_THRESHOLD 4
+#define DEFAULT_ACC_NUMERATOR (2*TWIN_FIXED_ONE)
+#define DEFAULT_ACC_DENOMINATOR TWIN_FIXED_ONE
+#define DEFAULT_ACC_THRESHOLD (4*TWIN_FIXED_ONE)
static void twin_linux_mouse_check_bounds(twin_linux_mouse_t *tm)
{
@@ -51,10 +51,12 @@ static void twin_linux_mouse_check_bound
/* This is directly copied from kdrive */
static void twin_linux_mouse_accel(twin_linux_mouse_t *tm, int *dx, int *dy)
{
- double speed = sqrt (*dx * *dx + *dy * *dy);
- double accel;
+ int square = *dx * *dx + *dy * *dy;
+ twin_fixed_t speed = square>65535 ? twin_int_to_fixed(256) :
+ twin_fixed_sqrt(twin_int_to_fixed(square));
+ twin_fixed_t accel;
#ifdef QUADRATIC_ACCELERATION
- double m;
+ twin_fixed_t m;
/*
* Ok, so we want it moving num/den times faster at threshold*2
@@ -67,16 +69,17 @@ static void twin_linux_mouse_accel(twin_
* num / den - 1 = m * threshold * 2
* (num / den - 1) / threshold * 2 = m
*/
- m = (((double) tm->acc_num / (double) tm->acc_den - 1.0) /
- ((double) tm->acc_threshold * 2.0));
- accel = m * speed + 1;
+ m = twin_fixed_div(tm->acc_num, tm->acc_den - TWIN_FIXED_ONE);
+ m = twin_fixed_div(m, (2*tm->acc_threshold));
+ accel = twin_fixed_mul(m, speed + TWIN_FIXED_ONE);
#else
- accel = 1.0;
+ accel = TWIN_FIXED_ONE;
+
if (speed > tm->acc_threshold)
- accel = (double) tm->acc_num / tm->acc_den;
+ accel = twin_fixed_div(tm->acc_num, tm->acc_den);
#endif
- *dx = accel * *dx;
- *dy = accel * *dy;
+ *dx = twin_fixed_to_int(twin_fixed_mul(accel, twin_int_to_fixed(*dx)));
+ *dy = twin_fixed_to_int(twin_fixed_mul(accel, twin_int_to_fixed(*dy)));
}
static twin_bool_t twin_linux_mouse_events(int file, twin_file_op_t ops,
@@ -146,7 +149,7 @@ twin_linux_mouse_t *twin_linux_mouse_cre
tm->screen = screen;
tm->acc_num = DEFAULT_ACC_NUMERATOR;
tm->acc_den = DEFAULT_ACC_DENOMINATOR;
- tm->acc_threshold =DEFAULT_ACC_THRESHOLD;
+ tm->acc_threshold = DEFAULT_ACC_THRESHOLD;
tm->x = screen->width / 2;
tm->y = screen->height / 2;
tm->fd = open(file, O_RDONLY);
@@ -187,7 +190,7 @@ void twin_linux_mouse_screen_changed(twi
void twin_linux_mouse_set_accel(twin_linux_mouse_t *tm,
int num, int den, int threshold)
{
- tm->acc_num = num;
- tm->acc_den = den;
- tm->acc_threshold = threshold;
+ tm->acc_num = twin_int_to_fixed(num);
+ tm->acc_den = twin_int_to_fixed(den);
+ tm->acc_threshold = twin_int_to_fixed(threshold);
}
Index: powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_linux_mouse.h
===================================================================
--- powerpc-utils-1.0.6.orig/libtwin-0.0.2/libtwin/twin_linux_mouse.h
+++ powerpc-utils-1.0.6/libtwin-0.0.2/libtwin/twin_linux_mouse.h
@@ -27,9 +27,9 @@ typedef struct _twin_linux_mouse {
twin_screen_t *screen;
/* acceleration settings */
- int acc_num;
- int acc_den;
- int acc_threshold;
+ twin_fixed_t acc_num;
+ twin_fixed_t acc_den;
+ twin_fixed_t acc_threshold;
/* internals */
int fd;
++++++ petitboot.add-default-entry.patch ++++++
Index: powerpc-utils-1.0.0/petitboot/devices.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/devices.c
+++ powerpc-utils-1.0.0/petitboot/devices.c
@@ -142,7 +142,7 @@ static int read_device(int fd, struct de
if (!icon)
goto out;
- index = dev_ctx->device_idx = pboot_add_device(dev.id, dev.name, icon, dev.timeout);
+ index = dev_ctx->device_idx = pboot_add_device(dev.id, dev.name, icon, dev.timeout, dev.defimage);
out:
free_strings(dev);
Index: powerpc-utils-1.0.0/petitboot/devices/kboot-parser.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/devices/kboot-parser.c
+++ powerpc-utils-1.0.0/petitboot/devices/kboot-parser.c
@@ -20,7 +20,7 @@ static const char *mountpoint;
static int param_is_ignored(const char *param)
{
static const char *ignored_options[] =
- { "message", "default", NULL };
+ { "message", NULL };
const char **str;
for (str = ignored_options; *str; str++)
@@ -198,10 +198,10 @@ static int parse_option(struct boot_opti
static void parse_buf(struct device *dev, char *buf)
{
- char *pos, *name, *value, *timeout;
+ char *pos, *name, *value, *timeout, *defimage;
int sent_device = 0;
- pos = name = value = timeout = NULL;
+ pos = name = value = timeout = defimage = NULL;
for (pos = buf; pos;) {
struct boot_option opt;
@@ -216,6 +216,11 @@ static void parse_buf(struct device *dev
if (*name == '#')
continue;
+ if (streq(name, "default")) {
+ dev->defimage = strdup(value);
+ continue;
+ }
+
if (streq(name, "timeout")) {
dev->timeout = strdup(value);
continue;
Index: powerpc-utils-1.0.0/petitboot/devices/message.h
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/devices/message.h
+++ powerpc-utils-1.0.0/petitboot/devices/message.h
@@ -16,6 +16,7 @@ struct device {
char *description;
char *icon_file;
char *timeout;
+ char *defimage;
};
struct boot_option {
Index: powerpc-utils-1.0.0/petitboot/devices/udev-helper.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/devices/udev-helper.c
+++ powerpc-utils-1.0.0/petitboot/devices/udev-helper.c
@@ -55,6 +55,7 @@ static void print_device(const struct de
pb_log("\tname: %s\n", dev->name);
pb_log("\tdescription: %s\n", dev->description);
pb_log("\tboot_image: %s\n", dev->icon_file);
+ pb_log("\tdefimage: %s\n", dev->defimage);
}
static int write_action(int fd, enum device_action action)
@@ -113,7 +114,8 @@ int add_device(const struct device *dev)
write_string(sock, dev->name) ||
write_string(sock, dev->description) ||
write_string(sock, dev->icon_file) ||
- write_string(sock, dev->timeout);
+ write_string(sock, dev->timeout) ||
+ write_string(sock, dev->defimage);
if (rc)
pb_log("error writing device %s to socket\n", dev->name);
Index: powerpc-utils-1.0.0/petitboot/petitboot.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/petitboot.c
+++ powerpc-utils-1.0.0/petitboot/petitboot.c
@@ -103,6 +103,8 @@ struct _pboot_device
twin_pixmap_t *badge;
twin_rect_t box;
int option_count;
+ int option_default;
+ char *defimage;
char *timeout;
pboot_option_t options[PBOOT_MAX_OPTION];
};
@@ -443,6 +445,10 @@ void pboot_set_rfocus(int index)
static void pboot_select_rpane(void)
{
+ /* for default boot option */
+ pboot_device_t *dev;
+ dev = pboot_devices[pboot_dev_sel];
+
if (pboot_focus_lpane == 0)
return;
pboot_focus_lpane = 0;
@@ -464,7 +470,15 @@ static void pboot_select_rpane(void)
twin_window_queue_paint(pboot_lpane->window);
twin_window_queue_paint(pboot_rpane->window);
- pboot_set_rfocus(0);
+ /* set focus on default boot entry */
+ if(dev->option_default!=-1 && pboot_bootopt_timer>0)
+ pboot_set_rfocus(dev->option_default);
+ else {
+ if (pboot_rpane->focus_curindex > -1)
+ pboot_set_rfocus(pboot_rpane->focus_curindex);
+ else
+ pboot_set_rfocus(0);
+ }
}
static void pboot_select_lpane(void)
@@ -609,6 +623,11 @@ int pboot_add_option(int devindex, const
opt->box.bottom = opt->box.top + PBOOT_RIGHT_OPTION_HEIGHT;
opt->data = data;
+
+ /* check: is default entry? */
+ if (!strcmp(opt->title, dev->defimage))
+ dev->option_default = index;
+
return index;
}
@@ -1049,7 +1068,7 @@ int pboot_update_lpane_focus(pboot_devic
static int sem = 1;
int pboot_add_device(const char *dev_id, const char *name,
- twin_pixmap_t *pixmap, const char *timeout)
+ twin_pixmap_t *pixmap, const char *timeout, const char *defimage)
{
int index;
int last;
@@ -1100,6 +1119,11 @@ int pboot_add_device(const char *dev_id,
strcpy(dev->id, dev_id);
dev->badge = pixmap;
dev->timeout = strdup(timeout);
+ dev->option_default = -1;
+ if (defimage)
+ dev->defimage = strdup(defimage);
+ else
+ dev->defimage = NULL;
pboot_devices[index] = dev;
Index: powerpc-utils-1.0.0/petitboot/petitboot.h
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/petitboot.h
+++ powerpc-utils-1.0.0/petitboot/petitboot.h
@@ -7,7 +7,7 @@
#define PBOOT_MAX_OPTION 16
int pboot_add_device(const char *dev_id, const char *name,
- twin_pixmap_t *pixmap, const char *timeout);
+ twin_pixmap_t *pixmap, const char *timeout, const char *defimage);
int pboot_add_option(int devindex, const char *title,
const char *subtitle, twin_pixmap_t *badge, void *data);
int pboot_remove_device(const char *dev_id);
++++++ petitboot.add-timeout.patch ++++++
++++ 836 lines (skipped)
++++ between arch/ppc/powerpc-utils/petitboot.add-timeout.patch
++++ and /mounts/work_src_done/STABLE/powerpc-utils/petitboot.add-timeout.patch
++++++ petitboot.boot-game-os.patch ++++++
Index: powerpc-utils-1.0.0/petitboot/petitboot.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/petitboot.c
+++ powerpc-utils-1.0.0/petitboot/petitboot.c
@@ -919,6 +919,11 @@ static twin_bool_t pboot_rpane_event (tw
pboot_rpane->window->event = pboot_changeres_event;
pboot_message("res: 0=auto 1=720p 2=1080i 3=1080p");
return TWIN_TRUE;
+ case KEY_BACKSPACE:
+ case KEY_DELETE:
+ system("ps3-boot-game-os");
+ pboot_message("boot game-os failed!");
+ return TWIN_TRUE;
case KEY_ENTER:
pboot_choose_option();
default:
@@ -1168,6 +1173,11 @@ static twin_bool_t pboot_lpane_event (tw
pboot_lpane->window->event = pboot_changeres_event;
pboot_message("res: 0=auto 1=720p 2=1080i 3=1080p");
return TWIN_TRUE;
+ case KEY_BACKSPACE:
+ case KEY_DELETE:
+ system("ps3-boot-game-os");
+ pboot_message("boot game-os failed!");
+ return TWIN_TRUE;
default:
break;
}
++++++ petitboot.boot-screen.patch ++++++
--- /var/tmp/diff_new_pack.T10868/_old 2008-01-07 12:37:47.000000000 +0100
+++ /var/tmp/diff_new_pack.T10868/_new 2008-01-07 12:37:47.000000000 +0100
@@ -1,8 +1,8 @@
-Index: powerpc-utils-1.0.0/petitboot-0.0.1/petitboot.c
+Index: powerpc-utils-1.0.0/petitboot/petitboot.c
===================================================================
---- powerpc-utils-1.0.0.orig/petitboot-0.0.1/petitboot.c
-+++ powerpc-utils-1.0.0/petitboot-0.0.1/petitboot.c
-@@ -528,8 +528,15 @@ static void pboot_choose_option(void)
+--- powerpc-utils-1.0.0.orig/petitboot/petitboot.c
++++ powerpc-utils-1.0.0/petitboot/petitboot.c
+@@ -320,8 +320,15 @@ static void pboot_choose_option(void)
pboot_device_t *dev = pboot_devices[pboot_dev_sel];
pboot_option_t *opt = &dev->options[pboot_rpane->focus_curindex];
@@ -19,7 +19,7 @@
/* Give user feedback, make sure errors and panics will be seen */
pboot_exec_option(opt->data);
}
-@@ -1115,14 +1122,18 @@ int pboot_remove_device(const char *dev_
+@@ -1179,14 +1186,18 @@ int pboot_remove_device(const char *dev_
return TWIN_TRUE;
}
@@ -41,7 +41,7 @@
filepic = twin_jpeg_to_pixmap(background_path, TWIN_ARGB32);
LOG("%s\n", filepic ? "ok" : "failed");
-@@ -1247,7 +1258,7 @@ int main(int argc, char **argv)
+@@ -1312,7 +1323,7 @@ int main(int argc, char **argv)
#endif
/* Set background pixmap */
@@ -50,12 +50,12 @@
/* Init more stuffs */
pboot_create_lpane();
-Index: powerpc-utils-1.0.0/petitboot-0.0.1/petitboot.h
+Index: powerpc-utils-1.0.0/petitboot/petitboot.h
===================================================================
---- powerpc-utils-1.0.0.orig/petitboot-0.0.1/petitboot.h
-+++ powerpc-utils-1.0.0/petitboot-0.0.1/petitboot.h
-@@ -18,3 +18,4 @@ void pboot_exec_option(void *data);
+--- powerpc-utils-1.0.0.orig/petitboot/petitboot.h
++++ powerpc-utils-1.0.0/petitboot/petitboot.h
+@@ -15,3 +15,4 @@ int pboot_remove_device(const char *dev_
+ int pboot_start_device_discovery(int udev_trigger);
+ void pboot_exec_option(void *data);
void pboot_message(const char *message);
- void pboot_set_lfocus(int index);
- void pboot_set_device_select(int sel, int force);
+void pboot_make_background(const char *background);
++++++ petitboot.continue-if-device-already-mounted.patch ++++++
Index: powerpc-utils-1.0.0/petitboot/devices/udev-helper.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/devices/udev-helper.c
+++ powerpc-utils-1.0.0/petitboot/devices/udev-helper.c
@@ -415,11 +415,9 @@ static int found_new_device(const char *
if (mount_device(dev_path)) {
pb_log("failed to mount %s\n", dev_path);
- return EXIT_FAILURE;
+ } else {
+ pb_log("mounted %s at %s\n", dev_path, mountpoint);
}
-
- pb_log("mounted %s at %s\n", dev_path, mountpoint);
-
iterate_parsers(dev_path, mountpoint);
return EXIT_SUCCESS;
++++++ petitboot.editor.patch ++++++
++++ 776 lines (skipped)
++++ between arch/ppc/powerpc-utils/petitboot.editor.patch
++++ and /mounts/work_src_done/STABLE/powerpc-utils/petitboot.editor.patch
++++++ petitboot.font.patch ++++++
Index: powerpc-utils-1.0.0/petitboot/petitboot.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/petitboot.c
+++ powerpc-utils-1.0.0/petitboot/petitboot.c
@@ -62,7 +62,9 @@ static twin_screen_t *pboot_screen;
#define PBOOT_RIGHT_OPTION_HEIGHT 64
#define PBOOT_RIGHT_OPTION_STRIDE 100
#define PBOOT_RIGHT_TITLE_TEXT_SIZE (30 * TWIN_FIXED_ONE)
-#define PBOOT_RIGHT_SUBTITLE_TEXT_SIZE (18 * TWIN_FIXED_ONE)
+#define PBOOT_RIGHT_SUB_TEXT_SIZE_L (18 * TWIN_FIXED_ONE)
+#define PBOOT_RIGHT_SUB_TEXT_SIZE_M (15 * TWIN_FIXED_ONE)
+#define PBOOT_RIGHT_SUB_TEXT_SIZE_S (13 * TWIN_FIXED_ONE)
#define PBOOT_RIGHT_TITLE_XOFFSET 80
#define PBOOT_RIGHT_TITLE_YOFFSET 30
#define PBOOT_RIGHT_SUBTITLE_XOFFSET 100
@@ -223,7 +225,14 @@ static void pboot_draw_option_cache(pboo
twin_path_empty (path);
if (opt->subtitle) {
- twin_path_set_font_size(path, PBOOT_RIGHT_SUBTITLE_TEXT_SIZE);
+ int sub_length;
+ sub_length = strlen(opt->subtitle);
+ if (sub_length < 80)
+ twin_path_set_font_size(path, PBOOT_RIGHT_SUB_TEXT_SIZE_L);
+ else if (sub_length < 100)
+ twin_path_set_font_size(path, PBOOT_RIGHT_SUB_TEXT_SIZE_M);
+ else
+ twin_path_set_font_size(path, PBOOT_RIGHT_SUB_TEXT_SIZE_S);
twin_path_set_font_style(path, TWIN_TEXT_UNHINTED);
tx = twin_int_to_fixed(PBOOT_RIGHT_SUBTITLE_XOFFSET);
ty = twin_int_to_fixed(PBOOT_RIGHT_SUBTITLE_YOFFSET);
++++++ petitboot.kboot-boot_args.patch ++++++
Index: powerpc-utils-1.0.0/petitboot/devices/kboot-parser.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/devices/kboot-parser.c
+++ powerpc-utils-1.0.0/petitboot/devices/kboot-parser.c
@@ -175,10 +175,6 @@ static int parse_option(struct boot_opti
initrd = get_global_option("initrd");
if (initrd) {
- asprintf(&tmp, "initrd=%s %s", initrd, cmdline);
- free(cmdline);
- cmdline = tmp;
-
opt->initrd_file = resolve_path(initrd, mountpoint);
}
++++++ petitboot.kboot-conf-file-locations.patch ++++++
Index: powerpc-utils-1.0.0/petitboot/devices/kboot-parser.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/devices/kboot-parser.c
+++ powerpc-utils-1.0.0/petitboot/devices/kboot-parser.c
@@ -248,6 +248,18 @@ static int parse(const char *devicepath,
filepath = join_paths(mountpoint, "/etc/kboot.conf");
fd = open(filepath, O_RDONLY);
+ if (fd < 0) {
+ filepath = join_paths(mountpoint, "/ETC/KBOOT.CONF");
+ fd = open(filepath, O_RDONLY);
+ }
+ if (fd < 0) {
+ filepath = join_paths(mountpoint, "/etc/kboot.cnf");
+ fd = open(filepath, O_RDONLY);
+ }
+ if (fd < 0) {
+ filepath = join_paths(mountpoint, "/ETC/KBOOT.CNF");
+ fd = open(filepath, O_RDONLY);
+ }
if (fd < 0)
goto out_free_path;
++++++ petitboot.kboot-no-root.patch ++++++
Index: powerpc-utils-1.0.0/petitboot/devices/kboot-parser.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/devices/kboot-parser.c
+++ powerpc-utils-1.0.0/petitboot/devices/kboot-parser.c
@@ -188,10 +188,7 @@ static int parse_option(struct boot_opti
cmdline = tmp;
} else if (initrd) {
- /* if there's an initrd but no root, fake up /dev/ram0 */
- asprintf(&tmp, "root=/dev/ram0 %s", cmdline);
- free(cmdline);
- cmdline = tmp;
+ /* if there's an initrd but no root, then its not a problem */
}
pb_log("kboot cmdline: %s\n", cmdline);
++++++ petitboot.pb_log.patch ++++++
--- /var/tmp/diff_new_pack.T10868/_old 2008-01-07 12:37:48.000000000 +0100
+++ /var/tmp/diff_new_pack.T10868/_new 2008-01-07 12:37:48.000000000 +0100
@@ -1,8 +1,8 @@
-Index: powerpc-utils-1.0.0/petitboot-0.0.1/devices/udev-helper.c
+Index: powerpc-utils-1.0.0/petitboot/devices/udev-helper.c
===================================================================
---- powerpc-utils-1.0.0.orig/petitboot-0.0.1/devices/udev-helper.c
-+++ powerpc-utils-1.0.0/petitboot-0.0.1/devices/udev-helper.c
-@@ -28,7 +28,7 @@
+--- powerpc-utils-1.0.0.orig/petitboot/devices/udev-helper.c
++++ powerpc-utils-1.0.0/petitboot/devices/udev-helper.c
+@@ -30,7 +30,7 @@
static FILE *logf;
static int sock;
@@ -11,19 +11,28 @@
{
va_list ap;
-Index: powerpc-utils-1.0.0/petitboot-0.0.1/devices/parser.h
+Index: powerpc-utils-1.0.0/petitboot/devices/parser.h
===================================================================
---- powerpc-utils-1.0.0.orig/petitboot-0.0.1/devices/parser.h
-+++ powerpc-utils-1.0.0/petitboot-0.0.1/devices/parser.h
-@@ -33,7 +33,10 @@ char *join_paths(const char *a, const ch
+--- powerpc-utils-1.0.0.orig/petitboot/devices/parser.h
++++ powerpc-utils-1.0.0/petitboot/devices/parser.h
+@@ -3,6 +3,8 @@
+ #define _PARSERS_H
+
+ #include
++#include
++#include
+ #include "message.h"
+
+ struct parser {
+@@ -33,7 +35,10 @@ char *join_paths(const char *a, const ch
const char *generic_icon_file(enum generic_icon_type type);
/* functions provided by udev-helper or the test wrapper */
-void pb_log(const char *fmt, ...);
+void __pb_log(const char *fmt, ...);
-+#define pb_log(fmt, args ...) __pb_log("%s:%s(%u)|" fmt, __FILE__, __FUNCTION__, __LINE__,##args)
++#define pb_log(fmt, args ...) __pb_log("(%d - %d)%s:%s(%u)|" fmt, getpid(), time(NULL), __FILE__, __FUNCTION__, __LINE__,##args)
+
+
- int mount_device(const char *dev_path, char *mount_path);
+ int mount_device(const char *dev_path);
++++++ petitboot-0.0.1.tar.bz2 -> petitboot.tar.bz2 ++++++
Files old/petitboot-0.0.1/artwork/loading.jpg and new/petitboot/artwork/loading.jpg differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/devices/kboot-parser.c new/petitboot/devices/kboot-parser.c
--- old/petitboot-0.0.1/devices/kboot-parser.c 2007-04-05 11:23:02.000000000 +0200
+++ new/petitboot/devices/kboot-parser.c 2007-09-12 15:21:51.000000000 +0200
@@ -76,6 +76,47 @@
return tmp ? tmp + 1 : NULL;
}
+struct global_option {
+ char *name;
+ char *value;
+};
+
+
+struct global_option global_options[] = {
+ { .name = "root" },
+ { .name = "initrd" },
+ { .name = "video" },
+ { .name = NULL }
+};
+
+/*
+ * Check if an option (name=value) is a global option. If so, store it in
+ * the global options table, and return 1. Otherwise, return 0.
+ */
+static int check_for_global_option(const char *name, const char *value)
+{
+ int i;
+
+ for (i = 0; global_options[i].name ;i++) {
+ if (!strcmp(name, global_options[i].name)) {
+ global_options[i].value = strdup(value);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static char *get_global_option(const char *name)
+{
+ int i;
+
+ for (i = 0; global_options[i].name ;i++)
+ if (!strcmp(name, global_options[i].name))
+ return global_options[i].value;
+
+ return NULL;
+}
+
static int parse_option(struct boot_option *opt, char *config)
{
char *pos, *name, *value, *root, *initrd, *cmdline, *tmp;
@@ -97,13 +138,13 @@
/* if there's no space, it's only a kernel image with no params */
if (!pos) {
- opt->boot_image_file = join_paths(mountpoint, config);
+ opt->boot_image_file = resolve_path(config, mountpoint);
opt->description = strdup(config);
return 1;
}
*pos = 0;
- opt->boot_image_file = join_paths(mountpoint, config);
+ opt->boot_image_file = resolve_path(config, mountpoint);
cmdline = malloc(buf_size);
*cmdline = 0;
@@ -128,12 +169,17 @@
}
}
+ if (!root)
+ root = get_global_option("root");
+ if (!initrd)
+ initrd = get_global_option("initrd");
+
if (initrd) {
asprintf(&tmp, "initrd=%s %s", initrd, cmdline);
free(cmdline);
cmdline = tmp;
- opt->initrd_file = join_paths(mountpoint, initrd);
+ opt->initrd_file = resolve_path(initrd, mountpoint);
}
if (root) {
@@ -141,17 +187,18 @@
free(cmdline);
cmdline = tmp;
- } else if (!initrd) {
+ } else if (initrd) {
/* if there's an initrd but no root, fake up /dev/ram0 */
asprintf(&tmp, "root=/dev/ram0 %s", cmdline);
free(cmdline);
cmdline = tmp;
}
- pb_log("kboot cmdline: %s", cmdline);
+ pb_log("kboot cmdline: %s\n", cmdline);
opt->boot_args = cmdline;
- asprintf(&opt->description, "%s %s", config, cmdline);
+ asprintf(&opt->description, "%s %s",
+ config, opt->boot_args);
return 1;
}
@@ -174,6 +221,9 @@
if (*name == '#')
continue;
+ if (check_for_global_option(name, value))
+ continue;
+
memset(&opt, 0, sizeof(opt));
opt.name = strdup(name);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/devices/parser.c new/petitboot/devices/parser.c
--- old/petitboot-0.0.1/devices/parser.c 2007-04-05 11:20:06.000000000 +0200
+++ new/petitboot/devices/parser.c 2007-09-12 15:21:51.000000000 +0200
@@ -21,12 +21,12 @@
{
int i;
- pb_log("trying parsers for %s@%s\n", devpath, mountpoint);
+ pb_log("trying parsers for %s\n", devpath);
for (i = 0; parsers[i]; i++) {
pb_log("\ttrying parser '%s'\n", parsers[i]->name);
/* just use a dummy device path for now */
- if (parsers[i]->parse(devpath, mountpoint))
+ if (parsers[i]->parse(devpath, mountpoint_for_device(devpath)))
return;
}
pb_log("\tno boot_options found\n");
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/devices/parser.h new/petitboot/devices/parser.h
--- old/petitboot-0.0.1/devices/parser.h 2007-04-05 10:48:43.000000000 +0200
+++ new/petitboot/devices/parser.h 2007-09-12 15:21:51.000000000 +0200
@@ -35,7 +35,10 @@
/* functions provided by udev-helper or the test wrapper */
void pb_log(const char *fmt, ...);
-int mount_device(const char *dev_path, char *mount_path);
+int mount_device(const char *dev_path);
+
+char *resolve_path(const char *path, const char *default_mountpoint);
+const char *mountpoint_for_device(const char *dev_path);
enum generic_icon_type guess_device_type(void);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/devices/parser-test.c new/petitboot/devices/parser-test.c
--- old/petitboot-0.0.1/devices/parser-test.c 2007-04-07 14:16:17.000000000 +0200
+++ new/petitboot/devices/parser-test.c 2007-09-12 15:21:51.000000000 +0200
@@ -1,8 +1,10 @@
+#define _GNU_SOURCE
#include
#include
#include
#include
+#include
#include "parser.h"
@@ -15,31 +17,44 @@
va_end(ap);
}
-
-int mount_device(const char *dev_path, char *mount_path)
+int mount_device(const char *dev_path)
{
- pb_log("attempt to mount device (%s) not supported\n", dev_path);
- return -1;
+ printf("[mount] %s\n", dev_path);
+ return 0;
}
+static int device_idx;
+static int option_idx;
+
int add_device(const struct device *dev)
{
- printf("device added:\n");
- printf("\tid: %s\n", dev->id);
- printf("\tname: %s\n", dev->name);
- printf("\tdescription: %s\n", dev->description);
- printf("\tboot_image: %s\n", dev->icon_file);
+ printf("[dev %2d] id: %s\n", device_idx, dev->id);
+ printf("[dev %2d] name: %s\n", device_idx, dev->name);
+ printf("[dev %2d] description: %s\n", device_idx, dev->description);
+ printf("[dev %2d] boot_image: %s\n", device_idx, dev->icon_file);
+
+ device_idx++;
+ option_idx = 0;
return 0;
}
+
int add_boot_option(const struct boot_option *opt)
{
- printf("option added:\n");
- printf("\tname: %s\n", opt->name);
- printf("\tdescription: %s\n", opt->description);
- printf("\tboot_image: %s\n", opt->boot_image_file);
- printf("\tinitrd: %s\n", opt->initrd_file);
- printf("\tboot_args: %s\n", opt->boot_args);
+ if (!device_idx) {
+ fprintf(stderr, "Option (%s) added before device\n",
+ opt->name);
+ exit(EXIT_FAILURE);
+ }
+
+ printf("[opt %2d] name: %s\n", option_idx, opt->name);
+ printf("[opt %2d] description: %s\n", option_idx, opt->description);
+ printf("[opt %2d] boot_image: %s\n", option_idx, opt->boot_image_file);
+ printf("[opt %2d] initrd: %s\n", option_idx, opt->initrd_file);
+ printf("[opt %2d] boot_args: %s\n", option_idx, opt->boot_args);
+
+ option_idx++;
+
return 0;
}
@@ -48,16 +63,45 @@
return ICON_TYPE_UNKNOWN;
}
+static char *mountpoint;
+
+/* pretend that all devices are mounted at our original mountpoint */
+const char *mountpoint_for_device(const char *dev_path)
+{
+ return mountpoint;
+}
+
+char *resolve_path(const char *path, const char *default_mountpoint)
+{
+ char *sep, *ret;
+ const char *devpath;
+
+ sep = strchr(path, ':');
+ if (!sep) {
+ devpath = default_mountpoint;
+ asprintf(&ret, "%s/%s", devpath, path);
+ } else {
+ char *tmp = strndup(path, sep - path);
+ devpath = mountpoint_for_device(path);
+ asprintf(&ret, "%s/%s", devpath, sep + 1);
+ free(tmp);
+ }
+
+ return ret;
+}
+
int main(int argc, char **argv)
{
- const char *dev = "/dev/null";
+ const char *dev = "sda1";
if (argc != 2) {
fprintf(stderr, "usage: %s <fake-mountpoint>\n", argv[0]);
return EXIT_FAILURE;
}
- iterate_parsers(dev, argv[1]);
+ mountpoint = argv[1];
+
+ iterate_parsers(dev, mountpoint);
return EXIT_SUCCESS;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/devices/parser-tests/001/etc/kboot.conf new/petitboot/devices/parser-tests/001/etc/kboot.conf
--- old/petitboot-0.0.1/devices/parser-tests/001/etc/kboot.conf 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/devices/parser-tests/001/etc/kboot.conf 2007-09-12 15:21:51.000000000 +0200
@@ -0,0 +1,9 @@
+# Ubuntu feisty kboot.conf
+message=/etc/kboot.msg
+timeout=300
+default=live
+live='/casper/vmlinux initrd=/casper/initrd.gz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --'
+live_nosplash='/casper/vmlinux initrd=/casper/initrd.gz file=/cdrom/preseed/ubuntu.seed boot=casper quiet --'
+driverupdates='/casper/vmlinux initrd=/casper/initrd.gz file=/cdrom/preseed/ubuntu.seed boot=casper debian-installer/driver-update=true quiet splash --'
+check='/casper/vmlinux initrd=/casper/initrd.gz boot=casper integrity-check quiet splash --'
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/devices/parser-tests/001/expected-output new/petitboot/devices/parser-tests/001/expected-output
--- old/petitboot-0.0.1/devices/parser-tests/001/expected-output 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/devices/parser-tests/001/expected-output 2007-09-12 15:21:51.000000000 +0200
@@ -0,0 +1,24 @@
+[dev 0] id: sda1
+[dev 0] name: (null)
+[dev 0] description: (null)
+[dev 0] boot_image: /usr/share/petitboot/artwork/hdd.png
+[opt 0] name: live
+[opt 0] description: /casper/vmlinux root=/dev/ram0 initrd=/casper/initrd.gz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --
+[opt 0] boot_image: devices/parser-tests/001//casper/vmlinux
+[opt 0] initrd: devices/parser-tests/001//casper/initrd.gz
+[opt 0] boot_args: root=/dev/ram0 initrd=/casper/initrd.gz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --
+[opt 1] name: live_nosplash
+[opt 1] description: /casper/vmlinux root=/dev/ram0 initrd=/casper/initrd.gz file=/cdrom/preseed/ubuntu.seed boot=casper quiet --
+[opt 1] boot_image: devices/parser-tests/001//casper/vmlinux
+[opt 1] initrd: devices/parser-tests/001//casper/initrd.gz
+[opt 1] boot_args: root=/dev/ram0 initrd=/casper/initrd.gz file=/cdrom/preseed/ubuntu.seed boot=casper quiet --
+[opt 2] name: driverupdates
+[opt 2] description: /casper/vmlinux root=/dev/ram0 initrd=/casper/initrd.gz file=/cdrom/preseed/ubuntu.seed boot=casper debian-installer/driver-update=true quiet splash --
+[opt 2] boot_image: devices/parser-tests/001//casper/vmlinux
+[opt 2] initrd: devices/parser-tests/001//casper/initrd.gz
+[opt 2] boot_args: root=/dev/ram0 initrd=/casper/initrd.gz file=/cdrom/preseed/ubuntu.seed boot=casper debian-installer/driver-update=true quiet splash --
+[opt 3] name: check
+[opt 3] description: /casper/vmlinux root=/dev/ram0 initrd=/casper/initrd.gz boot=casper integrity-check quiet splash --
+[opt 3] boot_image: devices/parser-tests/001//casper/vmlinux
+[opt 3] initrd: devices/parser-tests/001//casper/initrd.gz
+[opt 3] boot_args: root=/dev/ram0 initrd=/casper/initrd.gz boot=casper integrity-check quiet splash --
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/devices/parser-tests/002/etc/yaboot.conf new/petitboot/devices/parser-tests/002/etc/yaboot.conf
--- old/petitboot-0.0.1/devices/parser-tests/002/etc/yaboot.conf 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/devices/parser-tests/002/etc/yaboot.conf 2007-09-12 15:21:51.000000000 +0200
@@ -0,0 +1,8 @@
+init-message = "\nWelcome to the 64-bit Yellow Dog Linux 5.0 installer!\nHit <TAB> for boot options.\n\n"
+timeout=6000
+default=linux
+
+image=/ppc/ppc64/vmlinux
+ label=linux
+ initrd=/ppc/ppc64/ramdisk.image.gz
+ read-only
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/devices/parser-tests/002/expected-output new/petitboot/devices/parser-tests/002/expected-output
--- old/petitboot-0.0.1/devices/parser-tests/002/expected-output 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/devices/parser-tests/002/expected-output 2007-09-12 15:21:51.000000000 +0200
@@ -0,0 +1,9 @@
+[dev 0] id: sda1
+[dev 0] name: (null)
+[dev 0] description:
+[dev 0] boot_image: /usr/share/petitboot/artwork/hdd.png
+[opt 0] name: linux
+[opt 0] description: (null)
+[opt 0] boot_image: devices/parser-tests/002//ppc/ppc64/vmlinux
+[opt 0] initrd: devices/parser-tests/002//ppc/ppc64/ramdisk.image.gz
+[opt 0] boot_args: ro
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/devices/parser-test.sh new/petitboot/devices/parser-test.sh
--- old/petitboot-0.0.1/devices/parser-test.sh 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/devices/parser-test.sh 2007-09-12 15:21:51.000000000 +0200
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+testdir=devices/parser-tests
+
+function test_dir()
+{
+ dir="$1"
+ ./parser-test "$dir" 2>/dev/null |
+ diff -u "$dir/expected-output" -
+}
+
+set -ex
+
+for test in $testdir/*
+do
+ echo $test
+ test_dir "$test"
+done
+
+echo "All tests passed"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/devices/udev-helper.c new/petitboot/devices/udev-helper.c
--- old/petitboot-0.0.1/devices/udev-helper.c 2007-04-05 14:09:43.000000000 +0200
+++ new/petitboot/devices/udev-helper.c 2007-09-12 15:21:51.000000000 +0200
@@ -1,4 +1,6 @@
+#define _GNU_SOURCE
+
#include
#include
#include
@@ -181,28 +183,92 @@
#endif
}
-int mount_device(const char *dev_path, char *mount_path)
+struct device_map {
+ char *dev, *mnt;
+};
+
+#define DEVICE_MAP_SIZE 32
+static struct device_map device_map[DEVICE_MAP_SIZE];
+
+const char *mountpoint_for_device(const char *dev_path)
{
- char *dir;
+ int i;
const char *basename;
- int pid, status, rc = -1;
- basename = strrchr(dev_path, '/');
- if (basename)
- basename++;
- else
+ /* shorten '/dev/foo' to 'foo' */
+ basename = strrchr(dev_path, '/');
+ if (basename)
+ basename++;
+ else
basename = dev_path;
-
- /* create a unique mountpoint */
- dir = malloc(strlen(TMP_DIR) + 13 + strlen(basename));
- sprintf(dir, "%s/mnt-%s-XXXXXX", TMP_DIR, basename);
-
- if (!mkdtemp(dir)) {
- pb_log("failed to create temporary directory in %s: %s",
- TMP_DIR, strerror(errno));
- goto out;
+
+ /* check existing entries in the map */
+ for (i = 0; (i < DEVICE_MAP_SIZE) && device_map[i].dev; i++)
+ if (!strcmp(device_map[i].dev, basename))
+ return device_map[i].mnt;
+
+ if (i == DEVICE_MAP_SIZE)
+ return NULL;
+
+ device_map[i].dev = strdup(dev_path);
+ asprintf(&device_map[i].mnt, "%s/%s", TMP_DIR, basename);
+ return device_map[i].mnt;
+}
+
+/**
+ * Resolve a path given in a config file, to a path in the local filesystem.
+ * Paths may be of the form:
+ * device:path (eg /dev/sda:/boot/vmlinux)
+ *
+ * or just a path:
+ * /boot/vmlinux
+ * - in this case, the default mountpoint is used.
+ *
+ * Returns a newly-allocated string containing a full path to the file in path
+ */
+char *resolve_path(const char *path, const char *default_mountpoint)
+{
+ char *ret;
+ const char *devpath, *sep;
+
+ sep = strchr(path, ':');
+ if (!sep) {
+ devpath = default_mountpoint;
+ asprintf(&ret, "%s/%s", devpath, path);
+ } else {
+ /* copy just the device name into tmp */
+ char *dev = strndup(path, sep - path);
+ devpath = mountpoint_for_device(dev);
+ asprintf(&ret, "%s/%s", devpath, sep + 1);
+ free(dev);
}
+ return ret;
+}
+
+int mount_device(const char *dev_path)
+{
+ const char *dir;
+ int pid, status, rc = -1;
+ struct stat statbuf;
+
+ dir = mountpoint_for_device(dev_path);
+
+ if (stat(dir, &statbuf)) {
+ if (mkdir(dir, 0755)) {
+ pb_log("couldn't create directory %s: %s\n",
+ dir, strerror(errno));
+ goto out;
+ }
+ } else {
+ if (!S_ISDIR(statbuf.st_mode)) {
+ pb_log("mountpoint %s exists, "
+ "but isn't a directory\n", dir);
+ goto out;
+ }
+ }
+
+
pid = fork();
if (pid == -1) {
pb_log("%s: fork failed: %s\n", __FUNCTION__, strerror(errno));
@@ -220,13 +286,10 @@
goto out;
}
- if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
- strcpy(mount_path, dir);
+ if (WIFEXITED(status) && WEXITSTATUS(status) == 0)
rc = 0;
- }
out:
- free(dir);
return rc;
}
@@ -348,9 +411,9 @@
static int found_new_device(const char *dev_path)
{
- char mountpoint[PATH_MAX];
+ const char *mountpoint = mountpoint_for_device(dev_path);
- if (mount_device(dev_path, mountpoint)) {
+ if (mount_device(dev_path)) {
pb_log("failed to mount %s\n", dev_path);
return EXIT_FAILURE;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/devices/yaboot-parser.c new/petitboot/devices/yaboot-parser.c
--- old/petitboot-0.0.1/devices/yaboot-parser.c 2007-04-05 10:51:42.000000000 +0200
+++ new/petitboot/devices/yaboot-parser.c 2007-09-12 15:21:51.000000000 +0200
@@ -15,7 +15,6 @@
static struct device *dev;
static const char *mountpoint;
-static char partition_mntpoint[PATH_MAX];
static char *defimage;
char *
@@ -103,13 +102,13 @@
opt.name = label;
cfgopt = cfg_get_strg(label, "image");
- opt.boot_image_file = join_paths(mountpoint, cfgopt);
+ opt.boot_image_file = resolve_path(cfgopt, mountpoint);
if (cfgopt == defimage)
pb_log("This one is default. What do we do about it?\n");
cfgopt = cfg_get_strg(label, "initrd");
if (cfgopt)
- opt.initrd_file = join_paths(mountpoint, cfgopt);
+ opt.initrd_file = resolve_path(cfgopt, mountpoint);
opt.boot_args = make_params(label, NULL);
@@ -182,8 +181,8 @@
}
dev->icon_file = strdup(generic_icon_file(guess_device_type()));
- /* Mount the 'partition' which is what all the image filenames
- are relative to */
+ /* If we have a 'partiton=' directive, update the default mountpoint
+ * to use that instead of the current mountpoint */
tmpstr = cfg_get_strg(0, "partition");
if (tmpstr) {
char *endp;
@@ -203,16 +202,9 @@
/* and add our own... */
sprintf(endp+1, "%d", partnr);
- /* FIXME: udev may not have created the device node
- yet. And on removal, unmount_device() only unmounts
- it once, while in fact it may be mounted twice. */
- if (mount_device(new_dev, partition_mntpoint)) {
- pb_log("Error mounting image partition\n");
- return 0;
- }
- mountpoint = partition_mntpoint;
+ mountpoint = mountpoint_for_device(new_dev);
dev->id = new_dev;
- }
+ }
}
defimage = cfg_get_default();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/config new/petitboot/.git/config
--- old/petitboot-0.0.1/.git/config 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/config 2007-09-12 15:21:45.000000000 +0200
@@ -0,0 +1,3 @@
+[core]
+ repositoryformatversion = 0
+ filemode = true
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/description new/petitboot/.git/description
--- old/petitboot-0.0.1/.git/description 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/description 2007-09-12 15:21:45.000000000 +0200
@@ -0,0 +1 @@
+Unnamed repository; edit this file to name it for gitweb.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/FETCH_HEAD new/petitboot/.git/FETCH_HEAD
--- old/petitboot-0.0.1/.git/FETCH_HEAD 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/FETCH_HEAD 2007-12-12 15:01:07.000000000 +0100
@@ -0,0 +1 @@
+238549fe012d19681ede101f02fc4f653402e550 branch 'master' of git://ozlabs.org/home/jk/git/petitboot
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/HEAD new/petitboot/.git/HEAD
--- old/petitboot-0.0.1/.git/HEAD 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/HEAD 2007-09-12 15:21:51.000000000 +0200
@@ -0,0 +1 @@
+ref: refs/heads/master
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/hooks/applypatch-msg new/petitboot/.git/hooks/applypatch-msg
--- old/petitboot-0.0.1/.git/hooks/applypatch-msg 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/hooks/applypatch-msg 2007-09-12 15:21:45.000000000 +0200
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# An example hook script to check the commit log message taken by
+# applypatch from an e-mail message.
+#
+# The hook should exit with non-zero status after issuing an
+# appropriate message if it wants to stop the commit. The hook is
+# allowed to edit the commit message file.
+#
+# To enable this hook, make this file executable.
+
+. git-sh-setup
+test -x "$GIT_DIR/hooks/commit-msg" &&
+ exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
+:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/hooks/commit-msg new/petitboot/.git/hooks/commit-msg
--- old/petitboot-0.0.1/.git/hooks/commit-msg 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/hooks/commit-msg 2007-09-12 15:21:45.000000000 +0200
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# An example hook script to check the commit log message.
+# Called by git-commit with one argument, the name of the file
+# that has the commit message. The hook should exit with non-zero
+# status after issuing an appropriate message if it wants to stop the
+# commit. The hook is allowed to edit the commit message file.
+#
+# To enable this hook, make this file executable.
+
+# This example catches duplicate Signed-off-by lines.
+
+test "" = "$(grep '^Signed-off-by: ' "$1" |
+ sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
+ echo >&2 Duplicate Signed-off-by lines.
+ exit 1
+}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/hooks/post-commit new/petitboot/.git/hooks/post-commit
--- old/petitboot-0.0.1/.git/hooks/post-commit 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/hooks/post-commit 2007-09-12 15:21:45.000000000 +0200
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# An example hook script that is called after a successful
+# commit is made.
+#
+# To enable this hook, make this file executable.
+
+: Nothing
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/hooks/post-update new/petitboot/.git/hooks/post-update
--- old/petitboot-0.0.1/.git/hooks/post-update 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/hooks/post-update 2007-09-12 15:21:45.000000000 +0200
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# An example hook script to prepare a packed repository for use over
+# dumb transports.
+#
+# To enable this hook, make this file executable by "chmod +x post-update".
+
+exec git-update-server-info
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/hooks/pre-applypatch new/petitboot/.git/hooks/pre-applypatch
--- old/petitboot-0.0.1/.git/hooks/pre-applypatch 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/hooks/pre-applypatch 2007-09-12 15:21:45.000000000 +0200
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# An example hook script to verify what is about to be committed
+# by applypatch from an e-mail message.
+#
+# The hook should exit with non-zero status after issuing an
+# appropriate message if it wants to stop the commit.
+#
+# To enable this hook, make this file executable.
+
+. git-sh-setup
+test -x "$GIT_DIR/hooks/pre-commit" &&
+ exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
+:
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/hooks/pre-commit new/petitboot/.git/hooks/pre-commit
--- old/petitboot-0.0.1/.git/hooks/pre-commit 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/hooks/pre-commit 2007-09-12 15:21:45.000000000 +0200
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# An example hook script to verify what is about to be committed.
+# Called by git-commit with no arguments. The hook should
+# exit with non-zero status after issuing an appropriate message if
+# it wants to stop the commit.
+#
+# To enable this hook, make this file executable.
+
+# This is slightly modified from Andrew Morton's Perfect Patch.
+# Lines you introduce should not have trailing whitespace.
+# Also check for an indentation that has SP before a TAB.
+
+if git-rev-parse --verify HEAD 2>/dev/null
+then
+ git-diff-index -p -M --cached HEAD
+else
+ # NEEDSWORK: we should produce a diff with an empty tree here
+ # if we want to do the same verification for the initial import.
+ :
+fi |
+perl -e '
+ my $found_bad = 0;
+ my $filename;
+ my $reported_filename = "";
+ my $lineno;
+ sub bad_line {
+ my ($why, $line) = @_;
+ if (!$found_bad) {
+ print STDERR "*\n";
+ print STDERR "* You have some suspicious patch lines:\n";
+ print STDERR "*\n";
+ $found_bad = 1;
+ }
+ if ($reported_filename ne $filename) {
+ print STDERR "* In $filename\n";
+ $reported_filename = $filename;
+ }
+ print STDERR "* $why (line $lineno)\n";
+ print STDERR "$filename:$lineno:$line\n";
+ }
+ while (<>) {
+ if (m|^diff --git a/(.*) b/\1$|) {
+ $filename = $1;
+ next;
+ }
+ if (/^@@ -\S+ \+(\d+)/) {
+ $lineno = $1 - 1;
+ next;
+ }
+ if (/^ /) {
+ $lineno++;
+ next;
+ }
+ if (s/^\+//) {
+ $lineno++;
+ chomp;
+ if (/\s$/) {
+ bad_line("trailing whitespace", $_);
+ }
+ if (/^\s* /) {
+ bad_line("indent SP followed by a TAB", $_);
+ }
+ if (/^(?:[<>=]){7}/) {
+ bad_line("unresolved merge conflict", $_);
+ }
+ }
+ }
+ exit($found_bad);
+'
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/hooks/pre-rebase new/petitboot/.git/hooks/pre-rebase
--- old/petitboot-0.0.1/.git/hooks/pre-rebase 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/hooks/pre-rebase 2007-09-12 15:21:45.000000000 +0200
@@ -0,0 +1,150 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 Junio C Hamano
+#
+
+publish=next
+basebranch="$1"
+if test "$#" = 2
+then
+ topic="refs/heads/$2"
+else
+ topic=`git symbolic-ref HEAD`
+fi
+
+case "$basebranch,$topic" in
+master,refs/heads/??/*)
+ ;;
+*)
+ exit 0 ;# we do not interrupt others.
+ ;;
+esac
+
+# Now we are dealing with a topic branch being rebased
+# on top of master. Is it OK to rebase it?
+
+# Is topic fully merged to master?
+not_in_master=`git-rev-list --pretty=oneline ^master "$topic"`
+if test -z "$not_in_master"
+then
+ echo >&2 "$topic is fully merged to master; better remove it."
+ exit 1 ;# we could allow it, but there is no point.
+fi
+
+# Is topic ever merged to next? If so you should not be rebasing it.
+only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort`
+only_next_2=`git-rev-list ^master ${publish} | sort`
+if test "$only_next_1" = "$only_next_2"
+then
+ not_in_topic=`git-rev-list "^$topic" master`
+ if test -z "$not_in_topic"
+ then
+ echo >&2 "$topic is already up-to-date with master"
+ exit 1 ;# we could allow it, but there is no point.
+ else
+ exit 0
+ fi
+else
+ not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"`
+ perl -e '
+ my $topic = $ARGV[0];
+ my $msg = "* $topic has commits already merged to public branch:\n";
+ my (%not_in_next) = map {
+ /^([0-9a-f]+) /;
+ ($1 => 1);
+ } split(/\n/, $ARGV[1]);
+ for my $elem (map {
+ /^([0-9a-f]+) (.*)$/;
+ [$1 => $2];
+ } split(/\n/, $ARGV[2])) {
+ if (!exists $not_in_next{$elem->[0]}) {
+ if ($msg) {
+ print STDERR $msg;
+ undef $msg;
+ }
+ print STDERR " $elem->[1]\n";
+ }
+ }
+ ' "$topic" "$not_in_next" "$not_in_master"
+ exit 1
+fi
+
+exit 0
+
+################################################################
+
+This sample hook safeguards topic branches that have been
+published from being rewound.
+
+The workflow assumed here is:
+
+ * Once a topic branch forks from "master", "master" is never
+ merged into it again (either directly or indirectly).
+
+ * Once a topic branch is fully cooked and merged into "master",
+ it is deleted. If you need to build on top of it to correct
+ earlier mistakes, a new topic branch is created by forking at
+ the tip of the "master". This is not strictly necessary, but
+ it makes it easier to keep your history simple.
+
+ * Whenever you need to test or publish your changes to topic
+ branches, merge them into "next" branch.
+
+The script, being an example, hardcodes the publish branch name
+to be "next", but it is trivial to make it configurable via
+$GIT_DIR/config mechanism.
+
+With this workflow, you would want to know:
+
+(1) ... if a topic branch has ever been merged to "next". Young
+ topic branches can have stupid mistakes you would rather
+ clean up before publishing, and things that have not been
+ merged into other branches can be easily rebased without
+ affecting other people. But once it is published, you would
+ not want to rewind it.
+
+(2) ... if a topic branch has been fully merged to "master".
+ Then you can delete it. More importantly, you should not
+ build on top of it -- other people may already want to
+ change things related to the topic as patches against your
+ "master", so if you need further changes, it is better to
+ fork the topic (perhaps with the same name) afresh from the
+ tip of "master".
+
+Let's look at this example:
+
+ o---o---o---o---o---o---o---o---o---o "next"
+ / / / /
+ / a---a---b A / /
+ / / / /
+ / / c---c---c---c B /
+ / / / \ /
+ / / / b---b C \ /
+ / / / / \ /
+ ---o---o---o---o---o---o---o---o---o---o---o "master"
+
+
+A, B and C are topic branches.
+
+ * A has one fix since it was merged up to "next".
+
+ * B has finished. It has been fully merged up to "master" and "next",
+ and is ready to be deleted.
+
+ * C has not merged to "next" at all.
+
+We would want to allow C to be rebased, refuse A, and encourage
+B to be deleted.
+
+To compute (1):
+
+ git-rev-list ^master ^topic next
+ git-rev-list ^master next
+
+ if these match, topic has not merged in next at all.
+
+To compute (2):
+
+ git-rev-list master..topic
+
+ if this is empty, it is fully merged to "master".
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/hooks/update new/petitboot/.git/hooks/update
--- old/petitboot-0.0.1/.git/hooks/update 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/hooks/update 2007-09-12 15:21:45.000000000 +0200
@@ -0,0 +1,89 @@
+#!/bin/sh
+#
+# An example hook script to mail out commit update information.
+# It also blocks tags that aren't annotated.
+# Called by git-receive-pack with arguments: refname sha1-old sha1-new
+#
+# To enable this hook:
+# (1) change the recipient e-mail address
+# (2) make this file executable by "chmod +x update".
+#
+
+project=$(cat $GIT_DIR/description)
+recipients="commit-list@somewhere.com commit-list@somewhereelse.com"
+
+ref_type=$(git cat-file -t "$3")
+
+# Only allow annotated tags in a shared repo
+# Remove this code to treat dumb tags the same as everything else
+case "$1","$ref_type" in
+refs/tags/*,commit)
+ echo "*** Un-annotated tags are not allowed in this repo" >&2
+ echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate."
+ exit 1;;
+refs/tags/*,tag)
+ echo "### Pushing version '${1##refs/tags/}' to the masses" >&2
+ # recipients="release-announce@somwehere.com announce@somewhereelse.com"
+ ;;
+esac
+
+# set this to 'cat' to get a very detailed listing.
+# short only kicks in when an annotated tag is added
+short='git shortlog'
+
+# see 'date --help' for info on how to write this
+# The default is a human-readable iso8601-like format with minute
+# precision ('2006-01-25 15:58 +0100' for example)
+date_format="%F %R %z"
+
+(if expr "$2" : '0*$' >/dev/null
+then
+ # new ref
+ case "$1" in
+ refs/tags/*)
+ # a pushed and annotated tag (usually) means a new version
+ tag="${1##refs/tags/}"
+ if [ "$ref_type" = tag ]; then
+ eval $(git cat-file tag $3 | \
+ sed -n '4s/tagger \([^>]*>\)[^0-9]*\([0-9]*\).*/tagger="\1" ts="\2"/p')
+ date=$(date --date="1970-01-01 00:00:00 $ts seconds" +"$date_format")
+ echo "Tag '$tag' created by $tagger at $date"
+ git cat-file tag $3 | sed -n '5,$p'
+ echo
+ fi
+ prev=$(git describe "$3^" | sed 's/-g.*//')
+ # the first tag in a repo will yield no $prev
+ if [ -z "$prev" ]; then
+ echo "Changes since the dawn of time:"
+ git rev-list --pretty $3 | $short
+ else
+ echo "Changes since $prev:"
+ git rev-list --pretty $prev..$3 | $short
+ echo ---
+ git diff --stat $prev..$3
+ echo ---
+ fi
+ ;;
+
+ refs/heads/*)
+ branch="${1##refs/heads/}"
+ echo "New branch '$branch' available with the following commits:"
+ git-rev-list --pretty "$3" $(git-rev-parse --not --all)
+ ;;
+ esac
+else
+ base=$(git-merge-base "$2" "$3")
+ case "$base" in
+ "$2")
+ git diff --stat "$3" "^$base"
+ echo
+ echo "New commits:"
+ ;;
+ *)
+ echo "Rebased ref, commits from common ancestor:"
+ ;;
+ esac
+ git-rev-list --pretty "$3" "^$base"
+fi) |
+mail -s "$project: Changes to '${1##refs/heads/}'" $recipients
+exit 0
Files old/petitboot-0.0.1/.git/index and new/petitboot/.git/index differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/info/exclude new/petitboot/.git/info/exclude
--- old/petitboot-0.0.1/.git/info/exclude 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/info/exclude 2007-09-12 15:21:45.000000000 +0200
@@ -0,0 +1,6 @@
+# git-ls-files --others --exclude-from=.git/info/exclude
+# Lines that start with '#' are comments.
+# For a project mostly in C, the following would be a good set of
+# exclude patterns (uncomment them if you want to use them):
+# *.[oa]
+# *~
Files old/petitboot-0.0.1/.git/objects/pack/pack-e410af55057dc2a650e7a7d58dab1091e6ee6dcd.idx and new/petitboot/.git/objects/pack/pack-e410af55057dc2a650e7a7d58dab1091e6ee6dcd.idx differ
Files old/petitboot-0.0.1/.git/objects/pack/pack-e410af55057dc2a650e7a7d58dab1091e6ee6dcd.pack and new/petitboot/.git/objects/pack/pack-e410af55057dc2a650e7a7d58dab1091e6ee6dcd.pack differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/ORIG_HEAD new/petitboot/.git/ORIG_HEAD
--- old/petitboot-0.0.1/.git/ORIG_HEAD 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/ORIG_HEAD 2007-12-12 15:01:07.000000000 +0100
@@ -0,0 +1 @@
+238549fe012d19681ede101f02fc4f653402e550
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/refs/heads/master new/petitboot/.git/refs/heads/master
--- old/petitboot-0.0.1/.git/refs/heads/master 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/refs/heads/master 2007-09-12 15:21:51.000000000 +0200
@@ -0,0 +1 @@
+238549fe012d19681ede101f02fc4f653402e550
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/refs/heads/origin new/petitboot/.git/refs/heads/origin
--- old/petitboot-0.0.1/.git/refs/heads/origin 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/refs/heads/origin 2007-09-12 15:21:51.000000000 +0200
@@ -0,0 +1 @@
+238549fe012d19681ede101f02fc4f653402e550
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/refs/tags/v0.0.1 new/petitboot/.git/refs/tags/v0.0.1
--- old/petitboot-0.0.1/.git/refs/tags/v0.0.1 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/refs/tags/v0.0.1 2007-09-12 15:21:51.000000000 +0200
@@ -0,0 +1 @@
+da40d518d93d45379aa8ba6a2386c5c65c051817
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/.git/remotes/origin new/petitboot/.git/remotes/origin
--- old/petitboot-0.0.1/.git/remotes/origin 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/.git/remotes/origin 2007-09-12 15:21:51.000000000 +0200
@@ -0,0 +1,2 @@
+URL: git://ozlabs.org/home/jk/git/petitboot
+Pull: refs/heads/master:refs/heads/origin
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/Makefile new/petitboot/Makefile
--- old/petitboot-0.0.1/Makefile 2007-08-08 14:59:11.000000000 +0200
+++ new/petitboot/Makefile 2008-01-02 14:58:08.000000000 +0100
@@ -7,10 +7,10 @@
TWIN_LDFLAGS?=$(shell pkg-config --libs libtwin)
LDFLAGS =
-CFLAGS = -O0 -ggdb -Wall '-DPREFIX="$(PREFIX)"'
+CFLAGS = --std=gnu99 -O0 -ggdb -Wall '-DPREFIX="$(PREFIX)"'
PARSERS = native yaboot kboot
-ARTWORK = background.jpg loading.jpg cdrom.png hdd.png usbpen.png tux.png cursor.gz
+ARTWORK = background.jpg cdrom.png hdd.png usbpen.png tux.png loading.jpg cursor.gz
all: petitboot udev-helper
@@ -41,18 +41,28 @@
dist: $(PACKAGE)-$(VERSION).tar.gz
+check: parser-test
+ devices/parser-test.sh
+
+distcheck: dist
+ tar -xvf $(PACKAGE)-$(VERSION).tar.gz
+ cd $(PACKAGE)-$(VERSION) && make check
+
$(PACKAGE)-$(VERSION).tar.gz: $(PACKAGE)-$(VERSION)
tar czvf $@ $^
$(PACKAGE)-$(VERSION): clean
mkdir $@ $@/devices
cp -a artwork $@
+ cp -a utils $@
cp *.[ch] $@
- cp -a devices/*.[ch] $@/devices/
+ cp -a devices/*.{c,h,sh} $@/devices/
+ cp -a devices/parser-tests $@/devices/
cp Makefile $@
cp TODO COPYING $@
clean:
+ rm -rf $(PACKAGE)-$(VERSION)
rm -f petitboot
rm -f udev-helper
rm -f *.o devices/*.o
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/Makefile.orig new/petitboot/Makefile.orig
--- old/petitboot-0.0.1/Makefile.orig 2007-04-07 14:16:24.000000000 +0200
+++ new/petitboot/Makefile.orig 1970-01-01 01:00:00.000000000 +0100
@@ -1,58 +0,0 @@
-PREFIX?=/usr
-VERSION=0.0.1
-PACKAGE=petitboot
-CC=gcc
-INSTALL=install
-TWIN_CFLAGS?=$(shell pkg-config --cflags libtwin)
-TWIN_LDFLAGS?=$(shell pkg-config --libs libtwin)
-
-LDFLAGS =
-CFLAGS = -O0 -ggdb -Wall '-DPREFIX="$(PREFIX)"'
-
-PARSERS = native yaboot kboot
-ARTWORK = background.jpg cdrom.png hdd.png usbpen.png tux.png cursor.gz
-
-all: petitboot udev-helper
-
-petitboot: petitboot.o devices.o
- $(CC) $(LDFLAGS) -o $@ $^
-
-petitboot: LDFLAGS+=$(TWIN_LDFLAGS)
-petitboot: CFLAGS+=$(TWIN_CFLAGS)
-
-udev-helper: devices/udev-helper.o devices/params.o devices/parser.o \
- devices/yaboot-cfg.o \
- $(foreach p,$(PARSERS),devices/$(p)-parser.o)
- $(CC) $(LDFLAGS) -o $@ $^
-
-parser-test: devices/parser-test.o devices/params.o devices/parser.o \
- devices/yaboot-cfg.o \
- $(foreach p,$(PARSERS),devices/$(p)-parser.o)
- $(CC) $(LDFLAGS) -o $@ $^
-
-devices/%: CFLAGS+=-I.
-
-install: all
- $(INSTALL) -D petitboot $(DESTDIR)$(PREFIX)/sbin/petitboot
- $(INSTALL) -D udev-helper $(DESTDIR)$(PREFIX)/sbin/udev-helper
- $(INSTALL) -Dd $(DESTDIR)$(PREFIX)/share/petitboot/artwork/
- $(INSTALL) -t $(DESTDIR)$(PREFIX)/share/petitboot/artwork/ \
- $(foreach a,$(ARTWORK),artwork/$(a))
-
-dist: $(PACKAGE)-$(VERSION).tar.gz
-
-$(PACKAGE)-$(VERSION).tar.gz: $(PACKAGE)-$(VERSION)
- tar czvf $@ $^
-
-$(PACKAGE)-$(VERSION): clean
- mkdir $@ $@/devices
- cp -a artwork $@
- cp *.[ch] $@
- cp -a devices/*.[ch] $@/devices/
- cp Makefile $@
- cp TODO COPYING $@
-
-clean:
- rm -f petitboot
- rm -f udev-helper
- rm -f *.o devices/*.o
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/petitboot.c new/petitboot/petitboot.c
--- old/petitboot-0.0.1/petitboot.c 2007-04-07 14:16:24.000000000 +0200
+++ new/petitboot/petitboot.c 2007-09-12 15:21:51.000000000 +0200
@@ -14,6 +14,7 @@
#include
#include
+#include
#include
#include
@@ -141,6 +142,30 @@
static pboot_rpane_t *pboot_rpane;
static pboot_spane_t *pboot_spane;
+/* control to keyboard mappings for the sixaxis controller */
+uint8_t sixaxis_map[] = {
+ 0, /* 0 Select */
+ 0, /* 1 L3 */
+ 0, /* 2 R3 */
+ 0, /* 3 Start */
+ KEY_UP, /* 4 Dpad Up */
+ KEY_RIGHT, /* 5 Dpad Right */
+ KEY_DOWN, /* 6 Dpad Down */
+ KEY_LEFT, /* 7 Dpad Left */
+ 0, /* 8 L2 */
+ 0, /* 9 R2 */
+ 0, /* 10 L1 */
+ 0, /* 11 R1 */
+ 0, /* 12 Triangle */
+ KEY_ENTER, /* 13 Circle */
+ 0, /* 14 Cross */
+ KEY_DELETE, /* 15 Square */
+ 0, /* 16 PS Button */
+ 0, /* 17 nothing */
+ 0, /* 18 nothing */
+};
+
+
static int pboot_vmode_change = -1;
/* XXX move to twin */
@@ -729,6 +754,20 @@
pboot_cursor_hx,
pboot_cursor_hy);
break;
+ case TwinEventJoyButton:
+ /* map joystick events into key events */
+ if (event->u.js.control >= sizeof(sixaxis_map))
+ break;
+
+ event->u.key.key = sixaxis_map[event->u.js.control];
+ if (event->u.js.value == 0) {
+ event->kind = TwinEventKeyUp;
+ break;
+ } else {
+ event->kind = TwinEventKeyDown;
+ }
+
+ /* fall through.. */
case TwinEventKeyDown:
switch(event->u.key.key) {
/* Gross hack for video modes, need something better ! */
@@ -1099,6 +1138,7 @@
}
pboot_screen = pboot_fbdev->screen;
twin_linux_mouse_create(NULL, pboot_screen);
+ twin_linux_js_create(pboot_screen);
if (pboot_fbdev != NULL) {
char *cursor_path = artwork_pathname("cursor.gz");
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/petitboot-paths.h new/petitboot/petitboot-paths.h
--- old/petitboot-0.0.1/petitboot-paths.h 2007-04-07 14:16:24.000000000 +0200
+++ new/petitboot/petitboot-paths.h 2007-09-12 15:21:51.000000000 +0200
@@ -10,7 +10,7 @@
#endif
#ifndef TMP_DIR
-#define TMP_DIR "/var/tmp"
+#define TMP_DIR "/var/tmp/mnt/"
#endif
#define PBOOT_DEVICE_SOCKET "/var/tmp/petitboot-dev"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/TODO new/petitboot/TODO
--- old/petitboot-0.0.1/TODO 2007-04-07 14:16:24.000000000 +0200
+++ new/petitboot/TODO 2007-09-12 15:21:51.000000000 +0200
@@ -10,7 +10,6 @@
at least a way to use the kernel keymaps and modifiers key handling. Remove
some of the keyboard hacks from twin_fbdev and move console switching to
petitboot
- * PS3 controller support
* Mouse support (twin/petitboot supports it somewhat but it's not working,
check why, probably an udev issue or missing kernel driver)
* Saving settings in nvram
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/utils/99-petitboot.rules new/petitboot/utils/99-petitboot.rules
--- old/petitboot-0.0.1/utils/99-petitboot.rules 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/utils/99-petitboot.rules 2007-09-12 15:21:51.000000000 +0200
@@ -0,0 +1,2 @@
+# tell petitboot when we see new block devices ...
+SUBSYSTEM=="block",RUN+="/sbin/udev-helper"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/petitboot-0.0.1/utils/ps3-kboot-0.1-petitboot.patch new/petitboot/utils/ps3-kboot-0.1-petitboot.patch
--- old/petitboot-0.0.1/utils/ps3-kboot-0.1-petitboot.patch 1970-01-01 01:00:00.000000000 +0100
+++ new/petitboot/utils/ps3-kboot-0.1-petitboot.patch 2007-09-12 15:21:51.000000000 +0200
@@ -0,0 +1,343 @@
+Patch for the Ubuntu (feisty) ps3-kboot package, to add petitboot support.
+
+Just apply this patch, download libtwin-0.0.1.tar.gz and petitboot-0.0.1.tar.gz
+to the dl/ directory, and build.
+
+More info at http://ozlabs.org/~jk/projects/petitboot/
+
+--- ps3-kboot.orig/ps3-kboot-0.1/Makefile 2007-04-05 20:10:44.000000000 +1000
++++ ps3-kboot/ps3-kboot-0.1/Makefile 2007-04-04 20:54:40.000000000 +1000
+@@ -20,6 +20,9 @@
+ LOCAL_KERNEL_CONFIG=$(PWD)/config/kernel-config
+ LOCAL_KBOOT_CONF=$(PWD)/config/kboot.conf
+ LOCAL_FSTAB=$(PWD)/config/fstab
++LOCAL_UDEV_RULES=$(PWD)/config/65-persistent-storage.rules \
++ $(PWD)/config/99-petitboot.rules \
++ $(PWD)/config/20-input-names.rules
+ KBOOT_MESSAGE=$(PWD)/config/message
+ KBOOT_FEATURES=$(PWD)/config/kboot-features
+
+@@ -38,6 +40,14 @@
+ BUSYBOX_DIR=busybox-$(BUSYBOX_VERSION)
+ BUSYBOX_PACKAGE=busybox-$(BUSYBOX_VERSION).tar.bz2
+
++TWIN_VERSION=0.0.2
++TWIN_DIR=libtwin-$(TWIN_VERSION)
++TWIN_PACKAGE=libtwin-$(TWIN_VERSION).tar.gz
++
++PETITBOOT_VERSION=0.0.1
++PETITBOOT_DIR=petitboot-$(PETITBOOT_VERSION)
++PETITBOOT_PACKAGE=petitboot-$(PETITBOOT_VERSION).tar.gz
++
+ # ----- General settings ------------------------------------------------------
+
+ all: otheros.bld
+@@ -48,14 +58,21 @@
+ root: root-meta/installed/userspace \
+ root-meta/installed/kexec-tools \
+ root-meta/installed/busybox \
+- Makefile scripts/kboot \
++ root-meta/installed/twin \
++ root-meta/installed/petitboot \
++ Makefile scripts/kboot scripts/petitboot-init \
+ utils/readline utils/getctty \
+ $(LOCAL_KBOOT_CONF) $(KBOOT_MESSAGE) \
+- $(KBOOT_FEATURES) $(LOCAL_FSTAB)
++ $(KBOOT_FEATURES) $(LOCAL_FSTAB) \
++ $(LOCAL_UDEV_RULES)
+ rm -f root/etc/{hosts,passwd,kboot.conf,message}
+ rm -rf root/tmp root/dev
++ rm -rf root/include root/usr/include
++ find root/ -name '*.a' -o -name '*.la' -exec rm {} \;
+ mkdir -p root/etc root/tmp root/proc root/dev root/sys
+ mkdir -p root/mnt/tmp root/mnt/root root/bin root/sbin
++ mkdir -p root/var/tmp/mnt
++ mkdir -p root/etc/udev/rules.d
+ [ -e root/dev/console ] || mknod root/dev/console c 5 1
+ [ -e root/dev/null ] || mknod root/dev/null c 1 3
+ [ -e root/dev/tty ] || mknod root/dev/tty c 5 0
+@@ -66,15 +83,18 @@
+ cp "$(KBOOT_MESSAGE)" root/etc/
+ cp "$(LOCAL_FSTAB)" root/etc/
+ cp "$(KBOOT_FEATURES)" root/etc/
++ cp $(LOCAL_UDEV_RULES) root/etc/udev/rules.d/
+ touch root/etc/mtab
+ install -D -m755 scripts/kboot root/sbin/kboot
++ install -D -m755 scripts/petitboot-init root/sbin/petitboot-init
+ install -D -s -m755 utils/readline root/bin/readline
+ install -D -s -m755 utils/getctty root/sbin/getctty
+- ln -sf /sbin/kboot root/init
+- for FILE in $$( find root/bin root/sbin \
++ ln -sf /sbin/petitboot-init root/init
++ for FILE in $$( find root/bin root/sbin root/lib/udev \
+ -type f -perm -100 ) ; do \
+ LIBS=$$( ldd $$FILE | awk '/=>.*\.so/ { print $$3 }' | grep -v fakeroot ) ; \
+ for LIB in $$LIBS ; do \
++ [ -e root/$$LIB ] && continue; \
+ LIB_PATH=$$( echo $$LIB | sed -e 's/[^/]*$$//' ) ; \
+ mkdir -p root/$$LIB_PATH ; \
+ cp $$LIB root/$$LIB_PATH ; \
+@@ -133,6 +153,10 @@
+ install -m755 -D /sbin/udevtrigger root/sbin/udevtrigger
+ install -m755 -D /sbin/udevsettle root/sbin/udevsettle
+ install -m644 -D /etc/udev/udev.conf root/etc/udev/udev.conf
++ # udev helpers
++ while read helper; do install -m755 -D /lib/udev/$$helper \
++ root/lib/udev/$$helper; done < config/udev-helpers
++ cp -a /lib/udev/devices root/lib/udev/
+ # ps3pf-utils stuff
+ install -m755 -D /sbin/other-os-flash-util \
+ $(PWD)/root/sbin/other-os-flash-util
+@@ -199,6 +223,57 @@
+ root/sbin/kexec
+ touch $@
+
++# ----- twin library ----------------------------------------------------------
++
++$(TWIN_DIR)/.twin-extracted: \
++ dl/$(TWIN_PACKAGE)
++ tar xfz dl/$(TWIN_PACKAGE)
++ for i in `ls patches/twin/$(TWIN_VERSION)/*patch*` ; do \
++ patch -d $(TWIN_DIR) -p1 < $$i ; \
++ done
++ touch $@
++
++$(TWIN_DIR)/.twin-configured: \
++ $(TWIN_DIR)/.twin-extracted
++ ( cd $(TWIN_DIR) && \
++ ./configure --prefix=/ --disable-x11 $(GNU_ARCH); )
++ touch $@
++
++$(TWIN_DIR)/.twin-built: \
++ $(TWIN_DIR)/.twin-configured
++ make -C $(TWIN_DIR)
++ touch $@
++
++root-meta/installed/twin: \
++ $(TWIN_DIR)/.twin-built
++ mkdir -p root root-meta/installed
++ make -C $(TWIN_DIR) DESTDIR=$(PWD)/root install
++ strip root/lib/libtwin.so
++ rm root/lib/libtwin.a
++ touch $@
++
++# ----- petitboot GUI ----------------------------------------------------------
++
++$(PETITBOOT_DIR)/.petitboot-extracted: \
++ dl/$(PETITBOOT_PACKAGE)
++ tar xfz dl/$(PETITBOOT_PACKAGE)
++ for i in `ls patches/petitboot/$(PETITBOOT_VERSION)/*patch*` ; do \
++ patch -d $(PETITBOOT_DIR) -p1 < $$i ; \
++ done
++ touch $@
++
++$(PETITBOOT_DIR)/.petitboot-built: \
++ $(PETITBOOT_DIR)/.petitboot-extracted root-meta/installed/twin
++ make -C $(PETITBOOT_DIR) PREFIX=/ "TWIN_CFLAGS=-I$(PWD)/root/include" \
++ "TWIN_LDFLAGS=-L$(PWD)/root/lib -ltwin -ljpeg -lpng -lz"
++ touch $@
++
++root-meta/installed/petitboot: \
++ $(PETITBOOT_DIR)/.petitboot-built
++ mkdir -p root root-meta/installed
++ make -C $(PETITBOOT_DIR) PREFIX=/ DESTDIR=$(PWD)/root/ install
++ strip root/sbin/petitboot root/sbin/udev-helper
++ touch $@
+
+ # ----- kboot's utilities -----------------------------------------------------
+
+@@ -213,6 +288,7 @@
+ # ---- Cleanup ----------------------------------------------------------------
+
+ clean:
+- rm -rf $(KERNEL_DIR) $(KEXEC_TOOLS_DIR) $(BUSYBOX_DIR)
++ rm -rf $(KERNEL_DIR) $(KEXEC_TOOLS_DIR) $(BUSYBOX_DIR) $(TWIN_DIR) \
++ $(PETITBOOT_DIR)
+ rm -rf root root-meta otheros.bld initrd.bin
+ rm -f otheros.bld initrd.bin utils/getctty utils/readline
+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
+--- ps3-kboot.orig/ps3-kboot-0.1/config/65-persistent-storage.rules 1970-01-01 10:00:00.000000000 +1000
++++ ps3-kboot/ps3-kboot-0.1/config/65-persistent-storage.rules 2007-04-03 10:08:03.000000000 +1000
+@@ -0,0 +1,61 @@
++# persistent storage links: /dev/{disk,tape}/{by-id,by-uuid,by-label,by-path,by-name}
++# scheme based on "Linux persistent device names", 2004, Hannes Reinecke
++
++SUBSYSTEM!="block", GOTO="persistent_storage_end"
++
++KERNEL=="md*", ACTION=="add|change", PROGRAM="watershed -i udev-mdadm true", GOTO="persistent_storage_path_uuid"
++
++KERNEL=="dm-*", ACTION=="add|change", PROGRAM="devmap_name %M %m", NAME="mapper/$result", GOTO="persistent_storage_identify"
++KERNEL=="dm-*", ACTION=="add|change", NAME=""
++
++ACTION!="add", GOTO="persistent_storage_end"
++
++# skip rules for inappropriate block devices
++KERNEL=="ram*|loop*|fd*|nbd*|gnbd*", GOTO="persistent_storage_end"
++
++# never access non-cdrom removable ide devices, the drivers are causing event loops on open()
++KERNEL=="hd*[!0-9]", ATTRS{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end"
++KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end"
++
++# never add uuid information for whole disk
++ATTR{whole_disk}=="", GOTO="persistent_storage_end"
++
++# for partitions import parent information
++KERNEL=="*[0-9]", IMPORT{parent}="ID_*"
++
++# by-id (hardware serial number)
++KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
++KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
++KERNEL=="hd*[0-9]", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
++
++KERNEL=="sd*[!0-9]|sr*|st*", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
++KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x"
++KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
++KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
++KERNEL=="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode"
++KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
++KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
++KERNEL=="st*", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
++
++LABEL="persistent_storage_path_uuid"
++
++# by-path (shortest physical path)
++KERNEL=="*[!0-9]|sr*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
++KERNEL=="st*", IMPORT{program}="path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}"
++KERNEL=="sr*|st*", GOTO="persistent_storage_end"
++KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
++
++LABEL="persistent_storage_identify"
++
++# by-label/by-uuid (filesystem properties)
++KERNEL=="*[!0-9]", ATTR{removable}=="1", GOTO="persistent_storage_end"
++IMPORT{program}="vol_id --export $tempnode"
++ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
++ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
++
++# BIOS Enhanced Disk Device
++KERNEL=="*[!0-9]", IMPORT{program}="edd_id --export $tempnode"
++KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
++KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
++
++LABEL="persistent_storage_end"
+diff -urN ps3-kboot.orig/ps3-kboot-0.1/config/99-petitboot.rules ps3-kboot/ps3-kboot-0.1/config/99-petitboot.rules
+--- ps3-kboot.orig/ps3-kboot-0.1/config/99-petitboot.rules 1970-01-01 10:00:00.000000000 +1000
++++ ps3-kboot/ps3-kboot-0.1/config/99-petitboot.rules 2007-04-03 16:07:23.000000000 +1000
+@@ -0,0 +1,2 @@
++# tell petitboot when we see new block devices ...
++SUBSYSTEM=="block",RUN+="/sbin/udev-helper"
+diff -urN ps3-kboot.orig/ps3-kboot-0.1/config/udev-helpers ps3-kboot/ps3-kboot-0.1/config/udev-helpers
+--- ps3-kboot.orig/ps3-kboot-0.1/config/udev-helpers 1970-01-01 10:00:00.000000000 +1000
++++ ps3-kboot/ps3-kboot-0.1/config/udev-helpers 2007-04-05 14:21:52.000000000 +1000
+@@ -0,0 +1,12 @@
++devmap_name
++set_hwclock
++cdrom_id
++ata_id
++path_id
++scsi_id
++usb_id
++usb_device_name
++ide_media
++iftab_helper
++watershed
++vol_id
+diff -urN ps3-kboot.orig/ps3-kboot-0.1/scripts/petitboot-init ps3-kboot/ps3-kboot-0.1/scripts/petitboot-init
+--- ps3-kboot.orig/ps3-kboot-0.1/scripts/petitboot-init 1970-01-01 10:00:00.000000000 +1000
++++ ps3-kboot/ps3-kboot-0.1/scripts/petitboot-init 2007-04-05 15:37:48.000000000 +1000
+@@ -0,0 +1,49 @@
++#!/bin/sh
++#
++# kboot - Kboot initialization and command-line interface
++#
++# Written 2005, 2006 by Werner Almesberger
++#
++
++if [ "x$0" = x/init ]; then
++ __sysinit=true
++else
++ __sysinit=false
++fi
++
++###############################################################################
++#
++# System setup and internal initialization
++#
++
++if $__sysinit; then
++ if [ ! -f /proc/partitions ]; then
++ mount -n -t proc none /proc
++ fi
++ if [ ! -d /sys/block ]; then
++ mount -n -t sysfs none /sys
++
++ # Borrowed from initramfs tools. No more hard coded sleep
++ echo "" > /proc/sys/kernel/hotplug
++ udevd --daemon
++ udevtrigger
++ udevsettle --timeout=15
++ fi
++fi
++
++while /bin/true;
++do
++ /sbin/petitboot -u
++
++ # clean up after petitboot
++ for dir in /var/tmp/mnt/*;
++ do
++ umount "$dir"
++ rmdir "$dir"
++ done
++done &
++
++while /bin/true;
++do
++ /sbin/getctty /dev/console /bin/sh
++done
+--- ps3-kboot.orig/ps3-kboot-0.1/debian/control 2007-04-05 20:10:44.000000000 +1000
++++ ps3-kboot/ps3-kboot-0.1/debian/control 2007-04-03 15:54:04.000000000 +1000
+@@ -2,7 +2,7 @@
+ Section: base
+ Priority: optional
+ Maintainer: Ubuntu Kernel Team
+-Build-Depends: debhelper (>= 4.1.67), bzip2, cdbs, fakeroot, udev, ps3pf-utils, zlib1g-dev
++Build-Depends: debhelper (>= 4.1.67), bzip2, cdbs, fakeroot, udev, ps3pf-utils, libc6-dev, zlib1g-dev, libpng12-dev, libjpeg62-dev, pkg-config
+ Standards-Version: 3.6.1
+
+ Package: ps3-kboot
+--- ps3-kboot.orig/ps3-kboot-0.1/config/kernel-config 2007-06-27 14:25:08.000000000 +1000
++++ ps3-kboot/ps3-kboot-0.1/config/kernel-config 7-06-27 14:28:28.000000000 +1000
+@@ -449,10 +449,13 @@
+ #
+ # Userland interfaces
+ #
+-# CONFIG_INPUT_MOUSEDEV is not set
+-# CONFIG_INPUT_JOYDEV is not set
++CONFIG_INPUT_MOUSEDEV=y
++# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
++CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
++CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
++CONFIG_INPUT_JOYDEV=y
+ # CONFIG_INPUT_TSDEV is not set
+-# CONFIG_INPUT_EVDEV is not set
++CONFIG_INPUT_EVDEV=y
+ # CONFIG_INPUT_EVBUG is not set
+
+ #
+@@ -668,6 +671,7 @@
+ # CONFIG_USB_STORAGE_SDDR55 is not set
+ # CONFIG_USB_STORAGE_JUMPSHOT is not set
+ # CONFIG_USB_STORAGE_ALAUDA is not set
++# CONFIG_USB_STORAGE_ONETOUCH is not set
+ # CONFIG_USB_LIBUSUAL is not set
+
+ #
+--- /dev/null 2007-04-18 20:56:03.000000000 +1000
++++ ps3-kboot-0.1/ps3-kboot-0.1/config/20-input-names.rules 2007-06-27 14:34:05.000000000 +1000
+@@ -0,0 +1,5 @@
++# Input devices, group under /dev/input
++KERNEL=="event[0-9]*", NAME="input/%k"
++KERNEL=="mice", NAME="input/%k"
++KERNEL=="mouse[0-9]*", NAME="input/%k"
++KERNEL=="js[0-9]*", NAME="input/%k"
++++++ petitboot.videomode-switch.patch ++++++
Index: powerpc-utils-1.0.0/petitboot/petitboot.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/petitboot.c
+++ powerpc-utils-1.0.0/petitboot/petitboot.c
@@ -32,7 +32,7 @@ static twin_fbdev_t *pboot_fbdev;
static twin_screen_t *pboot_screen;
#define PBOOT_INITIAL_MESSAGE \
- "keys: e=edit del=GameOS ESC=quit"
+ "keys: c=resolution e=edit del=GameOS ESC=quit"
#define PBOOT_LEFT_PANE_SIZE 160
#define PBOOT_LEFT_PANE_COLOR 0x80000000
@@ -153,6 +153,7 @@ static pboot_lpane_t *pboot_lpane;
static pboot_rpane_t *pboot_rpane;
static pboot_spane_t *pboot_spane;
+static int pboot_vmode_change = -1;
static int edit_in_progress;
static char pboot_edit_buf[EDIT_BUF_SIZE];
static twin_bool_t pboot_rpane_event (twin_window_t *window,
@@ -346,6 +347,49 @@ int save_edit_option(char *new_opt)
}
return 0;
}
+
+static void pboot_changeres(void)
+{
+ exit(42);
+}
+
+static twin_bool_t pboot_changeres_event (twin_window_t *window,
+ twin_event_t *event)
+{
+ /* filter out all mouse events */
+ switch(event->kind) {
+ case TwinEventEnter:
+ case TwinEventMotion:
+ case TwinEventLeave:
+ case TwinEventButtonDown:
+ case TwinEventButtonUp:
+ case TwinEventKeyDown:
+ switch(event->u.key.key) {
+ case KEY_0:
+ pboot_vmode_change = 0; /* auto */
+ pboot_changeres();
+ return TWIN_TRUE;
+ case KEY_1:
+ pboot_vmode_change = 3; /* 720p */
+ pboot_changeres();
+ return TWIN_TRUE;
+ case KEY_2:
+ pboot_vmode_change = 4; /* 1080i */
+ pboot_changeres();
+ return TWIN_TRUE;
+ case KEY_3:
+ pboot_vmode_change = 5; /* 1080p */
+ pboot_changeres();
+ return TWIN_TRUE;
+ default:
+ break;
+ }
+ default:
+ break;
+ }
+ return TWIN_FALSE;
+}
+
static twin_bool_t pboot_edit_event (twin_window_t *window,
twin_event_t *event)
{
@@ -363,7 +407,7 @@ static twin_bool_t pboot_edit_event (twi
edit_in_progress = 0;
memset(pboot_edit_buf, 0, EDIT_BUF_SIZE);
pboot_rpane->window->event = pboot_rpane_event;
- pboot_message("keys: e=edit del=GameOS ESC=quit");
+ pboot_message("keys: c=resolution e=edit del=GameOS ESC=quit");
return TWIN_TRUE;
case KEY_BACKSPACE:
if( strlen(pboot_edit_buf) ) {
@@ -452,8 +496,6 @@ static twin_bool_t pboot_select_event (t
return TWIN_FALSE;
}
-static int pboot_vmode_change = -1;
-
/* XXX move to twin */
static inline twin_bool_t twin_rect_intersect(twin_rect_t r1,
twin_rect_t r2)
@@ -866,13 +908,17 @@ static twin_bool_t pboot_rpane_event (tw
pboot_set_rfocus(pboot_rpane->focus_curindex + 1);
return TWIN_TRUE;
case KEY_LEFT:
- pboot_message("keys: del=GameOS ESC=quit");
+ pboot_message("keys: c=resolution del=GameOS ESC=quit");
pboot_select_lpane();
return TWIN_TRUE;
case KEY_E:
pboot_rpane->window->event = pboot_select_event;
pboot_message("Edit: 1=kernel 2=initrd 3=cmdline");
return TWIN_TRUE;
+ case KEY_C:
+ pboot_rpane->window->event = pboot_changeres_event;
+ pboot_message("res: 0=auto 1=720p 2=1080i 3=1080p");
+ return TWIN_TRUE;
case KEY_ENTER:
pboot_choose_option();
default:
@@ -1115,9 +1161,13 @@ static twin_bool_t pboot_lpane_event (tw
pboot_set_lfocus(pboot_lpane->focus_curindex + 1);
return TWIN_TRUE;
case KEY_RIGHT:
- pboot_message("keys: e=edit del=GameOS ESC=quit");
+ pboot_message("keys: c=resolution e=edit del=GameOS ESC=quit");
pboot_select_rpane();
return TWIN_TRUE;
+ case KEY_C:
+ pboot_lpane->window->event = pboot_changeres_event;
+ pboot_message("res: 0=auto 1=720p 2=1080i 3=1080p");
+ return TWIN_TRUE;
default:
break;
}
++++++ petitboot.yaboot-suse.patch ++++++
Index: powerpc-utils-1.0.0/petitboot/devices/yaboot-parser.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/devices/yaboot-parser.c
+++ powerpc-utils-1.0.0/petitboot/devices/yaboot-parser.c
@@ -1,4 +1,4 @@
-
+#define _GNU_SOURCE
#include "parser.h"
#include "params.h"
#include "yaboot-cfg.h"
@@ -96,21 +96,40 @@ static int check_and_add_device(struct d
void process_image(char *label)
{
struct boot_option opt;
- char *cfgopt;
+ char *cfgopt, path[PATH_MAX];
memset(&opt, 0, sizeof(opt));
opt.name = label;
cfgopt = cfg_get_strg(label, "image");
- opt.boot_image_file = resolve_path(cfgopt, mountpoint);
+ if (!cfgopt)
+ cfgopt = cfg_get_strg(label, "image[64bit]");
+ if (cfgopt[0] == '/')
+ opt.boot_image_file = join_paths(mountpoint, cfgopt);
+ else {
+ snprintf(path, sizeof(path), "/suseboot/%s", cfgopt);
+ opt.boot_image_file = join_paths(mountpoint, path);
+ }
+ pb_log("boot_image_file %s\n",opt.boot_image_file);
+
+
if (cfgopt == defimage)
pb_log("This one is default. What do we do about it?\n");
cfgopt = cfg_get_strg(label, "initrd");
- if (cfgopt)
- opt.initrd_file = resolve_path(cfgopt, mountpoint);
+ if (cfgopt) {
+ if (cfgopt[0] == '/')
+ opt.initrd_file = resolve_path(cfgopt, mountpoint);
+ else {
+ snprintf(path, sizeof(path), "/suseboot/%s", cfgopt);
+ opt.initrd_file = resolve_path(cfgopt, path);
+ }
+ pb_log("initrd_file %s\n",opt.initrd_file);
+ }
opt.boot_args = make_params(label, NULL);
+ asprintf(&opt.description, "%s %s",
+ path, opt.boot_args);
add_boot_option(&opt);
@@ -130,18 +149,24 @@ static int yaboot_parse(const char *devi
mountpoint = _mountpoint;
+ /* reset image list for re-parsing */
+ cfg_reset_image_list();
+
filepath = join_paths(mountpoint, "/etc/yaboot.conf");
+ //pb_log("mountpoint=%s filepath=%s\n", mountpoint, filepath);
fd = open(filepath, O_RDONLY);
if (fd < 0) {
free(filepath);
filepath = join_paths(mountpoint, "/yaboot.conf");
fd = open(filepath, O_RDONLY);
-
- if (fd < 0)
- return 0;
}
-
+ if (fd < 0) {
+ filepath = join_paths(mountpoint, "/suseboot/yaboot.cnf");
+ fd = open(filepath, O_RDONLY);
+ }
+ if (fd < 0)
+ return 0;
if (fstat(fd, &st)) {
close(fd);
return 0;
@@ -172,6 +197,8 @@ static int yaboot_parse(const char *devi
dev = malloc(sizeof(*dev));
memset(dev, 0, sizeof(*dev));
dev->id = strdup(devicepath);
+ dev->name = strrchr(devicepath, '/');dev->name++;
+
if (cfg_get_strg(0, "init-message")) {
char *newline;
dev->description = strdup(cfg_get_strg(0, "init-message"));
Index: powerpc-utils-1.0.0/petitboot/devices/yaboot-cfg.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/devices/yaboot-cfg.c
+++ powerpc-utils-1.0.0/petitboot/devices/yaboot-cfg.c
@@ -27,6 +27,8 @@
#include
#include
+#include "parser.h"
+
#define prom_printf printf
#define prom_putchar putchar
#define prom_vprintf vprintf
@@ -113,6 +115,12 @@ static struct IMAGES {
struct IMAGES *next;
} *images = NULL;
+/* hack to clear image list when optical media is reinserted */
+void cfg_reset_image_list(void)
+{
+ images = NULL;
+}
+
void cfg_error (char *msg,...)
{
va_list ap;
@@ -296,7 +304,7 @@ static int cfg_set (char *item, char *va
{
CONFIG *walk;
- if (!strcasecmp (item, "image")) {
+ if (!strcasecmp (item, "image") || !strcasecmp (item, "image[64bit]")) {
struct IMAGES **p = &images;
while (*p)
@@ -309,6 +317,7 @@ static int cfg_set (char *item, char *va
(*p)->next = 0;
curr_table = ((*p)->table);
memcpy (curr_table, cf_image, sizeof (cf_image));
+ item = "image";
}
for (walk = curr_table; walk->type != cft_end; walk++) {
if (walk->name && !strcasecmp (walk->name, item)) {
Index: powerpc-utils-1.0.0/petitboot/devices/yaboot-cfg.h
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot/devices/yaboot-cfg.h
+++ powerpc-utils-1.0.0/petitboot/devices/yaboot-cfg.h
@@ -27,4 +27,5 @@ extern int cfg_get_flag(char *image, cha
extern void cfg_print_images(void);
extern char* cfg_get_default(void);
extern char* cfg_next_image(char *);
+extern void cfg_reset_image_list(void);
#endif
++++++ ps3config-2.6.22 ++++++
--- arch/ppc/powerpc-utils/ps3config-2.6.22 2007-10-19 10:47:24.000000000 +0200
+++ /mounts/work_src_done/STABLE/powerpc-utils/ps3config-2.6.22 2008-01-07 09:03:22.399811000 +0100
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22-rc6
-# Mon Jul 16 11:41:34 2007
+# Linux kernel version: 2.6.22
+# Thu Jan 3 10:01:44 2008
#
CONFIG_PPC64=y
CONFIG_64BIT=y
@@ -307,7 +307,24 @@
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set
-# CONFIG_BT is not set
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+# CONFIG_BT_SCO is not set
+CONFIG_BT_RFCOMM=y
+# CONFIG_BT_RFCOMM_TTY is not set
+# CONFIG_BT_BNEP is not set
+CONFIG_BT_HIDP=y
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=y
+# CONFIG_BT_HCIUSB_SCO is not set
+# CONFIG_BT_HCIUART is not set
+# CONFIG_BT_HCIBCM203X is not set
+# CONFIG_BT_HCIBPA10X is not set
+# CONFIG_BT_HCIBFUSB is not set
+CONFIG_BT_HCIVHCI=y
# CONFIG_AF_RXRPC is not set
#
@@ -363,7 +380,6 @@
#
# Misc devices
#
-# CONFIG_BLINK is not set
# CONFIG_IDE is not set
#
@@ -481,9 +497,9 @@
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_JOYDEV=y
# CONFIG_INPUT_TSDEV is not set
-# CONFIG_INPUT_EVDEV is not set
+CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set
#
@@ -491,7 +507,27 @@
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
-# CONFIG_INPUT_JOYSTICK is not set
+CONFIG_INPUT_JOYSTICK=y
+# CONFIG_JOYSTICK_ANALOG is not set
+# CONFIG_JOYSTICK_A3D is not set
+# CONFIG_JOYSTICK_ADI is not set
+# CONFIG_JOYSTICK_COBRA is not set
+# CONFIG_JOYSTICK_GF2K is not set
+# CONFIG_JOYSTICK_GRIP is not set
+# CONFIG_JOYSTICK_GRIP_MP is not set
+# CONFIG_JOYSTICK_GUILLEMOT is not set
+# CONFIG_JOYSTICK_INTERACT is not set
+# CONFIG_JOYSTICK_SIDEWINDER is not set
+# CONFIG_JOYSTICK_TMDC is not set
+# CONFIG_JOYSTICK_IFORCE is not set
+# CONFIG_JOYSTICK_WARRIOR is not set
+# CONFIG_JOYSTICK_MAGELLAN is not set
+# CONFIG_JOYSTICK_SPACEORB is not set
+# CONFIG_JOYSTICK_SPACEBALL is not set
+# CONFIG_JOYSTICK_STINGER is not set
+# CONFIG_JOYSTICK_TWIDJOY is not set
+# CONFIG_JOYSTICK_JOYDUMP is not set
+# CONFIG_JOYSTICK_XPAD is not set
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set
@@ -631,7 +667,7 @@
CONFIG_USB_HID=y
# CONFIG_USB_HIDINPUT_POWERBOOK is not set
# CONFIG_HID_FF is not set
-# CONFIG_USB_HIDDEV is not set
+CONFIG_USB_HIDDEV=y
#
# USB support
@@ -691,6 +727,7 @@
CONFIG_USB_STORAGE_SDDR55=y
CONFIG_USB_STORAGE_JUMPSHOT=y
CONFIG_USB_STORAGE_ALAUDA=y
+# CONFIG_USB_STORAGE_ONETOUCH is not set
CONFIG_USB_STORAGE_KARMA=y
# CONFIG_USB_LIBUSUAL is not set
@@ -821,7 +858,6 @@
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
# CONFIG_UDF_FS is not set
-# CONFIG_UDF_NLS is not set
#
# DOS/FAT/NT Filesystems
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org