Compare commits

...

5 Commits

Author SHA1 Message Date
Leah Rowe 5003e02bb2 build/roms: if release, allow all non-broken roms
this includes untested roms

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-28 20:47:59 +01:00
Leah Rowe dbe259ef65 build/roms: always display warnings
(even if status=stable)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-28 20:42:37 +01:00
Leah Rowe 0e2c56be41 build/roms: reduce indentation in skip_board()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-28 20:40:41 +01:00
Leah Rowe 91927760db build/roms: simplified status handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-28 20:33:38 +01:00
Leah Rowe 230f68fd8f build/roms: simplified seagrub handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-28 20:21:35 +01:00
3 changed files with 33 additions and 85 deletions

1
config/grub/bootorder Normal file
View File

@ -0,0 +1 @@
/rom@img/grub2

View File

@ -5,7 +5,7 @@ export LC_COLLATE=C
export LC_ALL=C export LC_ALL=C
version=""; versiondate=""; projectname=""; _nogit="" version=""; versiondate=""; projectname=""; _nogit=""
err="err_"; tmpdir=""; release_type=""; lbmk_status="" err="err_"; tmpdir=""; lbmk_status=""
# if "y": a coreboot target won't be built if target.cfg says release="n" # 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) # (this is used to exclude certain build targets from releases)
@ -15,17 +15,6 @@ set | grep LBMK_RELEASE 1>/dev/null 2>/dev/null || lbmk_release="n" || :
[ "$lbmk_release" = "n" ] || [ "$lbmk_release" = "y" ] || lbmk_release="n" [ "$lbmk_release" = "n" ] || [ "$lbmk_release" = "y" ] || lbmk_release="n"
export LBMK_RELEASE="$lbmk_release" export LBMK_RELEASE="$lbmk_release"
# valid values:
# empty / not set
# value: stable
# value: unstable
# e.g. export LBMK_VERSION_TYPE=stable
set | grep LBMK_VERSION_TYPE 1>/dev/null 2>/dev/null && \
release_type="$LBMK_VERSION_TYPE"
[ -z "$release_type" ] || [ "$release_type" = "stable" ] || \
[ "$release_type" = "unstable" ] || release_type=""
export LBMK_VERSION_TYPE="$release_type"
# if set to n via export, status checks will be skipped during # if set to n via export, status checks will be skipped during
# all builds, and all targets will be built regardless of status. # all builds, and all targets will be built regardless of status.
# this replicates the old behaviour of lbmk, prior to the checks. # this replicates the old behaviour of lbmk, prior to the checks.

View File

@ -72,13 +72,12 @@ main()
eval "$(setvars "n" ${pv}) $(setvars "" ${v})" eval "$(setvars "n" ${pv}) $(setvars "" ${v})"
grub_background="background1280x800.png" grub_background="background1280x800.png"
board="${x}" board="${x}"
status="unknown"
configure_target configure_target
[ "$board" = "$tree" ] && \ [ "$board" = "$tree" ] && \
continue continue
handle_status
if [ "$listboards" = "y" ]; then if [ "$listboards" = "y" ]; then
for _list_type in $list_type; do for _list_type in $list_type; do
[ "$status" != "$_list_type" ] && continue [ "$status" != "$_list_type" ] && continue
@ -163,50 +162,33 @@ configure_target()
eval "payload_${_payload}=y" eval "payload_${_payload}=y"
} }
handle_status()
{
[ "$status" = "stable" ] || [ "$status" = "unstable" ] || \
[ "$status" = "broken" ] || [ "$status" = "untested" ] || \
status="unknown"
[ "$listboards" != "y" ] && \
printf "Handling target: %s (status=%s)\n" "$board" "$status"
[ "$status" = "broken" ] && release="n"
[ "$status" = "unknown" ] && release="n"
[ "$status" = "untested" ] && release="n"
[ "$listboards" != "y" ] && \
[ "$status" != "stable" ] && [ "$status" != "$release_type" ] && \
printf "WARNING: %s not marked stable (status=%s):\n\n" \
"$board" "$status"; return 0
}
skip_board() skip_board()
{ {
[ "$release" = "n" ] && [ "$lbmk_release" = "y" ] && \ [ "$listboards" != "y" ] && [ "$status" != "stable" ] && \
return 0 printf "WARNING: %s not stable (status=%s):\n\n" \
[ -n "$release_type" ] && [ "$status" = "$release_type" ] && \ "$board" "$status"
return 1
if [ "$lbmk_release" != "y" ] && [ "$status" != "stable" ] && \ if [ -f "$targetdir/warn.txt" ] && [ "$listboards" != "y" ]; then
[ "$status" != "$release_type" ] && [ "$lbmk_status" = "y" ]; then printf "Regarding board '%s' (status '%s'):\n" \
if [ -f "$targetdir/warn.txt" ]; then "$board" "$status"
printf "Regarding board '%s' (status '%s'):\n" \ cat -u "$targetdir/warn.txt" || \
"$board" "$status" $err "!cat $targetdir/warn.txt"
cat -u "$targetdir/warn.txt" || \ fi
$err "!cat $targetdir/warn.txt"
fi [ "$lbmk_release" = "y" ] && [ "$release" = "n" ] && return 0
printf "\nTo disable this dialog when building, do:\n" [ "$lbmk_release" = "y" ] && [ "$status" != "broken" ] && return 1
printf "export LBMK_STATUS=n\n\n" [ "$lbmk_status" = "y" ] || return 1
while true; do [ "$status" = "stable" ] && return 1
printf "Board %s has status '%s'. Skip? [y/n]" \
"$board" "$status" printf "\nTo disable this dialog when building, do:\n"
read -r skip printf "export LBMK_STATUS=n\n\n"
[ "$skip" = "y" ] && return 0 while true; do
[ "$skip" = "n" ] && return 1; continue printf "Board %s has status '%s'. Skip? [y/n]" \
done "$board" "$status"
fi; return 1 read -r skip
[ "$skip" = "y" ] && return 0
[ "$skip" = "n" ] && return 1; continue
done
} }
build_payloads() build_payloads()
@ -399,8 +381,12 @@ build_grub_roms()
newrom="${newrom}${initmode}_${keymap}.rom" newrom="${newrom}${initmode}_${keymap}.rom"
x_ moverom "${tmpgrubrom}" "${newrom}" x_ moverom "${tmpgrubrom}" "${newrom}"
if [ "${payload_seabios_grubonly}" = "y" ]; then if [ "${payload_seabios_grubonly}" = "y" ]; then
mkSeagrubRom "${tmpgrubrom}" "${newrom}" x_ "$cbfstool" "$tmpgrubrom" add \
mkSeabiosGrubonlyRom "${tmpgrubrom}" "${newrom}" -f "config/grub/bootorder" -n bootorder -t raw
x_ moverom "$tmpgrubrom" "${newrom%.rom}_grubfirst.rom"
x_ "$cbfstool" "$tmpgrubrom" add-int -i 0 \
-n etc/show-boot-menu
x_ moverom "$tmpgrubrom" "${newrom%.rom}_grubonly.rom"
fi fi
x_ rm -f "${tmpgrubrom}" x_ rm -f "${tmpgrubrom}"
done done
@ -429,34 +415,6 @@ mkSeabiosRom() {
printf "%s\n" "${tmprom}" printf "%s\n" "${tmprom}"
} }
# SeaGRUB configuration
mkSeagrubRom()
{
_grubrom="${1}"
_newrom="${2}"
tmpbootorder=$(mktemp -t coreboot_rom.XXXXXXXXXX)
# only load grub, by inserting a custom bootorder file
printf "/rom@img/grub2\n" > "$tmpbootorder" || $err "printf bootorder"
x_ "${cbfstool}" "${_grubrom}" \
add -f "${tmpbootorder}" -n bootorder -t raw
x_ rm -f "${tmpbootorder}"
x_ moverom "${_grubrom}" "${_newrom%.rom}_grubfirst.rom"
}
# SeaGRUB, and disable the SeaBIOS menu (grub only)
mkSeabiosGrubonlyRom()
{
_grubrom="${1}"
_newrom="${2}"
x_ "${cbfstool}" "${_grubrom}" add-int -i 0 -n etc/show-boot-menu
x_ moverom "${_grubrom}" "${_newrom%.rom}_grubonly.rom"
}
build_uboot_roms() build_uboot_roms()
{ {
tmprom=$(mkUbootRom "${cbrom}" "fallback/payload") || \ tmprom=$(mkUbootRom "${cbrom}" "fallback/payload") || \