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] [room=hex] [bootloader=file] [bootloader_pad=hex] [mbsize=hex]

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.

bootloader=file

The file name of the boot loader. It only has a meaning if ptable is given and type is rescue.

bootloader_pad=hex

Size to pad the boot loader to as hexadecimal integer prefixed with "0x". 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).

mbsize=hex

The media blocksize as hexadecimal integer prefixed with "0x". It only has a meaning if ptable is given and type is jffs2.

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.

room=hex

Specifies the room reserved in the flash for the partition as hexadecimal integer prefixed with "0x". There must be some reserved room to cope with bad blocks that can occur e.g. when NAND flash is used. If room is set, then NAND flash is assumed to be used.

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 for a product with NOR flash:

    partition ptable type=rescue name=rescue size=0x010000 csum=yes \
                     bin=rfl.bin
    partition ptable type=kernel name=flash1 csum=yes size=0x350000
    partition        name=rootfs \
              fstab  type=cramfs dev=/dev/part/rootfs
                     mpoint=/ mopts=noauto pass=1
    partition ptable type=jffs2 name=flash2 csum=no size=0x0A0000 \
              fstab  dev=/dev/part/rwfs mpoint=/mnt/flash mopts=noauto pass=2
    partition fstab  type=proc dev=proc mpoint=/proc
    partition fstab  type=tmpfs dev=tmpfs mpoint=/var
    partition fstab  type=sysfs dev=sysfs mpoint=/sys
    partition fstab  type=devpts dev=devpts mpoint=/dev/pts
    

Typical partition function calls from a configure script for a product with NAND flash having a block size of 16384 bytes:

    partition ptable type=rescue name=rescue csum=yes \
                     size=0x020000 room=0x040000 \
                     bootloader=nandboot.bin bootloader_pad=0x04000 \
                     bin=rfl.bin
    partition ptable type=kernel name=kernel csum=yes \
                     size=0x150000 room=0x160000 \
    partition ptable type=jffs2 name=rootfs csum=yes \
                     size=0x280000 room=0x300000 mbsize=0x04000 \
              fstab  dev=/dev/part/rootfs mpoint=/ mopts=noauto pass=1
    partition ptable type=jffs2 name=rwfs csum=no \
                     size=0x3A0000 room=0x400000 mbsize=0x04000 \
              fstab  dev=/dev/part/rwfs mpoint=/mnt/flash mopts=noauto pass=2
    partition fstab  type=proc dev=proc mpoint=/proc
    partition fstab  type=tmpfs dev=tmpfs mpoint=/var
    partition fstab  type=sysfs dev=sysfs mpoint=/sys
    partition fstab  type=devpts dev=devpts mpoint=/dev/pts