mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
make.sh: Change execute() so that it can be used outside the namespaces, too
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
16
make.sh
16
make.sh
@@ -652,14 +652,8 @@ lfsmakecommoncheck() {
|
||||
}
|
||||
|
||||
execute() {
|
||||
# Check if we are running in our namespace
|
||||
if [ -z "${IN_NAMESPACE}" ]; then
|
||||
exiterror "Not running in namespace"
|
||||
fi
|
||||
|
||||
local command=()
|
||||
|
||||
local chroot="false"
|
||||
local command=()
|
||||
local interactive="false"
|
||||
local timer
|
||||
|
||||
@@ -717,8 +711,11 @@ execute() {
|
||||
[TOOLS_DIR]="${TOOLS_DIR}"
|
||||
)
|
||||
|
||||
local unshare=()
|
||||
|
||||
# Configure a new namespace
|
||||
local unshare=(
|
||||
if [ -n "${IN_NAMESPACE}" ]; then
|
||||
unshare+=(
|
||||
# Create a new cgroup namespace
|
||||
"--cgroup"
|
||||
|
||||
@@ -743,6 +740,7 @@ execute() {
|
||||
# If unshare is asked to terminate, terminate all child processes
|
||||
"--kill-child"
|
||||
)
|
||||
fi
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "${1}" in
|
||||
@@ -848,9 +846,11 @@ execute() {
|
||||
local env
|
||||
|
||||
# Create new namespaces
|
||||
if [ "${#unshare[@]}" -gt 0 ]; then
|
||||
execute+=(
|
||||
"unshare" "${unshare[@]}"
|
||||
)
|
||||
fi
|
||||
|
||||
# Run in chroot?
|
||||
if [ "${chroot}" = "true" ]; then
|
||||
|
||||
Reference in New Issue
Block a user