From b3527703b22a02d971d0b99e171533ca3af8cb94 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Fri, 5 Nov 2021 23:06:02 +0800 Subject: [PATCH 01/11] fstools: update to 2020-07-11 Remove upstreamed patch. --- package/system/fstools/Makefile | 12 +- package/system/fstools/files/fstab.init | 9 +- .../fstools/patches/000-fix-ntfs-uuid.patch | 56 ---- .../patches/0001-add-exfat-support.patch | 315 ------------------ .../patches/0005-disable-lazy-init.patch | 13 - ...xtroot-mount-preparation-more-robust.patch | 97 ------ .../0020-add-define-for-GLOB_ONLYDIR.patch | 32 -- 7 files changed, 8 insertions(+), 526 deletions(-) delete mode 100644 package/system/fstools/patches/000-fix-ntfs-uuid.patch delete mode 100644 package/system/fstools/patches/0001-add-exfat-support.patch delete mode 100644 package/system/fstools/patches/0005-disable-lazy-init.patch delete mode 100644 package/system/fstools/patches/0010-fstools-block-make-extroot-mount-preparation-more-robust.patch delete mode 100644 package/system/fstools/patches/0020-add-define-for-GLOB_ONLYDIR.patch 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 From 8ae4d1d9011fa3d397453c9e77179c9d9798d5fc Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Fri, 22 Oct 2021 16:12:10 -0300 Subject: [PATCH 02/11] build: avoid rebuilds of unset VARIANT packages If a Makefile defines some packages with VARIANT set, and others without it, the latter will be built once for every different VARIANT set, each build trumping the previous one. Avoid rebuilds by only building unnamed variant packages when the first variant is built. Signed-off-by: Eneas U de Queiroz (cherry picked from commit 19aae949c608c8e78475988a8c7b453b8187d865) --- include/package-bin.mk | 3 ++- include/package-ipkg.mk | 3 ++- include/subdir.mk | 10 ++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/package-bin.mk b/include/package-bin.mk index 192f0726d2..77e603e420 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),$(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..bd50edb75f 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),$$(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/subdir.mk b/include/subdir.mk index be080859b7..d33b947fdf 100644 --- a/include/subdir.mk +++ b/include/subdir.mk @@ -29,12 +29,14 @@ diralias=$(if $(findstring $(1),$(call lastdir,$(1))),,$(call lastdir,$(1))) subdir_make_opts = \ -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))), $(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),, From d0eae202381cfc504db8d51fe7ffa1c03e0bbc70 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 4 Nov 2021 15:53:50 +0100 Subject: [PATCH 03/11] build: add SUBDIR_MAKE_DEBUG variable to make it easier to debug package makefiles Signed-off-by: Felix Fietkau (cherry picked from commit 94b0849c19848beda9e1a215bcae0daac6927ff0) --- include/subdir.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/subdir.mk b/include/subdir.mk index d33b947fdf..155f493538 100644 --- a/include/subdir.mk +++ b/include/subdir.mk @@ -27,7 +27,7 @@ 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)" \ ALL_VARIANTS="$(5)" From 7162cbb4b57715a250302db69124d24b41b6733a Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Thu, 19 Aug 2021 18:14:22 -0300 Subject: [PATCH 04/11] download: improve handling of invalid local files 4e19cbc5533: [download: handle possibly invalid local tarballs] added a FORCE rule to downloaded files, so that they will be always checked by download.pl. As a side-effect, check-compile will fail, forcing unnecessary package rebuilds. The check-compile.txt log shows (for libxml2 for example): Considering target file '.../dl/libxml2-2.9.12.tar.gz'. ... prerequisite 'FORCE' of target '.../dl/libxml2-2.9.12.tar.gz' does not exist. Must remake target '.../dl/libxml2-2.9.12.tar.gz'. ... Giving up on target file '...libxml2-2.9.12/.prepared_...'. Giving up on target file '...libxml2-2.9.12/.configured_...'. Giving up on target file '...libxml2-2.9.12/.built'. Giving up on target file '...stamp/.libxml2_installed'. Giving up on target file '.compile'. Then the package is rebuilt even if it is not otherwise needed. To fix this, instead of always forcing the download target to be remade, check its hash first: if it matches, then the FORCE is not added. Signed-off-by: Eneas U de Queiroz --- include/download.mk | 17 +++++++++++++++-- include/host-build.mk | 2 +- include/package.mk | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) 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/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), From 3c3cbd9214e19c88631f9ea11c00777ff77ea893 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Fri, 15 Oct 2021 10:30:05 -0300 Subject: [PATCH 05/11] build: kernel: avoid unnecessary package rebuilds The $(LINUX_DIR)/.config timesptamp changes between runs of make target/compile and make target/install (which builds the image). Kernel-dependent packages and out of tree modules are built in between those runs, and they check the .config timestamp to decide if they need to be rebuilt. Save the target/compile .config to use its timestamp if the file does not change between runs. That way the subsequent kernel packages are not unnecessarily rebuilt when you run 'make' back to back. Signed-off-by: Eneas U de Queiroz --- include/kernel-defaults.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index 9a01cf5c2b..84cd30dc7f 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -112,6 +112,10 @@ endef define Kernel/CompileModules/Default rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map +$(KERNEL_MAKE) 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 From 87fb61cd8901d90b976dce42cbc2b6ba7d66e964 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Fri, 15 Oct 2021 13:39:19 -0300 Subject: [PATCH 06/11] hostapd: avoid unnecessary package rebuilds Package hostapd-common is a dependency of every other package defined in hostpad Makefile. It is currently built next to the bottom of that Makefile's package list. If you run make back to back, then check-compile will compare the hostapd-common timestamp to the variant being compiled, to decide if the varint needs to be rebuilt or not. Since the hostapd-conf package is built towards the end of the list, it will be newer than most of the variants, causing unnecessary package rebuilds. Move it to the top, so that its timestamp will be older than dependent packages, avoiding unnecessary rebuild of every selected variant. Signed-off-by: Eneas U de Queiroz --- package/network/services/hostapd/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 6d1c3cad82..48edbf3f34 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -613,6 +613,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-mini)) @@ -636,7 +639,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)) From a09443deb9ffeb4533ce8dab06c03a47a0f386c2 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Sun, 17 Oct 2021 12:34:05 -0300 Subject: [PATCH 07/11] f2fstools: set each library package VARIANT Set the different libf2fs packages's VARIANT, so that the right settings will be used by each different variant, if they are both being built. Signed-off-by: Eneas U de Queiroz --- package/utils/f2fs-tools/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 += \ From 28c057976cb31534ea62ecbc41924ff7faa3c42b Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Thu, 21 Oct 2021 10:35:41 -0300 Subject: [PATCH 08/11] iproute2: Avoid unnecessary package rebuilds Build the tc-mod-iptables before the tc-tiny and tc-full packages. This avoids unnecessary package rebuild when calling make back to back. Before this change, tc-mod-iptables will be built after the main tc binary packages. Both tc-tiny and tc-full depend on tc-mod-ipables. If make is called after the packages are already built, it will check the timestamps of both packages, and will rebuild the main binaries, since the module package will be newer than the tc package. Calling BuildPackage,mod-iptables first ensures that its variant gets built before the other packages' variants. Signed-off-by: Eneas U de Queiroz --- package/network/utils/iproute2/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)) From 066d40393f232067c72028a69d055ac19e4e34bf Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Wed, 3 Nov 2021 15:51:32 -0300 Subject: [PATCH 09/11] build: allow package to be built for all variants This allows a package to be rebuilt for all different VARIANTs. To do so, set VARIANT=*. The wpa-cli package is not getting built after changes made by 19aae94 [build: avoid rebuilds of unset VARIANT packages], because wpa-cli is only built when compiling a variant that includes supplicant support, and the first selected variant may not build it. Signed-off-by: Eneas U de Queiroz --- include/package-bin.mk | 2 +- include/package-ipkg.mk | 2 +- include/subdir.mk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/package-bin.mk b/include/package-bin.mk index 77e603e420..4ca49218e9 100644 --- a/include/package-bin.mk +++ b/include/package-bin.mk @@ -4,7 +4,7 @@ ifeq ($(DUMP),) define BuildTarget/bin - TARGET_VARIANT=$(if $(ALL_VARIANTS),$(if $(VARIANT),$(VARIANT),$(firstword $(ALL_VARIANTS)))) + 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),) diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index bd50edb75f..362a0e2a8b 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -105,7 +105,7 @@ ifeq ($(DUMP),) IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1) KEEP_$(1):=$(strip $(call Package/$(1)/conffiles)) - TARGET_VARIANT:=$$(if $(ALL_VARIANTS),$$(if $$(VARIANT),$$(VARIANT),$(firstword $(ALL_VARIANTS)))) + 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 diff --git a/include/subdir.mk b/include/subdir.mk index 155f493538..95009f814e 100644 --- a/include/subdir.mk +++ b/include/subdir.mk @@ -69,7 +69,7 @@ define subdir $(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)),$($(1)/$(bd)/variants))) $(call log_make,$(1)/$(bd),$(target),,$(filter-out __default,$(variant)),$($(1)/$(bd)/variants)) \ From 9faf4324d4fd013ae0e0841e5cb1157746d4560d Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Wed, 3 Nov 2021 15:58:57 -0300 Subject: [PATCH 10/11] hostapd: set VARIANT=* for wpa-cli, hostapd-utils 19aae94 [build: avoid rebuilds of unset VARIANT packages] builds packages defined without a VARIANT only once, using the first VARIANT defined in the Makefile. This caused problems with wpa-cli, as it is only built for variants that include supplicant support, and the first VARIANT defined may not build it. The same happens to hostapd-utils, which is not built for supplicant-only variants. To circumvent this, set VARIANT=* for both packages so that they get built for every defined variant. This should not cause spurious rebuilds, since tey are not a dependency of any other package defined in this Makefile. Signed-off-by: Eneas U de Queiroz --- package/network/services/hostapd/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 48edbf3f34..046bee48aa 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -375,6 +375,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 @@ -388,6 +389,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 From 92c43b059b748ba670eb1a5ed138d7b8084dc73a Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 17 Nov 2021 00:07:15 +0800 Subject: [PATCH 11/11] target: add `luci-lib-ipkg` to default packages Signed-off-by: Tianling Shen --- include/target.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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