Skip to content

fix: rockchip family_tweaks fails on forky — addgroup → groupadd#9753

Merged
igorpecovnik merged 1 commit intomainfrom
fix-rockchip-addgroup-on-forky
May 3, 2026
Merged

fix: rockchip family_tweaks fails on forky — addgroup → groupadd#9753
igorpecovnik merged 1 commit intomainfrom
fix-rockchip-addgroup-on-forky

Conversation

@igorpecovnik
Copy link
Copy Markdown
Member

@igorpecovnik igorpecovnik commented May 3, 2026

Symptom

forky armhf rockchip build (e.g. tinkerboard-current) fails in family_tweaks:

COMMAND: addgroup --system --quiet --gid 900 gpio
bash: line 1: addgroup: command not found
ERROR: Error 127 occurred in main shell

Log: https://paste.armbian.com/iyasuwenum

Cause

addgroup ships in adduser. Debian forky no longer pulls adduser into a minimal rootfs (it's been deprioritised in favour of passwd's groupadd/useradd, which stay Essential). family_tweaks calls addgroup directly via chroot_sdcard, so it 127s the moment the rootfs lacks adduser.

Fix

Switch the four call sites in config/sources/families/rockchip.conf and config/sources/families/rockchip-rv1106.conf from addgroup --system --quiet to groupadd --system. groupadd is in passwd and is present in every Debian/Ubuntu rootfs.

addgroup vs groupadd — relevant differences

addgroup --system --quiet --gid N name groupadd --system --gid N name
Package adduser (deprecated as essential in forky+) passwd (Essential, all Linux)
--system / GID identical behaviour identical
--quiet suppresses success/warn output not needed — silent on success
Group already exists exit 0 exit 9

The exit-9-on-existing difference is gated by a getent group … || guard. rockchip.conf already had that guard; added the same guard to rockchip-rv1106.conf (its addgroup calls were unguarded), so re-running family_tweaks stays idempotent.

Test plan

  • Re-run the failing nightly (tinkerboard-current on forky armhf) — family_tweaks should pass and the build progress past the post-cache rootfs stage.
  • Spot-check one rk3588 board (orangepi5, nanopct6) to confirm rockchip.conf path still works on bookworm/trixie/noble where adduser is present.
  • Re-run any rv1106 board (luckfox-pico-pro) twice in a row to confirm the new getent guard keeps groupadd from erroring with exit 9 on the second run.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved robustness of system group creation during device image builds for Rockchip platforms, ensuring more reliable build outcomes.

`addgroup` lives in `adduser`, which Debian forky no longer pulls
into a minimal rootfs by default. `family_tweaks` then dies with
`bash: line 1: addgroup: command not found` (exit 127) on every
forky-armhf rockchip build.

`groupadd` is in `passwd` (Essential, every Linux), and works
identically for our use here. The only behavioural difference —
`groupadd` returns 9 if the group already exists where `addgroup`
returns 0 — is gated by the existing `getent group … ||` guard in
rockchip.conf, and added to rockchip-rv1106.conf to keep
re-runnability.

Repro: armbian/os tinkerboard-current forky-armhf, log
https://paste.armbian.com/iyasuwenum
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0d94e9cc-cc9d-48c6-bc0b-f226c66b2877

📥 Commits

Reviewing files that changed from the base of the PR and between f13bc6b and 1d11ca6.

📒 Files selected for processing (2)
  • config/sources/families/rockchip-rv1106.conf
  • config/sources/families/rockchip.conf

📝 Walkthrough

Walkthrough

Two Rockchip family configuration files are updated to make system group creation (gpio and i2c) idempotent by either checking group existence before creation or switching from addgroup to groupadd, preventing duplicate group errors.

Changes

System Group Creation Idempotency

Layer / File(s) Summary
Group Creation Logic
config/sources/families/rockchip-rv1106.conf
Build-rootfs group creation (gpio GID 900, i2c GID 901) switched from unconditional addgroup to idempotent getent group || groupadd --system --gid pattern with updated comments.
Group Creation Logic
config/sources/families/rockchip.conf
Target-rootfs group creation for the same groups changed from addgroup --system --quiet --gid to groupadd --system --gid with updated inline comments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

Patches, BSP, size/small

Suggested reviewers

  • vidplace7

🐰 When groups were added twice, the build would break,
But now with idempotent checks, we're back on track!
getent guards the way, and groupadd's here to stay,
No duplicate errors shall ruin our day!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: replacing addgroup with groupadd in Rockchip family_tweaks to resolve build failures on forky systems where adduser package is not available.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-rockchip-addgroup-on-forky

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... size/small PR with less then 50 lines 05 Milestone: Second quarter release labels May 3, 2026
@igorpecovnik igorpecovnik merged commit a6cb68a into main May 3, 2026
12 checks passed
@igorpecovnik igorpecovnik deleted the fix-rockchip-addgroup-on-forky branch May 3, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

1 participant