1
1
# Thingino Firmware
2
2
# https://github.com/themactep/thingino-firmware
3
3
4
- BUILDROOT_VERSION := git
5
-
6
4
# Camera IP address
7
5
CAMERA_IP_ADDRESS ?= 192.168.1.10
8
6
@@ -25,16 +23,12 @@ OUTPUT_DIR ?= $(HOME)/output/$(BOARD)
25
23
STDOUT_LOG ?= $(OUTPUT_DIR ) /compilation.log
26
24
STDERR_LOG ?= $(OUTPUT_DIR ) /compilation-errors.log
27
25
28
- BUILDROOT_BUNDLE := $(SRC_DIR ) /buildroot-$(BUILDROOT_VERSION ) .tar.gz
29
- BUILDROOT_REPO := https://github.com/themactep/buildroot.git
30
- BUILDROOT_DIR := $(SRC_DIR ) /buildroot-$(BUILDROOT_VERSION ) -themactep
31
-
32
26
# project directories
33
27
BR2_EXTERNAL := $(CURDIR )
34
28
SCRIPTS_DIR := $(CURDIR ) /scripts
35
29
36
30
# make command for buildroot
37
- BR2_MAKE = $(MAKE ) -C $(BUILDROOT_DIR ) BR2_EXTERNAL=$(BR2_EXTERNAL ) O=$(OUTPUT_DIR )
31
+ BR2_MAKE = $(MAKE ) -C $(BR2_EXTERNAL ) /buildroot BR2_EXTERNAL=$(BR2_EXTERNAL ) O=$(OUTPUT_DIR )
38
32
39
33
BOARDS = $(shell find ./configs/* _defconfig | grep -v "\(_generic\|toolchain_\) " | sort | sed -E "s/^\.\/configs\/(.*)_defconfig/'\1' '\1'/")
40
34
@@ -174,9 +168,9 @@ ROOTFS_OFFSET = $(shell echo $$(($(KERNEL_OFFSET) + $(KERNEL_SIZE_ALIGNED) )))
174
168
FIRMWARE_BIN_FULL_SIZE = $(shell stat -c% s $(FIRMWARE_BIN_FULL ) )
175
169
FIRMWARE_BIN_NOBOOT_SIZE = $(shell stat -c% s $(FIRMWARE_BIN_NOBOOT ) )
176
170
177
- .PHONY : all toolchain sdk bootstrap clean defconfig distclean help info pack pack_full pack_update pad pad_full pad_update update_buildroot upload_tftp upload_sdcard upgrade_ota br-%
171
+ .PHONY : all toolchain sdk bootstrap clean defconfig distclean help info pack pack_full pack_update pad pad_full pad_update upload_tftp upload_sdcard upgrade_ota br-%
178
172
179
- all : update_buildroot defconfig
173
+ all : defconfig
180
174
ifndef BOARD
181
175
$(MAKE) BOARD=$(BOARD) $@
182
176
endif
@@ -208,7 +202,7 @@ endif
208
202
clean : defconfig
209
203
@rm -rf $(OUTPUT_DIR ) /target $(OUTPUT_DIR ) /.config
210
204
211
- defconfig : $( BUILDROOT_DIR )
205
+ defconfig :
212
206
@rm -rvf $(OUTPUT_DIR ) /.config
213
207
$(BR2_MAKE ) BR2_DEFCONFIG=$(BOARD_CONFIG ) defconfig
214
208
@@ -260,7 +254,7 @@ rebuild-%:
260
254
$(BR2_MAKE ) $(subst rebuild-,,$@ ) -dirclean
261
255
$(BR2_MAKE ) $(subst rebuild-,,$@ )
262
256
263
- sdk : update_buildroot defconfig
257
+ sdk : defconfig
264
258
ifeq ($(GCC ) ,12)
265
259
sed -i 's/^BR2_TOOLCHAIN_EXTERNAL_GCC_13=y/# BR2_TOOLCHAIN_EXTERNAL_GCC_13 is not set/' $(OUTPUT_DIR)/.config; \
266
260
sed -i 's/^# BR2_TOOLCHAIN_EXTERNAL_GCC_12 is not set/BR2_TOOLCHAIN_EXTERNAL_GCC_12=y/' $(OUTPUT_DIR)/.config; \
@@ -269,11 +263,6 @@ ifeq ($(GCC),12)
269
263
endif
270
264
$(BR2_MAKE) sdk
271
265
272
- update_buildroot : $(SRC_DIR )
273
- @if [ ! -d " $( SRC_DIR) " ]; then mkdir -p " $( SRC_DIR) " ; fi
274
- @if [ ! -d " $( BUILDROOT_DIR) " ]; then git clone --depth 1 $(BUILDROOT_REPO ) $(BUILDROOT_DIR ) ; fi
275
- @cd $(BUILDROOT_DIR ) && git pull && echo " Buildroot updated"
276
-
277
266
update_ota : pack_update
278
267
scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -O $(FIRMWARE_BIN_NOBOOT ) root@$(CAMERA_IP_ADDRESS ) :/tmp/fwupdate.bin
279
268
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@$(CAMERA_IP_ADDRESS ) " flashcp -v /tmp/fwupdate.bin /dev/mtd5 && reboot"
@@ -301,18 +290,6 @@ $(OUTPUT_DIR):
301
290
$(SRC_DIR ) :
302
291
mkdir -p $(SRC_DIR )
303
292
304
- # download Buildroot bundle
305
- $(BUILDROOT_BUNDLE ) :
306
- $(WGET ) -O $@ https://github.com/buildroot/buildroot/archive/refs/tags/$(BUILDROOT_VERSION ) .tar.gz
307
- # https://github.com/buildroot/buildroot/archive/refs/heads/master.zip
308
-
309
- # install Buildroot sources from bundle
310
- $(BUILDROOT_DIR ) /.extracted : $(BUILDROOT_BUNDLE )
311
- ls -l $(dirname $@ )
312
- mkdir -p $(SRC_DIR )
313
- tar -C $(SRC_DIR ) -xf $(BUILDROOT_BUNDLE )
314
- touch $@
315
-
316
293
# download bootloader
317
294
$(U_BOOT_BIN ) :
318
295
$(info U_BOOT_BIN: $@ )
@@ -359,9 +336,6 @@ info: defconfig
359
336
$(info BR2_EXTERNAL: $(BR2_EXTERNAL ) )
360
337
$(info BR2_MAKE: $(BR2_MAKE ) )
361
338
$(info BR2_SENSOR_MODEL: $(BR2_SENSOR_MODEL ) )
362
- $(info BUILDROOT_BUNDLE: $(BUILDROOT_BUNDLE ) )
363
- $(info BUILDROOT_DIR: $(BUILDROOT_DIR ) )
364
- $(info BUILDROOT_VERSION: $(BUILDROOT_VERSION ) )
365
339
$(info CAMERA_IP_ADDRESS: $(CAMERA_IP_ADDRESS ) )
366
340
$(info CURDIR: $(CURDIR ) )
367
341
$(info SOC_FAMILY: $(SOC_FAMILY ) )
@@ -389,7 +363,6 @@ help:
389
363
- make pad_update - pad the update firmware file with zeroes to 16MB\n \
390
364
- make clean - cleaning before reassembly\n \
391
365
- make distclean - switching to the factory state\n \
392
- - make prepare - download and unpack buildroot\n \
393
366
- make info - write to stdout information about selected board\n \
394
367
- make upgrade_ota CAMERA_IP_ADDRESS=192.168.1.10\n \
395
368
- upload the full firmware file to the camera over network, and flash it\n\
0 commit comments