Skip to content

Commit

Permalink
[bot] AutoMerging: merge all upstream's changes:
Browse files Browse the repository at this point in the history
* https://github.com/coolsnowwolf/lede: (28 commits)
  Revert "toolchain: gcc: improve patch handling by introducing major version"
  iwlwifi: edit package/firmware/linux-firmware/intel.mk for support inter-ax201 (coolsnowwolf#10303)
  libselinux: sync with upstream (coolsnowwolf#10300)
  kernel: bump 6.0 to 6.0.3 (coolsnowwolf#10299)
  scripts/download.pl: Make the download tool configurable (coolsnowwolf#10291)
  rockchip: Add Rongpin King3399 support (coolsnowwolf#10292)
  kernel: mtd: add en25qx128a spi nor support
  toolchain: musl: disable crypt size hack by default
  toolchain: gcc: improve patch handling by introducing major version
  build: remove GCC9 support
  build: remove GCC7 support
  toolchain/binutils: remove old versions
  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)
  ...
  • Loading branch information
github-actions[bot] committed Oct 23, 2022
2 parents 329cdb0 + 779ed7d commit bc12df6
Show file tree
Hide file tree
Showing 304 changed files with 13,080 additions and 16,401 deletions.
10 changes: 9 additions & 1 deletion Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@
mainmenu "OpenWrt Configuration"

config MODULES
option modules
modules
bool
default y

config HAVE_DOT_CONFIG
bool
default y

HOST_OS := $(shell, uname)

config HOST_OS_LINUX
def_bool $(shell, ./config/check-uname.sh Linux)

config HOST_OS_MACOS
def_bool $(shell, ./config/check-uname.sh Darwin)

source "target/Config.in"

source "config/Config-images.in"
Expand Down
21 changes: 15 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir

world:

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

ifneq ($(OPENWRT_BUILD),1)
Expand All @@ -38,7 +38,7 @@ else
include tools/Makefile
include toolchain/Makefile

$(toolchain/stamp-compile): $(tools/stamp-compile)
$(toolchain/stamp-compile): $(tools/stamp-compile) $(if $(CONFIG_BUILDBOT),toolchain_rebuild_check)
$(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared
$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
$(package/stamp-install): $(package/stamp-compile)
Expand All @@ -50,14 +50,23 @@ printdb:

prepare: $(target/stamp-compile)

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

dirclean: clean
rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/host $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)
clean: _clean
rm -rf $(BUILD_LOG_DIR)

targetclean: _clean
rm -rf $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)

dirclean: targetclean clean
rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(BUILD_DIR_BASE)/host
rm -rf $(TMP_DIR)
$(MAKE) -C $(TOPDIR)/scripts/config clean

toolchain_rebuild_check:
$(SCRIPT_DIR)/check-toolchain-clean.sh

cacheclean:
ifneq ($(CONFIG_CCACHE),)
$(STAGING_DIR_HOST)/bin/ccache -C
Expand Down
14 changes: 14 additions & 0 deletions config/Config-devel.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ menuconfig DEVEL
Store built firmware images and filesystem images in this directory.
If not set, uses './bin/$(BOARD)'

config DOWNLOAD_TOOL_CUSTOM
string "Use custom download tool" if DEVEL
default ""
help
Use and force custom download tool instead of relying on autoselection
between curl if available and wget as a fallback.

download.pl supports 3 tools officially aria2c, curl and wget.
If one of the tool is used in this config, download.pl will use the
default args to make use of them.

If the provided string is different than aria2c, curl or wget, the command
is used as is and the download url will be appended at the end of such command.

config DOWNLOAD_FOLDER
string "Download folder" if DEVEL
default ""
Expand Down
1 change: 1 addition & 0 deletions config/check-uname.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ "$(uname)" = "$1" ] && echo y || echo n
4 changes: 4 additions & 0 deletions include/download.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ endif

DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED)

# Export options for download.pl
export DOWNLOAD_CHECK_CERTIFICATE:=$(CONFIG_DOWNLOAD_CHECK_CERTIFICATE)
export DOWNLOAD_TOOL_CUSTOM:=$(CONFIG_DOWNLOAD_TOOL_CUSTOM)

define dl_method_git
$(if $(filter https://github.com/% git://github.com/%,$(1)),github_archive,git)
endef
Expand Down
117 changes: 96 additions & 21 deletions include/image-commands.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ IMAGE_KERNEL = $(word 1,$^)
IMAGE_ROOTFS = $(word 2,$^)

define ModelNameLimit16
$(shell expr substr "$(word 2, $(subst _, ,$(1)))" 1 16)
$(shell printf %.16s "$(word 2, $(subst _, ,$(1)))")
endef

define rootfs_align
Expand All @@ -27,8 +27,21 @@ define Build/append-kernel
dd if=$(IMAGE_KERNEL) >> $@
endef

define Build/package-kernel-ubifs
mkdir $@.kernelubifs
cp $@ $@.kernelubifs/kernel
$(STAGING_DIR_HOST)/bin/mkfs.ubifs \
$(KERNEL_UBIFS_OPTS) \
-r $@.kernelubifs $@
rm -r $@.kernelubifs
endef

define Build/append-image
dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) >> $@
cp "$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)" "$@.stripmeta"
fwtool -s /dev/null -t "$@.stripmeta" || :
fwtool -i /dev/null -t "$@.stripmeta" || :
dd if="$@.stripmeta" >> "$@"
rm "$@.stripmeta"
endef

ifdef IB
Expand All @@ -37,8 +50,12 @@ define Build/append-image-stage
endef
else
define Build/append-image-stage
dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) of=$(STAGING_DIR_IMAGE)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))-$(DEVICE_NAME)-$(1)
dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) >> $@
cp "$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)" "$@.stripmeta"
fwtool -s /dev/null -t "$@.stripmeta" || :
fwtool -i /dev/null -t "$@.stripmeta" || :
dd if="$@.stripmeta" of="$(STAGING_DIR_IMAGE)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))-$(DEVICE_NAME)-$(1)"
dd if="$@.stripmeta" >> "$@"
rm "$@.stripmeta"
endef
endif

