Saturday, May 24, 2008

Solaris 10 and VMWare Server

It seems that to install Solaris 10 (5/08 32bit) on VMWare Server (1.0.5 32bit), XP (SP2 32bit), you probably need >512MB RAM.

My first attempt to install with 512 (the "recommended" amount of memory according to Sun) it failed and halted during "determining size requirements".

Rebooted, adjusted to 756MB RAM, passed that stage with no problems. The rest of the installation was fine.

Problem #2: After rebooting, logging in, adjusting resolution (which doesn't stick after a reboot by the way). Mount the VM drivers, run the install script, use default answers for all the prompts. Reboot. Several unattended reboots later it finally comes back up and is extremely sluggish.

Oh well, using without drivers for now, seems fine interactively.

VMWare site down for maintenance?

Irony? www.vmware.com - a company specialising in products that help you keep 100% uptime is down "for maintenance" a lot of the time I access it to license/download.

IBM DSA get to the command line

IBM Dynamic System Analysis (IBM page) is just a Linux boot CD like most of their other utilities.

They don't seem to want to give you the idea you can transfer the diagnostic log straight over the network. The log suggest dhcp is "disabled" yet one of the options from the trapped menu is to "ftp" the file to IBM support.

ctrl-c, break, ctrl-d, etc have all been trapped.

One thing they forgot to do, prevent shelling out from the viewer - if you type "view" to view the log, you can type ":!sh" to spawn a shell and do whatever you want. ifconfig shows that you've already picked up a DHCP address and you're on the network.

Monday, May 19, 2008

Installing SCO OpenServer 5.0.6 with BTLD on CD

Scope: To install OpenServer 5.0.6 onto a server with no supported floppy drive (eg. servers that use wacky new USB emulation modes that 5.0.7 supports).

Initially the idea was from Bela Lubkin's suggestion on this usenet post. The concept is to build the BTLD into the El Torito filesystem of a recreated install CD so that a separate floppy is no longer required.

I emailed Bela to clarify a couple of things which he kindly replied to and provided some great tips. He now works for VMWare so he's also provided some tips that will come in handy for that too, I'll put some of his tips at the end of this post for those interested. The core instructions will also be cross posted to Usenet for long term archival/search.

