aboutsummaryrefslogtreecommitdiffstats
path: root/init/do_mounts_rd.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-10 06:04:41 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-10 06:04:41 -0500
commitb17304245f0db0ac69b795c411407808f3f2796d (patch)
tree63ed3915d9295bd08f640bf25c322064ba787fad /init/do_mounts_rd.c
parent889c92d21db40be0b7d22a59395060237895bb85 (diff)
parent9a100a4464917b5ffff3a8ce1c2758088fd9bb32 (diff)
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 @@
9#include <linux/string.h> 9#include <linux/string.h>
10 10
11#include "do_mounts.h" 11#include "do_mounts.h"
12#include "../fs/squashfs/squashfs_fs.h"
12 13
13#include <linux/decompress/generic.h> 14#include <linux/decompress/generic.h>
14 15
@@ -44,6 +45,7 @@ static int __init crd_load(int in_fd, int out_fd, decompress_fn deco);
44 * ext2 45 * ext2
45 * romfs 46 * romfs
46 * cramfs 47 * cramfs
48 * squashfs
47 * gzip 49 * gzip
48 */ 50 */
49static int __init 51static int __init
@@ -54,6 +56,7 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
54 struct ext2_super_block *ext2sb; 56 struct ext2_super_block *ext2sb;
55 struct romfs_super_block *romfsb; 57 struct romfs_super_block *romfsb;
56 struct cramfs_super *cramfsb; 58 struct cramfs_super *cramfsb;
59 struct squashfs_super_block *squashfsb;
57 int nblocks = -1; 60 int nblocks = -1;
58 unsigned char *buf; 61 unsigned char *buf;
59 const char *compress_name; 62 const char *compress_name;
@@ -66,6 +69,7 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
66 ext2sb = (struct ext2_super_block *) buf; 69 ext2sb = (struct ext2_super_block *) buf;
67 romfsb = (struct romfs_super_block *) buf; 70 romfsb = (struct romfs_super_block *) buf;
68 cramfsb = (struct cramfs_super *) buf; 71 cramfsb = (struct cramfs_super *) buf;
72 squashfsb = (struct squashfs_super_block *) buf;
69 memset(buf, 0xe5, size); 73 memset(buf, 0xe5, size);
70 74
71 /* 75 /*
@@ -100,6 +104,16 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
100 goto done; 104 goto done;
101 } 105 }
102 106
107 /* squashfs is at block zero too */
108 if (le32_to_cpu(squashfsb->s_magic) == SQUASHFS_MAGIC) {
109 printk(KERN_NOTICE
110 "RAMDISK: squashfs filesystem found at block %d\n",
111 start_block);
112 nblocks = (le64_to_cpu(squashfsb->bytes_used) + BLOCK_SIZE - 1)
113 >> BLOCK_SIZE_BITS;
114 goto done;
115 }
116
103 /* 117 /*
104 * Read block 1 to test for minix and ext2 superblock 118 * Read block 1 to test for minix and ext2 superblock
105 */ 119 */