So you know the drill, someone wants to do something with Solaris, and they’ve already installed the OS, and done a bunch of customization and whatnot, now they call up all in a panic as they copy in a binary distribution of GCC, but they can’t compile anything because they are missing values-Xa.o , or worse just about everything from the development tools.
Well I’m not sure about ancient Qemu, but 2.2 can mount the CD-ROM’s post install! … manually.
The poor guy didn’t want to re-install, but one option was to boot up the CD in single user mode, mount his disk, and copy the /cdrom path onto some partition so he could then install the packages as needed, and even better have the whole tree ready if need be.
But the better thing is to just mount the CD, install the package and be done with it right?
I’ve only tested this with Solaris 2.6…
While booting up single user mode from the CD (boot disk2:d -s) I noticed this line in the mount table:
/cdrom (/devices/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@2,0:a): 0 blocks 0 files
So I thought I’d try to mount that once the copy was done. The first thing I did was make a symbolic link as that name is a little hard to type, and I didn’t want to remember that path after this day.
ln -s /devices/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@2,0:a jr0
this gives me a /dev/jr0 linking to where the Solaris 2.6 install path was.
# mount -oro /dev/jr0 /mnt
mount: /dev/jr0 is not this fstype.
Well that was disappointing. Could I even read the CD?
# head -1 /dev/jr0
CD-ROM Disc for SunOS Solaris Installation
Ok, so it must be the file-system type. The ‘bootable’ partition on the CD contains a SYSV filesystem, as it’s a “live CD”..
mount -o ro /dev/dsk/c0t2d0s1 /mnt
# ls /mnt
a dev kernel opt reconfigure usr
bin devices lib platform sbin var
cdrom etc mnt proc tmp
You can even fsck it!
# fsck /dev/dsk/c0t2d0s1
** /dev/dsk/c0t2d0s1 (NO WRITE)
** Last Mounted on /tmp/MntDev.12554
** Phase 1 – Check Blocks and Sizes
** Phase 2 – Check Pathnames
** Phase 3 – Check Connectivity
** Phase 4 – Check Reference Counts
** Phase 5 – Check Cyl groups
2445 files, 19114 used, 4873 free (17 frags, 1214 blocks, 0.0% fragmentation)
But the part of the CD-ROM that we want, with all the packages uses a different file-system, and with a bit of hunting I found the right string:
mount -F hsfs -r /dev/jr0 /cdrom
Now we can manually add in the missing packages!
# mount -F hsfs -r /dev/jr0 /cdrom
# ls /cdrom
We just have to point the pkgadd command to where the CD-ROM is mounted. In my case I just had to type in:
pkgadd -d /cdrom/Solaris_2.6/Product/
And then I got the “interactive” mode showing off all 471 packages. Don’t just slam the enter key or you’ll start installing everything. Hit control-d and then we can manually add them in.
<RETURN> for more choices, <CTRL-D> to stop display:^D
Select package(s) you wish to process (or ‘all’ to process
all packages). (default: all) [?,??,q]:
And in this case, the packages I wanted were:
With those installed, now I can see the object files I wanted:
# find / -name ‘*.o’ -print
Wasn’t that great? Nobody had to re-install, no disk space is wasted, and now if other packages are needed, it’ll be easy to add them.