X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=libfstools%2Foverlay.c;h=5a49da2c550f3cb60f5ab619545ed571479f20d0;hb=92b4c2cbe1682c77826c4d7392e2e52cab3d2a28;hp=5215ff3a06018db740ca6a604f6d36e78d5f59eb;hpb=4abf9de460253771fabef2b2cdf5d7a8b457bd1d;p=project%2Ffstools.git diff --git a/libfstools/overlay.c b/libfstools/overlay.c index 5215ff3..5a49da2 100644 --- a/libfstools/overlay.c +++ b/libfstools/overlay.c @@ -195,6 +195,8 @@ handle_whiteout(const char *dir) static char *overlay_fs_name(int type) { switch (type) { + case FS_EXT4: + return "ext4"; case FS_F2FS: return "f2fs"; case FS_UBIFS: @@ -208,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")) @@ -227,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"); @@ -241,12 +245,13 @@ jffs2_switch(struct volume *v) foreachdir("/overlay/", handle_whiteout); break; + 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; @@ -317,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; @@ -351,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(); }