]> git.ozlabs.org Git - yaboot.git/blobdiff - ybin/ybin
Change ofpath to use /proc/ide/of1275 instead of /proc/ide/pmac
[yaboot.git] / ybin / ybin
index 976423c76279a9d193020b47b145a64517901a74..82ddda56c071ef21eaba1b4da8cfb0e3d21d4cc0 100755 (executable)
--- a/ybin/ybin
+++ b/ybin/ybin
@@ -3,7 +3,7 @@
 ###############################################################################
 ##
 ## ybin (YaBoot INstaller) installs/updates the yaboot bootloader.
-## Copyright (C) 2000, 2001 Ethan Benson
+## Copyright (C) 2000, 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
@@ -28,7 +28,7 @@ if [ -n "$PATH_PREFIX" ] ; then
 fi
 PRG="${0##*/}"
 SIGINT="$PRG: Interrupt caught ... exiting"
-VERSION=1.3.3
+VERSION=1.3.8-UNSUPPORTED_DEVEL_DO_NOT_DISTRIBUTE
 DEBUG=0
 VERBOSE=0
 TMP="${TMPDIR:-/tmp}"
@@ -65,7 +65,11 @@ fi
 
 ## defaults
 usemount=no
-fstype=hfs
+if (cat /proc/cpuinfo 2> /dev/null | grep ^machine | grep -q 'CHRP IBM') ; then
+    fstype=raw
+else
+    fstype=hfs
+fi
 hfstype=tbxi
 hfscreator=UNIX
 bless=yes
@@ -128,7 +132,7 @@ echo \
 "$PRG $VERSION
 Written by Ethan Benson
 
-Copyright (C) 2000, 2001 Ethan Benson
+Copyright (C) 2000, 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."
 }
@@ -166,19 +170,6 @@ Update/install bootloader onto a bootstrap partition.
                                this is useful of you don't want them to be
                                visible from MacOS.
       --nonvram              do not update the boot-device variable in nvram.
-      --device               yaboot auto configuration: sets the OF boot device
-                              default: hd:
-      --partition            yaboot auto configuration: sets the partition
-                              number of the root partition. default: 3
-      --timeout              yaboot auto configuration: sets the time yaboot
-                              will wait for user input before booting default
-                               image default: 40 (4 seconds)
-      --image                yaboot auto configuration: sets the path to the
-                              kernel image. default: /vmlinux
-      --label                yaboot auto configuration: sets the image label
-                               default: Linux
-      --root                 yaboot auto configuration: sets the root device
-                               default: /dev/hda3
       --force                don't ever ask for confirmation
   -v, --verbose              make $PRG more verbose
       --debug                print boring junk only useful for debugging
@@ -553,7 +544,7 @@ if (command -v readlink > /dev/null 2>&1) ; then
 else
     readlink()
     {
-       SYMTARGET="$(v=`ls -l "$2" 2>/dev/null` ; echo ${v##*> })"
+       local SYMTARGET="$(v=`ls -l "$2" 2>/dev/null` ; echo ${v##*> })"
        if [ -n "$SYMTARGET" ] ; then
            echo "$SYMTARGET"
            return 0
@@ -1052,7 +1043,7 @@ mnt_install()
        fi
     fi
 
-    [ "$VERBOSE" = 1 ] && echo "$INSTALLFIRST"
+    [ "$VERBOSE" = 1 ] && echo "$INSTALLPRIMARY"
     cp -f "$install" "$TARGET/$BTFILE"
     if [ $? != 0 ] ; then
        echo 1>&2 "$PRG: An error occured while writing to $boot"
@@ -1440,6 +1431,7 @@ if [ $# != 0 ] ; then
                if [ -n "$2" ] ; then
                    device="$2"
                    bootconf=auto
+                   echo 1>&2 "$PRG: WARNING: Deprecated option --device"
                    shift 2
                else
                    echo 1>&2 "$PRG: option requires an argument $1"
@@ -1451,6 +1443,7 @@ if [ $# != 0 ] ; then
                if [ -n "$2" ] ; then
                    timeout="$2"
                    bootconf=auto
+                   echo 1>&2 "$PRG: WARNING: Deprecated option --device"
                    shift 2
                else
                    echo 1>&2 "$PRG: option requires an argument $1"
@@ -1462,6 +1455,7 @@ if [ $# != 0 ] ; then
                if [ -n "$2" ] ; then
                    image="$2"
                    bootconf=auto
+                   echo 1>&2 "$PRG: WARNING: Deprecated option --device"
                    shift 2
                else
                    echo 1>&2 "$PRG: option requires an argument $1"
@@ -1473,6 +1467,7 @@ if [ $# != 0 ] ; then
                if [ -n "$2" ] ; then
                    label="$2"
                    bootconf=auto
+                   echo 1>&2 "$PRG: WARNING: Deprecated option --device"
                    shift 2
                else
                    echo 1>&2 "$PRG: option requires an argument $1"
@@ -1484,6 +1479,7 @@ if [ $# != 0 ] ; then
                if [ -n "$2" ] ; then
                    partition="$2"
                    bootconf=auto
+                   echo 1>&2 "$PRG: WARNING: Deprecated option --device"
                    shift 2
                else
                    echo 1>&2 "$PRG: option requires an argument $1"
@@ -1495,6 +1491,7 @@ if [ $# != 0 ] ; then
                if [ -n "$2" ] ; then
                    root="$2"
                    bootconf=auto
+                   echo 1>&2 "$PRG: WARNING: Deprecated option --device"
                    shift 2
                else
                    echo 1>&2 "$PRG: option requires an argument $1"