Currently there is inetboot as the only bootloader that is functional on the ODW, Mac and EFIKA targets. Make sure your nfs server is set to nfs 3. Edit the file
/etc/default/nfs
uncomment the following line and set NFS_SERVER_VESMAX=3
We haven't yet debugged why the target will hang if using NFS 4, but it does.
Changes to inetboot so that it functions without issue. Biggest problem was the 32KB I/Os that inetboot was doing what the ODW OF couldn't handle due to its lack of more than one receive buffer causing back-to-back packets to be dropped. With the coming of VOF this is no longer an issue. NFS3 works, NFS4 probably is ok too now.
NFS diskless boot (the inetboot) has being ported and currently functional with all three targets. No modifications to the source are required to support them. Codes (mainly src/psm and src/stand) are checked in. For an overview see Sameer Seth's Weblog Boot-net with BOOTPARAMS/RARP in Solaris for details of how inetboot works
- setup the build environment as outlined in GNU Toolchain and Host Environment
- build header in src/head (mainly for rpcsvc/*.h of nfs) (only need to build once),
make. Headers are installed in ${CODEMGRWS}/{GATE}/proto/rootppc/usr/include, but actually there is no need to install them, and later building will pick up them from src/head.
- build rpc header for nfs in src/uts/common/rpc (only need to build once),
make
- build and install stand lib in src/stand,
make, and make install. (llib-xx.ln are created to make install sucess). Libs are installed in ${CODEMGRWS}/{GATE}/proto/rootppc/stand/lib
- build inetboot and ufsboot in src/psm/,
make install
- copy up your inetboot from src/psm/stand/boot/ppc/chrp to you tftpboot dir
Notes: For changes that may cause the rebuilding of stand, you have to rebuid it by yourself and install them. inetboot make does not check dependencies for it
- copy the inetboot.elf (or inetboot) built before to the tftp server root, and start tftpd
- create file /etc/ethers with an entry "
<client mac address> clienthostname.domainname" and start rarpd by command "/usr/sbin/in.rarpd -ad " as root (make sure rarpd is stopped in svcs)
- create file /etc/bootparams with an entry "
clienthostname.domainname root=<nfs server ip>:<nfsroot> domain=domainname" and start bootparamd by command "/usr/sbin/rpc.bootparamd -d" as root
- export nfs root and start nfsd. in nfsroot/ppc/, put a PowerPC bootstrap binary, such as a kernel or just the inetboot.elf itself.
- start system into openfirmware prompt
- create a devalias by command "
devalias ethernet /pci@f4000000/ethernet" or use the appropriate address for the platform you are on.
- If on an ODW load vof with 'load ethernet:<tftpserverIP>,openfirmware'. The implementation of "load" word in machine open firmware needs to get an IP via dhcp, so a dhcp service should be available. When the ok prompt comes up again enter ok> boot net. If on a mac skip #3.
- 'load ethernet:<tftpserverIP>,inetboot.elf'. The implementation of "load" word in machine open firmware needs to get an IP via dhcp, so a dhcp service should be available.
- after the inetboot.elf is loaded, let it
go on firmware prompt to enter into inetboot bootstrap
- the bootstrap prints out memlists info, boot device, files and parameters info and then asks for a boot file. Enter the file name that is in the nfsroot, such as
/ppc/unix
- bootstrap prints out file ELF header info and transfers control to it.
Very early on the community hads a conf call to discuss the bootstrap topic bootstrap conf call and other threads and came down the following choices:
- Use a TFTP boot to load a simplified PPC flavored multiboot and the bootarchive. this is the most straighforward approach and least code intensive, small changes to current multiboot to remove BIOS calls. Not the best longterm solution.
- Enhance OF to enable loading multiple files, a simplified PPC flavored multiboot and the bootarchive. requires some modification of OF to allow loading of multiple files. Need to clarify UFS support in OF?
- Use OF to load GRUB2 and then it loads a simplified PPC flavored multiboot and the boot_archive. OF provides the same functionality and why layer this with GRUB, OF has a menu system already and we have the right people to enhance OF. GRUB knows the Free<nop>BSD variant of UFS, so it'll need to be changed to also support the Solaris variant of it. This is a solution to support booting into multiple OS in the long term.
- NFS boot, load bootstrap binary and the bootstrap loads kernel and nfs-mounts root file system. NFS diskless boot has been used in Solaris Xen bringup (see Tim's blog below) and proved to be the best choice for earlier kernel development.
Grub patched to support multiboot on PPC tested on ODW, and Noah's PowerMac G4 Thanks to Noah Yan for this initial work.
Much of this below is not applicable at the moment but just informational to know where we started from.
GRUB2 had been chosen by the community as the bootloader. It functions on PPC and the Genesi ODW. The NewBoot project here at Sun has used GRUB as a base. The changes for solaris support in GRUB are put back, they will need to be merged into GRUB2, Sun's team as no solid timeline yet to do this and expect the community to assist. Fortunately we do not need a bootloader to start with the low level kernel work. Why? Our JTAG tools can directly download the bin files into DRAM and jump to the start address ie: _start and begin stepping.
sparc: The approach is similar for PPC. In the case of a local ufs root file system, the secondary boot loader is the file /platform/uname -m/ufsboot. The primary boot loader knows just enough about how to interpret the ufs on-disk format to find the secondary boot loader in the root file system. The device containing the root file system is the same as the boot device.
- PPC Note: We skipped ufsboot and implemented inetboot instead.
Loading the core kernel modules and starting Solaris
This stage is the process of loading kernel/unix and krtld and then starting Solaris.
Sparc:
On sparc, the boot archive is not being used yet for booting. Instead, the secondary boot loader reads the kernel modules from the root file system.
The secondary boot loader knows enough about ufs to find and read the /platform/uname -i/kernel/unix and krtld modules. After loading them, jump to "main" and start executing. Solaris is now running, though without a root file system. File accesses are accomplished by the kobj_ interfaces, which in turn use the boot ops provided by the boot loader, since the vn* operations aren't available yet, (since the root isn't mounted and so there is no file system that can be accessed).
At the end of this file there are details in Shudongs analysis and they have been posted to the PPC Forum.
The boot environment need to load the ramdisk and the multiboot program. multiboot loads unix.
- OF—>GRUB2->multiboot + boot_archive -> unix/krtld -> kmdb …
Community Boot Conf Call Notes
A new boot architecture
Post new-boot Solaris on 128Mb systems
The New Bootloader for x86 Platforms
Solaris Deployment and Kernel Development with Diskless Clients
Solaris Bootup on Xen
Managing Diskless Clients
OpenSolaris Xen Community (OpenSolaris
Open Firmware Network Boot and Diskless Client
IEEE 1275 Open Firmware
IEEE 1275 Open Firmware Multiboot Specification
GRUB2 for Genesi ODW PowerPC Development Server
The GNU GRUB Wiki