diff options
author | James Bottomley <james.bottomley@steeleye.com> | 2004-02-03 21:51:43 -0800 |
---|---|---|
committer | David S. Miller <davem@kernel.bkbits.net> | 2004-02-03 21:51:43 -0800 |
commit | 6791a22a9e420278e098f49eee861bdb20d23226 (patch) | |
tree | d1de51edb6eb554d3e43007a3e3e6a139e545178 /init | |
parent | 3ba4cb0a34bf97b07130e62dced5f3adc07fafcb (diff) | |
download | history-6791a22a9e420278e098f49eee861bdb20d23226.tar.gz |
[PATCH] use cramfs as an initrd
Now that Al Viro fixed cramfs, it works beautifully as an initrd
filesystem.
So finally plumb it in.
Diffstat (limited to 'init')
-rw-r--r-- | init/do_mounts_rd.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index c4074ad08906a8..e8b6e2ffc11a8c 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c @@ -4,6 +4,7 @@ #include <linux/minix_fs.h> #include <linux/ext2_fs.h> #include <linux/romfs_fs.h> +#include <linux/cramfs_fs.h> #include <linux/initrd.h> #include <linux/string.h> @@ -41,6 +42,7 @@ static int __init crd_load(int in_fd, int out_fd); * minix * ext2 * romfs + * cramfs * gzip */ static int __init @@ -50,6 +52,7 @@ identify_ramdisk_image(int fd, int start_block) struct minix_super_block *minixsb; struct ext2_super_block *ext2sb; struct romfs_super_block *romfsb; + struct cramfs_super *cramfsb; int nblocks = -1; unsigned char *buf; @@ -60,6 +63,7 @@ identify_ramdisk_image(int fd, int start_block) minixsb = (struct minix_super_block *) buf; ext2sb = (struct ext2_super_block *) buf; romfsb = (struct romfs_super_block *) buf; + cramfsb = (struct cramfs_super *) buf; memset(buf, 0xe5, size); /* @@ -89,6 +93,14 @@ identify_ramdisk_image(int fd, int start_block) goto done; } + 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 */ |