mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-09-19 21:20:31 +02:00
Compare commits
7 Commits
6a2e9a7919
...
2d1d7624e9
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d1d7624e9 | |||
| a32374f6cc | |||
| 897c2667af | |||
| 446eca846e | |||
| c3e2d8c8bc | |||
| b094c60a39 | |||
| 798cc79399 |
+27
-75
@@ -44,12 +44,10 @@ fetch_project()
|
|||||||
|
|
||||||
clone_project()
|
clone_project()
|
||||||
{
|
{
|
||||||
if ! singletree "$project"; then
|
singletree "$project" || \
|
||||||
return 0
|
return 0
|
||||||
fi
|
|
||||||
|
|
||||||
loc="src/$project"
|
loc="src/$project"
|
||||||
|
|
||||||
[ -d "$loc" ] && \
|
[ -d "$loc" ] && \
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -81,13 +79,7 @@ git_prep()
|
|||||||
fetch_submodule()
|
fetch_submodule()
|
||||||
{
|
{
|
||||||
mcfgdir="$mdir/${1##*/}"
|
mcfgdir="$mdir/${1##*/}"
|
||||||
|
eval "`newvar st subcurl subcurl_bkup subgit subgit_bkup subhash`"
|
||||||
st=""
|
|
||||||
subcurl=""
|
|
||||||
subcurl_bkup=""
|
|
||||||
subgit=""
|
|
||||||
subgit_bkup=""
|
|
||||||
subhash=""
|
|
||||||
|
|
||||||
if e "$mcfgdir/module.cfg" f missing; then
|
if e "$mcfgdir/module.cfg" f missing; then
|
||||||
return 0
|
return 0
|
||||||
@@ -95,39 +87,22 @@ fetch_submodule()
|
|||||||
. "$mcfgdir/module.cfg" || \
|
. "$mcfgdir/module.cfg" || \
|
||||||
err "Can't read '$mcfgdir/module.cfg'" "fetch_submodules" "$@"
|
err "Can't read '$mcfgdir/module.cfg'" "fetch_submodules" "$@"
|
||||||
|
|
||||||
if [ -n "$subgit" ] || [ -n "$subgit_bkup" ]; then
|
[ -n "$subgit" ] && [ -n "$subgit_bkup" ] && \
|
||||||
st="$st git"
|
st="git"
|
||||||
fi
|
[ -n "$subcurl" ] && [ -n "$subcurl_bkup" ] && \
|
||||||
if [ -n "$subcurl" ] || [ -n "$subcurl_bkup" ]; then
|
st="curl$st"
|
||||||
st="$st curl"
|
[ "$st" = "curlgit" ] && \
|
||||||
fi
|
|
||||||
|
|
||||||
st="${st# }"
|
|
||||||
[ "$st" = "git curl" ] && \
|
|
||||||
err "$mdir: git+curl defined" "fetch_submodule" "$@"
|
err "$mdir: git+curl defined" "fetch_submodule" "$@"
|
||||||
|
|
||||||
[ -z "$st" ] && \
|
[ -z "$st" ] && \
|
||||||
return 0
|
return 0
|
||||||
|
[ -z "$subhash" ] && \
|
||||||
if [ "$st" = "curl" ]; then
|
|
||||||
if [ -z "$subcurl" ] || [ -z "$subcurl_bkup" ]; then
|
|
||||||
err "subcurl/subcurl_bkup not both set" \
|
|
||||||
"fetch_submodule" "$@"
|
|
||||||
fi
|
|
||||||
elif [ -z "$subgit" ] || [ -z "$subgit_bkup" ]; then
|
|
||||||
err "subgit/subgit_bkup not both set" "fetch_submodule" "$@"
|
|
||||||
elif [ -z "$subhash" ]; then
|
|
||||||
err "subhash not set" "fetch_submodule" "$@"
|
err "subhash not set" "fetch_submodule" "$@"
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$st" = "git" ]; then
|
[ "$st" = "git" ] && \
|
||||||
x_ rm -Rf "$tmpgit/$1"
|
x_ rm -Rf "$tmpgit/$1"
|
||||||
xbget "$st" "$subgit" "$subgit_bkup" "$tmpgit/$1" \
|
|
||||||
"$subhash" "$mdir/${1##*/}/patches"
|
eval "xbget \"\$st\" \"\$sub$st\" \"\$sub${st}_bkup\" \"\$tmpgit/\$1\" \
|
||||||
else
|
\"\$subhash\" \"\$mdir/\${1##*/}/patches\""
|
||||||
xbget "$st" "$subcurl" "$subcurl_bkup" "$tmpgit/$1" \
|
|
||||||
"$subhash" "$mdir/${1##*/}/patches"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO: in the following functions, argument numbers are used
|
# TODO: in the following functions, argument numbers are used
|
||||||
@@ -139,43 +114,18 @@ xbget()
|
|||||||
[ "$1" != "curl" ] && [ "$1" != "copy" ] && [ "$1" != "git" ] && \
|
[ "$1" != "curl" ] && [ "$1" != "copy" ] && [ "$1" != "git" ] && \
|
||||||
err "Bad dlop (arg 1)" "xbget" "$@"
|
err "Bad dlop (arg 1)" "xbget" "$@"
|
||||||
|
|
||||||
for url in "$2" "$3"
|
for url in "$2" "$3"; do
|
||||||
do
|
[ -z "$url" ] && \
|
||||||
if [ -z "$url" ]; then
|
|
||||||
err "empty URL given in" "xbget" "$@"
|
err "empty URL given in" "xbget" "$@"
|
||||||
elif ! try_fetch "$url" "$@"; then
|
try_fetch_$1 "$url" "$@" || \
|
||||||
continue
|
continue
|
||||||
fi
|
[ -e "$4" ] && \
|
||||||
|
return 0; : # successful download/copy
|
||||||
case "$1" in
|
|
||||||
git)
|
|
||||||
[ ! -d "$4" ] && \
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
[ ! -f "$4" ] && \
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
return 0 # successful download/copy
|
|
||||||
done
|
done
|
||||||
|
|
||||||
err "failed to download file/repository" "xbget" "$@"; :
|
err "failed to download file/repository" "xbget" "$@"; :
|
||||||
}
|
}
|
||||||
|
|
||||||
try_fetch()
|
|
||||||
{
|
|
||||||
if [ "$2" = "git" ]; then
|
|
||||||
if ! try_fetch_git "$@"; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if ! try_fetch_file "$@"; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
try_fetch_git()
|
try_fetch_git()
|
||||||
{
|
{
|
||||||
# 1st argument $1 is the current git remote being tried,
|
# 1st argument $1 is the current git remote being tried,
|
||||||
@@ -190,11 +140,10 @@ try_fetch_git()
|
|||||||
|
|
||||||
x_ xbmkdir "${5%/*}" "${cached%/*}"
|
x_ xbmkdir "${5%/*}" "${cached%/*}"
|
||||||
|
|
||||||
if ! try_$2 "$cached" "$@"; then
|
try_$2 "$cached" "$@" || \
|
||||||
return 1
|
return 1
|
||||||
elif [ ! -d "$cached" ]; then
|
[ ! -d "$cached" ] && \
|
||||||
return 1
|
return 1
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d "$5" ]; then
|
if [ ! -d "$5" ]; then
|
||||||
tmpclone "$cached" "$5" "$6" "$7" || \
|
tmpclone "$cached" "$5" "$6" "$7" || \
|
||||||
@@ -205,7 +154,12 @@ try_fetch_git()
|
|||||||
return 1; :
|
return 1; :
|
||||||
}
|
}
|
||||||
|
|
||||||
try_fetch_file()
|
try_fetch_copy()
|
||||||
|
{
|
||||||
|
try_fetch_curl "$@" || return 1; :
|
||||||
|
}
|
||||||
|
|
||||||
|
try_fetch_curl()
|
||||||
{
|
{
|
||||||
cached="file/$6"
|
cached="file/$6"
|
||||||
cached="$XBMK_CACHE/$cached"
|
cached="$XBMK_CACHE/$cached"
|
||||||
@@ -216,10 +170,9 @@ try_fetch_file()
|
|||||||
x_ rm -f "$cached"
|
x_ rm -f "$cached"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ ! -f "$cached" ] && \
|
[ -f "$cached" ] || \
|
||||||
if ! try_$2 "$cached" "$@"; then
|
try_$2 "$cached" "$@" || \
|
||||||
return 1
|
return 1
|
||||||
fi
|
|
||||||
|
|
||||||
[ -f "$5" ] && \
|
[ -f "$5" ] && \
|
||||||
if bad_checksum "$6" "$5" 2>/dev/null; then
|
if bad_checksum "$6" "$5" 2>/dev/null; then
|
||||||
@@ -230,7 +183,6 @@ try_fetch_file()
|
|||||||
return 1
|
return 1
|
||||||
elif bad_checksum "$6" "$cached"; then
|
elif bad_checksum "$6" "$cached"; then
|
||||||
x_ rm -f "$cached"
|
x_ rm -f "$cached"
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
+17
-47
@@ -5,24 +5,6 @@
|
|||||||
# Copyright (c) 2020-2026 Leah Rowe <leah@libreboot.org>
|
# Copyright (c) 2020-2026 Leah Rowe <leah@libreboot.org>
|
||||||
# Copyright (c) 2025 Alper Nebi Yasak <alpernebiyasak@gmail.com>
|
# Copyright (c) 2025 Alper Nebi Yasak <alpernebiyasak@gmail.com>
|
||||||
|
|
||||||
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"
|
projectname="libreboot"
|
||||||
projectsite="https://libreboot.org/"
|
projectsite="https://libreboot.org/"
|
||||||
|
|
||||||
@@ -57,9 +39,8 @@ xbmk_init()
|
|||||||
x_ xbmkdir "cache"
|
x_ xbmkdir "cache"
|
||||||
|
|
||||||
for init_cmd in get_version set_env set_threads git_init child_exec; do
|
for init_cmd in get_version set_env set_threads git_init child_exec; do
|
||||||
if ! xbmk_$init_cmd "$@"; then
|
xbmk_$init_cmd "$@" || \
|
||||||
break
|
break; :
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,9 +146,7 @@ xbmk_child_set_env()
|
|||||||
|
|
||||||
xbmk_child_set_tmp()
|
xbmk_child_set_tmp()
|
||||||
{
|
{
|
||||||
badtmp=""
|
eval "`newvar badtmp locktmp xbtmpchk`"
|
||||||
locktmp=""
|
|
||||||
xbtmpchk=""
|
|
||||||
|
|
||||||
xbtmpchk="`findpath "$TMPDIR" || err "!findpath $TMPDIR"`" || \
|
xbtmpchk="`findpath "$TMPDIR" || err "!findpath $TMPDIR"`" || \
|
||||||
err "!findpath '$TMPDIR'" "xbmk_child_set_tmp" "$@"
|
err "!findpath '$TMPDIR'" "xbmk_child_set_tmp" "$@"
|
||||||
@@ -299,14 +278,13 @@ xbmk_set_pyver()
|
|||||||
pyver="2"
|
pyver="2"
|
||||||
pyv="import sys; print(sys.version_info[:])"
|
pyv="import sys; print(sys.version_info[:])"
|
||||||
|
|
||||||
if ! pybin python3 1>/dev/null; then
|
pybin python3 1>/dev/null || \
|
||||||
python="python"
|
python="python"
|
||||||
fi
|
|
||||||
[ "$python" = "python3" ] && \
|
[ "$python" = "python3" ] && \
|
||||||
pyver="3"
|
pyver="3"
|
||||||
if ! pybin "$python" 1>/dev/null; then
|
pybin "$python" 1>/dev/null || \
|
||||||
pyver=""
|
pyver=""
|
||||||
fi
|
|
||||||
[ -z "$pyver" ] || \
|
[ -z "$pyver" ] || \
|
||||||
"`x_ pybin "$python"`" -c "$pyv" 1>/dev/null \
|
"`x_ pybin "$python"`" -c "$pyv" 1>/dev/null \
|
||||||
2>/dev/null || \
|
2>/dev/null || \
|
||||||
@@ -339,44 +317,37 @@ pybin()
|
|||||||
py="import sys; quit(1) if sys.prefix == sys.base_prefix else quit(0)"
|
py="import sys; quit(1) if sys.prefix == sys.base_prefix else quit(0)"
|
||||||
|
|
||||||
venv=1
|
venv=1
|
||||||
if ! command -v "$1" 1>/dev/null 2>/dev/null; then
|
command -v "$1" 1>/dev/null 2>/dev/null || \
|
||||||
venv=0
|
venv=0
|
||||||
fi
|
|
||||||
[ $venv -gt 0 ] && \
|
[ $venv -lt 1 ] || \
|
||||||
if ! "$1" -c "$py" 1>/dev/null 2>/dev/null; then
|
"$1" -c "$py" 1>/dev/null 2>/dev/null || \
|
||||||
venv=0
|
venv=0
|
||||||
fi
|
|
||||||
|
|
||||||
# ideally, don't rely on PATH or hardcoded paths if python venv.
|
|
||||||
# use the *real*, direct executable linked to by the venv symlink:
|
|
||||||
|
|
||||||
|
# try the direct path from PATH first. the binary specified by venv
|
||||||
|
# can be called directly, which then removes use of the venv
|
||||||
if [ $venv -gt 0 ] && [ -L "`command -v "$1" 2>/dev/null`" ]; then
|
if [ $venv -gt 0 ] && [ -L "`command -v "$1" 2>/dev/null`" ]; then
|
||||||
pypath="$(findpath \
|
pypath="$(findpath \
|
||||||
"$(command -v "$1" 2>/dev/null)" 2>/dev/null || :)"
|
"$(command -v "$1" 2>/dev/null)" 2>/dev/null || :)"
|
||||||
|
|
||||||
if [ -e "$pypath" ] && [ ! -d "$pypath" ] && \
|
if [ -e "$pypath" ] && [ ! -d "$pypath" ] && \
|
||||||
[ -x "$pypath" ]; then
|
[ -x "$pypath" ]; then
|
||||||
|
|
||||||
printf "%s\n" "$pypath"
|
printf "%s\n" "$pypath"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if python venv: fall back to common PATH directories for checking:
|
# if python venv: fall back to common PATH directories for checking:
|
||||||
|
|
||||||
[ $venv -gt 0 ] && for pypath in "/usr/local/bin" "/usr/bin"; do
|
[ $venv -gt 0 ] && for pypath in "/usr/local/bin" "/usr/bin"; do
|
||||||
if [ -e "$pypath/$1" ] && [ ! -d "$pypath/$1" ] && \
|
if [ -e "$pypath/$1" ] && [ ! -d "$pypath/$1" ] && \
|
||||||
[ -x "$pypath/$1" ]; then
|
[ -x "$pypath/$1" ]; then
|
||||||
|
|
||||||
printf "%s/%s\n" "$pypath" "$1"
|
printf "%s/%s\n" "$pypath" "$1"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
done && return 1
|
done && return 1
|
||||||
|
|
||||||
# Defer to normal command -v if not a venv
|
# Defer to normal command -v if not a venv
|
||||||
if ! command -v "$1" 2>/dev/null; then
|
command -v "$1" 2>/dev/null || \
|
||||||
return 1
|
return 1; :
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xbmk_set_mirror()
|
xbmk_set_mirror()
|
||||||
@@ -400,11 +371,9 @@ xbmk_git_init()
|
|||||||
# the git identity check is only needed for: ./mk -b coreboot [args]
|
# the git identity check is only needed for: ./mk -b coreboot [args]
|
||||||
[ "${2-}" = "-b" ] && [ "${3-}" = "coreboot" ] && \
|
[ "${2-}" = "-b" ] && [ "${3-}" = "coreboot" ] && \
|
||||||
for gitarg in "user.name" "user.email"; do
|
for gitarg in "user.name" "user.email"; do
|
||||||
gitcmd="git config --includes $gitarg"
|
git config --includes $gitarg 1>/dev/null 2>/dev/null || \
|
||||||
if ! $gitcmd 1>/dev/null 2>/dev/null; then
|
|
||||||
err "Run this first: $gitcmd \"your ${gitcmd##*.}\"" \
|
err "Run this first: $gitcmd \"your ${gitcmd##*.}\"" \
|
||||||
"xbmk_git_init" "$@"
|
"xbmk_git_init" "$@"; :
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -L ".git" ] && \
|
[ -L ".git" ] && \
|
||||||
@@ -424,6 +393,7 @@ xbmk_git_init()
|
|||||||
x_ git -c user.name="xbmk" -c user.email="xbmk@example.com" \
|
x_ git -c user.name="xbmk" -c user.email="xbmk@example.com" \
|
||||||
tag -a "$version" -m "$projectname $version" \
|
tag -a "$version" -m "$projectname $version" \
|
||||||
1>/dev/null 2>/dev/null; :
|
1>/dev/null 2>/dev/null; :
|
||||||
|
|
||||||
) || err "Can't initialise workdir" xbmk_git_init "$@"; :
|
) || err "Can't initialise workdir" xbmk_git_init "$@"; :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-14
@@ -48,9 +48,8 @@ inject()
|
|||||||
|
|
||||||
check_release
|
check_release
|
||||||
if check_target; then
|
if check_target; then
|
||||||
if ! patch_release; then
|
patch_release || \
|
||||||
return 0
|
return 0; :
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
[ "$xchanged" = "y" ] && \
|
[ "$xchanged" = "y" ] && \
|
||||||
remktar
|
remktar
|
||||||
@@ -135,17 +134,16 @@ patch_release()
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if ! readkconfig; then
|
readkconfig || \
|
||||||
return 1
|
return 1
|
||||||
elif [ -n "$new_mac" ] && [ -n "$CONFIG_GBE_BIN_PATH" ]; then
|
|
||||||
modify_mac
|
[ -n "$new_mac" ] && [ -n "$CONFIG_GBE_BIN_PATH" ] && \
|
||||||
fi
|
modify_mac; :
|
||||||
}
|
}
|
||||||
|
|
||||||
readkconfig()
|
readkconfig()
|
||||||
{
|
{
|
||||||
x_ rm -f "$xbtmp/cbcfg"
|
x_ rm -f "$xbtmp/cbcfg"
|
||||||
|
|
||||||
fx_ scankconfig x_ find "$boarddir/config" -type f
|
fx_ scankconfig x_ find "$boarddir/config" -type f
|
||||||
|
|
||||||
if e "$xbtmp/cbcfg" f missing; then
|
if e "$xbtmp/cbcfg" f missing; then
|
||||||
@@ -155,9 +153,8 @@ readkconfig()
|
|||||||
. "$xbtmp/cbcfg" || \
|
. "$xbtmp/cbcfg" || \
|
||||||
err "Can't read '$xbtmp/cbcfg'" "readkconfig" "$@"
|
err "Can't read '$xbtmp/cbcfg'" "readkconfig" "$@"
|
||||||
|
|
||||||
if ! setvfile "$@"; then
|
setvfile "$@" || \
|
||||||
return 1
|
return 1; :
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scankconfig()
|
scankconfig()
|
||||||
@@ -195,10 +192,10 @@ newmac()
|
|||||||
remktar()
|
remktar()
|
||||||
{
|
{
|
||||||
(
|
(
|
||||||
x_ cd "${tmpromdir%"/bin/$board"}"
|
x_ cd "${tmpromdir%"/bin/$board"}"
|
||||||
|
|
||||||
printf "Re-building tar archive (please wait)\n"
|
printf "Re-building tar archive (please wait)\n"
|
||||||
mkrom_tarball "bin/$board" 1>/dev/null
|
mkrom_tarball "bin/$board" 1>/dev/null
|
||||||
|
|
||||||
) || err "Cannot re-generate '$archive'" "remktar" "$@"
|
) || err "Cannot re-generate '$archive'" "remktar" "$@"
|
||||||
|
|
||||||
|
|||||||
+1
-6
@@ -4,11 +4,7 @@
|
|||||||
# Modifications in this version are Copyright 2021,2023-2025 Leah Rowe.
|
# Modifications in this version are Copyright 2021,2023-2025 Leah Rowe.
|
||||||
# Original copyright detailed in repo: https://review.coreboot.org/coreboot/
|
# Original copyright detailed in repo: https://review.coreboot.org/coreboot/
|
||||||
|
|
||||||
MRC_board=""
|
eval "`newvar MRC_board MRC_hash MRC_url MRC_url_bkup SHELLBALL`"
|
||||||
MRC_hash=""
|
|
||||||
MRC_url=""
|
|
||||||
MRC_url_bkup=""
|
|
||||||
SHELLBALL=""
|
|
||||||
|
|
||||||
extract_refcode()
|
extract_refcode()
|
||||||
{
|
{
|
||||||
@@ -62,7 +58,6 @@ extract_partition()
|
|||||||
parted "${1%.zip}" 2>/dev/null | grep "ROOT-A" )
|
parted "${1%.zip}" 2>/dev/null | grep "ROOT-A" )
|
||||||
|
|
||||||
START=$(( $( echo $ROOTP | cut -f2 -d\ | tr -d "B" ) ))
|
START=$(( $( echo $ROOTP | cut -f2 -d\ | tr -d "B" ) ))
|
||||||
|
|
||||||
SIZE=$(( $( echo $ROOTP | cut -f4 -d\ | tr -d "B" ) ))
|
SIZE=$(( $( echo $ROOTP | cut -f4 -d\ | tr -d "B" ) ))
|
||||||
|
|
||||||
x_ dd if="${1%.zip}" of="root-a.ext2" bs=1024 \
|
x_ dd if="${1%.zip}" of="root-a.ext2" bs=1024 \
|
||||||
|
|||||||
+8
-8
@@ -60,13 +60,13 @@ release()
|
|||||||
prep_release()
|
prep_release()
|
||||||
{
|
{
|
||||||
(
|
(
|
||||||
if [ "$1" != "tarball" ]; then
|
if [ "$1" != "tarball" ]; then
|
||||||
x_ cd "$rsrc"
|
x_ cd "$rsrc"
|
||||||
[ ! -e "cache" ] && \
|
[ ! -e "cache" ] && \
|
||||||
x_ ln -s "$XBMK_CACHE" "cache"; :
|
x_ ln -s "$XBMK_CACHE" "cache"; :
|
||||||
fi
|
fi
|
||||||
|
|
||||||
prep_release_$1
|
prep_release_$1
|
||||||
|
|
||||||
) || err "can't prep release $1" "prep_release" "$@"
|
) || err "can't prep release $1" "prep_release" "$@"
|
||||||
}
|
}
|
||||||
@@ -105,8 +105,8 @@ prep_release_tarball()
|
|||||||
x_ mv "$rsrc/util/sbase2" "$rsrc/util/sbase"
|
x_ mv "$rsrc/util/sbase2" "$rsrc/util/sbase"
|
||||||
|
|
||||||
(
|
(
|
||||||
x_ cd "${rsrc%/*}"
|
x_ cd "${rsrc%/*}"
|
||||||
x_ mktarball "${rsrc##*/}" "${rsrc##*/}.tar.xz"
|
x_ mktarball "${rsrc##*/}" "${rsrc##*/}.tar.xz"
|
||||||
|
|
||||||
) || err "can't create src tarball" "prep_release_tarball" "$@"; :
|
) || err "can't create src tarball" "prep_release_tarball" "$@"; :
|
||||||
}
|
}
|
||||||
|
|||||||
+31
-41
@@ -111,20 +111,18 @@ trees()
|
|||||||
|
|
||||||
build_project()
|
build_project()
|
||||||
{
|
{
|
||||||
if ! configure_project "$configdir"; then
|
configure_project "$configdir" || \
|
||||||
return 0
|
return 0
|
||||||
elif [ -f "$listfile" ]; then
|
|
||||||
if ! $if_not_dry_build elfcheck; then
|
[ ! -f "$listfile" ] || \
|
||||||
|
$if_not_dry_build elfcheck || \
|
||||||
return 0
|
return 0
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ "$mode" = "distclean" ] && \
|
[ "$mode" = "distclean" ] && \
|
||||||
mode="clean"
|
mode="clean"
|
||||||
|
|
||||||
if ! run_make_command; then
|
run_make_command || \
|
||||||
return 0
|
return 0
|
||||||
fi
|
|
||||||
|
|
||||||
[ -z "$mode" ] && \
|
[ -z "$mode" ] && \
|
||||||
$if_not_dry_build \
|
$if_not_dry_build \
|
||||||
@@ -168,9 +166,9 @@ handle_defconfig()
|
|||||||
|
|
||||||
[ ! -f "CHANGELOG" ] && \
|
[ ! -f "CHANGELOG" ] && \
|
||||||
fetch_project "$project"
|
fetch_project "$project"
|
||||||
if ! configure_project "$target_dir"; then
|
|
||||||
|
configure_project "$target_dir" || \
|
||||||
return 0
|
return 0
|
||||||
fi
|
|
||||||
|
|
||||||
[ -z "$tree" ] && \
|
[ -z "$tree" ] && \
|
||||||
err "$configdir: 'tree' not set" "handle_defconfig" "$@"
|
err "$configdir: 'tree' not set" "handle_defconfig" "$@"
|
||||||
@@ -304,10 +302,9 @@ build_dependencies()
|
|||||||
delete_old_project_files()
|
delete_old_project_files()
|
||||||
{
|
{
|
||||||
# delete an entire source tree along with its builds:
|
# delete an entire source tree along with its builds:
|
||||||
if ! project_up_to_date hash "$tree" badhash "$datadir" \
|
project_up_to_date hash "$tree" badhash "$datadir" \
|
||||||
"$configdir/$tree" "$mdir"; then
|
"$configdir/$tree" "$mdir" || \
|
||||||
x_ rm -Rf "src/$project/$tree" "elf/$project/$tree"
|
x_ rm -Rf "src/$project/$tree" "elf/$project/$tree"
|
||||||
fi
|
|
||||||
|
|
||||||
x_ cp "$xbtmp/new.hash" "$XBMK_CACHE/hash/$project$tree"
|
x_ cp "$xbtmp/new.hash" "$XBMK_CACHE/hash/$project$tree"
|
||||||
|
|
||||||
@@ -320,10 +317,8 @@ delete_old_project_files()
|
|||||||
# this is useful when only the target config changes, for
|
# this is useful when only the target config changes, for
|
||||||
# example x200_8mb coreboot configs change, but not coreboot:
|
# example x200_8mb coreboot configs change, but not coreboot:
|
||||||
|
|
||||||
if ! project_up_to_date tghash "$target" badtghash "$configdir/$target"
|
project_up_to_date tghash "$target" badtghash "$configdir/$target" || \
|
||||||
then
|
|
||||||
x_ rm -Rf "elf/$project/$tree/$target"
|
x_ rm -Rf "elf/$project/$tree/$target"
|
||||||
fi
|
|
||||||
|
|
||||||
x_ cp "$xbtmp/new.hash" "$XBMK_CACHE/tghash/$project$target"
|
x_ cp "$xbtmp/new.hash" "$XBMK_CACHE/tghash/$project$target"
|
||||||
}
|
}
|
||||||
@@ -414,9 +409,8 @@ check_cross_compiler()
|
|||||||
|
|
||||||
check_gnu_path()
|
check_gnu_path()
|
||||||
{
|
{
|
||||||
if ! command -v "$1" 1>/dev/null; then
|
command -v "$1" 1>/dev/null || \
|
||||||
err "Host '$1' unavailable" "check_gnu_path" "$@"
|
err "Host '$1' unavailable" "check_gnu_path" "$@"
|
||||||
fi
|
|
||||||
|
|
||||||
eval "`newvar gccdir gccfull gccver gnatdir gnatfull gnatver`"
|
eval "`newvar gccdir gccfull gccver gnatdir gnatfull gnatver`"
|
||||||
|
|
||||||
@@ -431,9 +425,8 @@ check_gnu_path()
|
|||||||
|
|
||||||
host_gcc_gnat_match()
|
host_gcc_gnat_match()
|
||||||
{
|
{
|
||||||
if ! gnu_setver "$1" "$1"; then
|
gnu_setver "$1" "$1" || \
|
||||||
err "Command '$1' unavailable." "check_gnu_path" "$@"
|
err "Command '$1' unavailable." "check_gnu_path" "$@"
|
||||||
fi
|
|
||||||
gnu_setver "$2" "$2" || :
|
gnu_setver "$2" "$2" || :
|
||||||
|
|
||||||
eval "[ -z \"\$$1ver\" ] && err \"Cannot detect host '$1' version\""
|
eval "[ -z \"\$$1ver\" ] && err \"Cannot detect host '$1' version\""
|
||||||
@@ -458,11 +451,10 @@ match_gcc_gnat_versions()
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if ! gnu_setver "$2" "$_gnudir/$2-$_gnuver"; then
|
gnu_setver "$2" "$_gnudir/$2-$_gnuver" || \
|
||||||
return 1
|
return 1
|
||||||
elif [ "$gnatfull" != "$gccfull" ]; then
|
[ "$gnatfull" != "$gccfull" ] && \
|
||||||
return 1
|
return 1
|
||||||
fi
|
|
||||||
|
|
||||||
( link_gcc_gnat_versions "$@" "$_gnudir" "$_gnuver" ) || \
|
( link_gcc_gnat_versions "$@" "$_gnudir" "$_gnuver" ) || \
|
||||||
err "Can't link '$2-$_gnuver' '$_gnudir'" "check_gnu_path" "$@"; :
|
err "Can't link '$2-$_gnuver' '$_gnudir'" "check_gnu_path" "$@"; :
|
||||||
@@ -555,14 +547,13 @@ run_make_command()
|
|||||||
[ -z "$mode" ] && \
|
[ -z "$mode" ] && \
|
||||||
x_ $premake
|
x_ $premake
|
||||||
|
|
||||||
if $if_not_dry_build check_cmake "$srcdir"; then
|
$if_not_dry_build check_cmake "$srcdir" && \
|
||||||
[ -z "$mode" ] && \
|
[ -z "$mode" ] && \
|
||||||
$if_not_dry_build \
|
$if_not_dry_build \
|
||||||
check_autoconf "$srcdir"; :
|
check_autoconf "$srcdir"
|
||||||
fi
|
|
||||||
if ! $if_not_dry_build check_makefile "$srcdir"; then
|
$if_not_dry_build check_makefile "$srcdir" || \
|
||||||
return 1
|
return 1
|
||||||
fi
|
|
||||||
|
|
||||||
$if_not_dry_build \
|
$if_not_dry_build \
|
||||||
x_ make -C "$srcdir" $mode -j$XBMK_THREADS $makeargs
|
x_ make -C "$srcdir" $mode -j$XBMK_THREADS $makeargs
|
||||||
@@ -570,30 +561,29 @@ run_make_command()
|
|||||||
[ -z "$mode" ] && \
|
[ -z "$mode" ] && \
|
||||||
x_ $mkhelper
|
x_ $mkhelper
|
||||||
|
|
||||||
if ! check_makefile "$srcdir"; then
|
check_makefile "$srcdir" || \
|
||||||
return 0
|
return 0
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$mode" = "clean" ]; then
|
[ "$mode" = "clean" ] || \
|
||||||
$if_dry_build \
|
return 0
|
||||||
return 0
|
$if_dry_build \
|
||||||
if ! make -C "$srcdir" $cleanargs distclean; then
|
return 0
|
||||||
x_ make -C "$srcdir" $cleanargs clean
|
|
||||||
fi
|
make -C "$srcdir" $cleanargs distclean || \
|
||||||
fi
|
x_ make -C "$srcdir" $cleanargs clean; :
|
||||||
}
|
}
|
||||||
|
|
||||||
check_cmake()
|
check_cmake()
|
||||||
{
|
{
|
||||||
$if_dry_build \
|
$if_dry_build \
|
||||||
return 0
|
return 0
|
||||||
if [ ! -n "$cmakedir" ]; then
|
[ ! -n "$cmakedir" ] && \
|
||||||
return 0
|
return 0
|
||||||
elif ! check_makefile "$1"; then
|
|
||||||
if ! cmake -B "$1" "$1/$cmakedir"; then
|
check_makefile "$1" || \
|
||||||
|
cmake -B "$1" "$1/$cmakedir" || \
|
||||||
x_ check_makefile "$1"
|
x_ check_makefile "$1"
|
||||||
fi
|
|
||||||
fi
|
|
||||||
x_ check_makefile "$1"; :
|
x_ check_makefile "$1"; :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-10
@@ -168,10 +168,9 @@ fetch()
|
|||||||
# the given hashsum. So, search for a matching file via bruteforce:
|
# the given hashsum. So, search for a matching file via bruteforce:
|
||||||
( fx_ "mkdst $binsum" x_ find "${_pre_dest%/*}" -type f ) || :
|
( fx_ "mkdst $binsum" x_ find "${_pre_dest%/*}" -type f ) || :
|
||||||
|
|
||||||
if ! bad_checksum "$binsum" "$_dest"; then
|
bad_checksum "$binsum" "$_dest" || \
|
||||||
[ -f "$_dest" ] && \
|
[ ! -f "$_dest" ] || \
|
||||||
return 0; :
|
return 0; :
|
||||||
fi
|
|
||||||
|
|
||||||
[ -z "$binsum" ] && \
|
[ -z "$binsum" ] && \
|
||||||
printf "'%s': checksum undefined\n" "$_dest" 1>&2
|
printf "'%s': checksum undefined\n" "$_dest" 1>&2
|
||||||
@@ -266,11 +265,6 @@ find_me()
|
|||||||
mfs="" # no MFS whitelist needed, due to -r:
|
mfs="" # no MFS whitelist needed, due to -r:
|
||||||
fi
|
fi
|
||||||
if [ "$MEclean" = "n" ] || [ "$MEshrink" != "y" ]; then
|
if [ "$MEclean" = "n" ] || [ "$MEshrink" != "y" ]; then
|
||||||
# MEclean can still be y, this just means don't shrink,
|
|
||||||
# so deleted modules would become padded space. this
|
|
||||||
# could also be used alongside --whitelist, if
|
|
||||||
# MEclean is otherwise enabled.
|
|
||||||
|
|
||||||
_r="" # don't re-locate ME modules
|
_r="" # don't re-locate ME modules
|
||||||
_trunc="" # don't shrink the me.bin file size
|
_trunc="" # don't shrink the me.bin file size
|
||||||
fi
|
fi
|
||||||
@@ -523,9 +517,8 @@ prep()
|
|||||||
( mksha512 "$_xrom" "vendorhashes" ) || err; :
|
( mksha512 "$_xrom" "vendorhashes" ) || err; :
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! add_vfiles "$_xrom"; then
|
add_vfiles "$_xrom" || \
|
||||||
return 1 # no need to insert files
|
return 1 # no need to insert files
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$nuke" = "nuke" ]; then
|
if [ "$nuke" = "nuke" ]; then
|
||||||
pad_one_byte "$_xrom"
|
pad_one_byte "$_xrom"
|
||||||
|
|||||||
@@ -7,6 +7,11 @@
|
|||||||
|
|
||||||
set -u -e
|
set -u -e
|
||||||
|
|
||||||
|
eval "`printf "%s\n" "LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE \
|
||||||
|
LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE \
|
||||||
|
LC_MEASUREMENT LC_IDENTIFICATION LC_ALL" | \
|
||||||
|
awk '{ for (i=1; i<=NF; i++) $i = "export " $i "=C.UTF-8;"; print }'`"
|
||||||
|
|
||||||
(
|
(
|
||||||
xbarg0="$0"
|
xbarg0="$0"
|
||||||
[ "${xbarg0##*/}" = "$xbarg0" ] && \
|
[ "${xbarg0##*/}" = "$xbarg0" ] && \
|
||||||
|
|||||||
Reference in New Issue
Block a user