Linux Capabilities with Yocto

Use Linux setcap command to set capabilities during Yocto build

I found the solution.
I had to add this to the libcap recipe

PACKAGECONFIG_class-native = "attr"

As the generated binaries (setcap & getcap) are depending on libattr, and this has to be configured manually.

I found that it's already configured for the target package

PACKAGECONFIG ??= "attr ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"

Sorry for disturbing.

Yocto getcap: command not found

If you have a look at build output from libcap, for instance ${WORKDIR}/packages-split, you'll see that the following packages have been created:

libcap
libcap-bin
libcap-dbg
libcap-dev
libcap-doc
libcap-locale
libcap-staticdev

The actual library has been put into libcap, while the helper binaries has been put into libcap-bin.

Read-only file system issue when convert and copy file to a hard drive

The .iso format (ISO 9660) is read-only by design, and doesn't have a system for allocating space for new files.

Instead, you can configure Yocto to bulid a .hddimg file instead, which will be writable. It's described in image-live.bbclass:

A .hddimg file which is an msdos filesystem containing syslinux, a kernel, an initrd and a rootfs image. These can be written to harddisks directly and also booted on USB flash disks (write them there with dd).

To bulid this format, add hddimg to IMAGE_FSTYPES.



Related Topics



Leave a reply



Submit