Bug 15171 - poky-tiny is failing to login to serial console
Summary: poky-tiny is failing to login to serial console
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: oe-core other (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 4.3 M4
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2023-07-24 14:53 UTC by Jon Mason
Modified: 2023-11-16 15:54 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
Boot log (20.23 KB, text/plain)
2023-07-24 14:57 UTC, Jon Mason
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Mason 2023-07-24 14:53:09 UTC
poky-tiny on qemuarm, qemuarm64, and qemuarmv5 (and possibly others, only testing these 3) is now failing to login when running testimage (currently only running ping test).

The issue was bisected to commit 6d5adecd028582bf548cfa47c3b0f9e76fbc2d1f

commit 6d5adecd028582bf548cfa47c3b0f9e76fbc2d1f
Author: Alex Kiernan <alex.kiernan@gmail.com>
Date:   Thu Jul 20 11:20:14 2023 +0100

    eudev: Add group sgx to eudev package

    Fix startup warning:

      udevd[171]: specified group 'sgx' unknown

    This mirrors the change in bab455cd9b1b ("systemd: add group sgx to udev
    package") for systemd-udev.

    (From OE-Core rev: 0e2bc425a6094a5816c9f4e73993baf27c9a51f5)

    Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
    Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Comment 1 Jon Mason 2023-07-24 14:57:00 UTC
Created attachment 4962 [details]
Boot log
Comment 2 Alex Kiernan 2023-07-27 21:40:05 UTC
I'm no closer to understanding what the underlying failure is, but the cause appears to be any package which does a groupadd causes login to fail with:

qemuarm64 login: root
setgid: Function not implemented
process '/sbin/getty 115200 ttyAMA0' (pid 65) exited. Scheduling for restart.

Reverting this commit and adding cronie to the image, causes the exact same error.
Comment 3 Alex Kiernan 2023-07-27 21:41:28 UTC
I could've been clearer - cronie has a groupadd in its build.
Comment 4 Jon Mason 2023-07-27 21:43:10 UTC
I tried it on qemux86 and it occurs there as well
Comment 5 Alex Kiernan 2023-07-27 22:21:02 UTC
Still trying to prove it, but I suspect this is because tiny uses allnoconfig, so CONFIG_MULTIUSER is unset and setgid() returns ENOSYS.
Comment 6 Alex Kiernan 2023-07-27 23:15:16 UTC
Bringing in changes via useradd.bbclass adds a dependency on shadow, which causes login to change from:

build/tmp/work/qemuarm64-poky-linux-musl/core-image-minimal/1.0-r0/rootfs/bin/login -> /bin/busybox.suid

to:

build/tmp/work/qemuarm64-poky-linux-musl/core-image-minimal/1.0-r0/rootfs/bin/login -> /bin/login.shadow

busybox login has these heuristics:

https://git.busybox.net/busybox/commit/?id=a818777d4249e934ef7c9e6e7df8475d6692f315

so its login works with CONFIG_MULTIUSER unset, which the one from shadow doesn't.

Not at all sure what the right fix here is...
Comment 7 Alex Kiernan 2023-07-28 08:51:34 UTC
Using a VIRTUAL-RUNTIME for useradd doesn't seem feasible here as busybox doesn't have useradd/groupadd applets. Adding the sgx user into base-passwd seems like the most sensible fix, but that still leaves the beartrap in useradd.bbclass for anyone using poky-tiny.
Comment 9 Randy MacLeod 2023-10-05 15:01:28 UTC
ross is this fixed your current patchset?
Comment 10 Ross Burton 2023-10-10 16:24:39 UTC
No, but should be fixed with d443fad3687c4dd2d7b4107079e0d297d03e94d6.
Comment 11 Ross Burton 2023-11-16 15:54:15 UTC
Closing, this should be fixed now.