Skip to content

Conversation

@hiromotai7
Copy link

Purpose

This commit adds an option to create an image without a kernel when KERNEL_NAME = "" is defined in local.conf.
This option is mainly intended for providing images for kernel testing.

  • This option is now only available for Qemu.

Test

How to test

setting local.conf as below.

MACHINE = "qemu-arm64"
KERNEL_NAME = ""

build emlinux-image-base.

$ bitbake emlinux-image-base

Test result

The build was succeed.

$ bitbake emlinux-image-base
Loading cache: 100% |######################################################################| Time: 0:00:00
Loaded 1848 entries from dependency cache.
Parsing recipes: 100% |####################################################################| Time: 0:00:01
Parsing of 1260 .bb files complete (1140 cached, 120 parsed). 2208 targets, 12 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
Sstate summary: Wanted 7 Local 0 Mirrors 0 Missed 7 Current 0 (0% match, 0% complete)      | ETA:  0:00:00
Initialising tasks: 100% |#################################################################| Time: 0:00:00
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 52 tasks of which 7 didn't need to be rerun and all succeeded.

$

The build artifacts are as below. confirmed without a kernel image.

$ ls -l tmp/deploy/images/qemu-arm64/
total 184696
-rw-r--r-- 1 build build    123446 Jan  5 18:37 emlinux-image-base-emlinux-bookworm-qemu-arm64.dpkg_status
-rw-r--r-- 1 build build 306900992 Jan  5 18:37 emlinux-image-base-emlinux-bookworm-qemu-arm64.ext4
-rw-r--r-- 1 build build      6391 Jan  5 18:37 emlinux-image-base-emlinux-bookworm-qemu-arm64.manifest
$

This commit adds an option to create an image without a kernel when
`KERNEL_NAME = ""` is defined in local.conf.
This option is mainly intended for providing images for kernel testing.

This option is now only available for Qemu.

Signed-off-by: Hirotaka Motai <[email protected]>
@hiromotai7 hiromotai7 requested a review from masami256 January 5, 2026 09:50
@masami256
Copy link
Contributor

@hiromotai7 Please check building an sdk instead of building an image because this PR changes the artifact of SDK .

Building emlinx-image-weston image and sdk for emlinux-image-weston failed to build by following error. So it looks as if emlinux-image-weston can't build with empty KERNEL_NAME variable.

