fxtentacle / chameleon-chimera-hajo

This is Chameleon 2.0 modified by Chimera branch modified by me. You can use it to net-boot :)
Other
3 stars 2 forks source link

Give a minimum indication of how to netboot using this bootloader #1

Open sebasfiorent opened 11 years ago

sebasfiorent commented 11 years ago

Hi, I'm interested in using this bootloader.

I'm planning to following this route:pxe->mboot.c32->chameleon-chimera-hajo->osx

Please give me the minimum assumptions for a working net-booting install that you used to netboot with this code.

Thanks in advance Regards

fxtentacle commented 11 years ago

I used the Apple "System Image Utility" to prepare a .nbi folder for the network boot. A NBI folder looks like this:

$ ls -R NBImageInfo.plist NetBoot.dmg i386

./i386: PlatformSupport.plist kernelcache booter x86_64

./i386/x86_64: kernelcache

I then replaced the x86_64 kernelcache file with my own version, generated as follows:

kextcache -v 6 -arch x86_64 -K /mach_kernel -c /path/to/nbi/i386/x86_64/kernelcache /System/Library/Extensions/ /path/to/custom/drivers

I then installed DNSMASQ which includes a TFTP server and a DHCP server. I also installed a NFS server. The boot procedure then works as follows:

The modified chameleon will poll DHCP for boot information and then download the booter and the kernelcache using TFTP. It will then mount a NFS share to access the NetBoot.dmg disk image.

Here's the interesting lines from my dnsmasq config:

dhcp-vendorclass=apple-boot,AAPLBSDPC/i386 dhcp-option-force=net:apple-boot,43,08:04:81:00:00:67 dhcp-option-force=net:apple-boot,60,"AAPLBSDPC/i386" dhcp-option-force=net:apple-boot,17,"nfs:192.168.2.123:/NfsExport:bootme.nbi/NetBoot.dmg" dhcp-option-force=net:apple-boot,67,"bootme.nbi/i386/booter"

disable router

dhcp-option=3

disable dns server

dhcp-option=6

Hope that helps, Hajo

fxtentacle commented 11 years ago

I also had this in my config plist. This will put a "net-boot" attribute in IOREG at "/" with a value of 3100. You might need to replace 3100 with an hex-encoded string like "bsdp://en0@192.168.2.123"

hajokeys hk-net-boot hk-net-boot /:net-boot=3100

optional:

Kernel Flags ..default stuff... -rwroot_hack rootpath=nfs:192.168.2.1:/exports:disk.dd

The -rwroot_hack will make the booter net-boot with a writable disk image. You can use that to (for example) boot from a RAW disk where you are sharing the /dev/sda from a linux box.

sebasfiorent commented 11 years ago

Thanks!

One last thing.. The chimera-hajo bootloader, gets booted by normal disk boot? Or it gets served by PXE (following the route sugested by http://www.puredarwin.org/developers/booting/boot/pxe - option 2)?

Regards Sebastian

fxtentacle commented 11 years ago

In my case i used a bootable USB key which contained the chameleon "boot" binary and the config.plist. It should also work with pxelinux, although i didn't try that.

For PXE to work, you would probably need to replace the NIB/i386/booter binary

sebasfiorent commented 11 years ago

Thanks, i'll give it a try and I'll let you know how it goes

fxtentacle commented 11 years ago

If you do PXE-based netboot, it will search for an .mkext file for the drivers, so you need to use the old 10.6 kextcache syntax. So if you kernel is named my_kernel, it will try to load my_kernel.mkext from the same folder. It will also search for the config.plist in the same folder.

sebasfiorent commented 11 years ago

I've tried with pxe with no luck for the moment. I'll try your same config (USB boot). I've compiled your code and I have the boot bootloader. Which files do you have on the USB drive? Can you give me an ls -lR?

Thanks!

sebasfiorent commented 11 years ago

Hi, can you copy an ls -lR of your USB working installation? thanks!