2005-06-29

Permalink 19:20:02, Categories: Developers are users best friends

FreeBSD on the Mac Mini! (on an external hdd)

Good news! My proposal for Google's Summer of Code was accepted. In the summer break, I will rewrite the FreeSBIE toolkit to integrate it in the FreeBSD source tree. Thanks a lot to the FreeBSD guys and Google as well.

Before start working on it, I want to give a try to the actual FreeSBIE script under FreeBSD-powerpc. I've got a Mac Mini, but unfortunately I haven't partitioned the internal hard drive, so I have only an 80Gig HFS+ partition, apparently unresizable without formatting everything.

So I took an external case for hdd, combo USB2/FireWire, and put an old 6Gig drive inside it. Then, with the Disk Utility from Mac OS X, I partitioned it, choosing UNIX File System as fs type (maybe this is optional). I split the space in two partitions: the second one, for swap, is ~768Mb, the first one has the remaining space.

I downloaded the miniiso made by Peter Grehan from here (well, 200Mb, not so mini). I burned it with Toast Titanium 6. In order to boot it you have to hold the "C" key pressed down right after the power on, or to go into OpenFirmware. After installing it, we should enable OpenFirmware boot prompt anyway, in order to choose our loader and booting device. So we enable the OpenFirmware prompt at next boot (and forever, maybe) by typing:

$ sudo nvram auto-boot?=false
(XXX is there any other way to do this?)

Say "see you soon!" to your Mac OS X and reboot. You should hear the initial chord, then the OpenFirmware prompt. Something like:

 ok
0 >

To boot into Mac OS X simply type boot. Now, make sure your firewire (or usb) hdd is powered on and attached, then type

0 > boot cd:,\boot\loader cd:0

Then you should see the loader, the kernel messages, and finally the sysinstall menu. The external harddrive is probably mapped to daN (da0, da1 or so). Proceed with a minimal installation (I've not tried installing sources from the cd), choose your external hard drive, then you should see partitions you already made before. Create one for / and one for swap. Commit changes, and then everything should work ok. Reboot.

Ok, now the tricky part, make external hard drive work. Starting from Peter Grehan's install, we read:


5. First boot

 Here's the rub: OpenFirmware doesn't understand UFS2. It does understand
iso9660 and HFS+, so the loader must live on a disk/partition of that
type. So, you can either:

a) leave the CD in the drive, break into OpenFirmware at boot, and

 0 > boot cd:,\boot\loader hd:11

 (or hd:X, where X is the partition number that FreeBSD was installed on)

or

b) Boot into OSX and copy /boot/loader from the miniinst CD into / on
   OSX. Reboot, break into OpenFirmware, and

 0 > boot hd:loader hd:11

 (or as above, hd:X)

the hd:11 part will not work in our case. We have to find the right reference to the hard drive. So type:

0 > dev /
0 > ls

and find your device type. In my case, firewire hdd is: /pci@f4000000/firewire/node/sbp-2/disk@0:3 (3 is the root partition number). When attached to my usb hub, the same disk is: /pci@f2000000/usb@1b,1/hub@1/disk@2:3

. So, to boot from firewire, type:
0 > boot cd:,\boot\loader /pci@f4000000/firewire/node/sbp-2/disk@0:3

I see some strange sbp message during the loader phase, but it works quite well after that. As I don't want to have always the CD inserted, and don't want to find the disk path everytime I copied /boot/loader from the CD to /fbsd_loader on my Mac OS X partition, and copied /boot/boot.tbxi to /freebsd.tbxi. Then I edited it, so it looks like:

<CHRP-BOOT>
<LICENSE>
$FreeBSD: src/release/powerpc/boot.tbxi,v 1.1 2004/08/18 11:08:18 grehan Exp $
</LICENSE>
<COMPATIBLE>
MacRISC MacRISC3 MacRISC4
</COMPATIBLE>
< DESCRIPTION>
FreeBSD/PPC bootloader
</DESCRIPTION>
<BOOT-SCRIPT>
" screen" output
boot hd:,\fbsd_loader /pci@f4000000/firewire/node/sbp-2/disk@0:3
</BOOT-SCRIPT>
</CHRP-BOOT>

So I can now boot FreeBSD by simply typing:

0 > boot hd:,\freebsd.tbxi

I'll post next days other hints for make userland work :) In the meantime, have fun!


UPDATE:

  • Andreas Tobler told me that "the short form of /pci@f4000000/firewire/node/sbp-2/disk@0:3 is fw/node/sbp-2/disk@0:3. Thank you!

