yocto-public/3-buildtest/wic.md

2.0 KiB

WIC

Generate image

wic create $WKS -e $IMAGE -o .

$WKS: File containing the configuration of the partition table.

The generated disk image will be put in build/$WKS-*.$DISK.direct

You need to source `$POKY/oe-init-build-env` to use wic

Available images

To list available configuration files:

wic list images

WKS config file

A WKS configuration file contains a list of commands to create the partitions and configure the bootloader.

Sample config

# short-description: Create a 'pcbios' direct disk image
# long-description: Creates a partitioned legacy BIOS disk image that the user
# can directly dd to boot media.

part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024 --size=200M

bootloader  --timeout=0  --append="rootwait rootfstype=ext3 video=vesafb vga=current console=tty0"
the syntax doesn't support ` \\\n` line escape

Header

# short-description: your description
# long-description: long description...

These descriptions are optional and will be displayed when using wic list images

Commands

Partition

part $MOUNTPOINT [args]
args _
$MOUNTPOINT Mount point. Can be a path (eg /, /boot) or swap
--source Source data provided by a plugin. To list plugins: wic list source-plugins
--size Partition size in MB.
If not provided, the partition will have the minimum possible size.
--ondisk Disk name on the target system (eg sda, sdb, ...)
--fstype File system type (eg ext4, ext2, btrfs, swap, ...)
--fsoptions Mount options to be added in fstab.
--label Partition name
--align Partition alignment in KB (ex: 1024)
--active Mark partition as active ?

Bootloader

bootloader [args]
args _
--timeout Timeout in seconds before booting default option
--append Kernel command line arguments to bee added when booting.