Article Sidebar may2004.tar

Changes to setup_chroot.sh for Solaris 9

A few minor fixes are needed for 3.9 release of the setup_chroot.sh for Solaris 9. These changes have been provided to Joe, and are likely to be incorporated in the next scponly release, and may already be fixed by the time you read this. Additionally, the 3.9 modified setup_chroot.sh script may be downloaded from rd1.net/sysadminmag/setup_chroot.sh.txt.

1. Added single quotes around ^cd$ on the BINARIES= line 53. The Solaris /bin/sh didn't pass these as an argument, and grep would give a usage error without the quotes.

2. Replaced echo with /usr/local/bin/echo on lines with -e option (lines 7, 17, 22, 30, 33, 34). I had /usr/local/bin first in my path, but Solaris /bin/sh is using a built-in echo. The echo program is included with the GNU core or shell utilities.

3. The output of ldd started with tabs rather than a space, so I changed the grep in LIB_LIST= line 69 to look for lines beginning with a [space or tab]:

.  /usr/local/bin/grep "^[     ]"
I needed to add the file /usr/lib/ld.so.1.

Solaris 9 has two ld.so files that are different:

# ls -ali /usr/lib/ld.so*
   1396 -rwxr-xr-x  1  root  bin   24576  Nov 13 2002 /usr/lib/ld.so
   1397 -rwxr-xr-x  1  root  bin  184040  Nov 13 2002 /usr/lib/ld.so.1
and /lib is linked to /usr/lib as well.

Of the four possible paths, only the /usr/lib/ld.so.1 file was required in the chrooted directory.