[Cbe-oss-dev] Mini Req to PS3 Linux boot loader (Re: PS3 Linux boot loader discussions)

Hiroyuki Machida Hiroyuki.Mach at gmail.com
Wed Feb 7 10:09:09 EST 2007


Hi all,

Here is a my revised proposal for the minimum requirements to PS3 Linux
boot loader for supporting removable boot media. I try to catch all of discussed
issues.

This requires one change for each on kboot and initrd. Please refer **1)
and **2) However most well designed Live CD would survive these change,
as shown as **3) e.g.#2 of  CASE 3: Optical Disc.

I believe that **1) change is needed  to handle multiple removale boot
media,  I'll bring up this issue  on Kboot ML.
On the other hand, I'm not sure that **2) change is really wanted,
because Live CD can assume that root dir would be on the builtin optical
device and can predict it's device name.

Thanks,
Hiroyuki


= Minimum requiremnts to boot loader for supporting removable boot media =

== Background ==

This document describes minimum requirements to boot loader for
PS3 Linux envrionment, so that system is able to boot from removable
media/devices.

This document does NOT intend to describe requirements, so that
system is able to boot from internal HDD. It's up to the boot
loader's implementation, if it requires /etc/kboot.conf and/or
how the boot loader interprets it.
Because the contents of HDD could be changed later, to follow
newer bootloader configuration file.

On the other hand, boot configuration file on removable boot
media like Live CD could be changed, once released.
So we need minimum specification of the boot loader, so that
any released removable boot media stay to be bootable.


== Supported Removable Boot Media and Format ==

Boot loader must have capability to recognize DOS partition table
and able on usb storage, and to handle DOS partition format and
the first primary partition, at least.

Following file system must be supported to read /etc/kboot,conf and
to get kernel and initial ram disk image on removable media.
Write methods may not be supported.

	ext2		on usb storage
	FAT16/32	on usb storage
	ISO9660	on optical media

Please note that those are not for rootfs, just for place of kboot.conf,
kernel and initial ram disk image. Kernel would support various fs types
and extensions, including ISO 9660 rockrige extension. Booting from UDF
media could be  supported using by ISO-UDF bridge. Some boot loader may
support other media and formats, but it's not expected to be common
across boot loaders.


== Expected Behavior to detect Removable Boot Media ==

1) When boot loader recognize block device, it is expected to execute following
procedure, to find removable boot media.

1-1. check if the device is a removable media.
1-2. check if format of the device meet one of following;
  ext2 (on USB mass), FAT16/32 (on USB mass) or ISO9660 (on optical)
1-3. check if the device has more than one partitions, if no, try to
  examine boot configuration file on the media.
1-4. Otherwise, it checks if the 1st primary partition is marked as
  "active"  or not. In the case of "active', try to examine boot configuration
  file on the 1st primary partition.
1- 5. try to mount the slected block device as "read only" and read the boot
  configuration file either /etc/kboot.conf or /etc/kboot.cnf
  (on FAT, it would be /ETC/KBOOT.CNF). In case of both exist, priroity is up
  to boot loader implemnation.

If boot loader successfully read the /etc/kboot.conf (or /etc/kboot.cnf),
it would load kernel and initial ram disk image, as specified at the
configuration file, then jump to entry address of the loaded kernel.

**1) Unfortunately current koot doesn't handle removable media with special
consideration like above.

2) When boot loader find more than one bootable media, it's expected
 to allow user to boot from removable boot media, with some how.
 This doesn't mean enforce every system to boot from removable media,
 prior to internal HDD. Such priority is up to it's implemenation.

=== Minimum /etc/kboot.conf ===

Bootloader needs to understand following minimum kboot.conf format.

timeout=[num]
initrd=[path1]
root=[rootname]
default=[label]
[label]=[path2]  [kernel-params]

 - [num] is digit number; which describes value of boot
  selection time out. It's just used as hint. Boot loader
   ignore this value.
 - [label] is a label for boot entry.
  There's no alternative entry, we can omit "label" line like;
  default=[path2] [kernel-params]
 - [path1] is a abosolute path name of initrd; which boot loader
  would look. That meanes the pathname has to begin with "/".
  And it's the 1st "/" stands for root dir of the file system which
  boot loader mount on seeking the boot loader configuration file.
 - [path2] is a abosolute path name of kernel; which boot loader
  would look, as same as [path1].
 - [rootname] is a name of root; which  bootloader would
  just pass to kernel.
 - [kernel-params] is a set of kernel parameters; which bootloader would
  just pass to kernel.


Boot loader may support other config file formats in addition to
the this /etc/kboot.conf.



