Skip to content

Commit

Permalink
sunfish: Add firmware extraction support
Browse files Browse the repository at this point in the history
Change-Id: If6cb6334a8f7b2fcc77c8947569eba1b2002190a
  • Loading branch information
mikeNG committed Dec 5, 2023
1 parent d3c68f3 commit 42554af
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
12 changes: 11 additions & 1 deletion extract-files.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2021 The LineageOS Project
# Copyright (C) 2017-2023 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
Expand Down Expand Up @@ -62,11 +62,21 @@ function blob_fixup() {
esac
}

function prepare_firmware() {
if [ "${SRC}" != "adb" ]; then
bash "${ANDROID_ROOT}"/lineage/scripts/pixel/prepare-firmware.sh "${DEVICE}" "${SRC}"
fi
}

# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"

extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
extract "${MY_DIR}/proprietary-files-carriersettings.txt" "${SRC}" "${KANG}" --section "${SECTION}"
extract "${MY_DIR}/proprietary-files-vendor.txt" "${SRC}" "${KANG}" --section "${SECTION}"

if [ -z "${SECTION}" ]; then
extract_firmware "${MY_DIR}/proprietary-firmware.txt" "${SRC}"
fi

"${MY_DIR}/setup-makefiles.sh"
13 changes: 13 additions & 0 deletions proprietary-firmware.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# All firmware images are extracted from Google factory images for each new ASB

abl.img;AB
aop.img;AB
devcfg.img;AB
hyp.img;AB
keymaster.img;AB
modem.img;AB
qupfw.img;AB
tz.img;AB
uefisecapp.img;AB
xbl.img;AB
xbl_config.img;AB
4 changes: 3 additions & 1 deletion setup-makefiles.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2021 The LineageOS Project
# Copyright (C) 2017-2023 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
Expand Down Expand Up @@ -34,5 +34,7 @@ write_makefiles "${MY_DIR}/proprietary-files.txt" true
write_makefiles "${MY_DIR}/proprietary-files-carriersettings.txt" true
write_makefiles "${MY_DIR}/proprietary-files-vendor.txt" true

append_firmware_calls_to_makefiles "${MY_DIR}/proprietary-firmware.txt"

# Finish
write_footers

0 comments on commit 42554af

Please sign in to comment.