References

2005-06-18

Permalink 23:00:51, Categories: Developers are users best friends

Hard work on the toolkit

Great news :) In this two weeks I worked hard on the toolkit to make it more flexible and efficient. We've added the "foobar" user ability, thanks to the switch to the ufs filesystem, and a files/custom directory, capable to contain the "deltas" with the livefs. In it you can put your custom files, e.g. rc scripts, or user settings. Those files are then copied as they are to the livefs, just before packing it (in 7.customuser phase).

Scott Ullrich greatly appreciated this for his pfSense install cd build system.

I've got lotsa ideas in this period, some of them (those with the highest priority) are listed in our ToDo/Desired Features page on the wiki. Others include make FreeSBIE capable of being a netboot server, as well as suitable for really embedded but complete OS installs to fit on less than 10Mb. Our $MINIMAL build takes 20Mb, still too much ;)

Also, we received a nice feedback from Kris Moore of PC-BSD, which also uses our toolkit for PC-BSD install cd. We really appreciated!

Please contribute if you can, even telling us your experience and if our toolkit fits your needs or you had to patch it in some way. Our goal is to make a really flexible and reliable tool, and embrace a huge amount of uses of it. Reach us on freenode, we have a funny channel now, no more ghost town as before :P

Regards...

2005-06-09

Permalink 16:59:46, Categories: Developers are users best friends

One day with -CURRENT

Yesterday I've installed a 6.0-CURRENT snap and updated it, in order to work on the booting problem issue. That was resolved with a couple row of patch.

Oh, I suddendly switched to 5.4-RELEASE again after that :P

I'm doing some cool experiments thanks to qemu. I made the network bridging work thanks to my lovely netgraph system. Here's my freesbie/qemu directory listing:

-rwxr-xr-x  1 satu  wheel  3476 Jun  8 23:48 ether.bridge
-rwxr-xr-x  1 satu  wheel   197 Jun  9 16:08 qemu-ifup
-rwxr-xr-x  1 satu  wheel    61 Jun  8 23:48 qemu.sh

ether.bridge is a copy of /usr/share/examples/netgraph/ether.bridge. The only modified part is:

BRIDGE_IFACES="tap0 bfe0"
LOCAL_IFACES="bfe0"

Where bfe0 is my local nic. qemu-ifup is:

#!/bin/sh
if ! kldstat -v | grep -q if_tap; 
then
        if kldload if_tap; then
                echo "if_tap module loaded"
        else
                echo "if_tap module failed to load"
        fi
fi
./ether.bridge stop
./ether.bridge start

And qemu.sh:

qemu -cdrom ../FreeSBIE.iso -boot c -n qemu-ifup -localtime

I've got to try the cross-compiling for booting under qemu with other archs. Great piece of software!

2005-05-22

Permalink 04:28:17 pm, Categories: Developers are users best friends

Bugtracker

I don't wear my bugmaster hat as often as I should, but today I decided that it was high time to reduce the number of open problem reports and so I did.

Many of them were duplicates: after FreeSBIE 1.1 we got lots of PR related to not working mouses. IMHO this is caused by the hint.psm.0.flags=0x1000 we put in /boot/device.hints to make more mouses work, but perhaps we obtained the opposite result. I'm still researching on this.

There were some PRs more FreeBSD than FreeSBIE related, so I closed them.

What is really missing in our PRs is the feedback: users open the PRs but then forget about them and this makes difficult for us to help them and track down bugs.

2005-05-20

Permalink 18:35:24, Categories: Developers are users best friends

FreeSBIE 2 plans

As somebody has maybe noticed, we're actually brainstorming on the FreeSBIE toolkit big rewrite. Check out the wiki page and feel free about giving some suggestions. Rionda tell me that they discussed about importing freesbie in the main FreeBSD source tree, so we should also consider this in our new structure.

Maybe an rc.d-like structure for every single step (i.e.: a directory with every script acts in the build process) can be very useful.

Also, a Makefile structure, like the one suggested by Luca Morettoni here has to be keep in consideration.

:: Next Page >>

Blog for The FreeSBIE People

:: Next Page >>

<  June 2005  >
Mon Tue Wed Thu Fri Sat Sun
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

 

Links:

FreeSBIE Home Page
G.U.F.I. Home Page
FreeBSD Home Page

Search

Categories


Archives

Recent Referers


Top Referers

Misc