Menu

[r5280]: / legacy / build / README  Maximize  Restore  History

Download this file

99 lines (69 with data), 3.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
FreeNAS (http://freenas.org) 
Olivier Cochard-Labbe (olivier@freenas.org)
Licence: BSD

============== SUMMARY =========

1. Files and directories listing
2. Preparing your FreeBSD for compiling FreeNAS
3. How to generate an FreeNAS ISO or IMG  file
4. Building FreeNAS from the latest sources
5. Building kernel

================================
1. Files and directories listing
- /freenas/bootloader : Contains FreeBSD boot loader files
- /freenas/rootfs: Minimum FreeBSD root filesystem and FreeNAS script/WebGUI
- /freenas/svn: Contains the whole up-to-date (working) release and scripts

===============================================
2. Preparing your FreeBSD for compiling FreeNAS
The FreeNAS build scripts are stupid scripts: They copy the binary files of your FreeBSD host.
This means that your FreeBSD used for compiling FreeNAS need to be compiled/re-installed with this /etc/make.conf:
- NO_SHARED=no
- Debug symbol disabled (comment the line WITH_DEBUG=yes if you have it)
- Remove all customization for CPU (comment the line CPUTYPE?=native if you have it)
Check the make.conf include in the source

Note about NO_SHARED: It seems that since FreeBSD 5.0 many executables binaries in /bin and /sbin are build using dynamic linking (this KNOBS is a m0n0wall heritage, don't know if it's still important to use it).

=============================================
3. How to generate an FreeNAS ISO or IMG file

Edit the script '/freenas/svn/build/make.sh' and adapt the directory
variables with your local ones.

Check that you have installed the following ports:
- subversion
- bash
- cdrtools
- portupgrade

Additional you might install the following ports, otherwise they are build
from sources:
- perl
- ruby
- m4
- bison

Start /freenas/svn/build/make.sh

Burn the freenas.iso file created.

=================================
3. Building FreeNAS from the latest sources

(normally possible with make.sh)

Here is how to build FreeNAS from the latest sources:

- Use the root user account on your FreeBSD system

3.1 Update your FreeNAS scripts/WebGUI code with SVN:
(this creates the svn directory)

cd /usr/local/freenas

svn co https://freenas.svn.sourceforge.net/svnroot/freenas/trunk svn

You should now have these directories:
/usr/local/freenas
/usr/local/freenas/svn

3.2 Update your ports collection:

Using portsnap the first time:
portsnap fetch extract

To update the ports collection next time:
portsnap fetch update

3.3 Use the building script:

svn/build/make.sh

Execute all menus in '20 - Build FreeNAS from scratch advanced menu' to build your FreeNAS from scratch. After that use one of the following menus:

10 - Create 'Embedded' (IMG) file (rawrite to CF/USB/DD)
11 - Create 'LiveCD' (ISO) file
12 - Create 'LiveCD' (ISO) file without 'Embedded' file
13 - Create 'Full' (TGZ) update file

=================================
4. Building kernel

Before building the kernel it is recommended to delete the directory /usr/src completely.
Next, run the build scripts and update the kernel sources via cvsup + freebsd-update.
Continue building using the 'Build kernel' menu in the build script.
 
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.