Compare commits

...

12 Commits

Author SHA1 Message Date
Leah Rowe 04c3bc53b6 mk: add error exit
not needed at the moment, since we ensure that
the functions always exit with error under fault
condition. they always return zero.

nevertheless, this might catch some unexpected
behaviour in the future.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-10 20:08:08 +01:00
Leah Rowe d722a02cda mk: remove redundant xrval variable
not needed.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-10 20:06:46 +01:00
Leah Rowe 6fe1d47fb3 mk: remove redundant set command
we exit immediately afterward, so there's
no point in putting this here.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-10 20:01:48 +01:00
Leah Rowe 005f1189c1 mk: major code cleanup
we don't need a main here. it's so generic that we
can just leave it really small like it is now. now
it's much clearer what it actually does.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-10 19:56:36 +01:00
Leah Rowe 86781a5881 mk: simplified command check
Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-10 19:43:28 +01:00
Leah Rowe 61ab5723df xbmk: use proper shebang
env isn't that useful these days. better just
use the standard declaration.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-10 19:37:16 +01:00
Leah Rowe 6050cdd1db init.sh: much more thorough locale initialisation
Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-10 19:35:17 +01:00
Leah Rowe 8c927b535d update header again
Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-10 19:28:27 +01:00
Leah Rowe 5f0bd5ea10 xbmk: remove setvars function
only one file used it. i've replaced its use with
a simple awk call alongside eval.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-10 19:25:45 +01:00
Leah Rowe 8822c56815 mk: make it completely generic
commands now fed from a file, include/common.sh
which in turn also includes other lib files

this makes mk completely generic, and means
that changes will now be completely in sync
with cbmk, ensuring a lack of merge conflicts,
though the file was already pretty small anyway.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-10 18:05:57 +01:00
Leah Rowe bb0221252c mk: make xbcddir usage clearer
it's always a directory, so filter it first

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-10 17:47:48 +01:00
Leah Rowe 1ceeb0ab55 update lbmk headers
i made several modificatinos to several files
thus for in 2026, in the main part of the build system.

i've added 2026 to the ones that i modified.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-10 17:45:11 +01:00
7 changed files with 62 additions and 73 deletions
+19
View File
@@ -0,0 +1,19 @@
# SPDX-License-Identifier: GPL-3.0-or-later
. "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"
xbcommands=" \
version \
release \
download \
inject \
prep_mr_import \
"
+1 -1
View File
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (c) 2020-2021,2023-2025 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2020-2021,2023-2026 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
url=""
+18 -4
View File
@@ -2,12 +2,26 @@
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
# Copyright (c) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
# Copyright (c) 2020-2025 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2020-2026 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2025 Alper Nebi Yasak <alpernebiyasak@gmail.com>
export LANG=C.UTF-8
export LC_COLLATE=C.UTF-8
export LC_ALL=C.UTF-8
utf_8="C.UTF-8"
export LANG="$utf_8"
export LANGUAGE="$utf_8"
export LC_CTYPE="$utf_8"
export LC_NUMERIC="$utf_8"
export LC_TIME="$utf_8"
export LC_COLLATE="$utf_8"
export LC_MONETARY="$utf_8"
export LC_MESSAGES="$utf_8"
export LC_PAPER="$utf_8"
export LC_NAME="$utf_8"
export LC_ADDRESS="$utf_8"
export LC_TELEPHONE="$utf_8"
export LC_MEASUREMENT="$utf_8"
export LC_IDENTIFICATION="$utf_8"
export LC_ALL="$utf_8"
projectname="libreboot"
projectsite="https://libreboot.org/"
+3 -2
View File
@@ -2,7 +2,7 @@
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
# Copyright (c) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
# Copyright (c) 2023-2025 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2023-2026 Leah Rowe <leah@libreboot.org>
cbcfgsdir="config/coreboot"
tmpromdel="$XBMK_CACHE/DO_NOT_FLASH"
@@ -27,7 +27,8 @@ tmpromdir=""
tree=""
xchanged=""
eval "`setvars "" $checkvars`"
eval "`printf "%s\n" "$checkvars" | \
awk '{ for (i=1; i<=NF; i++) $i = $i "=;"; print }'`"
inject()
{
+1 -18
View File
@@ -2,7 +2,7 @@
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
# Copyright (c) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
# Copyright (c) 2020-2025 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2020-2026 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2025 Alper Nebi Yasak <alpernebiyasak@gmail.com>
cbfstool="elf/coreboot/default/cbfstool"
@@ -85,23 +85,6 @@ e()
printf "%s %s\n" "$1" "$es2" 1>&2
}
setvars()
{
_setvars=""
if [ $# -lt 2 ]; then
return 0
fi
val="$1"
shift 1
while [ $# -gt 0 ]; do
printf "%s=\"%s\"\n" "$1" "$val"
shift 1
done
}
# return 0 if project is single-tree, otherwise 1
# e.g. coreboot is multi-tree, so 1
singletree()
+1 -1
View File
@@ -2,7 +2,7 @@
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
# Copyright (c) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
# Copyright (c) 2023-2025 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2023-2026 Leah Rowe <leah@libreboot.org>
# These are variables and functions, extending the functionality of
# inject.sh, to be used with lbmk; they are kept separate here, so that
+18 -46
View File
@@ -1,58 +1,32 @@
#!/usr/bin/env sh
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (c) 2020-2025 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2020-2026 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
set -u -e
xrval=0
(
xbarg0="$0"
if [ "${xbarg0##*/}" = "$xbarg0" ]; then
[ "${xbarg0##*/}" = "$xbarg0" ] && \
xbarg0="`command -v "$xbarg0"`"
commandv="`readlink -f "$xbarg0" 2>/dev/null`"
[ -z "$commandv" ] && \
commandv="`realpath "$xbarg0" 2>/dev/null`"
cd "${commandv%/*}" || exit 1
. "include/common.sh"
if xeq main "${1-}" \
$xbcommands; then
"$@" || exit 1
exit 0
fi
xbcddir="`readlink -f "$xbarg0" 2>/dev/null`"
if [ -z "$xbcddir" ]; then
xbcddir="`realpath "$xbarg0" 2>/dev/null`"
fi
cd "${xbcddir%/*}" || exit 1
. "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
@@ -61,6 +35,4 @@ x_ touch "$mkhelpercfg"
. "$mkhelpercfg"
$cmd
) || xrval=1
exit $xrval
) || exit 1; :