With this package it is possible to make links to files/folders during the boot process. This is particularly useful for volatile configuration and log files such as the imonc telephone directory /etc/phonebook to prevent losing all changes after the next reboot. Even complete directories can be ``moved'', i.e. /var/log.
This package is an adaptation of Alexander Krause's OPT_LNK package to fli4l 3.x.
To link the directory /var/log to the harddisk, change the variables in config/lnk.txt like this:
OPT_LNK='yes' # 'yes' installs the package to the router LNK_N='1' # Number of links, here '1' LNK_1_OPT='-fs' # Link 1: Options LNK_1_DST='/var/log' # Link 1: Target LNK_1_SRC='/data/var/log' # Link 1: Source
Important: The target of the link (here: /var/log) must be on a writable
file system in order to create the folder; so in this case /var has to be
a writable directory. If not, the link can not be created. Of course the target
(here: /data/var/log) must exist at the time of link creation.
If the target (here: /var/log) already exists at the time of
link creation, it will be deleted! (this is no problem in the example as at the
time of link creation the directory is empty anyway.)
To make the imonc phone book persistent, at first copy it to a directory on your harddisk (i.e. to /data/etc/phonebook) and create an additional link:
OPT_LNK='yes' # 'yes' installs the package to the router LNK_N='2' # Number of links, here '2' LNK_1_OPT='-fs' # Link 1: Options LNK_1_DST='/var/log' # Link 1: Target LNK_1_SRC='/data/var/log' # Link 1: Source LNK_2_OPT='-fs' # Link 2: Options LNK_2_DST='/etc/phonebook' # Link 2: Target LNK_2_SRC='/data/etc/phonebook' # Link 2: Source
In the following variables x has to be replaced by an index number!
Attention: If the target exists it will be deleted without warning!
Important: The source mentioned here has to exist at the time of link creation!