File: CDROM.HOWTO

package info (click to toggle)
silo 0.8.5-2.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,016 kB
  • ctags: 2,061
  • sloc: ansic: 10,060; asm: 2,319; makefile: 351; perl: 74; sh: 3
file content (170 lines) | stat: -rw-r--r-- 7,387 bytes parent folder | download
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
		HOW TO MAKE A SPARC BOOTABLE CDROM

SILO may be used to create a bootable CDROM for sparc. At the moment it will
support booting on sun4c, sun4m, sun4d and sun4u machines only, but sun4
support may come soon.

INTRO
=====

A CDROM is booted on Sparc by issuing following commands in the PROM
(depending on PROM version - v0 is PROM with major versions 0, found
on sun4c only, v2 is PROM with major versions 2 or 3, found on some newer
sun4c and all sun4m and sun4d machines) and the same applies to P1275 PROMs
found in the 64bit UltraSparc machines:

v0:

b sd(0,6,0)

v2:

boot cdrom

(cdrom is actually alias to /iommu/sbus/espdma/esp/sd@0,6:d or something
similar)

As Solaris has different kernels for each architecture, the PROM boots by
default from different "partitions" on the CD depending on the architecture
of the machine (that's e.g. the :d in the cdrom alias on v2 PROM). That
partition table is stored in the first 512 bytes of the CD (with exactly the
same format as partition tables on Sparc disks), so you can use SparcLinux
fdisk program to look into that partition table. As SparcLinux at the moment
uses one kernel image for all the architectures and if in the future the
need of different kernel images arises, SILO will have other means of
supporting it, SparcLinux bootable CDROMs have a partition table with only
one partition which covers the whole iso9660 image of the CD. Other
partitions are set up, so that they start at offset 0 (like the first one)
and have size of 0, ie. are disabled. The only value PROM looks at is
starting offset, so that it will boot on all machines correctly.
In the boot process PROM finds start of the boot partition (in SILO case it
is always 0) and loads 7680 bytes from offset 512 in that partition.
Fortunately iso9660 has first 32KB reserved for OS use, so that the
partition table and bootblock can be safely stored there. As SILO is longer
in size than those 32KB (eventhough it is compressed), it puts its first
stage loader in there and puts its second stage loader somewhere in the
iso9660 filesystem.

That's why the procedure is actually so complicated. You need first to put
all the files which will be stored in the iso9660 filesystem in some tree,
run mkisofs or you favourite user interface to it and then let SILO do some
magic on the raw iso9660 image.
Because SILO doesn't understand iso9660 format yet (it understands ext2fs
and ufs only), it will create a list of block starts for each image you'd
like to load from the CD (either executable, like kernel, or some message
text, or initial ramdisk image, etc.).

STEP BY STEP
============

