Metafiles ========= Metafiles are used to let a filesystem builder, such as mkcramfs and mkfs.jffs2, ignore files and change attributes of files while building the filesystem. This document briefly describes how Axis Communications are using metafiles with mkcramfs amd mkfs.jffs2 and is also a proposal of a metafile standard for filesystem builders. Metafile Format =============== An instruction is a line in a metafile telling the filesystem builder if anything special should be done with a file or directory before writing it to the filesystem. The following instructions should be recognized by the filesystem builder: Ignore ------ Syntax: "Ignore: FILE" Ignores a file or directory. I.e. FILE is not included in the filesystem. The metafiles themselves are always ignored and do not have to be mentioned in any metafiles. IgnoreContents -------------- Syntax: "IgnoreContents: DIRECTORY" Ignores the contents of a directory. I.e. DIRECTORY is included in the filesystem but all files and directories in DIRECTORY are ignored. Include ------- Syntax: "Include: FILE" Includes a file or directory. If an Include instruction is found in a metafile, all files or directories (in the same directory as the metafile) that are not included will be ignored (NOTE!). Device ------ Syntax: "Device: FILE TYPE MAJOR MINOR" Convert a regular file to a device special file. If FILE exists it will be written to the filesystem as a character or block special file with MAJOR and MINOR numbers. TYPE is 'b' for block and 'c' for character device. Example: To create the character special file /dev/ttyS0 using metafiles, add the following line to the metafile in the /dev directory: Device: ttyS0 c 4 64 UserId ------ Syntax: "UserId: FILE UID" Change file owner. The owner of FILE will be UID. DefaultUserId ------------- Syntax: "DefaultUserId: UID" Change file owner recursively. All files and directories in this directory will be owned by UID unless overridden with the UserId instruction. GroupId ------- Syntax: "GroupId: FILE GID" Change group ownership on a file or directory. The group membership of FILE will be GID. DefaultGroupId -------------- Syntax: "DefaultGroupId: UID" Change gruop ownership recursively. The group membership of all files and directories in this directory will be GID unless overridden with the GroupId instruction.