Skip to content

Commit

Permalink
bootstrap: Support Linux setups without groups(1), whoami(1)
Browse files Browse the repository at this point in the history
Allows initial support for OpenWRT.

from Saulius Krasuckas via tech-pkg.
  • Loading branch information
alarixnia committed Apr 23, 2024
1 parent 6f75054 commit 7dc7352
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bootstrap/bootstrap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh

# $NetBSD: bootstrap,v 1.323 2024/03/22 23:34:00 gutteridge Exp $
# $NetBSD: bootstrap,v 1.324 2024/04/23 07:38:14 nia Exp $
#
# Copyright (c) 2001-2011 Alistair Crooks <agc@NetBSD.org>
# All rights reserved.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7dc7352

Please sign in to comment.