Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Dual Booting Debian and FreeBSD on Apple PPC hardware

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
sossego
Posts: 1072
Joined: 2007-03-20 23:52

Dual Booting Debian and FreeBSD on Apple PPC hardware

#1 Post by sossego »

Dual booting these systems will give the user a chance to work with two different FOSS environments.





For this exercise, you will need the following:

Hardware.
Any Apple branded PPC based system which allows you to boot from the option menu.
The open firmware version will be 3.x and greater.
A single disk of 40G minimum size or two disks with a minimum size of 20G.
A processor of 400MHz or greater.
I recommend 374M RAM but you can do with 256M.
Keyboard, mouse, monitor, and the usual.

Software.
A Debian business card iso for the powerpc architecture. http://cdimage.debian.org/debian-cd/6.0 ... pc/iso-cd/
A FreeBSD disk one iso for the powerpc architecture. ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201102/



Information.
Monitor name, vendor, VertRefresh, HorizSync.
You will need an internet connection for the basic FreeBSD install.


This howto is based on information from kelsoo http://forums.debian.net/viewtopic.php?f=16&t=20481 ,
tingox http://sites.google.com/site/tingox/powermac_g4_freebsd ,
and myself http://forums.freebsd.org/showthread.php?t=13827 .

Let us begin.

Prepare the isos by burning each to a disk using your favorite program.
You are going to erase the entire contents of your drive(s) so be sure to upgrade and save whatever you want.
Reboot the machine and hold down the left option key. This will be the logo key on the keyboard.
Open the tray and place in the Debian CD. From the icon menu, choose the CD.
Click on it , click on the arrow.
Another way would be to place the CD in the drive and hold down the C key while rebooting.
The third way is:

Code: Select all

 > setenv boot-device cd 
Open the tray, place the cd, close.

Code: Select all

 >mac-boot 

Go through the menu as usual, setting up passwords and ftp servers. Remember, since this is the first step,
you will not be saving the accounts.

For a single disk system.

You will do a manual partition. Delete all entries.
Create a map with the following:
1024K New World Boot block
3G ext3 mounted as /
512M swap
1G /var
2G /tmp
12G /usr
The rest of the disk dedicated to /home.

For a dual disk system.

Follow the above. Be sure that you have /(root file system without var or tmp) at a minimum of 3G.


Optional layout:

18G /
512M swap
The remaining for home.
This is good for the beginner or general use.


Finish by answering yes to accept scheme. Pick a minimal install. let it finish and reboot.
Hold down the option key, open the tray, place in the FreeBSD CD.
Follow the methods for booting from the option menu.

Installing FreeBSD.

This process will take some time. I will only cover the basics.

Let the CD boot and enter the information until you come to the main menu.
Hit F to get to the fixit menu. Hit 5 to choose a shell.
Hit ALT+CTRL+F4 to get to the shell.

Single disk system.

Code: Select all

gpart show 
Remember the disk number.

Code: Select all

  gpart modify -i<first apple-ufs partition> -t freebsd ad<disk number from gpartshow>
gpart modify -i<second apple-ufs partition> -t freebsd-swap ad<dsk number>
gpart modify -i<next apple-ufs partition> -t freebsd ad<disk number>
 

For a dual disk system.

Follow the above, using ad1 and ad0 after gpart show. The modding follows the same rules.

When finished, use ALT+CTRL+F1 to return to the menu.
Hit X and enter. Choose standard.
Select each, hit C, and do the following:
The first should be filesystem, /. The second should be swap.
The third should follow whichever scheme from previous you chose.
Hit Q.

Choose the minimum installation. X and enter.
Choose the CD as the media.
Yes, you want to start a new shell.

When it is finished, go through the menu. You can select yes for SSH.
Do you want to add a user? Yes.
For the group info, type wheel. You will need this for "su to root."
Do not add any packages from the ports collection.

Add root password.
Return to post installation menu. Select setup networking. Select devices.
If on a router, you can make up a domain. If not, it should automatically be filled in.
Exit. Return to the main menu. F for fixit, Enter. 5 for shell.
CTRL+ALT+F4
If it prompts for a new shell, choose yes.