Expand Down Expand Up @@ -72,6 +89,7 @@ metadata_json = \

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

define Build/append-squashfs4-fakeroot
rm -rf $@.fakefs $@.fakesquashfs
mkdir $@.fakefs
$(STAGING_DIR_HOST)/bin/mksquashfs4 \
$@.fakefs $@.fakesquashfs \
-nopad -noappend -root-owned
cat $@.fakesquashfs >> $@
endef

define Build/append-string
echo -n $(1) >> $@
endef
Expand All @@ -103,7 +130,7 @@ define Build/append-ubi
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
$(if $(KERNEL_IN_UBI),--kernel $(IMAGE_KERNEL)) \
$(foreach part,$(UBINIZE_PARTS),--part $(part)) \
$(IMAGE_ROOTFS) \
--rootfs $(IMAGE_ROOTFS) \
$@.tmp \
-p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
$(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
Expand All @@ -113,6 +140,18 @@ define Build/append-ubi
rm $@.tmp
endef

define Build/ubinize-kernel
cp $@ $@.tmp
sh $(TOPDIR)/scripts/ubinize-image.sh \
--kernel $@.tmp \
$@ \
-p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
$(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
$(if $(VID_HDR_OFFSET),-O $(VID_HDR_OFFSET)) \
$(UBINIZE_OPTS)
rm $@.tmp
endef

define Build/append-uboot
dd if=$(UBOOT_PATH) >> $@
endef
Expand Down Expand Up @@ -170,11 +209,15 @@ define Build/check-size
@imagesize="$$(stat -c%s $@)"; \
limitsize="$$(($(subst k,* 1024,$(subst m, * 1024k,$(if $(1),$(1),$(IMAGE_SIZE))))))"; \
[ $$limitsize -ge $$imagesize ] || { \
echo "WARNING: Image file $@ is too big: $$imagesize > $$limitsize" >&2; \
$(call ERROR_MESSAGE, WARNING: Image file $@ is too big: $$imagesize > $$limitsize); \
rm -f $@; \
}
endef

define Build/copy-file
cat "$(1)" > "$@"
endef

define Build/elecom-product-header
$(eval product=$(word 1,$(1)))
$(eval fw=$(if $(word 2,$(1)),$(word 2,$(1)),$@))
Expand All @@ -187,6 +230,19 @@ define Build/elecom-product-header
mv $(fw).new $(fw)
endef

define Build/elecom-wrc-gs-factory
$(eval product=$(word 1,$(1)))
$(eval version=$(word 2,$(1)))
$(eval hash_opt=$(word 3,$(1)))
$(MKHASH) md5 $(hash_opt) $@ >> $@
( \
echo -n "ELECOM $(product) v$(version)" | \
dd bs=32 count=1 conv=sync; \
dd if=$@; \
) > $@.new
mv $@.new $@
endef

define Build/elx-header
$(eval hw_id=$(word 1,$(1)))
$(eval xor_pattern=$(word 2,$(1)))
Expand Down Expand Up @@ -223,15 +279,18 @@ endef
define Build/fit
$(TOPDIR)/scripts/mkits.sh \
-D $(DEVICE_NAME) -o $@.its -k $@ \
-C $(word 1,$(1)) $(if $(word 2,$(1)),\
$(if $(DEVICE_DTS_OVERLAY),-d $(KERNEL_BUILD_DIR)/image-$$(basename $(word 2,$(1))),\
-d $(word 2,$(1)))) \
-C $(word 1,$(1)) \
$(if $(word 2,$(1)),\
$(if $(findstring 11,$(if $(DEVICE_DTS_OVERLAY),1)$(if $(findstring $(KERNEL_BUILD_DIR)/image-,$(word 2,$(1))),,1)), \
-d $(KERNEL_BUILD_DIR)/image-$$(basename $(word 2,$(1))), \
-d $(word 2,$(1)))) \
$(if $(findstring with-rootfs,$(word 3,$(1))),-r $(IMAGE_ROOTFS)) \
$(if $(findstring with-initrd,$(word 3,$(1))), \
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE), \
-i $(KERNEL_BUILD_DIR)/initrd.cpio$(strip $(call Build/initrd_compression)))) \
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
$(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
$(if $(DEVICE_DTS_DELIMITER),-l $(DEVICE_DTS_DELIMITER)) \
$(if $(DEVICE_DTS_OVERLAY),$(foreach dtso,$(DEVICE_DTS_OVERLAY), -O $(dtso):$(KERNEL_BUILD_DIR)/image-$(dtso).dtb)) \
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
Expand All @@ -256,6 +315,16 @@ define Build/install-dtb
)
endef

define Build/iptime-crc32
$(STAGING_DIR_HOST)/bin/iptime-crc32 $(1) $@ $@.new
mv $@.new $@
endef

define Build/iptime-naspkg
$(STAGING_DIR_HOST)/bin/iptime-naspkg $(1) $@ $@.new
mv $@.new $@
endef

define Build/jffs2
rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 && \
mkdir -p $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$$(dirname $(1)) && \
Expand Down Expand Up @@ -318,6 +387,19 @@ define Build/netgear-dni
mv $@.new $@
endef

define Build/netgear-encrypted-factory
$(TOPDIR)/scripts/netgear-encrypted-factory.py \
--input-file $@ \
--output-file $@ \
--model $(NETGEAR_ENC_MODEL) \
--region $(NETGEAR_ENC_REGION) \
--version V1.0.0.0.$(VERSION_DIST).$(firstword $(subst -, ,$(REVISION))) \
--encryption-block-size 0x20000 \
--openssl-bin "$(STAGING_DIR_HOST)/bin/openssl" \
--key 6865392d342b4d212964363d6d7e7765312c7132613364316e26322a5a5e2538 \
--iv 4a253169516c38243d6c6d2d3b384145
endef

define Build/openmesh-image
$(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
"$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" \
Expand Down Expand Up @@ -370,13 +452,6 @@ define Build/qemu-image
fi
endef

define Build/qsdk-ipq-factory-mmc
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
$@.its kernel $(IMAGE_KERNEL) rootfs $(IMAGE_ROOTFS)
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
@mv $@.new $@
endef

define Build/qsdk-ipq-factory-nand
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
$@.its ubi $@
Expand Down Expand Up @@ -496,12 +571,12 @@ define Build/xor-image
endef

define Build/zip
rm -rf $@.tmp
mkdir $@.tmp
mv $@ $@.tmp/$(1)

zip -j -X \
$(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
$@ $@.tmp/$(if $(1),$(1),$@)
mv $@ $@.tmp/$(word 1,$(1))
TZ=UTC $(STAGING_DIR_HOST)/bin/zip -j -X \
$(wordlist 2,$(words $(1)),$(1)) \
$@ $@.tmp/$(if $(word 1,$(1)),$(word 1,$(1)),$$(basename $@))
rm -rf $@.tmp
endef

Expand Down
Loading

0 comments on commit bc12df6

Please sign in to comment.