[oe-commits] org.oe.dev merge of '3ecc917729c94ee2f23b012b99f74a8a524154c2'
mickeyl commit
openembedded-commits at lists.openembedded.org
Tue Sep 18 01:05:42 UTC 2007
merge of '3ecc917729c94ee2f23b012b99f74a8a524154c2'
and 'cc4ff44ab8858d40dac79ae6b3e11d75dbd68c10'
Author: mickeyl at openembedded.org
Branch: org.openembedded.dev
Revision: bf929ae0753d0ed4827728cda11e3ebdb73ef689
ViewMTN: http://monotone.openembedded.org/revision/info/bf929ae0753d0ed4827728cda11e3ebdb73ef689
Files:
1
conf/machine/include/gumstix.inc
conf/machine/omap5912osk.conf
packages/gtk+/gdk-pixbuf-csource-native_2.10.14.bb
packages/openmoko2/openmoko-sound-system2_0.1.0.bb
packages/openmoko2/openmoko-sound-theme-standard2_svn.bb
packages/uboot/uboot-openmoko_1.2.0+gitf34024d4a328e6edd906456da98d2c537155c4f7+svn2943.bb
packages/uboot/uboot-openmoko_svn.bb
packages/linux/linux-openmoko-devel/squashfs.patch
conf/distro/include/moko-autorev.inc
packages/linux/linux-openmoko-devel/defconfig
packages/linux/linux-openmoko-devel_svn.bb
Diffs:
#
# mt diff -r3ecc917729c94ee2f23b012b99f74a8a524154c2 -rbf929ae0753d0ed4827728cda11e3ebdb73ef689
#
#
#
# patch "conf/machine/include/gumstix.inc"
# from [a9b8b761a9a47e6df416c842987c359d772d4580]
# to [917537468325dc5643453f037aad76fbeb9bb147]
#
# patch "conf/machine/omap5912osk.conf"
# from [f0942949911d73f57760fb48a9469e67db0154ef]
# to [e1b832be81c4577a78b18536406e78bab2ffa518]
#
# patch "packages/gtk+/gdk-pixbuf-csource-native_2.10.14.bb"
# from [6b749d9ef772b8e60588711e9d902b4292a7e84b]
# to [3c5317edbfb2de05bfdcc53497f5a76d49e833db]
#
# patch "packages/openmoko2/openmoko-sound-system2_0.1.0.bb"
# from [d2d7385073d2de3086a6fc7137fa76d25390a2c1]
# to [2bbb752f84f5cd5d332df9a98b5ab1922ccc2320]
#
# patch "packages/openmoko2/openmoko-sound-theme-standard2_svn.bb"
# from [bfa0e09f44be1950d51c8251ab99fdf9fce69bea]
# to [8d7ac8b5a6221ab35c4c0a274a2edef6f114e8a9]
#
# patch "packages/uboot/uboot-openmoko_1.2.0+gitf34024d4a328e6edd906456da98d2c537155c4f7+svn2943.bb"
# from [b42ad01a57090bd2d30d7aab77b4aa9e3607b31c]
# to [d3999509e6f8e1b8cbcd12aafad259da103400de]
#
# patch "packages/uboot/uboot-openmoko_svn.bb"
# from [a9daac10326cc7c8c5b0dfea1c25a605b5855bc9]
# to [32f83f5ac25253fffe2da4176c4bce6897bd83a1]
#
============================================================
--- conf/machine/include/gumstix.inc a9b8b761a9a47e6df416c842987c359d772d4580
+++ conf/machine/include/gumstix.inc 917537468325dc5643453f037aad76fbeb9bb147
@@ -12,6 +12,7 @@ module_autoload_g_ether = "g_ether"
module_autoload_mmc_block = "mmc_block"
module_autoload_gumstix_gadget = "gumstix_gadget"
module_autoload_g_ether = "g_ether"
+module_autoload_smc91x = "smc91x"
UBOOT_ENTRYPOINT = "a0008000"
@@ -20,6 +21,10 @@ EXTRA_IMAGECMD_jffs2 = "--little-endian
EXTRA_IMAGECMD_jffs2 = "--little-endian --eraseblock=0x20000 --squash"
+# Install all kernel modules
+#MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS = "kernel-modules"
+
+# Install only selected kernel modules, comment out line above also
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS = "kernel-module-unix \
kernel-module-rtc-core \
kernel-module-rtc-dev \
============================================================
--- conf/machine/omap5912osk.conf f0942949911d73f57760fb48a9469e67db0154ef
+++ conf/machine/omap5912osk.conf e1b832be81c4577a78b18536406e78bab2ffa518
@@ -23,7 +23,9 @@ MACHINE_EXTRA_RRECOMMENDS = "kernel-modu
kernel-module-nls-iso8859-1 \
kernel-module-nls-cp437 \
kernel-module-nls-base \
- kernel-module-vfat"
+ kernel-module-vfat \
+ kernel-module-ohci-hcd \
+ "
RDEPENDS_kernel-base = ""
============================================================
--- packages/gtk+/gdk-pixbuf-csource-native_2.10.14.bb 6b749d9ef772b8e60588711e9d902b4292a7e84b
+++ packages/gtk+/gdk-pixbuf-csource-native_2.10.14.bb 3c5317edbfb2de05bfdcc53497f5a76d49e833db
@@ -1,6 +1,6 @@ inherit native
require gtk+_${PV}.bb
inherit native
-DEPENDS = ""
+DEPENDS = "jpeg-native libpng-native"
S = "${WORKDIR}/gtk+-${PV}"
FILESPATH = "${FILE_DIRNAME}/gdk-pixbuf-csource:${FILE_DIRNAME}/gtk+-${PV}:${FILE_DIRNAME}/files"
SRC_URI += "file://reduce-dependencies.patch;patch=1"
@@ -14,6 +14,8 @@ EXTRA_OECONF = "\
--without-x \
--with-gdktarget=linux-fb \
--without-libtiff \
+ --with-libjpeg \
+ --with-libpng \
"
do_compile() {
============================================================
--- packages/openmoko2/openmoko-sound-system2_0.1.0.bb d2d7385073d2de3086a6fc7137fa76d25390a2c1
+++ packages/openmoko2/openmoko-sound-system2_0.1.0.bb 2bbb752f84f5cd5d332df9a98b5ab1922ccc2320
@@ -10,7 +10,9 @@ RDEPENDS = "\
pulseaudio-module-native-protocol-unix \
pulseaudio-module-cli-protocol-unix \
"
-PR = "r0"
+RREPLACES = "openmoko-sound-system"
+RPROVIDES = "openmoko-sound-system"
+PR = "r1"
inherit openmoko-base update-rc.d
============================================================
--- packages/openmoko2/openmoko-sound-theme-standard2_svn.bb bfa0e09f44be1950d51c8251ab99fdf9fce69bea
+++ packages/openmoko2/openmoko-sound-theme-standard2_svn.bb 8d7ac8b5a6221ab35c4c0a274a2edef6f114e8a9
@@ -1,7 +1,9 @@ SECTION = "openmoko/base"
DESCRIPTION = "Standard sound theme for the OpenMoko distribution"
SECTION = "openmoko/base"
+RREPLACES = "openmoko-sound-theme-standard"
+RPROVIDES = "openmoko-sound-theme-standard"
PV = "0.1+svnr${SRCREV}"
-PR = "r0"
+PR = "r1"
inherit openmoko2 autotools
============================================================
--- packages/uboot/uboot-openmoko_1.2.0+gitf34024d4a328e6edd906456da98d2c537155c4f7+svn2943.bb b42ad01a57090bd2d30d7aab77b4aa9e3607b31c
+++ packages/uboot/uboot-openmoko_1.2.0+gitf34024d4a328e6edd906456da98d2c537155c4f7+svn2943.bb d3999509e6f8e1b8cbcd12aafad259da103400de
@@ -9,7 +9,7 @@ PV = "1.2.0+git${UBOOT_UPSTREAM_REV}+svn
UBOOT_MACHINES = "gta01bv2 gta01bv3 gta01bv4"
PV = "1.2.0+git${UBOOT_UPSTREAM_REV}+svn${UBOOT_OPENMOKO_REV}"
-PR = "r0"
+PR = "r1"
PROVIDES = "virtual/bootloader"
S = "${WORKDIR}/git"
@@ -30,16 +30,9 @@ do_svnrev() {
}
do_svnrev() {
- FILE=${S}/tools/setlocalversion
- OLDFILE=$FILE.old
- NEWFILE=$FILE.new
- cp $FILE $OLDFILE
- LINES=`cat $OLDFILE | wc -l`
- LINES_WE_WANT=$(($LINES-1))
- LASTLINE=`cat $OLDFILE | tail -n 1`
- cat $OLDFILE | head -n $LINES_WE_WANT > $NEWFILE
- echo ${LASTLINE}_${PR} >> $NEWFILE
- rm $FILE && mv $NEWFILE $FILE
+ mv -f tools/setlocalversion tools/setlocalversion.old
+ echo -n "echo " >>tools/setlocalversion
+ echo ${PV} >>tools/setlocalversion
}
do_configure_prepend() {
============================================================
--- packages/uboot/uboot-openmoko_svn.bb a9daac10326cc7c8c5b0dfea1c25a605b5855bc9
+++ packages/uboot/uboot-openmoko_svn.bb 32f83f5ac25253fffe2da4176c4bce6897bd83a1
@@ -5,7 +5,7 @@ PV = "1.2.0+git${SRCDATE}+svnr${SRCREV}"
PRIORITY = "optional"
PROVIDES = "virtual/bootloader"
PV = "1.2.0+git${SRCDATE}+svnr${SRCREV}"
-PR = "r0"
+PR = "r1"
SRCREV_FORMAT = "patches"
@@ -30,16 +30,9 @@ do_svnrev() {
}
do_svnrev() {
- FILE=${S}/tools/setlocalversion
- OLDFILE=$FILE.old
- NEWFILE=$FILE.new
- cp $FILE $OLDFILE
- LINES=`cat $OLDFILE | wc -l`
- LINES_WE_WANT=$(($LINES-1))
- LASTLINE=`cat $OLDFILE | tail -n 1`
- cat $OLDFILE | head -n $LINES_WE_WANT > $NEWFILE
- echo ${LASTLINE}_${PR} >> $NEWFILE
- rm $FILE && mv $NEWFILE $FILE
+ mv -f tools/setlocalversion tools/setlocalversion.old
+ echo -n "echo " >>tools/setlocalversion
+ echo ${PV} >>tools/setlocalversion
}
do_configure_prepend() {
#
# mt diff -rcc4ff44ab8858d40dac79ae6b3e11d75dbd68c10 -rbf929ae0753d0ed4827728cda11e3ebdb73ef689
#
#
#
# add_file "packages/linux/linux-openmoko-devel/squashfs.patch"
# content [f02adcc4dcc701eebc77fc31e6cb8a4ed17a7906]
#
# patch "conf/distro/include/moko-autorev.inc"
# from [7ab3e4a626dd86961455dfee876c957f998cfb14]
# to [cb196173c3a1b600e59b8b160c7290b856d0faa5]
#
# patch "packages/linux/linux-openmoko-devel/defconfig"
# from [e0d5e01862edf513ce61dd257d3e4a6790a4bfab]
# to [5006da7a604a90f24c0dd8a2e8506dbbd8cbdcbe]
#
# patch "packages/linux/linux-openmoko-devel_svn.bb"
# from [caff0d74c55eaddbfbb6f991685014f4afe718f1]
# to [aa4cafaa0349ca6de84aa37d4653ee0925325284]
#
============================================================
--- packages/linux/linux-openmoko-devel/squashfs.patch f02adcc4dcc701eebc77fc31e6cb8a4ed17a7906
+++ packages/linux/linux-openmoko-devel/squashfs.patch f02adcc4dcc701eebc77fc31e6cb8a4ed17a7906
@@ -0,0 +1,4386 @@
+diff -x .gitignore -Nurp linux-2.6.20/fs/Kconfig linux-2.6.20-squashfs3.2-r2/fs/Kconfig
+--- linux-2.6.20/fs/Kconfig 2006-12-25 01:13:12.000000000 +0000
++++ linux-2.6.20-squashfs3.2-r2/fs/Kconfig 2007-01-16 02:06:03.000000000 +0000
+@@ -1404,6 +1404,71 @@ config CRAMFS
+
+ If unsure, say N.
+
++config SQUASHFS
++ tristate "SquashFS 3.2 - Squashed file system support"
++ select ZLIB_INFLATE
++ help
++ Saying Y here includes support for SquashFS 3.2 (a Compressed Read-Only File
++ System). Squashfs is a highly compressed read-only filesystem for Linux.
++ It uses zlib compression to compress both files, inodes and directories.
++ Inodes in the system are very small and all blocks are packed to minimise
++ data overhead. Block sizes greater than 4K are supported up to a maximum of 64K.
++ SquashFS 3.1 supports 64 bit filesystems and files (larger than 4GB), full
++ uid/gid information, hard links and timestamps.
++
++ Squashfs is intended for general read-only filesystem use, for archival
++ use (i.e. in cases where a .tar.gz file may be used), and in embedded
++ systems where low overhead is needed. Further information and filesystem tools
++ are available from http://squashfs.sourceforge.net.
++
++ If you want to compile this as a module ( = code which can be
++ inserted in and removed from the running kernel whenever you want),
++ say M here and read <file:Documentation/modules.txt>. The module
++ will be called squashfs. Note that the root file system (the one
++ containing the directory /) cannot be compiled as a module.
++
++ If unsure, say N.
++
++config SQUASHFS_EMBEDDED
++
++ bool "Additional options for memory-constrained systems"
++ depends on SQUASHFS
++ default n
++ help
++ Saying Y here allows you to specify cache sizes and how Squashfs
++ allocates memory. This is only intended for memory constrained
++ systems.
++
++ If unsure, say N.
++
++config SQUASHFS_FRAGMENT_CACHE_SIZE
++ int "Number of fragments cached" if SQUASHFS_EMBEDDED
++ depends on SQUASHFS
++ default "3"
++ help
++ By default SquashFS caches the last 3 fragments read from
++ the filesystem. Increasing this amount may mean SquashFS
++ has to re-read fragments less often from disk, at the expense
++ of extra system memory. Decreasing this amount will mean
++ SquashFS uses less memory at the expense of extra reads from disk.
++
++ Note there must be at least one cached fragment. Anything
++ much more than three will probably not make much difference.
++
++config SQUASHFS_VMALLOC
++ bool "Use Vmalloc rather than Kmalloc" if SQUASHFS_EMBEDDED
++ depends on SQUASHFS
++ default n
++ help
++ By default SquashFS uses kmalloc to obtain fragment cache memory.
++ Kmalloc memory is the standard kernel allocator, but it can fail
++ on memory constrained systems. Because of the way Vmalloc works,
++ Vmalloc can succeed when kmalloc fails. Specifying this option
++ will make SquashFS always use Vmalloc to allocate the
++ fragment cache memory.
++
++ If unsure, say N.
++
+ config VXFS_FS
+ tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)"
+ depends on BLOCK
+diff -x .gitignore -Nurp linux-2.6.20/fs/Makefile linux-2.6.20-squashfs3.2-r2/fs/Makefile
+--- linux-2.6.20/fs/Makefile 2006-12-25 01:13:12.000000000 +0000
++++ linux-2.6.20-squashfs3.2-r2/fs/Makefile 2007-01-16 02:06:03.000000000 +0000
+@@ -68,6 +68,7 @@ obj-$(CONFIG_JBD) += jbd/
+ obj-$(CONFIG_JBD2) += jbd2/
+ obj-$(CONFIG_EXT2_FS) += ext2/
+ obj-$(CONFIG_CRAMFS) += cramfs/
++obj-$(CONFIG_SQUASHFS) += squashfs/
+ obj-$(CONFIG_RAMFS) += ramfs/
+ obj-$(CONFIG_HUGETLBFS) += hugetlbfs/
+ obj-$(CONFIG_CODA_FS) += coda/
+diff -x .gitignore -Nurp linux-2.6.20/fs/squashfs/inode.c linux-2.6.20-squashfs3.2-r2/fs/squashfs/inode.c
+--- linux-2.6.20/fs/squashfs/inode.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.20-squashfs3.2-r2/fs/squashfs/inode.c 2007-01-16 02:28:36.000000000 +0000
+@@ -0,0 +1,2329 @@
++/*
++ * Squashfs - a compressed read only filesystem for Linux
++ *
++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007
++ * Phillip Lougher <phillip at lougher.org.uk>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ * inode.c
++ */
++
++#include <linux/squashfs_fs.h>
++#include <linux/module.h>
++#include <linux/zlib.h>
++#include <linux/fs.h>
++#include <linux/squashfs_fs_sb.h>
++#include <linux/squashfs_fs_i.h>
++#include <linux/buffer_head.h>
++#include <linux/vfs.h>
++#include <linux/vmalloc.h>
++#include <linux/smp_lock.h>
++
++#include "squashfs.h"
++
++static void vfs_read_inode(struct inode *i);
++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 *);
++static int squashfs_symlink_readpage(struct file *file, struct page *page);
++static long long read_blocklist(struct inode *inode, int index,
++ int readahead_blks, char *block_list,
++ unsigned short **block_p, unsigned int *bsize);
++static int squashfs_readpage(struct file *file, struct page *page);
++static int squashfs_readpage4K(struct file *file, struct page *page);
++static int squashfs_readdir(struct file *, void *, filldir_t);
++static struct dentry *squashfs_lookup(struct inode *, struct dentry *,
++ struct nameidata *);
++static int squashfs_remount(struct super_block *s, int *flags, char *data);
++static void squashfs_put_super(struct super_block *);
++static int squashfs_get_sb(struct file_system_type *,int, const char *, void *,
++ struct vfsmount *);
++static struct inode *squashfs_alloc_inode(struct super_block *sb);
++static void squashfs_destroy_inode(struct inode *inode);
++static int init_inodecache(void);
++static void destroy_inodecache(void);
++
++static struct file_system_type squashfs_fs_type = {
++ .owner = THIS_MODULE,
++ .name = "squashfs",
++ .get_sb = squashfs_get_sb,
++ .kill_sb = kill_block_super,
++ .fs_flags = FS_REQUIRES_DEV
++};
++
++static const unsigned char squashfs_filetype_table[] = {
++ DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_FIFO, DT_SOCK
++};
++
++static struct super_operations squashfs_super_ops = {
++ .alloc_inode = squashfs_alloc_inode,
++ .destroy_inode = squashfs_destroy_inode,
++ .statfs = squashfs_statfs,
++ .put_super = squashfs_put_super,
++ .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 = {
++ .get_parent = squashfs_get_parent
++};
++
++SQSH_EXTERN const struct address_space_operations squashfs_symlink_aops = {
++ .readpage = squashfs_symlink_readpage
++};
++
++SQSH_EXTERN const struct address_space_operations squashfs_aops = {
++ .readpage = squashfs_readpage
++};
++
++SQSH_EXTERN const struct address_space_operations squashfs_aops_4K = {
++ .readpage = squashfs_readpage4K
++};
++
++static const struct file_operations squashfs_dir_ops = {
++ .read = generic_read_dir,
++ .readdir = squashfs_readdir
++};
++
++SQSH_EXTERN struct inode_operations squashfs_dir_inode_ops = {
++ .lookup = squashfs_lookup
++};
++
++
++static struct buffer_head *get_block_length(struct super_block *s,
++ int *cur_index, int *offset, int *c_byte)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ unsigned short temp;
++ struct buffer_head *bh;
++
++ if (!(bh = sb_bread(s, *cur_index)))
++ goto out;
++
++ if (msblk->devblksize - *offset == 1) {
++ if (msblk->swap)
++ ((unsigned char *) &temp)[1] = *((unsigned char *)
++ (bh->b_data + *offset));
++ else
++ ((unsigned char *) &temp)[0] = *((unsigned char *)
++ (bh->b_data + *offset));
++ brelse(bh);
++ if (!(bh = sb_bread(s, ++(*cur_index))))
++ goto out;
++ if (msblk->swap)
++ ((unsigned char *) &temp)[0] = *((unsigned char *)
++ bh->b_data);
++ else
++ ((unsigned char *) &temp)[1] = *((unsigned char *)
++ bh->b_data);
++ *c_byte = temp;
++ *offset = 1;
++ } else {
++ if (msblk->swap) {
++ ((unsigned char *) &temp)[1] = *((unsigned char *)
++ (bh->b_data + *offset));
++ ((unsigned char *) &temp)[0] = *((unsigned char *)
++ (bh->b_data + *offset + 1));
++ } else {
++ ((unsigned char *) &temp)[0] = *((unsigned char *)
++ (bh->b_data + *offset));
++ ((unsigned char *) &temp)[1] = *((unsigned char *)
++ (bh->b_data + *offset + 1));
++ }
++ *c_byte = temp;
++ *offset += 2;
++ }
++
++ if (SQUASHFS_CHECK_DATA(msblk->sblk.flags)) {
++ if (*offset == msblk->devblksize) {
++ brelse(bh);
++ if (!(bh = sb_bread(s, ++(*cur_index))))
++ goto out;
++ *offset = 0;
++ }
++ if (*((unsigned char *) (bh->b_data + *offset)) !=
++ SQUASHFS_MARKER_BYTE) {
++ ERROR("Metadata block marker corrupt @ %x\n",
++ *cur_index);
++ brelse(bh);
++ goto out;
++ }
++ (*offset)++;
++ }
++ return bh;
++
++out:
++ return NULL;
++}
++
++
++SQSH_EXTERN unsigned int squashfs_read_data(struct super_block *s, char *buffer,
++ long long index, unsigned int length,
++ long long *next_index, int srclength)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ struct buffer_head *bh[((SQUASHFS_FILE_MAX_SIZE - 1) >>
++ msblk->devblksize_log2) + 2];
++ unsigned int offset = index & ((1 << msblk->devblksize_log2) - 1);
++ unsigned int cur_index = index >> msblk->devblksize_log2;
++ int bytes, avail_bytes, b = 0, k = 0;
++ unsigned int compressed;
++ unsigned int c_byte = length;
++
++ if (c_byte) {
++ bytes = msblk->devblksize - offset;
++ compressed = SQUASHFS_COMPRESSED_BLOCK(c_byte);
++ c_byte = SQUASHFS_COMPRESSED_SIZE_BLOCK(c_byte);
++
++ TRACE("Block @ 0x%llx, %scompressed size %d, src size %d\n", index, compressed
++ ? "" : "un", (unsigned int) c_byte, srclength);
++
++ if (c_byte > srclength || index < 0 || (index + c_byte) > sblk->bytes_used)
++ goto read_failure;
++
++ if (!(bh[0] = sb_getblk(s, cur_index)))
++ goto block_release;
++
++ for (b = 1; bytes < c_byte; b++) {
++ if (!(bh[b] = sb_getblk(s, ++cur_index)))
++ goto block_release;
++ bytes += msblk->devblksize;
++ }
++ ll_rw_block(READ, b, bh);
++ } else {
++ if (index < 0 || (index + 2) > sblk->bytes_used)
++ goto read_failure;
++
++ if (!(bh[0] = get_block_length(s, &cur_index, &offset,
++ &c_byte)))
++ goto read_failure;
++
++ bytes = msblk->devblksize - offset;
++ compressed = SQUASHFS_COMPRESSED(c_byte);
++ c_byte = SQUASHFS_COMPRESSED_SIZE(c_byte);
++
++ TRACE("Block @ 0x%llx, %scompressed size %d\n", index, compressed
++ ? "" : "un", (unsigned int) c_byte);
++
++ if (c_byte > srclength || (index + c_byte) > sblk->bytes_used)
++ goto read_failure;
++
++ for (b = 1; bytes < c_byte; b++) {
++ if (!(bh[b] = sb_getblk(s, ++cur_index)))
++ goto block_release;
++ bytes += msblk->devblksize;
++ }
++ ll_rw_block(READ, b - 1, bh + 1);
++ }
++
++ if (compressed) {
++ int zlib_err = 0;
++
++ /*
++ * uncompress block
++ */
++
++ mutex_lock(&msblk->read_data_mutex);
++
++ msblk->stream.next_out = buffer;
++ msblk->stream.avail_out = srclength;
++
++ for (bytes = 0; k < b; k++) {
++ avail_bytes = (c_byte - bytes) > (msblk->devblksize - offset) ?
++ msblk->devblksize - offset :
++ c_byte - bytes;
++ wait_on_buffer(bh[k]);
++ if (!buffer_uptodate(bh[k]))
++ goto release_mutex;
++
++ msblk->stream.next_in = bh[k]->b_data + offset;
++ msblk->stream.avail_in = avail_bytes;
++
++ if (k == 0) {
++ zlib_err = zlib_inflateInit(&msblk->stream);
++ if (zlib_err != Z_OK) {
++ ERROR("zlib_inflateInit returned unexpected result 0x%x, srclength %d\n",
++ zlib_err, srclength);
++ goto release_mutex;
++ }
++
++ if (avail_bytes == 0) {
++ offset = 0;
++ brelse(bh[k]);
++ continue;
++ }
++ }
++
++ zlib_err = zlib_inflate(&msblk->stream, Z_NO_FLUSH);
++ if (zlib_err != Z_OK && zlib_err != Z_STREAM_END) {
++ ERROR("zlib_inflate returned unexpected result 0x%x, srclength %d, avail_in %d, avail_out %d\n",
++ zlib_err, srclength, msblk->stream.avail_in, msblk->stream.avail_out);
++ goto release_mutex;
++ }
++
++ bytes += avail_bytes;
++ offset = 0;
++ brelse(bh[k]);
++ }
++
++ if (zlib_err != Z_STREAM_END)
++ goto release_mutex;
++
++ zlib_err = zlib_inflateEnd(&msblk->stream);
++ if (zlib_err != Z_OK) {
++ ERROR("zlib_inflateEnd returned unexpected result 0x%x, srclength %d\n",
++ zlib_err, srclength);
++ goto release_mutex;
++ }
++ bytes = msblk->stream.total_out;
++ mutex_unlock(&msblk->read_data_mutex);
++ } else {
++ int i;
++
++ for(i = 0; i < b; i++) {
++ wait_on_buffer(bh[i]);
++ if(!buffer_uptodate(bh[i]))
++ goto block_release;
++ }
++
++ for (bytes = 0; k < b; k++) {
++ avail_bytes = (c_byte - bytes) > (msblk->devblksize - offset) ?
++ msblk->devblksize - offset :
++ c_byte - bytes;
++ memcpy(buffer + bytes, bh[k]->b_data + offset, avail_bytes);
++ bytes += avail_bytes;
++ offset = 0;
++ brelse(bh[k]);
++ }
++ }
++
++ if (next_index)
++ *next_index = index + c_byte + (length ? 0 :
++ (SQUASHFS_CHECK_DATA(msblk->sblk.flags)
++ ? 3 : 2));
++ return bytes;
++
++release_mutex:
++ mutex_unlock(&msblk->read_data_mutex);
++
++block_release:
++ for (; k < b; k++)
++ brelse(bh[k]);
++
++read_failure:
++ ERROR("sb_bread failed reading block 0x%x\n", cur_index);
++ return 0;
++}
++
++
++SQSH_EXTERN int squashfs_get_cached_block(struct super_block *s, char *buffer,
++ long long block, unsigned int offset,
++ int length, long long *next_block,
++ unsigned int *next_offset)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ int n, i, bytes, return_length = length;
++ long long next_index;
++
++ TRACE("Entered squashfs_get_cached_block [%llx:%x]\n", block, offset);
++
++ while ( 1 ) {
++ for (i = 0; i < SQUASHFS_CACHED_BLKS; i++)
++ if (msblk->block_cache[i].block == block)
++ break;
++
++ mutex_lock(&msblk->block_cache_mutex);
++
++ if (i == SQUASHFS_CACHED_BLKS) {
++ /* read inode header block */
++ for (i = msblk->next_cache, n = SQUASHFS_CACHED_BLKS;
++ n ; n --, i = (i + 1) %
++ SQUASHFS_CACHED_BLKS)
++ if (msblk->block_cache[i].block !=
++ SQUASHFS_USED_BLK)
++ break;
++
++ if (n == 0) {
++ wait_queue_t wait;
++
++ init_waitqueue_entry(&wait, current);
++ add_wait_queue(&msblk->waitq, &wait);
++ set_current_state(TASK_UNINTERRUPTIBLE);
++ mutex_unlock(&msblk->block_cache_mutex);
++ schedule();
++ set_current_state(TASK_RUNNING);
++ remove_wait_queue(&msblk->waitq, &wait);
++ continue;
%s
>>> DIFF TRUNCATED @ 16K
More information about the Openembedded-commits
mailing list