Skip to content

Adding Systemd init Fail on Qemu Normal world terminal #7479

@sbaradon

Description

@sbaradon

Hi,

I need to enhance the existing QEMU lab setup/build by incorporating support for Systemd.
This will enable me to use systemctl commands (start/status) and Dbus for controlling and testing our service in the "normal world" environment.

I've tried to integrated Systemd support and the necessary kernel functionalities into the QEMU build process,
by adding configs to the defconfig file this configs + creating a linux-systemd.fragment to support (The config added are after the errors example).

I manage to build the Qemu localy to start the emulator terminals but in the environment configuration stage I get this error:

Welcome to Buildroot 2022.11.1!

[ 8.370095] systemd[1]: Hostname set to .
[ 8.372498] systemd[1]: Initializing machine ID from random generator.
[ 8.949244] systemd[65]: /usr/lib/systemd/system-generators/systemd-gpt-auto-generator failed with exit status 1.
[ 9.696582] systemd[1]: Queued start job for default target Multi-User System.
[ 9.776761] systemd[1]: Created slice Slice /system/modprobe.
[ OK ] Created slice Slice /system/modprobe.
[ 9.791424] systemd[1]: Created slice Slice /system/serial-getty.
[ OK ] Created slice Slice /system/serial-getty.
[ 9.799899] systemd[1]: Created slice User and Session Slice.
[ OK ] Created slice User and Session Slice.
[ 9.807004] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[ OK ] Started Dispatch Password …ts to Console Directory Watch.
[ 9.811585] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ OK ] Started Forward Password R…uests to Wall Directory Watch.
[ 9.814891] systemd[1]: Reached target Path Units.
[ OK ] Reached target Path Units.
[ 9.816597] systemd[1]: Reached target Remote File Systems.
[ OK ] Reached target Remote File Systems.
[ 9.818250] systemd[1]: Reached target Slice Units.
[ OK ] Reached target Slice Units.
[ 9.819749] systemd[1]: Reached target Swaps.
[ OK ] Reached target Swaps.
[ 9.844989] systemd[1]: Listening on Process Core Dump Socket.
[ OK ] Listening on Process Core Dump Socket.
[ 9.853166] systemd[1]: Listening on Journal Audit Socket.
[ OK ] Listening on Journal Audit Socket.
[ 9.859866] systemd[1]: Listening on Journal Socket (/dev/log).
[ OK ] Listening on Journal Socket (/dev/log).
[ 9.866566] systemd[1]: Listening on Journal Socket.
[ OK ] Listening on Journal Socket.
[ 9.873120] systemd[1]: Listening on Network Service Netlink Socket.
[ OK ] Listening on Network Service Netlink Socket.
[ 9.880172] systemd[1]: Listening on udev Control Socket.
[ OK ] Listening on udev Control Socket.
[ 9.884895] systemd[1]: Listening on udev Kernel Socket.
[ OK ] Listening on udev Kernel Socket.
[ 9.946601] systemd[1]: Mounting Huge Pages File System...
Mounting Huge Pages File System...
[ 9.996282] systemd[1]: Mounting POSIX Message Queue File System...
Mounting POSIX Message Queue File System...
[ 10.064824] systemd[1]: Mounting Kernel Debug File System...
Mounting Kernel Debug File System...
[ 10.072650] systemd[1]: Kernel Trace File System was skipped because of a failed condition check (ConditionPathExists=/sys/kernel/tracing).
[ 10.099740] systemd[1]: Mounting Temporary Directory /tmp...
Mounting Temporary Directory /tmp...
[ 10.104140] systemd[1]: Create List of Static Device Nodes was skipped because of a failed condition check (ConditionFileNotEmpty=/lib/modules/6.14.0-gb8a233c2155a/modules.devname).
[ 10.151840] systemd[1]: Starting Load Kernel Module configfs...
Starting Load Kernel Module configfs...
[ 10.211793] systemd[1]: Starting Load Kernel Module drm...
Starting Load Kernel Module drm...
[ 10.270336] systemd[1]: Starting Load Kernel Module fuse...
Starting Load Kernel Module fuse...
[ 10.278232] systemd[1]: File System Check on Root Device was skipped because of a failed condition check (ConditionPathIsReadWrite=!/).
[ 10.360486] systemd[1]: Starting Journal Service...
Starting Journal Service...
[ 10.371312] systemd[1]: Load Kernel Modules was skipped because all trigger condition checks failed.
[ 10.397359] systemd[1]: Starting Generate network units from Kernel command line...
Starting Generate network …ts from Kernel command line...
[ 10.442136] systemd[1]: Starting Remount Root and Kernel File Systems...
Starting Remount Root and Kernel File Systems...
[ 10.530883] systemd[1]: Starting Apply Kernel Variables...
Starting Apply Kernel Variables...
[ 10.642777] systemd[1]: Starting Create Static Device Nodes in /dev...
Starting Create Static Device Nodes in /dev...
[ 10.755254] systemd[1]: Starting Coldplug All udev Devices...
Starting Coldplug All udev Devices...
[ 10.929376] systemd[1]: dev-hugepages.mount: Mount process exited, code=exited, status=1/FAILURE
[ 10.934981] systemd[1]: dev-hugepages.mount: Failed with result 'exit-code'.
[ 10.951405] systemd[1]: Failed to mount Huge Pages File System.
[FAILED] Failed to mount Huge Pages File System.
See 'systemctl status dev-hugepages.mount' for details.
[ 10.984194] systemd[1]: dev-mqueue.mount: Mount process exited, code=exited, status=1/FAILURE
[ 10.984590] systemd[1]: dev-mqueue.mount: Failed with result 'exit-code'.
[ 10.995014] systemd[1]: Failed to mount POSIX Message Queue File System.
[FAILED] Failed to mount POSIX Message Queue File System.
See 'systemctl status dev-mqueue.mount' for details.
[ 11.007192] systemd[1]: sys-kernel-debug.mount: Mount process exited, code=exited, status=1/FAILURE
[ 11.007665] systemd[1]: sys-kernel-debug.mount: Failed with result 'exit-code'.
[ 11.020862] systemd[1]: Failed to mount Kernel Debug File System.
[FAILED] Failed to mount Kernel Debug File System.
See 'systemctl status sys-kernel-debug.mount' for details.
[ 11.035401] systemd[1]: tmp.mount: Mount process exited, code=exited, status=1/FAILURE
[ 11.035784] systemd[1]: tmp.mount: Failed with result 'exit-code'.
[ 11.046265] systemd[1]: Failed to mount Temporary Directory /tmp.
[FAILED] Failed to mount Temporary Directory /tmp.
See 'systemctl status tmp.mount' for details.
[ 11.067010] systemd[1]: [email protected]: Deactivated successfully.
[ 11.072824] systemd[1]: Finished Load Kernel Module configfs.
[ OK ] Finished Load Kernel Module configfs.
[ 11.084643] systemd[1]: [email protected]: Deactivated successfully.
[ 11.091709] systemd[1]: Finished Load Kernel Module drm.
[ OK ] Finished Load Kernel Module drm.
[ 11.102203] systemd[1]: [email protected]: Deactivated successfully.
[ 11.106265] systemd[1]: Finished Load Kernel Module fuse.
[ OK ] Finished Load Kernel Module fuse.
[ 11.115441] systemd[1]: Finished Generate network units from Kernel command line.
[ OK ] Finished Generate network units from Kernel command line.
[ 11.121181] systemd[1]: systemd-remount-fs.service: Main process exited, code=exited, status=1/FAILURE
[ 11.127461] systemd[1]: systemd-remount-fs.service: Failed with result 'exit-code'.
[ 11.131558] systemd[1]: Failed to start Remount Root and Kernel File Systems.
[FAILED] Failed to start Remount Root and Kernel File Systems.
See 'systemctl status systemd-remount-fs.service' for details.
[ 11.140539] systemd[1]: Finished Apply Kernel Variables.
[ OK ] Finished Apply Kernel Variables.
[ 11.253362] systemd[1]: Reached target Preparation for Network.
[ OK ] Reached target Preparation for Network.
[ 11.268903] systemd[1]: FUSE Control File System was skipped because of a failed condition check (ConditionPathExists=/sys/fs/fuse/connections).
[ 11.337129] systemd[1]: Mounting Kernel Configuration File System...
Mounting Kernel Configuration File System...
[ 11.358442] systemd[1]: Platform Persistent Storage Archival was skipped because of a failed condition check (ConditionDirectoryNotEmpty=/sys/fs/pstore).
[ 11.378056] systemd[1]: Finished Coldplug All udev Devices.
[ OK ] Finished Coldplug All udev Devices.
[ 11.492599] systemd[1]: Started Journal Service.
[ OK ] Started Journal Service.
[FAILED] Failed to mount Kernel Configuration File System.
See 'systemctl status sys-kernel-config.mount' for details.
Starting Flush Journal to Persistent Storage...
[ 11.704869] systemd-journald[79]: Received client request to flush runtime journal.
[ OK ] Finished Create Static Device Nodes in /dev.
[ OK ] Reached target Preparation for Local File Systems.
Mounting /mnt/host...
[ OK ] Reached target Containers.
[ 11.803132] audit: type=1334 audit(1752656647.624:2): prog-id=6 op=LOAD
[ 11.803803] audit: type=1334 audit(1752656647.624:3): prog-id=7 op=LOAD
[ 11.804084] audit: type=1334 audit(1752656647.628:4): prog-id=8 op=LOAD
Starting Rule-based Manage…for Device Events and Files...
[FAILED] Failed to mount /mnt/host.
See 'systemctl status mnt-host.mount' for details.
[DEPEND] Dependency failed for Local File Systems.
[ OK ] Stopped Dispatch Password …ts to Console Directory Watch.
[ OK ] Stopped Forward Password R…uests to Wall Directory Watch.
[ OK ] Reached target Timer Units.
[ OK ] Reached target Login Prompts.
[ OK ] Reached target Socket Units.
[ OK ] Started Emergency Shell.
[ OK ] Reached target Emergency Mode.
Starting Update is Completed...
[ OK ] Finished Flush Journal to Persistent Storage.
[FAILED] Failed to start Rule-based…r for Device Events and Files.
See 'systemctl status systemd-udevd.service' for details.
Starting Create Volatile Files and Directories...
[ OK ] Stopped Rule-based Manager for Device Events and Files.
[ 12.242659] audit: type=1334 audit(1752656648.068:5): prog-id=9 op=LOAD
[ 12.245287] audit: type=1334 audit(1752656648.068:6): prog-id=10 op=LOAD
[ 12.254166] audit: type=1334 audit(1752656648.076:7): prog-id=11 op=LOAD
Starting Rule-based Manage…for Device Events and Files...
[ OK ] Finished Update is Completed.
[FAILED] Failed to start Rule-based…r for Device Events and Files.
See 'systemctl status systemd-udevd.service' for details.
[ OK ] Stopped Rule-based Manager for Device Events and Files.
[ 12.545959] audit: type=1334 audit(1752656648.368:8): prog-id=9 op=UNLOAD
[ 12.565211] audit: type=1334 audit(1752656648.388:9): prog-id=12 op=LOAD
[ 12.568317] audit: type=1334 audit(1752656648.392:10): prog-id=13 op=LOAD
[ 12.571866] audit: type=1334 audit(1752656648.392:11): prog-id=14 op=LOAD
Starting Rule-based Manage…for Device Events and Files...
[FAILED] Failed to start Rule-based…r for Device Events and Files.
See 'systemctl status systemd-udevd.service' for details.
[ OK ] Stopped Rule-based Manager for Device Events and Files.
Starting Rule-based Manage…for Device Events and Files...
[FAILED] Failed to start Rule-based…r for Device Events and Files.
See 'systemctl status systemd-udevd.service' for details.
[ OK ] Stopped Rule-based Manager for Device Events and Files.
Starting Rule-based Manage…for Device Events and Files...
[ OK ] Finished Create Volatile Files and Directories.
Starting Network Time Synchronization...
[FAILED] Failed to start Rule-based…r for Device Events and Files.
See 'systemctl status systemd-udevd.service' for details.
[ OK ] Stopped Rule-based Manager for Device Events and Files.
[FAILED] Failed to start Rule-based…r for Device Events and Files.
See 'systemctl status systemd-udevd.service' for details.
Starting Network Configuration...
[ OK ] Started Network Time Synchronization.
[ OK ] Reached target System Time Set.
[ OK ] Started Network Configuration.
Starting Network Name Resolution...
[ OK ] Started Network Name Resolution.
[ OK ] Reached target Network.
[ OK ] Reached target Host and Network Name Lookups.
You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
to boot into default mode.
sulogin: starting shell for system maintenance