build@e291cca2a2ba:~/work/build$ bitbake emlinux-image-weston -c populate_sdk
>>>> snip <<<<
NOTE: Executing Tasks
ERROR: emlinux-image-weston-1.0-r0 do_rootfs_postprocess: ExecutionError(['sudo', '-E', 'chroot', '/home/build/work/build/tmp/work/emlinux-bookworm-arm64/emlinux-image-weston-qemu-arm64/1.0-r0/rootfs', '/usr/sbi
n/useradd', '--groups', 'video,input,render,wayland', '--home-dir', '/home/weston', '--create-home', 'weston'], 6, '', "useradd: group 'input' does not exist\n")
ERROR: Logfile of failure stored in: /home/build/work/build/tmp/work/emlinux-bookworm-arm64/emlinux-image-weston-qemu-arm64/1.0-r0/temp/log.do_rootfs_postprocess.546927
Log data follows:
| DEBUG: Executing python function do_rootfs_postprocess
| DEBUG: Executing shell function rootfs_do_mounts
| DEBUG: Shell function rootfs_do_mounts finished
| DEBUG: Executing shell function rootfs_do_qemu
>>>> snip <<<<
| DEBUG: Executing shell function image_postprocess_populate_systemd_preset
| Failed to preset unit, unit /etc/systemd/system/systemd-firstboot.service is masked.
| Failed to preset unit, unit /lib/systemd/system/x11-common.service is masked.
| Failed to preset unit, unit /lib/systemd/system/hwclock.service is masked.
| Failed to preset unit, unit /lib/systemd/system/rcS.service is masked.
| Failed to preset unit, unit /lib/systemd/system/cryptdisks-early.service is masked.
| Failed to preset unit, unit /lib/systemd/system/rc.service is masked.
| Failed to preset unit, unit /lib/systemd/system/cryptdisks.service is masked.
| Unit /etc/systemd/system/systemd-firstboot.service is masked, ignoring.
| Created symlink /etc/systemd/system/sockets.target.wants/systemd-networkd.socket → /lib/systemd/system/systemd-networkd.socket.
| Created symlink /etc/systemd/system/sysinit.target.wants/systemd-network-generator.service → /lib/systemd/system/systemd-network-generator.service.
| Unit /lib/systemd/system/x11-common.service is masked, ignoring.
| Created symlink /etc/systemd/system/dbus-org.freedesktop.network1.service → /lib/systemd/system/systemd-networkd.service.
| Created symlink /etc/systemd/system/multi-user.target.wants/systemd-networkd.service → /lib/systemd/system/systemd-networkd.service.
| Created symlink /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service → /lib/systemd/system/systemd-networkd-wait-online.service.
| Unit /lib/systemd/system/hwclock.service is masked, ignoring.
| Created symlink /etc/systemd/system/ctrl-alt-del.target → /lib/systemd/system/reboot.target.
| Unit /lib/systemd/system/rcS.service is masked, ignoring.
| Created symlink /etc/systemd/system/sysinit.target.wants/systemd-sysext.service → /lib/systemd/system/systemd-sysext.service.
| Created symlink /etc/systemd/system/multi-user.target.wants/remote-veritysetup.target → /lib/systemd/system/remote-veritysetup.target.
| Created symlink /etc/systemd/system/multi-user.target.wants/remote-cryptsetup.target → /lib/systemd/system/remote-cryptsetup.target.
| Unit /lib/systemd/system/cryptdisks-early.service is masked, ignoring.
| Unit /lib/systemd/system/rc.service is masked, ignoring.
| Unit /lib/systemd/system/cryptdisks.service is masked, ignoring.
| DEBUG: Shell function image_postprocess_populate_systemd_preset finished
| DEBUG: Executing python function image_postprocess_accounts
| DEBUG: Python function image_postprocess_accounts finished
| DEBUG: Executing shell function rootfs_do_umounts
| DEBUG: Shell function rootfs_do_umounts finished
| DEBUG: Python function do_rootfs_postprocess finished
ERROR: Task (/home/build/work/build/../repos/meta-emlinux/recipes-core/images/emlinux-image-weston.bb:do_rootfs_postprocess) failed with exit code '1'
NOTE: Tasks Summary: Attempted 77 tasks of which 0 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/build/work/build/../repos/meta-emlinux/recipes-core/images/emlinux-image-weston.bb:do_rootfs_postprocess
Summary: There was 1 ERROR message, returning a non-zero exit code.

Hirotaka Motai added 2 commits January 8, 2026 10:14
The "input" and "render" groups to which the weston user belongs are
prepared by udev's postinst process. Thus, installed udev instead of
configurations that prepare the render group.

Signed-off-by: Hirotaka Motai <[email protected]>
When KERNEL_NAME is blank, the linux kenrel will not be compiled. As a
result, the udev package will not be installed.
To fix it, add udev as an essential package.

Signed-off-by: Hirotaka Motai <[email protected]>
@hiromotai7
Copy link
Author

@masami256 This issue was caused because the input group did not exist.

ERROR: emlinux-image-weston-1.0-r0 do_rootfs_postprocess: ExecutionError(['sudo', '-E', 'chroot', '/home/build/work/build/tmp/work/emlinux-bookworm-arm64/emlinux-image-weston-qemu-arm64/1.0-r0/rootfs', '/usr/sbin/useradd', '--groups', 'video,input,render,wayland', '--home-dir', '/home/weston', '--create-home', 'weston'], 6, '', "useradd: group 'input' does not exist\n")
ERROR: Logfile of failure stored in: /home/build/work/build/tmp/work/emlinux-bookworm-arm64/emlinux-image-weston-qemu-arm64/1.0-r0/temp/log.do_rootfs_postprocess.546927

The build error did not occur after adding the following setting to local.conf.

MACHINE = "qemu-arm64"
KERNEL_NAME = ""
GROUPS += "input"

I found that normally the input group is created by udev's postinst process. At the same time, the render group is also created. I also found that udev is not installed when "KERNEL_NAME" is blank.
So in commit 62250d3, installed udev and removed the extra setting for the render group from the emlinux-image-weston.bb.

Also, I think the kernel testing will not work as expected if udev does not exist.
Therefore, in commit f6e2afe, I added udev to IMAGE_PREINSTALL in the emlinux-image-base.bb.

Please review the added commits. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants