How to make a custom OS Restore CD

Posted in: Linux
By
Mar 10, 2009 - 12:53:34 PM

Q: How to make a custom OS Restore CD

 

A: Original from the sun knowledgebase;

 

BUILDING A CUSTOM OS RESTORE CD

This assumes you have access to a Linux
workstation with a CD burner.
Some/all of these steps might be
possible on a Windows box or Mac, but have not been tested
This assumes /home/osrcd is the 'working directory.' You can change
this to suit your system, but remember to make the changes in _all_
the commands listed here

QUALIFICATIONS

1. Do you have the hardware necessary to create the CD?
a. A GNU/Linux system with a CD-R drive (running a 'recent' distro)
b. 128 MB RAM is minimum (more is always better)
c. Approx 1-1.5 GB free hard disk space (enough to hold twice the
contents of the original OSRCD plus all PKGs you're adding)

2. Does your system have the necessary software (tar, mkisofs, and
cdrecord)?

3. Do the PKG file(s) you're adding to the CD operate as intended
when installed through the UI?

4. Do you have a correct version of the official Sun Cobalt OS
Restore CD for your product?

For instance, if your PKG file modifies a Sun Cobalt RaQ 4r, you must
have a copy of the official RaQ4r CD that shipped with your server.

RIP THE SUN COBALT OSRCD TO YOUR HARD DRIVE

1. Log in as 'root' on your GNU/Linux system
2. Insert the original Sun Cobalt OSRCD into your CD-ROM device
3. Mount the CD-ROM (assuming /dev/hdc):

# mount /dev/hdc /mnt/cdrom

4. Check for free disk space:

# df -h

5. Create a directory to hold the OSRCD contents (on a partition with
1-1.5GB of free space):

# mkdir /home/osrcd

6. Copy the CD-ROM contents to the new directory:

# cd /mnt/cdrom
# tar -c * | tar -C /home/osrcd -xf -

ADD YOUR PKG FILE(S)

PKG files should be named so that they appear alphabetically in the
order you wish them to be installed when doing an 'ls -l' command.
The easiest way to do this is to prepend '00' '01' '02' etc in front
of each filename.

NOTE: This causes problems on the Sausalito-based products (Qube 3,
RaQ 550, etc.), and is not recommended for use on those products.
(The 'internal' name (specified in the PKG) must match the actual
file name or the PKG will not install properly.) On Sausalito- based
products, files will be installed alphabetically by their actual file
names - please name your PKGs accordingly.

Example: I want 'my-daemon' to be installed first, then 'my-config',
then 'my-archiver'. I would do the following (in whatever directory
my PKG files are stored):

# cd /my/pkgfile/directory
# cp my-daemon.pkg 00my-daemon.pkg
# cp my-config.pkg 01my-config.pkg
# cp my-archiver.pkg 02my-archiver.pkg

1. Switch to the 'bundles' directory in
the directory you've already made:

# cd /home/osrcd/nfsroot-x86/bto-sync/bundles

2. Copy your PKG files (individually):

# cp /my/pkgfile/directory/00my-daemon.pkg .
# cp /my/pkgfile/directory/01my-config.pkg .
# cp /my/pkgfile/directory/02my-archiver.pkg .

or via wildcard (if you know you want _all_ PKG files in the
directory):

# cp /my/pkgfile/directory/*.pkg .

3. Double-check the order in which they will be installed:

# ls -l

CREATE A NEW ISO-9660 IMAGE OF THE MODIFIED CD CONTENTS

# cd /home/osrcd
# mkisofs -P YourName -b boot/eltorito.img -c boot/boot.catalog -R -l
-L -o /tmp/filename.iso .

Note: the trailing period (preceded with a space) is part of the
mkisofs command!

Note: the second switch on the second line above is a small 'L' --
not the number one!

Note: if YourName has whitespace in it, then put quotes around it
('Your Name')

This makes an ISO image of your new OSRCD, named filename.iso, in the
/tmp directory. We provide directions here how to burn the ISO to a
CD under Linux using cdrecord. You can also transfer this ISO image
(via FTP, etc) to another computer if that one has your CD burning
software/hardware already installed.

BURN YOUR NEW ISO IMAGE TO A CD

1. Insert a blank CD-R or CD-RW disk into your CD-R/CD-RW drive

2. Continuing from the above example, type this command:

# cdrecord -v /tmp/filename.iso

Note - the cdrecord command listed above assumes your CD-R drive is
properly installed and configured. You may need to specify the
driver, driver options, device, or other such options. Use 'man
cdrecord' for more info on switches, etc, you can add to the cdrecord
command.

3. Wait while the CD is burned. The time to wait is dependent on the
size of the ISO image you are burning, and the write speed of your
CD-R/CD-RW drive. Total time could be anywhere from 5 minutes to
almost an hour. By using the -v switch, you will be kept informed by
cdrecord of it's progress, etc.

4. Test the OSRCD



Visitor Comments