Wednesday June 07, 2006
Solaris GRUB Enhancements This is a summary of enhancements for GRUB shipped with Solaris.
Solaris VTOC
The fdisk id's for Solaris partition are 130 and 191. 130 is the old
tag, which also happens to conflict with Linux swap parition, so 191
is used starting from Solaris 10. GRUB is enhanced to understand
both id's.
Within the Solaris fdisk partition, the disk is further divided into
16 slices and the table (VTOC) is located on the 2nd and 3rd sector
(1st sector contains parition boot program). The table format is
described by:
struct dk_vtoc {
uint32_t v_bootinfo[3]; /* info for mboot (unsupported) */
uint32_t v_sanity; /* to verify vtoc sanity */
uint32_t v_version; /* layout version */
char v_volume[8]; /* volume name */
uint16_t v_sectorsz; /* sector size in bytes */
uint16_t v_nparts; /* number of partitions */
uint32_t v_reserved[10]; /* free space */
struct dkl_partition v_part[16]; /* partition headers */
time32_t timestamp[16]; /* partition timestamp (unsupported) */
char v_asciilabel[128]; /* for compatibility */
};
Each partition entry is described by
struct dkl_partition {
uint16_t p_tag; /* ID tag of partition */
uint16_t p_flag; /* permision flags */
daddr32_t p_start; /* start sector no of partition */
int32_t p_size; /* # of blocks in partition */
};
Following the BSD slice naming convention, Solaris partitions are
named a, b, c, etc. For details, see source code
pc_slice.h and
disk_io.c .
struct sol_netinfo {
uint8_t sn_infotype;
uint8_t sn_mactype;
uint8_t sn_maclen;
uint8_t sn_padding;
unsigned long sn_ciaddr;
unsigned long sn_siaddr;
unsigned long sn_giaddr;
unsigned long sn_netmask;
uint8_t sn_macaddr[1];
}
The information allows the Solaris kernel to configure network
interface for installing over the network as well as running
as diskless clients.