From 86fddba0118f900e03973430401be69d81703478 Mon Sep 17 00:00:00 2001 From: Saulius Krasuckas Date: Fri, 19 Apr 2024 16:52:19 +0300 Subject: [PATCH] bootstrap: Support Linux setups without groups(1), whoami(1) --- bootstrap/bootstrap | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap index 4d70d73334eb..eccb3379bec0 100755 --- a/bootstrap/bootstrap +++ b/bootstrap/bootstrap @@ -749,6 +749,13 @@ Linux) need_awk=yes need_sed=yes fi + # Some distros, eg. OpenWRT provide no groups(1), whoami(1) by default: + if ! groups >/dev/null 2>&1; then + groupsprog="id -gn" + fi + if ! whoami >/dev/null 2>&1; then + whoamiprog="id -un" + fi machine_arch=`uname -m` # Override machine_arch where required. case "$machine_arch" in