Skip to content

Commit

Permalink
0.9.1 fixed bug in ota_get_version routine
Browse files Browse the repository at this point in the history
  • Loading branch information
HomeACcessoryKid committed Dec 23, 2018
1 parent 84e640b commit 05c69a2
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
28 changes: 14 additions & 14 deletions deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ cd life-cycle-manager

#create/update the file versions/latest-pre-release but no new-line
```
echo -n 0.9.0 > versions/latest-pre-release
mkdir versions/0.9.0v
cp versions/certs.sector* versions/0.9.0v
echo -n 0.9.1 > versions/latest-pre-release
mkdir versions/0.9.1v
cp versions/certs.sector* versions/0.9.1v
```
#set local.mk to the ota-main program
```
make -j6 rebuild OTAVERSION=0.9.0
mv firmware/otamain.bin versions/0.9.0v
make -j6 rebuild OTAVERSION=0.9.1
mv firmware/otamain.bin versions/0.9.1v
```
#set local.mk back to ota-boot program
```
make -j6 rebuild OTAVERSION=0.9.0
mv firmware/otaboot.bin versions/0.9.0v
make -j6 rebuild OTAVERSION=0.9.0 OTABETA=1
cp firmware/otaboot.bin versions/0.9.0v/otabootbeta.bin
make -j6 rebuild OTAVERSION=0.9.1
mv firmware/otaboot.bin versions/0.9.1v
make -j6 rebuild OTAVERSION=0.9.1 OTABETA=1
cp firmware/otaboot.bin versions/0.9.1v/otabootbeta.bin
```

#remove the older versions files

#commit this as version 0.9.0
#set up a new github release 0.9.0 as a pre-release using the just commited master...
#commit this as version 0.9.1
#set up a new github release 0.9.1 as a pre-release using the just commited master...
#upload the certs and binaries to the pre-release assets on github

#erase the flash and upload the privatekey
Expand All @@ -41,15 +41,15 @@ esptool.py -p /dev/cu.usbserial-* --baud 230400 write_flash 0xf5000 privatekey.d
```
#upload the ota-boot BETA program to the device that contains the private key
```
make flash OTAVERSION=0.9.0 OTABETA=1
make flash OTAVERSION=0.9.1 OTABETA=1
```
#power cycle to prevent the bug for software reset after flash
#setup wifi and select the ota-demo repo without pre-release checkbox
#create the 3 signature files next to the bin file and upload to github one by one
#verify the hashes on the computer
```
openssl sha384 versions/0.9.0v/otamain.bin
xxd versions/0.9.0v/otamain.bin.sig
openssl sha384 versions/0.9.1v/otamain.bin
xxd versions/0.9.1v/otamain.bin.sig
```

#upload the file versions/latest-pre-release to the 'latest release' assets on github
Expand Down
8 changes: 6 additions & 2 deletions ota.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,6 @@ char* ota_get_version(char * repo) {
// if (retc) return retc;
// if (ret <= 0) return ret;

if (ota_boot() && ota_compare(version,OTAVERSION)<0) strcpy(version,OTAVERSION);

//find latest-pre-release if joined beta program
if ( (userbeta && strcmp(OTAREPO,repo)) || (otabeta && !strcmp(OTAREPO,repo)) ) {
prerelease[63]=0;
Expand All @@ -490,6 +488,12 @@ char* ota_get_version(char * repo) {
}
}

if (ota_boot() && ota_compare(version,OTAVERSION)<0) { //this acts when setting up a new version
free(version);
version=malloc(strlen(OTAVERSION)+1);
strcpy(version,OTAVERSION);
}

UDPLGP("%s@version:\"%s\"\n",repo,version);
return version;
}
Expand Down
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion versions/latest-pre-release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.0
0.9.1

0 comments on commit 05c69a2

Please sign in to comment.