From 29fe2c6a6922b5d16567234cb39c456f33a41416 Mon Sep 17 00:00:00 2001 From: Adrian Kennard Date: Mon, 14 Mar 2022 14:56:36 +0000 Subject: [PATCH] buuild suffix --- buildsuffix | 43 +++++++++++++++++++++++++++++++++++++++++++ setbuildsuffix | 28 ++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100755 buildsuffix create mode 100755 setbuildsuffix diff --git a/buildsuffix b/buildsuffix new file mode 100755 index 0000000..42a77c6 --- /dev/null +++ b/buildsuffix @@ -0,0 +1,43 @@ +#!/bin/csh -f + +setenv SDKCONFIG "sdkconfig" +if("$1" != "") setenv SDKCONFIG "$1" + +if(! -e "$SDKCONFIG") then + echo "Missing $SDKCONFIG" + exit 0 +endif + +# Match the code in revk.c for OTA suffix defaults + +# suffix1 +grep -q CONFIG_IDF_TARGET_ESP32=y "$SDKCONFIG" +if(! $status) echo -n "-S1" +grep -q CONFIG_IDF_TARGET_ESP32S2=y "$SDKCONFIG" +if(! $status) echo -n "-S2" +grep -q CONFIG_IDF_TARGET_ESP32S3=y "$SDKCONFIG" +if(! $status) echo -n "-S3" +grep -q CONFIG_IDF_TARGET_ESPC3=y "$SDKCONFIG" +if(! $status) echo -n "-C3" +grep -q CONFIG_IDF_TARGET_ESPH2=y "$SDKCONFIG" +if(! $status) echo -n "-H2" + +# suffix2 +grep -q CONFIG_FREERTOS_UNICORE=y "$SDKCONFIG" +if(! $status) echo -n "-SOLO" + +# suffix3 +grep -q CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y "$SDKCONFIG" +if(! $status) then +grep -q CONFIG_ESP32_SPIRAM_SUPPORT=y "$SDKCONFIG" +if(! $status) echo -n "-PICO" +endif + +# suffix4 +grep -q CONFIG_ESP32_REV_MIN_3=y "$SDKCONFIG" +if(! $status) echo -n "-V3" +grep -q CONFIG_ESP32_REV_MIN_2=y "$SDKCONFIG" +if(! $status) echo -n "-V2" +grep -q CONFIG_ESP32_REV_MIN_1=y "$SDKCONFIG" +if(! $status) echo -n "-V1" + diff --git a/setbuildsuffix b/setbuildsuffix new file mode 100755 index 0000000..ad3e5c2 --- /dev/null +++ b/setbuildsuffix @@ -0,0 +1,28 @@ +#!/bin/csh -f +if("$1" == "") then + echo "Specify suffix" + exit 1 +endif +setenv BUILDSUFFIX "$1" +shift +setenv SDKCONFIG "sdkconfig" +if("$1" != "") setenv SDKCONFIG "$1" + +if(! -e "$SDKCONFIG") then + echo "Missing $SDKCONFIG" + exit 0 +endif + +rm -f "$SDKCONFIG".new + +if("$BUILDSUFFIX" =~ *-PICO*) then + sed -e 's/# CONFIG_ESP32_SPIRAM_SUPPORT is not set/CONFIG_ESP32_SPIRAM_SUPPORT=y/' -e 's/# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set/CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y/' -e 's/CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y/# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set/' -e 's/CONFIG_FREERTOS_UNICORE=y/# CONFIG_FREERTOS_UNICORE is not set/' "$SDKCONFIG" > "$SDKCONFIG".new +else if("$BUILDSUFFIX" =~ *-SOLO*) then + sed -e 's/CONFIG_ESP32_SPIRAM_SUPPORT=y/# CONFIG_ESP32_SPIRAM_SUPPORT is not set/' -e 's/# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set/CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y/' -e 's/CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y/# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set/' -e 's/# CONFIG_FREERTOS_UNICORE is not set/CONFIG_FREERTOS_UNICORE=y/' "$SDKCONFIG" > "$SDKCONFIG".new +else + sed -e 's/CONFIG_ESP32_SPIRAM_SUPPORT=y/# CONFIG_ESP32_SPIRAM_SUPPORT is not set/' -e 's/# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set/CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y/' -e 's/CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y/# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set/' -e 's/CONFIG_FREERTOS_UNICORE=y/# CONFIG_FREERTOS_UNICORE is not set/' "$SDKCONFIG" > "$SDKCONFIG".new +endif + +mv -f "$SDKCONFIG".new "$SDKCONFIG" + +