60-beta.0
This commit is contained in:
@@ -3,11 +3,13 @@ installs/reinstalls full esp-idf with my own additions on linux.
|
|||||||
pulls from master so its the very latest
|
pulls from master so its the very latest
|
||||||
|
|
||||||
built for debian-like systems
|
built for debian-like systems
|
||||||
|
only currently tested on zsh
|
||||||
|
|
||||||
|
## Quick start
|
||||||
`git clone https://github.com/PrincessPi3/esp-install-custom.git ~`
|
`git clone https://github.com/PrincessPi3/esp-install-custom.git ~`
|
||||||
`bash ~/reinstall-esp-idf.sh`
|
`bash ~/reinstall-esp-idf.sh`
|
||||||
|
|
||||||
scripts added:
|
## Features
|
||||||
`build` idf.py build
|
`build` idf.py build
|
||||||
`changebaud` prompts to enter a new baud
|
`changebaud` prompts to enter a new baud
|
||||||
`changeesp` prompts to type in esp32s3, esp32c6, etc
|
`changeesp` prompts to type in esp32s3, esp32c6, etc
|
||||||
@@ -15,8 +17,52 @@ scripts added:
|
|||||||
`clean` idf.py clean
|
`clean` idf.py clean
|
||||||
`fullclean` fully resets a project, 'idf.py fullclean' plus remove the build dir and delete some temp and backup files
|
`fullclean` fully resets a project, 'idf.py fullclean' plus remove the build dir and delete some temp and backup files
|
||||||
`rebuildfull` does a `fullclean` but also an `erase-flash` and also `setup`
|
`rebuildfull` does a `fullclean` but also an `erase-flash` and also `setup`
|
||||||
`setup` same as running 'idf.py set-target $ESPTARGET; idf.py menuconfig; idf.py build'
|
`setup` same as running `idf.py set-target $ESPTARGET; idf.py menuconfig; idf.py build`
|
||||||
`flash` idf.py flash
|
`flash` idf.py flash
|
||||||
`monitor` idf.py monitor
|
`monitor` idf.py monitor
|
||||||
`erase-flash` idf.py erase-flash
|
`erase-flash` idf.py erase-flash
|
||||||
`save-defconfig` idf.py save-defconfig
|
`save-defconfig` idf.py save-defconfig
|
||||||
|
`step-flash-monitor` attempt clean, build, flash, then monitor, dying on error
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```
|
||||||
|
Modes:
|
||||||
|
default:
|
||||||
|
reinstalls non-interactively with no delays, logouts, or reboots
|
||||||
|
bash cron-reinstall-esp-idf.sh
|
||||||
|
|
||||||
|
test:
|
||||||
|
tests the script. very fast. minimal actions taken. no reinstall is done
|
||||||
|
bash cron-reinstall-esp-idf.sh test
|
||||||
|
|
||||||
|
retool:
|
||||||
|
reinstalls bins and export.sh, nothing else
|
||||||
|
bash cron-reinstall-esp-idf.sh retool
|
||||||
|
|
||||||
|
cron:
|
||||||
|
runs noninteractively with forced user logout and automatic reboot, plus delays
|
||||||
|
bash cron-reinstall-esp-idf.sh cron
|
||||||
|
|
||||||
|
interactive:
|
||||||
|
interactively installs/reinstalls esp-idf
|
||||||
|
bash cron-reinstall-esp-idf.sh interactive
|
||||||
|
|
||||||
|
help:
|
||||||
|
display this help text
|
||||||
|
bash cron-reinstall-esp-idf.sh help
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Helpful stuff
|
||||||
|
```
|
||||||
|
cron:
|
||||||
|
reinstall from master everyday at 8pm, logging out users with warn delays and rebooting after
|
||||||
|
crontab -e
|
||||||
|
0 8 * * * bash $HOME/esp/esp-install-custom/cron-reinstall-esp-idf.sh cron
|
||||||
|
|
||||||
|
manually wipe logs:
|
||||||
|
rm $ESPIDF_INSTALLDIR/install.log; rm $ESPIDF_INSTALLDIR/version-data.txt; touch $ESPIDF_INSTALLDIR/install.log; touch $ESPIDF_INSTALLDIR/version-data.txt;
|
||||||
|
|
||||||
|
monitor log file during install:
|
||||||
|
tail -n 75 $ESPIDF_INSTALLDIR/install.log;
|
||||||
|
```
|
||||||
+12
-36
@@ -1,42 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# set -e # for testan, die on error
|
# set -e # for testan, die on eelrror
|
||||||
startTime=$(date '+%s')
|
startTime=$(date '+%s') # to time the (re)install time for the logs
|
||||||
|
|
||||||
# modes:
|
|
||||||
# default:
|
|
||||||
# reinstalls non-interactively with no delays, logouts, or reboots
|
|
||||||
# bash cron-reinstall-esp-idf.sh
|
|
||||||
#
|
|
||||||
# test:
|
|
||||||
# tests the script. very fast. minimal actions taken. no reinstall is done
|
|
||||||
# bash cron-reinstall-esp-idf.sh test
|
|
||||||
#
|
|
||||||
# retool:
|
|
||||||
# reinstalls bins and export.sh, nothing else
|
|
||||||
# bash cron-reinstall-esp-idf.sh retool
|
|
||||||
#
|
|
||||||
# cron:
|
|
||||||
# runs noninteractively with forced user logout and automatic reboot, plus delays
|
|
||||||
# bash cron-reinstall-esp-idf.sh cron
|
|
||||||
#
|
|
||||||
# interactive:
|
|
||||||
# interactively installs/reinstalls esp-idf
|
|
||||||
# bash cron-reinstall-esp-idf.sh interactive
|
|
||||||
# cron:
|
|
||||||
# crontab -e
|
|
||||||
# 0 8 * * * bash $HOME/esp/esp-install-custom/cron-reinstall-esp-idf.sh cron
|
|
||||||
# manually wipe logs:
|
|
||||||
# rm $ESPIDF_INSTALLDIR/install.log; rm $ESPIDF_INSTALLDIR/version-data.txt; touch $ESPIDF_INSTALLDIR/install.log; touch $ESPIDF_INSTALLDIR/version-data.txt;
|
|
||||||
#
|
|
||||||
# monitor log file during install
|
|
||||||
# tail -n 75 $ESPIDF_INSTALLDIR/install.log;
|
|
||||||
|
|
||||||
myUser=princesspi # user installing esp-ids
|
myUser=princesspi # user installing esp-ids
|
||||||
gitJobs=5 # number of jobs to download from github with
|
gitJobs=5 # number of jobs to download from github with
|
||||||
gitBranch=master # branch from github
|
gitBranch=master # branch from github
|
||||||
rcFile=$HOME/.zshrc # shell rc file
|
rcFile=$HOME/.zshrc # shell rc file
|
||||||
|
|
||||||
if [ -z ESPIDF_INSTALLDIR ]; then
|
if [ -z $ESPIDF_INSTALLDIR ]; then
|
||||||
installDir=$HOME/esp
|
installDir=$HOME/esp
|
||||||
else
|
else
|
||||||
installDir=$ESPIDF_INSTALLDIR
|
installDir=$ESPIDF_INSTALLDIR
|
||||||
@@ -48,6 +19,7 @@ versionData=$installDir/version-data.txt # version data log file
|
|||||||
idfDir=$installDir/esp-idf # esp-idf path
|
idfDir=$installDir/esp-idf # esp-idf path
|
||||||
espressifLocation=$HOME/.espressif # espressif tools install location
|
espressifLocation=$HOME/.espressif # espressif tools install location
|
||||||
customBinLocation=$installDir/.custom_bin # where custom bin scripts are placed
|
customBinLocation=$installDir/.custom_bin # where custom bin scripts are placed
|
||||||
|
helpText=$runningDir/help.txt
|
||||||
runningDir="$( cd "$( dirname "$0" )" && pwd )"
|
runningDir="$( cd "$( dirname "$0" )" && pwd )"
|
||||||
customBinFrom=$runningDir/custom_bin # dir where custom scripts are coming FROM
|
customBinFrom=$runningDir/custom_bin # dir where custom scripts are coming FROM
|
||||||
scriptVers=$(cat $runningDir/version.txt) # make sure version.txt does NOT have newline
|
scriptVers=$(cat $runningDir/version.txt) # make sure version.txt does NOT have newline
|
||||||
@@ -236,10 +208,9 @@ function handleStart() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
writeToLog "\n === $(date '+%d/%m/%Y %H:%M:%S %Z (%s)'): new ${action} ==="
|
writeToLog "\n === $(date '+%d/%m/%Y %H:%M:%S %Z (%s)'): new ${action} ==="
|
||||||
writeToLog "Version: ${scriptVers}"
|
writeToLog "\tVersion: ${scriptVers}\n"
|
||||||
|
|
||||||
returnStatus
|
writeToLog "$(date '+%d/%m/%Y %H:%M:%S %Z (%s)')\nvars:\n\tmyUser: $myUser\n\tscriptVers: $scriptVers\n\tversionData: $versionData\n\tlog: $log\n\tsleepMins: $sleepMins\n\tinstallDir: $installDir\n\tgitJobs: $gitJobs\n\tgitBranch: $gitBranch\n\tgitCmd: $gitCmd\n\trunningDir: $runningDir\n\tidfDir: $idfDir\n\tespressifLocation: $espressifLocation\n\tcustomBinLocation: $customBinLocation\n\tcustomBinFrom: $customBinFrom\n\tinstallCmd: $installCmd\n\ttoolsInstallCmd: $toolsInstallCmd\n\trcFile: $rcFile\n\t(envvar) ESPIDF_INSTALLDIR: $installdirEnvvar"
|
||||||
writeToLog "\n$(date '+%d/%m/%Y %H:%M:%S %Z (%s)')\nvars:\n\tmyUser: $myUser\n\tscriptVers: $scriptVers\n\tversionData: $versionData\n\tlog: $log\n\tsleepMins: $sleepMins\n\tinstallDir: $installDir\n\tgitJobs: $gitJobs\n\tgitBranch: $gitBranch\n\tgitCmd: $gitCmd\n\trunningDir: $runningDir\n\tidfDir: $idfDir\n\tespressifLocation: $espressifLocation\n\tcustomBinLocation: $customBinLocation\n\tcustomBinFrom: $customBinFrom\n\tinstallCmd: $installCmd\n\ttoolsInstallCmd: $toolsInstallCmd\n\trcFile: $rcFile\n\t(envvar) ESPIDF_INSTALLDIR: $installdirEnvvar"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +234,12 @@ function handleEnd() {
|
|||||||
writeToLog " === $(date '+%d/%m/%Y %H:%M:%S %Z (%s)'): finished ===\n\n"
|
writeToLog " === $(date '+%d/%m/%Y %H:%M:%S %Z (%s)'): finished ===\n\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$arg" == "test" ]; then # minimal actions taken, echo the given commands and such
|
if [ "$arg" == "--help" || "$arg" == "help" || "$arg" == "-h" || "$arg" == "h" ]; then
|
||||||
|
cat $helpText;
|
||||||
|
|
||||||
|
exit
|
||||||
|
|
||||||
|
elif [ "$arg" == "test" ]; then # minimal actions taken, echo the given commands and such
|
||||||
action="TEST"
|
action="TEST"
|
||||||
|
|
||||||
gitCmd="echo git clone --jobs $gitJobs --branch $gitBranch --single-branch https://github.com/espressif/esp-idf $idfDir"
|
gitCmd="echo git clone --jobs $gitJobs --branch $gitBranch --single-branch https://github.com/espressif/esp-idf $idfDir"
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
Modes:
|
||||||
|
default:
|
||||||
|
reinstalls non-interactively with no delays, logouts, or reboots
|
||||||
|
bash cron-reinstall-esp-idf.sh
|
||||||
|
|
||||||
|
test:
|
||||||
|
tests the script. very fast. minimal actions taken. no reinstall is done
|
||||||
|
bash cron-reinstall-esp-idf.sh test
|
||||||
|
|
||||||
|
retool:
|
||||||
|
reinstalls bins and export.sh, nothing else
|
||||||
|
bash cron-reinstall-esp-idf.sh retool
|
||||||
|
|
||||||
|
cron:
|
||||||
|
runs noninteractively with forced user logout and automatic reboot, plus delays
|
||||||
|
bash cron-reinstall-esp-idf.sh cron
|
||||||
|
|
||||||
|
interactive:
|
||||||
|
interactively installs/reinstalls esp-idf
|
||||||
|
bash cron-reinstall-esp-idf.sh interactive
|
||||||
|
|
||||||
|
help:
|
||||||
|
display this help text
|
||||||
|
bash cron-reinstall-esp-idf.sh help
|
||||||
|
|
||||||
|
|
||||||
|
Helpful Stuff:
|
||||||
|
cron:
|
||||||
|
reinstall from master everyday at 8pm, logging out users with warn delays and rebooting after
|
||||||
|
crontab -e
|
||||||
|
0 8 * * * bash $HOME/esp/esp-install-custom/cron-reinstall-esp-idf.sh cron
|
||||||
|
|
||||||
|
manually wipe logs:
|
||||||
|
rm $ESPIDF_INSTALLDIR/install.log; rm $ESPIDF_INSTALLDIR/version-data.txt; touch $ESPIDF_INSTALLDIR/install.log; touch $ESPIDF_INSTALLDIR/version-data.txt;
|
||||||
|
|
||||||
|
monitor log file during install:
|
||||||
|
tail -n 75 $ESPIDF_INSTALLDIR/install.log;
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
60-dev.12
|
60-beta.0
|
||||||
Reference in New Issue
Block a user