Y e l l o w  D o g  S o l u t i o n s


TOPIC: How to Get Around a Failed Install



Introduction
As of this writing, I was new to Macs but not to Linux or PowerPCs. I had been the SysAdmin for a Linux mailserver from 1994 to 1997. The machine was a 486/33 with 20MB of RAM and a whopping 580MB harddrive. It wasn't the fastest pig on the block but it was reliable. As the facility was migrating to NT and NT Server, the little rockhopper box was relegated to backup and emergency server duties (often.) Upon leaving that position, my opportunity to work with Linux decreased to next to nil. Since then my clients required that I stay in lock step with their development systems, all Windows based. My PowerPC experience is from my profession, embedded systems software engineering. My last client was producing a system based on the MPC750 processor on a custom board.

I came to Macs because of Linux and PowerPC. Although the custom board used a heavily modified COTS RTOS, I couldn't help to think that the new G4 Mac running Linux would be the perfect development platform for embedded systems development, especially if the target computer were a PPC running Linux. So, when my employment situation changed (read as "contract ended"), I decided this would be the perfect opportunity to catch up with the evolved Linux and the G4 Mac platform. So, I'm now the proud owner of a 733MHz G4 with an Apple Studio LCD monitor. It has 256MB of RAM and two harddrives, the OEM 40GB and a Maxtor 60GB for YDL.

In parallel, I also installed RedHat 7.2 on my PII laptop. I had installed RH5.2 when the luggable was new but the graphics support for the S3 Virge MX video was below acceptable and I reclaimed the drive space for Win98 (required for DVD support) and NT. With the maturation of XFree86 and Linux, running Linux on this machine became more than a reality.

A lot of this information is based upon my experience gain during the installation of Yellow Dog Linux 2.2 on the Mac but some comes for the experiences with the laptop and from building and installing a pre-1.0 system. But this information is also limited to that which is specific to install for New World (Order) machines: IOW, yaboot and not BootX. I appologize but most of the rest of this HOW-To should be helpful. And this HOW-To is really more of a HOW-Did since it more-or-less documents how I overcame my own problems, including stupidity, to get my YDL 2.2 system up and running. If a section is not discussed, I most likely haven't encountered any problems in that area.


Graphical vs. Textual Install
Does it matter which install method is used? The short answer is "No." as both will get the task done. My personal feeling is that full installation should be a rare occurance and the graphics don't excuse you from knowing what you have to know before you start. For my system, the graphical mode didn't work. And neither did the default video mode. So, instead of proceeding with "install" or "install-text", I had to resort to "install-text-safe". This disables the video drivers for the booting process and uses a character-only display (aka. ASCII-art.) This is somewhat crude but its also been around since the dawn of Linux and has been well exercised. And behind the scenes, the GUI is just that as the actual functionality is performed using the same executables.


Partitioning of the Harddrive
Since I was starting with a fresh Mac OS X system, I didn't wish to mess with the OEM drive. So, I plopped down a Bennie at CompUSA for new drive. But I understand that not everyone has enough dead presidents to go this route.

When partitioning a harddrive for an Intel-based system, there isn't much to consider. You're asked to set-up a minimum of 3 partitions (although a single partition is possible) for the bootable images ("/boot"), virtual memory (swap), and the root file system ("/"). The bootloader, usually either LILO or GRUB, is installed in either the Master Boot Record (Intel sepecific) or the first partition of the drive. Note that there is a limitation that the boot information must be within the first GB of the drive.

When partitioning a drive for a yaboot-based system, the installation instructions recommend 3 partitions as well: the bootloader (of format type "bootloader"), the virtual memory (of type "swap") and the root file system (of type "Linux".) BUT, this is not the same as on an Intel machine. If YDL is your first Linux install, you wouldn't have made the assumption I did, that the bootable images was the same as the bootloader. Well, they're not. The New World ROM boots the first bootable partition. And that partition is only bootable if it is formatted a certain way (a format not normally readable from Linux) and has been "blessed". This partition does not hold the bootable Linux kernel, it just has a description of the operating systems available on the machine. More on yaboot can be had at penguinppc.com in the yaboot HOW-TO.

If you define only 3 partitions, one of each format type, the installer will automatically assign the proper mount points for each partition. If you're having trouble with the system booting after a recommended install, ie. yaboot can't find image, the problem isn't with the harddrive, it's probably in the yaboot configuration, which is addressed later on. If you define more than 3, you will be required to define the mount points for each. The important thing in defining the mount points is to NOT assign a mount point for the bootloader partition. This partition will have the "hfs" filesystem (graphical install) or "sun-ufs" filesystem (text install).

So, why would you want more partitions? When a problem occurs on the harddrive from which there is no recovery, meaning filesystem check can't produce a clean system, the entire partition must be reformatted. Most SysAdmins will define at least one users partition mounted on "/home", a bootable image partition on "/boot", an application partition on "/usr", a swap partition (this is essentially required to be it's own partition), and the rest of the system on "/". This localizes the damage and makes restoring the health somewhat easier should the unthinkable happen.

If you are repartitioning the Mac drive, you will need ~2 GB of free space to load enough stuff to make it loading YDL worthwhile. You can survive with less but it may mean unloading modules, using RPM, to free space for new stuff. If the bootloader partition is not the first partition on the drive (usually identified as /dev/hda2 in Linux-speak), don't panic. There are ways to "unbless" the Mac OS partition(s) to allow yaboot to work. Consult the other HOW-TOs at the YDL support pages for your particular problem.

