All of lore.kernel.org
 help / color / mirror / Atom feed
* Creating 'wic' image
@ 2016-11-14 15:23 Mike Looijmans
  2016-11-14 15:51 ` Christopher Larson
  2016-11-14 16:42 ` Maciej Borzęcki
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Looijmans @ 2016-11-14 15:23 UTC (permalink / raw)
  To: OE-core

In order to make life easier for people, I was looking into creating images 
with the "wic" tool.

There's just one big piece of documentation lacking: What's the format it 
wants my rootfs and boot files?
http://www.yoctoproject.org/docs/2.2/mega-manual/mega-manual.html

Basically I want an SD card with a FAT boot partition and an ext4 rootfs, and 
"sdimage-bootpart" is pretty close to that.

Without "wic", I build a tar of the rootfs and copy the boot files using a bit 
of shell scripting.

Adding "wic" to IMAGE_FSTYPES just results in an error that I should set 
WKS_FILE but I have no clue as to what file that should point to.

Running wic manually just results in more missing variables that I can't find 
what to specify in them...


Kind regards,

Mike Looijmans
System Expert

TOPIC Products
Materiaalweg 4, NL-5681 RJ Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail







^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Creating 'wic' image
  2016-11-14 15:23 Creating 'wic' image Mike Looijmans
@ 2016-11-14 15:51 ` Christopher Larson
  2016-11-14 16:42 ` Maciej Borzęcki
  1 sibling, 0 replies; 3+ messages in thread
From: Christopher Larson @ 2016-11-14 15:51 UTC (permalink / raw)
  To: Mike Looijmans; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]

On Mon, Nov 14, 2016 at 8:23 AM, Mike Looijmans <mike.looijmans@topic.nl>
wrote:

> In order to make life easier for people, I was looking into creating
> images with the "wic" tool.
>
> There's just one big piece of documentation lacking: What's the format it
> wants my rootfs and boot files?
> http://www.yoctoproject.org/docs/2.2/mega-manual/mega-manual.html
>
> Basically I want an SD card with a FAT boot partition and an ext4 rootfs,
> and "sdimage-bootpart" is pretty close to that.
>
> Without "wic", I build a tar of the rootfs and copy the boot files using a
> bit of shell scripting.
>
> Adding "wic" to IMAGE_FSTYPES just results in an error that I should set
> WKS_FILE but I have no clue as to what file that should point to.
>
> Running wic manually just results in more missing variables that I can't
> find what to specify in them...
>

WKS_FILE is how you tell it to use sdimage-bootpart.wks. IMAGE_BOOT_FILES
Is how to add extra files to the fat boot partiiton.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 1780 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Creating 'wic' image
  2016-11-14 15:23 Creating 'wic' image Mike Looijmans
  2016-11-14 15:51 ` Christopher Larson
@ 2016-11-14 16:42 ` Maciej Borzęcki
  1 sibling, 0 replies; 3+ messages in thread
From: Maciej Borzęcki @ 2016-11-14 16:42 UTC (permalink / raw)
  To: Mike Looijmans; +Cc: OE-core

On Mon, Nov 14, 2016 at 4:23 PM, Mike Looijmans <mike.looijmans@topic.nl> wrote:
> In order to make life easier for people, I was looking into creating images
> with the "wic" tool.
>
> There's just one big piece of documentation lacking: What's the format it
> wants my rootfs and boot files?
> http://www.yoctoproject.org/docs/2.2/mega-manual/mega-manual.html

I agree that wic is not exactly user-friendly, even after going through
the documentation.

There is no 'special 'format for rootfs or boot files. All that wic does
is assemble a disk image with partitions specified in kickstart file.
Partitions are created by source plugins (scripts/lib/wic/plugins/source
in poky tree).

Currently, you'll find the following files there (I'll comment on the
ones I use[d]):

- bootimg-efi.py

- bootimg-partition.py

  Creates a partition of given --fstype and populates it with files
  listed in IMAGE_BOOT_FILES. The files must exist in DEPLOY_DIR_IMAGE.
  For instance, you can use this plugin to prepare a boot partition for
  BeagleBone Black, copying over MLO and u-boot.img. Alternatively you
  could also prepare a boot partition for Raspberry Pi, copying over
  Broadcom files and kernel image. See
  https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#var-IMAGE_BOOT_FILES
  https://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/tree/conf/machine/include/rpi-base.inc#n55
  https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-yocto-bsp/conf/machine/beaglebone.conf#n42

- bootimg-pcbios.py

- fsimage.py

  This one can be used if you happen to have a filesystem image ready.
  We actually use it in Mender because currently, wic lacks the ability
  to specify a fixed size of a partition (a patch series adding that was
  posted).

  The way it works, you are assumed to have a file system image ready
  upfront and then just specify it like this in kickstart:

    part / --source fsimage --sourceparams=file=<path> --ondisk
mmcblk0 --label primary

- isoimage-isohybrid.py

  For all I know, this one requires syslinux.

- rawcopy.py

  rawcopy puts a verbatim copy of a file inside the disk image,
  basically covers a use case when, for instance, you need to place a
  bootloader at a specific offset. Minor quirks:
  - you are not able to explicitly specify offset, hence commonly used
    with --align,
  - it's usually undesirable to have a partition table entry for this
    partition, hence often used with --no-table

- rootfs_pcbios_ext.py

- rootfs.py

  Creates a partition image with contents of rootfs of a particular
  image (if -e was used) or some directory (not necessarily the actualy
  rootfs). The file system to use is determined by --fstype.

>
> Basically I want an SD card with a FAT boot partition and an ext4 rootfs,
> and "sdimage-bootpart" is pretty close to that.

The 'sdimage-bootpart' image is actually used by beaglebone (as defined
in meta-yocto-bsp). Machine config sets this:

  WKS_FILE = "sdimage-bootpart.wks"

See
https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-yocto-bsp/conf/machine/beaglebone.conf#n21
for reference


>
> Without "wic", I build a tar of the rootfs and copy the boot files using a
> bit of shell scripting.
>
> Adding "wic" to IMAGE_FSTYPES just results in an error that I should set
> WKS_FILE but I have no clue as to what file that should point to.

>
> Running wic manually just results in more missing variables that I can't
> find what to specify in them...

Another thing that is not obvious is that wic will not cause bitbake to
build native tools that may be required when building in image. The user
is expected to figure out by themselves.

https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-yocto-bsp/conf/machine/beaglebone.conf#n23


Hope that helps.

Cheers,
-- 
Maciej Borzecki
RnDity


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-14 16:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-14 15:23 Creating 'wic' image Mike Looijmans
2016-11-14 15:51 ` Christopher Larson
2016-11-14 16:42 ` Maciej Borzęcki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.