Commit 6791a22a authored by James Bottomley's avatar James Bottomley Committed by David S. Miller

[PATCH] use cramfs as an initrd

Now that Al Viro fixed cramfs, it works beautifully as an initrd
filesystem.

So finally plumb it in.
parent 3ba4cb0a
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <linux/minix_fs.h> #include <linux/minix_fs.h>
#include <linux/ext2_fs.h> #include <linux/ext2_fs.h>
#include <linux/romfs_fs.h> #include <linux/romfs_fs.h>
#include <linux/cramfs_fs.h>
#include <linux/initrd.h> #include <linux/initrd.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -41,6 +42,7 @@ static int __init crd_load(int in_fd, int out_fd); ...@@ -41,6 +42,7 @@ static int __init crd_load(int in_fd, int out_fd);
* minix * minix
* ext2 * ext2
* romfs * romfs
* cramfs
* gzip * gzip
*/ */
static int __init static int __init
...@@ -50,6 +52,7 @@ identify_ramdisk_image(int fd, int start_block) ...@@ -50,6 +52,7 @@ identify_ramdisk_image(int fd, int start_block)
struct minix_super_block *minixsb; struct minix_super_block *minixsb;
struct ext2_super_block *ext2sb; struct ext2_super_block *ext2sb;
struct romfs_super_block *romfsb; struct romfs_super_block *romfsb;
struct cramfs_super *cramfsb;
int nblocks = -1; int nblocks = -1;
unsigned char *buf; unsigned char *buf;
...@@ -60,6 +63,7 @@ identify_ramdisk_image(int fd, int start_block) ...@@ -60,6 +63,7 @@ identify_ramdisk_image(int fd, int start_block)
minixsb = (struct minix_super_block *) buf; minixsb = (struct minix_super_block *) buf;
ext2sb = (struct ext2_super_block *) buf; ext2sb = (struct ext2_super_block *) buf;
romfsb = (struct romfs_super_block *) buf; romfsb = (struct romfs_super_block *) buf;
cramfsb = (struct cramfs_super *) buf;
memset(buf, 0xe5, size); memset(buf, 0xe5, size);
/* /*
...@@ -89,6 +93,14 @@ identify_ramdisk_image(int fd, int start_block) ...@@ -89,6 +93,14 @@ identify_ramdisk_image(int fd, int start_block)
goto done; 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 * Read block 1 to test for minix and ext2 superblock
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment