btrfs-progs: add "btrfs device scan" before overlay/extroot
authorMarius Dinu <[email protected]>
Sun, 17 Apr 2022 10:23:51 +0000 (13:23 +0300)
committerRosen Penev <[email protected]>
Thu, 14 Nov 2024 18:32:35 +0000 (10:32 -0800)
commitafcf845b0b65cea9a421b82699ef26dee7330ca2
treeb50d0d25692ed4d0d6c9fc118ba6b17b447b49ff
parent19d40c8d7a7ecae9e8c8d21ae5ac2d8a6a5f35e9
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 <[email protected]>
utils/btrfs-progs/Makefile
utils/btrfs-progs/files/btrfs-scan.init