move root check to lib.sh (bugfix)
this avoids writing the version/versiondate files as root. this complements the previous fix, that avoided writing those same files when running the dependencies command. initial setup of the build system requires root, to run the dependencies script, but otherwise the build system prevents running as root for everything else, so we must avoid writing the version/versiondate files as root. that same avoidance is necessary when checking whether running other commands as root; ironically, this check then prevented running the build system at all! the bug should be fully fixed now. i found this quite by accident the other day, when testing something else. good thing this got fixed because the release! Signed-off-by: Leah Rowe <leah@libreboot.org>20240612_branch
parent
75382a4126
commit
62c25ac7ab
2
build
2
build
|
@ -28,8 +28,6 @@ main()
|
|||
[ $# -lt 1 ] && badcmd
|
||||
spath="script/$1"
|
||||
|
||||
[ "$(id -u)" != "0" ] || $err "this command as root is not permitted"
|
||||
|
||||
for g in "which git" "git config --global user.name" \
|
||||
"git config --global user.email" "git_init"; do
|
||||
eval "$g 1>/dev/null 2>/dev/null || git_err \"$g\""
|
||||
|
|
|
@ -61,6 +61,8 @@ install_packages()
|
|||
}
|
||||
[ $# -gt 0 ] && [ "$1" = "dependencies" ] && install_packages $@ && return 0
|
||||
|
||||
[ "$(id -u)" != "0" ] || $err "this command as root is not permitted"
|
||||
|
||||
# if "y": a coreboot target won't be built if target.cfg says release="n"
|
||||
# (this is used to exclude certain build targets from releases)
|
||||
|
||||
|
|
Loading…
Reference in New Issue