From 50a054a3a1e80beccf35540d4d838264f5ae87f2 Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Mon, 9 Mar 2020 21:14:06 +0900 Subject: [PATCH 01/21] build: image: move IMAGE_SIZE to image.mk IMAGE_SIZE is widely used in many targets. Declare it in the default template to clean up redundant code. This also prevents deriving IMAGE_SIZE unintentionally from the previously defined device. While at it, remove duplicate KERNEL_SIZE declaration. Signed-off-by: Sungbo Eo --- include/image.mk | 6 +++--- target/linux/apm821xx/image/Makefile | 2 +- target/linux/ar71xx/image/Makefile | 2 +- target/linux/ath79/image/Makefile | 2 +- target/linux/lantiq/image/Makefile | 3 +-- target/linux/ramips/image/Makefile | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/image.mk b/include/image.mk index b3efd8af95..9d39e71ca5 100644 --- a/include/image.mk +++ b/include/image.mk @@ -398,13 +398,13 @@ define Device/Init DEVICE_NAME := $(1) KERNEL:= KERNEL_INITRAMFS = $$(KERNEL) - KERNEL_SIZE:= CMDLINE:= IMAGES := ARTIFACTS := IMAGE_PREFIX := $(IMG_PREFIX)-$(1) IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2) + IMAGE_SIZE := KERNEL_PREFIX = $$(IMAGE_PREFIX) KERNEL_SUFFIX := -kernel.bin KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX) @@ -451,8 +451,8 @@ DEFAULT_DEVICE_VARS := \ CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI BLOCKSIZE PAGESIZE SUBPAGESIZE \ VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTS \ DEVICE_DTS_CONFIG DEVICE_DTS_DIR SOC BOARD_NAME UIMAGE_NAME SUPPORTED_DEVICES \ - IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH DEVICE_VENDOR \ - DEVICE_MODEL DEVICE_VARIANT \ + IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH IMAGE_SIZE \ + DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \ DEVICE_ALT0_VENDOR DEVICE_ALT0_MODEL DEVICE_ALT0_VARIANT \ DEVICE_ALT1_VENDOR DEVICE_ALT1_MODEL DEVICE_ALT1_VARIANT \ DEVICE_ALT2_VENDOR DEVICE_ALT2_MODEL DEVICE_ALT2_VARIANT diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index d6058fb926..22a456b36f 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -DEVICE_VARS += IMAGE_SIZE DTB_SIZE +DEVICE_VARS += DTB_SIZE define Build/boot-img $(RM) -rf $@.bootdir diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index c429eb39d9..62d5626a09 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/image.mk KERNEL_LOADADDR = 0x80060000 -DEVICE_VARS += BOARDNAME CMDLINE CONSOLE IMAGE_SIZE LOADER_TYPE +DEVICE_VARS += BOARDNAME CMDLINE CONSOLE LOADER_TYPE ifeq ($(SUBTARGET),generic) include ./generic.mk diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile index 10b1b4a02d..c61a3926d5 100644 --- a/target/linux/ath79/image/Makefile +++ b/target/linux/ath79/image/Makefile @@ -3,7 +3,7 @@ include $(INCLUDE_DIR)/image.mk KERNEL_LOADADDR = 0x80060000 -DEVICE_VARS += IMAGE_SIZE LOADER_FLASH_OFFS LOADER_TYPE +DEVICE_VARS += LOADER_FLASH_OFFS LOADER_TYPE define Build/loader-common rm -rf $@.src diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile index 9d1b62d39a..b169d93859 100644 --- a/target/linux/lantiq/image/Makefile +++ b/target/linux/lantiq/image/Makefile @@ -52,7 +52,7 @@ define Build/fullimage rm $@.tmp endef -DEVICE_VARS += IMAGE_SIZE SIGNATURE MAGIC CRC32_POLY +DEVICE_VARS += SIGNATURE MAGIC CRC32_POLY DTS_DIR := $(DTS_DIR)/lantiq # Shared device definition: applies to every defined device @@ -63,7 +63,6 @@ define Device/Default KERNEL := kernel-bin | append-dtb | lzma | uImage lzma KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma FILESYSTEMS := squashfs - IMAGE_SIZE := SOC := $(DEFAULT_SOC) DEVICE_DTS = $$(SOC)_$(1) SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index bc87753aa5..7c1f7c6c0b 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -DEVICE_VARS += IMAGE_SIZE NETGEAR_BOARD_ID NETGEAR_HW_ID +DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID DEVICE_VARS += BUFFALO_TAG_PLATFORM BUFFALO_TAG_VERSION BUFFALO_TAG_MINOR DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK DEVICE_VARS += SERCOMM_HWID SERCOMM_HWVER SERCOMM_SWVER From 8205dcaf776737308f312c694f1e1630703db35f Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Fri, 14 Aug 2020 13:21:22 +0100 Subject: [PATCH 02/21] zram-swap: explicitly use mkswap/swapon/swapoff from /sbin The required BusyBox applets are enabled by default, so we can rely on them being present in the system. This way, we make sure there are no conflicts with less featured variants of these same applets which might also be present in the system. Fixes: 0bd7dfa3ed60 ("zram-swap: enable swap discard") Signed-off-by: Rui Salvaterra [wrap commit description] Signed-off-by: David Bauer --- package/system/zram-swap/Makefile | 4 ++-- package/system/zram-swap/files/zram.init | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package/system/zram-swap/Makefile b/package/system/zram-swap/Makefile index 5c132c9062..9a18dd3417 100644 --- a/package/system/zram-swap/Makefile +++ b/package/system/zram-swap/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zram-swap -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) @@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk define Package/zram-swap SECTION:=utils CATEGORY:=Base system - DEPENDS:=+kmod-zram +!(BUSYBOX_CONFIG_MKSWAP&&BUSYBOX_CONFIG_SWAPON&&BUSYBOX_CONFIG_SWAPOFF):swap-utils + DEPENDS:=+kmod-zram +@BUSYBOX_CONFIG_MKSWAP +@BUSYBOX_CONFIG_SWAPON +@BUSYBOX_CONFIG_FEATURE_SWAPON_DISCARD +@BUSYBOX_CONFIG_FEATURE_SWAPON_PRI +@BUSYBOX_CONFIG_SWAPOFF TITLE:=ZRAM swap scripts PKGARCH:=all endef diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index 42c084855a..f31a87438c 100755 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -35,18 +35,18 @@ zram_applicable() return 1 } - command -v mkswap >/dev/null || { - logger -s -t zram_applicable -p daemon.err "[ERROR] 'mkswap' not installed" + [ -x /sbin/mkswap ] || { + logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox mkswap' not installed" return 1 } - command -v swapon >/dev/null || { - logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapon' not installed" + [ -x /sbin/swapon ] || { + logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox swapon' not installed" return 1 } - command -v swapoff >/dev/null || { - logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapoff' not installed" + [ -x /sbin/swapoff ] || { + logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox swapoff' not installed" return 1 } } @@ -181,8 +181,8 @@ start() zram_comp_algo "$zram_dev" zram_comp_streams "$zram_dev" echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize" - mkswap "$zram_dev" - swapon -d $zram_priority "$zram_dev" + /sbin/mkswap "$zram_dev" + /sbin/swapon -d $zram_priority "$zram_dev" } stop() @@ -191,7 +191,7 @@ stop() for zram_dev in $( grep zram /proc/swaps |awk '{print $1}' ); do { logger -s -t zram_stop -p daemon.debug "deactivate swap $zram_dev" - swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory back" + /sbin/swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory back" local dev_index="$( echo $zram_dev | grep -o "[0-9]*$" )" if [ $dev_index -ne 0 ]; then logger -s -t zram_stop -p daemon.debug "removing zram $zram_dev" From 0ac2954f4fef71aea2355219fd51024b87b214f7 Mon Sep 17 00:00:00 2001 From: Saxon <18494610+Saxon-Sun@users.noreply.github.com> Date: Mon, 21 Sep 2020 15:10:02 +0800 Subject: [PATCH 03/21] frp: update to 0.34 --- package/lean/frp/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lean/frp/Makefile b/package/lean/frp/Makefile index 5e16cebf32..1c7a1462d4 100644 --- a/package/lean/frp/Makefile +++ b/package/lean/frp/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=frp -PKG_VERSION:=0.33.0 +PKG_VERSION:=0.34.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/fatedier/frp/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=9c773ab4bbd208705c795599c5e69302a379734921c90489ed8ae331c24836cb +PKG_HASH:=3C4F354C7C82EB5001F0DE5A55015ACBAA1FBA03AA97647A74131BC4118598A8 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE From eee90d32226e3abfffe3ffdbf25b7de505a12bcf Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Mon, 21 Sep 2020 22:15:23 +0800 Subject: [PATCH 04/21] frp: fix HASH key --- package/lean/frp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/lean/frp/Makefile b/package/lean/frp/Makefile index 1c7a1462d4..ff42883d65 100644 --- a/package/lean/frp/Makefile +++ b/package/lean/frp/Makefile @@ -13,7 +13,7 @@ PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/fatedier/frp/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=3C4F354C7C82EB5001F0DE5A55015ACBAA1FBA03AA97647A74131BC4118598A8 +PKG_HASH:=3c4f354c7c82eb5001f0de5a55015acbaa1fba03aa97647a74131bc4118598a8 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE From f0a16418a5e9c494a71d87946f7a0692892fca1b Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 21 Sep 2020 13:47:57 +0100 Subject: [PATCH 05/21] libselinux: split utility packages and add PKG_LICENSE Split utility packages similar to coreutils in packages feed, adding ALTERNATIVES for those which are also provided by busybox-selinux. Also add missing license information. Signed-off-by: Daniel Golle --- package/libs/libselinux/Makefile | 89 ++++++++++++++++++++++++++------ 1 file changed, 74 insertions(+), 15 deletions(-) diff --git a/package/libs/libselinux/Makefile b/package/libs/libselinux/Makefile index 450bdfbf3b..20d9225d39 100644 --- a/package/libs/libselinux/Makefile +++ b/package/libs/libselinux/Makefile @@ -7,26 +7,71 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libselinux PKG_VERSION:=3.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/20200710 PKG_HASH:=ea5dcbb4d859e3f999c26a13c630da2f16dff9462e3cc8cb7b458ac157d112e7 HOST_BUILD_DEPENDS:=libsepol/host pcre/host +PKG_LICENSE:=libselinux-1.0 +PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=Thomas Petazzoni include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk -define Package/libselinux - SECTION:=libs - DEPENDS:=+libsepol +libpcre +musl-fts - CATEGORY:=Libraries +LIBSELINUX_UTILS := \ + avcstat \ + compute_av \ + compute_create \ + compute_member \ + compute_relabel \ + getconlist \ + getdefaultcon \ + getenforce \ + getfilecon \ + getpidcon \ + getsebool \ + getseuser \ + matchpathcon \ + policyvers \ + sefcontext_compile \ + selabel_digest \ + selabel_get_digests_all_partial_matches \ + selabel_lookup \ + selabel_lookup_best_match \ + selabel_partial_match \ + selinux_check_access \ + selinux_check_securetty_context \ + selinuxenabled \ + selinuxexeccon \ + setenforce \ + setfilecon \ + togglesebool \ + validatetrans + +LIBSELINUX_ALTS := \ + getenforce \ + getsebool \ + matchpathcon \ + selinuxenabled \ + setenforce + +$(eval $(foreach a,$(LIBSELINUX_ALTS),ALTS_$(a):=300:/usr/sbin/$(a):/usr/sbin/libselinux-$(a)$(newline))) + +define Package/libselinux/Default TITLE:=Runtime SELinux library URL:=http://selinuxproject.org/page/Main_Page endef +define Package/libselinux + $(call Package/libselinux/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libsepol +libpcre +musl-fts +endef + define Package/libselinux/description libselinux is the runtime SELinux library that provides interfaces (e.g. library functions for the SELinux kernel @@ -37,14 +82,24 @@ define Package/libselinux/description older version supported by the kernel) when loading policy. endef -define Package/libselinux-utils - SECTION:=utils - DEPENDS:=+libselinux - CATEGORY:=Utilities - TITLE:=Runtime SELinux utilities - URL:=http://selinuxproject.org/page/Main_Page +define GenUtilPkg + define Package/$(1) + $(call Package/libselinux/Default) + TITLE+= $(2) utility + SECTION:=utils + DEPENDS:=+libselinux + CATEGORY:=Utilities + SUBMENU:=libselinux tools + ALTERNATIVES:=$(ALTS_$(2)) + endef + + define Package/$(1)/description + libselinux version of the $(2) utility. + endef endef +$(foreach a,$(LIBSELINUX_UTILS),$(eval $(call GenUtilPkg,libselinux-$(a),$(a)))) + # Needed to link libselinux utilities, which link against # libselinux.so, which indirectly depends on libpcre.so, installed in # $(STAGING_DIR_HOSTPKG). @@ -83,11 +138,15 @@ define Package/libselinux/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libselinux.so.* $(1)/usr/lib/ endef -define Package/libselinux-utils/install - $(INSTALL_DIR) $(1)/usr/sbin - $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin +define BuildUtil + define Package/$(1)/install + $(INSTALL_DIR) $$(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/$(2) $$(1)/usr/sbin/$(if $(ALTS_$(2)),libselinux-$(2),$(2)) + endef + + $$(eval $$(call BuildPackage,$(1))) endef $(eval $(call HostBuild)) $(eval $(call BuildPackage,libselinux)) -$(eval $(call BuildPackage,libselinux-utils)) +$(foreach a,$(LIBSELINUX_UTILS),$(eval $(call BuildUtil,libselinux-$(a),$(a)))) From 4823ae6bdee261ca2de8f210a50624d38eaa9449 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 21 Sep 2020 18:12:24 +0100 Subject: [PATCH 06/21] policycoreutils: break into smaller packages Instead of vaguely describing dependencies in the package description actually split-up into individual packages, each with their dependencies expressed accurately. Signed-off-by: Daniel Golle --- package/utils/policycoreutils/Makefile | 161 +++++++++++++++++-------- 1 file changed, 113 insertions(+), 48 deletions(-) diff --git a/package/utils/policycoreutils/Makefile b/package/utils/policycoreutils/Makefile index 34c186e62e..3fd0e39081 100644 --- a/package/utils/policycoreutils/Makefile +++ b/package/utils/policycoreutils/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=policycoreutils PKG_VERSION:=3.1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/20200710 @@ -23,62 +23,127 @@ PKG_LICENSE_FILES:=COPYING include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk - -define Package/policycoreutils - SECTION:=utils - CATEGORY:=Utilities - DEPENDS:= +libsemanage +libcap-ng +BUSYBOX_CONFIG_PAM:libpam $(INTL_DEPENDS) - TITLE:=SELinux policy utilities - URL:=http://selinuxproject.org/page/Main_Page - ALTERNATIVES:=\ - 300:/sbin/restorecon:policycoreutils-restorecon \ - 300:/sbin/setfiles:policycoreutils-setfiles \ - 300:/usr/sbin/load_policy:policycoreutils-load_policy \ - 300:/usr/sbin/sestatus:policycoreutils-sestatus \ - 300:/usr/sbin/setsebool:policycoreutils-setsebool -endef - -define Package/policycoreutils/description - Policycoreutils is a collection of policy utilities - (originally the "core" set of utilities needed to use - SELinux, although it has grown a bit over time), which have - different dependencies. sestatus, secon, run_init, and - newrole only use libselinux. load_policy and setfiles only - use libselinux and libsepol. semodule and semanage use - libsemanage (and thus bring in dependencies on libsepol and - libselinux as well). setsebool uses libselinux to make - non-persistent boolean changes (via the kernel interface) - and uses libsemanage to make persistent boolean changes. -endef - include $(INCLUDE_DIR)/host-build.mk +DIR_SBIN:= \ + restorecon \ + setfiles + +DIR_USR_BIN:= \ + newrole \ + secon + +DIR_USR_SBIN:= \ + load_policy \ + sestatus \ + setsebool + +LIBEXEC_UTILS := \ + pp + +SBIN_UTILS:= \ + restorecon_xattr \ + restorecon \ + setfiles + +USR_BIN_UTILS:= \ + newrole \ + secon + +USR_SBIN_UTILS:= \ + fixfiles \ + genhomedircon \ + open_init_pty \ + run_init \ + semodule \ + load_policy \ + sestatus \ + setsebool + +TARGET_LDFLAGS += $(INTL_LDFLAGS) $(if $(INTL_FULL),-lintl) + +MAKE_FLAGS += \ + PAMH=$(CONFIG_BUSYBOX_CONFIG_PAM) + HOST_MAKE_FLAGS += \ PAMH=$(CONFIG_BUSYBOX_CONFIG_PAM) \ PREFIX=$(STAGING_DIR_HOSTPKG) \ SBINDIR=$(STAGING_DIR_HOSTPKG)/sbin \ ETCDIR=$(STAGING_DIR_HOSTPKG)/etc -MAKE_FLAGS += \ - PAMH=$(CONFIG_BUSYBOX_CONFIG_PAM) +$(eval $(foreach a,$(DIR_SBIN),ALTS_$(a):=300:/sbin/$(a):/sbin/policycoreutils-$(a)$(newline))) +$(eval $(foreach a,$(DIR_USR_BIN),ALTS_$(a):=300:/usr/bin/$(a):/usr/bin/policycoreutils-$(a)$(newline))) +$(eval $(foreach a,$(DIR_USR_SBIN),ALTS_$(a):=300:/usr/sbin/$(a):/usr/sbin/policycoreutils-$(a)$(newline))) -define Package/policycoreutils/install - $(INSTALL_DIR) $(1)/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/restorecon_xattr $(1)/sbin/restorecon_xattr - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/restorecon $(1)/sbin/policycoreutils-restorecon - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/setfiles $(1)/sbin/policycoreutils-setfiles - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fixfiles $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/genhomedircon $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/open_init_pty $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/run_init $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/semodule $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/load_policy $(1)/usr/sbin/policycoreutils-load_policy - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sestatus $(1)/usr/sbin/policycoreutils-sestatus - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/setsebool $(1)/usr/sbin/policycoreutils-setsebool - $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +DEPENDS_genhomedircon:=+libsemanage $(INTL_DEPENDS) +DEPENDS_load_policy:=+libselinux $(INTL_DEPENDS) +DEPENDS_newrole:=+libselinux +libaudit +BUSYBOX_CONFIG_PAM:libpam $(INTL_DEPENDS) +DEPENDS_open_init_pty:=$(INTL_DEPENDS) +DEPENDS_pp:=+libsepol $(INTL_DEPENDS) +DEPENDS_restorecon_xattr:=+libselinux +libsepol +libaudit $(INTL_DEPENDS) +DEPENDS_restorecon:=+libselinux +libsepol +libaudit $(INTL_DEPENDS) +DEPENDS_run_init:=+libselinux +libaudit +BUSYBOX_CONFIG_PAM:libpam $(INTL_DEPENDS) +DEPENDS_secon:=+libselinux $(INTL_DEPENDS) +DEPENDS_semanage:=+libsemanage +DEPENDS_semodule:=+libsemanage $(INTL_DEPENDS) +DEPENDS_sestatus:=+libselinux $(INTL_DEPENDS) +DEPENDS_setfiles:=+libselinux +libsepol +libaudit $(INTL_DEPENDS) +DEPENDS_setsebool:=+libsemanage $(INTL_DEPENDS) + +define Package/policycoreutils/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=SELinux policy utility + URL:=http://selinuxproject.org/page/Main_Page +endef + +define Package/policycoreutils + $(call Package/policycoreutils/Default) + MENU:=1 + TITLE+= common files +endef + +define GenUtilPkg + define Package/$(1) + $(call Package/policycoreutils/Default) + DEPENDS+= policycoreutils $(DEPENDS_$(2)) + TITLE+= $(2) + ALTERNATIVES:=$(ALTS_$(2)) + endef + + define Package/$(1)/description +Policycoreutils is a collection of policy utilities +(originally the "core" set of utilities needed to use +SELinux, although it has grown a bit over time). + +This package provides the $(2) utility. + endef +endef + +$(foreach a,$(LIBEXEC_UTILS) $(SBIN_UTILS) $(USR_BIN_UTILS) $(USR_SBIN_UTILS),$(eval $(call GenUtilPkg,policycoreutils-$(a),$(a)))) + +define Package/policycoreutils/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/sestatus.conf $(1)/etc +ifdef CONFIG_BUSYBOX_CONFIG_PAM + $(INSTALL_DIR) $(1)/etc/pam.d + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/pam.d/run_init $(1)/etc/pam.d + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/pam.d/newrole $(1)/etc/pam.d +endif +endef + +define BuildUtil + define Package/$(1)/install + $(INSTALL_DIR) $$(1)$(2) + $(INSTALL_BIN) $$(PKG_INSTALL_DIR)$(2)/$(3) $$(1)$(2) + endef + + $$(eval $$(call BuildPackage,$(1))) endef -$(eval $(call HostBuild)) $(eval $(call BuildPackage,policycoreutils)) +$(foreach a,$(SBIN_UTILS),$(eval $(call BuildUtil,policycoreutils-$(a),/sbin,$(a)))) +$(foreach a,$(USR_BIN_UTILS),$(eval $(call BuildUtil,policycoreutils-$(a),/usr/bin,$(a)))) +$(foreach a,$(USR_SBIN_UTILS),$(eval $(call BuildUtil,policycoreutils-$(a),/usr/sbin,$(a)))) +$(foreach a,$(LIBEXEC_UTILS),$(eval $(call BuildUtil,policycoreutils-$(a),/usr/libexec/selinux/hll,$(a)))) +$(eval $(call HostBuild)) From 82f429d24f815e8138039cdcc929da06601215ff Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 21 Sep 2020 18:51:37 +0100 Subject: [PATCH 07/21] policycoreutils: fix ALTERNATIVES install location Fixes: 7817c831ef ("policycoreutils: break into smaller packages") Signed-off-by: Daniel Golle --- package/utils/policycoreutils/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/utils/policycoreutils/Makefile b/package/utils/policycoreutils/Makefile index 3fd0e39081..03b3fd4879 100644 --- a/package/utils/policycoreutils/Makefile +++ b/package/utils/policycoreutils/Makefile @@ -135,7 +135,7 @@ endef define BuildUtil define Package/$(1)/install $(INSTALL_DIR) $$(1)$(2) - $(INSTALL_BIN) $$(PKG_INSTALL_DIR)$(2)/$(3) $$(1)$(2) + $(INSTALL_BIN) $$(PKG_INSTALL_DIR)$(2)/$(3) $$(1)$(2)/$(if $(ALTS_$(3)),policycoreutils-$(3),$(3)) endef $$(eval $$(call BuildPackage,$(1))) From 318a03fe11d24938ae6abbed9e53e02104232cc1 Mon Sep 17 00:00:00 2001 From: Stijn Segers Date: Sun, 20 Sep 2020 23:03:32 +0200 Subject: [PATCH 08/21] odhcpd: number UCI defaults script UCI defaults scripts are supposed to be numbered, but odhcpd's lacked numbering, which turned out to mess up my custom scripts numbered 9[0-9]_*. The idea is to have high number (custom) scripts executed last. Jow confirmed numbering is the default case, not the exception (thanks). Signed-off-by: Stijn Segers --- package/network/services/odhcpd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index d3e131caec..62dd53774d 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -100,7 +100,7 @@ define Package/odhcpd/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/odhcpd.init $(1)/etc/init.d/odhcpd $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) ./files/odhcpd.defaults $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/odhcpd.defaults $(1)/etc/uci-defaults/15_odhcpd endef Package/odhcpd-ipv6only/install = $(Package/odhcpd/install) From d5a3329fba35b041f56334740cb3392b51e95d89 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 14 Sep 2020 21:55:01 +0200 Subject: [PATCH 09/21] vxlan: add extra config options Add config options: srcportmin/srcportmax : range of port numbers to use as UDP source ports to communicate to the remote VXLAN tunnel endpoint ageing : lifetime in seconds of FDB entries learnt by the kernel maxaddress : maximum number of FDB entries learning : enable/disable entering unknown source link layer addresses and IP addresses into the VXLAN device FDB. rsc : enable/disable route short circuit proxy : enable/disable ARP proxy l2miss : enable/disable netlink LLADDR miss notifications l3miss : enable/disable netlink IP ADDR miss notifications gbp : enable/disable the Group Policy extension Signed-off-by: Hans Dedecker --- package/network/config/vxlan/Makefile | 2 +- package/network/config/vxlan/files/vxlan.sh | 26 +++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/package/network/config/vxlan/Makefile b/package/network/config/vxlan/Makefile index 00754c4218..9e79b069b2 100644 --- a/package/network/config/vxlan/Makefile +++ b/package/network/config/vxlan/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=vxlan -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/vxlan/files/vxlan.sh b/package/network/config/vxlan/files/vxlan.sh index d063c47d47..8b3a0a53d4 100755 --- a/package/network/config/vxlan/files/vxlan.sh +++ b/package/network/config/vxlan/files/vxlan.sh @@ -59,8 +59,8 @@ vxlan_generic_setup() { local link="$cfg" - local port vid ttl tos mtu macaddr zone rxcsum txcsum - json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum + local port vid ttl tos mtu macaddr zone rxcsum txcsum srcportmin srcportmax ageing maxaddress learning proxy l2miss l3miss gbp + json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum srcportmin srcportmax ageing maxaddress learning proxy l2miss l3miss gbp proto_init_update "$link" 1 @@ -78,9 +78,20 @@ vxlan_generic_setup() { json_add_object 'data' [ -n "$port" ] && json_add_int port "$port" [ -n "$vid" ] && json_add_int id "$vid" + [ -n "$srcportmin" ] && json_add_int srcportmin "$srcportmin" + [ -n "$srcportmax" ] && json_add_int srcportmax "$srcportmax" + [ -n "$ageing" ] && json_add_int ageing "$ageing" + [ -n "$maxaddress" ] && json_add_int maxaddress "$maxaddress" [ -n "$macaddr" ] && json_add_string macaddr "$macaddr" [ -n "$rxcsum" ] && json_add_boolean rxcsum "$rxcsum" [ -n "$txcsum" ] && json_add_boolean txcsum "$txcsum" + [ -n "$learning" ] && json_add_boolean learning "$learning" + [ -n "$rsc" ] && json_add_boolean rsc "$rsc" + [ -n "$proxy" ] && json_add_boolean proxy "$proxy" + [ -n "$l2miss" ] && json_add_boolean l2miss "$l2miss" + [ -n "$l3miss" ] && json_add_boolean l3miss "$l3miss" + [ -n "$gbp" ] && json_add_boolean gbp "$gbp" + json_close_object proto_close_tunnel @@ -163,9 +174,20 @@ vxlan_generic_init_config() { proto_config_add_int "ttl" proto_config_add_int "tos" proto_config_add_int "mtu" + proto_config_add_int "srcportmin" + proto_config_add_int "srcportmax" + proto_config_add_int "ageing" + proto_config_add_int "maxaddress" proto_config_add_boolean "rxcsum" proto_config_add_boolean "txcsum" + proto_config_add_boolean "learning" + proto_config_add_boolean "rsc" + proto_config_add_boolean "proxy" + proto_config_add_boolean "l2miss" + proto_config_add_boolean "l3miss" + proto_config_add_boolean "gbp" proto_config_add_string "macaddr" + } proto_vxlan_init_config() { From 911cb34aec5b4f23617c09ddfab0a05243132bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=94=B2=E5=93=A5?= Date: Wed, 23 Sep 2020 14:35:56 +0800 Subject: [PATCH 10/21] update n2n 2.8 to latest commit --- package/lean/n2n_v2/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/lean/n2n_v2/Makefile b/package/lean/n2n_v2/Makefile index b7b090b000..29da7ec64d 100644 --- a/package/lean/n2n_v2/Makefile +++ b/package/lean/n2n_v2/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=n2n PKG_SOURCE_URL:=https://github.com/ntop/n2n.git -PKG_SOURCE_VERSION:=3c983286184ebf2e06db6ccfb3223ea9430c216b +PKG_SOURCE_VERSION:=99e56e9f3c34c49eeb297971d41150b433489120 PKG_VERSION:=2.8.0_git-$(PKG_SOURCE_VERSION) PKG_RELEASE:=1 From 759b1497ca70e279acc65c70da047f69b7b9e42d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 18 Sep 2020 08:53:31 +0200 Subject: [PATCH 11/21] Revert "ramips: ethernet: fix to interrupt handling" This reverts commit 7ac454014a11347887323a131415ac7032d53546. The change reportedly causes regressions in ethernet performance. Fixes: FS#3332 Signed-off-by: Jo-Philipp Wich --- .../drivers/net/ethernet/mediatek/mtk_eth_soc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 3bb8f7800a..d17a38eab7 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -879,8 +879,6 @@ static int fe_poll_rx(struct napi_struct *napi, int budget, struct fe_rx_dma *rxd, trxd; int done = 0, pad; - fe_reg_w32(rx_intr, FE_REG_FE_INT_STATUS); - if (netdev->features & NETIF_F_RXCSUM) checksum_bit = soc->checksum_bit; else @@ -973,6 +971,9 @@ release_desc: done++; } + if (done < budget) + fe_reg_w32(rx_intr, FE_REG_FE_INT_STATUS); + return done; } @@ -988,8 +989,6 @@ static int fe_poll_tx(struct fe_priv *priv, int budget, u32 tx_intr, u32 idx, hwidx; struct fe_tx_ring *ring = &priv->tx_ring; - fe_reg_w32(tx_intr, FE_REG_FE_INT_STATUS); - idx = ring->tx_free_idx; hwidx = fe_reg_r32(FE_REG_TX_DTX_IDX0); @@ -1013,7 +1012,9 @@ static int fe_poll_tx(struct fe_priv *priv, int budget, u32 tx_intr, if (idx == hwidx) { /* read hw index again make sure no new tx packet */ hwidx = fe_reg_r32(FE_REG_TX_DTX_IDX0); - if (idx != hwidx) + if (idx == hwidx) + fe_reg_w32(tx_intr, FE_REG_FE_INT_STATUS); + else *tx_again = 1; } else { *tx_again = 1; From ad8b64d1978903751166747e2d9f068274e23190 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Thu, 24 Sep 2020 22:04:39 +0200 Subject: [PATCH 12/21] vxlan: fix rsc config option Fix route short circuit config option; fixes commit 036221ce5a899eb99ef1c1623fc9460af00a69e7 Signed-off-by: Hans Dedecker --- package/network/config/vxlan/Makefile | 2 +- package/network/config/vxlan/files/vxlan.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/vxlan/Makefile b/package/network/config/vxlan/Makefile index 9e79b069b2..47ea50cdf2 100644 --- a/package/network/config/vxlan/Makefile +++ b/package/network/config/vxlan/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=vxlan -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/vxlan/files/vxlan.sh b/package/network/config/vxlan/files/vxlan.sh index 8b3a0a53d4..5c1c484c47 100755 --- a/package/network/config/vxlan/files/vxlan.sh +++ b/package/network/config/vxlan/files/vxlan.sh @@ -59,8 +59,8 @@ vxlan_generic_setup() { local link="$cfg" - local port vid ttl tos mtu macaddr zone rxcsum txcsum srcportmin srcportmax ageing maxaddress learning proxy l2miss l3miss gbp - json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum srcportmin srcportmax ageing maxaddress learning proxy l2miss l3miss gbp + local port vid ttl tos mtu macaddr zone rxcsum txcsum srcportmin srcportmax ageing maxaddress learning rsc proxy l2miss l3miss gbp + json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum srcportmin srcportmax ageing maxaddress learning rsc proxy l2miss l3miss gbp proto_init_update "$link" 1 From b913d1908a5db44a1a5df1b90da2df63607816b4 Mon Sep 17 00:00:00 2001 From: "W. Michael Petullo" Date: Wed, 23 Sep 2020 21:42:00 -0500 Subject: [PATCH 13/21] dnsmasq: support tftp_unique_root in /etc/config/dhcp The TFTP server provided by dnsmasq supports serving a select boot image based on the client's MAC or IP address. This allows an administrator to activate this feature in /etc/config/dhcp. Here is an example /etc/config/dhcp that configures dnsmasq with --tftp-unique-root=mac. With this configuration, dnsmasq will serve /usr/libexec/tftpboot/00-11-22-33-44-55/openwrt-initramfs-kernel.bin to the client with MAC address 00:11:22:33:44:55. Signed-off-by: W. Michael Petullo --- package/network/services/dnsmasq/Makefile | 2 +- package/network/services/dnsmasq/files/dnsmasq.init | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 059481b185..407a292f6d 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.82 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 20fcdcf05e..83577e7cf3 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -908,6 +908,7 @@ dnsmasq_start() append_parm "$cfg" "min_cache_ttl" "--min-cache-ttl" append_parm "$cfg" "max_cache_ttl" "--max-cache-ttl" append_parm "$cfg" "pxe_prompt" "--pxe-prompt" + append_parm "$cfg" "tftp_unique_root" "--tftp-unique-root" config_list_foreach "$cfg" "pxe_service" append_pxe_service config_get DOMAIN "$cfg" domain From eccc14ce8457dc38a29ded76624ce11a1b7839c5 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Fri, 25 Sep 2020 10:28:19 +0800 Subject: [PATCH 14/21] dnsmasq: fix handling ignore condition for dnssec It should return false to indicate that the option should not be ignored Fixes 064dc1e8 ("dnsmasq: abort when dnssec requested but not available") Reported-by: Sami Olmari Signed-off-by: Yousong Zhou --- package/network/services/dnsmasq/Makefile | 2 +- package/network/services/dnsmasq/files/dnsmasq.init | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 407a292f6d..46995cabaa 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.82 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 83577e7cf3..9ed5497ba5 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -48,6 +48,7 @@ dnsmasq_ignore_opt() { echo "dnsmasq: \"$opt\" requested, but dnssec support is not available" >&2 exit 1 fi + return 1 ;; tftp-*) [ -z "$dnsmasq_has_tftp" ] ;; From 017ab13258daf5bb522994cd44dd1c950175632a Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 29 Aug 2020 22:48:49 +0200 Subject: [PATCH 15/21] scripts: mkits.sh make it possible to specify fdt@# Some bootloaders are really keen on just one special fdt in a multi-image fit image. This is a problem, because currently this is fixed to "fdt@1". This patch introduces a new device variable: DEVICE_FDT_NUM that allows to specify the right fdt number. If the value is absent "1" will be chosen. Signed-off-by: Christian Lamparter --- include/image-commands.mk | 1 + include/image.mk | 7 ++++--- scripts/mkits.sh | 12 ++++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index 67e82bc4d1..b394a8153e 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -158,6 +158,7 @@ define Build/fit -D $(DEVICE_NAME) -o $@.its -k $@ \ $(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \ -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + $(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \ -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \ -A $(LINUX_KARCH) -v $(LINUX_VERSION) PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new diff --git a/include/image.mk b/include/image.mk index 9d39e71ca5..814aef4bff 100644 --- a/include/image.mk +++ b/include/image.mk @@ -432,6 +432,7 @@ define Device/Init DEVICE_DTS := DEVICE_DTS_CONFIG := DEVICE_DTS_DIR := + DEVICE_FDT_NUM := SOC := BOARD_NAME := @@ -450,9 +451,9 @@ DEFAULT_DEVICE_VARS := \ DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_INITRAMFS_IMAGE KERNEL_SIZE \ CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI BLOCKSIZE PAGESIZE SUBPAGESIZE \ VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTS \ - DEVICE_DTS_CONFIG DEVICE_DTS_DIR SOC BOARD_NAME UIMAGE_NAME SUPPORTED_DEVICES \ - IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH IMAGE_SIZE \ - DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \ + DEVICE_DTS_CONFIG DEVICE_DTS_DIR DEVICE_FDT_NUM SOC BOARD_NAME UIMAGE_NAME \ + SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH \ + IMAGE_SIZE DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \ DEVICE_ALT0_VENDOR DEVICE_ALT0_MODEL DEVICE_ALT0_VARIANT \ DEVICE_ALT1_VENDOR DEVICE_ALT1_MODEL DEVICE_ALT1_VARIANT \ DEVICE_ALT2_VENDOR DEVICE_ALT2_MODEL DEVICE_ALT2_VARIANT diff --git a/scripts/mkits.sh b/scripts/mkits.sh index 468ef670e6..bb629d6fca 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -16,7 +16,7 @@ usage() { printf "Usage: %s -A arch -C comp -a addr -e entry" "$(basename "$0")" - printf " -v version -k kernel [-D name -d dtb] -o its_file" + printf " -v version -k kernel [-D name -n address -d dtb] -o its_file" printf "\n\t-A ==> set architecture to 'arch'" printf "\n\t-C ==> set compression type 'comp'" @@ -26,12 +26,15 @@ usage() { printf "\n\t-v ==> set kernel version to 'version'" printf "\n\t-k ==> include kernel image 'kernel'" printf "\n\t-D ==> human friendly Device Tree Blob 'name'" + printf "\n\t-n ==> fdt unit-address 'address'" printf "\n\t-d ==> include Device Tree Blob 'dtb'" printf "\n\t-o ==> create output file 'its_file'\n" exit 1 } -while getopts ":A:a:c:C:D:d:e:k:o:v:" OPTION +FDTNUM=1 + +while getopts ":A:a:c:C:D:d:e:k:n:o:v:" OPTION do case $OPTION in A ) ARCH=$OPTARG;; @@ -42,6 +45,7 @@ do d ) DTB=$OPTARG;; e ) ENTRY_ADDR=$OPTARG;; k ) KERNEL=$OPTARG;; + n ) FDTNUM=$OPTARG;; o ) OUTPUT=$OPTARG;; v ) VERSION=$OPTARG;; * ) echo "Invalid option passed to '$0' (options:$*)" @@ -61,7 +65,7 @@ ARCH_UPPER=$(echo "$ARCH" | tr '[:lower:]' '[:upper:]') # Conditionally create fdt information if [ -n "${DTB}" ]; then FDT_NODE=" - fdt@1 { + fdt@$FDTNUM { description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree blob\"; data = /incbin/(\"${DTB}\"); type = \"flat_dt\"; @@ -75,7 +79,7 @@ if [ -n "${DTB}" ]; then }; }; " - FDT_PROP="fdt = \"fdt@1\";" + FDT_PROP="fdt = \"fdt@$FDTNUM\";" fi # Create a default, fully populated DTS file From df3e28c485cb149fc4be36d585f21bca8a3ea055 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 29 Aug 2020 23:07:28 +0200 Subject: [PATCH 16/21] build: define PWM_SUPPORT arch feature flag As the PWM has its own sub-system in the Linux kernel, I think it should be handled in the same way as GPIO, RTC, PCI... This patch introduces a specific feature flag "pwm" and the "leds-pwm" kernel module as the first customer. Signed-off-by: Christian Lamparter --- package/kernel/linux/modules/leds.mk | 16 ++++++++++++++++ scripts/target-metadata.pl | 1 + target/Config.in | 3 +++ 3 files changed, 20 insertions(+) diff --git a/package/kernel/linux/modules/leds.mk b/package/kernel/linux/modules/leds.mk index c030b54b39..fe90c6b559 100644 --- a/package/kernel/linux/modules/leds.mk +++ b/package/kernel/linux/modules/leds.mk @@ -159,3 +159,19 @@ define KernelPackage/leds-pca963x/description endef $(eval $(call KernelPackage,leds-pca963x)) + + +define KernelPackage/leds-pwm + SUBMENU:=$(LEDS_MENU) + TITLE:=PWM driven LED Support + KCONFIG:=CONFIG_LEDS_PWM + DEPENDS:= @PWM_SUPPORT + FILES:=$(LINUX_DIR)/drivers/leds/leds-pwm.ko + AUTOLOAD:=$(call AutoLoad,60,leds-pwm,1) +endef + +define KernelPackage/leds-pwm/description + This option enables support for pwm driven LEDs +endef + +$(eval $(call KernelPackage,leds-pwm)) diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index 5414995648..d880abef98 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -20,6 +20,7 @@ sub target_config_features(@) { /^usb$/ and $ret .= "\tselect USB_SUPPORT\n"; /^usbgadget$/ and $ret .= "\tselect USB_GADGET_SUPPORT\n"; /^pcmcia$/ and $ret .= "\tselect PCMCIA_SUPPORT\n"; + /^pwm$/ and $ret .= "\select PWM_SUPPORT\n"; /^rtc$/ and $ret .= "\tselect RTC_SUPPORT\n"; /^squashfs$/ and $ret .= "\tselect USES_SQUASHFS\n"; /^jffs2$/ and $ret .= "\tselect USES_JFFS2\n"; diff --git a/target/Config.in b/target/Config.in index 3cf4231f2a..68786ab007 100644 --- a/target/Config.in +++ b/target/Config.in @@ -26,6 +26,9 @@ config PCIE_SUPPORT config PCMCIA_SUPPORT bool +config PWM_SUPPORT + bool + config USB_SUPPORT select AUDIO_SUPPORT bool From 5cc4a3de812917225d7a53b9597ce4ba110b0b20 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Fri, 25 Sep 2020 19:02:09 +0200 Subject: [PATCH 17/21] ipq40xx: fix DTS warning in qcom-ipq4029-gl-s1300.dts .dts:226.17-230.4: Warning (spi_bus_reg): /soc/spi@78b6000/spi@1: SPI bus unit address format error, expected "0" Signed-off-by: Christian Lamparter --- .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts index cc3a19b483..56ca063b74 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts @@ -223,7 +223,7 @@ pinctrl-names = "default"; status = "okay"; - spidev1: spi@1 { + spidev1: spi@0 { compatible = "siliconlabs,si3210"; reg = <0>; spi-max-frequency = <24000000>; From 6c72d901cecd577396a61560d195b10b200f5028 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 27 Sep 2020 17:10:34 +0100 Subject: [PATCH 18/21] policycoreutils: fix host utils rpath and bin directory 'setfiles' and others should be installed to $(STAGING_DIR_HOSTPKG)/bin rather than $(...)/sbin which isn't in PATH. Also using -Wl,-rpath to set library search location instead of setting LD_LIBRARY_PATH when calling setfiles in image.mk. Signed-off-by: Daniel Golle --- include/image.mk | 3 +-- package/utils/policycoreutils/Makefile | 10 ++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/image.mk b/include/image.mk index 814aef4bff..ce6d5296e4 100644 --- a/include/image.mk +++ b/include/image.mk @@ -243,8 +243,7 @@ endef ifeq ($(CONFIG_TARGET_ROOTFS_SECURITY_LABELS),y) define Image/mkfs/squashfs - echo "LD_LIBRARY_PATH=\$$LD_LIBRARY_PATH:$(STAGING_DIR_HOSTPKG)/lib" \ - "$(STAGING_DIR_HOSTPKG)/sbin/setfiles -r" \ + echo "$(STAGING_DIR_HOSTPKG)/bin/setfiles -r" \ "$(call mkfs_target_dir,$(1))" \ "$(call mkfs_target_dir,$(1))/etc/selinux/targeted/contexts/files/file_contexts " \ "$(call mkfs_target_dir,$(1))" > $@.fakeroot-script diff --git a/package/utils/policycoreutils/Makefile b/package/utils/policycoreutils/Makefile index 03b3fd4879..6b7b78ed78 100644 --- a/package/utils/policycoreutils/Makefile +++ b/package/utils/policycoreutils/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=policycoreutils PKG_VERSION:=3.1 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/20200710 @@ -67,9 +67,11 @@ MAKE_FLAGS += \ HOST_MAKE_FLAGS += \ PAMH=$(CONFIG_BUSYBOX_CONFIG_PAM) \ - PREFIX=$(STAGING_DIR_HOSTPKG) \ - SBINDIR=$(STAGING_DIR_HOSTPKG)/sbin \ - ETCDIR=$(STAGING_DIR_HOSTPKG)/etc + DESTDIR=$(STAGING_DIR_HOSTPKG) \ + PREFIX= \ + SBINDIR=/bin + +HOST_LDFLAGS += -Wl,-rpath=$(STAGING_DIR_HOSTPKG)/lib $(eval $(foreach a,$(DIR_SBIN),ALTS_$(a):=300:/sbin/$(a):/sbin/policycoreutils-$(a)$(newline))) $(eval $(foreach a,$(DIR_USR_BIN),ALTS_$(a):=300:/usr/bin/$(a):/usr/bin/policycoreutils-$(a)$(newline))) From bcf34aea008a6e9e4bdbccc597da4fe5b16c9557 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 27 Sep 2020 17:21:23 +0100 Subject: [PATCH 19/21] libsepol: break out chkcon utility Signed-off-by: Daniel Golle --- package/libs/libsepol/Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/package/libs/libsepol/Makefile b/package/libs/libsepol/Makefile index 2a6bd46ad0..8ceb7164a7 100644 --- a/package/libs/libsepol/Makefile +++ b/package/libs/libsepol/Makefile @@ -30,6 +30,18 @@ define Package/libsepol/description depend upon or use any of the other SELinux components. endef +define Package/chkcon + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libsepol + TITLE:=libsepol chkcon security context validation tool + URL:=http://selinuxproject.org/page/Main_Page +endef + +define Package/chkcon/description + chkcon - determine if a security context is valid for a given binary policy +endef + HOST_MAKE_FLAGS += \ PREFIX=$(STAGING_DIR_HOSTPKG) \ SHLIBDIR=$(STAGING_DIR_HOSTPKG)/lib @@ -62,5 +74,11 @@ define Package/libsepol/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsepol.so.* $(1)/usr/lib/ endef +define Package/chkcon/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chkcon $(1)/usr/bin/ +endef + $(eval $(call HostBuild)) $(eval $(call BuildPackage,libsepol)) +$(eval $(call BuildPackage,chkcon)) From ddcf55718e6e58dd5a3bea94c28133809548885d Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Wed, 25 Mar 2020 00:02:08 +0100 Subject: [PATCH 20/21] target.mk: enable iwinfo by default with any wpad variant There are currently several variants of 'wpad' package but the 'iwinfo' is included by default only if 'wpad', 'wpad-{basic*,mini}' or 'nas' packages are included in {DEVICE,DEFAULT}_PACKAGES. Use 'wpad-*' pattern to include 'iwinfo' with any 'wpad' variant. Signed-off-by: Piotr Dymacz --- include/target.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/target.mk b/include/target.mk index 6e63afad9d..840c4e10de 100644 --- a/include/target.mk +++ b/include/target.mk @@ -61,7 +61,7 @@ endif DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE)) filter_packages = $(filter-out -% $(patsubst -%,%,$(filter -%,$(1))),$(1)) -extra_packages = $(if $(filter wpad-mini wpad-basic wpad-basic-wolfssl wpad nas,$(1)),iwinfo) +extra_packages = $(if $(filter wpad wpad-% nas,$(1)),iwinfo) define ProfileDefault NAME:= From a66bea85390e229baa77bd18cbcebc0c9456af55 Mon Sep 17 00:00:00 2001 From: Chen Minqiang Date: Wed, 6 Nov 2019 22:30:12 +0800 Subject: [PATCH 21/21] ramips: thunder_timecloud support sdcard --- target/linux/ramips/image/mt7621.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 44e9de490c..0c7faefa73 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -755,7 +755,7 @@ define Device/thunder_timecloud IMAGE_SIZE := 16064k DEVICE_VENDOR := Thunder DEVICE_MODEL := Timecloud - DEVICE_PACKAGES := kmod-usb3 + DEVICE_PACKAGES := kmod-usb3 kmod-sdhci-mt7620 SUPPORTED_DEVICES += timecloud endef TARGET_DEVICES += thunder_timecloud