== Use Cases ==

=== CASE 1: USB storage - 1 ===

If developers would intend to carry both linux environment and bootloader in
one UBS storage, this configuration would be used.

==== Partitions ====

E.g.
Pat.	FS	SZ	Flag		Label	
1st 	FAT16	512MB	Active		(don't care)
2nd	FAT32	1G	-		(don't care)
3rd 	SWAP	2GB	-		(don't care)
4th 	ext3	36.5GB	-		MOBILE_200701311130

==== On the 1st part. (FAT16) =====

This partition would have minimum set of files, which let system bootabel.
The bootloader would mount this partition to read kboot.conf, kernel and
initial ram fs.

E.g.

- Bootloader related files

/PS3/OTHEROS.BLD		-	Bootloader to be install to flash
/ETC/KBOOT.CNF		-	Boot config file
/BOOT/VMLINUX.16		-	Linux kernel
/BOOT/INITRD.16		-	initrd
/BOOT/CONFIG.216		-	config of kernel
/BOOT/SYSMAP.216		-	symbol info of kernel

KBOOT.CNF would have following content;
timeout=1
initrd=/BOOT/INITRD.16
default=/BOOT/VMLINUX.16	root=LABEL=MOBILE_200701311130


==== On the 4th part. (ext3) =====

This contains normal root fs for Linux. Bootloader won't mount this
partition.




=== CASE 2: USB storage - 2 ===

If developers would intend to use the storage entirely, they
would use this configuration.

==== Partitions ====

Pat.	FS	SZ	Flag		Label	
1st 	ext3	38GB	Active		MY_USB_ROOT_20070131
3nd 	SWAP	2GB	-		(don't care)



==== On the 1st part. (ext3) =====

This partition would have both normal linux root fs and
minimum set of files, which let system bootabel.

The bootloader would mount this partition as "ext2" and RO, to read kboot.conf,
kernel and initial ram fs. After bootloader finished, Linux would mount
this partition as root again.

E.g.

- Bootloader related files

/etc/kboot.conf			-	Boot config file
/boot/vmlinux-2.6.16		-	Linux kernel
/boot/initrd.img-2.6.16		-	initrd
/boot/config-2.6.16		-	config of kernel
/boot/System.map-2.6.16		-	symbol info of kernel

kboot.conf would have following content;
timeout=1
initrd=/boot/initrd.img-2.6.16
default=/boot/vmlinux-2.6.16 root=LABEL=MY_USB_ROOT_20070131



=== CASE 3: Optical Disc  ===

If developers would intent to deliver Linux environment to other persons,
they would use this config.

==== Partitions ====

No. partition table. The optical disc would be readable as "ISO-9660".
In the case of UDF, UDF-ISO bridge would be used.


VOLUME ID of this media, "DISTROLIVE_200701302245         "
			

==== On the media. (ISO9660) =====

This partition would have both linux root fs and
minimum set of files, which let system bootabel.
The bootloader would mount this media to read kboot.conf, kernel and
initial ram fs. After bootloader finished, Linux would mount
this partition as root again.

E.g. #1

- Bootloader related files

/PS3/OTHEROS.BLD		-	Bootloader to be install to flash
/ETC/KBOOT.CONF		-	Boot config file
/BOOT/VMLINUX.16		-	Linux kernel
/BOOT/INITRD.16		-	initrd
/BOOT/CONFIG.216		-	config of kernel
/BOOT/SYSMAP.216		-	symbol info of kernel

KBOOT.CONF would have following content;
timeout=1
initrd=/BOOT/INITRD.16
default=/BOOT/VMLINUX.16 root=LABEL="DISTROLIVE_200701302245         "

**2)
In this case, initrd is expected to handle VOLUME ID of the media as LABEL.
Unfortunately current utils like "findfs" can not handle volume ID.


E.g. #2

**3)
In this case, root fs is directly specified by device name.
This works also with kboot in PS3 Linux Distributor Starter's Kit v1.1.

- Bootloader related files

/PS3/OTHEROS.BLD		-	Bootloader to be install to flash
/ETC/KBOOT.CONF			-	Boot config file
/ISOLINUX/VMLINUXZ		-	Linux kernel
/IOSLINUX/INITRD.GZ		-	initrd

KBOOT.CONF would have following content;

default=live
timeout=10
initrd=/isolinux/initrd.gz
root=/dev/scd0
live="/isolinux/vmlinuz boot=casper"


---

Regards,
Hiroyuki

Hiroyuki.Mach at gmail.com



More information about the cbe-oss-dev mailing list