Skip to content

Commit 6705bbd

Browse files
committed
[bot] AutoMerging: merge all upstream's changes:
* https://github.com/coolsnowwolf/lede: download.pl: use more Chinese mirrors (coolsnowwolf#10281) build: move Build/copy-file to image-commands.mk mt76: add MediaTek Filogic 630 (MT7916) support build: switch default target to x64 scripts: sync with upstream wireless-regdb: unlock WIFI6E channel and txpower rockchip: add rockchip-crypto support for rk3568/rk3588 toolchain: glibc: Update to glibc 2.35 (coolsnowwolf#10276) kernel: bump 5.10 to 5.10.149 (coolsnowwolf#10278) Kernel: bump 5.4 to 5.4.219 (coolsnowwolf#10279) rockchip: fix Makefile format (coolsnowwolf#10275)
2 parents a2656f6 + 3b4c47d commit 6705bbd

File tree

128 files changed

+11448
-4803
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+11448
-4803
lines changed

Config.in

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,22 @@
55
mainmenu "OpenWrt Configuration"
66

77
config MODULES
8-
option modules
8+
modules
99
bool
1010
default y
1111

1212
config HAVE_DOT_CONFIG
1313
bool
1414
default y
1515

16+
HOST_OS := $(shell, uname)
17+
18+
config HOST_OS_LINUX
19+
def_bool $(shell, ./config/check-uname.sh Linux)
20+
21+
config HOST_OS_MACOS
22+
def_bool $(shell, ./config/check-uname.sh Darwin)
23+
1624
source "target/Config.in"
1725

1826
source "config/Config-images.in"

Makefile

+15-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir
1414

1515
world:
1616

17-
DISTRO_PKG_CONFIG:=$(shell which -a pkg-config | grep '/usr' -m 1)
17+
DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep '/usr' -m 1)
1818
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
1919

2020
ifneq ($(OPENWRT_BUILD),1)
@@ -38,7 +38,7 @@ else
3838
include tools/Makefile
3939
include toolchain/Makefile
4040

41-
$(toolchain/stamp-compile): $(tools/stamp-compile)
41+
$(toolchain/stamp-compile): $(tools/stamp-compile) $(if $(CONFIG_BUILDBOT),toolchain_rebuild_check)
4242
$(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared
4343
$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
4444
$(package/stamp-install): $(package/stamp-compile)
@@ -50,14 +50,23 @@ printdb:
5050

5151
prepare: $(target/stamp-compile)
5252

53-
clean: FORCE
54-
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(BUILD_LOG_DIR) $(TOPDIR)/staging_dir/packages
53+
_clean: FORCE
54+
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(TOPDIR)/staging_dir/packages
5555

56-
dirclean: clean
57-
rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/host $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)
56+
clean: _clean
57+
rm -rf $(BUILD_LOG_DIR)
58+
59+
targetclean: _clean
60+
rm -rf $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)
61+
62+
dirclean: targetclean clean
63+
rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(BUILD_DIR_BASE)/host
5864
rm -rf $(TMP_DIR)
5965
$(MAKE) -C $(TOPDIR)/scripts/config clean
6066

67+
toolchain_rebuild_check:
68+
$(SCRIPT_DIR)/check-toolchain-clean.sh
69+
6170
cacheclean:
6271
ifneq ($(CONFIG_CCACHE),)
6372
$(STAGING_DIR_HOST)/bin/ccache -C

config/check-uname.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[ "$(uname)" = "$1" ] && echo y || echo n

include/image-commands.mk

+96-21
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ IMAGE_KERNEL = $(word 1,$^)
44
IMAGE_ROOTFS = $(word 2,$^)
55

66
define ModelNameLimit16
7-
$(shell expr substr "$(word 2, $(subst _, ,$(1)))" 1 16)
7+
$(shell printf %.16s "$(word 2, $(subst _, ,$(1)))")
88
endef
99

1010
define rootfs_align
@@ -27,8 +27,21 @@ define Build/append-kernel
2727
dd if=$(IMAGE_KERNEL) >> $@
2828
endef
2929

30+
define Build/package-kernel-ubifs
31+
mkdir $@.kernelubifs
32+
cp $@ $@.kernelubifs/kernel
33+
$(STAGING_DIR_HOST)/bin/mkfs.ubifs \
34+
$(KERNEL_UBIFS_OPTS) \
35+
-r $@.kernelubifs $@
36+
rm -r $@.kernelubifs
37+
endef
38+
3039
define Build/append-image
31-
dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) >> $@
40+
cp "$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)" "$@.stripmeta"
41+
fwtool -s /dev/null -t "$@.stripmeta" || :
42+
fwtool -i /dev/null -t "$@.stripmeta" || :
43+
dd if="$@.stripmeta" >> "$@"
44+
rm "$@.stripmeta"
3245
endef
3346

