building freenas on freenas

Status
Not open for further replies.

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
Hi

Has anyone managed to compile FreeNAS directly on FreeNAS?

so far all my attempts have failed and I have to build into a VMWare machine, which takes forever.

This are the steps I've attempted so far:

- build from within the port jail (this cause issue trying to mount some temp)
- chroot from main shell, into the ports jail location; mount /dev so there's no restriction.

things end up failing with:
cc -static -o rescue rescue.o cat.lo chflags.lo chio.lo chmod.lo cp.lo date.lo dd.lo df.lo echo.lo ed.lo expr.lo getfacl.lo hostname.lo kenv.lo kill.lo ln.lo ls.lo mkdir.lo mv.lo pkill.lo ps.lo pwd.lo realpath.lo rm.lo rmdir.lo setfacl.lo sh.lo stty.lo sync.lo test.lo csh.lo atacontrol.lo badsect.lo camcontrol.lo ccdconfig.lo clri.lo devfs.lo dmesg.lo dump.lo dumpfs.lo dumpon.lo fsck.lo fsck_ffs.lo fsck_msdosfs.lo fsdb.lo fsirand.lo gbde.lo geom.lo ifconfig.lo init.lo kldconfig.lo kldload.lo kldstat.lo kldunload.lo ldconfig.lo md5.lo mdconfig.lo mdmfs.lo mknod.lo mount.lo mount_cd9660.lo mount_msdosfs.lo mount_nfs.lo mount_ntfs.lo mount_nullfs.lo mount_udf.lo mount_unionfs.lo newfs.lo newfs_msdos.lo nos-tun.lo ping.lo reboot.lo restore.lo rcorder.lo route.lo routed.lo rtquery.lo rtsol.lo savecore.lo spppcontrol.lo swapon.lo sysctl.lo tunefs.lo umount.lo ping6.lo zfs.lo zpool.lo bsdlabel.lo fdisk.lo dhclient.lo head.lo mt.lo nc.lo sed.lo tail.lo tee.lo gzip.lo bzip2.lo less.lo xz.lo tar.lo vi.lo id.lo chroot.lo chown.lo /root/freenas/git/os-base/amd64/root/freenas/git/FreeBSD/src/rescue/rescue/../librescue/exec.o /root/freenas/git/os-base/amd64/root/freenas/git/FreeBSD/src/rescue/rescue/../librescue/getusershell.o /root/freenas/git/os-base/amd64/root/freenas/git/FreeBSD/src/rescue/rescue/../librescue/login_class.o /root/freenas/git/os-base/amd64/root/freenas/git/FreeBSD/src/rescue/rescue/../librescue/popen.o /root/freenas/git/os-base/amd64/root/freenas/git/FreeBSD/src/rescue/rescue/../librescue/rcmdsh.o /root/freenas/git/os-base/amd64/root/freenas/git/FreeBSD/src/rescue/rescue/../librescue/sysctl.o /root/freenas/git/os-base/amd64/root/freenas/git/FreeBSD/src/rescue/rescue/../librescue/system.o -lcrypt -ledit -lkvm -ll -ltermcap -lutil -lalias -lcam -lcurses -ldevstat -lipsec -lavl -ljail -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem -lgeom -lbsdxml -lkiconv -lmd -lreadline -lsbuf -lufs -lz -lbz2 -llzma -larchive -lcrypto -lm
nc.lo: In function `_$$hide$$ nc.lo main':
(.text+0x1dbf): warning: warning: mktemp() possibly used unsafely; consider using mkstemp()
/root/freenas/git/os-base/amd64/root/freenas/git/FreeBSD/src/tmp/usr/lib/libc.a(nsdispatch.o): In function `_nsdispatch':
nsdispatch.c:(.text+0x620): undefined reference to `_nsyyin'
nsdispatch.c:(.text+0x67e): undefined reference to `_nsyyin'
/root/freenas/git/os-base/amd64/root/freenas/git/FreeBSD/src/tmp/usr/lib/libc.a(nsparser.o): In function `_nsaddsrctomap':
nsparser.c:(.text+0x2a): undefined reference to `_nsyytext'
nsparser.c:(.text+0x30): undefined reference to `_nsyylineno'
/root/freenas/git/os-base/amd64/root/freenas/git/FreeBSD/src/tmp/usr/lib/libc.a(nsparser.o): In function `_nsyyparse':
nsparser.c:(.text+0x576): undefined reference to `_nsyylex'
nsparser.c:(.text+0x5a2): undefined reference to `_nsyyerror'
nsparser.c:(.text+0x688): undefined reference to `_nsyyerror'
nsparser.c:(.text+0x7c5): undefined reference to `_nsyylex'
*** [rescue] Error code 1
1 error
*** [rescue] Error code 2
1 error
*** [all] Error code 2
1 error
*** [rescue.all__D] Error code 2
7 errors
*** [everything] Error code 2
1 error
*** [buildworld] Error code 2
1 error

Getting the same error using either 9.1.1-release, or 9.2.2-beta

my freenas box is the fastest freebsd machine I have around, so would much prefer to compile on it.

Thanks in advance
 

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
I've tried several things...

First, I simply created a ports jail, followed the instructions (including setting a preliminary clone of ports and truenas for quicker access later). This failed rather early as you can't mount anything while in a jail (IRC, only zfs is allowed to be mounted while in a jail, mounting tmpfs requires a small mod first).

The jail pool was created into /mnt/pool/jails/ports

the freenas source code (git checkout) was installed in /mnt/pool/jails/ports/freenas/git

So I attempted the 2nd method.
I log into freenas. I mounted once again devfs to /mnt/pool/jails/ports/dev just in case.
then I did: chroot /mnt/pool/jails/ports/freenas/git.

I then set GIT_FREEBSD_CACHE and GIT_PORTS_CACHE to their respective path (file:///root/freenas/trueos and files:///root/freenas/ports)

then I ran make git-external
then make release.

build starts for several minutes; then fail during world when compiling libc (as mentioned in my first post).

Following identical steps on a FreeBSD 9.2 install, it works just fine...

Then, thinking the issue was just building libc so after I had finished building on my FreeBSD (not freenas) 9.2 machine, I copied via rsync the freenas/git directory that I had compiled to the freenas box. I made sure all the paths were identical.
I thought that way, I wouldn't have to compile world nor the kernel.

but that failed too. I can't remember exactly what was going on... A very particular error within the build system, nothing to do with the C compiler failing...

I haven't made progress on this since, so I've been compiling in the VM in the mean time...

I would still much prefer to compile on freenas itself...
 
D

dlavigne

Guest
build starts for several minutes; then fail during world when compiling libc (as mentioned in my first post).

Following identical steps on a FreeBSD 9.2 install, it works just fine...

Now you've lost me. What are you on when it fails?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
One of the former mods of this forum tried to setup a VM that was FreeNAS compiling FreeNAS. After over a week of attempting to get it to work he gave up and decided it wasn't something that was worth the effort. He said that because of several aspects of the build process it would be a situation where it when all was said and done it would build only the FreeNAS version you were currently working on. When the next version came out it would require you to practically redo large parts of your custom work to make it compile the next version. And with each revision it would bring new/different but significant changes again and again. There's a thread around here with some of his stuff documented and the efforts he made. If you find it, it might help you with some of the issues.

He was no slouch though. He ported FreeNAS to FreeBSD 9 "for fun" back when FreeNAS was still 8.x and the 9.x code didn't even exist yet.
 

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
Now you've lost me. What are you on when it fails?


Not sure what you mean with "what are you on" (sorry, it's 1:30AM here... )
I'm on FreeNAS 9.2-RC.

let me copy / paste exactly what I'm doing and where it fails.

[root@freenas-surrey1 /mnt/pool/jails/ports]# mount -t devfs dev /mnt/pool/jails/ports/dev
[root@freenas-surrey1 /mnt/pool/jails/ports]# chroot /mnt/pool/jails/ports
[root@freenas-surrey1 /]# cd pool/freenas/
[root@freenas-surrey1 /pool/freenas]# make clean
[root@freenas-surrey1 /pool/freenas]# export GIT_PORTS_CACHE=file:///root/freenas/ports
[root@freenas-surrey1 /pool/freenas]# export GIT_FREEBSD_CACHE=file:///root/freenas/trueos
[root@freenas-surrey1 /pool/freenas]# make git-external
[root@freenas-surrey1 /pool/freenas]# make release
env NANO_LABEL=FreeNAS VERSION=9.2.0-RC GIT_LOCATION=EXTERNAL script -a release.build.log make do-release
Script started, output file is release.build.log
NOTICE: You are building from the EXTERNAL git repo.
Doing executing target do-release on host: freenas-surrey1.bubblestuff.com
Build directory: /pool/freenas
env NANO_LABEL=FreeNAS VERSION=9.2.0-RC GIT_LOCATION=EXTERNAL build/build_release.sh
+ set -e
+ dirname build/build_release.sh
+ mydir=build
+ sh build/do_build.sh -z
Using local mirror in file:///root/freenas/trueos
Using local git ports mirror in https://github.com/freenas/ports.git
Use git set!
Checkout: FREEBSD -> https://github.com/trueos/trueos
+ mkdir -p /pool/freenas/FreeBSD
+ local _depth_arg=
+ [ x = xYES -o x != xYES ]
+ _depth_arg='--depth 1'
+ [ xyes != x -o x != x ]
+ _depth_arg=''
+ cd /pool/freenas/FreeBSD
+ [ -d src/.git ]
+ cd src
+ git rev-parse --abbrev-ref HEAD
+ local old_branch=feature/unified_freebsd
+ [ xfeature/unified_freebsd != xfeature/unified_freebsd ]
+ git pull
Already up-to-date.
+ cd ..
+ echo e
+ grep -q x
+ set +x
Checkout: PORTS -> https://github.com/freenas/ports.git
+ mkdir -p /pool/freenas/FreeBSD
+ local _depth_arg=
+ [ x = xYES -o x != xYES ]
+ _depth_arg='--depth 1'
+ [ xyes != x -o x != x ]
+ _depth_arg=''
+ cd /pool/freenas/FreeBSD
+ [ -d ports/.git ]
+ cd ports
+ git rev-parse --abbrev-ref HEAD
+ local old_branch=freenas/9.1-stable-b
+ [ xfreenas/9.1-stable-b != xfreenas/9.1-stable-b ]
+ git pull
Already up-to-date.
+ cd ..
+ echo e
+ grep -q x
+ set +x
Sourcing /pool/freenas/nanobsd/os-base
Not setting MASTER_SITE_OVERRIDE, value: ''
Package is not yet built: textproc_libxml2
Package is not yet built: devel_libffi
Package is not yet built: archivers_lzo2
Package is not yet built: www_aria2
Package is not yet built: security_easy-rsa
Package is not yet built: security_openvpn
Package is not yet built: converters_libiconv
Package is not yet built: converters_iconv
Package is not yet built: devel_gettext
Package is not yet built: devel_pkgconf
Package is not yet built: devel_libpthread-stubs
Package is not yet built: devel_cdialog
Package is not yet built: dns_inadyn-mt
Package is not yet built: devel_pcre
Package is not yet built: editors_nano
Package is not yet built: ftp_proftpd
Package is not yet built: net-mgmt_bsnmp-ucd
Package is not yet built: net-mgmt_bsnmptools
Package is not yet built: net-mgmt_clog
Package is not yet built: net-mgmt_sipcalc
Package is not yet built: net_istgt
Package is not yet built: net_vblade
Package is not yet built: security_libgpg-error
Package is not yet built: security_libgcrypt
Package is not yet built: databases_db46
Package is not yet built: security_cyrus-sasl2
Package is not yet built: net_openldap24-sasl-client
Package is not yet built: net_nss_ldap
Package is not yet built: net_rsync
Package is not yet built: lang_python27
Package is not yet built: lang_python2
Package is not yet built: lang_python
Package is not yet built: dns_py-dnspython
Package is not yet built: devel_tevent
Package is not yet built: devel_talloc
Package is not yet built: devel_libexecinfo
Package is not yet built: devel_popt
Package is not yet built: databases_tdb
Package is not yet built: sysutils_libsunacl
Package is not yet built: net_samba36
Package is not yet built: security_pam_ldap
Package is not yet built: security_pam_mkhomedir
Package is not yet built: shells_bash
Package is not yet built: shells_ksh93
Package is not yet built: shells_mksh
Package is not yet built: shells_scponly
Package is not yet built: sysutils_e2fsprogs
Package is not yet built: sysutils_fusefs-libs
Package is not yet built: sysutils_fusefs-kmod
Package is not yet built: devel_libublio
Package is not yet built: sysutils_fusefs-ntfs
Package is not yet built: sysutils_smartmontools
Package is not yet built: net_libdnet
Package is not yet built: emulators_open-vm-tools-nox11
Package is not yet built: databases_sqlite3
Package is not yet built: databases_py-sqlite3
Package is not yet built: databases_py-bsddb3
Package is not yet built: devel_py-distribute
Package is not yet built: devel_py-sysctl
Package is not yet built: www_py-flup
Package is not yet built: www_py-django
Package is not yet built: www_py-dojango
Package is not yet built: www_dojo
Package is not yet built: databases_py-south
Package is not yet built: devel_py-asn1
Package is not yet built: devel_py-asn1-modules
Package is not yet built: www_nginx
Package is not yet built: net-mgmt_net-snmp
Package is not yet built: sysutils_nut
Package is not yet built: textproc_py-libxml2
Package is not yet built: textproc_expat2
Package is not yet built: devel_gamin
Package is not yet built: devel_m4
Package is not yet built: misc_gnomehier
Package is not yet built: www_py-httplib2
Package is not yet built: net_py-oauth2
Package is not yet built: sysutils_jailme
Package is not yet built: graphics_png
Package is not yet built: devel_libstatgrab
Package is not yet built: devel_libltdl
Package is not yet built: print_freetype2
Package is not yet built: x11_xproto
Package is not yet built: x11-fonts_fontconfig
Package is not yet built: x11-fonts_libfontenc
Package is not yet built: x11-fonts_mkfontscale
Package is not yet built: x11-fonts_mkfontdir
Package is not yet built: x11-fonts_font-bh-ttf
Package is not yet built: x11-fonts_font-misc-meltho
Package is not yet built: x11-fonts_font-misc-ethiopic
Package is not yet built: x11-fonts_bitstream-vera
Package is not yet built: x11-fonts_font-util
Package is not yet built: x11-fonts_encodings
Package is not yet built: x11-fonts_dejavu
Package is not yet built: x11-fonts_xorg-fonts-truetype
Package is not yet built: x11_pixman
Package is not yet built: graphics_cairo
Package is not yet built: x11-toolkits_pango
Package is not yet built: devel_icu
Package is not yet built: graphics_graphite2
Package is not yet built: devel_glib20
Package is not yet built: print_harfbuzz
Package is not yet built: databases_rrdtool
Package is not yet built: net_liboping
Package is not yet built: net-mgmt_collectd5
Package is not yet built: devel_gobject-introspection
Package is not yet built: devel_py-ipaddr
Package is not yet built: converters_base64
Package is not yet built: emulators_mtools
Package is not yet built: sysutils_arcconf
Package is not yet built: sysutils_tw_cli
Package is not yet built: sysutils_megacli
Package is not yet built: sysutils_areca-cli
Package is not yet built: net_py-ldap2
Package is not yet built: sysutils_ataidle
Package is not yet built: sysutils_gnome_subr
Package is not yet built: devel_dbus
Package is not yet built: devel_dbus-glib
Package is not yet built: devel_libdaemon
Package is not yet built: databases_gdbm
Package is not yet built: net_avahi-app
Package is not yet built: net_avahi-libdns
Package is not yet built: textproc_py-xml
Package is not yet built: sysutils_throttle
Package is not yet built: sysutils_dmidecode
Package is not yet built: sysutils_graid5
Package is not yet built: devel_libevent
Package is not yet built: devel_libevent2
Package is not yet built: sysutils_tmux
Package is not yet built: devel_py-dbus
Package is not yet built: net_netatalk3
Package is not yet built: dns_libidn
Package is not yet built: ftp_wget
Package is not yet built: benchmarks_iozone
Package is not yet built: benchmarks_iperf
Package is not yet built: benchmarks_netperf
Package is not yet built: benchmarks_xdd
Package is not yet built: security_sudo
Package is not yet built: sysutils_ipmitool
Package is not yet built: www_py-django-json-rpc
Package is not yet built: devel_py-mimeparse
Package is not yet built: devel_py-six
Package is not yet built: devel_py-dateutil
Package is not yet built: devel_py-rose
Package is not yet built: www_py-django-tastypie
Package is not yet built: devel_py-lockfile
Package is not yet built: devel_py-daemon
Package is not yet built: devel_py-polib
Package is not yet built: devel_py-ujson
Package is not yet built: devel_py-simplejson
Package is not yet built: sysutils_bsdstats
Package is not yet built: www_wgetpaste
Package is not yet built: devel_py-greenlet
Package is not yet built: net_py-eventlet
Package is not yet built: graphics_jpeg
Package is not yet built: www_py-requests
Package is not yet built: sysutils_smp_utils
Package is not yet built: textproc_xmlcatmgr
Package is not yet built: textproc_libxslt
Package is not yet built: dns_c-ares
Package is not yet built: databases_ldb
Package is not yet built: devel_libunistring
Package is not yet built: devel_ding-libs
Package is not yet built: devel_nspr
Package is not yet built: security_nss
Package is not yet built: security_krb5
Package is not yet built: security_sssd
Automatically building a * * F A T * * image so we can build ports
Skipping post-package customize steps
00:00:00 # NanoBSD image FreeNAS-9.2.0-RC-13c8167-x64 build starting
00:00:00 ## Clean and create object directory (/pool/freenas/os-base/amd64)
00:00:00 ## Construct build make.conf (/pool/freenas/os-base/amd64/make.conf.build)
00:00:00 ## run buildworld
00:00:00 ### log: /pool/freenas/os-base/amd64/_.bw

00:00:00 ### log: /pool/freenas/os-base/amd64/_.bw

ERROR: build FAILED; displaying contents of /pool/freenas/os-base/amd64/_.bw
00:00:00 ### log: /pool/freenas/os-base/amd64/_.bw
ERROR: build FAILED; displaying contents of /pool/freenas/os-base/amd64/_.bw
===================================================================
--------------------------------------------------------------
>>> World build started on Tue Dec 3 01:43:24 EST 2013
--------------------------------------------------------------
--------------------------------------------------------------
>>> Rebuilding the temporary build tree
--------------------------------------------------------------
rm -rf /pool/freenas/os-base/amd64/pool/freenas/FreeBSD/src/tmp

rm -rf /pool/freenas/os-base/amd64/pool/freenas/FreeBSD/src/lib32

I snip some content here, as there are 1000s of lines following
and it finishes with:
crunchide -k _crunched_vi_stub vi.lo
cc -static -o rescue rescue.o cat.lo chflags.lo chio.lo chmod.lo cp.lo date.lo dd.lo df.lo echo.lo ed.lo expr.lo getfacl.lo hostname.lo kenv.lo kill.lo ln.lo ls.lo mkdir.lo mv.lo pkill.lo ps.lo pwd.lo realpath.lo rm.lo rmdir.lo setfacl.lo sh.lo stty.lo sync.lo test.lo csh.lo atacontrol.lo badsect.lo camcontrol.lo ccdconfig.lo clri.lo devfs.lo dmesg.lo dump.lo dumpfs.lo dumpon.lo fsck.lo fsck_ffs.lo fsck_msdosfs.lo fsdb.lo fsirand.lo gbde.lo geom.lo ifconfig.lo init.lo kldconfig.lo kldload.lo kldstat.lo kldunload.lo ldconfig.lo md5.lo mdconfig.lo mdmfs.lo mknod.lo mount.lo mount_cd9660.lo mount_msdosfs.lo mount_nfs.lo mount_ntfs.lo mount_nullfs.lo mount_udf.lo mount_unionfs.lo newfs.lo newfs_msdos.lo nos-tun.lo ping.lo reboot.lo restore.lo rcorder.lo route.lo routed.lo rtquery.lo rtsol.lo savecore.lo spppcontrol.lo swapon.lo sysctl.lo tunefs.lo umount.lo ping6.lo zfs.lo zpool.lo bsdlabel.lo fdisk.lo dhclient.lo head.lo mt.lo nc.lo sed.lo tail.lo tee.lo gzip.lo bzip2.lo less.lo xz.lo tar.lo vi.lo id.lo chroot.lo chown.lo /pool/freenas/os-base/amd64/pool/freenas/FreeBSD/src/rescue/rescue/../librescue/exec.o /pool/freenas/os-base/amd64/pool/freenas/FreeBSD/src/rescue/rescue/../librescue/getusershell.o /pool/freenas/os-base/amd64/pool/freenas/FreeBSD/src/rescue/rescue/../librescue/login_class.o /pool/freenas/os-base/amd64/pool/freenas/FreeBSD/src/rescue/rescue/../librescue/popen.o /pool/freenas/os-base/amd64/pool/freenas/FreeBSD/src/rescue/rescue/../librescue/rcmdsh.o /pool/freenas/os-base/amd64/pool/freenas/FreeBSD/src/rescue/rescue/../librescue/sysctl.o /pool/freenas/os-base/amd64/pool/freenas/FreeBSD/src/rescue/rescue/../librescue/system.o -lcrypt -ledit -lkvm -ll -ltermcap -lutil -lalias -lcam -lcurses -ldevstat -lipsec -lavl -ljail -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem -lgeom -lbsdxml -lkiconv -lmd -lreadline -lsbuf -lufs -lz -lbz2 -llzma -larchive -lcrypto -lm
nc.lo: In function `_$$hide$$ nc.lo main':
(.text+0x1dbf): warning: warning: mktemp() possibly used unsafely; consider using mkstemp()
/pool/freenas/os-base/amd64/pool/freenas/FreeBSD/src/tmp/usr/lib/libc.a(nsdispatch.o): In function `_nsdispatch':
nsdispatch.c:(.text+0x620): undefined reference to `_nsyyin'
nsdispatch.c:(.text+0x67e): undefined reference to `_nsyyin'
/pool/freenas/os-base/amd64/pool/freenas/FreeBSD/src/tmp/usr/lib/libc.a(nsparser.o): In function `_nsaddsrctomap':
nsparser.c:(.text+0x2a): undefined reference to `_nsyytext'
nsparser.c:(.text+0x30): undefined reference to `_nsyylineno'
/pool/freenas/os-base/amd64/pool/freenas/FreeBSD/src/tmp/usr/lib/libc.a(nsparser.o): In function `_nsyyparse':
nsparser.c:(.text+0x576): undefined reference to `_nsyylex'
nsparser.c:(.text+0x5a2): undefined reference to `_nsyyerror'
nsparser.c:(.text+0x688): undefined reference to `_nsyyerror'
nsparser.c:(.text+0x7c5): undefined reference to `_nsyylex'
*** [rescue] Error code 1
1 error
*** [rescue] Error code 2
1 error
*** [all] Error code 2
1 error
*** [rescue.all__D] Error code 2
8 errors
*** [everything] Error code 2
1 error
*** [buildworld] Error code 2
1 error
===================================================================
ERROR: build FAILED; see above or log file here: /pool/freenas/os-base/amd64/_.bw
to submit a build error type 'env RELEASE_LOGFILE="release.build.log" make build-bug-report '
do_build.sh: ERROR: FreeNAS /pool/freenas/nanobsd/os-base build FAILED; please check above log for more details
*** [do-release] Error code 1

Stop in /pool/freenas.

Script done, output file is release.build.log
*** [release] Error code 1
[/QUOTE]
As you can see, compilation fails while linking with static libc.a



note that to build on FreeBSD 9.2, I had to modified the build scripts as follow:

[QUOTE]
diff --git a/build/build_release.sh b/build/build_release.sh
index dab1265..19c548e 100755
--- a/build/build_release.sh
+++ b/build/build_release.sh
@@ -11,6 +11,6 @@ mydir=`dirname $0`

sh $mydir/do_build.sh -z
sh $mydir/do_build.sh -a
-env FREENAS_ARCH=i386 sh $mydir/do_build.sh -z
-env FREENAS_ARCH=i386 sh $mydir/do_build.sh -a
+#env FREENAS_ARCH=i386 sh $mydir/do_build.sh -z
+#env FREENAS_ARCH=i386 sh $mydir/do_build.sh -a
sh $mydir/create_release_tarball.sh
diff --git a/build/create_release_tarball.sh b/build/create_release_tarball.sh
index 4ba0ba8..dae10d3 100644
--- a/build/create_release_tarball.sh
+++ b/build/create_release_tarball.sh
@@ -18,7 +18,7 @@ rm -rf "${TOP}/release_stage"
set -x
set -e
mkdir -p "${TOP}/release_stage"
-for arch in x64 x86 ; do
+for arch in x64 ; do
eval mapped_arch=\$map_$arch
echo $arch = $mapped_arch
mkdir -p ${TOP}/release_stage/${arch}
diff --git a/build/nanobsd/nanobsd.sh b/build/nanobsd/nanobsd.sh
index eabbf66..e04837c 100644
--- a/build/nanobsd/nanobsd.sh
+++ b/build/nanobsd/nanobsd.sh
@@ -483,7 +483,7 @@ populate_slice ( ) (
$filter_func $filter_arg | \
cpio -dumpv ${mnt}
df -i ${mnt}
-umount ${mnt}
+umount -f ${mnt}
)

populate_cfg_slice ( ) (
@@ -582,7 +582,7 @@ create_i386_diskimage ( ) (
-y ${NANO_HEADS}`
fi

-trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT
+trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount -f ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT

fdisk -i -f ${NANO_OBJ}/_.fdisk ${MD}
fdisk ${MD}
@@ -598,7 +598,7 @@ create_i386_diskimage ( ) (
echo "Generating mtree..."
( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree
( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du
-umount ${MNT}
+umount -f ${MNT}

if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then
# Duplicate to second image (if present)
@@ -609,7 +609,7 @@ create_i386_diskimage ( ) (
do
sed -i "" "s=${NANO_DRIVE}s1=${NANO_DRIVE}s2=g" $f
done
-umount ${MNT}
+umount -f ${MNT}
# Override the label from the first partition so we
# don't confuse glabel with duplicates.
if [ ! -z ${NANO_LABEL} ]; then
[/QUOTE]

reason being it would always abort during the build while trying to unmount os-base/amd64/_.mnt (with error device busy). I haven't spent time looking into why, so I took the brute approach.
I also didn't want to build 32 bits image, it already takes long enough on my VM

I hope I've provided everything you need to help me continue from here... I'm guessing that what would take me a few hours will take you a few seconds ! :)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Forgot to add, his name was "protosd" if you want to go looking for his thread.
 

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
Allright... done... building freenas on freenas now.

It was actually a very simply issue preventing it to build properly.

Googling the error message occurring while libc made me check the symbol that was missing, and sure enough it's not resolved on freenas but was on FreeBSD.
this lead me to this post:
https://groups.google.com/forum/#!msg/mailing.freebsd.current/TUR5ZLPbkTc/f_RGCyrqe7kJ

and the build failing due to a bug with /dev/stdout
so I checked:

lrwxr-xr-x 1 root wheel 4 Dec 3 11:44 /dev/stdout -> /mnt/pool/jails/ports/dev/fd/1

and there you go, the link is an absolute path, regardless of chroot.
So I created a link in the jail like so:
ln -s /dev /mnt/pool/jails/ports/dev

and re-started the compilation...

it went much further, compiled world and kernel just fine.

I did have an error along the way:
===> Fetching all distfiles required by talloc-2.0.8 for building
===> Extracting for talloc-2.0.8
=> SHA256 Checksum OK for talloc-2.0.8.tar.gz.
===> Patching for talloc-2.0.8
===> Applying FreeBSD patches for talloc-2.0.8
===> talloc-2.0.8 depends on file: /usr/local/bin/python2.7 - found
===> talloc-2.0.8 depends on executable: python - found
===> talloc-2.0.8 depends on executable: pkgconf - found
===> Configuring for talloc-2.0.8

===> talloc-2.0.8 needs port lang/python27 to be build with THREADS support.

*** [pre-configure] Error code 1

Stop in /usr/ports/devel/talloc.
*** [build-depends] Error code 1

Stop in /usr/ports_dir/devel/tevent.

why it thinks python27 isn't build with thread support, I don't know. It certainly is:
[root@freenas-surrey1 /pool/freenas]# os-base/amd64/_.w/usr/local/bin/python -m threading
Producer-1.1
Producer-1.2
Producer-2.1
Producer-1.3
Producer-2.2
Producer-3.1
Producer-1.4
Producer-3.2
Producer-3.3
Producer-3.4
Producer-2.3
Producer-1.5
Producer-2.4
Producer-3.5
Producer-2.5

I didn't spend much time there, instead I used the talloc build I had made on my dev VM, and continued on...

On a related topic, and irrelevant of using freenas or freebsd to compile; since upgrading this morning, the makefile has been failing.

# make release
env NANO_LABEL=FreeNAS VERSION=9.2.0-RC GIT_LOCATION=EXTERNAL script -a release.build.log make do-release
Script started, output file is release.build.log
make: don't know how to make do-release. Stop

Script done, output file is release.build.log
*** [release] Error code 2

Stop in /pool/freenas.

Makefile has had no changes in weeks, and I'm puzzled what the problem is, the makefile looks fine to me.
 

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
now one thing interesting (at least to me); is that compiling freenas on my freenas machine (E3-1220 V3) takes 25m5.7s (user: 15m13 sys 1m26). Yet, in my VM (VMWare Fusion on a i7-2600, with only 2 core allocated to the VM and 4GB of RAM) it takes 19m54s (user: 15m15, sys 2m54)

building seems to be significantly faster on the freenas box; it really flies compare to the VM. But it stalls while creating the disk image.
In the log, you can see that it has stalled on some tiny files, you can see the disks activity LEDs blinking like crazy.. By the time the VM has caught up and finishes the building disk image phase very quickly...

it's very weird on how freenas is stalling while building the disk image; at first I thought it had crashed because it stayed over 5 minutes doing nothing (According to the log) yet the disks were very active...

could it be the issue @jgreco was mentioning that too much cache can lead to loss of performance?
 
J

jkh

Guest
First, I commend you for a noble (but quite possibly doomed :)) effort to build FreeNAS on FreeNAS. We build FreeNAS every day here at iXsystems Development Laboratories (we even have coats!) but I can't say one of us has ever even *tried* to build FreeNAS using itself. It just doesn't have the same tool suite and ancillary supporting packages that we list in the README for compiling FreeNAS on FreeBSD 9.2, which is our current build platform of choice (don't try building it on FreeBSD 10 - you will cry), since FreeNAS isn't spec'd as a development platform, it's... well... a NAS! :)

Still, good luck? There's no technical reason why it wouldn't be possible, given enough extra bits and perseverance.

Also, regarding your Makefile problems, that's weird. Are you sure you have a clean checkout of the freenas repo? That "missing target" is definitely in the Makefile!
 

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
Well, I'm building in a "ports" jail/chroot. So technically you could say I'm building on FreeBSD.

If the kernel was patched to allow mounting tmpfs in a jail, that would prevent requiring fiddling with chroot and the /dev issue.

For the Makefile, I'm having the exact same issue on both my FreeBSD VM (proper 9.2) and the freenas port jail.
I'll investigate further...
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Building FreeNAS in a FreeNAS ports jail is on my list of things to try, but I didn't find the time yet.
My current build "machine" is an FreeBSD 9.2 VM. It's a default install -- just select the ports tree and accept all the defaults (including partitioning). The VM has 2GB of memory and I see about 450MB of swap being used during the image compression confirming jayvenard's experience that 2GB is not enough.
I only just now noticed the comment in the readme that ZFS is required to build FreeNAS. The default FreeBSD install creates only UFS partitions and I'm happily building working FreeNAS ISOs with that setup :) (but I did not check the GUI upgrade packages). Jordan, you are the author of the „ZFS required“ comment in the readme. Would you care to enlighten us on why was it added?
 
J

jkh

Guest
I only just now noticed the comment in the readme that ZFS is required to build FreeNAS. The default FreeBSD install creates only UFS partitions and I'm happily building working FreeNAS ISOs :) with that setup (but I did not check the GUI upgrade packages). Jordan, you are the author of the „ZFS required“ comment in the readme. Would you care to enlighten us on why was it added?

Well, in the past (maybe *only* in the past), the build process created datasets for various parts of the build process. However, we also recently broke plugin building out of the freenas project (now its own freenas-plugins repo) and I know that one of the reasons datasets get used is to be able to have an "installworld" dataset for snapshotting and chrooting into for each plugin build (so you only have to do the buildworld/installworld once, then each plugin build can start from the same clean environment). That may have actually been the last remaining use of ZFS, which would render my instructions obsolete. Hmmm. I will try and verify this with a UFS-only install of FreeBSD in the near future, just as soon as I get this %$#@^$# 9.2.0-RC out the door!
 
Status
Not open for further replies.
Top