mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 21:24:31 +04:00
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 <m95d+git@psihoexpert.ro>
This commit is contained in:
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=btrfs-progs
|
PKG_NAME:=btrfs-progs
|
||||||
PKG_VERSION:=6.11
|
PKG_VERSION:=6.11
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
|
||||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs
|
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs
|
||||||
@@ -67,6 +67,7 @@ CONFIGURE_ARGS += \
|
|||||||
--disable-documentation \
|
--disable-documentation \
|
||||||
--disable-libudev \
|
--disable-libudev \
|
||||||
--disable-python
|
--disable-python
|
||||||
|
|
||||||
ifneq ($(CONFIG_BTRFS_PROGS_ZSTD),y)
|
ifneq ($(CONFIG_BTRFS_PROGS_ZSTD),y)
|
||||||
CONFIGURE_ARGS += --disable-zstd
|
CONFIGURE_ARGS += --disable-zstd
|
||||||
endif
|
endif
|
||||||
@@ -90,7 +91,8 @@ define Package/btrfs-progs/install
|
|||||||
$(foreach prog,$(boxprogs),$(LN) btrfs $(1)/usr/bin/$(prog);)
|
$(foreach prog,$(boxprogs),$(LN) btrfs $(1)/usr/bin/$(prog);)
|
||||||
$(foreach prog,$(progs),$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(prog) $(1)/usr/bin/;)
|
$(foreach prog,$(progs),$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(prog) $(1)/usr/bin/;)
|
||||||
$(INSTALL_DIR) $(1)/lib/preinit
|
$(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
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,btrfs-progs))
|
$(eval $(call BuildPackage,btrfs-progs))
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
preinit_btrfs_scan() {
|
preinit_btrfs_scan() {
|
||||||
if grep -q btrfs /proc/filesystems; then
|
if grep -q btrfs /proc/filesystems; then
|
||||||
btrfs device scan
|
btrfs device scan -d > /dev/kmsg
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user