projects
/
librecmc
/
librecmc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
kernel: mtdsplit: detect UBI partition when looking for rootfs
[librecmc/librecmc.git]
/
target
/
linux
/
generic
/
files
/
drivers
/
mtd
/
mtdsplit
/
mtdsplit.c
diff --git
a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit.c
b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit.c
index 4f6b46e28b93e04e9fbd3f0940008eb28cbcc206..9a330df252d44b9270362ceff5e32970051900f6 100644
(file)
--- a/
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit.c
+++ b/
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit.c
@@
-22,6
+22,8
@@
#include "mtdsplit.h"
#include "mtdsplit.h"
+#define UBI_EC_MAGIC 0x55424923 /* UBI# */
+
struct squashfs_super_block {
__le32 s_magic;
__le32 pad0[9];
struct squashfs_super_block {
__le32 s_magic;
__le32 pad0[9];
@@
-93,6
+95,10
@@
int mtd_check_rootfs_magic(struct mtd_info *mtd, size_t offset,
if (type)
*type = MTDSPLIT_PART_TYPE_JFFS2;
return 0;
if (type)
*type = MTDSPLIT_PART_TYPE_JFFS2;
return 0;
+ } else if (be32_to_cpu(magic) == UBI_EC_MAGIC) {
+ if (type)
+ *type = MTDSPLIT_PART_TYPE_UBI;
+ return 0;
}
return -EINVAL;
}
return -EINVAL;