Lund Sponsor Message

Back to News Page
January 1999
How to Make Posix Work on MPE/iX 5.5


By Michael D. Hensley
and readers of 3000-L

This article contains almost everything you need to know to get Posix properly configured and working on HP 3000s under MPE/iX 5.5. A lot of this was stolen from 3000-L newsgroup posters. I tried to give credit where due — but I’m willing to take the blame for any errors. Use at your own risk, batteries not included.

Commands preceded by a “:” should be typed at the MPE/iX prompt; commands preceded by a “$” should be typed in the Posix shell. Restoring HFS files, correcting file permissions and fixing up your etc/profile file are all fixed with the 6.0 version of MPE/iX. I’m also including suggested changes to vi arrow keys and modifying HPPATH — which aren’t technically fixes but make Posix easier to use on HP 3000s.

Restore the HP-supplied
HFS files, if missing

[This tip was supplied by John Dunlop]

Some sites are completely missing all of the HFS files (this is usually caused by an “incorrect” reload). From the MPE CI, try “:LISTFILE /bin/”; if no files are found, you will need to restore them from the FOS tape.

1. Restore the following from the FOS tape:
restore *t;,i0036431.usl.sys;create;show

2. :STREAM I0036431.USL.SYS

3. After I0036431 finishes,

All of the HP-supplied HFS files will be restored, and the directory structure and permissions set to the defaults.

Note: if you just want to restore all HFS files on a backup tape, try “:RESTORE /-@.@.@;SHOW;KEEP;OLDDATE;CREATE”. [Thanks to Gilles Schipper for this last item.]

Incorrect file permissions

The file permissions are wrong on a lot of files. The first thing you will probably run into is the message

Unknown terminal “hp2392a”

in response to various commands (tput, tabs, vi...). To fix this, log on with SM capability and do:

$ chmod -R 555 /usr/lib/terminfo

More incorrect file permissions

There are still more permissions to fix, like /usr/man for non-SM users. Here is a workaround that can be used to fix up those odd 5.5 permissions [Thanks to Lars Appel of HP for this!].

1. Restore from the FOS tape. (This file will be used just to get a list of the files which we need to modify).

2. :tobyte.hpbin.sys “ /tmp/tarfile”


shell/iX> for file in `tar tvf /tmp/tarfile 2>/dev/null |
> grep -v ‘^d’ | cut -c 57- `
> do
> chmod 444 $file
> done
shell/iX> exit

The quote mark which precedes tar and follows 57- in the above command is the “backward” quote usually found as the top-left key on a keyboard, and those surrounding the ^d are normal single quotes.

4. :purge /tmp/tarfile

Fix up your /etc/profile file

Finally, fix up your /etc/profile file which gets executed automatically whenever anyone invokes the shell [much of the following comes from Jeff Kell]:

All of this is fixed (and even improved) in MPE/iX 6.0. If you implement the changes as shown, and put any additional local customizations you like in /etc/profile.local, then after the installation of MPE/iX 6.0 overwrites your /etc/profile, it will still continue to work!

If you don’t own Robelle’s QEdit (why not?), I hope you can use ‘vi’ to edit bytestream files (if not, that’s an experience in itself).

Figure 1 below shows the revised /etc/profile, suitable for cut-and-pasting into your favorite text editor. I have posted notes on the changes at our Web site, at txt.

export PATH=/usr/local/bin:/bin
# (Change #1)
export MANPATH=${MANPATH:-/usr/local/man:/usr/man:}
# (Change #7)
export PS1='shell/iX> '
# (Change #2)
export TERM=${TERM:-hp2392a}
# (Change #3)

export ENV=$HOME/.environ
export LOGNAME=`logname`
export TZ=${TZ:-EST5EDT}
export MAILPATH=/usr/mail/$LOGNAME
export MAILCHECK=180
if [ "$HPHGROUP" = "" ] ; then
#export HOME=$PWD
if [ "$HPHGROUP" = "" ] ; then
# (Change #8)

alias -x copy="callci copy"
alias -x listf="callci listfile"
alias -x listgroup="callci listgroup"
alias -x listuser="callci listuser"
alias -x df="callci discfree d"
alias -x ll="ls -l"
# (Change #5)

#tput clear
cat /etc/motd
# (Change #6)

umask 7
set -o ignoreeof
# (Change #8)

if [ -r /etc/profile.local ] ; then
. /etc/profile.local
# (Change #9)

The idea is that starting with MPE/iX 6.0, you shouldn’t make changes to /etc/profile anymore; instead, put your local customizations into the file /etc/profile.local. This way, HP can replace /etc/profile without wiping out your local customizations!

Arrow keys in vi

Ok, now how about those pesky arrow keys in vi? [I stole this answer from Danny A. van Delft]

Create a file named .exrc, which contains the following:

:map ^V^[U ^V^F
:map ^V^[V ^V^B
:map ^V^[B j
:map ^V^[A k
:map ^V^[C l
:map ^V^[D h
:map ^V^[h 1G
:map ^V^[F G
:map ^V^[Q i
:map ^V^[P x

Note that ^V stands for <CTRL>V and ^[ for <ESC>, all literal. You need the ^V to tell ex that the next character should taken literally, not interpreted. (And the leading “:” has nothing to do with MPE here.)

Modify your HPPATH

You should add “HPBIN.SYS” to your path:

:SETVAR HPPATH=HPPATH+”,HPBIN.SYS” (You need to add this to your OPTION LOGON UDC.) Also, optionally you can


for a few handy UDCs.

Getting a head start

Starting with MPE/iX 6.0, the last thing /etc/profile does is call /etc/profile.local; this is where you should now put your local customizations.You should not modify /etc/profile, because it will be overwritten by future version.

Figure 2 below is a full copy of the MPE/iX 6.0 /etc/profile file.

export PS1='$PWD $ '
# (see Change #2 note)

# No need to set TZ; we do a :SETVAR TZ "PST8PDT" in a system-wide
# OPTION LOGON UDC and the shell picks it up automagically.

alias qedit="/ROBELLE/PUB/QEDIT"
alias lclint="/usr/local/bin/lclint"

# 97/08/22 mdh added for GNU
#alias -x make="/usr/local/bin/make"
#export CC=gcc
#export MAKE=/usr/local/bin/make

# 97/09/24 mdh added for JAVA
export SYSNAME="hp3000"
export MANPATH="/usr/man:/usr/contrib/man:/usr/local/man"
export PATH=$PATH:/usr/local/java/latest/bin
export THREADS_FLAG=green
export CLASSPATH=.:/usr/local/java/latest/lib/
export LD_LIBRARY_PATH=/usr/local/java/latest/lib/PA RISC/green_threads

Move your local customizations to /etc/profile.local, and replace your /etc/profile with the new one now, and you’ll be much happier when you upgrade to 6.0.

Congratulations to HP, by the way: This is a very elegant design.

With these fixes and changes, Posix is ready to use under MPE/iX 5.5. So go pick up copies of GNU C++, Perl, Python and Java from the HP Jazz Web server or the Interex FREEWARE tape, and have fun!

Michael Hensley is a developer with Allegro Consultants and creator of the FREEWARE tape of free utilities and programs for HP 3000s.

Copyright 3000 NewsWire, all rights reserved