Code: Select all

 dd if=/boot/boot1.hfs of=/dev/ad<disk number>s2 

CTRL+ALT+F1 to return to the main menu. Exit Install.


Setting up the base system.


Boot into the option menu.
Reinsert the FreeBSD CD. You will choose the hard disk as the boot device.
On a two disk system, choose the hard disk without an extra icon. This will be the FreeBSD install.
Select and arrow.

Let the system boot up.
Login as user.

Code: Select all

 mkdir cdrom
Su to root.

Code: Select all

 mount -t cd9660 -o ro /dec/acd0 cdrom
cd cdrom/9*
ls
For each directory.

Code: Select all

 cd 
sh install.sh
cd .. 
You will not need the base or kernel.
Do not install the ports package from the disk.

For src, you can either do

Code: Select all

 sh install.sh all 
or

Code: Select all

 sh install.sh <section> 

Code: Select all

 sh install.sh 
by itself will give you the source list.

Code: Select all

 cd /home/$USER && umount cdrom 

Final system setup.

Follow
http://www.freebsd.org/doc/handbook/ports-using.html and
http://www.freebsd.org/doc/handbook/ker ... lding.html

Be sure to reboot twice.

Installing Debian.

Reboot into the options menu. Load the Debian CD.

Do a normal install with the following exceptions on a single disk system.
All partitons dedicated to FreeBSD must be marked as do not use.

Be sure to setup a NewWorld Boot partition, at least one ext3 with /(root) as the minimum, and a swap partition.

I choose a minimal installation because you can control what goes in the environment for the most part.

The user, user password, and root password will be kept. Make them strong.

From here you can follow: http://forums.debian.net/viewtopic.php?f=16&t=20481
This is a very good guide for setting up the debian environment.

http://forums.freebsd.org/showthread.php?t=13827
For setting up the FreeBSD environment.

http://forums.debian.net/viewtopic.php?t=27227
For basic questions on setting up compatibility between the two.

Whenever you want to boot from either install, do the following:
Hold down the option key until the graphical menu appears.
The normal hard disk icon will be FreeBSD. Linux will be the one with the penguin.
Select then arrow to boot.
Let my desire and hope surpass my expectations;
And give me the strength to persevere through doubt.
Grant me the wisdom to exceed my bounds.
Let my eyes always see through the dream fog of childhood,
so that every moment may be treasured.

User avatar
sossego
Posts: 1072
Joined: 2007-03-20 23:52

Re: Dual Booting Debian and FreeBSD on Apple PPC hardware

#2 Post by sossego »

In the FreeBSD install, the user can eliminate the /home directory. Such an action would allow /usr/(subdirectories) and /root/(subdirectories) to be more flexible.

Using gpart to partition can be done; however, it may be difficult to repair the partitions later. Gpart can be buggy at times. This is the reason for the Debian disk.
Here is the partitioning scheme that can be done with gpart:

Code: Select all

gpart add -s 800K -t '!Apple_Bootstrap' ad<disk number>
gpart add -s <size> -t freebsd-ufs ad<disk number>
gpart add -s <size> -t freebsd-swap ad<disk number>
gpart add -s <size> -t freebsd-ufs ad<disk number> 
Resource: http://sites.google.com/site/tingox/powermac_g4_freebsd
Let my desire and hope surpass my expectations;
And give me the strength to persevere through doubt.
Grant me the wisdom to exceed my bounds.
Let my eyes always see through the dream fog of childhood,
so that every moment may be treasured.

User avatar
sossego
Posts: 1072
Joined: 2007-03-20 23:52

Re: Dual Booting Debian and FreeBSD on Apple PPC hardware

#3 Post by sossego »

http://code.google.com/p/powerpc-bits-a ... loads/list

Everything is according to letter.
I'll have everything uploaded plus a package list within the next few hours.
Let my desire and hope surpass my expectations;
And give me the strength to persevere through doubt.
Grant me the wisdom to exceed my bounds.
Let my eyes always see through the dream fog of childhood,
so that every moment may be treasured.

geazzy
Posts: 27
Joined: 2011-07-02 05:39

Re: Dual Booting Debian and FreeBSD on Apple PPC hardware

#4 Post by geazzy »

wow great job....

Post Reply