You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sys-boot/yaboot-static/files/new-ofpath-devspec.patch

31 lines
910 B

Fix the devspec path on newer kernels
--- a/usr/sbin/ofpath
+++ b/usr/sbin/ofpath
@@ -85,11 +85,20 @@
[ "$DEBUG" = 1 ] && echo "Devpath is: $DEVPATH"
### Get the OF Path of the controller
-case ${DISK_NAME} in
- sd*|sg*|sr*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec) ;;
- hd*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec) ;;
- *) CONTROLLER_PATH="" ;;
-esac
+if [ -e "${DEVPATH}/../../devspec" ]; then
+ ### /dev/hd*
+ CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec);
+elif [ -e "${DEVPATH}/../../../devspec" ]; then
+ ### /dev/sd* on kernel <3.3
+ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec);
+elif [ -e "${DEVPATH}/../../../../devspec" ]; then
+ ### /dev/sd* on kernel 3.3+
+ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../../devspec);
+else
+ ### None of the above...
+ CONTROLLER_PATH="";
+fi
+
if [ -z "$CONTROLLER_PATH" ]; then
echo "Unable to determine controller path!"
exit 1