Compare commits

..

9 Commits

Author SHA1 Message Date
Leah Rowe 6a2e9a7919 remove include/chromebook.sh import script (not needed)
i will be adding chromebooks, but not using this script,
which is why i never finished the script. i previously
had the plan to patch upstream coreboot, by importing
patches from mrchromebox, but that results in an extreme
number of patches. several hundred patches, in fact.

more efficient is to add multi-upstream support in
include/get.sh, for using different upstreams including
forks, on a given multi-tree project. i haven't done
this yet, but this is what will be done, and then
adding each chromebook will be a matter of importing
configs from mrchromebox alongside edk2 integration.

a script will still need to be written, for the initial
import, and imported chromebooks will be set release=n
until and when each target is fully tested.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-11 21:51:00 +01:00
Leah Rowe d0a1b40910 more cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-11 21:43:50 +01:00
Leah Rowe 0fd3d72998 tree.sh: remove redundant TODO
infinite loop detection was here before. i removed it
because it was bloat. we don't take general user input
here, so careful configuration is all we need.

infinite loops are harmless to the user. they are merely
annoying. they would never be introduced to the user,
because configs are always tested before release.
before commit, even.

we can save the user a few watts of electricity, or we
can Keep It Simple.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-11 19:49:26 +01:00
Leah Rowe 425855899f rom.sh: remove another TODO
this one is unnecessary, because we're not taking general input
from the user. we mitigate this carefully by being, you know,
careful.

implementing the TODO would have bloated the code, in ways that
might only introduce other serious bugs.

the current logic is fine, and great care will always be taken
by me to keep the code safe, while i'm in charge.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-11 19:46:07 +01:00
Leah Rowe f648167b9f rom.sh: remove redundant TODO
the code is correct. no TODO needed here.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-11 19:45:14 +01:00
Leah Rowe 36fef51e8f init.sh: universally set git commit/auth date
do it as an export. to avoid pollution elsewhere,
do it inside a subshell.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-11 19:42:03 +01:00
Leah Rowe b6b5f70934 init.sh: set git committer date as well
only the author date was being set before

with this change, at least on my system, i
now get the same commit ID and date each time
on the following test:

NOTE: . is lbmk (main work directory)
NOTE: here, we are copying the current clone

git clone . lbmktest
cd lbmktest
./mk version
rm -Rf .git
./mk version
git log

same output each time. we have thus eliminated
timestamps as a variable. this is but a part of
in a series of changes that will eventually lead
to libreboot being built reproducibly.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-11 19:32:12 +01:00
Leah Rowe 58094bd017 init.sh: portable date on git-init
don't even call the date util at all, to fix the
portability issues. now we don't need GNU date
anymore.

git itself can just take an epoch, and it will
do whatever it will do. yes.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-11 19:28:15 +01:00
Leah Rowe cdd399017e init.sh: don't check PATH on startup
even if i unset PATH before running lbmk, it is
reinitialised because of the shebang. if no PATH
exists, then it's either a broken system and you
have bigger problems, or you have some weird
system that uses something else.

