DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD General

NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 1st December 2015
philo_neo71 philo_neo71 is online now
Package Pilot
 
Join Date: Jul 2009
Posts: 196
Default build a kernel

Hi,
i've read many website about compile a kernel, this is that i anderstand.


Code:
# fetch source:
cd /usr; cvs -z3 -d anoncvs@anoncvs.se.netbsd.org:/cvsroot co -P src
# everything goes into this directory
mkdir /usr/obj
# build tools (to build everything else), custom kernel, binary sets
cd /usr/src; ./build.sh -O /usr/obj -U -j 8 tools kernel=H4KK1T modules distribution sets
# install kernel:
cd /usr/obj/sys/compile/arch/*/compile/H4KK1T; su root -c 'make install'
# test kernel:
su root -c 'shutdown -r now'
# update userland:
cd /usr/src; ./build.sh -O /usr/obj install=/
# follow printed instructions about "postinstall"

# build CD image (omit "tools" if built already):
cd /usr/src; ./build.sh -O /usr/obj -U -j 8 tools release iso-image
When i hit this step >> cd /usr/src; ./build.sh -O /usr/obj -U -j 8 tools kernel=H4KK1T modules distribution sets <<
have got issues :

Quote:
^
In file included from /usr/src/sys/fs/msdosfs/msdosfs_lookup.c:69:0:
/usr/src/tools/makefs/../../usr.sbin/makefs/ffs/buf.h:78:6: note: expected 'int' but argument is of type 'void *'
int bread(struct vnode *, daddr_t, int, int, struct buf **);
^
/usr/src/sys/fs/msdosfs/msdosfs_lookup.c:1149:7: error: too many arguments to function 'bread'
0, &bp)) {
^
In file included from /usr/src/sys/fs/msdosfs/msdosfs_lookup.c:69:0:
/usr/src/tools/makefs/../../usr.sbin/makefs/ffs/buf.h:78:6: note: declared here
int bread(struct vnode *, daddr_t, int, int, struct buf **);
^
*** [msdosfs_lookup.lo] Error code 1
nbmake[3]: stopped in /usr/src/tools/makefs
--- msdosfs_denode.lo ---
mv msdosfs_denode.lo.o msdosfs_denode.lo
--- v7fs_populate.lo ---
mv v7fs_populate.lo.o v7fs_populate.lo
--- msdosfs_conv.lo ---
mv msdosfs_conv.lo.o msdosfs_conv.lo
--- mkfs_msdos.lo ---
mv mkfs_msdos.lo.o mkfs_msdos.lo
2 errors
nbmake[3]: stopped in /usr/src/tools/makefs
*** [dependall] Error code 2
nbmake[2]: stopped in /usr/src/tools/makefs
1 error
nbmake[2]: stopped in /usr/src/tools/makefs

*** Failed target: dependall-makefs
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/usr/src/tools" ;; *) this="${dir}/"; real="/usr/src/tools/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /usr/obj/tooldir.NetBSD-7.0_RC3-amd64/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget makefs dependall
*** Error code 2
Stop.
nbmake[1]: stopped in /usr/src/tools
*** [build_install] Error code 1

nbmake: stopped in /usr/src/tools
1 error

nbmake: stopped in /usr/src/tools

ERROR: Failed to make build_install in "tools"
*** BUILD ABORTED ***
dct-pegasus#
Some one can help me !

Regards
Philippe

PS : i forgot the URL of NetBSD Users !
Reply With Quote
  #2   (View Single Post)  
Old 1st December 2015
kamil kamil is offline
Fdisk Soldier
 
Join Date: Mar 2015
Posts: 52
Default

Please try to upgrade your sources.

Quote:
cd /usr/src &&cvs -q update -PdAC
__________________
the dogs bark, but the caravan goes on
Reply With Quote
  #3   (View Single Post)  
Old 1st December 2015
bashrules bashrules is offline
Fdisk Soldier
 
Join Date: Mar 2010
Location: Here
Posts: 48
Default

Quote:
Originally Posted by kamil View Post
Please try to upgrade your sources.
It looks like that tools and kernel source are out of sync. Didn't philo check out both with his first statement?



Hello Philo.

- You know that H4KK1T is your kernel config file? If not, then use GENERIC.

- Do you know that you build and install more than the kernel and modules? Building userland dominates the build-time. For me on old hw:
  • tools: 30 min
  • kernel: 20 min
  • modules: 30 min
  • userland: 5 hours


A related question: The easiest way to build the kernel is (replace i386 with your architecture):

Code:
/usr/src/sys/arch/i386/conf# config GENERIC
Build directory is ../compile/GENERIC
Don't forget to run "make depend"
/usr/src/sys/arch/i386/conf# cd ../compile/GENERIC/
/usr/src/sys/arch/i386/compile/GENERIC# make depend; make; cp netbsd /; rm -rf *


Now: What's the make target for building (and installing) modules?
Reply With Quote
  #4   (View Single Post)  
Old 1st December 2015
philo_neo71 philo_neo71 is online now
Package Pilot
 
Join Date: Jul 2009
Posts: 196
Default

Hi,
I've do this quote :
Quote:
/usr/src/sys/arch/i386/conf# config GENERIC
Build directory is ../compile/GENERIC
Don't forget to run "make depend"
/usr/src/sys/arch/i386/conf# cd ../compile/GENERIC/
/usr/src/sys/arch/i386/compile/GENERIC# make depend; make; cp netbsd /; rm -rf *
What can i do now ?


Regards
philippe
Reply With Quote
  #5   (View Single Post)  
Old 1st December 2015
bashrules bashrules is offline
Fdisk Soldier
 
Join Date: Mar 2010
Location: Here
Posts: 48
Default

Quote:
Originally Posted by philo_neo71 View Post
Hi,
I've do this quote :


What can i do now ?
reboot

You have probably a more recent architecture than i386, that is amd64. If so, redo the above and replace i386 with amd64.

You can learn your architecture via

Code:
uname -p
Reply With Quote
  #6   (View Single Post)  
Old 1st December 2015
philo_neo71 philo_neo71 is online now
Package Pilot
 
Join Date: Jul 2009
Posts: 196
Default

ok !
The Hardware as an Bi quad cores opteron 2347 (amd64), totaly : 8 cores, 4 Go RAM, 1.250 tera
Reply With Quote
  #7   (View Single Post)  
Old 2nd December 2015
kamil kamil is offline
Fdisk Soldier
 
Join Date: Mar 2015
Posts: 52
Default

Quote:
Originally Posted by bashrules View Post
Now: What's the make target for building (and installing) modules?
The sanest way to build tools:

Code:
./build.sh tools
Kernel:

Code:
./build.sh kernel=GENERIC
Modules:

Code:
./build.sh modules
Install modules:

Code:
./build.sh installmodules=/
__________________
the dogs bark, but the caravan goes on
Reply With Quote
  #8   (View Single Post)  
Old 2nd December 2015
philo_neo71 philo_neo71 is online now
Package Pilot
 
Join Date: Jul 2009
Posts: 196
Default

Hi,
Can you tell me whitch directory i must apply your commands
Reply With Quote
  #9   (View Single Post)  
Old 4th December 2015
kamil kamil is offline
Fdisk Soldier
 
Join Date: Mar 2015
Posts: 52
Default

All commands are for /usr/src
__________________
the dogs bark, but the caravan goes on
Reply With Quote
Old 8th December 2015
philo_neo71 philo_neo71 is online now
Package Pilot
 
Join Date: Jul 2009
Posts: 196
Default

i've got errors at this command line :
>> cd /usr/src; ./build.sh -O /usr/obj -U -j 8 tools kernel=H4KK1T modules distribution sets
---------------------------------------------------------------------------------------------------------------------
this is my out put :
Quote:
# install /usr/obj/tooldir.NetBSD-7.0_RC3-amd64/bin/nbconfig
mkdir -p /usr/obj/tooldir.NetBSD-7.0_RC3-amd64/bin
/usr/obj/tooldir.NetBSD-7.0_RC3-amd64/bin/x86_64--netbsd-install -c -r -m 555 config /usr/obj/tooldir.NetBSD-7.0_RC3-amd64/bin/nbconfig
===> Tools built to /usr/obj/tooldir.NetBSD-7.0_RC3-amd64
--- obj ---
===> Building kernel: H4KK1T
===> Build directory: /usr/obj/sys/arch/amd64/compile/H4KK1T
--- __doclean ---
--- __docleandir ---
--- __doclean ---
(cd /usr/obj/sys/arch/amd64/compile/H4KK1T && rm -f a.out [Ee]rrs mklog core *.core .gdbinit || true)
nbconfig: Cannot read `/usr/src/sys/arch/amd64/conf/H4KK1T': No such file or directory

ERROR: nbconfig failed for H4KK1T
*** BUILD ABORTED ***
dct-itto#
Regards
Philippe
Reply With Quote
Old 8th December 2015
pygope pygope is offline
Port Guard
 
Join Date: Apr 2015
Posts: 32
Default

Quote:
Originally Posted by philo_neo71 View Post
i've got errors at this command line :
>> cd /usr/src; ./build.sh -O /usr/obj -U -j 8 tools kernel=H4KK1T modules distribution sets
---------------------------------------------------------------------------------------------------------------------
this is my out put :


Regards
Philippe
BashRules answered you a few post before:

Replace H4KK1T with GENERIC:

>> cd /usr/src; ./build.sh -O /usr/obj/ -U -j 8 tools kernel=GENERIC modules distribution set
Reply With Quote
Old 18th December 2015
philo_neo71 philo_neo71 is online now
Package Pilot
 
Join Date: Jul 2009
Posts: 196
Default

Hi,
i've build a generic kernel and it's work fine !
But now i want to can change parametres of kernel before compilation.
Whitch file configuration can i apply my parametres ?
it's GENERIC 's file ?

Regards
philippe
Reply With Quote
Old 18th December 2015
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 756
Default

Quote:
Originally Posted by philo_neo71 View Post
Whitch file configuration can i apply my parametres ?
it's GENERIC 's file ?
You could, but then your custom kernel would still identify itself as GENERIC, e.g., in uname output. This could be confusing to you, and certainly to others if you reported a problem.

So, the recommended way it to copy the GENERIC file in the usr/src/sys/arch/.../conf/ directory to another unique file in that directory, say, MY_KERNEL. Then make your changes to the new config file and compile with

% ./build.sh ... kernel=MY_KERNEL

Replacing MY_KERNEL with a more descriptive name would be wise.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Build kernel & userland as root? hanzer OpenBSD Installation and Upgrading 5 24th July 2015 06:52 PM
Guide to build a modular kernel. tolstoi NetBSD Installation and Upgrading 0 4th February 2013 07:10 AM
commands to build a kernel desreguard FreeBSD General 2 4th June 2011 05:20 PM
Problem during kernel-build for a 6.x-to-7 upgrade clevershark FreeBSD Installation and Upgrading 2 1st February 2009 10:45 PM
Unable to build custom kernel [Wrong configuration?] jrick FreeBSD General 3 31st July 2008 01:53 PM


All times are GMT. The time now is 03:28 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick