Hello! Based on your articles I just managed to create a solaris boot CD-ROM for the SPARC architecture. Since you may be interested in the procedure, I am sending a description to you. Comments are welcome! I hope mentioning your names and email-addresses is OK for you. If not, please tell me since I am going to post the article soon. regards Christoph Mack Howto create a solaris boot CD-ROM for the SPARC architecture This document describes the process of creating a SOLARIS 6 (SunOS 5.6) boot CD-ROM for the SPARC architecture. It is based on the following two articles: - "Burning a bootable CDRom for Solaris" by Lukas Karrer lkarrer@trash.net (http://www.trash.net/~lkarrer/solcdburn.html) - "SUMMARY: Changing the root filesystem" by Jason Youngquist jyoungqu@gpi.missouri.edu: (http://www.rrz.uni-koeln.de/RRZK/Abt-Systeme/sun/infos/ SUN-MANAGERS//1998/June-html/msg00020.html) In contrast to Lukas' approach the solution presented here is not based on the Solaris Installation CD-ROM and is not restricted by the VTOC used on this CD. Since the description is highly example-oriented it may be difficult to see the correlation of the single steps. Thus I want to begin with a short overview and list the details afterwards. OVERVIEW: The following description can be divided into 4 main steps: A.) Install the system on a harddisk as usual. B.) Migrate the installation from this harddisk to a "CD-ROM emulation harddisk" consisting of only one partition. When booting from the CD-ROM emulation harddisk its root partition shall be mounted read-only. This results in the same behaviour when booting from the CD-ROM emulation harddisk and the real CD-ROM drive. The CD-ROM emulation harddisk can be used to verify the setup without the necessity to create a CD-ROM every time something changes. In case of a boot failure from the CD-ROM emulation harddisk the system can still be booted from the original harddisk (step A) and the errors can be corrected. C.) Change some scripts and reorganize the directory structure, so that on system startup the files which SOLARIS wants to write are moved to a ramdisk (tmpfs). The main challenge is to change the /etc/rcS script so that it mounts all filesystems, creates a tmpfs and mounts it on /tmp and copies the files from a template tmp directory (/template_tmp) to /tmp. D.) Boot the system from the CD-ROM emulation harddisk and correct evental errors. E.) Create an image of the CD-ROM emulation harddisk and write it on a CD-ROM. Please note that it is neither necessary to create an ISO9660 filesystem for the CD-ROM emulation harddisk nor for the real boot CD. DETAILS: A1.) Set up the system on a hard disk as it should be written on the CD. In this description this disk is c0t2d0 with / mounted on c0t2d0s0 /usr mounted on c0t2d0s6 /export/home mounted on c0t2d0s7 To fit on a CD the installation must be smaller than 640MB. B1.) Determine which CD-ROM partition your SPARC boots from: a.) When switched into the monitor mode type ok devalias b.) Find the line associated with your CD-ROM drive. It should look similar to the following: cdrom /sbus/espdma@e,8400000/esp@e,8800000/sd@6,0:f c.) The value after the colon tells you the partition number your SPARC boots from when typing 'boot cdrom' a -> partition 0, b -> partition 1, ... , h -> partition 7 In this case the partition number is 5. B2.) Select the CD-ROM emulation harddisk and create a partition with the number determined in step B1 and a maximum size of 640MB. The new partition must start on cylinder 0! In our case the new partition shall be: c2t2d0s5 B3.) do an # ls -l /dev/dsk/c2t2d0s5 which produces something like lrwxrwxrwx 1 root other 49 Jul 7 16:33 /dev/dsk/c2t2d0s5 -> ../../devices/sbus@1f,0/QLGC,isp@1,10000/sd@2,0:f remember the /sbus@1f,0/QLGC,isp@1,10000/sd@2,0:f part as the device you want to boot from for CD emulation B4.) Create a ufs filesystem on this partition # newfs /dev/rdsk/c2t2d0s5 B5.) Mount the partition under /mnt # mount /dev/dsk/c2t2d0s5 /mnt B6.) Migrate the root partition to CD-ROM emulation disk a.) Copy the contents of the current root drive to the target drive using ufsdump and ufsrestore # (ufsdump 0f - /dev/rdsk/c0t2d0s0) | (cd /mnt; ufsrestore xf -) b.) run installboot on the CD-ROM emulation disk (man installboot(1M)) # installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk \ /dev/rdsk/c2t2d0s5 c.) edit the /mnt/etc/vfstab to reflect the changes you want to make to the disk. At least the following lines should be in the vfstab-file: fd - /dev/fd fd - no - /dev/dsk/c2t2d0s5 - / ufs 1 no ro swap - /tmp tmpfs - no - /proc - /proc proc - no - It is IMPORTANT to mount the root filesystem read-only, since the hard drive should behave like a CD-ROM drive for emulation reasons. B7.) Copy the remaining partitions from c0t2d0 to c2t2d0 using cpio: In our case the /usr and the /export/home directory is missing (see step 2): # ( cd /; find usr -print -depth | cpio -pdum /mnt ) # ( cd /; find export/home -print -depth | cpio -pdum /mnt ) C1.) Create a template directory containing the files which will be loaded on a ramdisk (tmpfs) on system startup and will thereby be writable. a.) # mkdir /mnt/template_tmp b.) move the entire var directory to /mnt/template_tmp # mv /mnt/var /mnt/template_tmp/var # ln -s /tmp/var /mnt/var c.) move the entire /etc/cron.d directory to /mnt/template_tmp/etc # mkdir /mnt/template_tmp/etc # chown root:sys /mnt/template_tmp/etc # chmod u=rwx,g=rwx,o=rx /mnt/template_tmp/etc # mv /mnt/etc/cron.d /mnt/template_tmp/etc # ln -s /tmp/etc/cron.d /mnt/etc/cron.d d.) move the entire /etc/saf directory to /mnt/template_tmp/etc # mv /mnt/etc/saf /mnt/template_tmp/etc # ln -s /tmp/etc/saf /mnt/etc/saf e.) further files: # mv /mnt/etc/device.tab /mnt/template_tmp/etc # mv /mnt/etc/dgroup.tab /mnt/template_tmp/etc # mv /mnt/etc/mnttab /mnt/template_tmp/etc # mv /mnt/etc/nodename /mnt/template_tmp/etc # mv /mnt/etc/nsswitch.conf /mnt/template_tmp/etc # mv /mnt/etc/resolv.conf /mnt/template_tmp/etc # mv /mnt/etc/syslog.pid /mnt/template_tmp/etc # mv /mnt/etc/.mnttab.lock /mnt/template_tmp/etc # ln -s /tmp/etc/device.tab /mnt/etc/device.tab # ln -s /tmp/etc/dgroup.tab /mnt/etc/dgroup.tab # ln -s /tmp/etc/mnttab /mnt/etc/mnttab # ln -s /tmp/etc/nodename /mnt/etc/nodename # ln -s /tmp/etc/nsswitch.conf /mnt/etc/nsswitch.conf # ln -s /tmp/etc/resolv.conf /mnt/etc/resolv.conf # ln -s /tmp/etc/syslog.pid /mnt/etc/syslog.pid # ln -s /tmp/etc/.mnttab.lock /mnt/etc/.mnttab.lock # ln -s /tmp/etc/.mnt.lock /mnt/etc/.mnt.lock # ln -s /tmp/.cpr_config /mnt/.cpr_config # ln -s /tmp/etc/.name_service_door /mnt/etc/.name_service_door # ln -s /tmp/etc/.syslog_door /mnt/etc/.syslog_door C2.) Disable the execution of the following rc-scripts: /mnt/etc/rc2.d/S01MOUNTFSYS /mnt/etc/rcS.d/S70buildmnttab.sh /mnt/etc/rcS.d/S50drvconfig /mnt/etc/rcS.d/S60devlinks /mnt/etc/rcS.d/S40standardmounts.sh e.g. by doing a # mv /mnt/etc/rc2.d/S01MOUNTFSYS /mnt/etc/rc2.d/NO_S01MOUNTFSYS on each of the files C3.) Edit the /mnt/etc/rc2.d/S72inetsvc file Change all instances of /etc/nsswitch.conf to /tmp/etc/nsswitch.conf /etc/nsswitch.conf.$$ to /tmp/etc/nsswitch.conf.$$ /etc/resolv.conf to /tmp/etc/resolv.conf /etc/resolv.conf.$$ to /tmp/etc/resolv.conf.$$ C4.) Edit the /mnt/etc/rcS file Insert the following lines at the begining (be careful with the marked line at the end!!!): # ----------------------- begin ------------------------ # mount tmpfs /sbin/mount -m -F tmpfs swap /tmp if [ $? -ne 0 ]; then echo "tmpfs mount failed." fi Setmnt="${Setmnt}/tmp /tmp\n" # mount proc /sbin/mount -F proc -m proc /proc if [ $? -ne 0 ]; then echo "proc mount failed." fi Setmnt="${Setmnt}/proc /proc\n" ( cd /template_tmp; find . -print -depth | \ cpio -pdm /tmp 2> /tmp/cpio.out ) echo "Configuring devices..." find devices dev -depth -print | cpio -pdum /tmp >/dev/null 2>&1 cd /tmp /usr/sbin/drvconfig -r devices -p /tmp/etc/path_to_inst cd / /usr/sbin/devlinks -r /tmp /usr/sbin/disks -r /tmp /usr/sbin/tapes -r /tmp /sbin/mount -F lofs /tmp/devices /devices Setmnt="${Setmnt}/tmp/devices /devices\n" /sbin/mount -F lofs /tmp/dev /dev Setmnt="${Setmnt}/tmp/dev /dev\n" # BE CAREFUL IN THE FOLLOWING LINE AND USE THE DEVICE DETERMINED # IN STEP B3 without the trailing ../../ !!!!!!!!!!!!! Setmnt="${Setmnt}/devices/sbus@1f,0/QLGC,isp@1,10000/sd@2,0:f /\n" Setmnt="${Setmnt}fd /dev/fd\n" echo "${Setmnt}" | /usr/sbin/setmnt # ------------------------ end ------------------------- C5.) remove everything but the /mnt/devices/pseudo subdirectory from /mnt/devices (in my case there is only a sbus@1f,0 to remove): # rm -rf /mnt/devices/sbus@1f,0 C6.) remove everything but the following from the /mnt/dev directory /mnt/dev/sad /mnt/dev/sad/admin /mnt/dev/sad/user /mnt/dev/be /mnt/dev/conslog /mnt/dev/console /mnt/dev/dsk /mnt/dev/fd /mnt/dev/hme /mnt/dev/icmp /mnt/dev/ie /mnt/dev/ip /mnt/dev/kmem /mnt/dev/ksyms /mnt/dev/le /mnt/dev/log /mnt/dev/mem /mnt/dev/null /mnt/dev/openprom /mnt/dev/pts /mnt/dev/qe /mnt/dev/rawip /mnt/dev/rdsk /mnt/dev/rmt /mnt/dev/rts /mnt/dev/stderr /mnt/dev/stdin /mnt/dev/stdout /mnt/dev/swap /mnt/dev/syscon /mnt/dev/systty /mnt/dev/tcp /mnt/dev/term /mnt/dev/ticlts /mnt/dev/ticotsord /mnt/dev/tty /mnt/dev/udp /mnt/dev/zero /mnt/dev/qfe this means (in my case): # cd /mnt/dev; rm -rf rsd* pty* tty?? tty? sd* rm sr* rsr* arp \ audio* rm bpp* c0* cdrom cu* dump es fbs ipd* isdn ts* \ ts* kbd kstat llc1 lockstat logindmux md mouse pcmcia pm \ printers profile ptmajor ptmx sound sp ticots tnfctl tnfmap \ tod volctl vx winlock wscons zsh* dsk/* rdsk/* fd/* pts/* term/* D1.) shutdown and reboot the system: # shutdown -i0 -g0 -y ok boot /sbus@1f,0/QLGC,isp@1,10000/sd@2,0:f (according to step B3) D2.) If everything works fine go on with step E1 :) else reboot from disk created in A1 mount CD-ROM emulation disk and debug :( E1.) Reboot from disk created in A1 and mount the CD-ROM emulation disk ok boot # mount /dev/dsk/c2t2d0s5 /mnt E2.) Change the /mnt/etc/vfstab file to mount the CD-ROM as the root partition. /dev/dsk/c2t2d0s5 - / ufs 1 no ro ---> /dev/dsk/c0t6d0s5 - / ufs 1 no ro E3.) Change the /mnt/etc/rcS file Setmnt="${Setmnt}/devices/sbus@1f,0/QLGC,isp@1,10000/sd@2,0:f /\n" ---> Setmnt="${Setmnt}/sbus/espdma@e,8400000/esp@e,8800000/sd@6,0:f /\n" (according to step B1) E4.) Unmount the CD-ROM emulation disk. # umount /mnt E5.) Create an image of the CD-ROM emulation disk. # dd if=/dev/rdsk/c2t2d0s5 of=//image.raw bs=1024k E6.) Write the image on a CD. Since my SPARC does not have a CD writer, I transfer the image to a Windows box and use WinOnCD to create the boot CD. The settings are: Dataformat: 2048 Mode 1 or Mode 2 Form 1 data Trackformat: CD-ROM Mode 1