|
1 http://phaq.phunsites.net/2006/06/25/streamline-userland-installation-on-freebsd-jails-using-sysinstall/ |
|
2 |
|
3 |
|
4 Streamline Userland Installation On FreeBSD Jails Using SysinstallPosted |
|
5 by: admin : Category: jails |
|
6 There is probably a dozen of ways to install the userland for use within |
|
7 a FreeBSD jail. |
|
8 |
|
9 Most of the documentation I saw (including the man page itself) refers |
|
10 to building/installing from the source tree. Sysinstall seems only to be |
|
11 considered for additional post-configuration tasks and is always run |
|
12 inside of the jail. |
|
13 |
|
14 While building/installing a jail may have it’s advantages in respect to |
|
15 security flaws or bugs in general, installing through sysinstall may be |
|
16 faster and probably less error prone. |
|
17 |
|
18 It is in fact very easy to run sysinstall in non-interactive mode on the |
|
19 host itself (not inside the jail!) from a shell script, which may |
|
20 optionally run some post-installation tasks afterwards. |
|
21 By the fact that sysinstall can use the same command line arguments as |
|
22 if given through a configuration file, a single line could be used in |
|
23 your script to achieve this: |
|
24 |
|
25 # sysinstall nonInteractive=yes \ |
|
26 _ftpPath=ftp://ftp2.ch.freebsd.org/pub/FreeBSD \ |
|
27 mediaSetFTP distSetMinimum installRoot=/var/jails/192.168.0.1 \ |
|
28 releaseName=6.1-RELEASE installCommit |
|
29 |
|
30 This line would cause sysinstall to run in non-interactive mode, useing |
|
31 ftp://ftp2.ch.freebsd.org/pub/FreeBSD as it’s download source. |
|
32 DistSetMinimum selects the smallest userland possible while installRoot |
|
33 is given to define destination directory. |
|
34 |
|
35 releaseName ist required to choose the actual release and must be set to |
|
36 your main release (e.g. 6.0-RELEASE, 6.1-RELEASE, etc). If you don’t set |
|
37 it, sysinstall will use the release name of your currently installed |
|
38 userland (e.g. 6.1-RELEASE-p1) and will most definitly fail because |
|
39 there exists no such distribution set for download. |
|
40 It is also possible to choose a different release like 5.5-RELEASE to be |
|
41 installed inside a jail. You must consider though that most tools will |
|
42 run expect those that interact with the kernel directly (ps, top, etc). |
|
43 In generall I would not recommend mixing releases expect you have a very |
|
44 good reason to do so. |
|
45 |
|
46 Don’t forget to add the installCommit command at the end otherwise |
|
47 sysinstall won’t do anything at all. |
|
48 |
|
49 By examing the sysinstall man page you will find other options to select |
|
50 different (or build customer) dist sets. |