]> git.ozlabs.org Git - yaboot.git/blobdiff - ybin/yabootconfig
Release yaboot 1.3.8
[yaboot.git] / ybin / yabootconfig
index 97a7b0194f44f87e617709ac44c30d068b29828d..19f32e9636eabdd4a418a8e106951cd71946a36a 100755 (executable)
@@ -3,7 +3,7 @@
 ###############################################################################
 ##
 ## yabootconfig generates a simple /etc/yaboot.conf
-## Copyright (C) 2001 Ethan Benson
+## Copyright (C) 2001, 2002 Ethan Benson
 ##
 ## This program is free software; you can redistribute it and/or
 ## modify it under the terms of the GNU General Public License
@@ -27,7 +27,7 @@ if [ -n "$PATH_PREFIX" ] ; then
     PATH="${PATH}:${PATH_PREFIX}/sbin:${PATH_PREFIX}/bin:${PATH_PREFIX}/usr/sbin:${PATH_PREFIX}/usr/bin:${PATH_PREFIX}/usr/local/sbin:${PATH_PREFIX}/usr/local/bin"
 fi
 PRG="${0##*/}"
-VERSION=1.0.6-UNSUPPORTED_DEVEL_BRANCH
+VERSION=1.0.7
 CHROOT=/
 ## $CONFIG is relative to $CHROOT
 CONFIG=etc/yaboot.conf
@@ -37,6 +37,13 @@ DEBUG=0
 SIGINT="$PRG: Interrupt caught ... exiting"
 export LC_COLLATE=C
 
+## avoid older versions of ofpath shipped in debian boot-floppies etc.
+if [ -x "${PATH_PREFIX}/usr/sbin/ofpath" ] ; then
+    OFPATH="${PATH_PREFIX}/usr/sbin/ofpath"
+else
+    OFPATH=ofpath
+fi
+
 ## catch signals, clean up temporary file
 trap "cleanup" 0
 trap "exit 129" 1
@@ -78,7 +85,7 @@ echo \
 "$PRG $VERSION
 Written by Ethan Benson
 
-Copyright (C) 2001 Ethan Benson
+Copyright (C) 2001, 2002 Ethan Benson
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
 }
@@ -501,7 +508,7 @@ fi
 
 ## only powermacs appear to need device=
 if (cat /proc/cpuinfo 2>/dev/null | grep -q pmac-generation 2> /dev/null) ; then
-    DEVICE="\ndevice=$(ofpath $KERNELDISK)"
+    DEVICE="\ndevice=$($OFPATH $KERNELDISK)"
     if [ $? != 0 ] ; then
        echo 1>&2 "$PRG: Unable to determine OpenFirmware device name to $KERNELDISK, aborting..."
        exit 1
@@ -563,6 +570,15 @@ if [ -n "$KERNARGS" ] ; then
     APPEND="\tappend=\"${KERNARGS}\"\n"
 fi
 
+## avoid user confusion when they boot an installer with video=ofonly
+## (usually via a install-safe label) and then reboot and have the box
+## not boot properly again.
+if [ -z "$APPEND" ] ; then
+    if (grep -q '\<video=ofonly\>' /proc/cmdline 2> /dev/null) ; then
+       APPEND="\tappend=\"video=ofonly\"\n"
+    fi
+fi
+
 ## generate global section of yaboot.conf
 GLOBAL="## yaboot.conf generated by $PRG $VERSION
 ##