From: Marius Dinu Date: Sun, 17 Apr 2022 10:23:51 +0000 (+0300) Subject: btrfs-progs: add "btrfs device scan" before overlay/extroot X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=afcf845b0b65cea9a421b82699ef26dee7330ca2;p=feed%2Fpackages.git btrfs-progs: add "btrfs device scan" before overlay/extroot If users choose to build OpenWrt with btrfs included and want to use a btrfs RAID for overlay/extroot, then devices need to be scanned *before* mounting overlay/extroot. If not, btrfs won't find all RAID drives and fail to mount. This commit: - creates a duplicate (symlink) of the btrfs scan script so that it runs both before and after overlay/extroot mount, - changes the scan command to not depend on blkid (-d), - outputs the scan results to kernel log to show what's being detected, as the system logger is not yet running. Signed-off-by: Marius Dinu --- diff --git a/utils/btrfs-progs/Makefile b/utils/btrfs-progs/Makefile index ac9d064d8d..5619e12bbe 100644 --- a/utils/btrfs-progs/Makefile +++ b/utils/btrfs-progs/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=btrfs-progs PKG_VERSION:=6.11 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs @@ -67,6 +67,7 @@ CONFIGURE_ARGS += \ --disable-documentation \ --disable-libudev \ --disable-python + ifneq ($(CONFIG_BTRFS_PROGS_ZSTD),y) CONFIGURE_ARGS += --disable-zstd endif @@ -90,7 +91,8 @@ define Package/btrfs-progs/install $(foreach prog,$(boxprogs),$(LN) btrfs $(1)/usr/bin/$(prog);) $(foreach prog,$(progs),$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(prog) $(1)/usr/bin/;) $(INSTALL_DIR) $(1)/lib/preinit - $(INSTALL_BIN) ./files/btrfs-scan.init $(1)/lib/preinit/85_btrfs_scan + $(INSTALL_BIN) ./files/btrfs-scan.init $(1)/lib/preinit/85_btrfs_scan_post + $(LN) ./85_btrfs_scan_post $(1)/lib/preinit/78_btrfs_scan_pre endef $(eval $(call BuildPackage,btrfs-progs)) diff --git a/utils/btrfs-progs/files/btrfs-scan.init b/utils/btrfs-progs/files/btrfs-scan.init index 6b9ab62df9..e5ec1705be 100644 --- a/utils/btrfs-progs/files/btrfs-scan.init +++ b/utils/btrfs-progs/files/btrfs-scan.init @@ -2,7 +2,7 @@ preinit_btrfs_scan() { if grep -q btrfs /proc/filesystems; then - btrfs device scan + btrfs device scan -d > /dev/kmsg fi }