Discussion:
build kernel from source
bycn82
2014-09-21 00:08:27 UTC
Permalink
Hi All,

Help, I am just download the source from CVS using this command `cvs
checkout -A -P src`,
so it should be current development version, But I met two issues.

I am new here:) please help.
_*
Tr*__*y to build kernel from source *_

*Command**:*
cd /usr/src; ./build.sh -O /usr/obj -U -j 8 tools kernel=NB6 modules
distribution sets


*Result:*
configure: creating ./config.status
config.status: creating host-mkdep
chmod +x host-mkdep
# install /tooldir.NetBSD-6.1.4-amd64/bin/nbhost-mkdep
mkdir -p /tooldir.NetBSD-6.1.4-amd64/bin
/usr/src/tools/binstall/xinstall -c -r -m 555 host-mkdep
/tooldir.NetBSD-6.1.4-amd64/bin/nbhost-mkdep
make: exec(/usr/src/tools/binstall/xinstall) failed (No such file or
directory)
*** Error code 1

Stop.
make: stopped in /usr/src/tools/host-mkdep
*** Error code 1

*Actually the xinstall is not in the **folder*
# find / -name xinstall
/usr/src/usr.bin/xinstall
/usr/obj/tools/binstall/xinstall
# cat ~/build_kernel

_*Try to build the npfctl command*_

# cd /usr/src/usr.sbin/npf/npfctl/
# pwd
/usr/src/usr.sbin/npf/npfctl
# make
# lex npfctl/npf_scan.c
/usr/src/tooldir.NetBSD-6.1.4-amd64/bin/nblex -onpf_scan.c npf_scan.l
make: exec(/usr/src/tooldir.NetBSD-6.1.4-amd64/bin/nblex) failed (No
such file or directory)
*** Error code 1

Stop.
make: stopped in /usr/src/usr.sbin/npf/npfctl
#

How to change the NetBSD6.1.4? I am using the current development
version of source!
Alan Barrett
2014-09-21 14:39:48 UTC
Permalink
Post by bycn82
*Command**:*
cd /usr/src; ./build.sh -O /usr/obj -U -j 8 tools kernel=NB6 modules
distribution sets
I see you didn't pass -T ${TOOLDIR} option to build.sh
Post by bycn82
*Result:*
configure: creating ./config.status
config.status: creating host-mkdep
chmod +x host-mkdep
# install /tooldir.NetBSD-6.1.4-amd64/bin/nbhost-mkdep
mkdir -p /tooldir.NetBSD-6.1.4-amd64/bin
/usr/src/tools/binstall/xinstall -c -r -m 555 host-mkdep
/tooldir.NetBSD-6.1.4-amd64/bin/nbhost-mkdep
make: exec(/usr/src/tools/binstall/xinstall) failed (No such file or
directory)
*** Error code 1
The "install" line suggests that some part of the build thinks
that the TOOLDIR is "/tooldir.NetBSD-6.1.4-amd64", which makes
no sense, and the invocation of /usr/src/tools/binstall/xinstall
suggests that it thinks you are not using an OBJDIR, which also
makes no sense.

Were there any error or warning messages printed by build.sh
before it got to "===> Updated makewrapper:" ? What TOOLDIR path
did build.sh print?
Post by bycn82
_*Try to build the npfctl command*_
If you can't build tools, nothing else is going to work, but ...
Post by bycn82
# cd /usr/src/usr.sbin/npf/npfctl/
# pwd
/usr/src/usr.sbin/npf/npfctl
# make
# lex npfctl/npf_scan.c
/usr/src/tooldir.NetBSD-6.1.4-amd64/bin/nblex -onpf_scan.c npf_scan.l
make: exec(/usr/src/tooldir.NetBSD-6.1.4-amd64/bin/nblex) failed (No
such file or directory)
*** Error code 1
... now it seems to think that your TOOLDIR is
/usr/src/tooldir.NetBSD-6.1.4-amd64, not the
/tooldir.NetBSD-6.1.4-amd64 that appeared earlier.
Post by bycn82
How to change the NetBSD6.1.4? I am using the current development
version of source!
The host platform name is embedded in the default TOOLDIR name, so
it's fine for it to say NetBSD-6.1.4.

