aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2011-12-15 22:03:40 +0000
committerGabor Juhos <juhosg@openwrt.org>2011-12-15 22:03:40 +0000
commitc0f856759b0b613ca12bfa28af0422e051a03200 (patch)
treee797a73b3a5532aebd3d59b0b5065962e326ba5a /target
parentbc40f1dc75b4572fd767acae718fa532a473b1fb (diff)
downloadupstream-c0f856759b0b613ca12bfa28af0422e051a03200.tar.gz
upstream-c0f856759b0b613ca12bfa28af0422e051a03200.tar.bz2
upstream-c0f856759b0b613ca12bfa28af0422e051a03200.zip
ar71xx: tplinkpart: allow to detect JFFS2 as well
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29543 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/files/drivers/mtd/tplinkpart.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/target/linux/ar71xx/files/drivers/mtd/tplinkpart.c b/target/linux/ar71xx/files/drivers/mtd/tplinkpart.c
index 2cbad5ada1..6f47f84351 100644
--- a/target/linux/ar71xx/files/drivers/mtd/tplinkpart.c
+++ b/target/linux/ar71xx/files/drivers/mtd/tplinkpart.c
@@ -84,7 +84,7 @@ err:
return NULL;
}
-static int tplink_check_squashfs_magic(struct mtd_info *mtd, size_t offset)
+static int tplink_check_rootfs_magic(struct mtd_info *mtd, size_t offset)
{
u32 magic;
size_t retlen;
@@ -98,7 +98,8 @@ static int tplink_check_squashfs_magic(struct mtd_info *mtd, size_t offset)
if (retlen != sizeof(magic))
return -EIO;
- if (le32_to_cpu(magic) != SQUASHFS_MAGIC)
+ if (le32_to_cpu(magic) != SQUASHFS_MAGIC &&
+ magic != 0x19852003)
return -EINVAL;
return 0;
@@ -136,7 +137,7 @@ static int tplink_parse_partitions(struct mtd_info *master,
squashfs_offset = offset + sizeof(struct tplink_fw_header) +
be32_to_cpu(header->kernel_len);
- ret = tplink_check_squashfs_magic(master, squashfs_offset);
+ ret = tplink_check_rootfs_magic(master, squashfs_offset);
if (ret == 0)
rootfs_offset = squashfs_offset;
else