[riot-notifications] [RIOT-OS/RIOT] cpu/esp32: Use awk/printf instead of echo -n when flashing esp32 (#12282)

Francisco notifications at github.com
Tue Sep 24 15:24:00 CEST 2019


fjmolinas commented on this pull request.



> @@ -167,11 +167,10 @@ PREFLASHER = $(ESPTOOL)
 PREFFLAGS  = --chip esp32 elf2image
 PREFFLAGS += -fm $(FLASH_MODE) -fs $(FLASH_SIZE) -ff $(FLASH_FREQ)
 PREFFLAGS += -o $(FLASHFILE).bin $(FLASHFILE);
-PREFFLAGS += echo "" > $(BINDIR)/partitions.csv;
-PREFFLAGS += echo "nvs, data, nvs, 0x9000, 0x6000" >> $(BINDIR)/partitions.csv;
-PREFFLAGS += echo "phy_init, data, phy, 0xf000, 0x1000" >> $(BINDIR)/partitions.csv;
-PREFFLAGS += echo -n "factory, app, factory, 0x10000, " >> $(BINDIR)/partitions.csv;
-PREFFLAGS += ls -l $(FLASHFILE).bin | awk '{ print $$5 }' >> $(BINDIR)/partitions.csv;
+PREFFLAGS += printf "\n" > $(BINDIR)/partitions.csv;
+PREFFLAGS += printf "nvs, data, nvs, 0x9000, 0x6000\n" >> $(BINDIR)/partitions.csv;
+PREFFLAGS += printf "phy_init, data, phy, 0xf000, 0x1000\n" >> $(BINDIR)/partitions.csv;
+PREFFLAGS += ls -l $(FLASHFILE).bin | awk '{ print "factory, app, factory, 0x10000, " $$5 }' >> $(BINDIR)/partitions.csv;

Also taking @cladmi comment into account I think we should keep the separation of concerns as before, where `awk` was only used to `cut` the size and not generate the whole output. @LordTy if you agree squash directly and we can trigger the build.
 
```suggestion
PREFFLAGS += printf "factory, app, factory, 0x10000, " >> $(BINDIR)/partitions.csv;
PREFFLAGS += ls -l $(FLASHFILE).bin | awk '{ print $$5 }' >> $(BINDIR)/partitions.csv;

```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12282#pullrequestreview-292405907
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190924/41d91bc4/attachment-0001.htm>


More information about the notifications mailing list