general code cleanup in the build system
Signed-off-by: Leah Rowe <leah@libreboot.org>3050wip
parent
3bd290f6a6
commit
7fa6052de0
28
build
28
build
|
@ -27,7 +27,7 @@ main()
|
||||||
|
|
||||||
for g in "which git" "git config --global user.name" \
|
for g in "which git" "git config --global user.name" \
|
||||||
"git config --global user.email" "git_init"; do
|
"git config --global user.email" "git_init"; do
|
||||||
eval "$g 1>/dev/null 2>/dev/null || git_err \"$g\""
|
eval "$g 1>/dev/null 2>/dev/null || $err \"Unconfigured: $g\""
|
||||||
done
|
done
|
||||||
|
|
||||||
case "${spath#script/}" in
|
case "${spath#script/}" in
|
||||||
|
@ -37,14 +37,13 @@ main()
|
||||||
download) shift 1; vendor_download $@ ;;
|
download) shift 1; vendor_download $@ ;;
|
||||||
roms)
|
roms)
|
||||||
if [ $# -gt 1 ] && [ "$2" = "serprog" ]; then
|
if [ $# -gt 1 ] && [ "$2" = "serprog" ]; then
|
||||||
x_ ./update trees -b stm32-vserprog
|
x_ ./mk -b stm32-vserprog
|
||||||
x_ ./update trees -b pico-serprog; return 0
|
x_ ./mk -b pico-serprog; return 0
|
||||||
fi; shift 1
|
fi; shift 1
|
||||||
x_ ./update trees -b coreboot $@ ;;
|
x_ ./mk -b coreboot $@ ;;
|
||||||
*)
|
*)
|
||||||
echo "'$@'"
|
|
||||||
[ -f "$spath" ] || $err "bad command"
|
[ -f "$spath" ] || $err "bad command"
|
||||||
$shcmd; "$spath" $@ || $err "excmd: $spath $@" ;;
|
$shcmd; "$spath" $@ || $err "excmd: $spath $(echo "$@")" ;;
|
||||||
esac
|
esac
|
||||||
set -u -e # some commands disable them. turn them on!
|
set -u -e # some commands disable them. turn them on!
|
||||||
}
|
}
|
||||||
|
@ -62,12 +61,6 @@ git_init()
|
||||||
git tag -a "$version" -m "$projectname $version" || return 1
|
git tag -a "$version" -m "$projectname $version" || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
git_err()
|
|
||||||
{
|
|
||||||
printf "You need to set git name/email, like so:\n%s\n\n" "$1" 1>&2
|
|
||||||
$err "Git name/email not configured"
|
|
||||||
}
|
|
||||||
|
|
||||||
mkrelease()
|
mkrelease()
|
||||||
{
|
{
|
||||||
export XBMK_RELEASE="y"
|
export XBMK_RELEASE="y"
|
||||||
|
@ -100,9 +93,7 @@ build_release()
|
||||||
{
|
{
|
||||||
(
|
(
|
||||||
cd "$srcdir" || $err "$vdir: !cd \"$srcdir\""
|
cd "$srcdir" || $err "$vdir: !cd \"$srcdir\""
|
||||||
./update trees -f
|
./mk -f; x_ rm -Rf tmp; rmgit .
|
||||||
rmgit .
|
|
||||||
x_ rm -Rf tmp
|
|
||||||
x_ mv src/docs docs
|
x_ mv src/docs docs
|
||||||
) || $err "can't create release files"
|
) || $err "can't create release files"
|
||||||
|
|
||||||
|
@ -117,12 +108,11 @@ build_release()
|
||||||
[ "$mode" = "src" ] && return 0
|
[ "$mode" = "src" ] && return 0
|
||||||
|
|
||||||
touch "$srcdir/lock" || $err "can't make lock file in $srcdir/"
|
touch "$srcdir/lock" || $err "can't make lock file in $srcdir/"
|
||||||
|
|
||||||
(
|
(
|
||||||
cd "$srcdir" || $err "$vdir: 2 !cd \"$srcdir\""
|
cd "$srcdir" || $err "$vdir: 2 !cd \"$srcdir\""
|
||||||
./update trees -b coreboot || $err "$vdir: roms-all"
|
./mk -b coreboot || $err "$vdir: roms-all"
|
||||||
./update trees -b pico-serprog || $err "$vdir: rp2040"
|
./mk -b pico-serprog || $err "$vdir: rp2040"
|
||||||
./update trees -b stm32-vserprog || $err "$vdir: stm32"
|
./mk -b stm32-vserprog || $err "$vdir: stm32"
|
||||||
x_ mv bin ../roms
|
x_ mv bin ../roms
|
||||||
) || $err "can't build rom images"
|
) || $err "can't build rom images"
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ eval `setvars "" loc url bkup_url subfile subhash subrepo subrepo_bkup \
|
||||||
fetch_targets()
|
fetch_targets()
|
||||||
{
|
{
|
||||||
[ -n "$tree_depend" ] && [ "$tree_depend" != "$tree" ] && \
|
[ -n "$tree_depend" ] && [ "$tree_depend" != "$tree" ] && \
|
||||||
x_ ./update trees -f "$project" "$tree_depend"
|
x_ ./mk -f "$project" "$tree_depend"
|
||||||
e "src/$project/$tree" d && return 0
|
e "src/$project/$tree" d && return 0
|
||||||
|
|
||||||
printf "Creating %s tree %s\n" "$project" "$tree"
|
printf "Creating %s tree %s\n" "$project" "$tree"
|
||||||
|
@ -23,10 +23,10 @@ fetch_project()
|
||||||
|
|
||||||
chkvars url
|
chkvars url
|
||||||
|
|
||||||
[ -n "$xtree" ] && x_ ./update trees -f coreboot "$xtree"
|
[ -n "$xtree" ] && x_ ./mk -f coreboot "$xtree"
|
||||||
[ -z "$depend" ] || for d in $depend ; do
|
[ -z "$depend" ] || for d in $depend ; do
|
||||||
printf "'%s' needs '%s'; grabbing '%s'\n" "$project" "$d" "$d"
|
printf "'%s' needs '%s'; grabbing '%s'\n" "$project" "$d" "$d"
|
||||||
x_ ./update trees -f $d
|
x_ ./mk -f $d
|
||||||
done
|
done
|
||||||
clone_project
|
clone_project
|
||||||
|
|
||||||
|
@ -39,32 +39,24 @@ clone_project()
|
||||||
{
|
{
|
||||||
loc="$XBMK_CACHE/repo/$project" && singletree "$project" && \
|
loc="$XBMK_CACHE/repo/$project" && singletree "$project" && \
|
||||||
loc="src/$project"
|
loc="src/$project"
|
||||||
|
|
||||||
printf "Downloading project '%s' to '%s'\n" "$project" "$loc"
|
printf "Downloading project '%s' to '%s'\n" "$project" "$loc"
|
||||||
e "$loc" d && return 0
|
|
||||||
|
|
||||||
remkdir "${tmpgit%/*}"
|
e "$loc" d missing && remkdir "${tmpgit%/*}" && git_prep \
|
||||||
git_prep "$url" "$bkup_url" "$PWD/config/$project/patches" "$loc"
|
"$url" "$bkup_url" "$PWD/config/$project/patches" "$loc"; :
|
||||||
}
|
}
|
||||||
|
|
||||||
git_prep()
|
git_prep()
|
||||||
{
|
{
|
||||||
_patchdir="$3" # $1 and $2 are gitrepo and gitrepo_backup
|
_patchdir="$3"; _loc="$4" # $1 and $2 are gitrepo and gitrepo_backup
|
||||||
_loc="$4"
|
|
||||||
|
|
||||||
chkvars rev
|
chkvars rev; tmpclone "$1" "$2" "$tmpgit" "$rev" "$_patchdir"
|
||||||
|
|
||||||
tmpclone "$1" "$2" "$tmpgit" "$rev" "$_patchdir"
|
|
||||||
if singletree "$project" || [ $# -gt 4 ]; then
|
if singletree "$project" || [ $# -gt 4 ]; then
|
||||||
prep_submodules "$_loc"
|
prep_submodules "$_loc"; fi
|
||||||
fi
|
|
||||||
|
|
||||||
[ "$project" = "coreboot" ] && [ -n "$xtree" ] && [ $# -gt 2 ] && \
|
[ "$project" = "coreboot" ] && [ -n "$xtree" ] && [ $# -gt 2 ] && \
|
||||||
[ "$xtree" != "$tree" ] && link_crossgcc "$_loc"
|
[ "$xtree" != "$tree" ] && link_crossgcc "$_loc"
|
||||||
|
|
||||||
[ "$XBMK_RELEASE" = "y" ] && \
|
[ "$XBMK_RELEASE" = "y" ] && \
|
||||||
[ "$_loc" != "$XBMK_CACHE/repo/$project" ] && \
|
[ "$_loc" != "$XBMK_CACHE/repo/$project" ] && rmgit "$tmpgit"
|
||||||
rmgit "$tmpgit"
|
|
||||||
|
|
||||||
move_repo "$_loc"
|
move_repo "$_loc"
|
||||||
}
|
}
|
||||||
|
@ -87,7 +79,6 @@ fetch_submodule()
|
||||||
_seval="if [ -n \"\$sub$xt\" ] || [ -n \"\$sub${xt}_bkup\" ]"
|
_seval="if [ -n \"\$sub$xt\" ] || [ -n \"\$sub${xt}_bkup\" ]"
|
||||||
eval "$_seval; then st=\"\$st \$xt\"; fi"
|
eval "$_seval; then st=\"\$st \$xt\"; fi"
|
||||||
done
|
done
|
||||||
|
|
||||||
st="${st# }" && [ "$st" = "repo file" ] && $err "$mdir: repo+file"
|
st="${st# }" && [ "$st" = "repo file" ] && $err "$mdir: repo+file"
|
||||||
|
|
||||||
[ -z "$st" ] && return 0 # subrepo/subfile not defined
|
[ -z "$st" ] && return 0 # subrepo/subfile not defined
|
||||||
|
@ -103,12 +94,12 @@ fetch_submodule()
|
||||||
tmpclone()
|
tmpclone()
|
||||||
{
|
{
|
||||||
[ "$repofail" = "y" ] && \
|
[ "$repofail" = "y" ] && \
|
||||||
printf "Cached clone failed; trying online.\n" 1>&2
|
printf "Cached clone failed; trying online.\n" 1>&2; repofail="n"
|
||||||
repofail="n"
|
|
||||||
|
|
||||||
[ $# -lt 6 ] || rm -Rf "$3" || $err "git retry: !rm $3 ($1)"
|
[ $# -lt 6 ] || rm -Rf "$3" || $err "git retry: !rm $3 ($1)"
|
||||||
repodir="$XBMK_CACHE/repo/${1##*/}" && [ $# -gt 5 ] && repodir="$3"
|
repodir="$XBMK_CACHE/repo/${1##*/}" && [ $# -gt 5 ] && repodir="$3"
|
||||||
mkdir -p "$XBMK_CACHE/repo" || $err "!rmdir $XBMK_CACHE/repo"
|
mkdir -p "$XBMK_CACHE/repo" || $err "!rmdir $XBMK_CACHE/repo"
|
||||||
|
|
||||||
if [ -d "$repodir" ] && [ $# -lt 6 ]; then
|
if [ -d "$repodir" ] && [ $# -lt 6 ]; then
|
||||||
git -C "$repodir" pull || sleep 3 || git -C "$repodir" pull \
|
git -C "$repodir" pull || sleep 3 || git -C "$repodir" pull \
|
||||||
|| sleep 3 || git -C "$repodir" pull || :
|
|| sleep 3 || git -C "$repodir" pull || :
|
||||||
|
|
|
@ -7,8 +7,6 @@ export LC_COLLATE=C
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
|
|
||||||
_ua="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
|
_ua="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
|
||||||
kbnotice="Insert a .gkb file from config/data/grub/keymap/ as keymap.gkb \
|
|
||||||
if you want a custom keymap in GRUB; use cbfstool from elf/cbfstool."
|
|
||||||
|
|
||||||
ifdtool="elf/ifdtool/default/ifdtool"
|
ifdtool="elf/ifdtool/default/ifdtool"
|
||||||
cbfstool="elf/cbfstool/default/cbfstool"
|
cbfstool="elf/cbfstool/default/cbfstool"
|
||||||
|
@ -58,8 +56,7 @@ e()
|
||||||
estr="[ -$es_t \"\$1\" ] || return 1"
|
estr="[ -$es_t \"\$1\" ] || return 1"
|
||||||
[ $# -gt 2 ] && estr="[ -$es_t \"\$1\" ] && return 1" && es2="missing"
|
[ $# -gt 2 ] && estr="[ -$es_t \"\$1\" ] && return 1" && es2="missing"
|
||||||
|
|
||||||
eval "$estr"
|
eval "$estr"; printf "%s %s\n" "$1" "$es2" 1>&2
|
||||||
printf "%s %s\n" "$1" "$es2" 1>&2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
install_packages()
|
install_packages()
|
||||||
|
@ -121,8 +118,7 @@ versiondate_="$versiondate"
|
||||||
[ ! -e ".git" ] || versiondate="$(git show --no-patch --no-notes \
|
[ ! -e ".git" ] || versiondate="$(git show --no-patch --no-notes \
|
||||||
--pretty='%ct' HEAD)" || versiondate="$versiondate_"
|
--pretty='%ct' HEAD)" || versiondate="$versiondate_"
|
||||||
for p in projectname version versiondate projectsite; do
|
for p in projectname version versiondate projectsite; do
|
||||||
chkvars "$p"
|
chkvars "$p"; eval "x_ printf \"%s\\n\" \"\$$p\" > $p"
|
||||||
eval "x_ printf \"%s\\n\" \"\$$p\" > $p"
|
|
||||||
done
|
done
|
||||||
relname="$projectname-$version"
|
relname="$projectname-$version"
|
||||||
export LOCALVERSION="-$projectname-${version%%-*}"
|
export LOCALVERSION="-$projectname-${version%%-*}"
|
||||||
|
@ -147,8 +143,7 @@ mkrom_tarball()
|
||||||
printf "%s\n" "$versiondate" > "$1/versiondate" || $err "$1 !vdate"
|
printf "%s\n" "$versiondate" > "$1/versiondate" || $err "$1 !vdate"
|
||||||
printf "%s\n" "$projectname" > "$1/projectname" || $err "$1 !pname"
|
printf "%s\n" "$projectname" > "$1/projectname" || $err "$1 !pname"
|
||||||
|
|
||||||
mktarball "$1" "${1%/*}/${relname}_${1##*/}.tar.xz"
|
mktarball "$1" "${1%/*}/${relname}_${1##*/}.tar.xz"; x_ rm -Rf "$1"; :
|
||||||
x_ rm -Rf "$1"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mktarball()
|
mktarball()
|
||||||
|
@ -182,7 +177,7 @@ rmgit()
|
||||||
singletree()
|
singletree()
|
||||||
{
|
{
|
||||||
for targetfile in "config/${1}/"*/target.cfg; do
|
for targetfile in "config/${1}/"*/target.cfg; do
|
||||||
[ -e "$targetfile" ] && [ -f "$targetfile" ] && return 1
|
[ -e "$targetfile" ] && [ -f "$targetfile" ] && return 1; :
|
||||||
done; return 0
|
done; return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,8 +203,7 @@ download()
|
||||||
vendor_checksum()
|
vendor_checksum()
|
||||||
{
|
{
|
||||||
[ "$(sha512sum "$2" | awk '{print $1}')" != "$1" ] || return 1
|
[ "$(sha512sum "$2" | awk '{print $1}')" != "$1" ] || return 1
|
||||||
printf "Bad checksum for file: %s\n" "$2" 1>&2
|
printf "Bad checksum for file: %s\n" "$2" 1>&2; rm -f "$2" || :; :
|
||||||
rm -f "$2" || :
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cbfs()
|
cbfs()
|
||||||
|
|
|
@ -28,10 +28,8 @@ mkpayload_grub()
|
||||||
{
|
{
|
||||||
eval `setvars "" grub_modules grub_install_modules`
|
eval `setvars "" grub_modules grub_install_modules`
|
||||||
$dry eval `setcfg "$grubdata/module/$tree"`
|
$dry eval `setcfg "$grubdata/module/$tree"`
|
||||||
|
$dry x_ rm -f "$srcdir/grub.elf"; $dry \
|
||||||
$dry x_ rm -f "$srcdir/grub.elf"
|
"$srcdir/grub-mkstandalone" --grub-mkimage="$srcdir/grub-mkimage" \
|
||||||
|
|
||||||
$dry "$srcdir/grub-mkstandalone" --grub-mkimage="$srcdir/grub-mkimage" \
|
|
||||||
-O i386-coreboot -o "$srcdir/grub.elf" -d "${srcdir}/grub-core/" \
|
-O i386-coreboot -o "$srcdir/grub.elf" -d "${srcdir}/grub-core/" \
|
||||||
--fonts= --themes= --locales= --modules="$grub_modules" \
|
--fonts= --themes= --locales= --modules="$grub_modules" \
|
||||||
--install-modules="$grub_install_modules" \
|
--install-modules="$grub_install_modules" \
|
||||||
|
@ -78,16 +76,11 @@ check_coreboot_utils()
|
||||||
}
|
}
|
||||||
|
|
||||||
mkcorebootbin()
|
mkcorebootbin()
|
||||||
{
|
|
||||||
$dry realmkcorebootbin; :
|
|
||||||
}
|
|
||||||
|
|
||||||
realmkcorebootbin()
|
|
||||||
{
|
{
|
||||||
[ "$target" = "$tree" ] && return 0
|
[ "$target" = "$tree" ] && return 0
|
||||||
|
|
||||||
tmprom="$TMPDIR/coreboot.rom"
|
tmprom="$TMPDIR/coreboot.rom"
|
||||||
mv "$srcdir/build/coreboot.rom" "$tmprom" || $err "!mktmprom"
|
$dry x_ cp "$srcdir/build/coreboot.rom" "$tmprom"
|
||||||
|
|
||||||
initmode="${defconfig##*/}"; displaymode="${initmode##*_}"
|
initmode="${defconfig##*/}"; displaymode="${initmode##*_}"
|
||||||
initmode="${initmode%%_*}"
|
initmode="${initmode%%_*}"
|
||||||
|
@ -107,12 +100,12 @@ realmkcorebootbin()
|
||||||
|
|
||||||
[ "$payload_memtest" = "y" ] || payload_memtest="n"
|
[ "$payload_memtest" = "y" ] || payload_memtest="n"
|
||||||
[ "$(uname -m)" = "x86_64" ] || payload_memtest="n"
|
[ "$(uname -m)" = "x86_64" ] || payload_memtest="n"
|
||||||
if grep "CONFIG_PAYLOAD_NONE=y" "$defconfig"; then
|
if $dry grep "CONFIG_PAYLOAD_NONE=y" "$defconfig"; then
|
||||||
[ "$payload_seabios" = "y" ] && pname="seabios" && \
|
[ "$payload_seabios" = "y" ] && pname="seabios" && \
|
||||||
$dry add_seabios
|
$dry add_seabios
|
||||||
[ "$payload_uboot" = "y" ] && pname="uboot" && $dry add_uboot
|
[ "$payload_uboot" = "y" ] && pname="uboot" && $dry add_uboot
|
||||||
else
|
else
|
||||||
pname="custom" && cprom; :
|
pname="custom" && $dry cprom; :
|
||||||
fi; :
|
fi; :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,10 +142,8 @@ mkseagrub()
|
||||||
{
|
{
|
||||||
cbfs "$tmprom" "$grubdata/bootorder" bootorder raw
|
cbfs "$tmprom" "$grubdata/bootorder" bootorder raw
|
||||||
for keymap in config/data/grub/keymap/*.gkb; do
|
for keymap in config/data/grub/keymap/*.gkb; do
|
||||||
[ -f "$keymap" ] || continue
|
[ -f "$keymap" ] && cprom "${keymap##*/}"; :
|
||||||
keymap="${keymap##*/}"
|
done; :
|
||||||
cprom "${keymap%.gkb}"
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add_uboot()
|
add_uboot()
|
||||||
|
@ -168,11 +159,11 @@ add_uboot()
|
||||||
cprom()
|
cprom()
|
||||||
{
|
{
|
||||||
newrom="bin/$target/${pname}_${target}_$initmode$displaymode.rom"
|
newrom="bin/$target/${pname}_${target}_$initmode$displaymode.rom"
|
||||||
[ $# -gt 0 ] && newrom="${newrom%.rom}_$1.rom"
|
[ $# -gt 0 ] && newrom="${newrom%.rom}_${1%.gkb}.rom"
|
||||||
|
|
||||||
x_ mkdir -p "bin/$target"
|
x_ mkdir -p "bin/$target"
|
||||||
x_ cp "$tmprom" "$newrom" && [ $# -gt 0 ] && \
|
x_ cp "$tmprom" "$newrom" && [ $# -gt 0 ] && \
|
||||||
cbfs "$newrom" "config/data/grub/keymap/$1.gkb" keymap.gkb raw
|
cbfs "$newrom" "config/data/grub/keymap/$1" keymap.gkb raw
|
||||||
|
|
||||||
[ "$XBMK_RELEASE" = "y" ] || return 0
|
[ "$XBMK_RELEASE" = "y" ] || return 0
|
||||||
$dry mksha512sum "$newrom" "vendorhashes"; $dry ./vendor inject \
|
$dry mksha512sum "$newrom" "vendorhashes"; $dry ./vendor inject \
|
||||||
|
@ -180,12 +171,7 @@ cprom()
|
||||||
}
|
}
|
||||||
|
|
||||||
mkcoreboottar()
|
mkcoreboottar()
|
||||||
{
|
|
||||||
$dry realmkcoreboottar
|
|
||||||
}
|
|
||||||
|
|
||||||
realmkcoreboottar()
|
|
||||||
{
|
{
|
||||||
[ "$target" = "$tree" ] && return 0; [ "$XBMK_RELEASE" = "y" ] && \
|
[ "$target" = "$tree" ] && return 0; [ "$XBMK_RELEASE" = "y" ] && \
|
||||||
[ "$release" != "n" ] && $dry mkrom_tarball "bin/$target"; return 0
|
[ "$release" != "n" ] && $dry mkrom_tarball "bin/$target"; :
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,10 +25,8 @@ eval `setvars "" EC_url_bkup EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \
|
||||||
|
|
||||||
vendor_download()
|
vendor_download()
|
||||||
{
|
{
|
||||||
export PATH="$PATH:/sbin"
|
[ $# -gt 0 ] || $err "No argument given"; export PATH="$PATH:/sbin"
|
||||||
|
board="$1"; readcfg && readkconfig && bootstrap && getfiles; :
|
||||||
[ $# -gt 0 ] || $err "No argument given"
|
|
||||||
board="$1" && readcfg && readkconfig && bootstrap && getfiles; return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
readkconfig()
|
readkconfig()
|
||||||
|
@ -49,14 +47,14 @@ readkconfig()
|
||||||
|
|
||||||
bootstrap()
|
bootstrap()
|
||||||
{
|
{
|
||||||
x_ ./update trees -f coreboot ${cbdir##*/}
|
x_ ./mk -f coreboot ${cbdir##*/}
|
||||||
for d in uefitool biosutilities bios_extract; do
|
for d in uefitool biosutilities bios_extract; do
|
||||||
x_ ./update trees -b "$d"
|
x_ ./mk -b "$d"
|
||||||
done
|
done
|
||||||
[ -d "${kbc1126_ec_dump%/*}" ] && x_ make -C "$cbdir/util/kbc1126"
|
[ -d "${kbc1126_ec_dump%/*}" ] && x_ make -C "$cbdir/util/kbc1126"
|
||||||
[ -n "$MRC_refcode_cbtree" ] && \
|
[ -n "$MRC_refcode_cbtree" ] && \
|
||||||
cbfstoolref="elf/cbfstool/$MRC_refcode_cbtree/cbfstool" && \
|
cbfstoolref="elf/cbfstool/$MRC_refcode_cbtree/cbfstool" && \
|
||||||
x_ ./update trees -d coreboot $MRC_refcode_cbtree; return 0
|
x_ ./mk -d coreboot $MRC_refcode_cbtree; return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
getfiles()
|
getfiles()
|
||||||
|
@ -68,9 +66,8 @@ getfiles()
|
||||||
"$CONFIG_SMSC_SCH5545_EC_FW_FILE"
|
"$CONFIG_SMSC_SCH5545_EC_FW_FILE"
|
||||||
[ -z "$CONFIG_KBC1126_FIRMWARE" ] || fetch kbc1126ec "$EC_url" \
|
[ -z "$CONFIG_KBC1126_FIRMWARE" ] || fetch kbc1126ec "$EC_url" \
|
||||||
"$EC_url_bkup" "$EC_hash" "$CONFIG_KBC1126_FW1"
|
"$EC_url_bkup" "$EC_hash" "$CONFIG_KBC1126_FW1"
|
||||||
[ -z "$CONFIG_VGA_BIOS_FILE" ] || fetch "e6400vga" \
|
[ -z "$CONFIG_VGA_BIOS_FILE" ] || fetch e6400vga "$E6400_VGA_DL_url" \
|
||||||
"$E6400_VGA_DL_url" "$E6400_VGA_DL_url_bkup" "$E6400_VGA_DL_hash" \
|
"$E6400_VGA_DL_url_bkup" "$E6400_VGA_DL_hash" "$CONFIG_VGA_BIOS_FILE"
|
||||||
"$CONFIG_VGA_BIOS_FILE"
|
|
||||||
[ -z "$CONFIG_HAVE_MRC" ] || fetch "mrc" "$MRC_url" "$MRC_url_bkup" \
|
[ -z "$CONFIG_HAVE_MRC" ] || fetch "mrc" "$MRC_url" "$MRC_url_bkup" \
|
||||||
"$MRC_hash" "$CONFIG_MRC_FILE"; return 0
|
"$MRC_hash" "$CONFIG_MRC_FILE"; return 0
|
||||||
}
|
}
|
||||||
|
@ -82,33 +79,27 @@ fetch()
|
||||||
|
|
||||||
download "$dl" "$dl_bkup" "$_dl" "$dlsum"
|
download "$dl" "$dl_bkup" "$_dl" "$dlsum"
|
||||||
|
|
||||||
rm -Rf "${_dl}_extracted" || \
|
rm -Rf "${_dl}_extracted" || $err "!rm -Rf ${_ul}_extracted"
|
||||||
$err "!rm -Rf ${_ul}_extracted"
|
|
||||||
e "$_dest" f && return 0
|
e "$_dest" f && return 0
|
||||||
|
|
||||||
mkdir -p "${_dest%/*}" || $err "mkdirs: !mkdir -p ${_dest%/*}"
|
mkdir -p "${_dest%/*}" || $err "mkdirs: !mkdir -p ${_dest%/*}"
|
||||||
remkdir "$appdir"
|
remkdir "$appdir"; extract_archive "$_dl" "$appdir" || \
|
||||||
extract_archive "$_dl" "$appdir" || [ "$dl_type" = "e6400vga" ] || \
|
[ "$dl_type" = "e6400vga" ] || $err "mkd $_dest $dl_type: !extract"
|
||||||
$err "mkdirs $_dest $dl_type: !extract"
|
|
||||||
|
|
||||||
eval "extract_$dl_type"
|
eval "extract_$dl_type"; set -u -e
|
||||||
set -u -e
|
e "$_dest" f missing && $err "!extract_$dl_type"; :
|
||||||
|
|
||||||
e "$_dest" f missing && $err "!extract_$dl_type"; return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extract_intel_me()
|
extract_intel_me()
|
||||||
{
|
{
|
||||||
e "$mecleaner" f not && $err "$cbdir: me_cleaner missing"
|
e "$mecleaner" f not && $err "$cbdir: me_cleaner missing"
|
||||||
|
|
||||||
_me="$PWD/$_dest" # must always be an absolute path
|
_me="$PWD/$_dest"; cdir="$PWD/$appdir"
|
||||||
cdir="$PWD/$appdir" # must always be an absolute path
|
|
||||||
[ $# -gt 0 ] && _me="${1}" && cdir="$2"
|
[ $# -gt 0 ] && _me="${1}" && cdir="$2"
|
||||||
|
|
||||||
e "$_me" f && return 0
|
e "$_me" f && return 0
|
||||||
|
|
||||||
sdir="$(mktemp -d)"
|
sdir="$(mktemp -d)"; [ -z "$sdir" ] && return 0
|
||||||
[ -z "$sdir" ] && return 0
|
|
||||||
mkdir -p "$sdir" || $err "extract_intel_me: !mkdir -p \"$sdir\""
|
mkdir -p "$sdir" || $err "extract_intel_me: !mkdir -p \"$sdir\""
|
||||||
|
|
||||||
set +u +e
|
set +u +e
|
||||||
|
@ -131,8 +122,7 @@ extract_intel_me()
|
||||||
else
|
else
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
cdir="$1"
|
cdir="$1"; [ "${cdir#/a}" != "$cdir" ] && cdir="${cdir#/}"
|
||||||
[ "${cdir#/a}" != "$cdir" ] && cdir="${cdir#/}"
|
|
||||||
cd "$cdir" || :
|
cd "$cdir" || :
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
@ -149,8 +139,7 @@ extract_kbc1126ec()
|
||||||
{
|
{
|
||||||
e "$kbc1126_ec_dump" f missing && $err "$cbdir: kbc1126 util missing"
|
e "$kbc1126_ec_dump" f missing && $err "$cbdir: kbc1126 util missing"
|
||||||
(
|
(
|
||||||
x_ cd "$appdir/"
|
x_ cd "$appdir/"; mv Rompaq/68*.BIN ec.bin || :
|
||||||
mv Rompaq/68*.BIN ec.bin || :
|
|
||||||
if [ ! -f "ec.bin" ]; then
|
if [ ! -f "ec.bin" ]; then
|
||||||
unar -D ROM.CAB Rom.bin || unar -D Rom.CAB Rom.bin || \
|
unar -D ROM.CAB Rom.bin || unar -D Rom.CAB Rom.bin || \
|
||||||
unar -D 68*.CAB Rom.bin || $err "can't extract Rom.bin"
|
unar -D 68*.CAB Rom.bin || $err "can't extract Rom.bin"
|
||||||
|
@ -195,14 +184,10 @@ extract_sch5545ec()
|
||||||
|
|
||||||
vendor_inject()
|
vendor_inject()
|
||||||
{
|
{
|
||||||
set +u +e
|
set +u +e; [ $# -lt 1 ] && $err "No options specified."
|
||||||
|
|
||||||
[ $# -lt 1 ] && $err "No options specified."
|
|
||||||
[ "$1" = "listboards" ] && eval "ls -1 config/coreboot || :; exit 0"
|
[ "$1" = "listboards" ] && eval "ls -1 config/coreboot || :; exit 0"
|
||||||
|
|
||||||
archive="$1"
|
archive="$1"; while getopts n:r:b:m: option; do
|
||||||
|
|
||||||
while getopts n:r:b:m: option; do
|
|
||||||
case "$option" in
|
case "$option" in
|
||||||
n) nukemode="$OPTARG" ;;
|
n) nukemode="$OPTARG" ;;
|
||||||
r) rom="$OPTARG" ;;
|
r) rom="$OPTARG" ;;
|
||||||
|
@ -215,11 +200,7 @@ vendor_inject()
|
||||||
check_board || return 0
|
check_board || return 0
|
||||||
[ "$nukemode" = "nuke" ] || x_ ./vendor download $board
|
[ "$nukemode" = "nuke" ] || x_ ./vendor download $board
|
||||||
[ "$vrelease" != "y" ] && patch_rom "$rom"
|
[ "$vrelease" != "y" ] && patch_rom "$rom"
|
||||||
[ "$vrelease" = "y" ] && patch_release_roms
|
[ "$vrelease" = "y" ] && patch_release_roms; :
|
||||||
|
|
||||||
[ "$nukemode" = "nuke" ] && return 0
|
|
||||||
printf "Friendly reminder (this is *not* an error message):\n"
|
|
||||||
printf "Make sure the files were inserted. ALSO:\n%s\n" "$kbnotice"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_board()
|
check_board()
|
||||||
|
@ -246,15 +227,13 @@ check_release()
|
||||||
# It will only succeed if the filename is not changed from the build/download
|
# It will only succeed if the filename is not changed from the build/download
|
||||||
detect_board()
|
detect_board()
|
||||||
{
|
{
|
||||||
path="$1"
|
path="$1"; filename="$(basename "$path")"
|
||||||
filename="$(basename "$path")"
|
|
||||||
case "$filename" in
|
case "$filename" in
|
||||||
grub_*|seagrub_*|custom_*)
|
grub_*|seagrub_*|custom_*)
|
||||||
board="$(echo "$filename" | cut -d '_' -f2-3)" ;;
|
board="$(echo "$filename" | cut -d '_' -f2-3)" ;;
|
||||||
seabios_withgrub_*)
|
seabios_withgrub_*)
|
||||||
board="$(echo "$filename" | cut -d '_' -f3-4)" ;;
|
board="$(echo "$filename" | cut -d '_' -f3-4)" ;;
|
||||||
*.tar.xz)
|
*.tar.xz) _stripped_prefix="${filename#*_}"
|
||||||
_stripped_prefix="${filename#*_}"
|
|
||||||
board="${_stripped_prefix%.tar.xz}" ;;
|
board="${_stripped_prefix%.tar.xz}" ;;
|
||||||
*) $err "detect_board $filename: could not detect board type"
|
*) $err "detect_board $filename: could not detect board type"
|
||||||
esac; printf "%s\n" "$board"
|
esac; printf "%s\n" "$board"
|
||||||
|
@ -265,10 +244,8 @@ readcfg()
|
||||||
if [ "$board" = "serprog_rp2040" ] || \
|
if [ "$board" = "serprog_rp2040" ] || \
|
||||||
[ "$board" = "serprog_stm32" ]; then
|
[ "$board" = "serprog_stm32" ]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi; boarddir="$cbcfgsdir/$board"
|
||||||
boarddir="$cbcfgsdir/$board"
|
eval `setcfg "$boarddir/target.cfg"`; chkvars vcfg tree
|
||||||
eval `setcfg "$boarddir/target.cfg"`
|
|
||||||
chkvars vcfg tree
|
|
||||||
|
|
||||||
cbdir="src/coreboot/$tree"
|
cbdir="src/coreboot/$tree"
|
||||||
cbfstool="elf/cbfstool/$tree/cbfstool"
|
cbfstool="elf/cbfstool/$tree/cbfstool"
|
||||||
|
@ -277,13 +254,12 @@ readcfg()
|
||||||
cbfstool="elf/cbfstool/$tree/cbfstool"
|
cbfstool="elf/cbfstool/$tree/cbfstool"
|
||||||
ifdtool="elf/ifdtool/$tree/ifdtool"
|
ifdtool="elf/ifdtool/$tree/ifdtool"
|
||||||
|
|
||||||
x_ ./update trees -d coreboot $tree
|
x_ ./mk -d coreboot $tree
|
||||||
}
|
}
|
||||||
|
|
||||||
patch_release_roms()
|
patch_release_roms()
|
||||||
{
|
{
|
||||||
remkdir "tmp/romdir"
|
remkdir "tmp/romdir"; tar -xf "$archive" -C "tmp/romdir" || \
|
||||||
tar -xf "$archive" -C "tmp/romdir" || \
|
|
||||||
$err "patch_release_roms: !tar -xf \"$archive\" -C \"tmp/romdir\""
|
$err "patch_release_roms: !tar -xf \"$archive\" -C \"tmp/romdir\""
|
||||||
|
|
||||||
for x in "tmp/romdir/bin/"*/*.rom ; do
|
for x in "tmp/romdir/bin/"*/*.rom ; do
|
||||||
|
@ -311,9 +287,7 @@ patch_release_roms()
|
||||||
|
|
||||||
patch_rom()
|
patch_rom()
|
||||||
{
|
{
|
||||||
rom="$1"
|
rom="$1"; . "$(check_defconfig "$boarddir")" 2>/dev/null || exit 0
|
||||||
|
|
||||||
. "$(check_defconfig "$boarddir")" 2>/dev/null || exit 0
|
|
||||||
|
|
||||||
[ "$CONFIG_HAVE_MRC" = "y" ] && inject "mrc.bin" "$CONFIG_MRC_FILE" \
|
[ "$CONFIG_HAVE_MRC" = "y" ] && inject "mrc.bin" "$CONFIG_MRC_FILE" \
|
||||||
"mrc" "0xfffa0000"
|
"mrc" "0xfffa0000"
|
||||||
|
@ -324,8 +298,7 @@ patch_rom()
|
||||||
"$CONFIG_KBC1126_FW1" raw "$CONFIG_KBC1126_FW1_OFFSET" && inject \
|
"$CONFIG_KBC1126_FW1" raw "$CONFIG_KBC1126_FW1_OFFSET" && inject \
|
||||||
ecfw2.bin "$CONFIG_KBC1126_FW2" raw "$CONFIG_KBC1126_FW2_OFFSET"
|
ecfw2.bin "$CONFIG_KBC1126_FW2" raw "$CONFIG_KBC1126_FW2_OFFSET"
|
||||||
[ -n "$CONFIG_VGA_BIOS_FILE" ] && [ -n "$CONFIG_VGA_BIOS_ID" ] && \
|
[ -n "$CONFIG_VGA_BIOS_FILE" ] && [ -n "$CONFIG_VGA_BIOS_ID" ] && \
|
||||||
inject "pci$CONFIG_VGA_BIOS_ID.rom" \
|
inject "pci$CONFIG_VGA_BIOS_ID.rom" "$CONFIG_VGA_BIOS_FILE" optionrom
|
||||||
"$CONFIG_VGA_BIOS_FILE" "optionrom"
|
|
||||||
[ "$CONFIG_INCLUDE_SMSC_SCH5545_EC_FW" = "y" ] && \
|
[ "$CONFIG_INCLUDE_SMSC_SCH5545_EC_FW" = "y" ] && \
|
||||||
[ -n "$CONFIG_SMSC_SCH5545_EC_FW_FILE" ] && \
|
[ -n "$CONFIG_SMSC_SCH5545_EC_FW_FILE" ] && \
|
||||||
inject sch5545_ecfw.bin "$CONFIG_SMSC_SCH5545_EC_FW_FILE" raw
|
inject sch5545_ecfw.bin "$CONFIG_SMSC_SCH5545_EC_FW_FILE" raw
|
||||||
|
@ -359,7 +332,7 @@ inject()
|
||||||
[ "$_t" != "stage" ] || "$cbfstool" "$rom" add-stage -f \
|
[ "$_t" != "stage" ] || "$cbfstool" "$rom" add-stage -f \
|
||||||
"$_dest" -n "$cbfsname" -t stage -c lzma || $err "$rom: !add ref"
|
"$_dest" -n "$cbfsname" -t stage -c lzma || $err "$rom: !add ref"
|
||||||
[ "$_t" = "stage" ] || "$cbfstool" "$rom" add -f "$_dest" \
|
[ "$_t" = "stage" ] || "$cbfstool" "$rom" add -f "$_dest" \
|
||||||
-n "$cbfsname" -t $_t $_offset || $err "$rom !add $_t ($_dest)"
|
-n "$cbfsname" -t $_t $_offset || $err "$rom !add $_t ($_dest)"; :
|
||||||
}
|
}
|
||||||
|
|
||||||
modify_gbe()
|
modify_gbe()
|
||||||
|
|
58
script/trees
58
script/trees
|
@ -12,8 +12,7 @@ set -u -e
|
||||||
eval `setvars "" xarch srcdir premake cmakedir xlang mode makeargs elfdir cmd \
|
eval `setvars "" xarch srcdir premake cmakedir xlang mode makeargs elfdir cmd \
|
||||||
project target target_dir targets xtree _f release bootstrapargs mkhelper \
|
project target target_dir targets xtree _f release bootstrapargs mkhelper \
|
||||||
autoconfargs listfile autogenargs btype tree rev tree_depend build_depend \
|
autoconfargs listfile autogenargs btype tree rev tree_depend build_depend \
|
||||||
defconfig postmake mkhelpercfg dry dest_dir mdir`
|
defconfig postmake mkhelpercfg dry dest_dir mdir`; badhash="n"
|
||||||
badhash="n"
|
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
@ -38,7 +37,7 @@ main()
|
||||||
done
|
done
|
||||||
[ -z "$_f" ] && $err "missing flag (-m/-u/-b/-c/-x/-f/-s/-l/-n)"
|
[ -z "$_f" ] && $err "missing flag (-m/-u/-b/-c/-x/-f/-s/-l/-n)"
|
||||||
[ -z "$project" ] && for p in $(ls -1 config/git); do
|
[ -z "$project" ] && for p in $(ls -1 config/git); do
|
||||||
./update trees $_f "$p" || $err "!./update trees $_f $p"; :
|
./mk $_f "$p" || $err "!./mk $_f $p"; :
|
||||||
done && return 1
|
done && return 1
|
||||||
|
|
||||||
[ -f "config/git/$project/pkg.cfg" ] || $err "'$project' not defined"
|
[ -f "config/git/$project/pkg.cfg" ] || $err "'$project' not defined"
|
||||||
|
@ -53,9 +52,8 @@ main()
|
||||||
e "$mkhelpercfg" f missing && mkhelpercfg="$TMPDIR/mkhelper.cfg" && \
|
e "$mkhelpercfg" f missing && mkhelpercfg="$TMPDIR/mkhelper.cfg" && \
|
||||||
x_ touch "$mkhelpercfg"
|
x_ touch "$mkhelpercfg"
|
||||||
|
|
||||||
targets="$@"
|
targets="$@"; cmd="build_targets $targets"
|
||||||
cmd="build_targets $targets" && singletree "$project" && \
|
singletree "$project" && cmd="build_project"
|
||||||
cmd="build_project"
|
|
||||||
|
|
||||||
remkdir "${tmpgit%/*}"
|
remkdir "${tmpgit%/*}"
|
||||||
}
|
}
|
||||||
|
@ -95,8 +93,7 @@ handle_defconfig()
|
||||||
configure_project "$target_dir" || return 0
|
configure_project "$target_dir" || return 0
|
||||||
x_ mkdir -p "$elfdir/$target"
|
x_ mkdir -p "$elfdir/$target"
|
||||||
|
|
||||||
chkvars tree
|
chkvars tree; srcdir="src/$project/$tree"
|
||||||
srcdir="src/$project/$tree"
|
|
||||||
|
|
||||||
if [ "$mode" = "distclean" ] || [ "$mode" = "crossgcc-clean" ]; then
|
if [ "$mode" = "distclean" ] || [ "$mode" = "crossgcc-clean" ]; then
|
||||||
[ -d "$srcdir" ] || return 0
|
[ -d "$srcdir" ] || return 0
|
||||||
|
@ -117,17 +114,12 @@ configure_project()
|
||||||
{
|
{
|
||||||
eval `setvars "" xarch xlang build_depend autoconfargs xtree postmake \
|
eval `setvars "" xarch xlang build_depend autoconfargs xtree postmake \
|
||||||
tree_depend makeargs btype mkhelper bootstrapargs premake release`
|
tree_depend makeargs btype mkhelper bootstrapargs premake release`
|
||||||
badhash="n"
|
_tcfg="$1/target.cfg"; badhash="n"; [ -f "$_tcfg" ] || btype="auto"
|
||||||
|
|
||||||
[ -f "$1/target.cfg" ] || btype="auto"
|
|
||||||
[ -f "$datadir/mkhelper.cfg" ] && eval `setcfg "$datadir/mkhelper.cfg"`
|
[ -f "$datadir/mkhelper.cfg" ] && eval `setcfg "$datadir/mkhelper.cfg"`
|
||||||
|
|
||||||
_tcfg="$1/target.cfg"
|
|
||||||
while [ -f "$_tcfg" ] || [ "$cmd" != "build_project" ]; do
|
while [ -f "$_tcfg" ] || [ "$cmd" != "build_project" ]; do
|
||||||
eval `setvars "" rev tree`
|
eval `setvars "" rev tree`; eval `setcfg "$_tcfg"`
|
||||||
|
|
||||||
printf "Loading %s config: %s\n" "$project" "$_tcfg"
|
printf "Loading %s config: %s\n" "$project" "$_tcfg"
|
||||||
eval `setcfg "$_tcfg"`
|
|
||||||
|
|
||||||
[ "$_f" = "-d" ] && build_depend="" # dry run
|
[ "$_f" = "-d" ] && build_depend="" # dry run
|
||||||
[ "$cmd" = "build_project" ] && break
|
[ "$cmd" = "build_project" ] && break
|
||||||
|
@ -136,20 +128,16 @@ configure_project()
|
||||||
[ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ] \
|
[ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ] \
|
||||||
&& break; _tcfg="${_tcfg%/*/target.cfg}/$tree/target.cfg"
|
&& break; _tcfg="${_tcfg%/*/target.cfg}/$tree/target.cfg"
|
||||||
done
|
done
|
||||||
|
|
||||||
[ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && return 1
|
[ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && return 1
|
||||||
[ -z "$btype" ] || [ "${mode%config}" = "$mode" ] || return 1
|
[ -z "$btype" ] || [ "${mode%config}" = "$mode" ] || return 1
|
||||||
|
|
||||||
[ -z "$mode" ] && build_dependencies
|
[ -z "$mode" ] && build_dependencies
|
||||||
|
|
||||||
mdir="$PWD/config/submodule/$project"
|
mdir="$PWD/config/submodule/$project"
|
||||||
[ -n "$tree" ] && mdir="$mdir/$tree"
|
[ -n "$tree" ] && mdir="$mdir/$tree"
|
||||||
|
|
||||||
[ -f "CHANGELOG" ] || check_project_hashes
|
[ -f "CHANGELOG" ] || check_project_hashes
|
||||||
|
|
||||||
[ "$mode" = "fetch" ] || x_ ./update trees -f "$project" $target
|
[ "$mode" = "fetch" ] || x_ ./mk -f "$project" $target
|
||||||
[ "$mode" = "fetch" ] || return 0
|
[ "$mode" = "fetch" ] || return 0
|
||||||
|
|
||||||
[ -f "CHANGELOG" ] && return 1; fetch_${cmd#build_}; return 1
|
[ -f "CHANGELOG" ] && return 1; fetch_${cmd#build_}; return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +147,7 @@ build_dependencies()
|
||||||
bd_p="${bd%%/*}"; bd_t="${bd##*/}"
|
bd_p="${bd%%/*}"; bd_t="${bd##*/}"
|
||||||
[ -z "$bd_p" ] && $dry $err "$project/$tree: !bd '$bd'"
|
[ -z "$bd_p" ] && $dry $err "$project/$tree: !bd '$bd'"
|
||||||
[ "${bd##*/}" = "$bd" ] && bd_t=""
|
[ "${bd##*/}" = "$bd" ] && bd_t=""
|
||||||
[ -z "$bd_p" ] || $dry ./update trees -b $bd_p $bd_t \
|
[ -z "$bd_p" ] || $dry ./mk -b $bd_p $bd_t \
|
||||||
|| $err "!mk $project/$tree $bd_p/$bd_t"; continue
|
|| $err "!mk $project/$tree $bd_p/$bd_t"; continue
|
||||||
done; return 0
|
done; return 0
|
||||||
}
|
}
|
||||||
|
@ -167,28 +155,23 @@ build_dependencies()
|
||||||
check_project_hashes()
|
check_project_hashes()
|
||||||
{
|
{
|
||||||
mkdir -p "$XBMK_CACHE/hash" || $err "!mkdir '$XBMK_CACHE/hash'"
|
mkdir -p "$XBMK_CACHE/hash" || $err "!mkdir '$XBMK_CACHE/hash'"
|
||||||
|
old_pjhash=""; [ ! -f "$XBMK_CACHE/hash/$project$tree" ] || \
|
||||||
old_pjhash=""
|
|
||||||
[ ! -f "$XBMK_CACHE/hash/$project$tree" ] || \
|
|
||||||
read -r old_pjhash < "$XBMK_CACHE/hash/$project$tree"
|
read -r old_pjhash < "$XBMK_CACHE/hash/$project$tree"
|
||||||
|
|
||||||
x_ rm -f "$TMPDIR/project.list" "$TMPDIR/project.hash" \
|
x_ rm -f "$TMPDIR/project.list" "$TMPDIR/project.hash" \
|
||||||
"$TMPDIR/project.tmp"; x_ touch "$TMPDIR/project.tmp"
|
"$TMPDIR/project.tmp"; x_ touch "$TMPDIR/project.tmp"
|
||||||
x_ touch "$TMPDIR/project.hash"
|
x_ touch "$TMPDIR/project.hash"
|
||||||
|
|
||||||
for delcheck in "$datadir" "$configdir/$tree" "$mdir"; do
|
for rmchk in "$datadir" "$configdir/$tree" "$mdir"; do
|
||||||
[ -d "$delcheck" ] || continue
|
[ -d "$rmchk" ] || continue
|
||||||
find "$delcheck" -type f -not -path "*/.git*/*" \
|
find "$rmchk" -type f -not -path "*/.git*/*" >> \
|
||||||
>> "$TMPDIR/project.tmp" || \
|
"$TMPDIR/project.tmp" || $err "!find $rmchk > project.tmp"
|
||||||
$err "!find $delcheck > project.tmp"
|
done; sort "$TMPDIR/project.tmp" > "$TMPDIR/project.list" || \
|
||||||
done
|
|
||||||
sort "$TMPDIR/project.tmp" > "$TMPDIR/project.list" || \
|
|
||||||
$err "!sort project tmp/list"
|
$err "!sort project tmp/list"
|
||||||
|
|
||||||
while read -r delcheck; do
|
while read -r rmchk; do
|
||||||
[ -f "$delcheck" ] || continue
|
[ ! -f "$rmchk" ] || sha512sum "$rmchk" | awk \
|
||||||
sha512sum "$delcheck" | awk '{print $1}' >> \
|
'{print $1}' >> "$TMPDIR/project.hash" || $err "!h $rmchk"
|
||||||
"$TMPDIR/project.hash" || $err "!findhash $delcheck"
|
|
||||||
done < "$TMPDIR/project.list"
|
done < "$TMPDIR/project.list"
|
||||||
|
|
||||||
pjhash="$(sha512sum "$TMPDIR/project.hash" | awk '{print $1}')" || :
|
pjhash="$(sha512sum "$TMPDIR/project.hash" | awk '{print $1}')" || :
|
||||||
|
@ -200,7 +183,7 @@ check_project_hashes()
|
||||||
|
|
||||||
[ "$badhash" = "n" ] || rm -Rf "src/$project/$tree" \
|
[ "$badhash" = "n" ] || rm -Rf "src/$project/$tree" \
|
||||||
"elf/$project/$tree" "elf/$project/$target" || \
|
"elf/$project/$tree" "elf/$project/$target" || \
|
||||||
$err "!rmproject $project $tree"; :
|
$err "!rm $project $tree"; :
|
||||||
}
|
}
|
||||||
|
|
||||||
check_cross_compiler()
|
check_cross_compiler()
|
||||||
|
@ -211,7 +194,7 @@ check_cross_compiler()
|
||||||
[ "$project" != "coreboot" ] && cbdir="src/coreboot/default"
|
[ "$project" != "coreboot" ] && cbdir="src/coreboot/default"
|
||||||
[ -n "$xtree" ] && cbdir="src/coreboot/$xtree"
|
[ -n "$xtree" ] && cbdir="src/coreboot/$xtree"
|
||||||
|
|
||||||
x_ ./update trees -f coreboot ${cbdir#src/coreboot/}
|
x_ ./mk -f coreboot ${cbdir#src/coreboot/}
|
||||||
|
|
||||||
export PATH="$PWD/$cbdir/util/crossgcc/xgcc/bin:$PATH"
|
export PATH="$PWD/$cbdir/util/crossgcc/xgcc/bin:$PATH"
|
||||||
export CROSS_COMPILE="${xarch% *}-"
|
export CROSS_COMPILE="${xarch% *}-"
|
||||||
|
@ -261,7 +244,6 @@ handle_makefile()
|
||||||
run_make_command()
|
run_make_command()
|
||||||
{
|
{
|
||||||
[ -z "$premake" ] || [ -n "$mode" ] || $premake || $err "!$premake"
|
[ -z "$premake" ] || [ -n "$mode" ] || $premake || $err "!$premake"
|
||||||
|
|
||||||
$dry check_cmake "$srcdir" && [ -z "$mode" ] && $dry check_autoconf \
|
$dry check_cmake "$srcdir" && [ -z "$mode" ] && $dry check_autoconf \
|
||||||
"$srcdir"; $dry check_makefile "$srcdir" || return 1
|
"$srcdir"; $dry check_makefile "$srcdir" || return 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue