summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-09-08 13:03:26 +0200
committerFelix Fietkau <nbd@nbd.name>2016-09-08 13:05:57 +0200
commit984a6beb959a5bbb2d0a6d13fb05dc9cd4a26338 (patch)
tree9db3c37450c07ec78665b4aca849ed1f19a67003
parent41e7cf7483c89926f5650028e07a54f9052884c4 (diff)
downloadfstools-984a6beb959a5bbb2d0a6d13fb05dc9cd4a26338.tar.gz
libfstools: replace hardcoded mentions of jffs2 in a few places
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--libfstools/overlay.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libfstools/overlay.c b/libfstools/overlay.c
index ed0f304..5a49da2 100644
--- a/libfstools/overlay.c
+++ b/libfstools/overlay.c
@@ -210,7 +210,7 @@ static char *overlay_fs_name(int type)
int
jffs2_switch(struct volume *v)
{
- char *mp;
+ char *mp, *fs_name;
int type;
if (find_overlay_mount("overlayfs:/tmp/root"))
@@ -229,6 +229,8 @@ jffs2_switch(struct volume *v)
}
type = volume_identify(v);
+ fs_name = overlay_fs_name(type);
+
switch (type) {
case FS_NONE:
ULOG_ERR("no jffs2 marker found\n");
@@ -246,10 +248,10 @@ jffs2_switch(struct volume *v)
case FS_EXT4:
case FS_F2FS:
case FS_UBIFS:
- if (overlay_mount(v, overlay_fs_name(type)))
+ if (overlay_mount(v, fs_name))
return -1;
if (mount_move("/tmp", "", "/overlay") || fopivot("/overlay", "/rom")) {
- ULOG_ERR("switching to jffs2 failed\n");
+ ULOG_ERR("switching to %s failed\n", fs_name);
return -1;
}
break;
@@ -320,7 +322,7 @@ int fs_state_set(const char *dir, enum fs_state state)
int mount_overlay(struct volume *v)
{
- char *mp;
+ char *mp, *fs_name;
if (!v)
return -1;
@@ -354,9 +356,10 @@ int mount_overlay(struct volume *v)
break;
}
- ULOG_INFO("switching to jffs2 overlay\n");
+ fs_name = overlay_fs_name(volume_identify(v));
+ ULOG_INFO("switching to %s overlay\n", fs_name);
if (mount_move("/tmp", "", "/overlay") || fopivot("/overlay", "/rom")) {
- ULOG_ERR("switching to jffs2 failed - fallback to ramoverlay\n");
+ ULOG_ERR("switching to %s failed - fallback to ramoverlay\n", fs_name);
return ramoverlay();
}