aboutsummaryrefslogtreecommitdiff
path: root/init/do_mounts_rd.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-10 12:04:41 +0100
committerIngo Molnar <mingo@elte.hu>2009-01-10 12:04:41 +0100
commitb17304245f0db0ac69b795c411407808f3f2796d (patch)
tree63ed3915d9295bd08f640bf25c322064ba787fad /init/do_mounts_rd.c
parent889c92d21db40be0b7d22a59395060237895bb85 (diff)
parent9a100a4464917b5ffff3a8ce1c2758088fd9bb32 (diff)
downloadlinux-linaro-stable-b17304245f0db0ac69b795c411407808f3f2796d.tar.gz
Merge branch 'linus' into x86/setup-lzma
Conflicts: init/do_mounts_rd.c
Diffstat (limited to 'init/do_mounts_rd.c')
-rw-r--r--init/do_mounts_rd.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
index a06ed4f92e0e..a015e267fd17 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -9,6 +9,7 @@
#include <linux/string.h>
#include "do_mounts.h"
+#include "../fs/squashfs/squashfs_fs.h"
#include <linux/decompress/generic.h>
@@ -44,6 +45,7 @@ static int __init crd_load(int in_fd, int out_fd, decompress_fn deco);
* ext2
* romfs
* cramfs
+ * squashfs
* gzip
*/
static int __init
@@ -54,6 +56,7 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
struct ext2_super_block *ext2sb;
struct romfs_super_block *romfsb;
struct cramfs_super *cramfsb;
+ struct squashfs_super_block *squashfsb;
int nblocks = -1;
unsigned char *buf;
const char *compress_name;
@@ -66,6 +69,7 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
ext2sb = (struct ext2_super_block *) buf;
romfsb = (struct romfs_super_block *) buf;
cramfsb = (struct cramfs_super *) buf;
+ squashfsb = (struct squashfs_super_block *) buf;
memset(buf, 0xe5, size);
/*
@@ -100,6 +104,16 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
goto done;
}
+ /* squashfs is at block zero too */
+ if (le32_to_cpu(squashfsb->s_magic) == SQUASHFS_MAGIC) {
+ printk(KERN_NOTICE
+ "RAMDISK: squashfs filesystem found at block %d\n",
+ start_block);
+ nblocks = (le64_to_cpu(squashfsb->bytes_used) + BLOCK_SIZE - 1)
+ >> BLOCK_SIZE_BITS;
+ goto done;
+ }
+
/*
* Read block 1 to test for minix and ext2 superblock
*/