Hello community, here is the log from the commit of package lilo checked in at Fri Aug 24 00:36:19 CEST 2007. -------- --- arch/ppc/lilo/lilo.changes 2007-08-17 22:42:01.000000000 +0200 +++ /mounts/work_src_done/STABLE/lilo/lilo.changes 2007-08-23 15:41:11.000000000 +0200 @@ -1,0 +2,16 @@ +Thu Aug 23 15:40:23 CEST 2007 - olh@suse.de + +- fix variable assignment in lilo-pmac.lib to fix 'copy' option + for root on lvm + +------------------------------------------------------------------- +Thu Aug 23 11:52:42 CEST 2007 - olh@suse.de + +- handle the sysfs layout of the week: /sys/block contains symlinks + +------------------------------------------------------------------- +Thu Aug 23 11:46:59 CEST 2007 - olh@suse.de + +- implement the lilo -R 'boot once' functionality (268527) + +------------------------------------------------------------------- Old: ---- yaboot-10.1.22-r1012.tar.bz2 New: ---- yaboot-10.1.22-r1016.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lilo.spec ++++++ --- /var/tmp/diff_new_pack.Z29117/_old 2007-08-24 00:35:15.000000000 +0200 +++ /var/tmp/diff_new_pack.Z29117/_new 2007-08-24 00:35:15.000000000 +0200 @@ -11,7 +11,7 @@ # norootforbuild Name: lilo -%define yaboot_vers 10.1.22-r1012 +%define yaboot_vers 10.1.22-r1016 Group: System/Boot License: BSD 3-Clause Summary: The Linux Loader, a Boot Menu @@ -24,7 +24,7 @@ Requires: binutils Requires: parted Version: 10.1.22 -Release: 61 +Release: 63 Source0: lilo-%{version}.tar.bz2 Source1: http://penguinppc.org/projects/yaboot/yaboot-%{yaboot_vers}.tar.bz2 # $Id: lilo.spec 985 2007-07-26 10:53:09Z olh $ @@ -155,6 +155,13 @@ %doc %{_mandir}/*/* %changelog +* Thu Aug 23 2007 - olh@suse.de +- fix variable assignment in lilo-pmac.lib to fix 'copy' option + for root on lvm +* Thu Aug 23 2007 - olh@suse.de +- handle the sysfs layout of the week: /sys/block contains symlinks +* Thu Aug 23 2007 - olh@suse.de +- implement the lilo -R 'boot once' functionality (268527) * Fri Aug 17 2007 - olh@suse.de - recognize the lilo -R "boot once" cmdline option * Fri Aug 17 2007 - olh@suse.de ++++++ lilo-10.1.22.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/lilo-10.1.22/lilo.new new/lilo-10.1.22/lilo.new --- old/lilo-10.1.22/lilo.new 2007-08-17 22:42:01.000000000 +0200 +++ new/lilo-10.1.22/lilo.new 2007-08-23 11:53:18.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/bash # vim: syntax=sh ts=4 -# $Id: lilo.new 1015 2007-08-17 20:42:01Z olh $ +# $Id: lilo.new 1017 2007-08-23 09:53:18Z olh $ # # a simple lilo to store the boot loader and the kernel images # in bash2 ... Think different [tm] @@ -157,7 +157,7 @@ --get-arch returns the board type lilo is running on known values are: iseries chrp pmac_new pmac_old pegasos - -R "label opts" set default command line for next reboot + -R "label opts" set default command line for next reboot (boot once) --version | -v displays the version number --help displays this help text EOHELP @@ -429,7 +429,7 @@ fi # find kernel name for major:minor pair : direntry_majorminor $direntry_majorminor - for dev in $(find /sys/block/ -name dev) + for dev in /sys/block/*/*/dev /sys/block/*/dev do : looking at $dev if test "$(< $dev)" = "$direntry_majorminor" @@ -909,6 +909,92 @@ done } #end function check_config_file +function setup_boot_once () { + local blah + local boot_once + local -i driver_count_offset=16 + local -i driverlist_offset=18 + local -i driverlist_entry_size=8 + local -i driver_count + local -i writing_to_disk_from_firmware_is_broken + + boot_once=$1 + if test -z "$boot_once" + then + return + fi + pushd "/sys/block/${OPTION_BOOT_DISK_DEVICE_NAME[0]}/device" > /dev/null + cd `pwd -P` + until test "$PWD" = "/" + do + if test -f devspec + then + blah="`cat devspec`" + echo "devspec '$blah' in $PWD" + blah="`cat /proc/device-tree/$blah/device_type`" + echo "device_type is '$blah'" + break + fi + cd .. + done + popd > /dev/null + case "$blah" in + pci-ide|pci-ata) + # pci-ide is the CMD646 onboard controller in B&W (untested) + # and early G4 (tested) models. Writing to disk from yaboot + # will corrupt the first 32k with random data + echo "The firmware can not write reliable to ${OPTION_BOOT_DISK_DEVICE_NAME[0]}." + writing_to_disk_from_firmware_is_broken=1 + ;; + ata) + # ata is used on pmac (tested) and QS22 + writing_to_disk_from_firmware_is_broken=0 + ;; + ide) + # ide is used on first gen iMac (untested) and JS20 + writing_to_disk_from_firmware_is_broken=2 + ;; + *) + # everything else is untested and will cause data integrity issues + writing_to_disk_from_firmware_is_broken=2 + ;; + esac + if test $writing_to_disk_from_firmware_is_broken = 0 + then + echo "The dubios lilo-once feature will most likely work with your firmware." + echo "But better fix YaST to not force reboot after first stage." + echo "Its pointless. Its wrong. It does not fix anything." + elif test $writing_to_disk_from_firmware_is_broken = 1 + then + echo "The firmware disk driver will corrupt your disk when writing to the first disk block" + echo "$0 -R is disabled" + return + else + echo "The firmware disk driver may corrupt your disk when writing to the first disk block" + echo "$0 -R is disabled because this system is untested." + return + fi + return + if test "`dd if=${OPTION_BOOT_DISK_DEVICE_NODE[0]} count=2 bs=1 2>/dev/null`" != "ER" + then + echo "Block zero does not start with 'ER', no mac label on ${OPTION_BOOT_DISK_DEVICE_NODE[0]}" + return + fi + if test "`dd if=${OPTION_BOOT_DISK_DEVICE_NODE[0]} count=2 bs=1 skip=512 2>/dev/null`" != "PM" + then + echo "Block one does not start with 'PM', no (or empty) mac label on ${OPTION_BOOT_DISK_DEVICE_NODE[0]}" + return + fi + echo "reading driver_count from ${OPTION_BOOT_DISK_DEVICE_NODE[0]}" + read blah driver_count < <( dd if="${OPTION_BOOT_DISK_DEVICE_NODE[0]}" bs=1 skip=$driver_count_offset count=2 2>/dev/null | od --read-bytes=2 --width=2 -t x2 ) + echo "driver_count is $driver_count" + offset_into_driverlist=$(( ($driver_count * $driverlist_entry_size) + $driverlist_offset)) + echo "offset into driverlist is $offset_into_driverlist" + if test "$offset_into_driverlist" -lt 512 + then + echo -n $boot_once | dd of=${OPTION_BOOT_DISK_DEVICE_NODE[0]} bs=1 seek=$(( $offset_into_driverlist )) count=$(( 512 - $offset_into_driverlist )) + fi +} # check for requirements: # /proc @@ -953,6 +1039,10 @@ parse_config_file check_config_file +if [ "$boot_once" ]; then + setup_boot_once "$boot_once" + exit 0 +fi function running_on_ps3() { local device local kernel_filename @@ -983,7 +1073,8 @@ file_majorminor=$file_major:$file_minor - for i in $(find /sys/block/ -name dev); do + for i in /sys/block/*/*/dev /sys/block/*/dev + do : looking at $i if [ "$(< $i)" = "$file_majorminor" ] ; then file_sysfs_path=$i ; break ; fi done diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/lilo-10.1.22/lilo-pmac.lib new/lilo-10.1.22/lilo-pmac.lib --- old/lilo-10.1.22/lilo-pmac.lib 2007-07-30 11:54:28.000000000 +0200 +++ new/lilo-10.1.22/lilo-pmac.lib 2007-08-23 15:41:11.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: lilo-pmac.lib 1007 2007-07-30 09:54:28Z olh $ +# $Id: lilo-pmac.lib 1018 2007-08-23 13:41:11Z olh $ # vim: syntax=sh ts=4 # # library for PowerMac routings @@ -103,7 +103,7 @@ # device-tree nodes with pci0123 have no boot rom FILE_PATH=$(get_of_path ${CONFIG_IMAGE_FILE[$i]} | grep -v /pci[0-9]) - test -z "$FILE_PATH" && "${CONFIG_IMAGE_COPY[$i]}" = "true" + test -z "$FILE_PATH" && CONFIG_IMAGE_COPY[$i]="true" if test "${CONFIG_IMAGE_COPY[$i]}" = "true" then CONFIG_IMAGE_FILE_YABOOT_CONF_PATH[$i]="$(printf 'vmlinux.%03d' $i)" @@ -117,7 +117,7 @@ fi if [ -n "${CONFIG_IMAGE_INITRD[$i]}" ] ; then FILE_PATH=$(get_of_path ${CONFIG_IMAGE_INITRD[$i]} | grep -v /pci[0-9]) - test -z "$FILE_PATH" && "${CONFIG_IMAGE_COPY[$i]}" = "true" + test -z "$FILE_PATH" && CONFIG_IMAGE_COPY[$i]="true" if test "${CONFIG_IMAGE_COPY[$i]}" = "true" then CONFIG_IMAGE_INITRD_YABOOT_CONF_PATH[$i]="$(printf 'initrd.%03d' $i)" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/lilo-10.1.22/show_of_path.sh new/lilo-10.1.22/show_of_path.sh --- old/lilo-10.1.22/show_of_path.sh 2007-08-17 22:31:05.000000000 +0200 +++ new/lilo-10.1.22/show_of_path.sh 2007-08-23 11:53:18.000000000 +0200 @@ -2,7 +2,7 @@ # vim: syntax=off ts=4 # set -ex # -# $Id: show_of_path.sh 1014 2007-08-17 20:31:05Z olh $ +# $Id: show_of_path.sh 1017 2007-08-23 09:53:18Z olh $ # find a OF bootpath on Apple PowerMacintosh Newworld machines # Copyright (C) 2000, 2004 Olaf Hering <olh@suse.de>, # 2005 Joachim Plack <jplack@suse.de> @@ -42,7 +42,7 @@ }' EXIT shopt -s extglob -read d myversion d <<< "$Date: 2007-08-17 20:31:05 +0000 (Fri, 17 Aug 2007) $" +read d myversion d <<< "$Date: 2007-08-23 09:53:18 +0000 (Thu, 23 Aug 2007) $" function error() { @@ -204,7 +204,8 @@ file_sysfs_path= -for i in $(find /sys/block/ -name dev); do +for i in /sys/block/*/*/dev /sys/block/*/dev +do : looking at $i if [ "$(< $i)" = "$file_majorminor" ] ; then file_sysfs_path=$i ; break ; fi done ++++++ yaboot-10.1.22-r1012.tar.bz2 -> yaboot-10.1.22-r1016.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yaboot-10.1.22-r1012/Changelog.SuSE new/yaboot-10.1.22-r1016/Changelog.SuSE --- old/yaboot-10.1.22-r1012/Changelog.SuSE 2007-08-17 22:42:09.000000000 +0200 +++ new/yaboot-10.1.22-r1016/Changelog.SuSE 2007-08-23 16:32:09.000000000 +0200 @@ -1,4 +1,17 @@ ------------------------------------------------------------------------ +r1016 | olh | 2007-08-23 09:47:44 +0000 (Thu, 23 Aug 2007) | 2 lines +Changed paths: + M /trunk/lilo/lilo.new + M /trunk/lilo.changes + M /trunk/yaboot/include/mac-part.h + M /trunk/yaboot/include/partition.h + M /trunk/yaboot/second/partition.c + M /trunk/yaboot/second/prom.c + M /trunk/yaboot/second/yaboot.c + ++- implement the lilo -R 'boot once' functionality (268527) + +------------------------------------------------------------------------ r1012 | olh | 2007-08-13 14:18:33 +0000 (Mon, 13 Aug 2007) | 3 lines Changed paths: M /trunk/lilo.changes diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yaboot-10.1.22-r1012/include/mac-part.h new/yaboot-10.1.22-r1016/include/mac-part.h --- old/yaboot-10.1.22-r1012/include/mac-part.h 2006-09-22 23:32:36.000000000 +0200 +++ new/yaboot-10.1.22-r1016/include/mac-part.h 2007-08-23 11:47:44.000000000 +0200 @@ -54,5 +54,10 @@ u16 signature; /* expected to be MAC_DRIVER_MAGIC */ u16 block_size; u32 block_count; - /* ... more stuff */ + u16 dev_type; + u16 dev_id; + u32 data; + u16 driver_count; + u8 driverlist[488]; + u16 padding[3]; }; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yaboot-10.1.22-r1012/include/partition.h new/yaboot-10.1.22-r1016/include/partition.h --- old/yaboot-10.1.22-r1012/include/partition.h 2006-04-29 22:04:58.000000000 +0200 +++ new/yaboot-10.1.22-r1016/include/partition.h 2007-08-23 11:47:44.000000000 +0200 @@ -44,5 +44,6 @@ extern struct partition_t* partitions_lookup(const char *device); extern void partitions_free(struct partition_t* list); +extern char lilo_once_cmdline[]; #endif diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yaboot-10.1.22-r1012/Makefile new/yaboot-10.1.22-r1016/Makefile --- old/yaboot-10.1.22-r1012/Makefile 2007-08-17 22:42:09.000000000 +0200 +++ new/yaboot-10.1.22-r1016/Makefile 2007-08-23 16:32:09.000000000 +0200 @@ -6,7 +6,7 @@ include Config -VERSION = 10.1.22-r1012 +VERSION = 10.1.22-r1016 # Debug mode (spam/verbose) DEBUG = 0 # make install vars diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yaboot-10.1.22-r1012/second/partition.c new/yaboot-10.1.22-r1016/second/partition.c --- old/yaboot-10.1.22-r1012/second/partition.c 2007-01-09 20:02:06.000000000 +0100 +++ new/yaboot-10.1.22-r1016/second/partition.c 2007-08-23 11:47:44.000000000 +0200 @@ -77,18 +77,34 @@ return desc->signature == MAC_DRIVER_MAGIC; } -static void partition_mac_lookup(prom_handle disk, struct partition_t **list) +#define driverlist_entry_size 8 +char lilo_once_cmdline[512]; +static int mac_write_once; +static void partition_mac_lookup(prom_handle disk, struct partition_t **list, char *buf) { int block, map_size; - /* block_buffer contains block 0 from the partitions_lookup() stage */ - struct mac_partition *part = (struct mac_partition *)block_buffer; - unsigned short ptable_block_size = ((struct mac_driver_desc *)block_buffer)->block_size; + /* buf contains block 0 from the partitions_lookup() stage */ + struct mac_driver_desc *desc = (struct mac_driver_desc*)buf; + struct mac_partition *part = (struct mac_partition *)buf; + unsigned short ptable_block_size = desc->block_size; + unsigned int lilo_once_string; DEBUG_F("\n"); + if (!mac_write_once++) { + lilo_once_string = offsetof(struct mac_driver_desc, driverlist) + (desc->driver_count * driverlist_entry_size); + if (lilo_once_string < 512 && buf[lilo_once_string] >= ' ' && buf[lilo_once_string] <= '~') { + memcpy(lilo_once_cmdline, buf + lilo_once_string, 512 - lilo_once_string); + memset(buf + lilo_once_string, 0, 512 - lilo_once_string); + prom_printf("Cleaning lilo -R 'label args' signature\n"); + prom_printf("seek returned %08x\n", prom_seek(disk, 0)); + prom_printf("write returned %08x\n", prom_write(disk, buf, 512)); + prom_sleep(3); + } + } map_size = 1; for (block = 1; block < map_size + 1; block++) { - if (prom_readblocks(disk, block, 1, block_buffer) != 1) { + if (prom_readblocks(disk, block, 1, buf) != 1) { prom_printf("Can't read partition %d\n", block); break; } @@ -354,7 +370,7 @@ } if (mac_magic_present(block_buffer)) { /* pdisk partition format */ - partition_mac_lookup(disk, &list); + partition_mac_lookup(disk, &list, block_buffer); } else if (msdos_magic_present(block_buffer)) { /* msdos partition format */ partition_msdos_lookup(disk, &list); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yaboot-10.1.22-r1012/second/prom.c new/yaboot-10.1.22-r1016/second/prom.c --- old/yaboot-10.1.22-r1012/second/prom.c 2006-12-04 19:53:08.000000000 +0100 +++ new/yaboot-10.1.22-r1016/second/prom.c 2007-08-23 11:47:44.000000000 +0200 @@ -334,12 +334,10 @@ return result; } -#if 0 int prom_write(prom_handle file, void *buf, int n) { return (int)call_prom("write", 3, 1, file, buf, n); } -#endif int prom_seek(prom_handle file, unsigned long long pos) { diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yaboot-10.1.22-r1012/second/yaboot.c new/yaboot-10.1.22-r1016/second/yaboot.c --- old/yaboot-10.1.22-r1012/second/yaboot.c 2007-08-13 16:18:33.000000000 +0200 +++ new/yaboot-10.1.22-r1016/second/yaboot.c 2007-08-23 11:47:44.000000000 +0200 @@ -53,6 +53,7 @@ #include <yaboot.h> #include <elf.h> #include <debug.h> +#include <partition.h> static char *hard_coded_bootpath(char *bootpath) { @@ -811,38 +812,46 @@ print_boot(NULL); - if (gpr == GET_PARAMS_OK && useconf && (p = cfg_get_strg(NULL, "timeout")) && *p) { - timeout = simple_strtol(p, NULL, 0); - if (timeout > 0) { - timeout = prom_getms() + 100 * timeout; - do { - c = prom_nbgetchar(); - } while (c == -1 && prom_getms() <= timeout); - } - if (c == -1 || !c) - c = '\n'; - else if (!char_is_newline(c) && !char_is_tab(c) && !char_is_backspace(c)) { - cmdbuff[0] = c = char_to_ascii(c); - cmdbuff[1] = 0; + if (lilo_once_cmdline[0]) { + strcpy(cmdbuff, lilo_once_cmdline); + lilo_once_cmdline[0] = '\0'; + imagename = cmdbuff; + prom_printf("lilo once: '%s'\n", imagename); + word_split(&imagename, ¶ms->args); + } else { + if (gpr == GET_PARAMS_OK && useconf && (p = cfg_get_strg(NULL, "timeout")) && *p) { + timeout = simple_strtol(p, NULL, 0); + if (timeout > 0) { + timeout = prom_getms() + 100 * timeout; + do { + c = prom_nbgetchar(); + } while (c == -1 && prom_getms() <= timeout); + } + if (c == -1 || !c) + c = '\n'; + else if (!char_is_newline(c) && !char_is_tab(c) && !char_is_backspace(c)) { + cmdbuff[0] = c = char_to_ascii(c); + cmdbuff[1] = 0; + } } - } - if (char_is_newline(c)) { - imagename = cfg_get_default(); - if (imagename) - prom_printf("%s", imagename); - prom_printf("\n"); - } else { - if (c >= ' ' && useconf && cfg_get_flag(cmdbuff, "single-key")) { - imagename = cmdbuff; - prom_printf("%s\n", cmdbuff); - } else { - if (char_is_tab(c)) - print_all_labels(); - cmdlineedit(cmdbuff, print_boot); + if (char_is_newline(c)) { + imagename = cfg_get_default(); + if (imagename) + prom_printf("%s", imagename); prom_printf("\n"); - imagename = cmdbuff; - word_split(&imagename, ¶ms->args); + } else { + if (c >= ' ' && useconf && cfg_get_flag(cmdbuff, "single-key")) { + imagename = cmdbuff; + prom_printf("%s\n", cmdbuff); + } else { + if (char_is_tab(c)) + print_all_labels(); + cmdlineedit(cmdbuff, print_boot); + prom_printf("\n"); + imagename = cmdbuff; + word_split(&imagename, ¶ms->args); + } } } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org