Use this method even if UBIFS extroot support is enabled. This is needed
on x86 systems (using F2FS for overlay) as they may still come with F2FS
enabled.
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2231
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
static int find_root_dev(char *buf, int len)
{
static int find_root_dev(char *buf, int len)
{
static int test_fs_support(const char *name)
{
char line[128], *p;
static int test_fs_support(const char *name)
{
char line[128], *p;
char devpath[32];
char tag[64];
FILE *fp;
char devpath[32];
char tag[64];
FILE *fp;
+ err = find_block_mtd("\"rootfs\"", devpath, sizeof(devpath));
- if (find_block_mtd("\"rootfs\"", devpath, sizeof(devpath))) {
- int err = -1;
libubi_t libubi;
libubi = libubi_open();
err = find_block_ubi_RO(libubi, "rootfs", devpath, sizeof(devpath));
libubi_close(libubi);
libubi_t libubi;
libubi = libubi_open();
err = find_block_ubi_RO(libubi, "rootfs", devpath, sizeof(devpath));
libubi_close(libubi);
- if (err)
- return -1;
- }
-#else
- if (find_block_mtd("\"rootfs\"", devpath, sizeof(devpath))) {
- if (find_root_dev(devpath, sizeof(devpath))) {
- ULOG_ERR("extroot: unable to determine root device\n");
- return -1;
- }
+ if (err) {
+ err = find_root_dev(devpath, sizeof(devpath));
+ }
+ if (err) {
+ ULOG_ERR("extroot: unable to determine root device\n");
+ return -1;
+ }
/* Find root device probe_info so we know its UUID */
list_for_each_entry(tmp, &devices, list) {
/* Find root device probe_info so we know its UUID */
list_for_each_entry(tmp, &devices, list) {