our job is not to fix the world. there was no
scenario in which this check would even trigger
an error or fallback, so just remove it.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-09-11 19:02:20 +01:00
7 changed files with 21 additions and 193 deletions
-130
View File
@@ -1,130 +0,0 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (c) 2025 Leah Rowe <leah@libreboot.org>
# Import MrChromebox project into xbmk
# NOTE: variable naming scheme:
# mr_ for variables/functions dealing with MrChromebox
# mx_ for variables/functions pertaining to Libreboot setup
# because i am a non-binary blob
spdx="# SPDX-License-Identifier: GPL-3.0-or-later"
# temporary work variables
mr_tmpdir="" # dir to clone tmp repos in
# NOTE: upstream for our purposes: https://review.coreboot.org/coreboot
mr_cbrepo="https://github.com/mrchromebox/coreboot"
mr_cbbranch="MrChromebox-2503" # branch in mrchromebox
mr_cbrev="ecd9fa6a177e00132ec214252a2b9cebbb01e25f" # relative to base
mr_cbrevbase="38f5f7c48024d9fca4b6bbd88914423c34da709c" # 25.03 upstream base
mr_cbtree="chromebook" # tree name in xbmk
# NOTE: upstream for our purposes: https://github.com/tianocore/edk2.git
mr_edk2repo="https://github.com/mrchromebox/edk2"
mr_edk2branch="uefipayload_2502" # branch in mrchromebox
mr_edk2rev="feaf6b976b7cc72a18ed364f273751c943a9e7d0" # relative to base
mr_edk2revbase="fbe0805b2091393406952e84724188f8c1941837" # 2025.02 upstream
mr_edk2tree="chromebook" # tree name in xbmk
# mxlibreboot was here
prep_mr_import()
{
if [ -f "$xbmkpwd/CHANGELOG" ]; then
err "Project import disabled on releases" "prep_mr_import" "$@"
fi
mr_tmpdir="`mktemp -d || err "can't make mrtmpdir"`" || \
err "can't make mrtmpdir" "prep_mr_coreboot" "$@"
x_ remkdir "$mr_tmpdir"
x_ prep_mx_edk2conf
x_ prep_mr_projects
x_ rm -Rf "$mr_tmpdir"
}
# create config/git/edk2/pkg.cfg
prep_mx_edk2conf()
{
x_ remkdir "config/git/edk2"
x_ prep_mr_file "config/git/edk2/pkg.cfg" \
"$spdx" \
"" \
"rev=\"HEAD\"" \
"url=\"https://codeberg.org/libreboot/edk2\"" \
"bkup_url=\"https://git.disroot.org/libreboot/edk2\""
}
# prep config/PROJECT/TREE/ for various projects
prep_mr_projects()
{
x_ prep_mr "coreboot" "$mr_cbrepo" "$mr_cbbranch" "$mr_cbrev" \
"$mr_cbrevbase" "$mr_cbtree"
x_ prep_mr "edk2" "$mr_edk2repo" "$mr_edk2branch" "$mr_edk2rev" \
"$mr_edk2revbase" "$mr_edk2tree"
}
# create config/PROJECT/TREE/target.cfg
# and config/PROJECT/TREE/patches/
prep_mr()
{
mr_projectname="$1"
mr_repo="$2"
mr_branch="$3"
mr_rev="$4"
mr_revbase="$5"
mr_tree="$6"
x_ prep_mr_clone "$@"
x_ prep_mr_patch "$@"
x_ prep_mr_file "config/$1/$6/target.cfg" \
"$spdx" \
"" \
"tree=\"$6\"" \
"rev=\"$5\""
}
prep_mr_clone()
{
mr_tmpclone="$mr_tmpdir/$1"
x_ git clone "$2" "$mr_tmpclone"
x_ git -C "$mr_tmpclone" checkout "$3"
# we don't reset, because we format-patch between revbase..rev
}
prep_mr_patch()
{
mr_tmpclone="$mr_tmpdir/$1"
mx_patchdir="config/$1/$6/patches"
x_ remkdir "$mx_patchdir"
if [ "$4" != "$5" ]; then
x_ git -C "$mr_tmpclone" format-patch $5..$4
x_ mv "$mr_tmpclone"/*.patch "$mx_patchdir"
fi
# if no patches were created, rmdir will succeed
rmdir "$mx_patchdir" 1>/dev/null 2>/dev/null || :
}
prep_mr_file()
{
mr_filename="$1"
shift 1
x_ rm -f "$mr_filename"
while [ $# -gt 0 ]
do
printf "%s\n" "$1" >> "$mr_filename" || \
err "Can't write '$1' to '$mr_filename'" prep_mr_file "$@"
shift 1
done
printf "Created '%s'\n" "$mr_filename"
}
-2
View File
@@ -8,12 +8,10 @@
. "include/rom.sh"
. "include/release.sh"
. "include/get.sh"
. "include/chromebook.sh"
xbcommands=" \
version \
release \
download \
inject \
prep_mr_import \
"
+8 -28
View File
@@ -26,10 +26,6 @@ export LC_ALL="$utf_8"
projectname="libreboot"
projectsite="https://libreboot.org/"
# TODO: consider just erroring here instead of hardcoding a default
[ -z "${PATH+x}" ] && \
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
sha512sum="util/sbase/sha512sum"
eval "`newvar aur_notice basetmp board checkvarschk checkvarsxbmk configdir \
@@ -146,23 +142,12 @@ xbmk_set_env()
[ -n "${TMPDIR+x}" ] && \
is_child="y"
if [ "$is_child" = "y" ]
then
# child instance of xbmk, so we stop init after this point
# and execute the given user command upon return:
if [ "$is_child" = "y" ]; then
xbmk_child_set_env
return 1
return 1 # child instance. discontinue initialisation.
else
# parent instance of xbmk, so we continue initialising.
# a parent instance of xbmk never processes its own
# command directly; instead, it calls a child instance
# of xbmk, and exits with the corresponding return status.
xbmk_parent_set_env
return 0
return 0 # parent instance. continue initialisation.
fi
}
@@ -192,7 +177,6 @@ xbmk_child_set_tmp()
if [ "$locktmp" != "$xbtmpchk" ]; then
badtmp="TMPDIR '$xbtmpchk' changed; was '$locktmp'"
printf "bad TMPDIR init, '%s': %s\n" "$TMPDIR" "$badtmp" 1>&2
err "'$xbmklock' present with bad tmpdir. is a build running?"
fi
@@ -428,23 +412,19 @@ xbmk_git_init()
[ -e ".git" ] && \
return 0
# GNU-specific extensions of date are used.
# TODO: that is a bug. fix it!
x_ date --version | grep "GNU coreutils" 1>/dev/null 2>/dev/null || \
err "Non-GNU date implementation" "xbmk_git_init" "$@"
cdate="`x_ date -Rud @$versiondate || err "can't get date"`" || \
err "can't get date" "xbmk_git_init" "$@"
(
export GIT_COMMITTER_DATE="@$versiondate +0000"
export GIT_AUTHOR_DATE="@$versiondate +0000"
x_ git init 1>/dev/null 2>/dev/null
x_ git add -A . 1>/dev/null 2>/dev/null
x_ git -c user.name="xbmk" -c user.email="xbmk@example.com" \
commit -m "$projectname $version" --date "$cdate" \
commit -m "$projectname $version" \
--author="xbmk <xbmk@example.com>" 1>/dev/null 2>/dev/null
x_ git -c user.name="xbmk" -c user.email="xbmk@example.com" \
tag -a "$version" -m "$projectname $version" \
1>/dev/null 2>/dev/null; :
) || err "Can't initialise workdir" xbmk_git_init "$@"; :
}
xbmk_child_exec()
+1 -2
View File
@@ -104,9 +104,8 @@ check_target()
. "$boarddir/target.cfg" || \
err "Can't read '$boarddir/target.cfg'" "check_target" "$@"
if [ -z "$tree" ]; then
[ -z "$tree" ] && \
err "tree unset in '$boarddir/target.cfg'" "check_target" "$@"
fi
x_ ./mk -d coreboot "$tree"
+8 -19
View File
@@ -104,10 +104,7 @@ check_coreboot_util()
x_ make -C "$utilsrcdir" $utilmode -j$XBMK_THREADS $makeargs
if [ -n "$mode" ]; then
# TODO: is this rm command needed?
x_ rm -Rf "$utilelfdir"
return 0
elif [ -n "$mode" ] || [ -f "$utilelfdir/$1" ]; then
return 0
@@ -237,8 +234,6 @@ mkcorebootbin_real()
add_cbfs_option()
{
# TODO: input sanitization (currently mitigated by careful config)
op_name="`printf "%s\n" "$1" | awk '{print $1}'`"
op_arg="`printf "%s\n" "$1" | awk '{print $2}'`"
@@ -373,8 +368,7 @@ add_uboot()
ubtree="x86_64"
ubtarget="amd64coreboot"
if [ "$payload_uboot" = "i386" ]
then
if [ "$payload_uboot" = "i386" ]; then
ubpath="u-boot" # 32-bit
ubtree="x86"
ubtarget="i386coreboot"; :
@@ -383,18 +377,13 @@ add_uboot()
ubdir="elf/u-boot/$ubtree/$ubtarget/$uboot_config"
# aarch64 targets:
ubootelf="$ubdir/u-boot.elf"
if [ ! -f "$ubootelf" ]; then
ubootelf="$ubdir/u-boot"
fi
# override for x86/x86_64 targets:
if [ "$payload_uboot" = "i386" ]; then
ubootelf="$ubdir/u-boot-dtb.bin"
elif [ "$payload_uboot" = "amd64" ]; then
ubootelf="$ubdir/u-boot-x86-with-spl.bin" # EFI-compatible
fi
ubootelf="$ubdir/u-boot.elf" # aarch64
[ ! -f "$ubootelf" ] && \
ubootelf="$ubdir/u-boot" # aarch64 (fallback)
[ "$payload_uboot" = "i386" ] && \
ubootelf="$ubdir/u-boot-dtb.bin" # x86 override
[ "$payload_uboot" = "amd64" ] && \
ubootelf="$ubdir/u-boot-x86-with-spl.bin" # x86_64 override
cbfs "$tmprom" "$ubootelf" "$ubpath" $ubcbfsargs
[ "$payload_seabios" != "y" ] && \
+2 -8
View File
@@ -55,11 +55,8 @@ trees()
if_dry_build=""
if_not_do_make=""
if_not_dry_build=":"
if [ "$flag" = "-F" ]; then
# don't skip git fetch/pull on cached src
forcepull="y"
fi
[ "$flag" = "-F" ] && \
forcepull="y"; : # never skip git fetch/pull
;;
-s) mode="savedefconfig" ;;
-l) mode="olddefconfig" ;;
@@ -231,9 +228,6 @@ configure_project()
# override target/tree specific variables from per-target config:
while e "$_tcfg" f || [ "$cmd" != "build_project" ]
do
# TODO: detect infinine loops and throw err.
# (currently mitigated by virtue of configuration)
printf "Loading %s config: %s\n" "$project" "$_tcfg"
eval "`newvar rev tree`"
+2 -4
View File
@@ -123,8 +123,7 @@ fetch()
remkdir "${_pre_dest%/*}" "$appdir"
# HACK: if grabbing fsp from coreboot, fix the path for lbmk
if [ "$dl_type" = "fsp" ]
then
if [ "$dl_type" = "fsp" ]; then
dl="${dl##*../}"
_cdp="$dl"
@@ -474,9 +473,8 @@ bootstrap()
rmodtool="elf/coreboot/$tree/rmodtool"
mecleaner="$xbmkpwd/$cbdir/util/me_cleaner/me_cleaner.py"
if [ "$XBMKmecleaner" = "y" ]; then
[ "$XBMKmecleaner" = "y" ] && \
mecleaner="$xbmkpwd/src/me_cleaner/me_cleaner.py"
fi
x_ ./mk -f coreboot "${cbdir##*/}"
x_ ./mk -f me_cleaner