mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-09-20 13:40:24 +02:00
e973584123
with this new function, i can turn commands on and off by virtue of config. for now, behaviour is unchanged, but this new design means i will be able to disable certain commands in child processes Signed-off-by: Leah Rowe <leah@libreboot.org>
62 lines
934 B
Bash
Executable File
62 lines
934 B
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
# Copyright (c) 2020-2025 Leah Rowe <leah@libreboot.org>
|
|
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
|
|
|
|
set -u -e
|
|
|
|
ispwd="true"
|
|
|
|
if [ "$0" != "./mk" ]; then
|
|
ispwd="false"
|
|
fi
|
|
if [ "$ispwd" = "true" ] && [ -L "mk" ]; then
|
|
ispwd="false"
|
|
fi
|
|
if [ "$ispwd" = "false" ]; then
|
|
printf "You must run this in the proper work directory.\n" 1>&2
|
|
exit 1
|
|
fi
|
|
|
|
. "include/lib.sh"
|
|
. "include/init.sh"
|
|
. "include/vendor.sh"
|
|
. "include/mrc.sh"
|
|
. "include/inject.sh"
|
|
. "include/rom.sh"
|
|
. "include/release.sh"
|
|
. "include/get.sh"
|
|
. "include/chromebook.sh"
|
|
|
|
main()
|
|
{
|
|
cmd=""
|
|
if [ $# -gt 0 ]; then
|
|
cmd="$1"
|
|
shift 1
|
|
fi
|
|
|
|
if ! xeq main "$cmd" \
|
|
version release download inject prep_mr_import; then
|
|
return 0
|
|
fi
|
|
|
|
$cmd "$@"
|
|
set -u -e
|
|
|
|
return 1
|
|
}
|
|
|
|
main "$@" || exit 0
|
|
|
|
. "include/tree.sh"
|
|
|
|
trees "$@" || exit 0
|
|
|
|
x_ touch "$mkhelpercfg"
|
|
|
|
. "$mkhelpercfg"
|
|
$cmd
|