What you will need:

  • SCO OpenServer 5.0.6 installation CD. It should be legal for someone to make you a copy if you don't have one, since you will still need license codes.
  • SCO OpenServer 5.0.7 July 05 ISO from here (definitely required on the new boot disk we're creating for some newer hardware/VMWare - see notes from Bela later).
  • The geteltorito perl script.
  • The BTLD floppy or image you're expecting to require (eg. ServeRAID ipsraid, LSI lsil, etc).
  • A working SCO box to mount the floppy images.
  • A SCO or some other *ix box that has mkisofs/cdrecord to prepare the new boot image CD.
  • Any additional drivers which might be convenient to add to the SCO boot CD so you don't have to scrap together all your drivers next time you reinstall.

Generic Procedure:

  1. Extract the 5.0.6 install CD el torito image => 506bootfd.img
  2. Extract the 5.0.7 install CD el torito image => 507bootfd.img
  3. Mount the boot images and the BTLD on an OpenServer box.
  4. rm /mnt506/unix.notebook (if you don't need it and need space for BTLDs)
  5. cp /mnt507/boot /mnt506/
  6. cp -pR /mntbtld/btldname /mntbtld/install /mnt506/ (for each BTLD you want to add).
  7. Optional: edit /mnt506/etc/default/boot to set your default boot string, or add new entries as aliases for multiple BTLDs already built into the boot string.
  8. unmount 506bootfd.img (and the others if you like)
  9. mount 5.0.6 boot CD (eg to /mnt506cd for this example)
  10. mkdir /tmp/506newimg
  11. cp -pR /mnt506cd/* /tmp/506newimg
  12. cp 506bootfd.img /tmp/506newimg (506bootfd.img = the modified one we added the BTLD to).
  13. Copy any other drivers you want, to /tmp/506newimg now - eg. NIC drivers.
  14. mkisofs -r -v -l -b 506bootfd.img -o 506customcd.iso /tmp/506newimg
  15. Burn 506customcd.iso (or virtual mount if under VMWare).
  16. Boot using this CD on the new server and boot string: "defbootstr link= btld=fd(64)ipsraid". With any additional strings as required to help SCO find the root disk.
  17. Install as normal, press enter when it asks you to put the floppy with the BTLD in the drive, near the middle it will attempt to install the BTLD permanently, this will fail, follow the prompts until you get the opportunity to "(b) abort BTLD load, but continue the install" - press "b".
  18. Reboot the server, keeping the same CD in the drive to boot from it (in VMWare don't forget to go into the virtual BIOS and update the boot order if you need to - it automatically reduces the CD boot priority once the MBR is modified).
  19. At the boot prompt use the boot string: "hd(40)unix root=hd(42) link=fd(64)ipsraid Srom=wd(0,0,0,0) Sdsk=ips(0,0,0,0)" Modifying BTLD names and parameters as required.
  20. At the single user login prompt, enter the root password.
  21. mount /dev/cd0 /mnt
  22. /etc/btldinstall /mnt - follow the prompts.
  23. /etc/conf/cf.d/link_unix
  24. umount /mnt
  25. eject cd
  26. init 6
  27. Server should boot by itself!
  28. Optionally install the extra drivers from the CD once the server is back up.
  29. Start installing patches and customising your box. (Also, Acronis works well with SCO to cut an image of the hard disk - compression doesn't work as well if you don't cut an image with a relatively clean/fresh install, you can fit a base install image in under 700MB).

Detailed Procedure

1. Extract the 5.0.6 install CD el torito image => 506bootfd.img

./geteltorito.pl -o 506bootfd.img /dev/cdrom
Booting catalog starts at sector: 193114
Manufacturer of CD: SCO Product Integration
Image architecture: x86
Boot media type is: 2.88meg floppy
El Torito image starts at sector 193115 and has 5760 sector(s) of 512 Bytes
Image has been written to file "506bootfd.img".
Notes: Parts 1 and 2 were done on a Linux box, since I don't have easy access to the CD drive of a SCO box.

2. Extract the 5.0.7 install CD el torito image => 507bootfd.img

./geteltorito.pl -o 507bootfd.img /dev/cdrom
Booting catalog starts at sector: 140269
Manufacturer of CD: SCO Product Integration
Image architecture: x86
Boot media type is: 2.88meg floppy
El Torito image starts at sector 140270 and has 5760 sector(s) of 512 Bytes
Image has been written to file "507bootfd.img".

3. Mount the boot images and the BTLD on an OpenServer box.

mkdir /disks
ftp/scp/rcp images into /disks
restore:/disks >ls -l 50?bootfd.img
-rw-r--r-- 1 root sys 2949120 May 23 09:31 506bootfd.img
-rw-r--r-- 1 root sys 2949120 May 23 09:31 507bootfd.img
mkdir /mnt506 <- mount point for 506 boot image mkdir /mnt507 <- mount point for 507 boot image marry -a /disks/506bootfd.img
marry -a /disks/507bootfd.img
mount -o nolog /dev/marry/disks/506bootfd.img /mnt506
mount -o nolog /dev/marry/disks/507bootfd.img /mnt507

restore:/disks >df -Pk
Filesystem 1024-blocks Used Available Capacity Mounted on
[...]
/dev/marry/disks/5 2880 2256 624 79% /mnt506
/dev/marry/disks/5 2880 2755 125 96% /mnt507
Key information: 624KB free on the floppy image to work with, plenty of space. Not much room on the 507 image, let's see what's on the filesystems.

restore:/disks >ls -l /mnt506
total 4200
-r--r----- 2 bin bin 52961 Jul 28 2000 ahslink
-r-------- 1 bin bin 74096 Jul 28 2000 boot
drwxrwxrwx 3 bin bin 48 Jul 28 2000 etc
-r--r----- 2 bin bin 52961 Jul 28 2000 link
drwxrwxrwx 4 bin bin 64 Jul 28 2000 opt
-rw-r--r-- 1 bin bin 150810 Jul 28 2000 rootFS
-rw-r--r-- 1 bin bin 1182756 Jul 28 2000 unix
-rwxr-xr-x 1 root sys 616630 Jul 28 2000 unix.notebook


You can delete the unix.notebook kernel if you need space on the 506 disk, but I don't think you'll need to for most.

restore:/disks >ls -l /mnt507
total 5190
-r--r----- 2 bin bin 52985 May 20 2005 ahslink
-r-------- 1 bin bin 74648 May 20 2005 boot
drwxrwxrwx 3 bin bin 48 May 20 2005 etc
-r--r----- 2 bin bin 52985 May 20 2005 link
drwxrwxrwx 4 bin bin 64 May 20 2005 opt
-rw-r--r-- 1 bin bin 154182 May 20 2005 rootFS
-rw-r--r-- 1 bin bin 1652840 May 20 2005 unix
-rw-r--r-- 1 root sys 648826 May 20 2005 unix.smallmem


If you're adjusting this procedure to install a BTLD on the 507 disk you probably want to make space by deleting the >600KB unix.smallmem.








TBC

Wednesday, May 14, 2008

Installing GCC on SCO OpenServer 5.0.6


A short log of issues when configuring a GNU development environment on SCO OpenServer 5.0.6. I've had problems over the years with separate packages overwriting files from other GNU packages, so I wanted to clean up my installs and wanted to write about the problems here for others and for my future reference. This is 5.0.6 specific, though this procedure should work for 5.0.x, or any that oss646c, gnutools and a recent version of gwxlibs will install on.

My test system for this was a VMWare Server 1.0.5 virtual box so I could grab a sequence of screenshots and vm snapshots.


Invaluable SCO resources:

I had a box that no amount of installing/uninstalling gnutools/gwxlibs/oss646c in any order would result in a working gcc compiling environment, I rolled back ALL software I could see in the software manager including rs506a, then followed the procedure below and everything was back to working perfectly.

Basic steps:
  1. Base SCO install
  2. Install the linkers and libraries package from the SCO distribution media.
  3. Install any required OS patches including oss646c.
  4. Install gnutools-5.0.7Kj
  5. touch /tmp/gnutools.nocheck
  6. Install gwxlibs-2.1.0Ba (or latest gwxlibs available).
  7. Configure paths. /usr/gnu/i586-pc-sco3.2v5.0/bin to your PATH.

1. Base SCO install

Nothing special to know during the installation. Just go by all the defaults unless you know what you're doing. Install the SMP supplement from the instsall CD first, then I consider rs506a to be part of the base install so please install that before the next step. It's probably meant to be installed AFTER the Linkers and Libraries, but this is the order everyone seems to do it, so you're better off running into the same problems as everyone else when something fails to compile and you google for the error.

2. Libraries and linkers.

From the original install CD, install the package named "SCO OpenServer Linker and Application Development Libraries". On my media it is version 5.1.2A.












When it asks for the license codes, select "defer", they won't be required since we aren't using SCO's compiler.

NOTE: Don't get this package confused with the Unixware & OpenServer Development Kit that is on a separate CD to the OSR5 install disk.

3. Install your OS patches.

I install the following patches and packages in this order. At the very least you probably should install oss646c before the next step.
UDKCompat 7.1.1 (or the version you require - it's up to 8.0.2)
oss630a
oss629a
oss646c
oss631b (This one is actually upgraded by gwxlibs)
oss635a
oss636a
oss638a
oss640a
oss642a
oss643a
oss644b
oss645a
oss648a
oss650a
oss651a
oss663a

UDKCompat and oss630a can be installed with the pkgadd command. eg.

cd /tmp/OSRCompat711
pkgadd -d`pwd`/OSRCompat711 all
cd /tmp/oss630a
pkgadd -d`pwd`/oss630a all
But UDK Compat libraries 8.0.2 includes the OSRCompat UDK package as part of VOLs, so depends what version is in your SOE. We had no need to upgrade so kept it at 7.1.1.

oss629a must be installed manually since it has 2 components, using the custom software manager. This can be automated with the custom command below if you work out the sub package names in the volume.

The rest of the oss patches can be installed by changing to their directory and running this command:

custom -i -p `grep "^PROD:" VOL.000.000 |head -1 |cut -d: -f2,3` -z `pwd`


Some may prompt for an "i" to ignore the warning that some software isn't installed or is installed and will be upgraded. You can probably pipe "yes i" to the custom command to have it automatically send "i" to the prompt, or maybe there's a custom flag, I can't remember now.

Why install all these patches? Well we actually encountered quite a number of problems resolved by these patches, so all servers are brought up to the same patch level (and see note above about OSR/UDK compat patches).

To compile your own version of GCC, the GCC docs now claims you need oss631c as well, which includes a number of libraries such as zlib. From snippets I've found it seems oss631 was renamed to gwxlibs which might just confuse you more.

4. Install gnutools-5.0.7Kj

eg.
cd /tmp/gnutools-5.0.7Kj
custom -i -p `grep "^PROD:" VOL.000.000 |head -1 |cut -d: -f2,3` -z `pwd`

5. gwxlibs install fix

Type this command to prevent software manager errors which prevent gwxlibs from installing properly:

touch /tmp/gnutools.nocheck

6. Install gwxlibs-2.1.0Ba

Or the latest gwxlibs you can find.

eg.

cd /tmp/gwxlibs-2.1.0Ba
custom -i -p `grep "^PROD:" VOL.000.000 |head -1 |cut -d: -f2,3` -z `pwd`


7. Adding new bin PATH and LD_LIBRARY path

Edit ~/.profile, add paths as required. eg. (as suggested by Boyd Gerber).

[ -d /usr/local/bin -a -x /usr/local/bin ] && PATH=$PATH:/usr/local/bin
[ -d /usr/gnu/bin -a -x /usr/gnu/bin ] && PATH=$PATH:/usr/gnu/bin

PATH=$PATH:$HOME/bin:. # set command search path
export PATH

[ -d /usr/local/lib -a -x /usr/local/lib ] && LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
[ -d /usr/gnu/lib -a -x /usr/gnu/lib ] && LD_LIBRARY_PATH=/usr/gnu/lib:$LD_LIBRARY_PATH

[ -d /usr/X11R6/lib -a -x /usr/X11R6/lib ] && LD_LIBRARY_PATH=/usr/X11R6/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

I'ts possible you may need to add /usr/gnu/i586-pc-sco3.2v5.0/bin to your path also, unless it was a shell bug that didn't pick up the correct directories.


Testing time


1. Let's whip up a hello.c.


2. Let's compile it!

# gcc -o hello hello.c
#
hello.c: In function `main':
hello.c:3: warning: return type of `main' is not `int'
#

Never mind the warning, teehee.

3. And finally, will it execute?

# ./hello
Hello World!



4. Now a basic package that needs to be built with make. Downloaded GNU Barcode, ran ./configure, make. No errors and nice "barcode" and "sample" binaries created. Looks like a nice working environment.

Known Compiling Issues

  • The Korn shell, while reasonably good, doesn't like some build scripts (eg. GNU GCC definitely requires and recommends BASH).
  • MAXPATHLEN doesn't seem to be defined in system headers according to a few packages I built.