When BLOCKSIZE is defined we call padjffs2 with the defined alignment
to pad towards. That results in one of more block of all-1s instead of
the expected 0xdeadc0de and ultimaltely breaks restoring configuration
as fstools won't look for a the GZ signature indicating the config
backup in this case.
Change that and also look for config backup when all-1s are used for
padding.
Fixes: ee54c6b ("libfstools: skip JFFS2 padding on block devices")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
switch (volume_identify(v)) {
case FS_DEADCODE:
+ case FS_NONE:
/* skip padding */
fd = open(v->blk, O_RDONLY);
if (fd < 0) {
ULOG_ERR("failed extracting config backup from %s\n", v->blk);
break;
}
- /* fall-through */
- case FS_NONE:
do_format:
ULOG_INFO("overlay filesystem in %s has not been formatted yet\n", v->blk);
if (use_f2fs(v, offset, bdev))
#include "common.h"
#define BUFLEN 64
+#define DEVPATHSTR_SIZE 15
static const char *const fit0 = "/dev/fit0";
static const char *const fitrw = "/dev/fitrw";
struct fit_volume {
struct volume v;
union {
- char devpathstr[16];
+ char devpathstr[DEVPATHSTR_SIZE+1];
struct devpath devpath;
} dev;
};
if (!p)
return NULL;
- strcpy(p->dev.devpathstr, fname);
+ strncpy(p->dev.devpathstr, fname, DEVPATHSTR_SIZE);
p->v.drv = &fit_driver;
p->v.blk = p->dev.devpathstr;
p->v.name = name;
#include <linux/loop.h>
#define ROOTDEV_OVERLAY_ALIGN (64ULL * 1024ULL)
-#define F2FS_MINSIZE (100ULL * 1024ULL * 1024ULL)
struct squashfs_super_block {
uint32_t s_magic;