Skip to content

Commit

Permalink
Added documentation for mdraid and f2fs images
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Mudrunka <[email protected]>
  • Loading branch information
Harvie committed Dec 30, 2024
1 parent 43a3588 commit 6f40ffd
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 3 deletions.
54 changes: 52 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ Here are all options for images:
Additionally each image can have one of the following sections describing the
type of the image:

cpio, cramfs, ext2, ext3, ext4, file, flash, hdimage, iso, jffs2, qemu, squashfs,
tar, ubi, ubifs, vfat.
cpio, cramfs, ext2, ext3, ext4, f2fs, file, flash, hdimage, iso,
jffs2, mdraid, qemu, squashfs, tar, ubi, ubifs, vfat.

Partition options:

Expand Down Expand Up @@ -297,6 +297,15 @@ Options:
:usage-type: Specify the usage type for the filesystem. Only valid with mke2fs.
More details can be found in the mke2fs man-page.

f2fs
****
Generates F2FS images.

Options:

:label: Specify the volume-label.
:extraargs: Extra arguments passed to mkfs.f2fs

file
****

Expand Down Expand Up @@ -472,6 +481,43 @@ Options:

:extraargs: Extra arguments passed to mkfs.jffs2

mdraid
****
Generates MD RAID images.

Options:

:label: Text name of array, eg: localhost:42
:level: RAID level, currently only level 1 (default) is supported
:devices: Number of devices in array (default 1)
:role: 0 based index of this image in whole array. (autoassigned by default)
:timestamp: Unix timestamp of array creation (current time by default)
:raid-uuid: UUID of whole array (has to be identical across all disks in array, random by default)
:disk-uuid: UUID of disk (has to be unique for each array member disk, random by default)
:image: Image of data to be preloaded into array (optional)
:inherit: Image to inherit array identity/config from (when creating extra members of existing array)

For example here only the first image has configuration and the UUID/timestamp is generated on demand::

image mdraid-a.img {
mdraid {
level = 1
devices = 2
image = "mdraid-ext4.img"
}
}

Then to create second member to that array we just inherit config from the first member::

image mdraid-b.img {
mdraid {
inherit = "mdraid-a.img"
}
}

Role number is 0 for the master image and when other images inherit configuration from it, they are assigned roles from autoincrementing counter.


qemu
****
Generates a QEMU image. Needs at least one valid partition.
Expand Down Expand Up @@ -683,6 +729,7 @@ variable.
:mmd: path to the mmd program (default mmd)
:mkcramfs: path to the mkcramfs program (default mkcramfs)
:mkdosfs: path to the mkdosfs program (default mkdosfs)
:mkfsf2fs: path to the mkfs.f2fs program (default mkfs.f2fs)
:mkfsjffs2: path to the mkfs.jffs2 program (default mkfs.jffs2)
:mkfsubifs: path to the mkfs.ubifs program (default mkfs.ubifs)
:mksquashfs: path to the mksquashfs program (default mksquashfs)
Expand Down Expand Up @@ -742,3 +789,6 @@ commits (e.g. using ``git commit -s``) looking as follows:
Signed-off-by: Random J Developer <[email protected]>

with your identity and email address matching the commit meta data.

Before creating pull request, please make sure your tree is passing
all unit tests by running ``make distcheck``.
2 changes: 1 addition & 1 deletion image-mdraid.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static int mdraid_generate(struct image *image) {
/* constant array information - 128 bytes */
sb->magic = MD_SB_MAGIC; /* MD_SB_MAGIC: 0xa92b4efc - little endian. This is actualy just char string saying "bitm" :-) */
sb->major_version = 1; /* 1 */
sb->feature_map = MD_FEATURE_BITMAP_OFFSET; /* bit 0 set if 'bitmap_offset' is meaningful */ //TODO: internal bitmap bit is ignored, unless there is correct bitmap with BITMAP_MAGIC in place
sb->feature_map = MD_FEATURE_BITMAP_OFFSET; /* bit 0 set if 'bitmap_offset' is meaningful */
sb->pad0 = 0; /* always set to 0 when writing */

char *raid_uuid = cfg_getstr(image->imagesec, "raid-uuid");
Expand Down

0 comments on commit 6f40ffd

Please sign in to comment.