# FreeBSD 9.1-RELEASE NanoBSD Build Kernel Failed



## razi91 (Jul 16, 2013)

Hello, Any NanoBSD expert here? help me why got error on this. I using nanobsd-ng configuration and do self custom for my nanobsd, for your information.. i already using nanoBSD-ng on FreeBSD 9.0 before.. and its work... after moving to FreeBSD 9.1-RELEASE i got this error when do the Buildkernel .bk

Please explain why I'm getting an error on this. I'm using the NanoBSD-NG configuration and customise NanoBSD myself. For your information, I have already used NanoBSD-NG on FreeBSD 9.0 before and it worked. After moving to FreeBSD 9.1-RELEASE, I got this error when building the kernel. 


```
===> zlib (depend)
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
rm -f .depend
mkdep -f .depend -a   -nostdinc -D_KERNEL -DKLD_MODULE -DHAVE_KERNEL_OPTION_HEADERS -I. -I@ -I@/contrib/altq -I/usr/obj/nanobsd.NanoBSD64SSD/usr/src/sys/DNSCELL /usr/src/sys/modules/zlib/../../net/zlib.c
1 error
*** [buildkernel] Error code 2
1 error
*** [buildkernel] Error code 2
1 error
```

My config file:

```
NANO_NAME=NanoBSD64SSD
NANO_SRC=/usr/src
NANO_PMAKE="make -j 4"
NANO_KERNEL=DNSCELL
NANO_ARCH="amd64"
NANO_MODULES='zfs zlib crypto opensolaris geom pf pfsync pflog vesa splash'
NANO_IMAGES=1
NANO_MEDIASIZE=`expr 7998455808 / 512`
NANO_HEADS=16
NANO_SECTS=63
NANO_CONFSIZE=40960
NANO_DATASIZE=8388608
NANO_RAM_ETCSIZE=40960
NANO_RAM_TMPVARSIZE=262144
NANO_GLABEL_SYS="nanoBSD"
NANO_GLABEL_CFG="cfg"
NANO_GLABEL_DATA="SSD"
# The drive name of the media at runtime
NANO_DRIVE=ad0

# boot0 flags/options and configuration
NANO_BOOT0CFG="-o packet -s 1 -m 3 -t 20"
NANO_BOOTLOADER="boot/boot0"

# boot2 flags/options
# default force serial console
NANO_BOOT2CFG=" -Dh"


# Set correct nameserver in /etc/resolv.conf
cust_setResolvConf() (
        touch ${NANO_WORLDDIR} /etc/resolv.conf
        chroot ${NANO_WORLDDIR} sh -c 'echo "nameserver 8.8.8.8" >> /etc/resolv.conf'
)

cust_confRCConf() (
        touch ${NANO_WORLDDIR}/etc/rc.conf
        # Enable SSH Server
        echo 'sshd_enable="YES"' >> ${NANO_WORLDDIR}/etc/rc.conf
        echo 'ifconfig_em0="inet 192.168.0.171 netmask 255.255.255.0"' >> ${NANO_WORLDDIR}/etc/rc.conf.local
        echo 'defaultrouter="192.168.0.1"' >> ${NANO_WORLDDIR}/etc/rc.conf.local
        echo 'hostname="nano64.dnscell.com"' >> ${NANO_WORLDDIR}/etc/rc.conf.local

)



customize_cmd cust_pkg_fetch
customize_cmd cust_install_files
customize_cmd cust_setResolvConf
customize_cmd cust_confRCConf
customize_cmd cust_boot_option
customize_cmd cust_console_dual
customize_cmd cust_allow_ssh_root
customize_cmd cust_splash
customize_cmd cust_geli_zfs
```

My kernel file:

```
include GENERIC
#makeoptions NO_MODULES=yes

cpu             HAMMER
ident           NANOSERVER



## Setup CPU Config


#ADD ACPI (missing in GENERIC for i386)
#device acpi



## Get rid of stuff we wont use.
nooptions COMPAT_FREEBSD4 # Compatible with FreeBSD4
nooptions COMPAT_FREEBSD5 # Compatible with FreeBSD5
nooptions COMPAT_FREEBSD6 # Compatible with FreeBSD6
nooptions COMPAT_FREEBSD7 # Compatible with FreeBSD7



## Build in GEOM Stuff
#options GEOM_STRIPE
#options GEOM_MIRROR
#options GEOM_GATE
#options GEOM_ELI
#options GEOM_JOURNAL

## Null fs
#options NULLFS

## File Descripter FS
#options FDESCFS

## IPSec Stuff
#options IPSEC
#options IPSEC_FILTERTUNNEL
#device crypto
#device cryptodev
#device hifn

## Failover stuff
device carp

## VLan Dev
device vlan #include generic

## Bridge dev
device if_bridge

## Link Aggragtion
device lagg

## IPMI Support
device smbus
device ipmi
```


----------



## razi91 (Jul 17, 2013)

Well.. I just find out how to solve this problem by myself. First, I don't know why I cannot compile the kernel using the source of 9.1, so I just changed to 9.0-STABLE source: `checkout [url=svn://svn.freebsd.org/base/releng/9.0]svn://svn.freebsd.org/base/releng/9.0[/url]`

So my configuration also needs me to set the path for the source: `NANO_SRC=/usr/src/9.0`


----------



## razi91 (Jul 18, 2013)

To @fonz,

Thanks, teacher!


----------



## SirDice (Jul 18, 2013)

razi91 said:
			
		

> Well.. I just find out how to solve this problem by myself. First, I don't know why I cannot compile the kernel using the source of 9.1, so I just changed to 9.0-STABLE source: `checkout [url=svn://svn.freebsd.org/base/releng/9.0]svn://svn.freebsd.org/base/releng/9.0[/url]`


That's 9.0-RELEASE. There is no 9.0-STABLE any more. There's a 9-STABLE which, at this moment, is 9.1-STABLE.

Keep in mind that 9.0-RELEASE is end-of-life and shouldn't be used.

[thread=40469]Topics about unsupported FreeBSD versions[/thread]


----------



## razi91 (Jul 18, 2013)

SirDice said:
			
		

> That's 9.0-RELEASE. There is no 9.0-STABLE any more. There's a 9-STABLE which, at this moment, is 9.1-STABLE.
> 
> Keep in mind that 9.0-RELEASE is end-of-life and shouldn't be used.
> 
> [thread=40469]Topics about unsupported FreeBSD versions[/thread]



Yeah I know. What I mention here is: I am using FreeBSD 9.1-RELEASE, but by using original source I mean /usr/src. It has failed to build a kernel. at _.bk. So I don't know what's wrong. So I move to `checkout [url=svn://svn.freebsd.org/base/releng/9.0]svn://svn.freebsd.org/base/releng/9.0[/url]`. 

So the conclusion here is:

I am compiling NanoBSD using a NanoBSD-NG script.
Operating system: FreeBSD 9.1-RELEASE.
usr/src: FreeBSD 9.0-STABLE


----------



## razi91 (Jul 18, 2013)

Any help for this error?

```
===> zlib (depend)
machine -> /usr/9.1/sys/amd64/include
x86 -> /usr/9.1/sys/x86/include
@ -> /usr/9.1/sys
rm -f .depend
mkdep -f .depend -a   -nostdinc -D_KERNEL -DKLD_MODULE -DHAVE_KERNEL_OPTION_HEADERS -I. -I@ -I@/contrib/altq -I/usr/obj/nanobsd.NanoBSD64SSD/usr/9.1/sys/DNSCELL /usr/9.1/sys/modules/zlib/../../net/zlib.c
1 error
*** [buildkernel] Error code 2
1 error
*** [buildkernel] Error code 2
1 error
```

Help me please


----------



## SirDice (Jul 18, 2013)

First check out a proper source. Use releng/9.1, the same version you have running, and save it in /usr/src/. Clear out /etc/make.conf and /etc/src.conf. Then see if you can buildworld normally. If that works without any issues move to NanoBSD.


----------



## razi91 (Jul 18, 2013)

Ok, thanks for that.

Here is my system

OS: FreeBSD-9.1-STABLE-amd64-20130707-r252919-release. Found this here. Source `usr/src`: source here.

So the step I need to do is:
Clear: /etc/make.conf, /etc/src.conf

Sorry for the stupid question here:

With 'clear' you mean: delete it?


----------



## wblock@ (Jul 18, 2013)

In this context, "clear" means "remove all entries that you added" to /etc/make.conf and /etc/src.conf.  The ports system adds some entries to /etc/make.conf, like one for the Perl version, which should be left alone.


----------



## razi91 (Jul 18, 2013)

wblock@ said:
			
		

> In this context, "clear" means "remove all entries that you added" to /etc/make.conf and /etc/src.conf.  The ports system adds some entries to /etc/make.conf, like one for the Perl version, which should be left alone.



Sorry for asking you, where this file located? /etc/src.conf and /etc/make.conf in my FreeBSD-9.1-STABLE. Is it inside /etc?


----------



## SirDice (Jul 18, 2013)

Yes, the files /etc/src.conf and /etc/make.conf are in /etc/. That's why they have /etc/ before them.

Handbook: 4.4. Directory Structure

If you're running 9-STABLE check out the stable/9 source instead of releng/9.1.


----------



## razi91 (Jul 18, 2013)

Ok, I understand that about directory structure, but it make me confuse when you said clear /etc/src.conf and /etc/make.conf. Because this file not found in my /etc. How? 

So the step I need to do is:
OS: FreeBSD-9.1-STABLE
Source : 
	
	



