bug fixes and symantic improvements
This commit is contained in:
@@ -64,7 +64,7 @@ echo -e "\nSetting alias"
|
||||
alias changeport="source $binDir/changeport.sh"
|
||||
alias changebaud="source $binDir/changebaud.sh"
|
||||
alias changeesp="source $binDir/changeesp.sh"
|
||||
alias exit_esp_tools="source $binDir/exit_idf.sh"
|
||||
alias exit-esp-tools="source $binDir/exit-idf.sh"
|
||||
alias monitor="idf.py monitor"
|
||||
alias flashmonitor="idf.py flash monitor"
|
||||
alias menuconfig="idf.py menuconfig"
|
||||
|
||||
@@ -6,8 +6,12 @@ subprocess() {
|
||||
return 0
|
||||
}
|
||||
|
||||
ret=''
|
||||
subprocess ret
|
||||
if [ ! -z "$1" ]; then
|
||||
ret="$1"
|
||||
else
|
||||
ret=''
|
||||
subprocess ret
|
||||
fi
|
||||
|
||||
export ESPTARGET="${ret}"
|
||||
|
||||
|
||||
+19
-5
@@ -1,8 +1,22 @@
|
||||
#!/bin/bash
|
||||
echo -e "\nflash_id\n"
|
||||
esptool.py flash_id
|
||||
echo -e "Getting ESP Chip Info...\n"
|
||||
# echo -e "Base MAC Address:"
|
||||
# esptool.py --port $ESPPORT --baud $ESPBAUD --chip auto read_mac
|
||||
echo -e "\nChip ID:"
|
||||
esptool.py --port $ESPPORT --baud $ESPBAUD --chip auto chip_id
|
||||
|
||||
echo -e "\nchip_id\n"
|
||||
esptool.py chip_id
|
||||
echo -e "\nFlash ID:"
|
||||
esptool.py --port $ESPPORT --baud $ESPBAUD --chip auto flash_id
|
||||
|
||||
echo -e "\nAll done :3\n"
|
||||
echo -e "\nFlash Status:"
|
||||
esptool.py --port $ESPPORT --baud $ESPBAUD --chip auto read_flash_status
|
||||
|
||||
echo -e "\nSecurity Info:"
|
||||
esptool.py --port $ESPPORT --baud $ESPBAUD --chip auto get_security_info
|
||||
|
||||
if [ -f "./CMakeLists.txt" ]; then
|
||||
echo -e "\nEfuse Table:"
|
||||
idf.py --port $ESPPORT --baud $ESPBAUD efuse-dump
|
||||
fi
|
||||
|
||||
echo -e "\nAll donsies~ :3\n"
|
||||
|
||||
+12
-22
@@ -1,22 +1,12 @@
|
||||
#!/bin/bash
|
||||
echo -e "Getting ESP Chip Info...\n"
|
||||
# echo -e "Base MAC Address:"
|
||||
# esptool.py --port $ESPPORT --baud $ESPBAUD --chip auto read_mac
|
||||
echo -e "\nChip ID:"
|
||||
esptool.py --port $ESPPORT --baud $ESPBAUD --chip auto chip_id
|
||||
|
||||
echo -e "\nFlash ID:"
|
||||
esptool.py --port $ESPPORT --baud $ESPBAUD --chip auto flash_id
|
||||
|
||||
echo -e "\nFlash Status:"
|
||||
esptool.py --port $ESPPORT --baud $ESPBAUD --chip auto read_flash_status
|
||||
|
||||
echo -e "\nSecurity Info:"
|
||||
esptool.py --port $ESPPORT --baud $ESPBAUD --chip auto get_security_info
|
||||
|
||||
if [ -f "./CMakeLists.txt" ]; then
|
||||
echo -e "\nEfuse Table:"
|
||||
idf.py --port $ESPPORT --baud $ESPBAUD efuse-dump
|
||||
fi
|
||||
|
||||
echo -e "\nAll donsies~ :3\n"
|
||||
echo "esp-idf install dir: $ESPIDF_INSTALLDIR"
|
||||
echo "esp-idf path: $IDF_PATH"
|
||||
echo "esp-idf version: $ESP_IDF_VERSION"
|
||||
echo "esp-idf python path: $IDF_PYTHON_ENV_PATH
|
||||
echo "openocd scripts: $OPENOCD_SCRIPTS"
|
||||
echo "esp-idf rom elf dir: $ESP_ROM_ELF_DIR"
|
||||
echo "esp-idf-deactivate file path $IDF_DEACTIVATE_FILE_PATH"
|
||||
echo "esp-idf tools install cmd: $IDF_TOOLS_INSTALL_CMD"
|
||||
echo "esp-idf-tools export cmd: $IDF_TOOLS_EXPORT_CMD"
|
||||
echo "port: $ESPPORT"
|
||||
echo "baud: $ESPBAUD"
|
||||
echo "target device $SPTARGET"
|
||||
@@ -7,7 +7,6 @@ unset ESP_ROM_ELF_DIR
|
||||
unset IDF_DEACTIVATE_FILE_PATH
|
||||
unset IDF_TOOLS_INSTALL_CMD
|
||||
unset IDF_TOOLS_EXPORT_CMD
|
||||
unset IDF_TOOLS_EXPORT_CMD
|
||||
unset ESPPORT
|
||||
unset ESPBAUD
|
||||
unset ESPTARGET
|
||||
+38
-13
@@ -263,10 +263,10 @@ function testAppendAlias() {
|
||||
}
|
||||
|
||||
function handleAliasEnviron() {
|
||||
testAppendAlias "get_esp_tools" "alias get_esp_tools='. $exportScript'"
|
||||
testAppendAlias "run_esp_cmd" "alias run_esp_cmd='git -C $runningDir pull;echo -e \"\nOld Version:\";tail -1 $versionData;echo -e \"\n\";bash $runningDir/esp-idf-tools-cmd.sh'"
|
||||
testAppendAlias "esp_install_monitor" "alias esp_install_monitor='tail -n 75 -f $log'"
|
||||
testAppendAlias "esp_install_logs" "alias esp_install_logs='less $versionData;less $log'"
|
||||
testAppendAlias "get-esp-tools" "alias get-esp-tools='. $exportScript'"
|
||||
testAppendAlias "run-esp-cmd" "alias run-esp-cmd='git -C $runningDir pull;echo -e \"\nOld Version:\";tail -1 $versionData;echo -e \"\n\";bash $runningDir/esp-idf-tools-cmd.sh'"
|
||||
testAppendAlias "esp-install-monitor" "alias esp-install-monitor='tail -n 75 -f $log'"
|
||||
testAppendAlias "esp-install-logs" "alias esp-install-logs='less $versionData;less $log'"
|
||||
|
||||
if [ -z $ESPIDF_INSTALLDIR ]; then
|
||||
writeToLog "ESPIDF_INSTALLDIR environment variable not found, appending to $rcFile"
|
||||
@@ -338,7 +338,14 @@ function handleDownloadInstall() {
|
||||
returnStatus
|
||||
gitHashChk=$?
|
||||
|
||||
gitDataLog="$(date '+%d/%m/%Y %H:%M:%S %Z (%s)') commit $commitHash branch $gitBranch version $scriptVers action $action"
|
||||
# if gitDataLog file doesnt exist, initialize with header
|
||||
if [[ ! -f "$gitDataLog" ]]; then
|
||||
writeToLog "$gitDataLog not found, initializing with header"
|
||||
echo "date | esp-idf branch | esp-idf-tools version | action" > "$gitDataLog";
|
||||
fi
|
||||
|
||||
# date | esp-idf branch | esp-idf-tools version | action
|
||||
gitDataLog="$(date '+%d/%m/%Y %H:%M:%S %Z (%s)') | $commitHash | $gitBranch | $scriptVers | $action"
|
||||
writeToLog "$gitDataLog"
|
||||
echo "$gitDataLog" >> $versionData
|
||||
returnStatus
|
||||
@@ -347,7 +354,7 @@ function handleDownloadInstall() {
|
||||
|
||||
handleReboot() {
|
||||
# writeToLog "Handling reboot: (function ran)\n"
|
||||
eval "sudo shutdown -r +$rebootMins"
|
||||
sudo shutdown -r +$rebootMins
|
||||
}
|
||||
|
||||
# warning not work how i make it work fuckin ell
|
||||
@@ -481,7 +488,6 @@ function handleClearInstallLog() {
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function handleEnd() {
|
||||
handleChk
|
||||
|
||||
@@ -591,7 +597,7 @@ elif [[ "$arg" == "interactive" || "$arg" == "i" ]]; then
|
||||
|
||||
elif [[ "$arg" == "cron" || "$arg" == "c" ]]; then # full install with warn, sleep, and reboot
|
||||
action="REINSTALL (CRON)"
|
||||
# sleepMins=3
|
||||
sleepMins=1
|
||||
idfGet="update"
|
||||
sleepMins=0
|
||||
|
||||
@@ -610,9 +616,8 @@ elif [[ "$arg" == "cron" || "$arg" == "c" ]]; then # full install with warn, sle
|
||||
|
||||
elif [[ "$arg" == "update" || "$arg" == "u" ]]; then # update without logouts or reboot
|
||||
action="UPDATE"
|
||||
# sleepMins=3
|
||||
idfGet="update"
|
||||
sleepMins=0
|
||||
sleepMins=1
|
||||
|
||||
handleStart
|
||||
handleClearInstallLog
|
||||
@@ -624,12 +629,12 @@ elif [[ "$arg" == "update" || "$arg" == "u" ]]; then # update without logouts or
|
||||
|
||||
exit
|
||||
|
||||
elif [[ "$arg" == "clearlogs" || "$arg" == "cl" || "$arg" == "clear" || "$arg" == "clean" ]]; then # clear logs
|
||||
elif [[ "$arg" == "clearlogs" || "$arg" == "cl" || "$arg" == "clear"]]; then
|
||||
handleEmptyLogs
|
||||
|
||||
exit
|
||||
|
||||
elif [[ "$arg" == "nuke" || "$arg" == "n" ]]; then # clear logs
|
||||
elif [[ "$arg" == "nuke" || "$arg" == "n" ]]; then
|
||||
action="REINSTALL (NUKE)"
|
||||
idfGet="download"
|
||||
|
||||
@@ -644,14 +649,34 @@ elif [[ "$arg" == "nuke" || "$arg" == "n" ]]; then # clear logs
|
||||
|
||||
exit
|
||||
|
||||
elif [ "$arg" == "uninstall" ]; then # clear logs
|
||||
elif [[ "$arg" == "nukereboot" || "$arg" == "nr" ]]; then
|
||||
action="REINSTALL (NUKEREBOOT)"
|
||||
sleepMins=1
|
||||
idfGet="download"
|
||||
|
||||
handleStart
|
||||
handleClearInstallLog
|
||||
handleSetupEnvironment
|
||||
handleCustomBins
|
||||
handleDownloadInstall
|
||||
handleExport
|
||||
handleAliasEnviron
|
||||
handleEnd
|
||||
handleReboot
|
||||
|
||||
exit
|
||||
|
||||
elif [ "$arg" == "uninstall" ]; then
|
||||
handleUninstall
|
||||
|
||||
echo -e "\nAll done :3\n"
|
||||
exit
|
||||
|
||||
elif [ ! -z $arg ]; then
|
||||
writeToLog "FAIL: bad argument. Terminating"
|
||||
|
||||
exit
|
||||
|
||||
else # full noninteractive (re)install without logout, reboot, or sleeps
|
||||
action="REINSTALL (DEFAULT)"
|
||||
|
||||
|
||||
@@ -1,75 +1,90 @@
|
||||
Modes:
|
||||
Some take optional [branch] paramater
|
||||
[branch] is the esp-idf branch you desire, defaults to master if not specified.
|
||||
|
||||
|
||||
default:
|
||||
reinstalls non-interactively with no delays, logouts, or reboots
|
||||
`run_esp_cmd`
|
||||
`run-esp-cmd`
|
||||
|
||||
test:
|
||||
tests the script. very fast. minimal actions taken. no reinstall is done
|
||||
`run_esp_cmd test`
|
||||
`run_esp_cmd t`
|
||||
`run-esp-cmd test [branch]`
|
||||
`run-esp-cmd t [branch]`
|
||||
|
||||
retool:
|
||||
reinstalls bins and export.sh, nothing else
|
||||
`run_esp_cmd retool`
|
||||
`run_esp_cmd rt`
|
||||
`run-esp-cmd retool`
|
||||
`run-esp-cmd rt`
|
||||
|
||||
cron:
|
||||
runs noninteractively with forced user logout and automatic reboot, plus delays
|
||||
`run_esp_cmd cron`
|
||||
`run_esp_cmd c`
|
||||
`run-esp-cmd cron [branch]`
|
||||
`run-esp-cmd c [branch]`
|
||||
|
||||
update:
|
||||
updates and installs latest without reboot or user logout
|
||||
`run_esp_cmd update`
|
||||
`run_esp_cmd u`
|
||||
`run-esp-cmd update [branch]`
|
||||
`run-esp-cmd u [branch]`
|
||||
|
||||
interactive:
|
||||
interactively installs/reinstalls esp-idf
|
||||
`run_esp_cmd interactive`
|
||||
`run_esp_cmd i`
|
||||
`run-esp-cmd interactive`
|
||||
`run-esp-cmd i`
|
||||
|
||||
nuke:
|
||||
full delete and re-download and install
|
||||
`run_esp_cmd nuke`
|
||||
`run_esp_cmd n`
|
||||
`run-esp-cmd nuke [branch]`
|
||||
`run-esp-cmd n [branch]`
|
||||
|
||||
nukereboot
|
||||
full delete and re-download and install, then reboot
|
||||
`run-esp-cmd nukereboot [branch]`
|
||||
`run-esp-cmd nr [branch]`
|
||||
|
||||
clearlogs:
|
||||
clear logs
|
||||
`run_esp_cmd clearlogs`
|
||||
`run_esp_cmd clear`
|
||||
`run_esp_cmd clean`
|
||||
`run_esp_cmd cl`
|
||||
`run-esp-cmd clearlogs`
|
||||
`run-esp-cmd clear`
|
||||
`run-esp-cmd cl`
|
||||
|
||||
help:
|
||||
display this help text
|
||||
`run_esp_cmd help`
|
||||
`run_esp_cmd h`
|
||||
`run_esp_cmd -h`
|
||||
`run_esp_cmd --help`
|
||||
`run-esp-cmd help`
|
||||
`run-esp-cmd h`
|
||||
`run-esp-cmd -h`
|
||||
`run-esp-cmd --help`
|
||||
`help-esp-tools`
|
||||
|
||||
uninstall:
|
||||
uninstall esp-idf
|
||||
`run_esp_cmd uninstall`
|
||||
`run-esp-cmd uninstall`
|
||||
|
||||
|
||||
Usage:
|
||||
Once installed for the first time, restart your shell.
|
||||
to activate esp-idf with the custom additions, run:
|
||||
`get_esp_tools`
|
||||
`get-esp-tools`
|
||||
exit with
|
||||
`exit_esp_tools`
|
||||
`exit-esp-tools`
|
||||
for help
|
||||
`help_esp_tools`
|
||||
`help-esp-tools`
|
||||
|
||||
|
||||
Features:
|
||||
`help-esp` show this help
|
||||
`get_idf` enter esp-idf
|
||||
`exit_idf` exit esp-idf and reset terminal
|
||||
`get-idf-tools` enter esp-idf
|
||||
`help-esp-tools` show this help
|
||||
`exit-esp-tools` exit esp-idf and reset terminal
|
||||
`build` idf.py build
|
||||
`changebaud` prompts to enter a new baud
|
||||
`changeesp` prompts to type in esp32s3, esp32c6, etc
|
||||
`changeport` opens a menu to select a serial port
|
||||
`changeesp` change esp device
|
||||
`changeesp` alone prompts to enter
|
||||
`changeesp <esp device>` manually changes to <esp device>
|
||||
ex. `changeesp esp32p4`
|
||||
`changeport` change serial port
|
||||
`changeport` alone prompts to select
|
||||
`changeport <tty device path>` manually specifies path
|
||||
ex. `changeport /dev/ttyUSB0` changes to /dev/ttyUSB0
|
||||
`clean` idf.py clean
|
||||
`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`
|
||||
@@ -83,32 +98,15 @@ Features:
|
||||
`chipinfo` get information from the esp chip
|
||||
`espinfo` get detailed information from the esp chip
|
||||
`menuconfig` run `idf.py menuconfig`
|
||||
`create-project <project name>` same as idf.py create-project <proejct name>
|
||||
ex. `create-project hello-world`
|
||||
`esp-install-monitor` monitors install.log. alias for `tail -n 75 -f $ESPIDF_INSTALLDIR/install.log`
|
||||
`esp-install-logs` displays full text of install.log and version-data.txt
|
||||
|
||||
|
||||
Aliases:
|
||||
run_esp_cmd
|
||||
Updates the esp-install-custom code via git, displays the script version, then executes esp-idf-tools-cmd.sh with optional arument.
|
||||
Takes identical arguments to running esp-idf-tools-cmd.sh manually
|
||||
run_esp_cmd
|
||||
run_esp_cmd clean
|
||||
run_esp_cmd nuke [branch]
|
||||
run_esp_cmd retool [branch]
|
||||
run_esp_cmd cron [branch]
|
||||
run_esp_cmd update [branch]
|
||||
run_esp_cmd interactive
|
||||
run_esp_cmd test
|
||||
run_esp_cmd uninstall
|
||||
Second optional argument specifies branch (requires two arguments!):
|
||||
`run_esp_cmd nuke v5.4.1`
|
||||
|
||||
esp_install_monitor
|
||||
monitors install.log
|
||||
alias for tail -n 75 -f $ESPIDF_INSTALLDIR/install.log
|
||||
no arguments
|
||||
|
||||
esp_install_logs
|
||||
displays full text of install.log and version-data.txt
|
||||
no arguments
|
||||
|
||||
Helpful Stuff:
|
||||
cron:
|
||||
@@ -116,9 +114,3 @@ Helpful Stuff:
|
||||
`crontab -e`
|
||||
add below to bottom of file:
|
||||
0 4 * * * bash $HOME/esp/esp-install-custom/esp-idf-tools-cmd.sh cron
|
||||
|
||||
monitor log file during install:
|
||||
`tail -n 75 $ESPIDF_INSTALLDIR/install.log;`
|
||||
|
||||
view both logs from beginning:
|
||||
`less $ESPIDF_INSTALLDIR/install.log; less $ESPIDF_INSTALLDIR/version-data.txt`
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
8-rc-5
|
||||
9-rc-2
|
||||
|
||||
Reference in New Issue
Block a user