# HG changeset patch # User Pascal Bellard # Date 1213555442 0 # Node ID db3faeb6da24272acf66abe571a7938bd7cbc87c # Parent 674428d9fabfc7c2bee88f87146624cfc831cfc2 Squashfs: split kernel module and userland tools. diff -r 674428d9fabf -r db3faeb6da24 squashfs-module/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/squashfs-module/receipt Sun Jun 15 18:44:02 2008 +0000 @@ -0,0 +1,29 @@ +# SliTaz package receipt. + +PACKAGE="squashfs-module" +VERSION="3.3" +CATEGORY="base-system" +SHORT_DESC="Linux squashfs module." +MAINTAINER="pascal.bellard@slitaz.org" +WEB_SITE="http://$PACKAGE.sourceforge.net/" +WANTED="squashfs" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + kver=$(grep "kernel version" ../linux/linux-*/.config) + kver=${kver##* } + EXTRAVERSION=_$kver + cp -a $src/_pkg/lib $fs +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + depmod -a -b "$1/" +} + +post_remove() +{ + depmod -a +} diff -r 674428d9fabf -r db3faeb6da24 squashfs/receipt --- a/squashfs/receipt Sun Jun 15 18:08:57 2008 +0200 +++ b/squashfs/receipt Sun Jun 15 18:44:02 2008 +0000 @@ -3,12 +3,12 @@ PACKAGE="squashfs" VERSION="3.3" CATEGORY="base-system" -SHORT_DESC="Linux squashfs module and userland tools." +SHORT_DESC="Linux squashfs userland tools." MAINTAINER="pascal.bellard@slitaz.org" WEB_SITE="http://$PACKAGE.sourceforge.net/" TARBALL="squashfs$VERSION.tgz" WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" -DEPENDS="zlib" +DEPENDS="zlib squashfs-module" BUILD_DEPENDS="zlib-dev patch" # Rules to configure and make the package. @@ -17,6 +17,7 @@ local kver local patch_dir + ln -s . $src # get kernel version if [ ! -d ../linux/taz ]; then tazwok cook linux @@ -26,7 +27,13 @@ # Select patch according to kernel version patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-${kver%.*} - if [ -f ${PACKAGE}${VERSION}/kernel-patches/linux-$kver ]; then + i=${patch_dir##*.} + while [ ! -d ${patch_dir%.*}.$i ]; do + [ "$i" = "0" ] && break + i=$(($i - 1)) + done + patch_dir=${patch_dir%.*}.$i + if [ -d ${PACKAGE}${VERSION}/kernel-patches/linux-$kver ]; then patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-$kver fi if [ ! -d $patch_dir ]; then @@ -36,7 +43,7 @@ [ -d _kernel ] && rm -rf _kernel mkdir _kernel cd _kernel - ln -s ../../linux/linux-$kver* src + ln -fs ../../linux/linux-$kver* src # Copy files to be patched in local aera # Do not alter kernel sources !! @@ -46,7 +53,16 @@ done # Apply squashfs patches in local aera - patch -p1 < ../$patch_dir/${PACKAGE}${VERSION}-patch + #patch -p1 < ../$patch_dir/${PACKAGE}${VERSION}-patch + echo "Apply $patch_dir..." + awk 'BEGIN { keep=1} /^---/ { keep=(index($0,"/fs/squashfs/") || index($0,"/include/linux/"))} { if (keep) print }' < \ + ../$patch_dir/${PACKAGE}${VERSION}-patch | patch -p1 + + extra_patch=stuff/squashfs-patch-${kver%.*} + if [ -e ../$extra_patch ]; then + echo "Apply $extra_patch..." + patch -p1 < ../$extra_patch || return 1 + fi # Move every files in fs/squashfs directory mv include/linux/* fs/squashfs @@ -56,6 +72,10 @@ sed -e 's/CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE/3/g' > $i < $i.$$ done + # Apply lzma patches +# echo "Apply stuff/lzma.u.." +# patch -p0 < ../stuff/lzma.u + # Build kernel module make -C src/. SUBDIRS=$(pwd)/fs/squashfs/ CONFIG_SQUASHFS=m modules cd .. @@ -76,13 +96,13 @@ # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { - cp -a _pkg/* $fs + cp -a _pkg/usr _pkg/sbin $fs } # Post install/remove commands for Tazpkg. post_install() { - depmod -a -b /$1 + depmod -a -b "$1/" } post_remove() diff -r 674428d9fabf -r db3faeb6da24 squashfs/stuff/squashfs-patch-2.6.25 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/squashfs/stuff/squashfs-patch-2.6.25 Sun Jun 15 18:44:02 2008 +0000 @@ -0,0 +1,161 @@ +diff -x .gitignore -Nurp linux-2.6.25-rc7.orig/fs/squashfs/inode.c linux-2.6.25-rc7.new/fs/squashfs/inode.c +--- linux-2.6.25-rc7.orig/fs/squashfs/inode.c 2008-04-05 00:19:09.000000000 +0100 ++++ linux-2.6.25-rc7.new/fs/squashfs/inode.c 2008-04-05 00:22:44.000000000 +0100 +@@ -1,7 +1,7 @@ + /* + * Squashfs - a compressed read only filesystem for Linux + * +- * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 + * Phillip Lougher + * + * This program is free software; you can redistribute it and/or +@@ -37,7 +37,10 @@ + + int squashfs_cached_blks; + +-static void vfs_read_inode(struct inode *i); ++static struct dentry *squashfs_fh_to_dentry(struct super_block *s, ++ struct fid *fid, int fh_len, int fh_type); ++static struct dentry *squashfs_fh_to_parent(struct super_block *s, ++ struct fid *fid, int fh_len, int fh_type); + static struct dentry *squashfs_get_parent(struct dentry *child); + static int squashfs_read_inode(struct inode *i, squashfs_inode_t inode); + static int squashfs_statfs(struct dentry *, struct kstatfs *); +@@ -78,15 +81,9 @@ static struct super_operations squashfs_ + .remount_fs = squashfs_remount + }; + +-static struct super_operations squashfs_export_super_ops = { +- .alloc_inode = squashfs_alloc_inode, +- .destroy_inode = squashfs_destroy_inode, +- .statfs = squashfs_statfs, +- .put_super = squashfs_put_super, +- .read_inode = vfs_read_inode +-}; +- + static struct export_operations squashfs_export_ops = { ++ .fh_to_dentry = squashfs_fh_to_dentry, ++ .fh_to_parent = squashfs_fh_to_parent, + .get_parent = squashfs_get_parent + }; + +@@ -630,42 +627,72 @@ static squashfs_inode_t squashfs_inode_l + out: + return SQUASHFS_INVALID_BLK; + } +- + +-static void vfs_read_inode(struct inode *i) ++ ++ ++static struct dentry *squashfs_export_iget(struct super_block *s, ++ unsigned int inode_number) + { +- struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; +- squashfs_inode_t inode = squashfs_inode_lookup(i->i_sb, i->i_ino); ++ squashfs_inode_t inode; ++ struct inode *i; ++ struct dentry *dentry; + +- TRACE("Entered vfs_read_inode\n"); ++ TRACE("Entered squashfs_export_iget\n"); + +- if(inode != SQUASHFS_INVALID_BLK) +- (msblk->read_inode)(i, inode); ++ inode = squashfs_inode_lookup(s, inode_number); ++ if(inode == SQUASHFS_INVALID_BLK) { ++ dentry = ERR_PTR(-ENOENT); ++ goto failure; ++ } ++ ++ i = squashfs_iget(s, inode, inode_number); ++ if(i == NULL) { ++ dentry = ERR_PTR(-EACCES); ++ goto failure; ++ } ++ ++ dentry = d_alloc_anon(i); ++ if (dentry == NULL) { ++ iput(i); ++ dentry = ERR_PTR(-ENOMEM); ++ } ++ ++failure: ++ return dentry; ++} ++ ++ ++static struct dentry *squashfs_fh_to_dentry(struct super_block *s, ++ struct fid *fid, int fh_len, int fh_type) ++{ ++ if((fh_type != FILEID_INO32_GEN && fh_type != FILEID_INO32_GEN_PARENT) || ++ fh_len < 2) ++ return NULL; ++ ++ return squashfs_export_iget(s, fid->i32.ino); ++} ++ ++ ++static struct dentry *squashfs_fh_to_parent(struct super_block *s, ++ struct fid *fid, int fh_len, int fh_type) ++{ ++ if(fh_type != FILEID_INO32_GEN_PARENT || fh_len < 4) ++ return NULL; ++ ++ return squashfs_export_iget(s, fid->i32.parent_ino); + } + + + static struct dentry *squashfs_get_parent(struct dentry *child) + { + struct inode *i = child->d_inode; +- struct inode *parent = iget(i->i_sb, SQUASHFS_I(i)->u.s2.parent_inode); +- struct dentry *rv; + + TRACE("Entered squashfs_get_parent\n"); + +- if(parent == NULL) { +- rv = ERR_PTR(-EACCES); +- goto out; +- } +- +- rv = d_alloc_anon(parent); +- if(rv == NULL) +- rv = ERR_PTR(-ENOMEM); +- +-out: +- return rv; ++ return squashfs_export_iget(i->i_sb, SQUASHFS_I(i)->u.s2.parent_inode); + } + +- ++ + SQSH_EXTERN struct inode *squashfs_iget(struct super_block *s, + squashfs_inode_t inode, unsigned int inode_number) + { +@@ -1257,7 +1284,6 @@ static int squashfs_fill_super(struct su + if (read_inode_lookup_table(s) == 0) + goto failed_mount; + +- s->s_op = &squashfs_export_super_ops; + s->s_export_op = &squashfs_export_ops; + + allocate_root: +@@ -2124,7 +2150,7 @@ static int __init init_squashfs_fs(void) + if (err) + goto out; + +- printk(KERN_INFO "squashfs: version 3.3 (2007/10/31) " ++ printk(KERN_INFO "squashfs: version 3.3-CVS (2008/04/04) " + "Phillip Lougher\n"); + + err = register_filesystem(&squashfs_fs_type); +@@ -2187,6 +2213,6 @@ static void destroy_inodecache(void) + + module_init(init_squashfs_fs); + module_exit(exit_squashfs_fs); +-MODULE_DESCRIPTION("squashfs 3.2-r2-CVS, a compressed read-only filesystem"); ++MODULE_DESCRIPTION("squashfs 3.3, a compressed read-only filesystem"); + MODULE_AUTHOR("Phillip Lougher "); + MODULE_LICENSE("GPL");