summaryrefslogtreecommitdiff
path: root/resources/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'resources/scripts')
-rwxr-xr-xresources/scripts/build/boot/roms_helper35
-rw-r--r--resources/scripts/build/dependencies/arch2
-rwxr-xr-xresources/scripts/build/dependencies/debian2
-rwxr-xr-xresources/scripts/build/dependencies/fedora382
-rwxr-xr-xresources/scripts/build/dependencies/parabola2
-rwxr-xr-xresources/scripts/build/dependencies/ubuntu20042
-rwxr-xr-xresources/scripts/build/dependencies/void2
-rwxr-xr-xresources/scripts/update/blobs/download65
-rwxr-xr-xresources/scripts/update/blobs/inject21
9 files changed, 89 insertions, 44 deletions
diff --git a/resources/scripts/build/boot/roms_helper b/resources/scripts/build/boot/roms_helper
index 21110e59..32a6e537 100755
--- a/resources/scripts/build/boot/roms_helper
+++ b/resources/scripts/build/boot/roms_helper
@@ -40,16 +40,16 @@ payloads=""
keyboard_layouts=""
while [ $# -gt 0 ]; do
case ${1} in
- -d)
+ -d)
displaymodes="${displaymodes}${2}"
shift ;;
- -p)
+ -p)
payloads="${payloads}${2}"
shift ;;
- -k)
+ -k)
keyboard_layouts="${keyboard_layouts}${2}"
shift ;;
- *)
+ *)
board=${1} ;;
esac
shift
@@ -84,6 +84,8 @@ seabios_opromloadonly="0"
payload_memtest="n"
payload_uboot="n"
uboot_config="undefined"
+# ditto option whether to compile ada in crossgcc:
+crossgcc_ada="y" # yes by default
# Override the above defaults using board.cfg
. "resources/coreboot/${board}/board.cfg"
@@ -170,7 +172,13 @@ if [ "${blobs_required}" != "n" ] \
blobs_required="y"
fi
+# ada support needed for libgfxinit submodule
+if [ "${crossgcc_ada}" != "y" ] && [ "${crossgcc_ada}" != "n" ]; then
+ crossgcc_ada="y"
+fi
+
# Override all payload directives with cmdline args
+# (do not override crossgcc_ada)
if [ ! -z ${payloads} ]; then
echo "setting payloads $payloads"
payload_grub="n"
@@ -203,6 +211,9 @@ fi
cat version > "${cbdir}/.coreboot-version"
+if [ "${crossgcc_ada}" = "n" ]; then
+ export BUILD_LANGUAGES=c
+fi
if [ "${arch}" = "x86_32" ] || [ "${arch}" = "x86_64" ]; then
if [ ! -d "${cbdir}/util/crossgcc/xgcc/i386-elf/" ]; then
# Even for 64-bit machines, coreboot builds 32-bit ROM
@@ -334,6 +345,19 @@ moverom() {
cp ${rompath} ${newrompath}
fi
+ # pike2008 cards cause a system hang when loading option roms in seabios
+ # if there is an empty option rom in cbfs, no option rom will be loaded
+ if [ "${cuttype}" = "d8d16sas" ]; then
+ emptyrom=$(mktemp -t coreboot_rom.XXXXXXXXXX)
+ rm -f "${emptyrom}"
+ touch "${emptyrom}"
+ for deviceID in "0072" "3050"; do
+ "${cbfstool}" "${newrompath}" add -f "${emptyrom}" \
+ -n pci1000,${deviceID}.rom -t raw
+ done
+ rm -f "${emptyrom}"
+ fi
+
for romsize in 4 8 16; do
ifdgbe="descriptors/ich9m/ich9fdgbe_${romsize}m.bin"
if [ "${cuttype}" = "${romsize}MiB ICH9 IFD NOR flash" ]; then
@@ -390,8 +414,7 @@ mkCoreboot() {
printf "Skipping build.\n"
return 0
fi
- printf "%s-%s\n" "$(cat projectname)" "$(cat version)" \
- > "${cbdir}/.coreboot-version"
+ cat version > "${cbdir}/.coreboot-version"
(
if [ -f "${cbfstool}" ]; then
mv "${cbfstool}" "${cbdir}/cbfstool"
diff --git a/resources/scripts/build/dependencies/arch b/resources/scripts/build/dependencies/arch
index c20a1faf..407915e1 100644
--- a/resources/scripts/build/dependencies/arch
+++ b/resources/scripts/build/dependencies/arch
@@ -92,7 +92,7 @@ pacman -S --needed --noconfirm libpciaccess pciutils zlib libftdi \
# Management engine extraction dependencies
# ------------------------------------------------------------
-pacman -S --needed --noconfirm innoextract p7zip
+pacman -S --needed --noconfirm innoextract p7zip unar
# U-Boot build dependencies
# ------------------------------------------------------------
diff --git a/resources/scripts/build/dependencies/debian b/resources/scripts/build/dependencies/debian
index fb0ae248..b9ab42e6 100755
--- a/resources/scripts/build/dependencies/debian
+++ b/resources/scripts/build/dependencies/debian
@@ -131,4 +131,4 @@ apt-get -y install libpci-dev pciutils zlib1g-dev libftdi-dev \
# Blobs building dependencies (for me)
# ------------------------------------------------------------
-apt-get -y install innoextract p7zip p7zip-full
+apt-get -y install innoextract p7zip p7zip-full unar
diff --git a/resources/scripts/build/dependencies/fedora38 b/resources/scripts/build/dependencies/fedora38
index 2389b806..0f852f44 100755
--- a/resources/scripts/build/dependencies/fedora38
+++ b/resources/scripts/build/dependencies/fedora38
@@ -95,4 +95,4 @@ dnf -y install pciutils-devel zlib-devel libftdi-devel gcc libusb-devel
# For extracting IntelME from lenovo updates (X230 etc)
-dnf -y install innoextract p7zip p7zip-plugins
+dnf -y install innoextract p7zip p7zip-plugins unar
diff --git a/resources/scripts/build/dependencies/parabola b/resources/scripts/build/dependencies/parabola
index da284bed..4e40b175 100755
--- a/resources/scripts/build/dependencies/parabola
+++ b/resources/scripts/build/dependencies/parabola
@@ -95,7 +95,7 @@ pacman -S --needed --noconfirm libpciaccess pciutils zlib \
#
# ------------------------------------------------------------
-pacman -S --needed --noconfirm innoextract p7zip
+pacman -S --needed --noconfirm innoextract p7zip unar
# U-Boot build dependencies
# ------------------------------------------------------------
diff --git a/resources/scripts/build/dependencies/ubuntu2004 b/resources/scripts/build/dependencies/ubuntu2004
index 14a1d8c2..bacb1e46 100755
--- a/resources/scripts/build/dependencies/ubuntu2004
+++ b/resources/scripts/build/dependencies/ubuntu2004
@@ -113,4 +113,4 @@ apt-get -y install libpci-dev pciutils zlib1g-dev libftdi-dev \
# Blobs building dependencies (for me)
# ------------------------------------------------------------
-apt-get -y install innoextract p7zip p7zip-full
+apt-get -y install innoextract p7zip p7zip-full unar
diff --git a/resources/scripts/build/dependencies/void b/resources/scripts/build/dependencies/void
index e46cd5ee..7ceaafde 100755
--- a/resources/scripts/build/dependencies/void
+++ b/resources/scripts/build/dependencies/void
@@ -88,4 +88,4 @@ xbps-install -y libpciaccess pciutils zlib libftdi1 base-devel libusb
# Management engine extraction dependencies
# ------------------------------------------------------------
-xbps-install -y innoextract p7zip
+xbps-install -y innoextract p7zip unar
diff --git a/resources/scripts/update/blobs/download b/resources/scripts/update/blobs/download
index 0896ed47..2368e8e9 100755
--- a/resources/scripts/update/blobs/download
+++ b/resources/scripts/update/blobs/download
@@ -5,6 +5,8 @@
# SPDX-FileCopyrightText: 2023 Leah Rowe <info@minifree.org>
# SPDX-License-Identifier: GPL-3.0-only
+agent="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
+
ec_url=""
ec_url_bkup=""
ec_hash=""
@@ -106,14 +108,14 @@ scan_sources_config()
while read -r line ; do
case ${line} in
- EC_url*)
- set ${line}
- ec_url=${2}
- ;;
EC_url_bkup*)
set ${line}
ec_url_bkup=${2}
;;
+ EC_url*)
+ set ${line}
+ ec_url=${2}
+ ;;
EC_hash*)
set ${line}
ec_hash=${2}
@@ -122,26 +124,26 @@ scan_sources_config()
set ${line}
dl_hash=${2}
;;
- DL_url*)
- set ${line}
- dl_url=${2}
- ;;
DL_url_bkup*)
set ${line}
dl_url_bkup=${2}
;;
- E6400_VGA_DL_hash*)
+ DL_url*)
set ${line}
- e6400_vga_dl_hash=${2}
+ dl_url=${2}
;;
- E6400_VGA_DL_url*)
+ E6400_VGA_DL_hash*)
set ${line}
- e6400_vga_dl_url=${2}
+ e6400_vga_dl_hash=${2}
;;
E6400_VGA_DL_url_bkup*)
set ${line}
e6400_vga_dl_url_bkup=${2}
;;
+ E6400_VGA_DL_url*)
+ set ${line}
+ e6400_vga_dl_url=${2}
+ ;;
E6400_VGA_offset*)
set ${line}
e6400_vga_offset=${2}
@@ -235,8 +237,9 @@ extract_blob_intel_me()
printf "Extracting and stripping Intel ME firmware\n"
- innoextract ${dl_path} -d ${blobdir} \
+ innoextract ${dl_path} -d ${appdir} \
|| 7z x ${dl_path} -o${appdir} \
+ || unar "${dl_path}" -o "${appdir}" \
|| fail 'Could not extract vendor update'
bruteforce_extract_blob_intel_me "$(pwd)/${_me_destination}" \
@@ -278,19 +281,21 @@ bruteforce_extract_blob_intel_me()
"${me7updateparser}" -O ${_me_destination} "${i}" \
&& break # (we found me.bin)
_7ztest="${_7ztest}a"
- 7z x "${i}" -o${_7ztest} || continue
+ 7z x "${i}" -o${_7ztest} \
+ || innoextract "${i}" -d "${_7ztest}" \
+ || unar "${i}" -o "${_7ztest}" \
+ || continue
bruteforce_extract_blob_intel_me "${_me_destination}" \
"${cdir}/${_7ztest}"
- cdir="${1}"
- cd "${cdir}"
elif [ -d "$i" ]; then
bruteforce_extract_blob_intel_me "${_me_destination}" \
"${cdir}/${i}"
- cdir="${1}"
- cd "${cdir}"
else
printf "SKIPPING: %s\n" "${i}"
+ continue
fi
+ cdir="${1}"
+ cd "${cdir}"
done
)
@@ -337,6 +342,11 @@ extract_ec()
unar -D ROM.CAB Rom.bin
mv Rom.bin ec.bin
fi
+ if [ ! -f ec.bin ]; then
+ printf "could not extract ec.bin for board '%s'" ${board} \
+ 1>&2
+ fail "aborting the build. please audit blobutil carefully."
+ fi
"${kbc1126_ec_dump}" ec.bin
)
@@ -442,11 +452,20 @@ fetch_update()
dl_path=${blobdir}/cache/${dlsum}
mkdir -p ${blobdir}/cache
- vendor_checksum ${dlsum} || \
- wget ${dl} -O ${dl_path} || wget ${dl_bkup} -O ${dl_path}
-
- vendor_checksum ${dlsum} || fail \
- "Cannot guarantee intergity of vendor update for: ${board}"
+ dl_fail="y"
+ vendor_checksum ${dlsum} && dl_fail="n"
+ for x in "${dl}" "${dl_bkup}"; do
+ if [ "${dl_fail}" = "n" ]; then
+ break
+ fi
+ rm -f "${dl_path}"
+ wget -U "${agent}" ${x} -O ${dl_path}
+ vendor_checksum ${dlsum} && dl_fail="n"
+ done
+ if [ "${dl_fail}" = "y" ]; then
+ printf "Could not download blob file\n" 1>&2
+ return 1
+ fi
}
vendor_checksum()
diff --git a/resources/scripts/update/blobs/inject b/resources/scripts/update/blobs/inject
index 891cb198..bc8a9a4d 100755
--- a/resources/scripts/update/blobs/inject
+++ b/resources/scripts/update/blobs/inject
@@ -50,15 +50,18 @@ main()
while getopts r:b:m: option
do
- case "${option}"
- in
- r)rom=${OPTARG};;
- b)board=${OPTARG};;
+ case "${option}" in
+ r)
+ rom=${OPTARG}
+ ;;
+ b)
+ board=${OPTARG}
+ ;;
m)
modifygbe=true
new_mac=${OPTARG}
;;
- esac
+ esac
done
check_board
@@ -111,17 +114,17 @@ detect_board()
path=${1}
filename=$(basename ${path})
case ${filename} in
- grub_*)
+ grub_*)
board=$(echo "${filename}" | cut -d '_' -f2-3)
;;
- seabios_withgrub_*)
+ seabios_withgrub_*)
board=$(echo "${filename}" | cut -d '_' -f3-4)
;;
- *.tar.xz)
+ *.tar.xz)
_stripped_prefix=${filename#*_}
board="${_stripped_prefix%.tar.xz}"
;;
- *)
+ *)
return 1
esac