Subsections


1.1 OPT_LNK - Creation Of Links

1.1.1 Introduction

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.

1.1.2 Examples

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

1.1.3 Configuration

OPT_LNK
Setting this to ``yes'', activates the package.
LNK_N
This variable holds the number of links to be created.


In the following variables x has to be replaced by an index number!

LNK_x_OPT
With this variable you may change the options transferred to the program ``ln'' during linking of Source and target. The default ``-fs'' is correct in most use cases and should not be changed.
LNK_x_DST
This variable holds the target of the link. By the name provided here you may acces the Source after link creation. As a rule of thumb the target referenced here should not exist.


Attention: If the target exists it will be deleted without warning!

LNK_x_SRC
This variable holds the source for the link to be created. This may be a file or a directory.


Important: The source mentioned here has to exist at the time of link creation!

© 2001-2015 The fli4l-Team - 26 April 2015