Re: /sbin/macos ...self-destruct mechanism?


Subject: Re: /sbin/macos ...self-destruct mechanism?
From: Timothy A. Seufert (tas@mindspring.com)
Date: Sat Nov 10 2001 - 18:17:37 MST


(cc'ed to Hollis Blanchard because the macos script should probably
get axed from pmac-utils)

At 1:18 PM -0600 11/10/01, Carl McCabe wrote:
> This question was posted previously by another list memeber, but I
>haven't seen a solution so I'll try again:
>
> Out of curiousity, I typed /sbin/macos as root and, as expected, my iMac
>restarted into the Mac OS. But when I restarted again there was no prompt
>giving me the options to start into Linux, Mac or from a CD. Instead it
>just started into my Mac OS. So from this I have two questions...
>
>1.) Has anyone else tried /sbin/macos? And if so, did you have the same
>results?

Anybody who has tried it will get that result, guaranteed. The
"macos" script resets Open Firmware's "boot-device" NVRAM variable to
the default value for New World Macs, instead of what it needs to be
in order to boot the Linux bootstrap partition.

Out of curiosity, why was it exactly that you ran it? Just wondering
because many people do run it for some reason, even though there's no
need to.

The script is really a holdover from a LONG time ago in the history
of Linux on PowerMacs, when there was no such thing as a boot menu
and you needed to dork with Open Firmware variables to explicitly
switch between booting MacOS and booting Linux.

Hollis, why not drop macos from pmac-utils? People keep stumbling
over this problem and it seems doubtful that its functionality is
important to anybody these days. ybin/yaboot and quik users don't
need it because those packages provide boot menus. You don't need to
change the NVRAM to boot back into MacOS anymore. BootX and miboot
users should not need it either for obvious reasons. It just seems
to cause problems because people run it without realizing what it is
going to do. In fact, it can screw up Old World PowerMacs bad enough
to require a PRAM reset because it sets "boot-device" to a value
which will only work with New World OF versions. (I have had to
assist a YDL 2.0 user who ended up in exactly that situation; he
thought his computer was dead because it just sat there with the
screen blank.)

>2.) Once this command has wreaked its havok, what can I do to reverse it?
>Should I reinstall the boot partition from CD? Or is there a more
>specific solution.

No, you don't need to do anything as severe as a reinstall.

If you have a recent enough Mac, you should be able to get back into
Linux with the Open Firmware boot chooser. Just hold down option
after you turn the computer on or reset it and wait to see if you get
a screen with a mouse cursor and icons for the different operating
systems available. Click on the linux icon and, once in Linux
(assuming that /etc/yaboot.conf is set up correctly), run ybin as
root. That should restore the correct Open Firmware boot-device
setting.

If you don't have the boot chooser, there are other options which
aren't quite as easy. One of them is to use the YDL CD to load the
Linux kernel while pointing it at your root partition rather than the
installer or rescue RAMdisks. Another is to drop into Open Firmware
(hold down cmd+opt+O+F after poweron/reset until you get the prompt)
and set the Open Firmware boot-device variable by hand. The command
is:

setenv boot-device hd:N,ofboot.b

where N is the partition number of your Linux bootstrap partition.
Note that OF uses hexadecimal, so if the number is 10 or higher, you
need to use 'a' 'b' 'c' etc. instead of '10' '11' '12' etc. for N.

-- 
Tim Seufert



This archive was generated by hypermail 2a24 : Sat Nov 10 2001 - 18:29:39 MST