diff --git a/include/download.mk b/include/download.mk index 609956b004..76bd374cf7 100644 --- a/include/download.mk +++ b/include/download.mk @@ -59,6 +59,21 @@ define dl_tar_pack $$$${TAR_TIMESTAMP:+--mtime="$$$$TAR_TIMESTAMP"} -c $(2) | $(call dl_pack,$(1)) endef +gen_sha256sum = $(shell $(MKHASH) sha256 $(DL_DIR)/$(1)) + +# Used in Build/CoreTargets and HostBuild/Core as an integrity check for +# downloaded files. It will add a FORCE rule if the sha256 hash does not +# match, so that the download can be more thoroughly handled by download.pl. +define check_download_integrity + expected_hash:=$(strip $(if $(filter-out x,$(HASH)),$(HASH),$(MIRROR_HASH))) + $$(if $$(and $(FILE),$$(wildcard $(DL_DIR)/$(FILE)), \ + $$(filter undefined,$$(flavor DownloadChecked/$(FILE)))), \ + $$(eval DownloadChecked/$(FILE):=1) \ + $$(if $$(filter-out $$(call gen_sha256sum,$(FILE)),$$(expected_hash)), \ + $(DL_DIR)/$(FILE): FORCE) \ + ) +endef + ifdef CHECK check_escape=$(subst ','\'',$(1)) #') @@ -74,8 +89,6 @@ else check_warn = $(if $(filter-out undefined,$(origin F_$(1))),$(filter ,$(shell $(call F_$(1),$(2),$(3),$(4)) >&2)),$(check_warn_nofix)) endif -gen_sha256sum = $(shell $(MKHASH) sha256 $(DL_DIR)/$(1)) - ifdef FIXUP F_hash_deprecated = $(SCRIPT_DIR)/fixup-makefile.pl $(CURDIR)/Makefile fix-hash $(3) $(call gen_sha256sum,$(1)) $(2) F_hash_mismatch = $(F_hash_deprecated) diff --git a/include/host-build.mk b/include/host-build.mk index e4a5c48e72..cfa29419aa 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -180,7 +180,7 @@ ifndef DUMP clean-build: host-clean-build endif - $(DL_DIR)/$(FILE): FORCE + $(call check_download_integrity) $(_host_target)host-prepare: $(HOST_STAMP_PREPARED) $(_host_target)host-configure: $(HOST_STAMP_CONFIGURED) diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index bfa6a5ed94..d5dc63e4ce 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -128,6 +128,10 @@ endef define Kernel/CompileModules/Default rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules + # If .config did not change, use the previous timestamp to avoid package rebuilds + cmp -s $(LINUX_DIR)/.config $(LINUX_DIR)/.config.modules.save && \ + mv $(LINUX_DIR)/.config.modules.save $(LINUX_DIR)/.config; \ + $(CP) $(LINUX_DIR)/.config $(LINUX_DIR)/.config.modules.save endef OBJCOPY_STRIP = -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id diff --git a/include/package-bin.mk b/include/package-bin.mk index 192f0726d2..4ca49218e9 100644 --- a/include/package-bin.mk +++ b/include/package-bin.mk @@ -4,7 +4,8 @@ ifeq ($(DUMP),) define BuildTarget/bin - ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT)) + TARGET_VARIANT=$(if $(ALL_VARIANTS),$(if $(VARIANT),$(filter-out *,$(VARIANT)),$(firstword $(ALL_VARIANTS)))) + ifeq ($(if $(TARGET_VARIANT),$(BUILD_VARIANT)),$(TARGET_VARIANT)) ifdef Package/$(1)/install ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),) $(_pkg_target)compile: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index 19f09c2311..362a0e2a8b 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -105,7 +105,8 @@ ifeq ($(DUMP),) IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1) KEEP_$(1):=$(strip $(call Package/$(1)/conffiles)) - ifeq ($(BUILD_VARIANT),$$(if $$(VARIANT),$$(VARIANT),$(BUILD_VARIANT))) + TARGET_VARIANT:=$$(if $(ALL_VARIANTS),$$(if $$(VARIANT),$$(filter-out *,$$(VARIANT)),$(firstword $(ALL_VARIANTS)))) + ifeq ($(BUILD_VARIANT),$$(if $$(TARGET_VARIANT),$$(TARGET_VARIANT),$(BUILD_VARIANT))) do_install= ifdef Package/$(1)/install do_install=yes diff --git a/include/package.mk b/include/package.mk index fc1bb7d67e..92b8ef580b 100644 --- a/include/package.mk +++ b/include/package.mk @@ -183,7 +183,7 @@ define Build/CoreTargets $(call Build/Autoclean) $(call DefaultTargets) - $(DL_DIR)/$(FILE): FORCE + $(call check_download_integrity) download: $(foreach hook,$(Hooks/Download), diff --git a/include/subdir.mk b/include/subdir.mk index be080859b7..95009f814e 100644 --- a/include/subdir.mk +++ b/include/subdir.mk @@ -27,14 +27,16 @@ lastdir=$(word $(words $(subst /, ,$(1))),$(subst /, ,$(1))) diralias=$(if $(findstring $(1),$(call lastdir,$(1))),,$(call lastdir,$(1))) subdir_make_opts = \ - -r -C $(1) \ + $(if $(SUBDIR_MAKE_DEBUG),-d) -r -C $(1) \ BUILD_SUBDIR="$(1)" \ - BUILD_VARIANT="$(4)" + BUILD_VARIANT="$(4)" \ + ALL_VARIANTS="$(5)" # 1: subdir # 2: target # 3: build type # 4: build variant +# 5: all variants log_make = \ $(if $(call debug,$(1),v),,@)+ \ $(if $(BUILD_LOG), \ @@ -62,15 +64,15 @@ define subdir $(foreach target,$(SUBTARGETS) $($(1)/subtargets), $(foreach btype,$(buildtypes-$(bd)), $(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(btype)/$(target): $(if $(NO_DEPS)$(QUILT),,$($(1)/$(bd)/$(btype)/$(target)) $(call $(1)//$(btype)/$(target),$(1)/$(bd)/$(btype)))) - $(call log_make,$(1)/$(bd),$(target),$(btype),$(filter-out __default,$(variant))) \ + $(call log_make,$(1)/$(bd),$(target),$(btype),$(filter-out __default,$(variant)),$($(1)/$(bd)/variants)) \ || $(call ERROR,$(2), ERROR: $(1)/$(bd) [$(btype)] failed to build.,$(findstring $(bd),$($(1)/builddirs-ignore-$(btype)-$(target)))) $(if $(call diralias,$(bd)),$(call warn_eval,$(1)/$(bd),l,T,$(1)/$(call diralias,$(bd))/$(btype)/$(target): $(1)/$(bd)/$(btype)/$(target))) ) $(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(target): $(if $(NO_DEPS)$(QUILT),,$($(1)/$(bd)/$(target)) $(call $(1)//$(target),$(1)/$(bd)))) - $(foreach variant,$(if $(BUILD_VARIANT),$(BUILD_VARIANT),$(if $(strip $($(1)/$(bd)/variants)),$($(1)/$(bd)/variants),$(if $($(1)/$(bd)/default-variant),$($(1)/$(bd)/default-variant),__default))), + $(foreach variant,$(filter-out *,$(if $(BUILD_VARIANT),$(BUILD_VARIANT),$(if $(strip $($(1)/$(bd)/variants)),$($(1)/$(bd)/variants),$(if $($(1)/$(bd)/default-variant),$($(1)/$(bd)/default-variant),__default)))), $(if $(BUILD_LOG),@mkdir -p $(BUILD_LOG_DIR)/$(1)/$(bd)/$(filter-out __default,$(variant))) - $(if $($(1)/autoremove),$(call rebuild_check,$(1)/$(bd),$(target),,$(filter-out __default,$(variant)))) - $(call log_make,$(1)/$(bd),$(target),,$(filter-out __default,$(variant))) \ + $(if $($(1)/autoremove),$(call rebuild_check,$(1)/$(bd),$(target),,$(filter-out __default,$(variant)),$($(1)/$(bd)/variants))) + $(call log_make,$(1)/$(bd),$(target),,$(filter-out __default,$(variant)),$($(1)/$(bd)/variants)) \ || $(call ERROR,$(1), ERROR: $(1)/$(bd) failed to build$(if $(filter-out __default,$(variant)), (build variant: $(variant))).,$(findstring $(bd),$($(1)/builddirs-ignore-$(target)))) ) $(if $(PREREQ_ONLY)$(DUMP_TARGET_DB),, diff --git a/include/target.mk b/include/target.mk index 4a09e63bb6..fca015955e 100644 --- a/include/target.mk +++ b/include/target.mk @@ -59,7 +59,8 @@ DEFAULT_PACKAGES.tweak:=\ luci-app-cpufreq \ luci-app-filetransfer \ luci-app-turboacc \ - luci-lib-fs + luci-lib-fs \ + luci-lib-ipkg ifneq ($(DUMP),) all: dumpinfo diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 4727a51553..227f48de8a 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -423,6 +423,7 @@ define Package/hostapd-utils TITLE:=IEEE 802.1x Authenticator (utils) URL:=http://hostap.epitest.fi/ DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(HOSTAPD_PROVIDERS),PACKAGE_$(pkg))) + VARIANT:=* endef define Package/hostapd-utils/description @@ -436,6 +437,7 @@ define Package/wpa-cli SUBMENU:=WirelessAPD DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(SUPPLICANT_PROVIDERS),PACKAGE_$(pkg))) TITLE:=WPA Supplicant command line control utility + VARIANT:=* endef define Package/eapol-test/Default @@ -672,6 +674,9 @@ ifeq ($(BUILD_VARIANT),supplicant-full-wolfssl) endef endif +# Build hostapd-common before its dependents, to avoid +# spurious rebuilds when building multiple variants. +$(eval $(call BuildPackage,hostapd-common)) $(eval $(call BuildPackage,hostapd)) $(eval $(call BuildPackage,hostapd-basic)) $(eval $(call BuildPackage,hostapd-basic-openssl)) @@ -698,7 +703,6 @@ $(eval $(call BuildPackage,wpa-supplicant-openssl)) $(eval $(call BuildPackage,wpa-supplicant-wolfssl)) $(eval $(call BuildPackage,wpa-cli)) $(eval $(call BuildPackage,hostapd-utils)) -$(eval $(call BuildPackage,hostapd-common)) $(eval $(call BuildPackage,eapol-test)) $(eval $(call BuildPackage,eapol-test-openssl)) $(eval $(call BuildPackage,eapol-test-wolfssl)) diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 039360511e..2cb8adc824 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -236,9 +236,11 @@ endef $(eval $(call BuildPackage,ip-tiny)) $(eval $(call BuildPackage,ip-full)) +# build tc-mod-iptables before its dependents, to avoid +# spurious rebuilds when building multiple variants. +$(eval $(call BuildPackage,tc-mod-iptables)) $(eval $(call BuildPackage,tc-tiny)) $(eval $(call BuildPackage,tc-full)) -$(eval $(call BuildPackage,tc-mod-iptables)) $(eval $(call BuildPackage,genl)) $(eval $(call BuildPackage,ip-bridge)) $(eval $(call BuildPackage,ss)) diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 9724a18b37..dd4ec06bfb 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fstools -PKG_RELEASE:=6 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git -PKG_SOURCE_DATE:=2019-03-28 -PKG_SOURCE_VERSION:=ff1ded63c51e84e239fb422ac8b9d15251d1221f -PKG_MIRROR_HASH:=2731bbca42c0eafda557d545ebeca243fa4048c433c3b27d31256aca356886bc +PKG_MIRROR_HASH:=04cc533f567e8a928a1c13dedcad781e73dfc796db8e83ac1218b47412ce01bd +PKG_SOURCE_DATE:=2020-07-11 +PKG_SOURCE_VERSION:=5345343828df944ae247d91cc77182f87559bc9a CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -79,14 +79,14 @@ define Package/block-mount SECTION:=base CATEGORY:=Base system TITLE:=Block device mounting and checking - DEPENDS:=+ubox +libubox +libuci + DEPENDS:=+ubox +libubox +libuci +libblobmsg-json +libjson-c endef define Package/blockd SECTION:=base CATEGORY:=Base system TITLE:=Block device automounting - DEPENDS:=+block-mount +fstools +libubus +kmod-fs-autofs4 + DEPENDS:=+block-mount +fstools +libubus +kmod-fs-autofs4 +libblobmsg-json +libjson-c endef define Package/fstools/install diff --git a/package/system/fstools/files/fstab.init b/package/system/fstools/files/fstab.init index 484d868950..03a3993494 100755 --- a/package/system/fstools/files/fstab.init +++ b/package/system/fstools/files/fstab.init @@ -10,16 +10,11 @@ boot() { } start() { - /sbin/block mount + return 0 } restart() { - /sbin/block umount - /sbin/block mount -} - -restart() { - start + return 0 } stop() { diff --git a/package/system/fstools/patches/000-fix-ntfs-uuid.patch b/package/system/fstools/patches/000-fix-ntfs-uuid.patch deleted file mode 100644 index 578945353f..0000000000 --- a/package/system/fstools/patches/000-fix-ntfs-uuid.patch +++ /dev/null @@ -1,56 +0,0 @@ -From d05276dc1d6de119da518d62930b9a8ef55ef7e9 Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Fri, 25 Oct 2019 10:48:47 +0000 -Subject: [PATCH] libblkid-tiny: ntfs: fix use-after-free - -The memory pointed to by ns can be reallocated when checking mft records - -Fixes FS#2129 - -Signed-off-by: Yousong Zhou ---- - libblkid-tiny/ntfs.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - ---- a/libblkid-tiny/ntfs.c -+++ b/libblkid-tiny/ntfs.c -@@ -88,6 +88,7 @@ static int probe_ntfs(blkid_probe pr, co - - uint32_t sectors_per_cluster, mft_record_size; - uint16_t sector_size; -+ uint64_t volume_serial; - uint64_t nr_clusters, off; //, attr_off; - unsigned char *buf_mft; - -@@ -148,15 +149,16 @@ static int probe_ntfs(blkid_probe pr, co - return 1; - - -+ volume_serial = ns->volume_serial; - off = le64_to_cpu(ns->mft_cluster_location) * sector_size * - sectors_per_cluster; - - DBG(LOWPROBE, ul_debug("NTFS: sector_size=%"PRIu16", mft_record_size=%"PRIu32", " - "sectors_per_cluster=%"PRIu32", nr_clusters=%"PRIu64" " -- "cluster_offset=%"PRIu64"", -+ "cluster_offset=%"PRIu64", volume_serial=%"PRIu64"", - sector_size, mft_record_size, - sectors_per_cluster, nr_clusters, -- off)); -+ off, volume_serial)); - - buf_mft = blkid_probe_get_buffer(pr, off, mft_record_size); - if (!buf_mft) -@@ -207,9 +209,9 @@ static int probe_ntfs(blkid_probe pr, co - #endif - - blkid_probe_sprintf_uuid(pr, -- (unsigned char *) &ns->volume_serial, -- sizeof(ns->volume_serial), -- "%016" PRIX64, le64_to_cpu(ns->volume_serial)); -+ (unsigned char *) &volume_serial, -+ sizeof(volume_serial), -+ "%016" PRIX64, le64_to_cpu(volume_serial)); - return 0; - } - diff --git a/package/system/fstools/patches/0001-add-exfat-support.patch b/package/system/fstools/patches/0001-add-exfat-support.patch deleted file mode 100644 index f2325d0f17..0000000000 --- a/package/system/fstools/patches/0001-add-exfat-support.patch +++ /dev/null @@ -1,315 +0,0 @@ ---- a/libblkid-tiny/blkidP.h -+++ b/libblkid-tiny/blkidP.h -@@ -557,4 +557,16 @@ extern size_t blkid_encode_to_utf8(int e - #define BLKID_ENC_UTF16BE 0 - #define BLKID_ENC_UTF16LE 1 - -+enum uuid_format { -+ UUID_DOS = 0, /* 4 bytes */ -+ UUID_NTFS = 1, /* 8 bytes */ -+ UUID_DCE = 2, /* 16 bytes */ -+ UUID_DCE_STRING = 3, /* 36 bytes (VOLUME_ID_UUID_SIZE) */ -+}; -+ -+enum endian { -+ LE = 0, -+ BE = 1 -+}; -+ - #endif /* _BLKID_BLKIDP_H */ ---- /dev/null -+++ b/libblkid-tiny/exfat.c -@@ -0,0 +1,155 @@ -+ /* -+ * Copyright (C) 1999 by Andries Brouwer -+ * Copyright (C) 1999, 2000, 2003 by Theodore Ts'o -+ * Copyright (C) 2001 by Andreas Dilger -+ * Copyright (C) 2004 Kay Sievers -+ * Copyright (C) 2008 Karel Zak -+ * Copyright (C) 2012 S-G Bergh -+ * Copyright (C) 2018 rosysong -+ * -+ * This file may be redistributed under the terms of the -+ * GNU Lesser General Public License. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#if 0 -+#include "pt-mbr.h" -+#endif -+ -+#include "superblocks.h" -+ -+#define EXFAT_SB_OFFSET 0 -+#define EXFAT_DIR_ENTRY_SZ 32 -+#define EXFAT_MAX_DIR_ENTRIES 100 -+ -+struct exfat_super_block { -+/* 0x00 */ uint8_t boot_jump[3]; -+/* 0x03 */ uint8_t fs_name[8]; -+/* 0x0B */ uint8_t must_be_zero[53]; -+/* 0x40 */ uint64_t partition_offset; -+/* 0x48 */ uint64_t volume_length; -+/* 0x50 */ uint32_t fat_offset; // Sector address of 1st FAT -+/* 0x54 */ uint32_t fat_size; // In sectors -+/* 0x58 */ uint32_t cluster_heap_offset; // Sector address of Data Region -+/* 0x5C */ uint32_t cluster_count; -+/* 0x60 */ uint32_t root_dir; // Cluster address of Root Directory -+/* 0x64 */ uint8_t vol_serial_nr[4]; // Volume ID -+/* 0x68 */ uint16_t fs_revision; // VV.MM -+/* 0x6A */ uint16_t vol_flags; -+/* 0x6C */ uint8_t bytes_per_sector; // Power of 2: 9 => 512, 12 => 4096 -+/* 0x6D */ uint8_t sectors_per_cluster; // Power of 2 -+/* 0x6E */ uint8_t nr_of_fats; // 2 for TexFAT -+/* 0x6F */ // ... -+} __attribute__((packed)); -+ -+struct exfat_dir_entry { -+/* 0x00 */ uint8_t entry_type; -+ union { -+ struct volume_label { -+/* 0x01 */ uint8_t char_count; // Length of label -+/* 0x02 */ uint16_t vol_label[11]; // UTF16 string without null termination -+/* 0x18 */ uint8_t reserved[8]; -+/* 0x20 */ } __attribute__((packed)) label; -+ struct volume_guid { -+/* 0x01 */ uint8_t sec_count; -+/* 0x02 */ uint16_t set_checksum; -+/* 0x04 */ uint16_t flags; -+/* 0x06 */ uint8_t vol_guid[16]; -+/* 0x16 */ uint8_t reserved[10]; -+/* 0x20 */ } __attribute__((packed)) guid; -+ } __attribute__((packed)) type; -+} __attribute__((packed)); -+ -+static int probe_exfat(blkid_probe pr, const struct blkid_idmag *mag) -+{ -+ struct exfat_super_block *sb; -+ struct exfat_dir_entry *de; -+ unsigned char *vol_label = 0; -+ unsigned char *vol_serno = NULL; -+ unsigned sector_sz; -+ unsigned cluster_sz; -+ uint64_t root_dir_off; -+ unsigned count; -+ unsigned need_lbl_guid; -+ const char *version = "EXFAT"; -+ -+ // Primary super block -+ DBG(LOWPROBE, ul_debug("exFAT: probing at offset 0x%x", EXFAT_SB_OFFSET)); -+ sb = blkid_probe_get_sb(pr, mag, struct exfat_super_block); -+ if (!sb) -+ return errno ? -errno : 1; -+ -+ if (memcmp(sb->fs_name, "EXFAT ", 8) != 0) -+ return -1; -+ -+ sector_sz = 1 << sb->bytes_per_sector; -+ cluster_sz = sector_sz << sb->sectors_per_cluster; -+ // There are no clusters 0 and 1, so the first cluster is 2. -+ root_dir_off = (uint64_t)EXFAT_SB_OFFSET + -+ // Hmm... should we cast sector_sz/cluster_sz to uint64_t? -+ (le32_to_cpu(sb->cluster_heap_offset)) * sector_sz + -+ (le32_to_cpu(sb->root_dir) - 2) * cluster_sz; -+ DBG(LOWPROBE, ul_debug("exFAT: sector size 0x%x bytes", sector_sz)); -+ DBG(LOWPROBE, ul_debug("exFAT: cluster size 0x%x bytes", cluster_sz)); -+ DBG(LOWPROBE, ul_debug("exFAT: root dir is at 0x%llx", (long long)root_dir_off)); -+ -+ // Use DOS uuid(UUID_DOS) as fallback, if no GUID set -+ vol_serno = sb->vol_serial_nr; -+ blkid_probe_sprintf_uuid_exfat(pr, vol_serno, UUID_DOS); -+ -+ // EXFAT_MAX_DIR_ENTRIES is used as a safety belt. -+ // The Root Directory may hold an unlimited number of entries, -+ // so we do not want to check all. Usually label and GUID -+ // are in the beginning, but there are no guarantees. -+ need_lbl_guid = (1 << 0) | (1 << 1); -+ for (count = 0; count < EXFAT_MAX_DIR_ENTRIES; count++) { -+ de = (struct exfat_dir_entry *) -+ blkid_probe_get_buffer(pr, root_dir_off + (count * EXFAT_DIR_ENTRY_SZ), EXFAT_DIR_ENTRY_SZ); -+ if (de == NULL) -+ break; -+ if (de->entry_type == 0x00) { -+ // End of Directory Marker -+ DBG(LOWPROBE, ul_debug("exFAT: End of root directory reached after %u entries", count)); -+ break; -+ } -+ if (de->entry_type == 0x83) { -+ // Volume Label Directory Entry -+ vol_label = (unsigned char *)de->type.label.vol_label; -+ blkid_probe_set_unicode16label(pr, vol_label, LE, 2 * de->type.label.char_count); -+ need_lbl_guid &= ~(1 << 0); -+ } -+ if (de->entry_type == 0xA0) { -+ // Volume GUID Directory Entry (UUID_DCE) -+ vol_serno = de->type.guid.vol_guid; -+ blkid_probe_sprintf_uuid_exfat(pr, vol_serno, UUID_DCE); -+ need_lbl_guid &= ~(1 << 1); -+ } -+ if (!need_lbl_guid) -+ break; -+ } -+ -+ if (version) -+ blkid_probe_set_version(pr, version); -+ -+ return 0; -+} -+ -+const struct blkid_idinfo exfat_idinfo = -+{ -+ .name = "exfat", -+ .usage = BLKID_USAGE_FILESYSTEM, -+ .probefunc = probe_exfat, -+ .magics = -+ { -+ { .magic = "EXFAT ", .len = 8, .sboff = 0x03 }, -+ { NULL } -+ } -+}; -+ ---- a/libblkid-tiny/libblkid-tiny.c -+++ b/libblkid-tiny/libblkid-tiny.c -@@ -121,6 +121,51 @@ int blkid_probe_set_label(blkid_probe pr - return 0; - } - -+int blkid_probe_set_unicode16(char *str, size_t len, const unsigned char *buf, enum endian endianess, size_t count) -+{ -+ unsigned i, j; -+ unsigned c; -+ -+ j = 0; -+ for (i = 0; i + 2 <= count; i += 2) { -+ if (endianess == LE) -+ c = (buf[i+1] << 8) | buf[i]; -+ else -+ c = (buf[i] << 8) | buf[i+1]; -+ if (c == 0) -+ break; -+ if (j+1 >= len) -+ break; -+ if (c < 0x80) { -+ /* 0xxxxxxx */ -+ } else { -+ unsigned char topbits = 0xc0; -+ if (j+2 >= len) -+ break; -+ if (c < 0x800) { -+ /* 110yyyxx 10xxxxxx */ -+ } else { -+ if (j+3 >= len) -+ break; -+ /* 1110yyyy 10yyyyxx 10xxxxxx */ -+ str[j++] = (unsigned char) (0xe0 | (c >> 12)); -+ topbits = 0x80; -+ } -+ str[j++] = (unsigned char) (topbits | ((c >> 6) & 0x3f)); -+ c = 0x80 | (c & 0x3f); -+ } -+ str[j++] = (unsigned char) c; -+ } -+ str[j] = '\0'; -+ -+ return j; -+} -+ -+int blkid_probe_set_unicode16label(blkid_probe pr, unsigned char *label, enum endian endianess, size_t len) -+{ -+ return blkid_probe_set_unicode16(pr->label, sizeof(pr->label), label, endianess, len); -+} -+ - int blkid_probe_set_uuid_as(blkid_probe pr, unsigned char *uuid, const char *name) - { - short unsigned int*u = (short unsigned int*) uuid; -@@ -135,6 +180,47 @@ int blkid_probe_set_uuid_as(blkid_probe - return 0; - } - -+int blkid_probe_sprintf_uuid_exfat(blkid_probe pr, unsigned char *buf, enum uuid_format format) -+{ -+ unsigned i; -+ unsigned count = 4 << format; -+ -+ /* if set, create string in the same format, the native platform uses */ -+ for (i = 0; i < count; i++) -+ if (buf[i] != 0) -+ goto set; -+ -+ /* all bytes are zero, leave it empty ("") */ -+ return 0; -+ -+set: -+ switch (format) { -+ case UUID_DOS: -+ blkid_probe_sprintf_uuid(pr, buf, count, "%02X%02X-%02X%02X", -+ buf[3], buf[2], buf[1], buf[0]); -+ break; -+ case UUID_NTFS: -+ blkid_probe_sprintf_uuid(pr, buf, count, "%02X%02X%02X%02X%02X%02X%02X%02X", -+ buf[7], buf[6], buf[5], buf[4], -+ buf[3], buf[2], buf[1], buf[0]); -+ break; -+ case UUID_DCE: -+ blkid_probe_sprintf_uuid(pr, buf, count, -+ "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", -+ buf[0], buf[1], buf[2], buf[3], -+ buf[4], buf[5], buf[6], buf[7], -+ buf[8], buf[9], buf[10], buf[11], -+ buf[12], buf[13], buf[14], buf[15]); -+ break; -+ case UUID_DCE_STRING: -+ memcpy(pr->uuid, buf, count); -+ pr->uuid[count] = '\0'; -+ break; -+ } -+ -+ return count; -+} -+ - int blkid_probe_set_uuid(blkid_probe pr, unsigned char *uuid) - { - return blkid_probe_set_uuid_as(pr, uuid, NULL); -@@ -155,6 +241,7 @@ int blkid_probe_sprintf_uuid(blkid_probe - static const struct blkid_idinfo *idinfos[] = - { - &vfat_idinfo, -+ &exfat_idinfo, - &swsuspend_idinfo, - &swap_idinfo, - &ext4dev_idinfo, ---- a/libblkid-tiny/superblocks.h -+++ b/libblkid-tiny/superblocks.h -@@ -88,9 +88,15 @@ extern int blkid_probe_sprintf_version(b - extern int blkid_probe_set_label(blkid_probe pr, unsigned char *label, size_t len); - extern int blkid_probe_set_utf8label(blkid_probe pr, unsigned char *label, - size_t len, int enc); -+extern int blkid_probe_set_unicode16(char *str, size_t len, const unsigned char *buf, -+ enum endian endianess, size_t count); -+extern int blkid_probe_set_unicode16label(blkid_probe pr, unsigned char *label, -+ enum endian endianess, size_t len); - extern int blkid_probe_sprintf_uuid(blkid_probe pr, unsigned char *uuid, - size_t len, const char *fmt, ...) - __attribute__ ((__format__ (__printf__, 4, 5))); -+extern int blkid_probe_sprintf_uuid_exfat(blkid_probe pr, unsigned char *buf, -+ enum uuid_format format); - extern int blkid_probe_strncpy_uuid(blkid_probe pr, unsigned char *str, size_t len); - - extern int blkid_probe_set_uuid(blkid_probe pr, unsigned char *uuid); ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -24,6 +24,7 @@ ADD_LIBRARY(blkid-tiny SHARED - libblkid-tiny/ext.c - libblkid-tiny/jffs2.c - libblkid-tiny/vfat.c -+ libblkid-tiny/exfat.c - libblkid-tiny/ntfs.c - libblkid-tiny/hfs.c - libblkid-tiny/swap.c diff --git a/package/system/fstools/patches/0005-disable-lazy-init.patch b/package/system/fstools/patches/0005-disable-lazy-init.patch deleted file mode 100644 index c30925703b..0000000000 --- a/package/system/fstools/patches/0005-disable-lazy-init.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/libfstools/rootdisk.c b/libfstools/rootdisk.c -index dd00c1b..f3b87fc 100644 ---- a/libfstools/rootdisk.c -+++ b/libfstools/rootdisk.c -@@ -270,7 +270,7 @@ static int rootdisk_volume_init(struct volume *v) - if (rootdisk_use_f2fs(p)) - snprintf(str, sizeof(str), "mkfs.f2fs -q -l rootfs_data %s", v->blk); - else -- snprintf(str, sizeof(str), "mkfs.ext4 -q -L rootfs_data %s", v->blk); -+ snprintf(str, sizeof(str), "mkfs.ext4 -q -E lazy_itable_init=0,lazy_journal_init=0 -L rootfs_data %s", v->blk); - ret = system(str); - break; - default: diff --git a/package/system/fstools/patches/0010-fstools-block-make-extroot-mount-preparation-more-robust.patch b/package/system/fstools/patches/0010-fstools-block-make-extroot-mount-preparation-more-robust.patch deleted file mode 100644 index 22271dbbe4..0000000000 --- a/package/system/fstools/patches/0010-fstools-block-make-extroot-mount-preparation-more-robust.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 1aa83d3cba087decaac34a1e845e301fe98d2abe Mon Sep 17 00:00:00 2001 -From: "Kenneth J. Miller" -Date: Tue, 9 Apr 2019 19:49:35 +0200 -Subject: [PATCH] fstools: block: make extroot mount preparation more robust - -The extroot mount preparation code for r/w rootfs overlay discovery, and -determining the user-defined /etc/config/fstab location within, would only -discover overlays residing on JFFS2 or UBIFS MTD storage. - -This led to attempts at loading the uci fstab configuration without the -required /tmp/overlay directory prefix on devices with a non-MTD r/w -rootfs overlay, and thus failure to find any custom fstab /overlay extroot -entries on PREINIT. -(example: the default openwrt eMMC partition layout on the zyxel nbg6817) - -Futher, with UBIFS_EXTROOT enabled (fstools package default), and no MTD -rootfs partitions present, check_extroot would not attempt rootfs -discovery on block devices, such as the ext4 mmcblk rootfs overlay on the -nbg6817. - -With this patch: -1) main_extroot now attempts to load uci fstab configuration from an - already mounted overlay, before defaulting to the prefix-less uci - config dir when no MTD rootfs partitions are detected. -2) check_extroot now also attempts to find rootfs partitions on block - devices when no MTD rootfs partitions are detected. - -Fixes: FS#2231 -Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2231 -Signed-off-by: Kenneth J. Miller ---- - block.c | 17 +++++------------ - 1 file changed, 5 insertions(+), 12 deletions(-) - -diff --git a/block.c b/block.c -index 39212d2..3dfc4a5 100644 ---- a/block.c -+++ b/block.c -@@ -1301,7 +1301,7 @@ static int find_block_ubi_RO(libubi_t libubi, char *name, char *part, int plen) - return err; - } - --#else -+#endif - - static int find_root_dev(char *buf, int len) - { -@@ -1332,8 +1332,6 @@ static int find_root_dev(char *buf, int len) - return -1; - } - --#endif -- - static int test_fs_support(const char *name) - { - char line[128], *p; -@@ -1363,25 +1361,20 @@ static int check_extroot(char *path) - struct probe_info *pr = NULL; - char devpath[32]; - --#ifdef UBIFS_EXTROOT - if (find_block_mtd("\"rootfs\"", devpath, sizeof(devpath))) { - int err = -1; -+#ifdef UBIFS_EXTROOT - libubi_t libubi; - - libubi = libubi_open(); - err = find_block_ubi_RO(libubi, "rootfs", devpath, sizeof(devpath)); - libubi_close(libubi); -- if (err) -- return -1; -- } --#else -- if (find_block_mtd("\"rootfs\"", devpath, sizeof(devpath))) { -- if (find_root_dev(devpath, sizeof(devpath))) { -+#endif -+ if (err && find_root_dev(devpath, sizeof(devpath))) { - ULOG_ERR("extroot: unable to determine root device\n"); - return -1; - } - } --#endif - - list_for_each_entry(pr, &devices, list) { - if (!strcmp(pr->dev, devpath)) { -@@ -1585,7 +1578,7 @@ static int main_extroot(int argc, char **argv) - } - #endif - -- return mount_extroot(NULL); -+ return mount_extroot("/tmp/overlay"); - } - - static int main_mount(int argc, char **argv) --- -2.21.0 - diff --git a/package/system/fstools/patches/0020-add-define-for-GLOB_ONLYDIR.patch b/package/system/fstools/patches/0020-add-define-for-GLOB_ONLYDIR.patch deleted file mode 100644 index 2208f1dff1..0000000000 --- a/package/system/fstools/patches/0020-add-define-for-GLOB_ONLYDIR.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 5345343828df944ae247d91cc77182f87559bc9a Mon Sep 17 00:00:00 2001 -From: Rosen Penev -Date: Wed, 25 Mar 2020 16:27:47 -0700 -Subject: [PATCH] fstoools: add define for GLOB_ONLYDIR - -This was originally a patch for musl. It is not present in musl as it is a -GNU extension. - -Place it here where it belongs. - -Signed-off-by: Rosen Penev ---- - libfstools/overlay.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/libfstools/overlay.c b/libfstools/overlay.c -index 14214a3..39215d5 100644 ---- a/libfstools/overlay.c -+++ b/libfstools/overlay.c -@@ -30,6 +30,10 @@ - #include "libfstools.h" - #include "volume.h" - -+#ifndef GLOB_ONLYDIR -+#define GLOB_ONLYDIR 0x100 -+#endif -+ - #define SWITCH_JFFS2 "/tmp/.switch_jffs2" - - static bool keep_sysupgrade; --- -2.20.1 diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile index 0d243302c2..44ab63c403 100644 --- a/package/utils/f2fs-tools/Makefile +++ b/package/utils/f2fs-tools/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=f2fs-tools PKG_VERSION:=1.14.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/ @@ -85,6 +85,7 @@ define Package/libf2fs DEPENDS:=+libuuid ABI_VERSION:=6 CONFLICTS:=libf2fs-selinux + VARIANT:=default endef define Package/libf2fs-selinux @@ -93,6 +94,7 @@ define Package/libf2fs-selinux TITLE:=Library for Flash-Friendly File System (F2FS) tools with SELinux support DEPENDS:=+libuuid +libselinux ABI_VERSION:=6 + VARIANT:=selinux endef CONFIGURE_ARGS += \