This repository has been archived on 2024-12-14. You can view files and clone it, but cannot push or open issues or pull requests.
toolchain/scripts/host-env

20 lines
295 B
Bash
Executable File

#!/bin/bash
set -e
uid=${UID?}
gid=${GID?}
user=${USER:-"build"}
export HOME="/home/${user}"
groupdel dialout
groupadd -g "$gid" "${user}"
useradd \
-g "$gid" \
-u "$uid" \
-d "/home/${user}" \
-s /bin/bash \
"${user}"
cd "$HOME"
setpriv --reuid="$uid" --regid="$gid" --init-groups "$@"