pity-riotous
pity-riotous
pity-riotous
pity-riotous
hyenas
hyenas
hyenas
hyenas
Linux on your Apple Mac | iLinux • View topic - USB installation Debian/Ubuntu via the net

USB installation Debian/Ubuntu via the net

USB installation Debian/Ubuntu via the net

Postby linuxopjemac » Sun Mar 21, 2010 7:51 pm

For Ubuntu see the end of the post.

If I install a system, I like simplicity. I used to install Debian on my PowerBook G3 Pismo with a netinstaller on CD. So I downloaded the netinstall.iso and burnt it on CD. It would be even cooler, to boot from a USB stick to get into a minimalist environment, which can then be used to install a Debian system over the internet. This can be very useful for those old NewWorld PPC machines where the CDROM passed away. I just did it and I tell you how.

Currently, NewWorld PowerMac systems are known to support USB booting. To prepare the USB stick, you will need a PPC system where GNU/Linux is already running and where USB is supported (unfortunately you cannot yet do these things with fdisk on Intel machines). You should ensure that the usb-storage kernel module is loaded (modprobe usb-storage) and try to find out which SCSI device the USB stick has been mapped to (in this example /dev/sda is used). To write to your stick, you may have to turn off its write protection switch.

Note that the USB stick should be at least 32Mb in size.

Most USB sticks do not come pre-configured in such a way that Open Firmware can boot from them, so you will need to repartition the stick. On Mac systems, run
Code: Select all
mac-fdisk /dev/sda

, initialise a new partition map using the i command, and create a new partition of type Apple_Bootstrap using the C (capital c) command. (Note that the first "partition" will always be the partition map itself.) Then type
Code: Select all
hformat /dev/sda2

Take care that you use the correct device name for your USB stick, you might be formatting the partition where your Linux is running in right now. The hformat command is contained in the hfsutils package.

In order to start the kernel after booting from the USB stick, we will put a boot loader on the stick. The yaboot boot loader can be installed on an HFS filesystem and can be reconfigured by just editing a text file. Any operating system which supports the HFS file system can be used to make changes to the configuration of the boot loader.

The normal ybin tool that comes with yaboot does not yet understand USB storage devices, so you will have to install yaboot by hand using the hfsutils tools. Type
Code: Select all
hmount /dev/sda2
hcopy -r /usr/lib/yaboot/yaboot :
hattrib -c UNIX -t tbxi :yaboot
hattrib -b :
humount

Again, take care that you use the correct device name. The partition must not be otherwise mounted during this procedure. This procedure writes the boot loader to the partition, and uses the HFS utilities to mark it in such a way that Open Firmware will boot it. Having done this, the rest of the USB stick may be prepared using the normal Unix utilities.

Mount the second partition of the stick somewhere, here I create usbstick as a mount place:
Code: Select all
sudo mkdir /mnt/usbstick
sudo mount /dev/sda2 /mnt/usbstick


Now we will get the files necessary for the USB stick. Download the netboot directory from the Debian PPC installer, here for 32-bits systems, i.e. most PPC systems and here for 64-bits systems, i.e. G5. In this example I took the Sid (unstable most recent packages) installer, you might want to take the Squeeze installation somewhere else.

Copy the following files from the netboot directory to the stick (/mnt/usbstick)

*vmlinux (kernel binary)
*initrd.gz (initial ramdisk image)
*yaboot.conf (yaboot configuration file)
*boot.msg (optional boot message)
*vmlinuz-chrp.initrd
*mini.iso

Note: don't copy yaboot over! You will not be able to boot from the stick if you do this.

As an example to copy vmlinux you do this:
Code: Select all
sudo cp /path_to_your_files/vmlinux /mnt/usbstick


Now unmount the USB stick:
Code: Select all
sudo umount /dev/sda2


Booting the USB stick

To boot a Macintosh system from a USB stick, you will need to use the Open Firmware prompt, since Open Firmware does not search USB storage devices by default. To get to the prompt, hold down Command+Option+o+f all together while booting.

You will need to work out where the USB storage device appears in the device tree, since at the moment ofpath cannot work that out automatically. Type dev / ls and devalias at the Open Firmware prompt to get a list of all known devices and device aliases. On the author's system with various types of USB stick, paths such as usb0/disk, usb0/hub/disk, /pci@f2000000/usb@1b,1/disk@1, and /pci@f2000000/usb@1b,1/hub@1/disk@1 work.

I found out, if you have two USB ports, that it is either usb0 or usb1. So I had to do:
Code: Select all
boot usb0/disk@1:2,\\:tbxi


The 2 matches the Apple_HFS or Apple_Bootstrap partition onto which you copied the boot image earlier, and the ,\\:tbxi part instructs Open Firmware to boot from the file with an HFS file type of "tbxi" (i.e. yaboot) in the directory previously blessed with hattrib -b.
The system should now boot up, and you should be presented with the boot: prompt. Here you can select different installers and optional boot arguments, or just hit Enter.

You will be presented with the Debian installer. The rest of the installation I leave up to you, as it is not part of this manual.

If you like Karmic Koala's Ubuntu instead of Debian, the path to the Ubuntu files is here.
linuxopjemac
Site Admin
 
Posts: 541
Joined: Tue Feb 02, 2010 8:48 am

Return to Installation

Who is online

Users browsing this forum: No registered users and 2 guests

cron
pity-riotous
pity-riotous
pity-riotous
pity-riotous
hyenas
hyenas
hyenas
hyenas