0
0
mirror of https://github.com/openwrt/packages.git synced 2025-07-09 19:59:08 +00:00
Files
packages/utils/btrfs-progs/files/btrfs-scan.init
Marius Dinu afcf845b0b 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>
2024-11-14 10:32:35 -08:00

10 lines
164 B
Bash

#!/bin/sh
preinit_btrfs_scan() {
if grep -q btrfs /proc/filesystems; then
btrfs device scan -d > /dev/kmsg
fi
}
boot_hook_add preinit_main preinit_btrfs_scan