Hello community,
here is the log from the commit of package powerpc-utils
checked in at Mon May 7 18:16:32 CEST 2007.
--------
--- arch/ppc/powerpc-utils/powerpc-utils.changes 2007-02-19 14:09:02.000000000 +0100
+++ /mounts/work_src_done/STABLE/powerpc-utils/powerpc-utils.changes 2007-05-07 16:37:08.043384000 +0200
@@ -1,0 +2,8 @@
+Mon May 7 16:35:35 CEST 2007 - sassmann@suse.de
+
+- generate otheros.bld from kernel source 2.6.16
+ added libtwin
+ added petitboot
+ added ps3pf-utils
+
+-------------------------------------------------------------------
Old:
----
get_release_number.sh
New:
----
extract_from_elf.c
geninitrd.sh
libtwin-0.0.2.tar.gz
linux-2.6.16-ps3patches.tar.bz2
linux-2.6.16.tar.bz2
petitboot-0.0.1.tar.gz
petitboot.kboot-parser.patch
petitboot.root-dev-ram.patch
petitboot.yaboot-parser.patch
ps3av.h
ps3config
ps3pf-utils-1.0.9.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ powerpc-utils.spec ++++++
--- /var/tmp/diff_new_pack.kv2589/_old 2007-05-07 18:16:11.000000000 +0200
+++ /var/tmp/diff_new_pack.kv2589/_new 2007-05-07 18:16:11.000000000 +0200
@@ -11,12 +11,13 @@
# norootforbuild
Name: powerpc-utils
-BuildRequires: librtas
+BuildRequires: busybox kexec-tools libjpeg-devel libpng-devel librtas pkg-config quilt udev util-linux zlib-devel
+#BuildRequires: ncurses-devel
Obsoletes: powerpc-utils-papr
Obsoletes: ppc64-utils
Provides: ppc64-utils
Version: 1.0.0
-Release: 200702090516
+Release: 200704280124
License: IBM Public License
URL: http://powerpc-utils.ozlabs.org/
Group: System/Management
@@ -26,6 +27,15 @@
%define papr_version 1.0.1
Source0: powerpc-utils-%{version}.tar.gz
Source1: powerpc-utils-papr-%{papr_version}.tar.gz
+Source2: linux-2.6.16.tar.bz2
+Source3: linux-2.6.16-ps3patches.tar.bz2
+Source4: ps3config
+Source5: geninitrd.sh
+Source7: libtwin-0.0.2.tar.gz
+Source8: petitboot-0.0.1.tar.gz
+Source9: extract_from_elf.c
+Source10: ps3pf-utils-1.0.9.tar.bz2
+Source11: ps3av.h
Patch0: powerpc-utils-nvsetenv.patch
Patch1: powerpc-utils-lsprop.patch
Patch2: powerpc-utils.ofpathname.show_of_path.patch
@@ -33,6 +43,9 @@
Patch4: powerpc-utils.bootlist.easy-network-dev.patch
Patch5: powerpc-utils.nvram.short-write.patch
Patch6: powerpc-utils.ofpathname.flat-device-tree.patch
+Patch20: petitboot.root-dev-ram.patch
+Patch21: petitboot.kboot-parser.patch
+Patch22: petitboot.yaboot-parser.patch
%description
IBM PPC64 hardware utilities for accessing NVRAM, flashing firmware,
@@ -47,7 +60,8 @@
Michael Strosaker
%prep
-%setup -q -a 1
+%setup -q -a 1 -a 2 -a 3 -a 7 -a 8 -a 10
+ln -s ../linux-2.6.16-ps3patches/patches linux-2.6.16/patches
%patch0 -p1
%patch1 -p1
%patch2 -p1
@@ -56,12 +70,64 @@
%patch5 -p1
%patch6 -p1
cd powerpc-utils-papr-%{papr_version}
+cd ..
+%patch20 -p1
+%patch21 -p1
+%patch22 -p1
%build
make CFLAGS="$RPM_OPT_FLAGS" %{?jobs:-j%jobs}
cd powerpc-utils-papr-%{papr_version}
make CFLAGS="$RPM_OPT_FLAGS" %{?jobs:-j%jobs}
cd ..
+# make kernel
+cd linux-2.6.16
+quilt push -q -a
+mkdir ../O
+cp %{S:4} ../O/.config
+make O=../O vmlinux %{?jobs:-j%jobs}
+cd ..
+# make libtwin
+cd libtwin-0.0.2
+autoreconf -fi
+LDFLAGS="-s" \
+CFLAGS="-Wall -Os" \
+./configure \
+ --prefix=%{_prefix}
+make %{?jobs:-j%jobs}
+make install \
+ DESTDIR=`pwd`/../install-libtwin
+cd ..
+# make petitboot
+cd petitboot-0.0.1
+make all \
+ CFLAGS="-Wall -I`pwd`/../install-libtwin%{_prefix}/include -I. -Os" \
+ LDFLAGS=" -L`pwd`/../install-libtwin%{_libdir} -ltwin -lpng12 -ljpeg -lz -s"
+make install \
+ DESTDIR=`pwd`/../install-petitboot
+cd ..
+ln -sfn */petitboot petitboot
+export LD_LIBRARY_PATH=`pwd`/install-libtwin%{_libdir}
+ldd petitboot
+# make ps3pf-utils
+cd ps3pf-utils-1.0.9
+mkdir asm
+cp %{S:11} asm
+make CC="gcc $RPM_OPT_FLAGS -I." %{?jobs:-j%jobs}
+make install \
+ DESTDIR=`pwd`/../install-ps3pf-utils
+cd ..
+# create otheros.bld
+gcc -Wall -Os -s -o extract_from_elf %{S:9}
+bash %{S:5} xxx O/vmlinux
+objcopy -O binary O/vmlinux O/otheros.build
+gzip -cv9 < O/otheros.build > otheros.bld
+bash -c '
+FILESIZE=`stat -c %s otheros.bld`
+MAXSIZE=$(( 0x3FFE00 ))
+echo "otheros.bld filesize:$FILESIZE max size:$MAXSIZE size left:$(( $MAXSIZE - $FILESIZE )) "
+test $FILESIZE -lt $MAXSIZE
+'
%install
rm -rf $RPM_BUILD_ROOT
@@ -79,6 +145,12 @@
mv README ../README.papr
cd ..
rm -rf $RPM_BUILD_ROOT/usr/share/doc/packages
+cd ps3pf-utils-1.0.9
+make install \
+ DESTDIR=$RPM_BUILD_ROOT
+cd ..
+mkdir $RPM_BUILD_ROOT/usr/share/ps3
+cp otheros.bld $RPM_BUILD_ROOT/usr/share/ps3
%files
%defattr(444, root, root,555)
@@ -86,9 +158,15 @@
%{_mandir}/man*/*
%attr (755,root,root) /*bin/*
%attr (755,root,root) /usr/*bin/*
+/usr/share/ps3/
%config %attr (755,root,root) /etc/init.d/ibmvscsis.sh
%changelog
+* Mon May 07 2007 - sassmann@suse.de
+- generate otheros.bld from kernel source 2.6.16
+ added libtwin
+ added petitboot
+ added ps3pf-utils
* Mon Feb 19 2007 - olh@suse.de
- handle network devices with flat device-tree
* Fri Oct 13 2006 - olh@suse.de
++++++ petitboot.kboot-parser.patch ++++++
---
petitboot-0.0.1/devices/kboot-parser.c | 56 +++++++++++++++++++++++++++------
petitboot-0.0.1/devices/parser.h | 5 ++
petitboot-0.0.1/devices/udev-helper.c | 41 +++++++++++-------------
3 files changed, 71 insertions(+), 31 deletions(-)
Index: powerpc-utils-1.0.0/petitboot-0.0.1/devices/kboot-parser.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot-0.0.1/devices/kboot-parser.c
+++ powerpc-utils-1.0.0/petitboot-0.0.1/devices/kboot-parser.c
@@ -9,6 +9,8 @@
#include
#include
#include
+#include
+#include
#include "parser.h"
#include "params.h"
@@ -17,6 +19,47 @@
static const char *mountpoint;
+/* /dev/sda5:/vmlinux */
+static char *blah(const char *option)
+{
+ struct stat sb;
+ char mount_path[PATH_MAX];
+ char *filepath, *p, *dev, *file;
+ int i;
+
+ dev = strdup(option);
+ if (!dev)
+ return NULL;
+ file = strrchr(dev, ':');
+ if (!file)
+ return NULL;
+ *file = '\0';
+ file++;
+ i = stat(dev, &sb);
+ if (i < 0)
+ return NULL;
+ if (!S_ISBLK(sb.st_mode)) {
+ pb_log("'%s' is not a blockdevice\n", dev);
+ return NULL;
+ }
+ /* create an unique mountpoint */
+ snprintf(mount_path, sizeof(mount_path), "/%016llx", (unsigned long long)sb.st_rdev);
+ i = mkdir(mount_path, 0755);
+ if (i < 0)
+ pb_log("failed to create mount dir '%s': %s\n", mount_path, strerror(errno));
+
+ filepath = malloc(strlen(mount_path) + 1 + strlen(file) + 1);
+ if (filepath) {
+ sprintf(filepath, "%s/%s", mount_path, file);
+ i = asprintf(&p, "/bin/sh -c ' /bin/mount -o ro %s %s' >> /log 2>&1", dev, mount_path);
+ if (i > 0)
+ i = system(p);
+ pb_log("system ret %d for '%s'\n", i, p);
+ }
+ pb_log("ret '%s'\n", filepath);
+ return filepath;
+}
+
static int param_is_ignored(const char *param)
{
static const char *ignored_options[] =
@@ -97,13 +140,13 @@ static int parse_option(struct boot_opti
/* 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 = blah(config);
opt->description = strdup(config);
return 1;
}
*pos = 0;
- opt->boot_image_file = join_paths(mountpoint, config);
+ opt->boot_image_file = blah(config);
cmdline = malloc(buf_size);
*cmdline = 0;
@@ -128,13 +171,8 @@ static int parse_option(struct boot_opti
}
}
- if (initrd) {
- asprintf(&tmp, "initrd=%s %s", initrd, cmdline);
- free(cmdline);
- cmdline = tmp;
-
- opt->initrd_file = join_paths(mountpoint, initrd);
- }
+ if (initrd)
+ opt->initrd_file = blah(initrd);
if (root) {
asprintf(&tmp, "root=%s %s", root, cmdline);
Index: powerpc-utils-1.0.0/petitboot-0.0.1/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
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)
+
+
int mount_device(const char *dev_path, char *mount_path);
Index: powerpc-utils-1.0.0/petitboot-0.0.1/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 @@
static FILE *logf;
static int sock;
-void pb_log(const char *fmt, ...)
+void __pb_log(const char *fmt, ...)
{
va_list ap;
@@ -183,23 +183,25 @@ int connect_to_socket()
int mount_device(const char *dev_path, char *mount_path)
{
- char *dir;
- const char *basename;
+ struct stat sb;
int pid, status, rc = -1;
- 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));
+ memset(&sb, 0, sizeof(sb));
+ status = stat(dev_path, &sb);
+ if (status < 0) {
+ pb_log("failed to stat '%s', %s\n", dev_path, strerror(errno));
+ goto out;
+ }
+ if (!S_ISBLK(sb.st_mode)) {
+ pb_log("'%s' is not a blockdevice\n", dev_path);
+ goto out;
+ }
+
+ /* create an unique mountpoint */
+ snprintf(mount_path, PATH_MAX, "/%016llx", (unsigned long long)sb.st_rdev);
+ status = mkdir(mount_path, 0755);
+ if (status < 0) {
+ pb_log("failed to create mount dir '%s': %s\n", mount_path, strerror(errno));
goto out;
}
@@ -210,7 +212,7 @@ int mount_device(const char *dev_path, c
}
if (pid == 0) {
- execl(MOUNT_BIN, MOUNT_BIN, dev_path, dir, "-o", "ro", NULL);
+ execl(MOUNT_BIN, MOUNT_BIN, dev_path, mount_path, "-o", "ro", NULL);
exit(EXIT_FAILURE);
}
@@ -220,13 +222,10 @@ int mount_device(const char *dev_path, c
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;
}
++++++ petitboot.root-dev-ram.patch ++++++
---
petitboot-0.0.1/devices/kboot-parser.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
Index: powerpc-utils-1.0.0/petitboot-0.0.1/devices/kboot-parser.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot-0.0.1/devices/kboot-parser.c
+++ powerpc-utils-1.0.0/petitboot-0.0.1/devices/kboot-parser.c
@@ -142,10 +142,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", cmdline);
++++++ petitboot.yaboot-parser.patch ++++++
---
petitboot-0.0.1/devices/yaboot-parser.c | 61 ++++++++------------------------
1 file changed, 16 insertions(+), 45 deletions(-)
Index: powerpc-utils-1.0.0/petitboot-0.0.1/devices/yaboot-parser.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot-0.0.1/devices/yaboot-parser.c
+++ powerpc-utils-1.0.0/petitboot-0.0.1/devices/yaboot-parser.c
@@ -15,8 +15,6 @@
static struct device *dev;
static const char *mountpoint;
-static char partition_mntpoint[PATH_MAX];
-static char *defimage;
char *
make_params(char *label, char *params)
@@ -97,19 +95,32 @@ static int check_and_add_device(struct d
void process_image(char *label)
{
struct boot_option opt;
- char *cfgopt;
-
+ char *cfgopt, path[PATH_MAX];
+ pb_log("ENTER process_image\n");
memset(&opt, 0, sizeof(opt));
opt.name = label;
cfgopt = cfg_get_strg(label, "image");
- opt.boot_image_file = join_paths(mountpoint, cfgopt);
- if (cfgopt == defimage)
- pb_log("This one is default. What do we do about it?\n");
-
+
+ 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);
+
cfgopt = cfg_get_strg(label, "initrd");
- if (cfgopt)
- opt.initrd_file = join_paths(mountpoint, cfgopt);
+ if (cfgopt) {
+ if (cfgopt[0] == '/')
+ opt.initrd_file = join_paths(mountpoint, cfgopt);
+ else {
+ snprintf(path, sizeof(path), "/suseboot/%s", cfgopt);
+ opt.initrd_file = join_paths(mountpoint, path);
+ }
+ }
opt.boot_args = make_params(label, NULL);
@@ -131,7 +142,7 @@ static int yaboot_parse(const char *devi
mountpoint = _mountpoint;
- filepath = join_paths(mountpoint, "/etc/yaboot.conf");
+ filepath = join_paths(mountpoint, "/suseboot/yaboot.cnf");
fd = open(filepath, O_RDONLY);
if (fd < 0) {
@@ -182,45 +193,10 @@ static int yaboot_parse(const char *devi
}
dev->icon_file = strdup(generic_icon_file(guess_device_type()));
- /* Mount the 'partition' which is what all the image filenames
- are relative to */
- tmpstr = cfg_get_strg(0, "partition");
- if (tmpstr) {
- char *endp;
- int partnr = strtol(tmpstr, &endp, 10);
- if (endp != tmpstr && !*endp) {
- char *new_dev = malloc(strlen(devicepath) + strlen(tmpstr) + 1);
- if (!new_dev)
- return 0;
-
- strcpy(new_dev, devicepath);
-
- /* Strip digits (partition number) from string */
- endp = &new_dev[strlen(devicepath) - 1];
- while (isdigit(*endp))
- *(endp--) = 0;
-
- /* 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;
- dev->id = new_dev;
- }
- }
- defimage = cfg_get_default();
- if (!defimage)
- return 0;
- defimage = cfg_get_strg(defimage, "image");
label = cfg_next_image(NULL);
+ pb_log("label: %s\n",label);
if (!label || !check_and_add_device(dev))
return 0;
Index: powerpc-utils-1.0.0/petitboot-0.0.1/devices/yaboot-cfg.c
===================================================================
--- powerpc-utils-1.0.0.orig/petitboot-0.0.1/devices/yaboot-cfg.c
+++ powerpc-utils-1.0.0/petitboot-0.0.1/devices/yaboot-cfg.c
@@ -26,6 +26,7 @@
#include
#include
#include
+#include "parser.h"
#define prom_printf printf
#define prom_putchar putchar
@@ -295,8 +296,8 @@ static void cfg_return (char *item, char
static int cfg_set (char *item, char *value)
{
CONFIG *walk;
-
- if (!strcasecmp (item, "image")) {
+pb_log("CFG_SET: %i\n",strcasecmp(item, "image[64]"));
+ if (!strcasecmp (item, "image") || !strcasecmp (item, "image[64bit]")) {
struct IMAGES **p = &images;
while (*p)
@@ -309,6 +310,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)) {
@@ -341,16 +343,21 @@ int cfg_parse (char *cfg_file, char *buf
currp = buff;
endp = currp + len;
- if (setjmp (env))
+ if (setjmp (env)) {
+ pb_log("setjump failed\n");
return -1;
+}
while (1) {
- if (!cfg_next (&item, &value))
+ if (!cfg_next (&item, &value)) {
+ pb_log("cfg_next failed\n");
return 0;
+ }
if (!cfg_set (item, value)) {
#if DEBUG
prom_printf("Can't set item %s to value %s\n", item, value);
#endif
}
+ pb_log("cfg_parse ok!\n");
free (item);
}
}
@@ -359,9 +366,11 @@ static char *cfg_get_strg_i (CONFIG * ta
{
CONFIG *walk;
- for (walk = table; walk->type != cft_end; walk++)
+ for (walk = table; walk->type != cft_end; walk++) {
+ pb_log("cfg_get_strg_i -> walk->name: %s\n", walk->name);
if (walk->name && !strcasecmp (walk->name, item))
return walk->data;
+ }
return 0;
}
@@ -470,7 +479,9 @@ char *cfg_next_image(char *prev)
wantnext = 1;
for (p = images; p; p = p->next) {
+ pb_log("p->table %s\n",p->table);
label = cfg_get_strg_i (p->table, "label");
+ pb_log("cfg_next_image ->label %s", label);
if (!label) {
label = cfg_get_strg_i (p->table, "image");
alias = strrchr (label, '/');
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org