--apb (Alan Barrett)
bycn82
2014-09-21 15:07:29 UTC
Permalink
Post by Alan Barrett
Post by bycn82
*Command**:*
cd /usr/src; ./build.sh -O /usr/obj -U -j 8 tools kernel=NB6 modules
distribution sets
I see you didn't pass -T ${TOOLDIR} option to build.sh
Post by bycn82
*Result:*
configure: creating ./config.status
config.status: creating host-mkdep
chmod +x host-mkdep
# install /tooldir.NetBSD-6.1.4-amd64/bin/nbhost-mkdep
mkdir -p /tooldir.NetBSD-6.1.4-amd64/bin
/usr/src/tools/binstall/xinstall -c -r -m 555 host-mkdep
/tooldir.NetBSD-6.1.4-amd64/bin/nbhost-mkdep
make: exec(/usr/src/tools/binstall/xinstall) failed (No such file or
directory)
*** Error code 1
The "install" line suggests that some part of the build thinks that
the TOOLDIR is "/tooldir.NetBSD-6.1.4-amd64", which makes no sense,
and the invocation of /usr/src/tools/binstall/xinstall suggests that
it thinks you are not using an OBJDIR, which also makes no sense.
Were there any error or warning messages printed by build.sh before it
got to "===> Updated makewrapper:" ? What TOOLDIR path did build.sh
print?
Post by bycn82
_*Try to build the npfctl command*_
If you can't build tools, nothing else is going to work, but ...
Yes, you are right, thanks.
After I successfully built the tools, everything goes well,
Post by Alan Barrett
Post by bycn82
# cd /usr/src/usr.sbin/npf/npfctl/
# pwd
/usr/src/usr.sbin/npf/npfctl
# make
# lex npfctl/npf_scan.c
/usr/src/tooldir.NetBSD-6.1.4-amd64/bin/nblex -onpf_scan.c npf_scan.l
make: exec(/usr/src/tooldir.NetBSD-6.1.4-amd64/bin/nblex) failed (No
such file or directory)
*** Error code 1
... now it seems to think that your TOOLDIR is
/usr/src/tooldir.NetBSD-6.1.4-amd64, not the
/tooldir.NetBSD-6.1.4-amd64 that appeared earlier.
Post by bycn82
How to change the NetBSD6.1.4? I am using the current development
version of source!
The host platform name is embedded in the default TOOLDIR name, so
it's fine for it to say NetBSD-6.1.4.
--apb (Alan Barrett)
bycn82
2014-09-21 16:09:34 UTC
Permalink
*Now I am building the npfctl, and I met below**
*
-Wsign-compare -Wformat=2 -Werror -I/usr/src/usr.sbin/npf/npfctl
--sysroot=/ -c /usr/src/usr.sbin/npf/npfctl/npf_bpf_comp.c
In file included from /usr/src/usr.sbin/npf/npfctl/npf_bpf_comp.c:56:0:
/usr/src/usr.sbin/npf/npfctl/npf_bpf_comp.c: In function 'npfctl_bpf_table':
/usr/src/usr.sbin/npf/npfctl/npf_bpf_comp.c:610:21: error: 'BPF_COP'
undeclared (first use in this function)
BPF_STMT(BPF_MISC+BPF_COP, NPF_COP_TABLE),
^
/usr/src/usr.sbin/npf/npfctl/npf_bpf_comp.c:610:21: note: each
undeclared identifier is reported only once for each function it appears in
*** Error code 1

Stop.
make: stopped in /usr/src/usr.sbin/npf/npfctl

*Can someone told me which header has the declaration of the BPF_COP ? **
**I found below only.*
# grep -R BPF_COP /usr/src
/usr/src/doc/CHANGES.prev: kernel: Add BPF coprocessor support
(BPF_COP/BPF_COPX instructions).
Alan Barrett
2014-09-21 16:18:45 UTC
Permalink
Post by bycn82
*Now I am building the npfctl, and I met below**
*
-Wsign-compare -Wformat=2 -Werror -I/usr/src/usr.sbin/npf/npfctl
--sysroot=/ -c /usr/src/usr.sbin/npf/npfctl/npf_bpf_comp.c
/usr/src/usr.sbin/npf/npfctl/npf_bpf_comp.c:610:21: error: 'BPF_COP'
undeclared (first use in this function)
BPF_STMT(BPF_MISC+BPF_COP, NPF_COP_TABLE),
^
/usr/src/usr.sbin/npf/npfctl/npf_bpf_comp.c:610:21: note: each
undeclared identifier is reported only once for each function it appears in
*** Error code 1
Stop.
make: stopped in /usr/src/usr.sbin/npf/npfctl
I suspect that you have a corrupted source tree. Please take this
to current-users, not tech-kern.
Post by bycn82
*Can someone told me which header has the declaration of the BPF_COP ? **
**I found below only.*
# grep -R BPF_COP /usr/src
/usr/src/doc/CHANGES.prev: kernel: Add BPF coprocessor support
(BPF_COP/BPF_COPX instructions).
It's in src/sys/net/bpf.h. If grep didn't find it then you have
an incomplete source tree. Please fix that, and then if you still
have build problems, ask in current-users.

--apb (Alan Barrett)
Mindaugas Rasiukevicius
2014-09-21 17:12:41 UTC
Permalink
Post by Alan Barrett
Post by bycn82
*Now I am building the npfctl, and I met below**
*
-Wsign-compare -Wformat=2 -Werror -I/usr/src/usr.sbin/npf/npfctl
--sysroot=/ -c /usr/src/usr.sbin/npf/npfctl/npf_bpf_comp.c
/usr/src/usr.sbin/npf/npfctl/npf_bpf_comp.c: In function
error: 'BPF_COP' undeclared (first use in this function)
BPF_STMT(BPF_MISC+BPF_COP, NPF_COP_TABLE),
^
/usr/src/usr.sbin/npf/npfctl/npf_bpf_comp.c:610:21: note: each
undeclared identifier is reported only once for each function it appears in
*** Error code 1
Stop.
make: stopped in /usr/src/usr.sbin/npf/npfctl
I suspect that you have a corrupted source tree. Please take this
to current-users, not tech-kern.
Unlikely. I think he is just trying to build -current code on 6.x system
by manually invoking 'make' in the directory. Well, that is not going to
work: either build using ./build.sh or build on -current.
--
Mindaugas
Continue reading on narkive:
Loading...