|
10 | 10 | parser.add_argument('-s', '--build', type=str, help='Buildnummer der GithubAction (Unique ID)') |
11 | 11 | parser.add_argument('-t', '--stage', type=str, help='Stage (Branch name)') |
12 | 12 | parser.add_argument('-bp', '--binarypath', type=str, help='Path of binary files') |
| 13 | +parser.add_argument('-fn', '--firmwarename', type=str, help='Name of the firmware') |
13 | 14 | parser.add_argument('-rp', '--releasepath', type=str, default="release", help='Path of destination, BIN and JSON files') |
14 | 15 | parser.add_argument('-rf', '--releasefile', type=str, help='Path of release file, contains version number') |
15 | 16 | parser.add_argument('-a', '--arch', type=str, help='Architecture (ESP8266|ESP32|ESP32-S2|ESP32-C3|...)') |
|
26 | 27 | logging.info(f"BUILDNUMMER={args.build}") |
27 | 28 | logging.info(f"STAGE={args.stage}") |
28 | 29 | logging.info(f"BINARYPATH={args.binarypath}") |
| 30 | + logging.info(f"FIRMWARENAME={args.firmwarename}") |
29 | 31 | logging.info(f"RELEASEPATH={args.releasepath}") |
30 | 32 | logging.info(f"RELEASEFILE={args.releasefile}") |
31 | 33 | logging.info(f"ARCHITECTURE={args.arch}") |
|
57 | 59 | for file in files: |
58 | 60 | if file == 'firmware.bin': |
59 | 61 | FILENAME = os.path.splitext(file)[0] |
60 | | - FILEEXT = os.path.splitext(file)[1][1:] |
61 | | - FIRMWARENAME = args.binarypath.split(os.sep)[-2] # get the name of the firmware folder |
62 | | - |
| 62 | + FILEEXT = os.path.splitext(file)[1][1:] |
63 | 63 | DOWNLOADURL = f"https://tobiasfaust.github.io/{args.repository}/firmware/{FILENAME}.{FileExtension}.{FILEEXT}" |
64 | 64 |
|
65 | 65 | ################ Create custom json ################## |
|
98 | 98 |
|
99 | 99 | if os.path.isfile(os.path.join(args.binarypath, "merged-firmware.bin")): |
100 | 100 | manifest_data["parts"].append({ |
101 | | - "path": f"https://tobiasfaust.github.io/{args.repository}/firmware/{SubDir}/{FIRMWARENAME}/merged-firmware.{FileExtension}.bin", |
| 101 | + "path": f"https://tobiasfaust.github.io/{args.repository}/firmware/{SubDir}/{args.firmwarename}/merged-firmware.{FileExtension}.bin", |
102 | 102 | "offset": 0 |
103 | 103 | }) |
104 | 104 | else: |
105 | 105 | # fuer ESP8266 |
106 | 106 | manifest_data["parts"].append({ |
107 | | - "path": f"https://tobiasfaust.github.io/{args.repository}/firmware/{SubDir}/{FIRMWARENAME}/{FILENAME}.{FileExtension}.{FILEEXT}", |
| 107 | + "path": f"https://tobiasfaust.github.io/{args.repository}/firmware/{SubDir}/{args.firmwarename}/{FILENAME}.{FileExtension}.{FILEEXT}", |
108 | 108 | "offset": 0 |
109 | 109 | }) |
110 | 110 |
|
111 | 111 | # process files.json |
112 | 112 | if os.path.isfile(os.path.join(args.binarypath, "bootloader.bin")): |
113 | 113 | files_data["parts"].append({ |
114 | | - "path": f"https://tobiasfaust.github.io/{args.repository}/firmware/{SubDir}/{FIRMWARENAME}/bootloader.{FileExtension}.bin", |
| 114 | + "path": f"https://tobiasfaust.github.io/{args.repository}/firmware/{SubDir}/{args.firmwarename}/bootloader.{FileExtension}.bin", |
115 | 115 | "offset": 4096, |
116 | 116 | "filetype": "bootloader" |
117 | 117 | }) |
118 | 118 | if os.path.isfile(os.path.join(args.binarypath, "partitions.bin")): |
119 | 119 | files_data["parts"].append({ |
120 | | - "path": f"https://tobiasfaust.github.io/{args.repository}/firmware/{SubDir}/{FIRMWARENAME}/partitions.{FileExtension}.bin", |
| 120 | + "path": f"https://tobiasfaust.github.io/{args.repository}/firmware/{SubDir}/{args.firmwarename}/partitions.{FileExtension}.bin", |
121 | 121 | "offset": 32768, |
122 | 122 | "filetype": "partitions" |
123 | 123 | }) |
124 | 124 | if os.path.isfile(os.path.join(args.binarypath, "littlefs.bin")): |
125 | 125 | files_data["parts"].append({ |
126 | | - "path": f"https://tobiasfaust.github.io/{args.repository}/firmware/{SubDir}/{FIRMWARENAME}/littlefs.{FileExtension}.bin", |
| 126 | + "path": f"https://tobiasfaust.github.io/{args.repository}/firmware/{SubDir}/{args.firmwarename}/littlefs.{FileExtension}.bin", |
127 | 127 | "offset": int(readOffsetFromPartitionCSV("partitions.csv", "webdata"), 16), |
128 | 128 | "filetype": "filesystem" |
129 | 129 | }) |
130 | 130 |
|
131 | 131 |
|
132 | 132 | OFFSET = 0 if "ESP8266" in args.arch else int(readOffsetFromPartitionCSV("partitions.csv", "app0"), 16) |
133 | 133 | files_data["parts"].append({ |
134 | | - "path": f"https://tobiasfaust.github.io/{args.repository}/firmware/{SubDir}/{FIRMWARENAME}/{FILENAME}.{FileExtension}.{FILEEXT}", |
| 134 | + "path": f"https://tobiasfaust.github.io/{args.repository}/firmware/{SubDir}/{args.firmwarename}/{FILENAME}.{FileExtension}.{FILEEXT}", |
135 | 135 | "offset": OFFSET, |
136 | 136 | "filetype": "firmware" |
137 | 137 | }) |
|
0 commit comments