```
svn checkout svn://svn.freebsd.org/base/stable/9/
```

Am I correct?


----------



## SirDice (Jul 18, 2013)

razi91 said:
			
		

> Ok, I understand that about directory structure, but it make me confuse when you said clear /etc/src.conf and /etc/make.conf. Because this file not found in my /etc. How?


Clear it like @wblock@ said. If they don't exist there's nothing to clear 




> So the step I need to do is:
> OS: FreeBSD-9.1-STABLE
> Source : `svn checkout [url=svn://svn.freebsd.org/base/stable/9/]svn://svn.freebsd.org/base/stable/9/[/url]`
> 
> Am I correct?


Almost. You need to add the directory: `# svn checkout [url=svn://svn.freebsd.org/base/stable/9]svn://svn.freebsd.org/base/stable/9[/url] /usr/src/`
(If you do a checkout the directory needs to be empty)


----------



## Chris_H (Jul 18, 2013)

razi91 said:
			
		

> Ok, I understand that about directory structure, but it make me confuse when you said clear /etc/src.conf and /etc/make.conf. Because this file not found in my /etc. How?
> 
> So the step i need to do is:
> OS: FreeBSD-9.1-STABLE
> ...



Congratulations! Yes. You are correct, and best of luck with this. 

--chris

P.S. /etc/make.conf, and /etc/scr.conf are frequently found in FreeBSD systems, which is why they were mentioned. You need have no concern, if your system doesn't contain them. It was mentioned only as a potential cause for the experience you trying to overcome.


----------



## razi91 (Jul 18, 2013)

Thanks a lot, @SirDice. Going to try it. 

Now just downloading source.


----------



## Chris_H (Jul 18, 2013)

SirDice said:
			
		

> Clear it like @wblock@ said. If they don't exist there's nothing to clear
> 
> 
> 
> ...



D'OH! Sorry. I'll stay out.

--chris


----------



## razi91 (Jul 18, 2013)

Still got the same error.


```
===> zfs (depend)
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -p
awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -q
awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -h
rm -f .depend
mkdep -f .depend -a   -nostdinc -DFREEBSD_NAMECACHE -DBUILDING_ZFS -D_KERNEL -DKLD_MODULE -I/usr/src/sys/modules/zfs/../../cddl/compat/opensolaris -I/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs -I/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod -I/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common -I/usr/src/sys/modules/zfs/../.. -I/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs -I/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common -DHAVE_KERNEL_OPTION_HEADERS -I. -I@ -I@/contrib/altq -I/usr/obj/nanobsd.NanoBSD64SSD/usr/src/sys/DNSCELL -std=iso9899:1999   /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/acl/acl_common.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/avl/avl.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/nvpair/nvpair.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/nvpair/nvpair_alloc_fixed.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/nvpair/fnvpair.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/unicode/u8_textprep.c /usr/src/sys/modules/zfs/../../cddl/compat/opensolaris/kern/opensolaris_acl.c /usr/src/sys/modules/zfs/../../cddl/compat/opensolaris/kern/opensolaris_kobj.c /usr/src/sys/modules/zfs/../../cddl/compat/opensolaris/kern/opensolaris_kstat.c /usr/src/sys/modules/zfs/../../cddl/compat/opensolaris/kern/opensolaris_lookup.c /usr/src/sys/modules/zfs/../../cddl/compat/opensolaris/kern/opensolaris_policy.c /usr/src/sys/modules/zfs/../../cddl/compat/opensolaris/kern/opensolaris_string.c /usr/src/sys/modules/zfs/../../cddl/compat/opensolaris/kern/opensolaris_sysevent.c /usr/src/sys/modules/zfs/../../cddl/compat/opensolaris/kern/opensolaris_taskq.c /usr/src/sys/modules/zfs/../../cddl/compat/opensolaris/kern/opensolaris_uio.c /usr/src/sys/modules/zfs/../../cddl/compat/opensolaris/kern/opensolaris_vfs.c /usr/src/sys/modules/zfs/../../cddl/compat/opensolaris/kern/opensolaris_zone.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/atomic/amd64/opensolaris_atomic.S /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/gfs.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/vnode.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/os/callb.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/os/fm.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/os/list.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/os/nvpair_alloc_system.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod/adler32.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod/opensolaris_crc32.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod/deflate.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod/inffast.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod/inflate.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod/inftrees.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod/trees.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod/zmod.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod/zmod_subr.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod/zutil.c /usr/src/sys/modules/zfs/../../crypto/sha2/sha2.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/bplist.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/gzip.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zle.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs/zfeature_common.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs/zfs_comutil.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs/zfs_deleg.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs/zfs_prop.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs/zpool_prop.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs/zprop_common.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
===> zlib (depend)
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
rm -f .depend
mkdep -f .depend -a   -nostdinc -D_KERNEL -DKLD_MODULE -DHAVE_KERNEL_OPTION_HEADERS -I. -I@ -I@/contrib/altq -I/usr/obj/nanobsd.NanoBSD64SSD/usr/src/sys/DNSCELL -std=iso9899:1999   /usr/src/sys/modules/zlib/../../net/zlib.c
1 error
*** [buildkernel] Error code 2
1 error
*** [buildkernel] Error code 2
1 error
```


