Subject: Re: read only /usr/src & build.sh
To: None <netbsd-help@NetBSD.org>
From: Aleksey Cheusov <cheusov@tut.by>
List: netbsd-help
Date: 11/10/2007 14:45:03
> Aleksey Cheusov --> netbsd-help (2007-11-10 12:30:10 +0200):
 >> Is it really possible to build NetBSD with read only /usr/src?

> Yes. When building e.g. a release using build.sh, you need to specify
> either -O or -M, and all of -T, -D and -R. Of course their arguments
> should be paths to writable directories.

When I add -U flag it doesn't work.

mk.conf is empty (only ifdef'ed pkgsrc code is there)

0 src>rm -rf /tmp/obj
0 src>./build.sh -U -O /tmp/obj -T /tmp/obj/tools tools 
===> build.sh command: ./build.sh -U -O /tmp/obj -T /tmp/obj/tools tools
===> build.sh started: Sat Nov 10 14:40:19 EET 2007
===> NetBSD version:   4.0_RC4
===> MACHINE:          i386
===> MACHINE_ARCH:     i386
===> Build platform:   NetBSD 4.0_RC3 i386
===> HOST_SH:          /bin/sh
===> No /tmp/obj/tools/bin/nbmake, needs building.
===> Bootstrapping nbmake
...
...
rm -f .depend ialloc.d scheck.d zic.d /srv/src/tools/zic/tags 
cleandir ===> groff
rm -r -f .*_done build
rm -f a.out [Ee]rrs mklog core *.core     man.local-s mdoc.local-s
rm -f PREVIOUSTOOLDIR
cat: PREVIOUSTOOLDIR: No such file or directory
nbmake: "/srv/src/tools/Makefile" line 124: warning: "cat PREVIOUSTOOLDIR" returned non-zero status
echo /tmp/obj/tools >PREVIOUSTOOLDIR
dependall ===> host-mkdep
install ===> host-mkdep
mkdir -p /tmp/obj/tools/bin
cp host-mkdep /tmp/obj/tools/bin/nbhost-mkdep
cp: host-mkdep: No such file or directory

*** Failed target:  /tmp/obj/tools/bin/nbhost-mkdep
*** Failed command: cp host-mkdep /tmp/obj/tools/bin/nbhost-mkdep
*** Error code 1

Stop.
nbmake: stopped in /srv/src/tools/host-mkdep

*** Failed target:  install-host-mkdep
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/srv/src/tools" ;; *) this="${dir}/"; real="/srv/src/tools/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /tmp/obj/tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget host-mkdep install
*** Error code 1

Stop.
nbmake: stopped in /srv/src/tools

ERROR: Failed to make dependall tools
*** BUILD ABORTED ***
1 src>

-- 
Best regards, Aleksey Cheusov.