Commit a8021b5
Improve bootloader and partitions file detection in prepare-firmware.sh
Enhanced file discovery to handle various PlatformIO/ESP-IDF directory structures:
**Problem:** The script may fail to find bootloader.bin and partitions.bin if
they're in unexpected locations within the build directory.
**Improvements:**
1. **Enhanced file search function:**
- Checks multiple possible locations for each file
- Shows exactly which paths are being checked
- Reports which location succeeded
- Falls back to recursive search if standard locations fail
2. **Extended search paths:**
- bootloader.bin: 3 locations checked
- BUILD_DIR/bootloader.bin (ESP-IDF v3.x)
- BUILD_DIR/bootloader/bootloader.bin (ESP-IDF v4.x)
- BUILD_DIR/esp-idf/bootloader/bootloader.bin (some configs)
- partitions.bin: 2 locations checked
- BUILD_DIR/partitions.bin (standard)
- BUILD_DIR/partitions/partitions.bin (alternative)
3. **Better debugging output:**
- Shows search progress for each file
- If file not found in expected locations, performs recursive search
- Displays first 50 lines of build directory structure
- Clear indication of which files are found vs missing
4. **Improved error messages:**
- Lists all checked locations before failing
- Shows actual filesystem structure to aid diagnosis
- Provides actionable troubleshooting steps
- Helps identify if files are in unexpected locations
This ensures the script works across different PlatformIO and ESP-IDF
versions, and provides clear diagnostic information when files can't be found.
Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>1 parent c2c4afc commit a8021b5
1 file changed
Lines changed: 88 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
37 | | - | |
| 35 | + | |
| 36 | + | |
38 | 37 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
43 | 58 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
50 | 67 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
55 | 82 | | |
56 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
57 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
58 | 104 | | |
59 | 105 | | |
60 | | - | |
61 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
62 | 110 | | |
63 | 111 | | |
64 | | - | |
| 112 | + | |
| 113 | + | |
65 | 114 | | |
66 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
67 | 120 | | |
68 | 121 | | |
69 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
70 | 126 | | |
71 | 127 | | |
72 | 128 | | |
| |||
0 commit comments