From 53695b2ef3f2fbf757b26c66ad3fa45ccb6b93e6 Mon Sep 17 00:00:00 2001 From: Ethan Benson Date: Mon, 22 Mar 2004 02:05:07 +0000 Subject: [PATCH] Add 2.6 kernel support to ofpath * ybin/ofpath: Add support for 2.6.4+ kernels with sysfs mounted. git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-66 --- 0arch-timestamps0 | 240 +++++++++++++++++++++++----------------------- ChangeLog | 13 +++ Makefile | 2 +- ybin/ofpath | 27 +++++- ybin/ybin | 2 +- 5 files changed, 159 insertions(+), 125 deletions(-) diff --git a/0arch-timestamps0 b/0arch-timestamps0 index fb6b4f1..3eb5a0e 100644 --- a/0arch-timestamps0 +++ b/0arch-timestamps0 @@ -1,120 +1,120 @@ -./0arch-timestamps0 1075106662 1077455716 -./BUGS 1075106662 1000991730 -./COPYING 1075106662 1000991730 -./ChangeLog 1077455527 1077455711 -./Config 1075106662 1002101497 -./INSTALL 1075106662 1000991730 -./Makefile 1075106662 1069321562 -./README 1075106662 1044766458 -./README.man.patch 1075106662 1000991730 -./THANKS 1075106662 1006350263 -./TODO 1075106662 1044766566 -./changelog 1075106662 1069321587 -./doc/Makefile 1075106662 1019310768 -./doc/README.ofboot 1075106662 1000991730 -./doc/README.ofpath 1075106662 1000991730 -./doc/README.rs6000 1075106662 1007200689 -./doc/examples/README.dualboot.chrp 1075106662 1000991730 -./doc/examples/README.mbicons 1075106662 1000991730 -./doc/examples/README.simpleboot.chrp 1075106662 1000991730 -./doc/examples/dualboot.chrp 1075106662 1068017741 -./doc/examples/large-penguin.mbicon 1075106662 1000991730 -./doc/examples/simpleboot.chrp 1075106662 1068017750 -./doc/examples/yaboot.conf.multi-boot 1075106662 1006348765 -./doc/examples/yaboot.conf.rs6000 1075106662 1006348765 -./doc/examples 1077455716 1068017750 -./doc/yaboot-howto.de.sgml 1077455454 1077455488 -./doc/yaboot-howto.sgml 1077455492 1077455511 -./doc 1077455716 1077455511 -./etc/yaboot.conf 1075106662 1006348765 -./etc 1077455716 1007269243 -./first/ofboot 1075106662 1065311880 -./first 1077455716 1071492158 -./include/asm/elf.h 1076059952 1000991730 -./include/asm/ppc_asm.tmpl 1076059952 1000991730 -./include/asm/processor.h 1076059952 1000991730 -./include/asm 1077455716 1007269243 -./include/bootinfo.h 1076059952 1007200690 -./include/byteorder.h 1076059952 1000991730 -./include/cfg.h 1076059952 1007200690 -./include/cmdline.h 1076059952 1007200690 -./include/ctype.h 1076059952 1003656411 -./include/debug.h 1076059952 1007200690 -./include/errors.h 1076059952 1007200690 -./include/et/com_err.h 1076059953 1000991731 -./include/et 1077455716 1007269243 -./include/ext2fs/bitops.h 1076059953 1003927524 -./include/ext2fs/ext2_err.h 1076059953 1003927524 -./include/ext2fs/ext2_io.h 1076059953 1003927524 -./include/ext2fs/ext2fs.h 1076059953 1003927524 -./include/ext2fs 1077455716 1007269243 -./include/fdisk-part.h 1076059953 1007200690 -./include/file.h 1076059953 1007200690 -./include/fs.h 1076059953 1007200690 -./include/linux/elf.h 1076059953 1000991731 -./include/linux/ext2_fs.h 1076059953 1000991731 -./include/linux/iso_fs.h 1076059953 1000991731 -./include/linux/stat.h 1076059953 1000991731 -./include/linux/types.h 1076059953 1000991731 -./include/linux 1077455716 1007269243 -./include/mac-part.h 1076059953 1007200690 -./include/md5.h 1076059953 1000991730 -./include/partition.h 1076059953 1007200690 -./include/prom.h 1076059953 1007200690 -./include/reiserfs/reiserfs.h 1076059953 1025684115 -./include/reiserfs 1077455716 1025684115 -./include/setjm2.h 1076059953 1000991730 -./include/setjmp.h 1076059953 1000991730 -./include/stdlib.h 1076059953 1000991730 -./include/string.h 1076059953 1002620217 -./include/swab.h 1076059953 1000991730 -./include/types.h 1076059953 1000991730 -./include/xfs/xfs.h 1076059953 1002101334 -./include/xfs 1077455716 1007269244 -./include/yaboot.h 1076059953 1007200690 -./include 1077455716 1007269244 -./lib/ctype.c 1075106662 1000991731 -./lib/libext2fs.a 1075106662 1003927524 -./lib/malloc.c 1075106662 1007200690 -./lib/nosys.c 1075106662 1000991731 -./lib/string.S 1075106662 1007200690 -./lib/strstr.c 1075106662 1000991731 -./lib/strtol.c 1075106662 1000991731 -./lib/vsprintf.c 1075106662 1000991731 -./lib 1077455716 1069320301 -./man/bootstrap.8 1075106662 1000991731 -./man/mkofboot.8 1075106662 1006348765 -./man/ofpath.8 1075106662 1000991731 -./man/yaboot.8 1075106662 1006348765 -./man/yaboot.conf.5 1075106662 1004256691 -./man/yabootconfig.8 1075106662 1027929577 -./man/ybin.8 1075106662 1006348765 -./man 1077455716 1027929577 -./man.patch 1075106662 1006348761 -./second/cache.S 1076059950 1007200690 -./second/cfg.c 1076059950 1007200690 -./second/cmdline.c 1076059950 1032059589 -./second/crt0.S 1076059950 1000991731 -./second/file.c 1076059950 1044868693 -./second/fs.c 1076059950 1032059574 -./second/fs_ext2.c 1076059950 1032059564 -./second/fs_iso.c 1076059950 1007200690 -./second/fs_of.c 1076059950 1032059553 -./second/fs_reiserfs.c 1076059950 1007200690 -./second/fs_xfs.c 1076059950 1032059541 -./second/iso_util.c 1076059950 1003656415 -./second/md5.c 1076059950 1032059532 -./second/partition.c 1076059950 1032059525 -./second/prom.c 1076059950 1067937197 -./second/setjmp.S 1076059950 1000991732 -./second/yaboot.c 1076059950 1032059504 -./second 1077455716 1069320301 -./util/addnote.c 1075106663 1007200691 -./util/elfextract.c 1075106663 1007303237 -./util 1077455716 1069320301 -./ybin/mkofboot 1077455716 1073219938 -./ybin/ofpath 1075106666 1069321527 -./ybin/yabootconfig 1075106666 1044766426 -./ybin/ybin 1075276661 1069319269 -./ybin 1077455716 1069321554 -. 1077455716 1077455711 +./0arch-timestamps0 1079920783 1079921100 +./BUGS 1077455728 1000991730 +./COPYING 1077455728 1000991730 +./ChangeLog 1079920723 1079920773 +./Config 1077455728 1002101497 +./INSTALL 1077455728 1000991730 +./Makefile 1079920783 1079920671 +./README 1077455728 1044766458 +./README.man.patch 1077455728 1000991730 +./THANKS 1079879289 1006350263 +./TODO 1077455728 1044766566 +./changelog 1077455728 1069321587 +./doc/Makefile 1077455730 1019310768 +./doc/README.ofboot 1077455728 1000991730 +./doc/README.ofpath 1077455728 1000991730 +./doc/README.rs6000 1077455728 1007200689 +./doc/examples/README.dualboot.chrp 1077455728 1000991730 +./doc/examples/README.mbicons 1077455728 1000991730 +./doc/examples/README.simpleboot.chrp 1077455728 1000991730 +./doc/examples/dualboot.chrp 1077455728 1068017741 +./doc/examples/large-penguin.mbicon 1077455728 1000991730 +./doc/examples/simpleboot.chrp 1077455728 1068017750 +./doc/examples/yaboot.conf.multi-boot 1077455728 1006348765 +./doc/examples/yaboot.conf.rs6000 1077455728 1006348765 +./doc/examples 1079921100 1068017750 +./doc/yaboot-howto.de.sgml 1077455730 1077455488 +./doc/yaboot-howto.sgml 1078398547 1077455511 +./doc 1079921100 1077455511 +./etc/yaboot.conf 1077455728 1006348765 +./etc 1079921100 1007269243 +./first/ofboot 1078705056 1065311880 +./first 1079921100 1071492158 +./include/asm/elf.h 1077455728 1000991730 +./include/asm/ppc_asm.tmpl 1077455728 1000991730 +./include/asm/processor.h 1077455728 1000991730 +./include/asm 1079921100 1007269243 +./include/bootinfo.h 1077455728 1007200690 +./include/byteorder.h 1077455728 1000991730 +./include/cfg.h 1077455728 1007200690 +./include/cmdline.h 1077455728 1007200690 +./include/ctype.h 1077455728 1003656411 +./include/debug.h 1077455730 1007200690 +./include/errors.h 1077455728 1007200690 +./include/et/com_err.h 1077455729 1000991731 +./include/et 1079921100 1007269243 +./include/ext2fs/bitops.h 1077455729 1003927524 +./include/ext2fs/ext2_err.h 1077455729 1003927524 +./include/ext2fs/ext2_io.h 1077455729 1003927524 +./include/ext2fs/ext2fs.h 1077455729 1003927524 +./include/ext2fs 1079921100 1007269243 +./include/fdisk-part.h 1077455729 1007200690 +./include/file.h 1077455729 1007200690 +./include/fs.h 1077455729 1007200690 +./include/linux/elf.h 1077455729 1000991731 +./include/linux/ext2_fs.h 1077455729 1000991731 +./include/linux/iso_fs.h 1077455729 1000991731 +./include/linux/stat.h 1077455729 1000991731 +./include/linux/types.h 1077455729 1000991731 +./include/linux 1079921100 1007269243 +./include/mac-part.h 1077455729 1007200690 +./include/md5.h 1077455729 1000991730 +./include/partition.h 1077455729 1007200690 +./include/prom.h 1077455729 1007200690 +./include/reiserfs/reiserfs.h 1077455729 1025684115 +./include/reiserfs 1079921100 1025684115 +./include/setjm2.h 1077455729 1000991730 +./include/setjmp.h 1077455729 1000991730 +./include/stdlib.h 1077455729 1000991730 +./include/string.h 1077455729 1002620217 +./include/swab.h 1077455729 1000991730 +./include/types.h 1077455729 1000991730 +./include/xfs/xfs.h 1077455728 1002101334 +./include/xfs 1079921100 1007269244 +./include/yaboot.h 1077455729 1007200690 +./include 1079921100 1007269244 +./lib/ctype.c 1077455729 1000991731 +./lib/libext2fs.a 1077455729 1003927524 +./lib/malloc.c 1077455729 1007200690 +./lib/nosys.c 1077455729 1000991731 +./lib/string.S 1077455729 1007200690 +./lib/strstr.c 1077455729 1000991731 +./lib/strtol.c 1077455729 1000991731 +./lib/vsprintf.c 1077455729 1000991731 +./lib 1079921100 1069320301 +./man/bootstrap.8 1077455729 1000991731 +./man/mkofboot.8 1077455729 1006348765 +./man/ofpath.8 1077455729 1000991731 +./man/yaboot.8 1077455729 1006348765 +./man/yaboot.conf.5 1077455729 1004256691 +./man/yabootconfig.8 1077455729 1027929577 +./man/ybin.8 1077455729 1006348765 +./man 1079921100 1027929577 +./man.patch 1077455729 1006348761 +./second/cache.S 1077455729 1007200690 +./second/cfg.c 1077455729 1007200690 +./second/cmdline.c 1077455729 1032059589 +./second/crt0.S 1077455729 1000991731 +./second/file.c 1077455729 1044868693 +./second/fs.c 1077455729 1032059574 +./second/fs_ext2.c 1077455730 1032059564 +./second/fs_iso.c 1077455730 1007200690 +./second/fs_of.c 1077455730 1032059553 +./second/fs_reiserfs.c 1077455730 1007200690 +./second/fs_xfs.c 1077455728 1032059541 +./second/iso_util.c 1077455730 1003656415 +./second/md5.c 1077455730 1032059532 +./second/partition.c 1077455730 1032059525 +./second/prom.c 1077455730 1067937197 +./second/setjmp.S 1077455730 1000991732 +./second/yaboot.c 1077455730 1032059504 +./second 1079921100 1069320301 +./util/addnote.c 1077455730 1007200691 +./util/elfextract.c 1077455730 1007303237 +./util 1079921100 1069320301 +./ybin/mkofboot 1079921100 1073219938 +./ybin/ofpath 1079920929 1079920942 +./ybin/yabootconfig 1077455730 1044766426 +./ybin/ybin 1079920783 1079920690 +./ybin 1079921100 1079920942 +. 1079921100 1079920783 diff --git a/ChangeLog b/ChangeLog index 495a28f..ecb956e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,19 @@ # arch-tag: automatic-ChangeLog--erbenson@alaska.net--public/yaboot--devel--1.3 # +2004-03-22 02:05:07 GMT Ethan Benson patch-66 + + Summary: + Add 2.6 kernel support to ofpath + Revision: + yaboot--devel--1.3--patch-66 + + * ybin/ofpath: Add support for 2.6.4+ kernels with sysfs mounted. + + modified files: + 0arch-timestamps0 ChangeLog Makefile ybin/ofpath ybin/ybin + + 2004-02-22 13:15:30 GMT Ethan Benson patch-65 Summary: diff --git a/Makefile b/Makefile index a79ba3b..5d4eba8 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ include Config -VERSION = 1.3.11 +VERSION = 1.3.12-UNRELEASED_UNSUPPORTED_DEVELOPMENT_VERSION # Debug mode (spam/verbose) DEBUG = 0 # make install vars diff --git a/ybin/ofpath b/ybin/ofpath index a1d74ea..0625c38 100755 --- a/ybin/ofpath +++ b/ybin/ofpath @@ -27,7 +27,7 @@ PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" PRG="${0##*/}" -VERSION=1.0.5 +VERSION=1.0.6-pre1 DEBUG=0 export LC_COLLATE=C @@ -323,11 +323,32 @@ ide_ofpath() echo 1>&2 "$PRG: BUG: IDEBUS == NULL" return 1 fi - local OF1275IDE="/proc/ide/$IDEBUS/devspec" + + case "$(uname -r)" in + 2.5.*|2.6.0*|2.6.1|2.6.1-*|2.6.2|2.6.2-*|2.6.3|2.6.3-*) + echo "$PRG: Linux kernel `uname -r` is not supported" + return 1 + ;; + 2.6.*|2.7.*) + if ! (grep -q ^sysfs /proc/mounts 2> /dev/null) ; then + echo 1>&2 "$PRG: sysfs must be mounted for ofpath to support this system" + return 1 + fi + local SYS="$(m=`grep ^sysfs /proc/mounts | head -n 1` ; echo `d=${m#* };echo ${d%% *}`)" + if [ -z "$SYS" -o ! -d "$SYS" ] ; then + echo 2>&1 "$PRG: Unable to determine sysfs mountpoint" + return 1 + fi + local OF1275IDE="${SYS}/block/${DEVNODE}/device/../../devspec" + ;; + *) + local OF1275IDE="/proc/ide/$IDEBUS/devspec" + ;; + esac if [ ! -f "$OF1275IDE" ] ; then case "$(cat /proc/device-tree/model)" in - "PowerMac3,6") + PowerMac3*|PowerMac4*|PowerMac5*|PowerMac6*|PowerMac7*|X*) local CDROM="$(grep "^drive name:" /proc/sys/dev/cdrom/info 2> /dev/null | grep $DEVNODE)" if [ -z "$CDROM" ] ; then echo 1>&2 "$PRG: WARNING: Your kernel is too old for proper support, device may be innaccurate." diff --git a/ybin/ybin b/ybin/ybin index 1e4e3be..30d3695 100755 --- a/ybin/ybin +++ b/ybin/ybin @@ -28,7 +28,7 @@ if [ -n "$PATH_PREFIX" ] ; then fi PRG="${0##*/}" SIGINT="$PRG: Interrupt caught ... exiting" -VERSION=1.3.11 +VERSION=1.3.12-UNRELEASED_UNSUPPORTED_DEVELOPMENT_VERSION DEBUG=0 VERBOSE=0 TMP="${TMPDIR:-/tmp}" -- 2.39.2