If you have Mac OS X and Mac OS 9 on the system and you are using two drives, it's imperative that the YDL drive contain the yaboot partition and that this drive be the master (for IDE) or ID 0 (for SCSI). This is because selecting the "Start-Up Disk" from within the Mac OS's will "bless" the selected Mac partition and will be the first partition to be encountered by the New World bootloader. Unblessing the partition will require rebooting from the CD and rerunning ybin. Back to partitioning, the bootloader partition size is suggested to be 10MB, but the yaboot man page says it can be as little as 800k. This may be important to those trying to sqeeze YDL onto a single disk with the Mac OS's.

If you need to reinstall, you should delete the previous partitions from the aborted installation (assuming that's why you're reinstalling.) This is a good idea because the installer assumes you are installing a new system and that existing partitions contain valid systems. (Sort of the opposite philosophy from Microsoft XP, Win2k, and Win98.) Delete the partitions before adding new ones. This is because the operations are queued and if you add a partition between deletetions, the added partition may be deleted since it's relative position is not accounted for.


Configuration of X11
I don't like to configure X11 during installation. Most of the problems I've had with systems not working have been in the area of misconfigured X11. And this installation was no different. My suggestion is to select the best representation you can for the monitor, resolutions and color depth, but DO NOT select the graphical login.

Within Linux, it is possible to have multiple virtual terminals. Classically, you hit CTL-ALT-F1/F2/F3... and you are presented with an alternative command-line login. The graphical terminals are on F6-F9. Unfortunately, for my install, the system doesn't present this capability. There is a HOW-TO related to this but its advice hasn't worked. Therefore, it can't be relied upon. X can be startx once you login and if it doesn't work, the reasons why can be determined and corrected. My Mac came equiped with the Radeon 7500 but the default driver selected was fbdev. This was the result of the limited capabilities inthe installation programming and of the relatively new device.


Installation of yaboot
I encountered a problem where the installation of yaboot literally crashed. The bug was reported and TerraSoft is determining the cause and a solution. The work around is to answer "No" to the question "Do you want to install yaboot now?" This will mean that other questions you answered in this installation section will be for naught but you need to get beyond this section without an error. If yousay "Yes" to the question and the install of yaboot errors, the "Continue" option does allow you to continue but the yaboot files aren't copied to the filesystem. The recovery is far more difficult than just reinstalling YDL.

Well, without yaboot installed, you will need to boot from a CD. According the installation guide, this should be possible from the YDL installation disk. I wasn't able to do this, "cd-linux root=/dev/hda4" would result in an error message saying "file not found." The "cd-linux" or in my case "cd-linux-safe" boot options are on the Tasty Morsels CD. To reboot:
0. Insert the Tasty Morsels CD (for me, reboot into MacOS, insert the disk, and reboot.)

1. Hold "c" while the system boots (you can release when the screen flashes.)

2. At the "boot:" prompt, enter "cd-linux root=/dev/hda4". This could be either cd-linux, cd-linux-safe, cd-linux22, etc. A list of options is attained by hitting the tab. The root dev should be the location you defined during the mount procedure. If it was performed automatically, it should be in the order you defined them. Assuming the 3rd partition on the master drive, it would be hda4. If its on the slave drive, its would be hdb. If its SCSI ID 0, its sda. If you added to the OEM drive, the part number could be 7, 8 or whatever. In the end, it matters little as an incorrect entry will be detected and you can enter another device.

3. You should now be be presented by the booting of the image and eventually a login. Log in as root.
You're now in. If the video is working, you were presented with a graphical login screen and you logged into the default KDE environment. If like me, you were required to install using the "-safe" mode, you will need to boot using "cd-linux-safe" kernel in step 2 above.

You will need to edit the yaboot configuration file before you can proceed. If you answered "No" to installing yaboot during the installation, you should have a template /etc/yaboot.conf. If you said "Yes" and "Continue" from the error, there is only a zero-file. Now would be a good time to consult the yaboot, yaboot.conf, and ybin man pages. I worked from the template yaboot.conf and can't really advise what else may be required if the template is not there.

In an editor, open yaboot.conf. The template file has some things that should be changed, added and deleted.
1. Change: boot=unconfigured
To: boot=/dev/hda2
or to whatever device is the bootloader partition.
2. If the "root=" device was /dev/hdb
Change: device=hd:
To: device=ultra1:
or to whatever representation the device has been given by yaboot.
3. If the "root=/dev/hda" was 4,
Change: partition=3
To: partition=4
or to whatever number represented the root device.
4. Comment (#) the lines from the first "image=" to the end.

5. Above the newly commented section, add (| = left end of line)
|image = /boot/vmlinux
| label = YDL
If you were required to use the "-safe" option, also add
| novideo
Note that the indentation is important. Option for the "image" shouldn't begin in the first column. The "label" option isn't required and you can give it whatever name you'd like. This is what you enter on the "boot:" prompt and gets listed when tab is entered. If you have multiple Linux kernels from which you hope to boot (very useful while upgrading to a newer kernel), you must specify a label to identify which kernel you want.

6. If you have MacOS or MacOSX somewhere add
macosx = /dev/hdb5
macos = /dev/hdb4
or to whatever devices they are.
7. Lastly, if you want to specify a default OS to boot when no input is given, add
defaultos=macosx
or to one of the other operating systems. Absence of this line
defaults to the first "image = " image for booting.
8. Save and exit.

The installation guide would now have you execute (ybin). When I did this, it failed. But the error message was helpful. It said I needed to execute (mkofboot) prior to executing (ybin). This was simple and successful. Both functions are found in /usr/sbin. Execute (ybin) after (mkofboot). If you edited yaboot.conf correctly, you shouldn't need to pass any parameters to either function. You should now be able to boot without using the Tasty Morsels CD.

This HOWTO was written by John R. Stuart



 
          Copyright ® 1999-2010. Fixstars Corporation. All rights reserved.
YDL.net Fixstars Corporation