Subject: Re: read only /usr/src & build.sh
To: None <netbsd-help@netbsd.org>
From: Jan Danielsson <jan.m.danielsson@gmail.com>
List: netbsd-help
Date: 11/10/2007 11:47:52
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Aleksey Cheusov wrote:
> Is it really possible to build NetBSD with read only /usr/src?
> Whatever build.sh options or mk.conf variables I tried to use,
> build.sh always tries to write to /usr/src
>
>
> Always set variables:
> MKUNPRIVED= yes
> TOOLDIR= /usr/obj/tools
> DESTDIR= /usr/obj/destdir
> RELEASEDIR= /usr/obj/release
> X11SRCDIR= /usr/xsrc
If you're doing that a lot in different places, you can use something
like this:
- --[prep_build_env.sh]--------------------------
#!/bin/sh
ARCH=`uname -m`
BASE=`pwd`
if [ $# -gt 0 ] ; then
ARCH=$1
fi
export TOOLDIR=$BASE/tools
export DESTDIR=$BASE/dest.$ARCH
export RELEASEDIR=$BASE/release
export MAKEOBJDIRPREFIX=$BASE/obj.$ARCH
if ! [ -d $TOOLDIR ] ; then
mkdir -p $TOOLDIR
fi
if ! [ -d $DESTDIR ] ; then
mkdir -p $DESTDIR
fi
if ! [ -d $RELEASEDIR ] ; then
mkdir -p $RELEASEDIR
fi
if ! [ -d $MAKEOBJDIRPREFIX ] ; then
mkdir -p $MAKEOBJDIRPREFIX
fi
- --[prep_build_env.sh]--------------------------
Go to the directory you want the build to end up in, and type:
$ . prep_build_env.sh
Now run build.sh as usual.
- --
Kind regards,
Jan Danielsson
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (NetBSD)
iD8DBQFHNYxYuPlHKFfKXTYRCgpNAJoDAeM+MrNH9MsjXn9DnVEdelLszQCfZnm1
FbE0Wqa2ztd0SulroSuAGzE=
=pe2W
-----END PGP SIGNATURE-----