FreeNAS 0.7 live: how to install packages (like mldonkey)

If you want to install FreeBSD packages on FreeNAS live you have to “move” your /usr/local directory where you have more space.
This is what you have to do to install mldonkey, for example:
Create a directory local inside your storage:
mkdir /data/local
now copy the content of the current local directory to the new one:
cp -a /usr/local/ /data/local/
and link it in it’s new place, after removing the old one:
rm -r /usr/local
ln -s /data/local /usr/local

Now your /usr/local dir have more spaces and you can install whatever you want. I’ve installed mldonkey with
pkg_add -r ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/net-p2p/mldonkey-core-3.0.1_1.tbz
(since FreeNAS it’s based on FreeBSD 7.2) then i’ve moved my home dir to the storage doing the same things above.
NB: mldonkey needs libmagic.so.3, you can download it from here and you have to copy it at boot time in /usr/lib.
To have all the jobs done at startup you’ve to create a simple script (and put it in your storage, i’ve created mine in /data dir):

sistemadir.sh
#!/bin/sh

rm -r /usr/local
ln -s /data/local /usr/local
rm -r /usr/home/simplex
ln -s /data/simplex /usr/home/simplex
cp /data/libmagic.so.3 /usr/lib
ldconfig

Now chmod +x the script and tell FreeNAS to launch it after boot.
Go to System->Advanced->Command scripts and add the command sh /data/sistemascript.sh or whatever you’ve called it and set type PostInit.
I’ve also added screen to launch mlnet inside it.
Enjoy mldonkey on FreeNAS!

2 pensieri riguardo “FreeNAS 0.7 live: how to install packages (like mldonkey)”

  1. I´ve followed your instructions and after freens reboot my local dir is gone. any idea how to revert the default? I´m nor being able to connect via ssh nor enter webadmin.
    thanks

  2. This is a bit strange, are you sure you’ve copied the “old” local content to the new one? And that you’ve created it in your storage?
    FreeNAS live extract it directories from the image to the ramdisk, after that /usr/local should be replaced with the “new” one.
    All files that you want to keep after a reboot must be stored in your storage.
    I think the problem is in your script, could you paste it here?
    If you have physical access to the machine i could suggest to take a look with the root account, press 6 in the menu and remove the script.

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *