partition

Name

partition  --  add an entry to the partition table and/or a line to fstab

Synopsis

partition [ptable[=bool]] [fstab[=bool]] [name=string] [size=hex] [type=type] [csum[=bool]] [bin=file] [mpoint=directory] [mopts=options] [dump=integer] [pass=integer]

Description

partition generates commands for adding a partition table entry and/or a line to /etc/fstab.

ptable implies that an entry in the partition table will be added as well as commands for generating an image file. fstab implies that a line in /etc/fstab will be added. Either ptable or fstab must be given. Both ptable and fstab can be given as long as all their other required options are also given.

Options

bin=file

Executable binary to be stored instead of the default (rescue.bin in Linux) at the beginning of the rescue partition. It only has a meaning if ptable is given and type is rescue.

csum[=bool]

Add checksum to the partition table entry if bool is yes or not given. The checksum can be used by the rescue code to check if the partition has been changed (assumed corrupted!) so it is for read-only partitions only.

dump=integer

The dump field in /etc/fstab. Default is 0.

fstab[=bool]

Include the partition in /etc/fstab if bool is yes or not given. Requires dev, mpoint, type, dump, pass and if mpoint is /, name (used for name of the image file to be generated).

mopts=options

Mount options. The mount options field in /etc/fstab.

mpoint=directory

Mount point. It will be used as the root directory of the file system when the file system image is created and the mount point in /etc/fstab (if fstab is given). It is required if fstab is given or if ptable is given and type is a file system type.

name=string

Name of the partition in the partiton table and first part of the name of the image file to be generated.

pass=integer

The pass field in /etc/fstab. Default is 0.

ptable[=bool]

Include the partition in the partition table if bool is yes or not given. Requires name, size and type to be given as well.

size=hex

Partition size as hexadecimal integer prefixed with "0x".

type=type

Partition type and/or file system type. Known values of type are rescue, kernel, cramfs, jffs and jffs2.

Examples

Typical partition function calls from a configure script:

    partition ptable name=rescue size=0x010000 csum=yes type=rescue \
            bin=rfl.bin
    partition ptable name=flash1 size=0x300000 csum=yes type=kernel
    partition fstab name=rootfs dev=/dev/flash3 mpoint=/ type=cramfs \
            mopts=noauto dump=0 pass=1
    partition ptable fstab name=flash2 size=0x0f0000 csum=no \
            dev=/dev/flash2 mpoint=/mnt/flash type=jffs2 mopts=noauto \
            dump=0 pass=2
    partition fstab dev=proc mpoint=/proc type=proc mopts=defaults \
            dump=0 pass=0
    partition fstab dev=tmpfs mpoint=/var type=tmpfs mopts=defaults \
            dump=0 pass=0
    partition fstab dev=devpts mpoint=/dev/pts type=devpts \
            mopts=defaults dump=0 pass=0