Subject: Sharing /usr/src r/o among different architectures
To: None <current-users@netbsd.org>
From: None <apr@spade.apc.aip.de>
List: current-users
Date: 01/03/1999 17:37:01
Hi all,

I'm running NetBSD on two machines here. One is a Decstation 5000/200
running the pmax port and serving as a server for /usr/src for another
machine (running the i386 port). The i386 has /usr/src mounted via NFS
(readonly!) on /usr/src. I wanted it readonly especially because I
use two different machine architectures to avoid any side effects!

The mk.conf on the i386 side is:

#
# apr's mk.conf
#
UPDATE=yes
#
BSDSRCDIR=/usr/src
BSDOBJDIR=/var/obj
OBJMACHINE=yes
USR_OBJMACHINE=yes
#
USE_EGCS=yes
#
EXPORTABLE_SYSTEM=yes
#
USE_RSAREF2=NO
WARN=0


I got the procedure more or less running, but there are some problems left.

One occurs during make includes in gnu/lib/libstdc++/config:

includes ===> gnu/lib/libstdc++/config
rootme=/usr/src/gnu/lib/libstdc++/config CC="cc" CXX="c++" CONFIG_NM="nm"  /bin/sh /usr/src/gnu/lib/libstdc++/config/../../../dist/libio/gen-params LIB_VERSION=2.9.0 >_G_config.h
cannot create _G_config.h: read-only file system
*** Error code 2

Obviously it tries to write to the mounted /usr/src. Is this really the
intended behaviour?

Another story starts with make depend in gnu/lib/libg2c:

depend ===> libg2c
ln -sf /usr/src/gnu/lib/libg2c/../../dist/libf2c/libF77/F77_aloc.c F77_aloc_F.c
ln: F77_aloc_F.c: Read-only file system
*** Error code 1

Stop.
*** Error code 1

Stop.

The gnu subtree shows a lot more of these.


A third thing is in libexec/ld.aout_so. During make depend it shows:

depend ===> libexec/ld.aout_so
mkdep -a -fpic -fno-function-cse -DRTLD -DLIBC_SCCS -I/usr/src/libexec/ld.aout_s
o/../../lib/libc/include -I/usr/src/libexec/ld.aout_so/arch/i386 -I/usr/src/libe
xec/ld.aout_so /usr/src/libexec/ld.aout_so/arch/i386/mdprologue.S
/usr/bin/mkdep: cannot create .depend: read-only file system
mkdep -a -fpic -fno-function-cse -DRTLD -DLIBC_SCCS -I/usr/src/libexec/ld.aout_s
o/../../lib/libc/include -I/usr/src/libexec/ld.aout_so/arch/i386 -I/usr/src/libe
xec/ld.aout_so rtld.c malloc.c shlib.c /usr/src/libexec/ld.aout_so/arch/i386/md.
c /usr/src/libexec/ld.aout_so/../../lib/libc/stdio/vfprintf.c
/usr/bin/mkdep: cannot create .depend: read-only file system
cannot open .depend: no such file
*** Error code 2 (continuing)
`depend' not remade because of errors.

Others failing make depend in the "normal" tree are:

sbin/atactl
sbin/raidctl
sbin/wsconsctl
sbin/ldconfig
usr.bin/fgen

They seem to fall in two categories: one is a non-existant .depend, others
are connected with lex/yacc.

Will this tell me that .depend is always IN /usr/src and that this is no
problem for sharing /usr/src among different machine architectures?


BTW Is there a possibility to mount /usr/pkgsrc the same way  (readonly).
By now it creates work.pmax and work.i386 WITHIN the pkgsrc tree.
Are there any settings in mk.conf that can help?

TIA and greetings from Germany,

Andreas