diff options
| author | Daniel Golle | 2023-01-03 12:07:15 +0000 |
|---|---|---|
| committer | Daniel Golle | 2023-05-28 16:01:52 +0000 |
| commit | 56a9b4e7e39514813208b776605899c80a37a7f3 (patch) | |
| tree | 779726d32e51a8c1de4f77fb45f36b436ef6cf2d | |
| parent | 9cd09d4269bb15710b5d9bd72573ef243eb2927c (diff) | |
| download | fstools-56a9b4e7e39514813208b776605899c80a37a7f3.tar.gz | |
block: consider currently mounted root device first
First look for the currently mounted root device and then fallback to
looking for rootfs.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| -rw-r--r-- | block.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1479,7 +1479,9 @@ static int check_extroot(char *path) FILE *fp; int err; - err = find_block_mtd("\"rootfs\"", devpath, sizeof(devpath)); + err = find_root_dev(devpath, sizeof(devpath)); + if (err) + err = find_block_mtd("\"rootfs\"", devpath, sizeof(devpath)); #ifdef UBIFS_EXTROOT if (err) { libubi_t libubi; @@ -1490,9 +1492,6 @@ static int check_extroot(char *path) } #endif if (err) { - err = find_root_dev(devpath, sizeof(devpath)); - } - if (err) { ULOG_ERR("extroot: unable to determine root device\n"); return -1; } |