From b5653498509f29d5f94b7e32e506cb56e4ea93a2 Mon Sep 17 00:00:00 2001 From: Ethan Benson Date: Wed, 30 Oct 2002 10:32:14 +0000 Subject: [PATCH] Update ofpath for new devspec export in /proc * ofpath: /proc/ide/pmac is dead, the OpenFirmware devspec is now exported to /proc/ide/ideX/devspec, ofpath now uses that. - this change is not tested, some additional sanity checks are still needed. git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-36 --- 0arch-timestamps0 | 74 +++++++++++++++++++++++------------------------ ChangeLog | 16 ++++++++++ ybin/ofpath | 35 +++++++--------------- 3 files changed, 64 insertions(+), 61 deletions(-) diff --git a/0arch-timestamps0 b/0arch-timestamps0 index f444ccf..ac6ea98 100644 --- a/0arch-timestamps0 +++ b/0arch-timestamps0 @@ -1,8 +1,8 @@ ./include/xfs/.arch-ids/=id 1035679942 1017069090 ./include/xfs/.arch-ids/xfs.h.id 1035679942 1017069096 -./include/xfs/.arch-ids 1035679942 1017069096 +./include/xfs/.arch-ids 1035973750 1017069096 ./include/xfs/xfs.h 1035679950 1002101334 -./include/xfs 1035679942 1007269244 +./include/xfs 1035973750 1007269244 ./include/.arch-ids/errors.h.id 1035679942 1017069108 ./include/.arch-ids/=id 1035679942 1017027153 ./include/.arch-ids/bootinfo.h.id 1035679942 1017027154 @@ -25,50 +25,50 @@ ./include/.arch-ids/types.h.id 1035679942 1017027162 ./include/.arch-ids/yaboot.h.id 1035679942 1017027162 ./include/.arch-ids/debug.h.id 1035679942 1017154770 -./include/.arch-ids 1035679942 1017154770 +./include/.arch-ids 1035973750 1017154770 ./include/asm/.arch-ids/=id 1035679942 1017027153 ./include/asm/.arch-ids/elf.h.id 1035679942 1017027153 ./include/asm/.arch-ids/ppc_asm.tmpl.id 1035679942 1017027153 ./include/asm/.arch-ids/processor.h.id 1035679942 1017027154 -./include/asm/.arch-ids 1035679942 1017027154 +./include/asm/.arch-ids 1035973750 1017027154 ./include/asm/elf.h 1035679948 1000991730 ./include/asm/ppc_asm.tmpl 1035679948 1000991730 ./include/asm/processor.h 1035679948 1000991730 -./include/asm 1035679942 1007269243 +./include/asm 1035973750 1007269243 ./include/et/.arch-ids/=id 1035679942 1017027155 ./include/et/.arch-ids/com_err.h.id 1035679942 1017027155 -./include/et/.arch-ids 1035679942 1017155400 +./include/et/.arch-ids 1035973750 1017155400 ./include/et/com_err.h 1035679949 1000991731 -./include/et 1035679942 1007269243 +./include/et 1035973750 1007269243 ./include/ext2fs/.arch-ids/=id 1035679942 1017027156 ./include/ext2fs/.arch-ids/bitops.h.id 1035679942 1017027156 ./include/ext2fs/.arch-ids/ext2_err.h.id 1035679942 1017027156 ./include/ext2fs/.arch-ids/ext2_io.h.id 1035679942 1017027156 ./include/ext2fs/.arch-ids/ext2fs.h.id 1035679942 1017027156 -./include/ext2fs/.arch-ids 1035679942 1017027156 +./include/ext2fs/.arch-ids 1035973750 1017027156 ./include/ext2fs/bitops.h 1035679949 1003927524 ./include/ext2fs/ext2_err.h 1035679949 1003927524 ./include/ext2fs/ext2_io.h 1035679949 1003927524 ./include/ext2fs/ext2fs.h 1035679949 1003927524 -./include/ext2fs 1035679942 1007269243 +./include/ext2fs 1035973750 1007269243 ./include/linux/.arch-ids/=id 1035679942 1017027157 ./include/linux/.arch-ids/elf.h.id 1035679942 1017027158 ./include/linux/.arch-ids/ext2_fs.h.id 1035679942 1017027158 ./include/linux/.arch-ids/iso_fs.h.id 1035679942 1017027158 ./include/linux/.arch-ids/stat.h.id 1035679942 1017027158 ./include/linux/.arch-ids/types.h.id 1035679942 1017027159 -./include/linux/.arch-ids 1035679942 1017027159 +./include/linux/.arch-ids 1035973750 1017027159 ./include/linux/elf.h 1035679949 1000991731 ./include/linux/ext2_fs.h 1035679949 1000991731 ./include/linux/iso_fs.h 1035679949 1000991731 ./include/linux/stat.h 1035679949 1000991731 ./include/linux/types.h 1035679949 1000991731 -./include/linux 1035679942 1007269243 +./include/linux 1035973750 1007269243 ./include/reiserfs/.arch-ids/=id 1035679942 1017027160 ./include/reiserfs/.arch-ids/reiserfs.h.id 1035679942 1017027160 -./include/reiserfs/.arch-ids 1035679942 1017027160 +./include/reiserfs/.arch-ids 1035973750 1017027160 ./include/reiserfs/reiserfs.h 1035679949 1025684115 -./include/reiserfs 1035679942 1025684115 +./include/reiserfs 1035973750 1025684115 ./include/errors.h 1035679949 1007200690 ./include/bootinfo.h 1035679948 1007200690 ./include/byteorder.h 1035679948 1000991730 @@ -90,7 +90,7 @@ ./include/types.h 1035679950 1000991730 ./include/yaboot.h 1035679950 1007200690 ./include/debug.h 1035679949 1007200690 -./include 1035679942 1007269244 +./include 1035973750 1007269244 ./second/.arch-ids/fs_xfs.c.id 1035679942 1017069120 ./second/.arch-ids/=id 1035679942 1017027166 ./second/.arch-ids/cache.S.id 1035679942 1017027167 @@ -109,7 +109,7 @@ ./second/.arch-ids/prom.c.id 1035679942 1017027170 ./second/.arch-ids/setjmp.S.id 1035679942 1017027171 ./second/.arch-ids/yaboot.c.id 1035679942 1017027171 -./second/.arch-ids 1035679942 1017069120 +./second/.arch-ids 1035973750 1017069120 ./second/fs_xfs.c 1035679952 1032059541 ./second/cache.S 1035679951 1007200690 ./second/cfg.c 1035679951 1007200690 @@ -127,7 +127,7 @@ ./second/prom.c 1035679952 1032059515 ./second/setjmp.S 1035679952 1000991732 ./second/yaboot.c 1035679952 1032059504 -./second 1035679942 1032765950 +./second 1035973750 1032765950 ./.arch-ids/Config.id 1035679942 1017069133 ./.arch-ids/0arch-timestamps0.id 1035679942 1020516949 ./.arch-ids/ChangeLog.id 1035679942 1017026820 @@ -141,7 +141,7 @@ ./.arch-ids/TODO.id 1035679942 1017027149 ./.arch-ids/changelog.id 1035679942 1017027149 ./.arch-ids/man.patch.id 1035679942 1017027166 -./.arch-ids 1035679942 1020516949 +./.arch-ids 1035973750 1020516949 ./doc/.arch-ids/=id 1035679942 1017027149 ./doc/.arch-ids/README.ofboot.id 1035679942 1017027149 ./doc/.arch-ids/README.ofpath.id 1035679942 1017027149 @@ -149,7 +149,7 @@ ./doc/.arch-ids/Makefile.id 1035679942 1017235762 ./doc/.arch-ids/yaboot-howto.sgml.id 1035679942 1017235765 ./doc/.arch-ids/yaboot-howto.de.sgml.id 1035679942 1017238100 -./doc/.arch-ids 1035679942 1017238100 +./doc/.arch-ids 1035973750 1017238100 ./doc/examples/.arch-ids/=id 1035679942 1017027150 ./doc/examples/.arch-ids/README.dualboot.chrp.id 1035679942 1017027150 ./doc/examples/.arch-ids/README.mbicons.id 1035679942 1017027150 @@ -159,7 +159,7 @@ ./doc/examples/.arch-ids/simpleboot.chrp.id 1035679942 1017027151 ./doc/examples/.arch-ids/yaboot.conf.multi-boot.id 1035679942 1017027151 ./doc/examples/.arch-ids/yaboot.conf.rs6000.id 1035679942 1017027152 -./doc/examples/.arch-ids 1035679942 1017236175 +./doc/examples/.arch-ids 1035973751 1017236175 ./doc/examples/README.dualboot.chrp 1035679947 1000991730 ./doc/examples/README.mbicons 1035679947 1000991730 ./doc/examples/README.simpleboot.chrp 1035679947 1000991730 @@ -168,24 +168,24 @@ ./doc/examples/simpleboot.chrp 1035679947 1006347336 ./doc/examples/yaboot.conf.multi-boot 1035679947 1006348765 ./doc/examples/yaboot.conf.rs6000 1035679947 1006348765 -./doc/examples 1035679942 1007269243 +./doc/examples 1035973750 1007269243 ./doc/README.ofboot 1035679947 1000991730 ./doc/README.ofpath 1035679947 1000991730 ./doc/README.rs6000 1035679947 1007200689 ./doc/Makefile 1035679947 1019310768 ./doc/yaboot-howto.sgml 1035679947 1032059987 ./doc/yaboot-howto.de.sgml 1035679947 1032059970 -./doc 1035679942 1032059987 +./doc 1035973750 1032059987 ./etc/.arch-ids/=id 1035679942 1017027152 ./etc/.arch-ids/yaboot.conf.id 1035679942 1017027152 -./etc/.arch-ids 1035679942 1017027152 +./etc/.arch-ids 1035973751 1017027152 ./etc/yaboot.conf 1035679947 1006348765 -./etc 1035679942 1007269243 +./etc 1035973751 1007269243 ./first/.arch-ids/=id 1035679942 1017027152 ./first/.arch-ids/ofboot.id 1035679942 1017027152 -./first/.arch-ids 1035679942 1017027152 +./first/.arch-ids 1035973751 1017027152 ./first/ofboot 1035679948 1032060202 -./first 1035679942 1032060202 +./first 1035973751 1032060202 ./lib/.arch-ids/=id 1035679942 1017027162 ./lib/.arch-ids/ctype.c.id 1035679942 1017027163 ./lib/.arch-ids/libext2fs.a.id 1035679942 1017027163 @@ -195,7 +195,7 @@ ./lib/.arch-ids/strstr.c.id 1035679942 1017027164 ./lib/.arch-ids/strtol.c.id 1035679942 1017027164 ./lib/.arch-ids/vsprintf.c.id 1035679942 1017027164 -./lib/.arch-ids 1035679942 1017027164 +./lib/.arch-ids 1035973751 1017027164 ./lib/ctype.c 1035679950 1000991731 ./lib/libext2fs.a 1035679950 1003927524 ./lib/malloc.c 1035679950 1007200690 @@ -204,7 +204,7 @@ ./lib/strstr.c 1035679950 1000991731 ./lib/strtol.c 1035679950 1000991731 ./lib/vsprintf.c 1035679950 1000991731 -./lib 1035679942 1014816709 +./lib 1035973751 1014816709 ./man/.arch-ids/=id 1035679942 1017027164 ./man/.arch-ids/bootstrap.8.id 1035679942 1017027165 ./man/.arch-ids/mkofboot.8.id 1035679942 1017027165 @@ -213,7 +213,7 @@ ./man/.arch-ids/yaboot.conf.5.id 1035679942 1017027166 ./man/.arch-ids/yabootconfig.8.id 1035679942 1017027166 ./man/.arch-ids/ybin.8.id 1035679942 1017027166 -./man/.arch-ids 1035679942 1017027166 +./man/.arch-ids 1035973751 1017027166 ./man/bootstrap.8 1035679951 1000991731 ./man/mkofboot.8 1035679951 1006348765 ./man/ofpath.8 1035679951 1000991731 @@ -221,28 +221,28 @@ ./man/yaboot.conf.5 1035679951 1004256691 ./man/yabootconfig.8 1035679951 1027929577 ./man/ybin.8 1035679951 1006348765 -./man 1035679942 1027929577 +./man 1035973751 1027929577 ./util/.arch-ids/=id 1035679942 1017027171 ./util/.arch-ids/addnote.c.id 1035679942 1017027171 ./util/.arch-ids/elfextract.c.id 1035679942 1017027172 -./util/.arch-ids 1035679942 1017027172 +./util/.arch-ids 1035973751 1017027172 ./util/addnote.c 1035679952 1007200691 ./util/elfextract.c 1035679952 1007303237 -./util 1035679942 1014816709 +./util 1035973751 1014816709 ./ybin/.arch-ids/=id 1035679942 1017027172 ./ybin/.arch-ids/mkofboot.id 1035679942 1017027172 ./ybin/.arch-ids/ofpath.id 1035679942 1017027172 ./ybin/.arch-ids/yabootconfig.id 1035679942 1017027172 ./ybin/.arch-ids/ybin.id 1035679942 1017027173 -./ybin/.arch-ids 1035679942 1017027173 +./ybin/.arch-ids 1035973751 1017027173 ./ybin/mkofboot 1035679952 1030918600 -./ybin/ofpath 1035679952 1035679930 +./ybin/ofpath 1035973736 1035973727 ./ybin/yabootconfig 1035679952 1033252801 ./ybin/ybin 1035679952 1035678761 -./ybin 1035679942 1035679930 +./ybin 1035973751 1035973727 ./Config 1035679946 1002101497 -./0arch-timestamps0 1035679946 1035680019 -./ChangeLog 1035679946 1035679212 +./0arch-timestamps0 1035680228 1035973751 +./ChangeLog 1035693539 1035680241 ./BUGS 1035679946 1000991730 ./COPYING 1035679946 1000991730 ./INSTALL 1035679946 1000991730 @@ -253,4 +253,4 @@ ./TODO 1035679946 1006527567 ./changelog 1035679946 1033275819 ./man.patch 1035679950 1006348761 -. 1035680019 1035680016 +. 1035973750 1035973746 diff --git a/ChangeLog b/ChangeLog index 2e813f8..f196e36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,22 @@ # tag: automatic-ChangeLog--erbenson@alaska.net--public/yaboot--devel--1.3 # +2002-10-30 10:32:14 GMT Ethan Benson patch-36 + + Summary: + Update ofpath for new devspec export in /proc + Revision: + yaboot--devel--1.3--patch-36 + + * ofpath: /proc/ide/pmac is dead, the OpenFirmware devspec is now + exported to /proc/ide/ideX/devspec, ofpath now uses that. + - this change is not tested, some additional sanity checks are still + needed. + + modified files: + 0arch-timestamps0 ChangeLog ybin/ofpath + + 2002-10-27 00:57:19 GMT Ethan Benson patch-35 Summary: diff --git a/ybin/ofpath b/ybin/ofpath index 426285d..be3f8cd 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.3-DEVEL_DO_NOT_DISTRIBUTE-1 +VERSION=1.0.3-DEVEL_DO_NOT_DISTRIBUTE-patch-36 DEBUG=0 export LC_COLLATE=C @@ -296,7 +296,13 @@ scsi_ofpath() ide_ofpath() { - local OF1275IDE=/proc/ide/of1275 + if [ ! -L "/proc/ide/$DEVNODE" ] ; then + echo 2>&1 "$PRG: /dev/$DEVNODE: Device not configured" + return 1 + fi + + local IDEBUS="$(v=`readlink /proc/ide/$DEVNODE` ; echo ${v%%/*} )" + local OF1275IDE="/proc/ide/$IDEBUS/devspec" if [ ! -f "$OF1275IDE" ] ; then case "$(cat /proc/device-tree/model)" in @@ -326,33 +332,14 @@ ide_ofpath() ;; esac else - if [ ! -L "/proc/ide/$DEVNODE" ] ; then - echo 2>&1 "$PRG: /dev/$DEVNODE: Device not configured" - return 1 - fi - - local IDEBUS="$(v=`readlink /proc/ide/$DEVNODE` ; echo ${v%%/*} )" - [ "$DEBUG" = 1 ] && echo 1>&2 "$PRG: DEBUG: IDEBUS=$IDEBUS" - local NUMBUSSES="$(($(linecount $OF1275IDE) / 5))" - [ "$DEBUG" = 1 ] && echo 1>&2 "$PRG: DEBUG: NUMBUSSES=$NUMBUSSES" - if [ "$((${IDEBUS##ide} + 1))" -gt "$NUMBUSSES" ] ; then - echo 1>&2 "$PRG: /dev/$DEVNODE is not supported" - return 1 - fi - local IDEDEV="$(head -n $((5 * $((${IDEBUS##ide} + 1)))) $OF1275IDE | tail -n 5)" - [ "$DEBUG" = 1 ] && echo 1>&2 "$PRG: DEBUG: IDEDEV=$IDEDEV" - if [ "$(echo "$IDEDEV" | head -n 1)" != "$IDEBUS" ] ; then - echo "$PRG: /dev/$DEVNODE: is not supported" - return 1 - fi - local DEVSPEC="$(v=`echo "$IDEDEV" | grep devspec` ; echo ${v##*:})" + local DEVSPEC="$(cat /proc/ide/$IDEBUS/devspec)" [ "$DEBUG" = 1 ] && echo 1>&2 "$PRG: DEBUG: DEVSPEC=$DEVSPEC" case "$DEVNODE" in - hda|hdc|hde|hdg) + hda|hdc|hde|hdg|hdi) echo "${DEVSPEC}/disk@0:$PARTITION" return 0 ;; - hdb|hdd|hdf|hdh) + hdb|hdd|hdf|hdh|hdj) echo "${DEVSPEC}/disk@1:$PARTITION" return 0 ;; -- 2.39.2