The mksysimage script uses fileset files, which group files into sets that can be easily included in or excluded from an image.
Filesets let you specify the files, directories, and symbolic links that you want to include in an image, as well and their permissions. If you want to modify the contents of your image, you must ensure that all files you want to include in an image are added to the appropriate filesets, and that files you no longer want are removed from the filesets.
To be used by the image generation process, filesets must be listed in a profile file (see Profiles).
To add a new fileset to an image:
Open the new file, and add a line with the XML declaration, then the name of the fileset. For example:
<?xml version="1.0" encoding="UTF-8"?> <fileset name="basefs.denmark.elsinor">
The name of the fileset isn't significant, but the install_path specified in the profile file <package> element is (see Profiles).
Add any files or symbolic links (symlinks) that you require. For example, the following element adds a new horatio configuration file:
<!-- horatio config files --> <file name="etc/system/config/file_horatio.conf" uid="root" gid="nto" mode="0755"/>
Add the new fileset to a profile file, such as os.xml or dos-variant.xml. For example:
<include-fileset name="basefs.denmark.elsinor"/>
Before you can reference a user (uid) or group (gid) in a fileset, you must define them in the appropriate user and group configuration files. If the user or group is referenced, but isn't appropriately defined in these files, the image generation process will fail.
By default, if the mksysimage script can't find a file listed in a fileset it will fail and exit. To prevent mksysimage from exiting when it can't find a file listed in a fileset, you can do one of the following:
Set the optional attribute for individual files listed in a fileset to true. If this attribute is set, if mksysimage can't find the file, it ignores it. For example, the following will cause mksysimage to ignore scripts/env.override.board if it can't find it:
<file name="scripts/env.polonius.board" optional="true" uid="root" gid="nto" mode="0750"/>
The optional attribute is itself optional. You can simply omit it and mksysimage assumes that is is set to "false": fail if the file is not found.