Does someone encounter these issues and can help me solve them?
Do I need all of this configuration to setup SystemD?


defconfig additional configs:

BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_OPTEE_PATH)/board/qemu/linux-systemd.fragment"

BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"

BR2_INIT_SYSTEMD=y

BR2_PACKAGE_SYSTEMD_TMPFILES=y

BR2_PACKAGE_SYSTEMD_SYSCTL=y

BR2_PACKAGE_SYSTEMD_UDEV=y

BR2_PACKAGE_UTIL_LINUX=y
BR2_PACKAGE_UTIL_LINUX_LIBS=y
BR2_PACKAGE_UTIL_LINUX_LIBMOUNT=y
BR2_PACKAGE_UTIL_LINUX_LIBBLKID=y
BR2_PACKAGE_UTIL_LINUX_LIBUUID=y

BR2_PACKAGE_UTIL_LINUX_AGETTY=y
BR2_PACKAGE_UTIL_LINUX_MOUNT=y
BR2_PACKAGE_UTIL_LINUX_FSCK=y

BR2_PACKAGE_HOST_UTIL_LINUX=y
BR2_PACKAGE_HOST_PKGCONF=y

BR2_PACKAGE_LIBCAP=y
BR2_PACKAGE_KMOD=y
BR2_PACKAGE_KMOD_TOOLS=y
BR2_PACKAGE_ZLIB=y