3447
ifdef IB
@@ -37,8 +50,12 @@ define Build/append-image-stage
3750
endef
3851
else
3952
define Build/append-image-stage
40-
dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) of=$(STAGING_DIR_IMAGE)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))-$(DEVICE_NAME)-$(1)
41-
dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) >> $@
53+
cp "$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)" "$@.stripmeta"
54+
fwtool -s /dev/null -t "$@.stripmeta" || :
55+
fwtool -i /dev/null -t "$@.stripmeta" || :
56+
dd if="$@.stripmeta" of="$(STAGING_DIR_IMAGE)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))-$(DEVICE_NAME)-$(1)"
57+
dd if="$@.stripmeta" >> "$@"
58+
rm "$@.stripmeta"
4259
endef
4360
endif
4461

@@ -72,6 +89,7 @@ metadata_json = \
7289

7390
define Build/append-metadata
7491
$(if $(SUPPORTED_DEVICES),-echo $(call metadata_json) | fwtool -I - $@)
92+
sha256sum "$@" | cut -d" " -f1 > "$@.sha256sum"
7593
[ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \
7694
cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
7795
usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
@@ -94,6 +112,15 @@ define Build/append-squashfs-fakeroot-be
94112
cat $@.fakesquashfs >> $@
95113
endef
96114

115+
define Build/append-squashfs4-fakeroot
116+
rm -rf $@.fakefs $@.fakesquashfs
117+
mkdir $@.fakefs
118+
$(STAGING_DIR_HOST)/bin/mksquashfs4 \
119+
$@.fakefs $@.fakesquashfs \
120+
-nopad -noappend -root-owned
121+
cat $@.fakesquashfs >> $@
122+
endef
123+
97124
define Build/append-string
98125
echo -n $(1) >> $@
99126
endef
@@ -103,7 +130,7 @@ define Build/append-ubi
103130
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
104131
$(if $(KERNEL_IN_UBI),--kernel $(IMAGE_KERNEL)) \
105132
$(foreach part,$(UBINIZE_PARTS),--part $(part)) \
106-
$(IMAGE_ROOTFS) \
133+
--rootfs $(IMAGE_ROOTFS) \
107134
$@.tmp \
108135
-p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
109136
$(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
@@ -113,6 +140,18 @@ define Build/append-ubi
113140
rm $@.tmp
114141
endef
115142

143+
define Build/ubinize-kernel
144+
cp $@ $@.tmp
145+
sh $(TOPDIR)/scripts/ubinize-image.sh \
146+
--kernel $@.tmp \
147+
$@ \
148+
-p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
149+
$(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
150+
$(if $(VID_HDR_OFFSET),-O $(VID_HDR_OFFSET)) \
151+
$(UBINIZE_OPTS)
152+
rm $@.tmp
153+
endef
154+
116155
define Build/append-uboot
117156
dd if=$(UBOOT_PATH) >> $@
118157
endef
@@ -170,11 +209,15 @@ define Build/check-size
170209
@imagesize="$$(stat -c%s $@)"; \
171210
limitsize="$$(($(subst k,* 1024,$(subst m, * 1024k,$(if $(1),$(1),$(IMAGE_SIZE))))))"; \
172211
[ $$limitsize -ge $$imagesize ] || { \
173-
echo "WARNING: Image file $@ is too big: $$imagesize > $$limitsize" >&2; \
212+
$(call ERROR_MESSAGE, WARNING: Image file $@ is too big: $$imagesize > $$limitsize); \
174213
rm -f $@; \
175214
}
176215
endef
177216

217+
define Build/copy-file
218+
cat "$(1)" > "$@"
219+
endef
220+
178221
define Build/elecom-product-header
179222
$(eval product=$(word 1,$(1)))
180223
$(eval fw=$(if $(word 2,$(1)),$(word 2,$(1)),$@))
@@ -187,6 +230,19 @@ define Build/elecom-product-header
187230
mv $(fw).new $(fw)
188231
endef
189232

233+
define Build/elecom-wrc-gs-factory
234+
$(eval product=$(word 1,$(1)))
235+
$(eval version=$(word 2,$(1)))
236+
$(eval hash_opt=$(word 3,$(1)))
237+
$(MKHASH) md5 $(hash_opt) $@ >> $@
238+
( \
239+
echo -n "ELECOM $(product) v$(version)" | \
240+
dd bs=32 count=1 conv=sync; \
241+
dd if=$@; \
242+
) > $@.new
243+
mv $@.new $@
244+
endef
245+
190246
define Build/elx-header
191247
$(eval hw_id=$(word 1,$(1)))
192248
$(eval xor_pattern=$(word 2,$(1)))
@@ -223,15 +279,18 @@ endef
223279
define Build/fit
224280
$(TOPDIR)/scripts/mkits.sh \
225281
-D $(DEVICE_NAME) -o $@.its -k $@ \
226-
-C $(word 1,$(1)) $(if $(word 2,$(1)),\
227-
$(if $(DEVICE_DTS_OVERLAY),-d $(KERNEL_BUILD_DIR)/image-$$(basename $(word 2,$(1))),\
228-
-d $(word 2,$(1)))) \
282+
-C $(word 1,$(1)) \
283+
$(if $(word 2,$(1)),\
284+
$(if $(findstring 11,$(if $(DEVICE_DTS_OVERLAY),1)$(if $(findstring $(KERNEL_BUILD_DIR)/image-,$(word 2,$(1))),,1)), \
285+
-d $(KERNEL_BUILD_DIR)/image-$$(basename $(word 2,$(1))), \
286+
-d $(word 2,$(1)))) \
229287
$(if $(findstring with-rootfs,$(word 3,$(1))),-r $(IMAGE_ROOTFS)) \
230288
$(if $(findstring with-initrd,$(word 3,$(1))), \
231289
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE), \
232290
-i $(KERNEL_BUILD_DIR)/initrd.cpio$(strip $(call Build/initrd_compression)))) \
233291
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
234292
$(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
293+
$(if $(DEVICE_DTS_DELIMITER),-l $(DEVICE_DTS_DELIMITER)) \
235294
$(if $(DEVICE_DTS_OVERLAY),$(foreach dtso,$(DEVICE_DTS_OVERLAY), -O $(dtso):$(KERNEL_BUILD_DIR)/image-$(dtso).dtb)) \
236295
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
237296
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
@@ -256,6 +315,16 @@ define Build/install-dtb
256315
)
257316
endef
258317

318+
define Build/iptime-crc32
319+
$(STAGING_DIR_HOST)/bin/iptime-crc32 $(1) $@ $@.new
320+
mv $@.new $@
321+
endef
322+
323+
define Build/iptime-naspkg
324+
$(STAGING_DIR_HOST)/bin/iptime-naspkg $(1) $@ $@.new
325+
mv $@.new $@
326+
endef
327+
259328
define Build/jffs2
260329
rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 && \
261330
mkdir -p $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$$(dirname $(1)) && \
@@ -318,6 +387,19 @@ define Build/netgear-dni
318387
mv $@.new $@
319388
endef
320389

390+
define Build/netgear-encrypted-factory
391+
$(TOPDIR)/scripts/netgear-encrypted-factory.py \
392+
--input-file $@ \
393+
--output-file $@ \
394+
--model $(NETGEAR_ENC_MODEL) \
395+
--region $(NETGEAR_ENC_REGION) \
396+
--version V1.0.0.0.$(VERSION_DIST).$(firstword $(subst -, ,$(REVISION))) \
397+
--encryption-block-size 0x20000 \
398+
--openssl-bin "$(STAGING_DIR_HOST)/bin/openssl" \
399+
--key 6865392d342b4d212964363d6d7e7765312c7132613364316e26322a5a5e2538 \
400+
--iv 4a253169516c38243d6c6d2d3b384145
401+
endef
402+
321403
define Build/openmesh-image
322404
$(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
323405
"$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" \
@@ -370,13 +452,6 @@ define Build/qemu-image
370452
fi
371453
endef
372454

373-
define Build/qsdk-ipq-factory-mmc
374-
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
375-
$@.its kernel $(IMAGE_KERNEL) rootfs $(IMAGE_ROOTFS)
376-
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
377-
@mv $@.new $@
378-
endef
379-
380455
define Build/qsdk-ipq-factory-nand
381456
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
382457
$@.its ubi $@
@@ -496,12 +571,12 @@ define Build/xor-image
496571
endef
497572

498573
define Build/zip
574+
rm -rf $@.tmp
499575
mkdir $@.tmp
500-
mv $@ $@.tmp/$(1)
501-
502-
zip -j -X \
503-
$(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
504-
$@ $@.tmp/$(if $(1),$(1),$@)
576+
mv $@ $@.tmp/$(word 1,$(1))
577+
TZ=UTC $(STAGING_DIR_HOST)/bin/zip -j -X \
578+
$(wordlist 2,$(words $(1)),$(1)) \
579+
$@ $@.tmp/$(if $(word 1,$(1)),$(word 1,$(1)),$$(basename $@))
505580
rm -rf $@.tmp
506581
endef
507582

0 commit comments

Comments
 (0)