You should first prepare the tree you'd like to have on the CD. The only
requirement is that you put boot/* files from SILO distribution into /boot
in the tree, edit appropriate /etc/silo.conf in the tree and maybe also put
sbin/silo into /sbin/silo in the tree, so that users use same version of
SILO as is the CD made with.

To edit /etc/silo.conf in the tree, you should know which files you'd like
SILO at runtime to load from the CD. This includes executable images (like
Linux kernel), messages (for use with message= option in silo.conf - these
messages are displayed when SILO comes up), initial ramdisk images. Note
that images which the user has on disks will SILO still be able to load, so
you shouldn't put them in the list. You should put those names in a list and
assign them numbers from 1 to 30. Let's say you will need to load following
files during run-time:

/boot/vmlinux-2.0.24.gz
/etc/welcome.msg
/boot/initial.ramdisk.gz
/boot/vmlinux-2.1.6.gz
/boot/vmlinux-2.1.30.gz

You assign them numbers like this:

!cd1 /boot/vmlinux-2.0.24.gz
!cd2 /etc/welcome.msg
!cd3 /boot/initial.ramdisk.gz
!cd4 /boot/vmlinux-2.1.6.gz
!cd5 /boot/vmlinux-2.1.30.gz

(the !cd is a prefix, as !cd1 to !cd30 you refer to the particular files in
silo.conf).
Now you edit the silo.conf file according to your needs. The only difference
between usual on-disk silo.conf and silo.conf on the cd is that you replace
all the paths to files on the CD (and their prom disk paths) with the !cdX
notation. Files you'd like to load with the on-CD SILO from user's disks
should keep the format dependent on the PROM version of the machine, but it
is usually not wise idea to put it on the CD, as the location of user's
disks differs from machine to machine and you cannot use the default boot-on
disk, as the boot-on disk is the CD, so you don't know which disk will be
root for the user. If the user wants, he'll still be able to use the SILO
command line.

Here is an example how such silo.conf may look like:

message=!cd2
image=!cd1
	label=stable
	alias=2.0.24
	initrd=!cd3
image=!cd4
	label=old
image=!cd5
	label=current
	alias=2.1.30

For exact format of silo.conf consult SILO.CONF.HOWTO.

Next step is to make the iso9660 filesystem (either on a raw partition, such
as /dev/sdb1, or into a file (e.g. ~/sparcbootable.iso). How to do this is
outside the scope of this document, there are many programs which can do it.
I'm for instance using CDW tools, which is a shell + dialog interface to
mkisofs and related programs.

Following step can be done on Linux/Sparc or Linux/i386 machines only. If
you have the iso9660 raw image in a file, the kernel should support the
loopback device and you should have losetup utility somewhere available.
You should then mount the iso9660 image somewhere and run either sbin/silo 
(on Linux/Sparc) or misc/intelsilo (on Linux/i[3456]86) with the
following arguments:
-r /mount_point_of_iso9660_image -c /raw_iso9660_image 
-l comma,separated,list,of,files,you,used,in,silo,conf,as,!cdX,from,1,to,last,number,used
You may also use other flags, see silo -?

Examples for the above shown list of SILO loadable files and with iso9660
raw image on raw partition /dev/sdb1:

/sbin/mount /dev/sdb1 /mnt
sbin/silo -r /mnt -c /dev/sdb1 -l /boot/vmlinux-2.0.24.gz,/etc/welcome.msg,/boot/initial.ramdisk.gz,/boot/vmlinux-2.1.6.gz,/boot/vmlinux-2.1.30.gz
/sbin/umount /mnt

The same for iso9660 image on ~/sparcbootable.iso

/sbin/losetup /dev/loop0 ~/sparcbootable.iso
/sbin/mount /dev/loop0 /mnt
sbin/silo -r /mnt -c ~/sparcbootable.iso -l /boot/vmlinux-2.0.24.gz,/etc/welcome.msg,/boot/initial.ramdisk.gz,/boot/vmlinux-2.1.6.gz,/boot/vmlinux-2.1.30.gz
/sbin/umount /mnt
/sbin/losetup -d /dev/loop0

(replace sbin/silo with misc/intelsilo on Linux/i[3456]86).
This step does following steps:
It sets up the partition table in the first 512 bytes of the image.
It puts the first stage boot loader starting from offset 512 in the image.
It puts offset to /boot/second.b in 512B chunks into the first stage loader
and sets up internal first stage loader variables.
It fills first 2048 bytes of /boot/second.b with the table of second.b
sectors (again, in 512B chunks).
It sets up a table in second.b, which is at run-time used to translate !cdX
names into CD blocks and file sizes.

(note: if you want to see the changes in second.b, you have to umount it and
mount it again, as silo writes to the raw image, iso9660 is read-only, so it
doesn't reread it correctly).

SILO doesn't change the size of the image, so that isosize on the iso raw
image file before and after silo magic will tell you the same number.

Now is the time to burn the CD and then cross your fingers and see what
happens.

If you have any problems, mail jj@sunsite.mff.cuni.cz