summaryrefslogtreecommitdiff
path: root/script/vendor
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-10-29 01:22:21 +0000
committerLeah Rowe <leah@libreboot.org>2023-10-29 04:46:25 +0000
commit7e6fd7e5b4a87063e962e57ba73a85c28aaeb932 (patch)
tree691aefbb8134b5f147f290c32ced7c9d59089836 /script/vendor
parent93458de74a2e403bdd7e7a25d6fdead41d8fa718 (diff)
add lenovo x201 support
note: me6_update_parser needs to be written, similar to me7_update_parser, to generate the partition tables within intel me6 on lenovo bios updates. the current logic in lbmk goes like this: mkdir -p vendorfiles/cache/ and save your factory dump as: vendorfiles/cache/x201_factory.rom the build system has been modified, in such a way as to support extracting me.bin (which is the full one) and then neutering from this. this is done automatically, if the file is present, but you must first insert that file there, which means you'll need a dump of the original boot flash on your thinkpad x201 Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/vendor')
-rwxr-xr-xscript/vendor/download26
1 files changed, 21 insertions, 5 deletions
diff --git a/script/vendor/download b/script/vendor/download
index 40244fff..12231b39 100755
--- a/script/vendor/download
+++ b/script/vendor/download
@@ -22,7 +22,8 @@ uefiextract="${PWD}/src/uefitool/uefiextract"
eval "$(setvars "" _b _dl EC_url EC_url_bkup EC_hash DL_hash DL_url DL_url_bkup \
E6400_VGA_DL_hash E6400_VGA_DL_url E6400_VGA_DL_url_bkup E6400_VGA_offset \
- E6400_VGA_romname SCH5545EC_DL_url SCH5545EC_DL_url_bkup SCH5545EC_DL_hash)"
+ E6400_VGA_romname SCH5545EC_DL_url SCH5545EC_DL_url_bkup SCH5545EC_DL_hash \
+ is_rom)"
main()
{
@@ -97,11 +98,18 @@ fetch()
[ "${5#/}" = "${5}" ] || err "fetch: absolute path not allowed: '${5}'"
_dest="${5##*../}"
_dl="${vendir}/cache/${dlsum}"
+ dl_fail=""
x_ mkdir -p "${_dl%/*}"
- dl_fail="y"
- vendor_checksum "${dlsum}" "${_dl}" && dl_fail="n"
+ is_rom="n"
+ if [ "${dl}" = "rom" ] || [ "${dl_bkup}" = "rom" ]; then
+ dl_fail="n"
+ is_rom="y"
+ else
+ dl_fail="y"
+ vendor_checksum "${dlsum}" "${_dl}" && dl_fail="n"
+ fi
for url in "${dl}" "${dl_bkup}"; do
[ "${dl_fail}" = "n" ] && break
[ -z "${url}" ] && continue
@@ -137,8 +145,14 @@ mkdirs()
mkdir -p "${1%/*}" || err "mkdirs: !mkdir -p ${1%/*}"
x_ rm -Rf "${appdir}"
x_ mkdir -p "${appdir}/"
- extract_archive "${_dl}" "${appdir}" || \
- [ "${2}" = "extract_e6400vga" ] || err "mkdirs ${1} ${2}: !extract"
+ if [ "${is_rom}" = "y" ]; then
+ cp "${_dl}" "${appdir}" || \
+ err "mkdirs copyrom ${_dl}: can't copy to appdir"
+ else
+ extract_archive "${_dl}" "${appdir}" || \
+ [ "${2}" = "extract_e6400vga" ] || \
+ err "mkdirs ${1} ${2}: !extract"
+ fi
}
extract_intel_me()
@@ -152,6 +166,7 @@ extract_intel_me()
sdir="$(mktemp -d)"
mkdir -p "${sdir}" || err "extract_intel_me: !mkdir -p \"${sdir}\""
(
+ [ "${cdir#/a}" != "${cdir}" ] && cdir="${cdir#/}"
cd "${cdir}" || err "extract_intel_me: !cd \"${cdir}\""
for i in *; do
[ -f "${_me}" ] && break
@@ -170,6 +185,7 @@ extract_intel_me()
continue
fi
cdir="${1}"
+ [ "${cdir#/a}" != "${cdir}" ] && cdir="${cdir#/}"
cd "${cdir}"
done
)