wok rev 2991

Up squashfs (4.0)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon May 11 19:12:26 2009 +0200 (2009-05-11)
parents 9059daaaa23d
children 214c9590a5e5
files squashfs-module/receipt squashfs/receipt squashfs/stuff/squashfs-patch-2.6.25
line diff
     1.1 --- a/squashfs-module/receipt	Mon May 11 19:08:50 2009 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,30 +0,0 @@
     1.4 -# SliTaz package receipt.
     1.5 -
     1.6 -PACKAGE="squashfs-module"
     1.7 -VERSION="3.3"
     1.8 -CATEGORY="base-system"
     1.9 -SHORT_DESC="Linux squashfs module."
    1.10 -MAINTAINER="pascal.bellard@slitaz.org"
    1.11 -DEPENDS="linux"
    1.12 -WEB_SITE="http://squashfs.sourceforge.net/"
    1.13 -WANTED="squashfs"
    1.14 -
    1.15 -# Rules to gen a SliTaz package suitable for Tazpkg.
    1.16 -genpkg_rules()
    1.17 -{
    1.18 -	kver=$(grep "kernel version" ../linux/$(ls ../linux/taz)/.config)
    1.19 -	kver=${kver##* }
    1.20 -	EXTRAVERSION=_$kver
    1.21 -	cp -a $src/_pkg/lib $fs
    1.22 -}
    1.23 -
    1.24 -# Post install/remove commands for Tazpkg.
    1.25 -post_install()
    1.26 -{
    1.27 -	chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz
    1.28 -}
    1.29 -
    1.30 -post_remove()
    1.31 -{
    1.32 -	depmod -a
    1.33 -}
     2.1 --- a/squashfs/receipt	Mon May 11 19:08:50 2009 +0200
     2.2 +++ b/squashfs/receipt	Mon May 11 19:12:26 2009 +0200
     2.3 @@ -1,198 +1,31 @@
     2.4  # SliTaz package receipt.
     2.5  
     2.6  PACKAGE="squashfs"
     2.7 -VERSION="3.3"
     2.8 +VERSION="4.0"
     2.9  CATEGORY="base-system"
    2.10  SHORT_DESC="Linux squashfs userland tools."
    2.11  MAINTAINER="pascal.bellard@slitaz.org"
    2.12  WEB_SITE="http://$PACKAGE.sourceforge.net/"
    2.13 -TARBALL="squashfs$VERSION.tgz"
    2.14 +TARBALL="squashfs$VERSION.tar.gz"
    2.15  WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    2.16 -DEPENDS="zlib squashfs-module"
    2.17 -BUILD_DEPENDS="zlib-dev patch lzma"
    2.18 +DEPENDS="zlib"
    2.19 +BUILD_DEPENDS="zlib-dev"
    2.20  PROVIDE="cromfs-or-squashfs"
    2.21 -CONFIG_FILES="/etc/filesystems"
    2.22 -
    2.23 -# Download a source tarball
    2.24 -. /etc/tazwok.conf
    2.25 -slitaz_wget()
    2.26 -{
    2.27 -	if [ ! -f $SOURCES_REPOSITORY/$(basename $2) ]; then
    2.28 -		local here=$(pwd)
    2.29 -		cd $SOURCES_REPOSITORY
    2.30 -		wget $1 $2
    2.31 -		cd $here
    2.32 -	fi
    2.33 -	cp $SOURCES_REPOSITORY/$(basename $2) .
    2.34 -}
    2.35  
    2.36  # Rules to configure and make the package.
    2.37  compile_rules()
    2.38  {
    2.39 -	local kver
    2.40 -	local patch_dir
    2.41 +	mv ${PACKAGE}${VERSION} $src 2> /dev/null
    2.42  
    2.43 -	if [ -L $(which patch) ]; then
    2.44 -		echo "Please reinstall patch !"
    2.45 -		return 1
    2.46 -	fi
    2.47 -	mkdir -p $src
    2.48 -	cd $src
    2.49 -	mv ../$PACKAGE$VERSION . 2> /dev/null
    2.50 -	# get kernel version
    2.51 -	if [ ! -d $WOK/linux/taz ]; then
    2.52 -		tazwok cook linux
    2.53 -	fi
    2.54 -	kver=$(grep "kernel version" $WOK/linux/$(ls $WOK/linux/taz)/.config)
    2.55 -	kver=${kver##* }
    2.56 -
    2.57 -	# Select patch according to kernel version
    2.58 -	patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-${kver%.*}
    2.59 -	i=${patch_dir##*.}
    2.60 -	while [ ! -d ${patch_dir%.*}.$i ]; do
    2.61 -		[ "$i" = "0" ] && break
    2.62 -		i=$(($i - 1))
    2.63 -	done
    2.64 -	patch_dir=${patch_dir%.*}.$i
    2.65 -	if [ -d ${PACKAGE}${VERSION}/kernel-patches/linux-$kver ]; then
    2.66 -		patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-$kver
    2.67 -	fi
    2.68 -	if [ ! -d $patch_dir ]; then
    2.69 -		echo "No squashfs patchset for kernel $ker. Abort."
    2.70 -		return 1
    2.71 -	fi
    2.72 -	[ -d _kernel ] && rm -rf _kernel
    2.73 -	mkdir _kernel
    2.74 -	cd _kernel
    2.75 -	ln -fs $WOK/linux/linux-$kver* src
    2.76 -
    2.77 -	# Copy files to be patched in local aera
    2.78 -	# Do not alter kernel sources !!
    2.79 -	for i in $(grep ^--- ../$patch_dir/${PACKAGE}${VERSION}-patch | \
    2.80 -    		awk '{ if ($3 != "1970-01-01") print $2 } '); do
    2.81 -		( cd src ; tar cf - ${i#*/}) | tar xf -
    2.82 -	done
    2.83 -
    2.84 -	# Apply squashfs patches in local aera
    2.85 -	#patch -p1 < ../$patch_dir/${PACKAGE}${VERSION}-patch
    2.86 -	echo "Apply $patch_dir..."
    2.87 -	awk 'BEGIN { keep=1} /^---/ { keep=(index($0,"/fs/squashfs/") || index($0,"/include/linux/"))} { if (keep) print }' < \
    2.88 -		../$patch_dir/${PACKAGE}${VERSION}-patch | patch -p1
    2.89 -
    2.90 -	extra_patch=../stuff/squashfs-patch-${kver%.*}
    2.91 -	if [ -e ../$extra_patch ]; then
    2.92 -		echo "Apply $extra_patch..."
    2.93 -		patch -p1 < ../$extra_patch || return 1
    2.94 -	fi
    2.95 -
    2.96 -	# Move every files in fs/squashfs directory
    2.97 -	mv include/linux/* fs/squashfs
    2.98 -	rmdir include/linux
    2.99 -	ln -s ../fs/squashfs include/linux
   2.100 -	ln -s . fs/squashfs/linux
   2.101 -	for i in fs/squashfs/*.c fs/squashfs/*.h ; do
   2.102 -		sed -i 's/#include <\(linux\/squashfs.*\)>.*/#include "\1"/g' $i
   2.103 -		sed -i 's/CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE/3/g' $i
   2.104 -	done
   2.105 -	
   2.106 -	# Apply lzma patches
   2.107 -	cd ..
   2.108 -	slitaz_wget -c $SF_MIRROR/sevenzip/lzma457.tar.bz2
   2.109 -	tar xjf lzma457.tar.bz2
   2.110 -	SQLZMA=ftp://ftp.slax.org/source/slax/sqlzma/old-versions-unsupported
   2.111 -	slitaz_wget -c $SQLZMA/sqlzma457-1/sqlzma3.3-457.tar.bz2
   2.112 -	tar xjf sqlzma3.3-457.tar.bz2
   2.113 -	rm -f $(grep ^+++ sqlzma1-449.patch | awk '{ print $2 }' | \
   2.114 -		sed 's|[^/]*/||') 2> /dev/null
   2.115 -	patch -p1 < sqlzma1-449.patch || return 1
   2.116 -	patch -p0 << EOT
   2.117 ---- _kernel/fs/squashfs/inode.c
   2.118 -+++ _kernel/fs/squashfs/inode.c
   2.119 -@@ -2153 +2153 @@
   2.120 --	printk(KERN_INFO "squashfs: version 3.3-CVS (2008/04/04) "
   2.121 -+	printk(KERN_INFO "squashfs: version 3.3 (2007/10/31) "
   2.122 -@@ -2216 +2216 @@
   2.123 --MODULE_DESCRIPTION("squashfs 3.3, a compressed read-only filesystem");
   2.124 -+MODULE_DESCRIPTION("squashfs 3.2-r2-CVS, a compressed read-only filesystem");
   2.125 -
   2.126 ---- _kernel/fs/squashfs/squashfs_fs_sb.h
   2.127 -+++ _kernel/fs/squashfs/squashfs_fs_sb.h
   2.128 -@@ -26 +26 @@
   2.129 --#include "linux/squashfs_fs.h"
   2.130 -+#include <linux/squashfs_fs.h>
   2.131 -EOT
   2.132 -	( cd _kernel ; patch -p1 ) < sqlzma2k-3.3.patch || return 1
   2.133 -	patch -p0 << EOT
   2.134 ---- _kernel/fs/squashfs/squashfs_fs_sb.h
   2.135 -+++ _kernel/fs/squashfs/squashfs_fs_sb.h
   2.136 -@@ -26 +26 @@
   2.137 --#include <linux/squashfs_fs.h>
   2.138 -+#include "linux/squashfs_fs.h"
   2.139 -EOT
   2.140 -	cp sq*.h _kernel/fs/squashfs
   2.141 -	grep -q "sqlzma.h" squashfs3.3/squashfs-tools/mksquashfs.c ||
   2.142 -	patch -p0 << EOT
   2.143 ---- squashfs3.3/squashfs-tools/unsquashfs.c
   2.144 -+++ squashfs3.3/squashfs-tools/unsquashfs.c
   2.145 -@@ -326,2 +326,3 @@
   2.146 --		if((res = uncompress((unsigned char *) block, &bytes,
   2.147 --		(const unsigned char *) buffer, c_byte)) != Z_OK) {
   2.148 -+		res = uncompress((unsigned char *) block, &bytes, (const unsigned char *) buffer, c_byte);
   2.149 -+
   2.150 -+		if(res != Z_OK) {
   2.151 -@@ -365,2 +366,3 @@
   2.152 --		if((res = uncompress((unsigned char *) block, &bytes,
   2.153 --		(const unsigned char *) data, c_byte)) != Z_OK) {
   2.154 -+		res = uncompress((unsigned char *) block, &bytes, (const unsigned char *) data, c_byte);
   2.155 -+
   2.156 -+		if(res != Z_OK) {
   2.157 -EOT
   2.158 -	grep -q "sqlzma.h" squashfs3.3/squashfs-tools/mksquashfs.c ||
   2.159 -	patch -p0 < sqlzma2u-3.3.patch || return 1
   2.160 -	export LzmaC=$PWD/C/Compress/Lzma
   2.161 -	export LzmaAlone=$PWD/CPP/7zip/Compress/LZMA_Alone
   2.162 -	export Sqlzma=$PWD/_kernel/fs/squashfs
   2.163 -	for i in $LzmaC $LzmaAlone ; do
   2.164 -		make -C $i -f sqlzma.mk || return 1
   2.165 -	done
   2.166 -	rm -f $LzmaC/kmod/uncomp.c 2> /dev/null
   2.167 -	make -C $LzmaC KDir=$PWD/_kernel/src/. -f kmod.mk || return 1
   2.168 -	cp $LzmaC/kmod/Module.symvers $Sqlzma
   2.169 -	
   2.170 -	# Build kernel squashfs module
   2.171 -	cd _kernel
   2.172 -	make -C src/. SUBDIRS=$(pwd)/fs/squashfs/ CONFIG_SQUASHFS=m modules || return 1
   2.173 -	cd ..
   2.174 -	[ -d _pkg ] && rm -rf _pkg
   2.175 -	mkdir -p _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs
   2.176 -	mkdir -p _pkg/usr/sbin _pkg/sbin
   2.177 -	find . -name "*.ko" | while read module; do
   2.178 -		lzma e $module _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/$(basename $module).gz
   2.179 -	done
   2.180 -
   2.181 -	# Build user land tools
   2.182 -	cd ${PACKAGE}${VERSION}/squashfs-tools
   2.183 +	cd $src/squashfs-tools
   2.184 +	mkdir -p ../_pkg/usr/sbin ../_pkg/sbin
   2.185  	make || return 1
   2.186 -	cp mksquashfs ../../_pkg/usr/sbin
   2.187 -	cp unsquashfs ../../_pkg/sbin
   2.188 +	cp mksquashfs ../_pkg/usr/sbin
   2.189 +	cp unsquashfs ../_pkg/sbin
   2.190  }
   2.191  
   2.192  # Rules to gen a SliTaz package suitable for Tazpkg.
   2.193  genpkg_rules()
   2.194  {
   2.195 -	mkdir $fs/etc
   2.196 -	touch $fs/etc/filesystems
   2.197  	cp -a $_pkg/usr $_pkg/sbin $fs
   2.198  }
   2.199 -
   2.200 -# Pre remove and post install commands for Tazpkg.
   2.201 -pre_remove()
   2.202 -{
   2.203 -	sed -i '/^$PACKAGE$/d' $1/etc/filesystems
   2.204 -}
   2.205 -
   2.206 -post_install()
   2.207 -{
   2.208 -	grep -qs ^$PACKAGE$ $1/etc/filesystems || \
   2.209 -		echo "$PACKAGE" >> $1/etc/filesystems
   2.210 -}
     3.1 --- a/squashfs/stuff/squashfs-patch-2.6.25	Mon May 11 19:08:50 2009 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,161 +0,0 @@
     3.4 -diff -x .gitignore -Nurp linux-2.6.25-rc7.orig/fs/squashfs/inode.c linux-2.6.25-rc7.new/fs/squashfs/inode.c
     3.5 ---- linux-2.6.25-rc7.orig/fs/squashfs/inode.c	2008-04-05 00:19:09.000000000 +0100
     3.6 -+++ linux-2.6.25-rc7.new/fs/squashfs/inode.c	2008-04-05 00:22:44.000000000 +0100
     3.7 -@@ -1,7 +1,7 @@
     3.8 - /*
     3.9 -  * Squashfs - a compressed read only filesystem for Linux
    3.10 -  *
    3.11 -- * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007
    3.12 -+ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008
    3.13 -  * Phillip Lougher <phillip@lougher.demon.co.uk>
    3.14 -  *
    3.15 -  * This program is free software; you can redistribute it and/or
    3.16 -@@ -37,7 +37,10 @@
    3.17 - 
    3.18 - int squashfs_cached_blks;
    3.19 - 
    3.20 --static void vfs_read_inode(struct inode *i);
    3.21 -+static struct dentry *squashfs_fh_to_dentry(struct super_block *s,
    3.22 -+		struct fid *fid, int fh_len, int fh_type);
    3.23 -+static struct dentry *squashfs_fh_to_parent(struct super_block *s,
    3.24 -+		struct fid *fid, int fh_len, int fh_type);
    3.25 - static struct dentry *squashfs_get_parent(struct dentry *child);
    3.26 - static int squashfs_read_inode(struct inode *i, squashfs_inode_t inode);
    3.27 - static int squashfs_statfs(struct dentry *, struct kstatfs *);
    3.28 -@@ -78,15 +81,9 @@ static struct super_operations squashfs_
    3.29 - 	.remount_fs = squashfs_remount
    3.30 - };
    3.31 - 
    3.32 --static struct super_operations squashfs_export_super_ops = {
    3.33 --	.alloc_inode = squashfs_alloc_inode,
    3.34 --	.destroy_inode = squashfs_destroy_inode,
    3.35 --	.statfs = squashfs_statfs,
    3.36 --	.put_super = squashfs_put_super,
    3.37 --	.read_inode = vfs_read_inode
    3.38 --};
    3.39 --
    3.40 - static struct export_operations squashfs_export_ops = {
    3.41 -+	.fh_to_dentry = squashfs_fh_to_dentry,
    3.42 -+	.fh_to_parent = squashfs_fh_to_parent,
    3.43 - 	.get_parent = squashfs_get_parent
    3.44 - };
    3.45 - 
    3.46 -@@ -630,42 +627,72 @@ static squashfs_inode_t squashfs_inode_l
    3.47 - out:
    3.48 - 	return SQUASHFS_INVALID_BLK;
    3.49 - }
    3.50 --	
    3.51 - 
    3.52 --static void vfs_read_inode(struct inode *i)
    3.53 -+
    3.54 -+
    3.55 -+static struct dentry *squashfs_export_iget(struct super_block *s,
    3.56 -+	unsigned int inode_number)
    3.57 - {
    3.58 --	struct squashfs_sb_info *msblk = i->i_sb->s_fs_info;
    3.59 --	squashfs_inode_t inode = squashfs_inode_lookup(i->i_sb, i->i_ino);
    3.60 -+	squashfs_inode_t inode;
    3.61 -+	struct inode *i;
    3.62 -+	struct dentry *dentry;
    3.63 - 
    3.64 --	TRACE("Entered vfs_read_inode\n");
    3.65 -+	TRACE("Entered squashfs_export_iget\n");
    3.66 - 
    3.67 --	if(inode != SQUASHFS_INVALID_BLK)
    3.68 --		(msblk->read_inode)(i, inode);
    3.69 -+	inode = squashfs_inode_lookup(s, inode_number);
    3.70 -+	if(inode == SQUASHFS_INVALID_BLK) {
    3.71 -+		dentry = ERR_PTR(-ENOENT);
    3.72 -+		goto failure;
    3.73 -+	}
    3.74 -+
    3.75 -+	i = squashfs_iget(s, inode, inode_number);
    3.76 -+	if(i == NULL) {
    3.77 -+		dentry = ERR_PTR(-EACCES);
    3.78 -+		goto failure;
    3.79 -+	}
    3.80 -+
    3.81 -+	dentry = d_alloc_anon(i);
    3.82 -+	if (dentry == NULL) {
    3.83 -+		iput(i);
    3.84 -+		dentry = ERR_PTR(-ENOMEM);
    3.85 -+	}
    3.86 -+
    3.87 -+failure:
    3.88 -+	return dentry;
    3.89 -+}
    3.90 -+
    3.91 -+
    3.92 -+static struct dentry *squashfs_fh_to_dentry(struct super_block *s,
    3.93 -+		struct fid *fid, int fh_len, int fh_type)
    3.94 -+{
    3.95 -+	if((fh_type != FILEID_INO32_GEN && fh_type != FILEID_INO32_GEN_PARENT) ||
    3.96 -+			fh_len < 2)
    3.97 -+		return NULL;
    3.98 -+
    3.99 -+	return squashfs_export_iget(s, fid->i32.ino);
   3.100 -+}
   3.101 -+
   3.102 -+
   3.103 -+static struct dentry *squashfs_fh_to_parent(struct super_block *s,
   3.104 -+		struct fid *fid, int fh_len, int fh_type)
   3.105 -+{
   3.106 -+	if(fh_type != FILEID_INO32_GEN_PARENT || fh_len < 4)
   3.107 -+		return NULL;
   3.108 -+
   3.109 -+	return squashfs_export_iget(s, fid->i32.parent_ino);
   3.110 - }
   3.111 - 
   3.112 - 
   3.113 - static struct dentry *squashfs_get_parent(struct dentry *child)
   3.114 - {
   3.115 - 	struct inode *i = child->d_inode;
   3.116 --	struct inode *parent = iget(i->i_sb, SQUASHFS_I(i)->u.s2.parent_inode);
   3.117 --	struct dentry *rv;
   3.118 - 
   3.119 - 	TRACE("Entered squashfs_get_parent\n");
   3.120 - 
   3.121 --	if(parent == NULL) {
   3.122 --		rv = ERR_PTR(-EACCES);
   3.123 --		goto out;
   3.124 --	}
   3.125 --
   3.126 --	rv = d_alloc_anon(parent);
   3.127 --	if(rv == NULL)
   3.128 --		rv = ERR_PTR(-ENOMEM);
   3.129 --
   3.130 --out:
   3.131 --	return rv;
   3.132 -+	return squashfs_export_iget(i->i_sb, SQUASHFS_I(i)->u.s2.parent_inode);
   3.133 - }
   3.134 - 
   3.135 --	
   3.136 -+
   3.137 - SQSH_EXTERN struct inode *squashfs_iget(struct super_block *s,
   3.138 - 				squashfs_inode_t inode, unsigned int inode_number)
   3.139 - {
   3.140 -@@ -1257,7 +1284,6 @@ static int squashfs_fill_super(struct su
   3.141 - 	if (read_inode_lookup_table(s) == 0)
   3.142 - 		goto failed_mount;
   3.143 - 
   3.144 --	s->s_op = &squashfs_export_super_ops;
   3.145 - 	s->s_export_op = &squashfs_export_ops;
   3.146 - 
   3.147 - allocate_root:
   3.148 -@@ -2124,7 +2150,7 @@ static int __init init_squashfs_fs(void)
   3.149 - 	if (err)
   3.150 - 		goto out;
   3.151 - 
   3.152 --	printk(KERN_INFO "squashfs: version 3.3 (2007/10/31) "
   3.153 -+	printk(KERN_INFO "squashfs: version 3.3-CVS (2008/04/04) "
   3.154 - 		"Phillip Lougher\n");
   3.155 - 
   3.156 - 	err = register_filesystem(&squashfs_fs_type);
   3.157 -@@ -2187,6 +2213,6 @@ static void destroy_inodecache(void)
   3.158 - 
   3.159 - module_init(init_squashfs_fs);
   3.160 - module_exit(exit_squashfs_fs);
   3.161 --MODULE_DESCRIPTION("squashfs 3.2-r2-CVS, a compressed read-only filesystem");
   3.162 -+MODULE_DESCRIPTION("squashfs 3.3, a compressed read-only filesystem");
   3.163 - MODULE_AUTHOR("Phillip Lougher <phillip@lougher.demon.co.uk>");
   3.164 - MODULE_LICENSE("GPL");