76 lines
No EOL
2 KiB
Markdown
76 lines
No EOL
2 KiB
Markdown
# WIC
|
|
|
|
## Generate image
|
|
```sh
|
|
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`
|
|
|
|
<info data-markdown>
|
|
You need to source `$POKY/oe-init-build-env` to use wic
|
|
</info>
|
|
|
|
## Available images
|
|
To list available configuration files:
|
|
```sh
|
|
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
|
|
```sh
|
|
# 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"
|
|
```
|
|
<info data-markdown>
|
|
the syntax doesn't support ` \\\n` line escape
|
|
</info>
|
|
|
|
## Header
|
|
```sh
|
|
# short-description: your description
|
|
# long-description: long description...
|
|
```
|
|
|
|
These descriptions are optional and will be displayed when using `wic list images`
|
|
|
|
## Commands
|
|
#### Partition
|
|
```sh
|
|
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.<br/>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 <todo>?</todo>
|
|
|
|
|
|
#### Bootloader
|
|
```sh
|
|
bootloader [args]
|
|
```
|
|
|
|
`args`|_
|
|
---|---
|
|
`--timeout`|Timeout in seconds before booting default option
|
|
`--append`|Kernel command line arguments to bee added when booting. |