From: <ke...@us...> - 2007-03-18 13:01:17
|
Revision: 918 http://svn.sourceforge.net/hackndev/?rev=918&view=rev Author: keddar Date: 2007-03-18 05:28:29 -0700 (Sun, 18 Mar 2007) Log Message: ----------- l4p: add support for initrd in SquashFS-LZMA format Modified Paths: -------------- linux4palm/linux/trunk/init/do_mounts_rd.c Modified: linux4palm/linux/trunk/init/do_mounts_rd.c =================================================================== --- linux4palm/linux/trunk/init/do_mounts_rd.c 2007-03-18 12:23:04 UTC (rev 917) +++ linux4palm/linux/trunk/init/do_mounts_rd.c 2007-03-18 12:28:29 UTC (rev 918) @@ -5,7 +5,14 @@ #include <linux/ext2_fs.h> #include <linux/romfs_fs.h> #include <linux/cramfs_fs.h> -#include <linux/squashfs_fs.h> + +#ifdef CONFIG_SQUASHFS_LZMA + #include <linux/squashfslzma_fs.h> + #include <../fs/squashfs_lzma/sqmagic.h> +#else + #include <linux/squashfs_fs.h> +#endif + #include <linux/initrd.h> #include <linux/string.h> @@ -41,6 +48,7 @@ * * We currently check for the following magic numbers: * squashfs + * squashfs-lzma * minix * ext2 * romfs @@ -56,6 +64,8 @@ struct romfs_super_block *romfsb; struct cramfs_super *cramfsb; struct squashfs_super_block *squashfsb; + struct squashfs_super_block *squashfslzmab; + int nblocks = -1; unsigned char *buf; @@ -68,6 +78,7 @@ romfsb = (struct romfs_super_block *) buf; cramfsb = (struct cramfs_super *) buf; squashfsb = (struct squashfs_super_block *) buf; + squashfslzmab = (struct squashfs_super_block *) buf; memset(buf, 0xe5, size); /* @@ -117,6 +128,17 @@ goto done; } + /* squashfslzma is at block zero too */ + if (squashfslzmab->s_magic == SQUASHFS_MAGIC_LZMA) { + printk(KERN_NOTICE + "RAMDISK: SquashFS-LZMA filesystem found at block %d\n", + start_block); + if (squashfslzmab->s_major < 3) + nblocks = (squashfslzmab->bytes_used_2+BLOCK_SIZE-1)>>BLOCK_SIZE_BITS; + else + nblocks = (squashfslzmab->bytes_used+BLOCK_SIZE-1)>>BLOCK_SIZE_BITS; + goto done; + } /* * Read block 1 to test for minix and ext2 superblock This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |