How to compile FreeNAS 8

Status
Not open for further replies.

pauldonovan

Explorer
Joined
May 31, 2011
Messages
76
If I build FreeNAS from SVN and change the install size in freenas-common to 2g, will updating a 'standard' install using the firmware upload page with the built .xz file successfully expand the install size? In other words will the two 512MB partitions be increased to two 1GB partitions on reboot?

The reason why I ask is that I can build OK, but I'm having a hard time correctly copying the .full image to a USB drive in OS X (it fails to find /dev/ufs/FreeNASs3 and drops me into /bin/sh. Same as here: https://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=38&t=9819).

It will be easier for me to use a working 1GB install that I created on a Windows PC and 'upgrade' it. If it works...

Paul
 

heavydrinker

Cadet
Joined
May 30, 2011
Messages
5
Hi thanks a lot for this post.

If i understand, to perform an install in entire usb key (like 8gb) ! this procedure is perfect. Can*I*install*several other*packages*in*freenas*after*install? Because today the pkg_add command failed on classic freenas 8 install !
I hope to install java and tomcat server !
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
@ HeavyDrinker
Right now all I can say is my 2GB USB drive when I looked at it last week, it was partitioned into 4 sections. Two of them were large just over 900MB, the other ones were very small and I didn't notice the size, they could hold configuration data or boot files, or nothing? I don't know. The important part was the large 900+ MB partitions, one I understand is for the active revision, the other is used for an upgrade or reverting back from an upgrade.

I know there are folks here much smarter on this topic than I am. As for installing packages, I don't know the answer and I guess it depends on how small a footprint the programmers are desiring.
 

jjstecchino

Contributor
Joined
May 29, 2011
Messages
136
I think the CF layout is a typical nanobsd. 2 large equal size partitions, only one of which is active at any given time. This partition will be mounted readonly as /. These partition will contain the active freebsd and freenas code. A third small partition which will be used to persist configuration data on boot. This is mounted briefly as read-write as /cfg on boot and its content is copied to /etc. /etc as well as /var are memory based partitions. These partitions contain frequently written files and are memory based to avoid continuously write on a CF memory device which has a limited amount of write cycles before is ruined. Whenever you modify something in /etc and you don't copy that back to /cfg, your changes will be lost upon next reboot. In order to copy stuff to /cfg you have to mount it first, copy then unmount.

As the ability to add packages will be added to freenas I believe the initial 1gb CF choice will be not enough.

One solution would be to provide new releases on different CF sizes i.e 1,2,4,8,16 gb end you would install the one matching your cf size.

I do not know if the two code partitions can be dynamically resized once written to CF.
 

heavydrinker

Cadet
Joined
May 30, 2011
Messages
5
Ok, thanks.
Can you described process to add packages just after installing freenas source code in freebsd vm?
May be i CAN customize size of freenas and add java, tomcat packages in new freenas custom release ?

Thank you for you help
 

jjstecchino

Contributor
Joined
May 29, 2011
Messages
136
Ok, thanks.
Can you described process to add packages just after installing freenas source code in freebsd vm?
May be i CAN customize size of freenas and add java, tomcat packages in new freenas custom release ?

Thank you for you help

Here we go....

Lets install a media server. I like mediatomb because with few mods will serve movies, music and pictures to xbox, playstation and the very picky samsung tv.

Mediatomb has a lot of dependencies and use quite bit a of space, so I compiled Freenas for a 2Gb usb stick, otherwise it will not fit. If your packages are large use a larger stick accordingly.

Once you have freenas compiled and installed go to the Web GUI on the services page. Configure SSH to allow login from root with password and start the service.

Use an SSH client, I like putty which is of nimble size but powerful.

With putty SSH to your freenas box and login as root. The password is the GUI admin password.

Once you are logged in run

mount

The output is something like this:
Code:
/dev/ufs/FreeNASs1a on / (ufs, local, read-only, soft-updates)
devfs on /dev (devfs, local, multilabel)
/dev/md0 on /etc (ufs, local)
/dev/md1 on /mnt (ufs, local)
/dev/md2 on /var (ufs, local)


Note the partition that is mounted as / in this case /dev/ufs/FreeNASs1a
This is one of the 2 large "code" partition nanobsd creates on the usb stick.

Now remount the partition read-write:

mount -o rw /dev/ufs/FreeNASs1a /

now you are ready to install packages

pkg_add -r mediatomb or whatever you need.

Tweak the configuration files now that the filesystem is RW and keep in mind that if your packages needs to write files i.e. mediatomb needs to update a sqlite database you have to instruct your package to store these files on a writable partition. The only writable disk based partition in Freenas are the actual volumes created in the GUI. they are mounted into /mnt/yourvolumename, make a directory in one of your nas volumes and instruct your package to use that directory for its writable files.

You can remount the filesystem as ro with:

mount -o ro /dev/ufs/FreeNASs1a / or reboot. Upon rebooting the FS will be RO again.

Please note the package is installed in only one of the two partitions so if you swhitch to the other one your package will not be there.

Also your packages will be lost upon upgrading and will need to be installed again once you do that.

Hope it does help
 

rccypher

Cadet
Joined
Aug 6, 2011
Messages
1
I'm loving the MoJo here guys. Thanks for all the help so far. However I have found that mediatomb doesn't support the xbox 360. As this is the platform I would be trans-coding and streaming to I am having some issues finding a resolution. I was thinking perhaps I would try to install fuppes instead of mediatomb, and I am curious if anyone has any thoughts on this matter? Other suggestions perhaps? Please let me know. I will be posting the results and a How-To If I am able to get the system up and working properly.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Right now I believe UPnP might be a plug-in item. Even if one flavor of UPnP is installed, lets say MediaTomb for argument sake, you should be able to add Fuppies as an add-on/plug-in later. I'd like to see Serviio as it supports DLNA 1.5. I think Fuppies could be easily added right now if you compiled it yourself.
 

isirotin

Cadet
Joined
Sep 12, 2011
Messages
4
Hello guys!

I'm trying to compile FreeNAS 8.0.1 REL amd64 in order to incorporate a RAID controller driver into kernel.

I'm doing the following steps:

Code:
cd /usr/local/freenas801/
svn co -r 8080 https://freenas.svn.sourceforge.net/svnroot/freenas/trunk
cd trunk


after that I modify nanobsd/FREENAS.amd64 file to remove some options related to mfi driver (see this topic)

then:

Code:
setenv FREEBSD_CVSUP_HOST cvsup7.ru.freebsd.org
sh build/do_build.sh


But during installworld procces I always got the following error: (in _.iw)
Code:

if [ -L /usr/local/freenas801/trunk/obj.amd64/_.w/usr/include/ufs/ffs ]; then  rm -f /usr/local/freenas801/trunk/obj.amd64/_.w/usr/include/ufs/ffs;  fi
if [ -L /usr/local/freenas801/trunk/obj.amd64/_.w/usr/include/ufs/ufs ]; then  rm -f /usr/local/freenas801/trunk/obj.amd64/_.w/usr/include/ufs/ufs;  fi
if [ -L /usr/local/freenas801/trunk/obj.amd64/_.w/usr/include/machine ]; then  rm -f /usr/local/freenas801/trunk/obj.amd64/_.w/usr/include/machine;  fi
if [ -L /usr/local/freenas801/trunk/obj.amd64/_.w/usr/include/crypto ]; then  rm -f /usr/local/freenas801/trunk/obj.amd64/_.w/usr/include/crypto;  fi
mtree -deU   -f /usr/local/freenas801/trunk/FreeBSD/src/include/../etc/mtree/BSD.include.dist  -p /usr/local/freenas801/trunk/obj.amd64/_.w/usr/include
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error


These operations worked ok for FreeNAS8.0 RELEASE.

Any suggestions?

Thank you in advance
 

jjstecchino

Contributor
Joined
May 29, 2011
Messages
136
I'm loving the MoJo here guys. Thanks for all the help so far. However I have found that mediatomb doesn't support the xbox 360. As this is the platform I would be trans-coding and streaming to I am having some issues finding a resolution. I was thinking perhaps I would try to install fuppes instead of mediatomb, and I am curious if anyone has any thoughts on this matter? Other suggestions perhaps? Please let me know. I will be posting the results and a How-To If I am able to get the system up and working properly.

Definitely some upnp/dlna server do better than other at supporting different clients. Mediatomb unfortunately does not support xbox 360. On the old freenas 7 fuppes did a good job with the xbox but did not support samsung tv. I guess in the future there will be several plug-in available and you will have to chose the one which suits you needs best.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Even though this is a little off topic, the UPnP is going strong with minidlna. It works like a champ for me but my needs are simple. I think you're correct about many plug-ins are in the future and I can't wait but that will likely be a year away. All I see now are people manually installing or compiling custom builds (like me).
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
@isirotin
So you are trying to compile version 8080? What exactly did you do to modify the FREENAS.amd64 file? The link you had doesn't tell me enough. I'm probably not the best one to help you here but I'll give it a shot. I'm learning more about how FreeNAS is built every day.

Did you put a ticket in for this issue? That is the real solution, when the fix it incorporated into the software from the developers.
 

isirotin

Cadet
Joined
Sep 12, 2011
Messages
4
Yes, I'm trying to compile rev 8080 because its clean 8.0.1RELEASE.
I've modified (commented) these lines in FREENAS.amd64:

Code:
     
#device     cbb    #cardbus (yenta) bridge
#device     mpt   # LSI-Logic MPT-Fusion
#device     mfi    #LSI MegaRAID SAS



Also notice another error earclier int _.iw:
Code:
if [ -L /usr/local/freenas801-8080/trunk/obj.amd64/_.w/usr/include/netatalk ]; then  rm -f /usr/local/freenas801-8080/trunk/obj.amd64/_.w/usr/include/netatalk;  fi
env ECHO="echo"  MAKE="make"  NEWVERS_SH=/usr/local/freenas801-8080/trunk/FreeBSD/src/include/../sys/conf/newvers.sh  PARAM_H=/usr/local/freenas801-8080/trunk/FreeBSD/src/include/../sys/sys/param.h  /usr/local/freenas801-8080/trunk/FreeBSD/src/include/mk-osreldate.sh
env: not found
*** Error code 127
if [ -L /usr/local/freenas801-8080/trunk/obj.amd64/_.w/usr/include/netgraph ]; then  rm -f /usr/local/freenas801-8080/trunk/obj.amd64/_.w/usr/include/netgraph


You think better to write a bug ticket?
 

isirotin

Cadet
Joined
Sep 12, 2011
Messages
4
Never mind.
The process finished successfully when I ran it on the real server, not on VirtualBox VM. Don't know what was the matter but this is it.
 

jerrybme

Dabbler
Joined
Sep 28, 2011
Messages
40
Never mind.
The process finished successfully when I ran it on the real server, not on VirtualBox VM. Don't know what was the matter but this is it.

Hmm, I wonder if this compile problem is related to this story .

I've been seeing the same error on my compiles for the last 2 days using a VM in Virtual Box. Keep hoping an update to the netatalk port will fix it.
 

Noodle

Dabbler
Joined
Oct 26, 2011
Messages
24
Hi Forum,

I get latest source code from svn, I have build environment setup, but after build, /boot/kernel/ contains no .ko file? and I cannot "kldload zfs.ko"? This is right?

And after decompress .xz file, it's not 2G, it's about 988M. I follow the guide from here.
On vSphere 5 virtual machine:
1. Install FreeBSD 8.2 release
2. issue "freebsd-update fetch install".
3. install subversion, cdrtools
4. svn check out code
5. edit nano_env to enable MULTIMEDIA
6. sh build/do_build.sh
7. (optional) sh build/create_iso.sh

Did I miss something?

Thanks

Noodle
 

SeeJayEmm

Cadet
Joined
Nov 15, 2011
Messages
1
Confused...

So I followed these steps about a month ago successfully and build a FreeNAS nightly in a VM.

Today I attempted to just update the source and build a new ISO. I did an "svn update" followed by a build/do_build.sh and it failed.

I wiped out the trunk directory and started over from scratch. Same problem. It grabs the source via cvsup, patches the source, and then dies here:

build# build/do_build.sh
/usr/local/trunk/build/nanobsd/nanobsd.sh -c /usr/local/trunk/nanobsd/freenas-common -j 5
Sourcing /usr/local/trunk/nanobsd/freenas-common
do_build.sh: ERROR: FreeNAS build FAILED; please check above log for more details​

So I try to run it manually:
build# /usr/local/trunk/build/nanobsd/nanobsd.sh -c /usr/local/trunk/nanobsd/freenas-common -j 5
/usr/local/trunk/build/nanobsd/nanobsd.sh: Permission denied.​

Easy fix right, I chmod 755 nanobsd.sh and try again:
build# /usr/local/trunk/build/nanobsd/nanobsd.sh -c /usr/local/trunk/nanobsd/freenas-common -j 5
Sourcing /usr/local/trunk/nanobsd/freenas-common

That's it, that's all I get. Am I doing something blatantly and obviously wrong? I'd appreciate any help I could get. Thanks.


EDIT: of course after I reach my wits end and post here I have an idea. It appears the build process now requires git to be installed as well. Once I added that package I was able to start the build. You may want to update the 1st post.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
The 'git' issue has been resolved and does not need to be added separately. You just caught one of the many issues we deal with when compiling code that gets broken often.
 

donairb

Dabbler
Joined
Jan 5, 2012
Messages
19
OK. I think I'd like to try this, but am wondering if it's possible (it might be something obvious I'm overlooking) to recompile the release version, as opposed to the latest build. I would simply like to add a package or two to the existing build and reconfigure.

Thanks

Brian
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
OK. I think I'd like to try this, but am wondering if it's possible (it might be something obvious I'm overlooking) to recompile the release version, as opposed to the latest build. I would simply like to add a package or two to the existing build and reconfigure.

Thanks

Brian

Absolutely, these 2 threads are very helpful:

http://forums.freenas.org/showthrea...e-(including-nut)-and-customize-FreeNAS-8-0-2!

http://forums.freenas.org/showthrea...e-FreeNAS-image-quot-devguide&highlight=ports
 
Status
Not open for further replies.
Top