Buildfile syntax

QNX SDP8.0Building Embedded SystemsConfigurationDeveloper

The buildfile text may include blank lines and comments. All sections are optional, but not all combinations are permitted.

The general format for a buildfile is:
attribute filename contents
attribute filename contents
For example, consider the line:
[virtual=aarch64le,elf +compress] .boot = {
This has an attribute of [virtual=aarch64le,elf +compress] and a filename of .boot. The contents part of the line is what we call an inline file.
Note:
  • In a buildfile, a number sign (#) indicates a comment; anything between it and the end of the line is ignored. Make sure there's a space between a buildfile command and the number sign.
  • For full information about attributes and modifiers used in buildfiles, see the mkifs documentation in the Utilities Reference.
  • For information about buildfiles used to generate flash filesystem images (instead of OS images), see mkefs and its buildfile and the entry for mkefs in the Utilities Reference.

Attributes

Two types of attributes can be present in a buildfile:

Boolean ([+attribute] | [-attribute])
Turn on or off a specific attribute. For example, [+script] turns on the script attribute, and [-optional] turns off the optional attribute.
Value ([attribute=value])
Assign a value to an attribute (e.g., [uid=0]). Note that there are no spaces around the equals sign.
When combining attributes, put all attributes together inside the square brackets. For example:
  • Correct: [attr1 attr2]
  • Wrong: [attr1] [attr2]
In other words, use this syntax: [uid=0 gid=0] file_owned_by_root. The following is incorrect:
# Wrong!
[uid=0] [gid=0] [perms=0666] file1
The above attributes should be combined as follows:
# Correct!
[uid=0 gid=0 perms=0666] file1
Attributes can apply to a single file or to all files listed after the attribute. For example:
  • Attributes apply to a single file:
    [uid=7] file1_owned_by_user7
    [uid=6] file2_owned_by_user6
  • Attributes apply to all subsequent files:
    [uid=7]
    file1_owned_by_user7
    file2_owned_by_user7

Modifiers

Buildfile modifiers use the same syntax as buildfile attributes (e.g., [some_modifier]), but apply to commands in script files.

Inline files

Inline files are a convenient way to place a file in the image without actually having a separate file. Instead of getting the file contents from the filesystem on the host machine, mkifs gets them from the text enclosed in braces in the buildfile itself.

The following rules apply to inline files:
  • You can pick any filename you like, but it's good practice (and kind to those who may come after you) to give the files meaningful names such as .boot or boot, or .script.
  • The contents of the inline file can't be on the same line as an opening or closing brace.
  • Leading spaces count.
  • To put {, }, or \ characters in the file, preceed each one by a backslash (e.g., \{, \}, \\).
  • Filenames that use special (i.e., non-alphanumeric) characters must be enclosed in double quotation marks. For example, a file called I "think" so, must be specified:
    "I \"think\" so" = ...
    
Page updated: