Issues and methods stated in this article are outdated. Reading it may still help understand the problems.
You might want to check out the PDF from Sun Blueprints for a much easier way of doing things these days.
http://www.sun.com/software/solutions/blueprints/0301/BuildBoot.pdf
I have been trying to customize a Solaris install CDROM to my own needs. After several searches without any usable results, I ran into some really good explanations on this topic on the SunManagers Mailinglist Archive.
The work of Victoria Lau (vlau@msmail2.hac.com) 'Log file to customize the Solaris 2.5 boot cdrom' and a paper of James Hutchinson (lsharp@taz.hutch.org) 'Summary: How to build a Solaris bootable CDROM' helped alot, but these documents are Solaris 2.5 specific. Sun changed the CD-Layout from 2.5 to 2.6 :=)
In this document, I will explain how the Sun boots off the CDROM and how this CDROM could be customized to fit someones needs. This paper refers to the Solaris 2.6 HW 5/98 CDROM. The new Solaris 2.7 CDROM seems to share the same layout.
This document is structured in several sections:
1. Introduction to the Sun CDROM layout
2. How is the machine booting off the CDROM and where does the installation begin.
3. Altering the CDROM
3.1 The VTOC explained
3.2 Two possible methods for changing the CD
4. Testing your future, bootable CDROM
Last, why am I doing this? I would like to be able to install a standalone system without human interaction. For example for a firewall, my clients should be able to buy the recommended hardware (Sun Ultra10 with additional Ethernet port) , shove in my customized CD, plug in the LAN and WAN, type boot cdrom. No more, No less! The installation includes Operating System with Patches, Eagle Firewall with Patches and configuration, and a couple of custom scripts, which lets me administrate the system.
Please send me your comments, suggestions etc. You can reach me at lkarrer@trash.net
Good luck in burning your own bootable CD's
Lukas Karrer
There are 5 slices on the CDROM.
The exact layout can be found in the VTOC of the CDROM:
# prtvtoc /dev/dsk/c0t6d0s2
Attention: This command can only be issued when vold is not running! Eject the CDROM, kill vold, reinsert the CDROM!
When issuing the boot cdrom command from the boot promt the system loads its specific bootblock and gets redirected to slice 1 to start loading the kernel. The system comes up into Single User Mode.
Since there is only a minimal /usr on slice 1, the OS mounts a full /usr from slice 0 over the previous minimal /usr.
This can be found in /cdrom/cdrom1/s0/Solaris_2.6/Tools/Boot/usr
The system comes up and starts the shell script /sbin/suninstal. Suninstall does:
As I understand, there is no difference in doing a JumpStart installation over the net or doing the installation from CD.
So far you might ask yourself, what are the difficulties in burning a custom CD.
The problem lies in the VTOC! When booting off CDROM, the boot prom checks the VTOC. This is the 'Table of Contents' which is located in the first cylinder (512 Bytes) of slice 0. The partition map of the CDROM is specified in the VTOC together with a checksum. Whenever changing the partition layout, the Sun system WILL NOT BOOT OFF THIS CDROM ANYMORE. So far I do not know of any tool to create a new VTOC. Hints for this are very welcome.
A second problem is the ufs format. Slice 1 to 5 MUST be in ufs format. The ufs format is bound to the disk geometry which is different on CD and your harddrive.
At first we look at the layout of the CDROM. Remember: To print the VTOC, vold MUST NOT be running and the CDROM MUST be unmounted!
# prtvtoc /dev/dsk/c0t6d0s2 * /dev/dsk/c0t6d0s2 partition map * * Dimensions: * 512 bytes/sector * 640 sectors/track * 1 tracks/cylinder * 640 sectors/cylinder * 2048 cylinders * 2048 accessible cylinders * * Flags: * 1: unmountable * 10: read-only * * Unallocated space: * First Sector Last * Sector Count Sector * 1088000 3200 1091199 * 1100800 209920 1310719 * * First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory 0 4 10 0 984960 984959 1 2 10 984960 103040 1087999 2 0 00 1088000 3200 1091199 3 0 00 1091200 3200 1094399 4 0 00 1094400 3200 1097599 5 0 00 1097600 3200 1100799 #
The size of the partitions can be calculated by multiplying the Count field by 512 eg:
Slice 0: 984960 sectors * 512 bytes / sector = 504299520 Bytes = 481 MB
WE ARE ABSOLUTELY BOUND TO THIS PARTITION MAP! The 110MB of unallocated space CANNOT be used.
Whatever we change, WE MUST STAY IN THE VTOC SPECIFIED RANGE
I have two suggestions how to customize the CD. First, a simple and dirty one, mentioned in the 'Summary: How to build a Solaris bootable CDROM' then a more elaborate one.
Note: Most of this text is copied from the mentioned document. I only changed the procedure accomodated for the 2.6 changes and provided some deeper explanations to the needed steps.
dd if=/dev/dsk/c0t6d0s1 of=/dev/rdsk/c0t1d0s1 bs=512
fsck /dev/rdsk/c0t1d0s1
mount /dev/dsk/c0t1d0s1 /s1
vi /s1/sbin/sysconfig
sync; sync; sync; umount /s1 dd if=/dev/rdsk/c0t1d0s1 of=cdrom.s1 bs=512 count=5240
5240 is the number of blocks which dd reported before
Additional note: The pad file is needed in order to keep the starting block number of the slices aligned to the number stated in VTOC
Since the available size is limited to about 300 Megs, I have thought about other possibilities. Further I would like to install the OS off the virgin files provided on the CD. I do not want to use an image. Since I want no human interaction, the Sun HW should have two CDROM players. This costs additional 200$ but we have max convenience. Note: It could also be done with somebody changing CD's inbetween the installation process.
The main problem is changing the /sbin/suninstall file on the CDROM to accomodate my changes. This file lies on slice 1 of the CD. The changes are that severe that they cannot be made using a binary editor and changing a few lines in this file. I am still working on getting the whole procedure to run as I want to. Therefore the noted changes are ideas and NOT tested out yet!!!
change suninstall to load a config file off diskette, use this as config for pfinstall to install the machine.
reboot the machine
start application installation off second CDROM
reboot and finish up
The problem lies in changing the suninstall file. Here is what I did (Analog to the document from Victoria Lau):
Catherine Baley Catherine.Baley@matranortel.com mentioned a neat possibility to test the CD before burning!
Copy the 6 partitions to a disk. (all the partitions can be ufs, even s0)
Then boot on this disk:
ok boot disk1:d (d sun4m)
Eric Negaard has put together some shell scripts, which help with the burning process.
Here you will find :
Jan Stevens has some other ideas to reach the same goal.
Daniel Solero mentions a tool CDTK which can recreate the slice map, vtoc, etc.
Christoph Stevens submitted a totally different procedure ito burn bootable CD's This document describes how to create a bootable cd from an existing (running) machine.
Mari Donkers describes a procedure to extend the partition table of a Solaris 2.6 hw 5/98 CD-ROM here
Jürg Schilly, the developer of cdrecord notes:
Paragraph 3 is wrong:
"Out of boredom" Ignatios Souvatzis analyzed the format of
bootable CDs a while ago
Results can be found in the "mksunbootcd" program in NetBSD. See /usr/src/distrib/utils/mksunbootcd (accessible via
http://cvsweb.netbsd.org/