esp8266: Allow building a board to any dest directory.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2021-12-23 17:09:05 +11:00
parent 8af9dbbde1
commit a29c70c9b4
2 changed files with 6 additions and 11 deletions

View File

@ -144,7 +144,7 @@ SECTIONS
*shared/timeutils/*.o*(.literal*, .text*)
*drivers/bus/*.o(.literal* .text*)
build-*/main.o(.literal* .text*)
*/main.o(.literal* .text*)
*fatfs_port.o(.literal* .text*)
*gccollect.o(.literal* .text*)
*gchelper.o(.literal* .text*)
@ -182,7 +182,7 @@ SECTIONS
*/frozen.o(.rodata.mp_frozen_content) /* frozen modules */
/* for -mforce-l32 */
build-*/*.o(.rodata*)
*/*.o(.rodata*)
_irom0_text_end = ABSOLUTE(.);
} >irom0_0_seg :irom0_0_phdr

View File

@ -13,9 +13,7 @@ function do_build() {
shift
shift
echo "building $descr $board"
#build_dir=/tmp/esp8266-build-$board
build_dir=build-$board # until esp8266.ld is fixed
rm -rf $build_dir # be sure we don't have anything leftover from a previous build
build_dir=/tmp/esp8266-build-$board
$MICROPY_AUTOBUILD_MAKE $@ BOARD=$board BUILD=$build_dir || exit 1
mv $build_dir/firmware-combined.bin $dest_dir/$descr$fw_tag.bin
mv $build_dir/firmware.elf $dest_dir/$descr$fw_tag.elf
@ -29,19 +27,16 @@ function do_build_ota() {
shift
shift
echo "building $descr $board"
#build_dir=/tmp/esp8266-build-$board
build_dir=build-$board # until esp8266.ld is fixed
rm -rf $build_dir # be sure we don't have anything leftover from a previous build
build_dir=/tmp/esp8266-build-$board
$MICROPY_AUTOBUILD_MAKE $@ BOARD=$board BUILD=$build_dir || exit 1
cat $yaota8266/yaota8266.bin $build_dir/firmware-ota.bin > $dest_dir/$descr$fw_tag.bin
cwd=$(pwd)
pushd $yaota8266/ota-client
$PYTHON3 ota_client.py sign $cwd/$build_dir/firmware-ota.bin
$PYTHON3 ota_client.py sign $build_dir/firmware-ota.bin
popd
mv $build_dir/firmware-ota.bin.ota $dest_dir/$descr$fw_tag.ota
mv $build_dir/firmware.elf $dest_dir/$descr$fw_tag.elf
mv $build_dir/firmware.map $dest_dir/$descr$fw_tag.map
#rm -rf $build_dir
rm -rf $build_dir
}
# check/get parameters