BR2_PACKAGE_NCURSES=y
BR2_PACKAGE_PKGCONF=y

BR2_PACKAGE_DBUS=y

BR2_PACKAGE_UTIL_LINUX_FINDMNT=y
BR2_PACKAGE_UTIL_LINUX_LSBLK=y

BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT=y
BR2_PACKAGE_UTIL_LINUX_UMOUNT=y

BR2_PACKAGE_UTIL_LINUX_WIPEFS=y

BR2_PACKAGE_XZ=y
BR2_PACKAGE_LIBELF=y
BR2_PACKAGE_LIBFFI=y
BR2_PACKAGE_LIBGPG_ERROR=y
BR2_PACKAGE_LIBGCRYPT=y
BR2_PACKAGE_LZ4=y
BR2_PACKAGE_LZMA=y
BR2_PACKAGE_ZSTD=y

BR2_PACKAGE_SYSTEMD_JOURNAL_REMOTE=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_SYSTEMD_NETWORKD=y
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_TIMESYNCD=y

BR2_PACKAGE_SYSTEMD_MACHINED=y
BR2_PACKAGE_SYSTEMD_IMPORTD=y
BR2_PACKAGE_SYSTEMD_HOSTNAMED=y
BR2_PACKAGE_SYSTEMD_LOCALED=y
BR2_PACKAGE_SYSTEMD_TIMEDATED=y

BR2_PACKAGE_SYSTEMD_COREDUMP=y

BR2_PACKAGE_SYSTEMD_BOOT=y

BR2_PACKAGE_E2FSPROGS=y
BR2_PACKAGE_E2FSPROGS_FSCK=y
BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y

### linux-systemd.fragment configs:

BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_OPTEE_PATH)/board/qemu/linux-systemd.fragment"

BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"

BR2_INIT_SYSTEMD=y

BR2_PACKAGE_SYSTEMD_TMPFILES=y

BR2_PACKAGE_SYSTEMD_SYSCTL=y

BR2_PACKAGE_SYSTEMD_UDEV=y

BR2_PACKAGE_UTIL_LINUX=y
BR2_PACKAGE_UTIL_LINUX_LIBS=y
BR2_PACKAGE_UTIL_LINUX_LIBMOUNT=y
BR2_PACKAGE_UTIL_LINUX_LIBBLKID=y
BR2_PACKAGE_UTIL_LINUX_LIBUUID=y

BR2_PACKAGE_UTIL_LINUX_AGETTY=y
BR2_PACKAGE_UTIL_LINUX_MOUNT=y
BR2_PACKAGE_UTIL_LINUX_FSCK=y

BR2_PACKAGE_HOST_UTIL_LINUX=y
BR2_PACKAGE_HOST_PKGCONF=y

BR2_PACKAGE_LIBCAP=y
BR2_PACKAGE_KMOD=y
BR2_PACKAGE_KMOD_TOOLS=y
BR2_PACKAGE_ZLIB=y

BR2_PACKAGE_NCURSES=y
BR2_PACKAGE_PKGCONF=y

BR2_PACKAGE_DBUS=y

BR2_PACKAGE_UTIL_LINUX_FINDMNT=y
BR2_PACKAGE_UTIL_LINUX_LSBLK=y

BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT=y
BR2_PACKAGE_UTIL_LINUX_UMOUNT=y

BR2_PACKAGE_UTIL_LINUX_WIPEFS=y

BR2_PACKAGE_XZ=y
BR2_PACKAGE_LIBELF=y
BR2_PACKAGE_LIBFFI=y
BR2_PACKAGE_LIBGPG_ERROR=y
BR2_PACKAGE_LIBGCRYPT=y
BR2_PACKAGE_LZ4=y
BR2_PACKAGE_LZMA=y
BR2_PACKAGE_ZSTD=y

BR2_PACKAGE_SYSTEMD_JOURNAL_REMOTE=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_SYSTEMD_NETWORKD=y
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_TIMESYNCD=y

BR2_PACKAGE_SYSTEMD_MACHINED=y
BR2_PACKAGE_SYSTEMD_IMPORTD=y
BR2_PACKAGE_SYSTEMD_HOSTNAMED=y
BR2_PACKAGE_SYSTEMD_LOCALED=y
BR2_PACKAGE_SYSTEMD_TIMEDATED=y

BR2_PACKAGE_SYSTEMD_COREDUMP=y

BR2_PACKAGE_SYSTEMD_BOOT=y

BR2_PACKAGE_E2FSPROGS=y
BR2_PACKAGE_E2FSPROGS_FSCK=y
BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions