Provide fastboot binaries within the fastboot flash package
Could you please consider distributing fastboot binaries together with the fastboot flash package?
This would be beneficial for users, which do not have fastboot in their system's path as well as prevent issues with the binaries being too old or not compatible with the current device.
If you are building the dist target, you can find fastboot binaries already in out/dist and you would just need to copy them into your packaging folder, which should be trivial :)
Example of binaries copied over with our fastboot packaging bash script.
_OUT_DIR_DEFAULT=$(build/soong/soong_ui.bash --dumpvar-mode OUT_DIR)
if [ -z "${_OUT_DIR_DEFAULT}" ]; then
_OUT_DIR_DEFAULT="./out"
fi
DIST_FOLDER=${2:-${_OUT_DIR_DEFAULT}/dist}
OUT_DIR=${3:-${_OUT_DIR_DEFAULT}/fastboot}
fastboot_binaries=(
"adb"
"adb.exe"
"e2fsdroid"
"fastboot"
"fastboot.exe"
"make_f2fs"
"make_f2fs_casefold"
"mkbootfs"
"mke2fs"
"sload_f2fs"
)
# Copy fastboot binaries to out dir
for binary in "${fastboot_binaries[@]}"; do
cp -v "${DIST_FOLDER}/$binary" "${OUT_DIR}/"
done
Example of our directory structure after packaging with our own script.
0 ✓ amartinz SHIFT6MQ.SOS.5.0.G.20231005-RELEASE-FASTBOOT $> tree
.
├── abl.img
├── adb
├── adb.exe
├── aop.img
├── bluetooth.img
├── boot-debug.img
├── boot.img
├── boot-test-harness.img
├── cmnlib64.img
├── cmnlib.img
├── devcfg.img
├── devinfo.bin
├── dsp.img
├── dtbo.img
├── e2fsdroid
├── fastboot
├── fastboot.exe
├── fastboot_flash.sh
├── hyp.img
├── ImageFv.img
├── keymaster.img
├── make_f2fs
├── make_f2fs_casefold
├── mkbootfs
├── mke2fs
├── modem.img
├── product.img
├── product.map
├── qupfw.img
├── recovery.img
├── sload_f2fs
├── storsec.img
├── super_empty.img
├── system_ext.img
├── system_ext.map
├── system.img
├── system.map
├── tz.img
├── userdata_ats_automation.img
├── vbmeta.img
├── vbmeta_system.img
├── vbmeta_vendor.img
├── vendor.img
├── vendor.map
├── xbl_config.img
└── xbl.img
1 directory, 46 files
Edited by Alexander Martinz