From 1f7efcae4da6a3e9c55d465deab6ad8532f94cf3 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Wed, 2 Nov 2011 13:37:47 -0700 Subject: [PATCH] --- yaml --- r: 273231 b: refs/heads/master c: f919b9235f930e649b374a50009c6c268bd9a073 h: refs/heads/master i: 273229: dc415f8012fb3e5f2d23bc13c06f794ca0835ea9 273227: 92878dc78a6085b70454905545b37475cdff358b 273223: c8c663e9cd6ba477d8fe5bb5708ed33d21985b03 273215: 208ef3be26f9eb5c91eb1266733a5c2cb7f729b7 v: v3 --- [refs] | 2 +- trunk/init/do_mounts_rd.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ca3fb382f20c..1c2e6d7d21b0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0620d9193cb976ba635d56a6cfd11cb81616d02b +refs/heads/master: f919b9235f930e649b374a50009c6c268bd9a073 diff --git a/trunk/init/do_mounts_rd.c b/trunk/init/do_mounts_rd.c index fe9acb0ae480..887629e24c54 100644 --- a/trunk/init/do_mounts_rd.c +++ b/trunk/init/do_mounts_rd.c @@ -119,6 +119,20 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor) goto done; } + /* + * Read 512 bytes further to check if cramfs is padded + */ + sys_lseek(fd, start_block * BLOCK_SIZE + 0x200, 0); + sys_read(fd, buf, size); + + if (cramfsb->magic == CRAMFS_MAGIC) { + printk(KERN_NOTICE + "RAMDISK: cramfs filesystem found at block %d\n", + start_block); + nblocks = (cramfsb->size + BLOCK_SIZE - 1) >> BLOCK_SIZE_BITS; + goto done; + } + /* * Read block 1 to test for minix and ext2 superblock */