----------



## Chris_H (Jul 18, 2013)

Greetings,

 While I've never built NanoBSD, and I can't follow the messages as they fly by during buildkernel/buildworld. There appears to be something (to me) that seems incorrect near the last line:

```
-DHAVE_KERNEL_OPTION_HEADERS -I. -I@ -I@/contrib/altq -I/usr/obj/nanobsd.NanoBSD64SSD/usr/src
_________________________________^^^^^^^
```
Why are there two `-I@`? It appears to me that the first one is missing a parameter (path, in this case). Just thought I'd mention it.

--chris


----------



## razi91 (Jul 19, 2013)

Chris_H said:
			
		

> Greetings,
> While I've never built nanoBSD, and I can't follow the messages as they fly by during buildkernel/buildworld.
> There appears to be something (to me) that seems incorrect near the last line:
> 
> ...



Thanks for mentioning that, I am not sure what it is.  Because I had tried to compile source using releng/9.0, there is no error mention about this zlib. Any ideas?


----------



## Chris_H (Jul 19, 2013)

I think I'd do well to let someone more familiar with your error, answer. But if it were me, I'd probably perform a

```
cd /usr/src
make clean
make <target>
```
If make(1) completed successfully on my copy/revision of the source, I'd then know it was a problem somewhere in NanoBSD, or my NanoBSD build scripts.

--chris


----------



## razi91 (Jul 19, 2013)

Thanks. @Chris_H, I will try it.


----------



## razi91 (Jul 25, 2013)

@Chris_H, I had tried to:

```
cd /usr/src
make clean
make <target>
```

Can you explain more about `make <target>`? For example `make /usr/src` or `make zlib`?

So I already make clean inside /usr/src, and still no help about this error 

```
===> zlib (depend)
machine -> /usr/src/sys/amd64/include
@ -> /usr/src/sys
x86 -> /usr/src/sys/x86/include
rm -f .depend
mkdep -f .depend -a   -nostdinc -D_KERNEL -DKLD_MODULE -DHAVE_KERNEL_OPTION_HEADERS -I. -I@ -I@/contrib/altq -I/usr/obj/nanobsd.NanoBSD64SSD/usr/src/sys/DNSCELL -std=iso9899:1999   /usr/src/sys/modules/zlib/../../net/zlib.c
1 error
*** [buildkernel] Error code 2
1 error
*** [buildkernel] Error code 2
1 error
```

So here I try to run manually 

```
mkdep -f .depend -a   -nostdinc -D_KERNEL -DKLD_MODULE -DHAVE_KERNEL_OPTION_HEADERS -I. -I@ -I@/contrib/altq -I/usr/obj/nanobsd.NanoBSD64SSD/usr/src/sys/DNSCELL -std=iso9899:1999   /usr/src/sys/modules/zlib/../../net/zlib.c
/usr/src/sys/modules/zlib/../../net/zlib.c:50:22: error: net/zlib.h: No such file or directory
/usr/src/sys/modules/zlib/../../net/zlib.c:57:23: error: sys/types.h: No such file or directory
/usr/src/sys/modules/zlib/../../net/zlib.c:58:22: error: sys/time.h: No such file or directory
/usr/src/sys/modules/zlib/../../net/zlib.c:59:23: error: sys/systm.h: No such file or directory
/usr/src/sys/modules/zlib/../../net/zlib.c:60:23: error: sys/param.h: No such file or directory
/usr/src/sys/modules/zlib/../../net/zlib.c:61:24: error: sys/kernel.h: No such file or directory
/usr/src/sys/modules/zlib/../../net/zlib.c:62:24: error: sys/module.h: No such file or directory
```


----------



## Chris_H (Jul 26, 2013)

Greetings,

My thoughts were to attempt to determine if there was any issue(s) with your _src_ -- /usr/src, or whether it was something within your NANO scripts/configuration. So, if I were in your position, I'd figure the easiest way to determine that, would be to:

```
cd /usr/scr
make clean
make <target>
```
...where <target> is one of *kernel*, or -- if you're real adventurous; *world*. But honestly, it should be enough to build _kernel_, in your case.

Sorry for not being clearer, and good luck.

--chris


----------



## razi91 (Nov 18, 2013)

Hello guys,

The problem is solved. The actual problem is I forgot to replace my new custom kernel and after replacing the new kernel it's working perfectly. Sorry for the long post. 

Thanks.


----------

