info.nfo Specification

This text defines the outer and inner form of the files named 'info.nfo' used by the FreeWRT ADK. These files provide certain information about the part they belong to which has to be shared between different parts of the development kit. The intention is to reduce redundancy and to ease the task of providing information to different parties, as these files will be taken as source of information in any case.

Outer Form

Every package distributed with the FreeWRT ADK possesses it's own info.nfo file. Other parts of the development kit may additionally be endorsed with info.nfo files later, if necessary or useful. The packages' info.nfo files are placed each at the relative path package/<pkg-name>/info.nfo.

Inner Form

The file contains key-value statements and comments only. Empty lines (i.e. only containing a newline character) and those beginning with a hashmark (#) are treated as comments and are therefore stripped before any interpreting occurs.

Keys

Key names must be unique within the file they appear. They must only consist of the characters A-Z, 0-9 and '_' (i.e., they are NOT case sensitive and therefore everything is written uppercase) and may not start with a digit. A key definition consists of a line stating first the key itself, immediately followed by a TAB character. The rest of the line is interpreted as the value (or part of).

Values

Key values are strings that may also contain newlines. Backslashes (\) have to be escaped by doubling them (\\). To define multi-line values, all subsequent lines extending the value string must start with a TAB character (which is stripped by the parser). To split single-line statements across several lines, all lines except the last one must end with a single backslash, and all lines except the first one (containing the key definition) have to begin with a TAB. The parser will strip each backslash, the immediately following newline and the TAB character of the next line.

Examples

This section is split into two parts, the first one giving samples of the syntax used internally, the second part shows a sample usage scenario of the file in the build system.

Syntax Samples

Following are some sample input lines and how they would be interpreted (for unambiguousness of interpretation shown in bash-notation). To make it more readable, TAB characters aren't written out but substituted with '<TAB>':

input:

FOO_BAR<TAB>this is the value of it

interpreted:

FOO_BAR="this is the value of it"

input:

FOO_BAR<TAB>here
<TAB>we
<TAB>go

interpreted:

FOO_BAR="here
we
go"

input:

FOO_BAR<TAB>this \
<TAB>is split \
<TAB>across several \
<TAB>lines

interpreted:

FOO_BAR="this is split across several lines"

input:

FOO_BAR<TAB>this\
<TAB> is another way\
<TAB> defining the space\
<TAB> at the beginning

interpreted:

FOO_BAR="this is another way defining the space at the beginning"

input:

FOO_BAR<TAB>here is
# a comment
<TAB><TAB>an indented line

interpreted:

FOO_BAR="here is
<TAB>an indented line"

(note that the comment and ONLY the first TAB is stripped, leading to a single TAB being in the resulting string)


input:

FOO_VERY_VERY_VERY_LOOOONG_BAR<TAB>\
<TAB>making the file more readable :)

interpreted:

FOO_VERY_VERY_VERY_LOOOONG_BAR="making the file more readable :)"

Usage Sample

$(TOPDIR)/package/radvd/info.nfo:

NAME    radvd
VERSION 0.7.3
RELEASE 2
MD5SUM  56ce3f8cbf5966a0d531c21813320423
SOURCES http://v6web.litech.org/radvd/dist \
        http://download.sourcemage.org/mirror
SOURCENAME      $(PKG_NAME)-$(PKG_VERSION).tar.gz
INIT_NUM        51
SECTION net
PRIORITY        optional
PKG_DEPENDS     kmod-ipv6
DESC_LINE       IPv6 Routing Advertisement Daemon
DESC_FULL       Routing Advertisement Daemon for IPv6

        http://v6web.litech.org/radvd/
SYMBOL  FWRT_PACKAGE_RADVD
DEFAULT_STATE   n
SELECT  FWRT_PACKAGE_KMOD_IPV6 \
        BUSYBOX_CONFIG_FEATURE_IPV6

A script creates a set of files based on the one shown above:

$(TOPDIR)/package/radvd/info.mk:

PKG_NAME:=              radvd
PKG_VERSION:=           0.7.3
PKG_RELEASE:=           2
PKG_MD5SUM:=            56ce3f8cbf5966a0d531c21813320423
PKG_INIT:=              51

PKG_SOURCE_URL:=        http://v6web.litech.org/radvd/dist \
                        http://download.sourcemage.org/mirror
PKG_SOURCE:=            $(PKG_NAME)-$(PKG_VERSION).tar.gz

$(eval $(call PKG_template,RADVD,radvd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))

$(TOPDIR)/package/radvd/info.cfg:

config FWRT_PACKAGE_RADVD
        prompt "radvd............................. IPv6 Routing Advertisement Daemon"
        tristate
        default n
        select FWRT_PACKAGE_KMOD_IPV6
        select BUSYBOX_CONFIG_FEATURE_IPV6
        help
          Routing Advertisement Daemon for IPv6

          http://v6web.litech.org/radvd/

$(TOPDIR)/package/radvd/ipkg/radvd.control:

Package: radvd
Priority: optional
Section: net
Depends: kmod-ipv6
Description: IPv6 Routing Advertisement Daemon

No guarantee on that, the implementation may differ from it, as it's not yet done and some stuff can be generated at runtime (ipkg CONTROL files e.g.)