mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-16 03:25:25 +02:00
minor code cleanup in shell scripts
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+1
-2
@@ -4,8 +4,7 @@
|
||||
|
||||
# This file is only used by update/project/trees
|
||||
|
||||
eval "$(setvars "" _target rev _xm)"
|
||||
eval "$(setvars "" loc url bkup_url depend)"
|
||||
eval "$(setvars "" _target rev _xm loc url bkup_url depend)"
|
||||
tmp_git_dir="${PWD}/tmp/gitclone"
|
||||
|
||||
fetch_project_trees()
|
||||
|
||||
+11
-15
@@ -4,7 +4,7 @@
|
||||
# Modifications in this version are Copyright 2021 and 2023 Leah Rowe.
|
||||
# Original copyright detailed in repo: https://review.coreboot.org/coreboot/
|
||||
|
||||
eval "$(setvars "" MRC_url MRC_url_bkup MRC_hash MRC_board)"
|
||||
eval "$(setvars "" MRC_url MRC_url_bkup MRC_hash MRC_board ROOTFS SHELLBALL)"
|
||||
|
||||
extract_mrc()
|
||||
{
|
||||
@@ -12,14 +12,14 @@ extract_mrc()
|
||||
[ -z "${CONFIG_MRC_FILE}" ] && \
|
||||
err "extract_mrc $MRC_hash: CONFIG_MRC_FILE not set"
|
||||
|
||||
_file="${MRC_url##*/}"
|
||||
_file="${_file%.zip}"
|
||||
ROOTFS="root-a.ext2"
|
||||
SHELLBALL="chromeos-firmwareupdate-${MRC_board}"
|
||||
|
||||
(
|
||||
x_ cd "${appdir}"
|
||||
extract_partition ROOT-A "${_file}" root-a.ext2
|
||||
extract_shellball root-a.ext2 chromeos-firmwareupdate-${MRC_board}
|
||||
extract_coreboot chromeos-firmwareupdate-${MRC_board}
|
||||
extract_partition
|
||||
extract_shellball
|
||||
extract_coreboot
|
||||
)
|
||||
|
||||
x_ "${cbfstool}" "${appdir}/"coreboot-*.bin extract -n mrc.bin \
|
||||
@@ -28,9 +28,9 @@ extract_mrc()
|
||||
|
||||
extract_partition()
|
||||
{
|
||||
NAME=${1}
|
||||
FILE=${2}
|
||||
ROOTFS=${3}
|
||||
NAME="ROOT-A"
|
||||
FILE="${MRC_url##*/}"
|
||||
FILE="${FILE%.zip}"
|
||||
_bs=1024
|
||||
|
||||
printf "Extracting ROOT-A partition\n"
|
||||
@@ -46,9 +46,6 @@ extract_partition()
|
||||
|
||||
extract_shellball()
|
||||
{
|
||||
ROOTFS=${1}
|
||||
SHELLBALL=${2}
|
||||
|
||||
printf "Extracting chromeos-firmwareupdate\n"
|
||||
printf "cd /usr/sbin\ndump chromeos-firmwareupdate ${SHELLBALL}\nquit" \
|
||||
| debugfs "${ROOTFS}" || err "extract_shellball: debugfs"
|
||||
@@ -56,13 +53,12 @@ extract_shellball()
|
||||
|
||||
extract_coreboot()
|
||||
{
|
||||
_shellball=${1}
|
||||
_unpacked=$( mktemp -d )
|
||||
|
||||
printf "Extracting coreboot image\n"
|
||||
[ -f "${_shellball}" ] || \
|
||||
[ -f "${SHELLBALL}" ] || \
|
||||
err "extract_coreboot: shellball missing in google cros image"
|
||||
x_ sh "${_shellball}" --unpack "${_unpacked}"
|
||||
x_ sh "${SHELLBALL}" --unpack "${_unpacked}"
|
||||
|
||||
# TODO: audit the f* out of that shellball, for each mrc version.
|
||||
# it has to be updated for each mrc update. we should ideally
|
||||
|
||||
+2
-2
@@ -17,11 +17,11 @@ eval "$(setvars "" CONFIG_BOARD_DELL_E6400 CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN \
|
||||
CONFIG_INCLUDE_SMSC_SCH5545_EC_FW CONFIG_SMSC_SCH5545_EC_FW_FILE \
|
||||
CONFIG_IFD_BIN_PATH CONFIG_MRC_FILE _dest board boarddir)"
|
||||
|
||||
listitems()
|
||||
items()
|
||||
{
|
||||
rval=1
|
||||
[ ! -d "${1}" ] && \
|
||||
printf "listitems: directory '%s' doesn't exist" "${1}" && \
|
||||
printf "items: directory '%s' doesn't exist" "${1}" && \
|
||||
return 1
|
||||
for x in "${1}/"*; do
|
||||
# -e used because this is for files *or* directories
|
||||
|
||||
Reference in New Issue
Block a user