libfstools: extroot: support builtin block
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 17 Feb 2015 18:50:00 +0000 (19:50 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 17 Feb 2015 18:50:06 +0000 (19:50 +0100)
Fix regression introduced with migration to fs-tools.

The old ubox based exroot did a fall back to /sbin/block if $cfg/sbin/block
did not exist.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
libfstools/extroot.c

index 45cc3f51bf27e6d36dfa8d8cf0b2121d6c1a1105..ca38ce132b8857c6295d8836fe2785eb20d13a23 100644 (file)
@@ -42,8 +42,11 @@ int mount_extroot(void)
        sprintf(ldlib_path, "%s/lib", extroot_prefix);
        sprintf(block_path, "%s/sbin/block", extroot_prefix);
 
-       if (stat(block_path, &s))
-               return -1;
+       if (stat(block_path, &s)) {
+               sprintf(block_path, "/sbin/block");
+               if (stat(block_path, &s))
+                       return -1;
+       }
 
        sprintf(kmod_loader, "/sbin/kmodloader %s/etc/modules-boot.d/ %s", extroot_prefix, extroot_prefix);
        system(kmod_loader);