Skip to content

Commit a6cb68a

Browse files
committed
fix: switch rockchip family_tweaks from addgroup to groupadd
`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
1 parent cd55d66 commit a6cb68a

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

config/sources/families/rockchip-rv1106.conf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,13 @@ write_uboot_platform() {
126126
family_tweaks() {
127127

128128
# Create gpio and i2c groups on the build rootfs; they are matched against
129-
# udev rules to allow non-root user access to these resources
130-
chroot_sdcard addgroup --system --quiet --gid 900 gpio
131-
chroot_sdcard addgroup --system --quiet --gid 901 i2c
129+
# udev rules to allow non-root user access to these resources.
130+
# `groupadd` (from passwd, Essential) instead of `addgroup` (from
131+
# adduser): forky no longer pulls adduser into a minimal rootfs.
132+
# `getent group … ||` guard keeps the call idempotent — `groupadd`
133+
# exits 9 (vs `addgroup`'s 0) if the group already exists.
134+
chroot_sdcard getent group gpio >/dev/null || chroot_sdcard groupadd --system --gid 900 gpio
135+
chroot_sdcard getent group i2c >/dev/null || chroot_sdcard groupadd --system --gid 901 i2c
132136

133137
return 0
134138

config/sources/families/rockchip.conf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,11 @@ fi
236236
family_tweaks() {
237237

238238
# Create gpio and i2c groups on the build rootfs; they are matched against
239-
# udev rules to allow non-root user access to these resources
240-
chroot_sdcard getent group gpio >/dev/null || chroot_sdcard addgroup --system --quiet --gid 900 gpio
241-
chroot_sdcard getent group i2c >/dev/null || chroot_sdcard addgroup --system --quiet --gid 901 i2c
239+
# udev rules to allow non-root user access to these resources.
240+
# `groupadd` (from passwd, Essential) instead of `addgroup` (from
241+
# adduser): forky no longer pulls adduser into a minimal rootfs.
242+
chroot_sdcard getent group gpio >/dev/null || chroot_sdcard groupadd --system --gid 900 gpio
243+
chroot_sdcard getent group i2c >/dev/null || chroot_sdcard groupadd --system --gid 901 i2c
242244

243245
return 0
244246

0 commit comments

Comments
 (0)