From 3a255aef4c2e55d743db5f95a43e8cd1d466294a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20L=C3=BCbbe?= Date: Mon, 12 Jan 2009 13:47:56 +0000 Subject: linux-openmoko-{2.6.28/devel}: remove spourious -2.6.28 files and base config on gta02-packaging-defconfig --- .../linux/linux-openmoko-2.6.28/defconfig-oe.patch | 283 +- packages/linux/linux-openmoko-2.6.28_git.bb | 4 +- .../linux/linux-openmoko-devel/defconfig-oe.patch | 292 +- .../0001-squashfs-with-lzma.patch | 5342 -------------------- .../0002-squashfs-initrd.patch | 55 - .../0003-squashfs-force-O2.patch | 17 - .../0004-squashfs-Kconfig.patch | 61 - .../0005-squashfs-Makefile.patch | 12 - .../linux-openmoko-2.6.28/defconfig-oe.patch | 296 -- .../openwrt-ledtrig-netdev.patch | 474 -- packages/linux/linux-openmoko-devel_git.bb | 4 +- 11 files changed, 28 insertions(+), 6812 deletions(-) delete mode 100644 packages/linux/linux-openmoko-devel/linux-openmoko-2.6.28/0001-squashfs-with-lzma.patch delete mode 100644 packages/linux/linux-openmoko-devel/linux-openmoko-2.6.28/0002-squashfs-initrd.patch delete mode 100644 packages/linux/linux-openmoko-devel/linux-openmoko-2.6.28/0003-squashfs-force-O2.patch delete mode 100644 packages/linux/linux-openmoko-devel/linux-openmoko-2.6.28/0004-squashfs-Kconfig.patch delete mode 100644 packages/linux/linux-openmoko-devel/linux-openmoko-2.6.28/0005-squashfs-Makefile.patch delete mode 100644 packages/linux/linux-openmoko-devel/linux-openmoko-2.6.28/defconfig-oe.patch delete mode 100644 packages/linux/linux-openmoko-devel/linux-openmoko-2.6.28/openwrt-ledtrig-netdev.patch (limited to 'packages') diff --git a/packages/linux/linux-openmoko-2.6.28/defconfig-oe.patch b/packages/linux/linux-openmoko-2.6.28/defconfig-oe.patch index faca44adef..109e9ec83d 100644 --- a/packages/linux/linux-openmoko-2.6.28/defconfig-oe.patch +++ b/packages/linux/linux-openmoko-2.6.28/defconfig-oe.patch @@ -1,203 +1,16 @@ ---- defconfig-oe 2009-01-09 15:38:56.000000000 +0000 -+++ defconfig-oe 2009-01-09 16:37:51.000000000 +0000 -@@ -505,8 +505,8 @@ +--- gta02-packaging-defconfig 2009-01-12 13:09:33.000000000 +0000 ++++ defconfig-oe 2009-01-12 13:18:23.000000000 +0000 +@@ -337,9 +337,6 @@ # - # IP: Netfilter Configuration + # At least one emulation must be selected # --CONFIG_NF_DEFRAG_IPV4=y --CONFIG_NF_CONNTRACK_IPV4=y -+CONFIG_NF_DEFRAG_IPV4=m -+CONFIG_NF_CONNTRACK_IPV4=m - # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set - # CONFIG_IP_NF_QUEUE is not set - CONFIG_IP_NF_IPTABLES=m -@@ -584,12 +584,12 @@ - # CONFIG_IP_SCTP is not set - # CONFIG_TIPC is not set - # CONFIG_ATM is not set --CONFIG_STP=y --CONFIG_BRIDGE=y -+CONFIG_STP=m -+CONFIG_BRIDGE=m - # CONFIG_NET_DSA is not set - # CONFIG_VLAN_8021Q is not set - # CONFIG_DECNET is not set --CONFIG_LLC=y -+CONFIG_LLC=m - # CONFIG_LLC2 is not set - # CONFIG_IPX is not set - # CONFIG_ATALK is not set -@@ -642,20 +642,20 @@ - # CONFIG_HAMRADIO is not set - # CONFIG_CAN is not set - # CONFIG_IRDA is not set --CONFIG_BT=y --CONFIG_BT_L2CAP=y --CONFIG_BT_SCO=y --CONFIG_BT_RFCOMM=y -+CONFIG_BT=m -+CONFIG_BT_L2CAP=m -+CONFIG_BT_SCO=m -+CONFIG_BT_RFCOMM=m - CONFIG_BT_RFCOMM_TTY=y --CONFIG_BT_BNEP=y -+CONFIG_BT_BNEP=m - CONFIG_BT_BNEP_MC_FILTER=y - CONFIG_BT_BNEP_PROTO_FILTER=y --CONFIG_BT_HIDP=y -+CONFIG_BT_HIDP=m +-CONFIG_FPE_NWFPE=y +-# CONFIG_FPE_NWFPE_XP is not set +-# CONFIG_FPE_FASTFPE is not set # - # Bluetooth device drivers - # --CONFIG_BT_HCIBTUSB=y -+CONFIG_BT_HCIBTUSB=m - # CONFIG_BT_HCIBTSDIO is not set - # CONFIG_BT_HCIUART is not set - # CONFIG_BT_HCIBCM203X is not set -@@ -867,24 +867,10 @@ - # CONFIG_BONDING is not set - # CONFIG_MACVLAN is not set - # CONFIG_EQUALIZER is not set --CONFIG_TUN=y -+CONFIG_TUN=m - # CONFIG_VETH is not set --# CONFIG_PHYLIB is not set --CONFIG_NET_ETHERNET=y -+# CONFIG_NET_ETHERNET is not set - CONFIG_MII=y --# CONFIG_AX88796 is not set --# CONFIG_SMC91X is not set --# CONFIG_DM9000 is not set --# CONFIG_ENC28J60 is not set --# CONFIG_SMC911X is not set --# CONFIG_IBM_NEW_EMAC_ZMII is not set --# CONFIG_IBM_NEW_EMAC_RGMII is not set --# CONFIG_IBM_NEW_EMAC_TAH is not set --# CONFIG_IBM_NEW_EMAC_EMAC4 is not set --# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set --# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set --# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set --# CONFIG_B44 is not set - # CONFIG_NETDEV_1000 is not set - # CONFIG_NETDEV_10000 is not set - -@@ -922,18 +908,18 @@ - CONFIG_USB_NET_ZAURUS=m - # CONFIG_USB_HSO is not set - # CONFIG_WAN is not set --CONFIG_PPP=y -+CONFIG_PPP=m - CONFIG_PPP_MULTILINK=y - CONFIG_PPP_FILTER=y --CONFIG_PPP_ASYNC=y --CONFIG_PPP_SYNC_TTY=y --CONFIG_PPP_DEFLATE=y --CONFIG_PPP_BSDCOMP=y --CONFIG_PPP_MPPE=y -+CONFIG_PPP_ASYNC=m -+CONFIG_PPP_SYNC_TTY=m -+CONFIG_PPP_DEFLATE=m -+CONFIG_PPP_BSDCOMP=m -+CONFIG_PPP_MPPE=m - # CONFIG_PPPOE is not set - # CONFIG_PPPOL2TP is not set - # CONFIG_SLIP is not set --CONFIG_SLHC=y -+CONFIG_SLHC=m - # CONFIG_NETCONSOLE is not set - # CONFIG_NETPOLL is not set - # CONFIG_NET_POLL_CONTROLLER is not set -@@ -1347,17 +1333,17 @@ - # CONFIG_FONT_SUN12x22 is not set - # CONFIG_FONT_10x18 is not set - # CONFIG_LOGO is not set --CONFIG_SOUND=y -+CONFIG_SOUND=m - CONFIG_SOUND_OSS_CORE=y --CONFIG_SND=y --CONFIG_SND_TIMER=y --CONFIG_SND_PCM=y -+CONFIG_SND=m -+CONFIG_SND_TIMER=m -+CONFIG_SND_PCM=m - CONFIG_SND_HWDEP=m - CONFIG_SND_RAWMIDI=m - # CONFIG_SND_SEQUENCER is not set - CONFIG_SND_OSSEMUL=y --CONFIG_SND_MIXER_OSS=y --CONFIG_SND_PCM_OSS=y -+CONFIG_SND_MIXER_OSS=m -+CONFIG_SND_PCM_OSS=m - CONFIG_SND_PCM_OSS_PLUGINS=y - # CONFIG_SND_DYNAMIC_MINORS is not set - CONFIG_SND_SUPPORT_OLD_API=y -@@ -1376,13 +1362,13 @@ - CONFIG_SND_USB=y - CONFIG_SND_USB_AUDIO=m - # CONFIG_SND_USB_CAIAQ is not set --CONFIG_SND_SOC=y --CONFIG_SND_S3C24XX_SOC=y --CONFIG_SND_S3C24XX_SOC_I2S=y --CONFIG_SND_S3C24XX_SOC_NEO1973_GTA02_WM8753=y -+CONFIG_SND_SOC=m -+CONFIG_SND_S3C24XX_SOC=m -+CONFIG_SND_S3C24XX_SOC_I2S=m -+CONFIG_SND_S3C24XX_SOC_NEO1973_GTA02_WM8753=m - # CONFIG_SND_S3C24XX_SOC_LN2440SBC_ALC650 is not set - # CONFIG_SND_SOC_ALL_CODECS is not set --CONFIG_SND_SOC_WM8753=y -+CONFIG_SND_SOC_WM8753=m - # CONFIG_SOUND_PRIME is not set - CONFIG_HID_SUPPORT=y - CONFIG_HID=y -@@ -1462,7 +1448,7 @@ - # - # USB Device Class drivers - # --CONFIG_USB_ACM=y -+CONFIG_USB_ACM=m - CONFIG_USB_PRINTER=m - # CONFIG_USB_WDM is not set - CONFIG_USB_TMC=m -@@ -1474,7 +1460,7 @@ - # - # may also be needed; see USB_STORAGE Help for more information - # --CONFIG_USB_STORAGE=y -+CONFIG_USB_STORAGE=m - # CONFIG_USB_STORAGE_DEBUG is not set - CONFIG_USB_STORAGE_DATAFAB=y - CONFIG_USB_STORAGE_FREECOM=y -@@ -1499,8 +1485,7 @@ - # - # USB port drivers - # --CONFIG_USB_SERIAL=y --CONFIG_USB_SERIAL_CONSOLE=y -+CONFIG_USB_SERIAL=m - CONFIG_USB_EZUSB=y - CONFIG_USB_SERIAL_GENERIC=y - CONFIG_USB_SERIAL_AIRCABLE=m -@@ -1541,7 +1526,7 @@ - CONFIG_USB_SERIAL_TI=m - CONFIG_USB_SERIAL_CYBERJACK=m - CONFIG_USB_SERIAL_XIRCOM=m --CONFIG_USB_SERIAL_OPTION=y -+CONFIG_USB_SERIAL_OPTION=m - CONFIG_USB_SERIAL_OMNINET=m - # CONFIG_USB_SERIAL_DEBUG is not set - -@@ -1601,7 +1586,7 @@ - # CONFIG_USB_MIDI_GADGET is not set - # CONFIG_USB_G_PRINTER is not set - # CONFIG_USB_CDC_COMPOSITE is not set --CONFIG_AR6000_WLAN=y -+CONFIG_AR6000_WLAN=m - CONFIG_MMC=y - # CONFIG_MMC_DEBUG is not set - CONFIG_MMC_UNSAFE_RESUME=y -@@ -1641,9 +1626,10 @@ + # Userspace binary formats +@@ -1634,9 +1631,10 @@ # CONFIG_LEDS_TRIGGERS=y CONFIG_LEDS_TRIGGER_TIMER=y @@ -209,88 +22,16 @@ CONFIG_RTC_LIB=y CONFIG_RTC_CLASS=y CONFIG_RTC_HCTOSYS=y -@@ -1738,21 +1724,21 @@ - # - # File systems - # --CONFIG_EXT2_FS=y -+CONFIG_EXT2_FS=m - # CONFIG_EXT2_FS_XATTR is not set - # CONFIG_EXT2_FS_XIP is not set --CONFIG_EXT3_FS=y -+CONFIG_EXT3_FS=m - # CONFIG_EXT3_FS_XATTR is not set --CONFIG_EXT4_FS=y -+CONFIG_EXT4_FS=m - CONFIG_EXT4DEV_COMPAT=y - CONFIG_EXT4_FS_XATTR=y - # CONFIG_EXT4_FS_POSIX_ACL is not set - CONFIG_EXT4_FS_SECURITY=y --CONFIG_JBD=y -+CONFIG_JBD=m - # CONFIG_JBD_DEBUG is not set --CONFIG_JBD2=y -+CONFIG_JBD2=m - # CONFIG_JBD2_DEBUG is not set --CONFIG_FS_MBCACHE=y -+CONFIG_FS_MBCACHE=m - # CONFIG_REISERFS_FS is not set - # CONFIG_JFS_FS is not set - CONFIG_FS_POSIX_ACL=y -@@ -1778,9 +1764,9 @@ - # - # DOS/FAT/NT Filesystems - # --CONFIG_FAT_FS=y --CONFIG_MSDOS_FS=y --CONFIG_VFAT_FS=y -+CONFIG_FAT_FS=m -+CONFIG_MSDOS_FS=m -+CONFIG_VFAT_FS=m - CONFIG_FAT_DEFAULT_CODEPAGE=437 - CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" - # CONFIG_NTFS_FS is not set -@@ -1828,15 +1814,19 @@ +@@ -1822,7 +1820,11 @@ # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set CONFIG_NETWORK_FILESYSTEMS=y -# CONFIG_NFS_FS is not set --CONFIG_NFSD=y -+CONFIG_NFS_FS=y ++CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +# CONFIG_NFS_V4 is not set +CONFIG_ROOT_NFS=y -+CONFIG_NFSD=m + CONFIG_NFSD=m CONFIG_NFSD_V2_ACL=y CONFIG_NFSD_V3=y - CONFIG_NFSD_V3_ACL=y - # CONFIG_NFSD_V4 is not set - CONFIG_LOCKD=y - CONFIG_LOCKD_V4=y --CONFIG_EXPORTFS=y -+CONFIG_EXPORTFS=m - CONFIG_NFS_ACL_SUPPORT=y - CONFIG_NFS_COMMON=y - CONFIG_SUNRPC=y -@@ -1875,9 +1865,9 @@ - # CONFIG_KARMA_PARTITION is not set - # CONFIG_EFI_PARTITION is not set - # CONFIG_SYSV68_PARTITION is not set --CONFIG_NLS=y -+CONFIG_NLS=m - CONFIG_NLS_DEFAULT="iso8859-1" --CONFIG_NLS_CODEPAGE_437=y -+CONFIG_NLS_CODEPAGE_437=m - # CONFIG_NLS_CODEPAGE_737 is not set - # CONFIG_NLS_CODEPAGE_775 is not set - CONFIG_NLS_CODEPAGE_850=m -@@ -1901,7 +1891,7 @@ - # CONFIG_NLS_CODEPAGE_1250 is not set - # CONFIG_NLS_CODEPAGE_1251 is not set - # CONFIG_NLS_ASCII is not set --CONFIG_NLS_ISO8859_1=y -+CONFIG_NLS_ISO8859_1=m - # CONFIG_NLS_ISO8859_2 is not set - # CONFIG_NLS_ISO8859_3 is not set - # CONFIG_NLS_ISO8859_4 is not set diff --git a/packages/linux/linux-openmoko-2.6.28_git.bb b/packages/linux/linux-openmoko-2.6.28_git.bb index 2389db2bcd..e37742caa2 100644 --- a/packages/linux/linux-openmoko-2.6.28_git.bb +++ b/packages/linux/linux-openmoko-2.6.28_git.bb @@ -8,7 +8,7 @@ KERNEL_VERSION = "${KERNEL_RELEASE}" OEV = "oe1" PV = "${KERNEL_RELEASE}-${OEV}+gitr${SRCREV}" -PR = "r1" +PR = "r2" SRC_URI = "\ git://git.openmoko.org/git/kernel.git;protocol=git;branch=andy-tracking \ @@ -18,7 +18,7 @@ SRC_URI = "\ S = "${WORKDIR}/git" do_configure_prepend() { - install -m 644 ./arch/arm/configs/gta02-moredrivers-defconfig ${WORKDIR}/defconfig-oe + install -m 644 ./arch/arm/configs/gta02-packaging-defconfig ${WORKDIR}/defconfig-oe cat ${WORKDIR}/defconfig-oe.patch | patch -p0 -d ${WORKDIR} } diff --git a/packages/linux/linux-openmoko-devel/defconfig-oe.patch b/packages/linux/linux-openmoko-devel/defconfig-oe.patch index 1bcf4463d0..109e9ec83d 100644 --- a/packages/linux/linux-openmoko-devel/defconfig-oe.patch +++ b/packages/linux/linux-openmoko-devel/defconfig-oe.patch @@ -1,212 +1,16 @@ ---- defconfig-oe 2009-01-09 15:38:56.000000000 +0000 -+++ defconfig-oe 2009-01-09 16:37:51.000000000 +0000 -@@ -1,7 +1,7 @@ +--- gta02-packaging-defconfig 2009-01-12 13:09:33.000000000 +0000 ++++ defconfig-oe 2009-01-12 13:18:23.000000000 +0000 +@@ -337,9 +337,6 @@ # - # Automatically generated make config: don't edit - # Linux kernel version: 2.6.28-rc4 --# Thu Jan 8 20:00:01 2009 -+# Fri Jan 9 16:37:51 2009 + # At least one emulation must be selected # - CONFIG_ARM=y - CONFIG_HAVE_PWM=y -@@ -505,8 +505,8 @@ - # - # IP: Netfilter Configuration - # --CONFIG_NF_DEFRAG_IPV4=y --CONFIG_NF_CONNTRACK_IPV4=y -+CONFIG_NF_DEFRAG_IPV4=m -+CONFIG_NF_CONNTRACK_IPV4=m - # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set - # CONFIG_IP_NF_QUEUE is not set - CONFIG_IP_NF_IPTABLES=m -@@ -584,12 +584,12 @@ - # CONFIG_IP_SCTP is not set - # CONFIG_TIPC is not set - # CONFIG_ATM is not set --CONFIG_STP=y --CONFIG_BRIDGE=y -+CONFIG_STP=m -+CONFIG_BRIDGE=m - # CONFIG_NET_DSA is not set - # CONFIG_VLAN_8021Q is not set - # CONFIG_DECNET is not set --CONFIG_LLC=y -+CONFIG_LLC=m - # CONFIG_LLC2 is not set - # CONFIG_IPX is not set - # CONFIG_ATALK is not set -@@ -642,20 +642,20 @@ - # CONFIG_HAMRADIO is not set - # CONFIG_CAN is not set - # CONFIG_IRDA is not set --CONFIG_BT=y --CONFIG_BT_L2CAP=y --CONFIG_BT_SCO=y --CONFIG_BT_RFCOMM=y -+CONFIG_BT=m -+CONFIG_BT_L2CAP=m -+CONFIG_BT_SCO=m -+CONFIG_BT_RFCOMM=m - CONFIG_BT_RFCOMM_TTY=y --CONFIG_BT_BNEP=y -+CONFIG_BT_BNEP=m - CONFIG_BT_BNEP_MC_FILTER=y - CONFIG_BT_BNEP_PROTO_FILTER=y --CONFIG_BT_HIDP=y -+CONFIG_BT_HIDP=m - - # - # Bluetooth device drivers - # --CONFIG_BT_HCIBTUSB=y -+CONFIG_BT_HCIBTUSB=m - # CONFIG_BT_HCIBTSDIO is not set - # CONFIG_BT_HCIUART is not set - # CONFIG_BT_HCIBCM203X is not set -@@ -867,24 +867,10 @@ - # CONFIG_BONDING is not set - # CONFIG_MACVLAN is not set - # CONFIG_EQUALIZER is not set --CONFIG_TUN=y -+CONFIG_TUN=m - # CONFIG_VETH is not set --# CONFIG_PHYLIB is not set --CONFIG_NET_ETHERNET=y -+# CONFIG_NET_ETHERNET is not set - CONFIG_MII=y --# CONFIG_AX88796 is not set --# CONFIG_SMC91X is not set --# CONFIG_DM9000 is not set --# CONFIG_ENC28J60 is not set --# CONFIG_SMC911X is not set --# CONFIG_IBM_NEW_EMAC_ZMII is not set --# CONFIG_IBM_NEW_EMAC_RGMII is not set --# CONFIG_IBM_NEW_EMAC_TAH is not set --# CONFIG_IBM_NEW_EMAC_EMAC4 is not set --# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set --# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set --# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set --# CONFIG_B44 is not set - # CONFIG_NETDEV_1000 is not set - # CONFIG_NETDEV_10000 is not set +-CONFIG_FPE_NWFPE=y +-# CONFIG_FPE_NWFPE_XP is not set +-# CONFIG_FPE_FASTFPE is not set -@@ -922,18 +908,18 @@ - CONFIG_USB_NET_ZAURUS=m - # CONFIG_USB_HSO is not set - # CONFIG_WAN is not set --CONFIG_PPP=y -+CONFIG_PPP=m - CONFIG_PPP_MULTILINK=y - CONFIG_PPP_FILTER=y --CONFIG_PPP_ASYNC=y --CONFIG_PPP_SYNC_TTY=y --CONFIG_PPP_DEFLATE=y --CONFIG_PPP_BSDCOMP=y --CONFIG_PPP_MPPE=y -+CONFIG_PPP_ASYNC=m -+CONFIG_PPP_SYNC_TTY=m -+CONFIG_PPP_DEFLATE=m -+CONFIG_PPP_BSDCOMP=m -+CONFIG_PPP_MPPE=m - # CONFIG_PPPOE is not set - # CONFIG_PPPOL2TP is not set - # CONFIG_SLIP is not set --CONFIG_SLHC=y -+CONFIG_SLHC=m - # CONFIG_NETCONSOLE is not set - # CONFIG_NETPOLL is not set - # CONFIG_NET_POLL_CONTROLLER is not set -@@ -1347,17 +1333,17 @@ - # CONFIG_FONT_SUN12x22 is not set - # CONFIG_FONT_10x18 is not set - # CONFIG_LOGO is not set --CONFIG_SOUND=y -+CONFIG_SOUND=m - CONFIG_SOUND_OSS_CORE=y --CONFIG_SND=y --CONFIG_SND_TIMER=y --CONFIG_SND_PCM=y -+CONFIG_SND=m -+CONFIG_SND_TIMER=m -+CONFIG_SND_PCM=m - CONFIG_SND_HWDEP=m - CONFIG_SND_RAWMIDI=m - # CONFIG_SND_SEQUENCER is not set - CONFIG_SND_OSSEMUL=y --CONFIG_SND_MIXER_OSS=y --CONFIG_SND_PCM_OSS=y -+CONFIG_SND_MIXER_OSS=m -+CONFIG_SND_PCM_OSS=m - CONFIG_SND_PCM_OSS_PLUGINS=y - # CONFIG_SND_DYNAMIC_MINORS is not set - CONFIG_SND_SUPPORT_OLD_API=y -@@ -1376,13 +1362,13 @@ - CONFIG_SND_USB=y - CONFIG_SND_USB_AUDIO=m - # CONFIG_SND_USB_CAIAQ is not set --CONFIG_SND_SOC=y --CONFIG_SND_S3C24XX_SOC=y --CONFIG_SND_S3C24XX_SOC_I2S=y --CONFIG_SND_S3C24XX_SOC_NEO1973_GTA02_WM8753=y -+CONFIG_SND_SOC=m -+CONFIG_SND_S3C24XX_SOC=m -+CONFIG_SND_S3C24XX_SOC_I2S=m -+CONFIG_SND_S3C24XX_SOC_NEO1973_GTA02_WM8753=m - # CONFIG_SND_S3C24XX_SOC_LN2440SBC_ALC650 is not set - # CONFIG_SND_SOC_ALL_CODECS is not set --CONFIG_SND_SOC_WM8753=y -+CONFIG_SND_SOC_WM8753=m - # CONFIG_SOUND_PRIME is not set - CONFIG_HID_SUPPORT=y - CONFIG_HID=y -@@ -1462,7 +1448,7 @@ - # - # USB Device Class drivers - # --CONFIG_USB_ACM=y -+CONFIG_USB_ACM=m - CONFIG_USB_PRINTER=m - # CONFIG_USB_WDM is not set - CONFIG_USB_TMC=m -@@ -1474,7 +1460,7 @@ - # - # may also be needed; see USB_STORAGE Help for more information # --CONFIG_USB_STORAGE=y -+CONFIG_USB_STORAGE=m - # CONFIG_USB_STORAGE_DEBUG is not set - CONFIG_USB_STORAGE_DATAFAB=y - CONFIG_USB_STORAGE_FREECOM=y -@@ -1499,8 +1485,7 @@ - # - # USB port drivers - # --CONFIG_USB_SERIAL=y --CONFIG_USB_SERIAL_CONSOLE=y -+CONFIG_USB_SERIAL=m - CONFIG_USB_EZUSB=y - CONFIG_USB_SERIAL_GENERIC=y - CONFIG_USB_SERIAL_AIRCABLE=m -@@ -1541,7 +1526,7 @@ - CONFIG_USB_SERIAL_TI=m - CONFIG_USB_SERIAL_CYBERJACK=m - CONFIG_USB_SERIAL_XIRCOM=m --CONFIG_USB_SERIAL_OPTION=y -+CONFIG_USB_SERIAL_OPTION=m - CONFIG_USB_SERIAL_OMNINET=m - # CONFIG_USB_SERIAL_DEBUG is not set - -@@ -1601,7 +1586,7 @@ - # CONFIG_USB_MIDI_GADGET is not set - # CONFIG_USB_G_PRINTER is not set - # CONFIG_USB_CDC_COMPOSITE is not set --CONFIG_AR6000_WLAN=y -+CONFIG_AR6000_WLAN=m - CONFIG_MMC=y - # CONFIG_MMC_DEBUG is not set - CONFIG_MMC_UNSAFE_RESUME=y -@@ -1641,9 +1626,10 @@ + # Userspace binary formats +@@ -1634,9 +1631,10 @@ # CONFIG_LEDS_TRIGGERS=y CONFIG_LEDS_TRIGGER_TIMER=y @@ -218,88 +22,16 @@ CONFIG_RTC_LIB=y CONFIG_RTC_CLASS=y CONFIG_RTC_HCTOSYS=y -@@ -1738,21 +1724,21 @@ - # - # File systems - # --CONFIG_EXT2_FS=y -+CONFIG_EXT2_FS=m - # CONFIG_EXT2_FS_XATTR is not set - # CONFIG_EXT2_FS_XIP is not set --CONFIG_EXT3_FS=y -+CONFIG_EXT3_FS=m - # CONFIG_EXT3_FS_XATTR is not set --CONFIG_EXT4_FS=y -+CONFIG_EXT4_FS=m - CONFIG_EXT4DEV_COMPAT=y - CONFIG_EXT4_FS_XATTR=y - # CONFIG_EXT4_FS_POSIX_ACL is not set - CONFIG_EXT4_FS_SECURITY=y --CONFIG_JBD=y -+CONFIG_JBD=m - # CONFIG_JBD_DEBUG is not set --CONFIG_JBD2=y -+CONFIG_JBD2=m - # CONFIG_JBD2_DEBUG is not set --CONFIG_FS_MBCACHE=y -+CONFIG_FS_MBCACHE=m - # CONFIG_REISERFS_FS is not set - # CONFIG_JFS_FS is not set - CONFIG_FS_POSIX_ACL=y -@@ -1778,9 +1764,9 @@ - # - # DOS/FAT/NT Filesystems - # --CONFIG_FAT_FS=y --CONFIG_MSDOS_FS=y --CONFIG_VFAT_FS=y -+CONFIG_FAT_FS=m -+CONFIG_MSDOS_FS=m -+CONFIG_VFAT_FS=m - CONFIG_FAT_DEFAULT_CODEPAGE=437 - CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" - # CONFIG_NTFS_FS is not set -@@ -1828,15 +1814,19 @@ +@@ -1822,7 +1820,11 @@ # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set CONFIG_NETWORK_FILESYSTEMS=y -# CONFIG_NFS_FS is not set --CONFIG_NFSD=y -+CONFIG_NFS_FS=y ++CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +# CONFIG_NFS_V4 is not set +CONFIG_ROOT_NFS=y -+CONFIG_NFSD=m + CONFIG_NFSD=m CONFIG_NFSD_V2_ACL=y CONFIG_NFSD_V3=y - CONFIG_NFSD_V3_ACL=y - # CONFIG_NFSD_V4 is not set - CONFIG_LOCKD=y - CONFIG_LOCKD_V4=y --CONFIG_EXPORTFS=y -+CONFIG_EXPORTFS=m - CONFIG_NFS_ACL_SUPPORT=y - CONFIG_NFS_COMMON=y - CONFIG_SUNRPC=y -@@ -1875,9 +1865,9 @@ - # CONFIG_KARMA_PARTITION is not set - # CONFIG_EFI_PARTITION is not set - # CONFIG_SYSV68_PARTITION is not set --CONFIG_NLS=y -+CONFIG_NLS=m - CONFIG_NLS_DEFAULT="iso8859-1" --CONFIG_NLS_CODEPAGE_437=y -+CONFIG_NLS_CODEPAGE_437=m - # CONFIG_NLS_CODEPAGE_737 is not set - # CONFIG_NLS_CODEPAGE_775 is not set - CONFIG_NLS_CODEPAGE_850=m -@@ -1901,7 +1891,7 @@ - # CONFIG_NLS_CODEPAGE_1250 is not set - # CONFIG_NLS_CODEPAGE_1251 is not set - # CONFIG_NLS_ASCII is not set --CONFIG_NLS_ISO8859_1=y -+CONFIG_NLS_ISO8859_1=m - # CONFIG_NLS_ISO8859_2 is not set - # CONFIG_NLS_ISO8859_3 is not set - # CONFIG_NLS_ISO8859_4 is not set diff --git a/packages/linux/linux-openmoko-devel/linux-openmoko-2.6.28/0001-squashfs-with-lzma.patch b/packages/linux/linux-openmoko-devel/linux-openmoko-2.6.28/0001-squashfs-with-lzma.patch deleted file mode 100644 index 04d47fe16f..0000000000 --- a/packages/linux/linux-openmoko-devel/linux-openmoko-2.6.28/0001-squashfs-with-lzma.patch +++ /dev/null @@ -1,5342 +0,0 @@ - -diff -urN linux-2.6.23/fs/squashfs/LzmaDecode.c linux-2.6.23.sqlzma-ng/fs/squashfs/LzmaDecode.c ---- linux-2.6.23/fs/squashfs/LzmaDecode.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.23.sqlzma-ng/fs/squashfs/LzmaDecode.c 2007-11-13 19:45:12.000000000 -0500 -@@ -0,0 +1,584 @@ -+/* -+ LzmaDecode.c -+ LZMA Decoder (optimized for Speed version) -+ -+ LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01) -+ http://www.7-zip.org/ -+ -+ LZMA SDK is licensed under two licenses: -+ 1) GNU Lesser General Public License (GNU LGPL) -+ 2) Common Public License (CPL) -+ It means that you can select one of these two licenses and -+ follow rules of that license. -+ -+ SPECIAL EXCEPTION: -+ Igor Pavlov, as the author of this Code, expressly permits you to -+ statically or dynamically link your Code (or bind by name) to the -+ interfaces of this file without subjecting your linked Code to the -+ terms of the CPL or GNU LGPL. Any modifications or additions -+ to this file, however, are subject to the LGPL or CPL terms. -+*/ -+ -+#include "LzmaDecode.h" -+ -+#define kNumTopBits 24 -+#define kTopValue ((UInt32)1 << kNumTopBits) -+ -+#define kNumBitModelTotalBits 11 -+#define kBitModelTotal (1 << kNumBitModelTotalBits) -+#define kNumMoveBits 5 -+ -+#define RC_READ_BYTE (*Buffer++) -+ -+#define RC_INIT2 Code = 0; Range = 0xFFFFFFFF; \ -+ { int i; for(i = 0; i < 5; i++) { RC_TEST; Code = (Code << 8) | RC_READ_BYTE; }} -+ -+#ifdef _LZMA_IN_CB -+ -+#define RC_TEST { if (Buffer == BufferLim) \ -+ { SizeT size; int result = InCallback->Read(InCallback, &Buffer, &size); if (result != LZMA_RESULT_OK) return result; \ -+ BufferLim = Buffer + size; if (size == 0) return LZMA_RESULT_DATA_ERROR; }} -+ -+#define RC_INIT Buffer = BufferLim = 0; RC_INIT2 -+ -+#else -+ -+#define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; } -+ -+#define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2 -+ -+#endif -+ -+#define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; } -+ -+#define IfBit0(p) RC_NORMALIZE; bound = (Range >> kNumBitModelTotalBits) * *(p); if (Code < bound) -+#define UpdateBit0(p) Range = bound; *(p) += (kBitModelTotal - *(p)) >> kNumMoveBits; -+#define UpdateBit1(p) Range -= bound; Code -= bound; *(p) -= (*(p)) >> kNumMoveBits; -+ -+#define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \ -+ { UpdateBit0(p); mi <<= 1; A0; } else \ -+ { UpdateBit1(p); mi = (mi + mi) + 1; A1; } -+ -+#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;) -+ -+#define RangeDecoderBitTreeDecode(probs, numLevels, res) \ -+ { int i = numLevels; res = 1; \ -+ do { CProb *p = probs + res; RC_GET_BIT(p, res) } while(--i != 0); \ -+ res -= (1 << numLevels); } -+ -+ -+#define kNumPosBitsMax 4 -+#define kNumPosStatesMax (1 << kNumPosBitsMax) -+ -+#define kLenNumLowBits 3 -+#define kLenNumLowSymbols (1 << kLenNumLowBits) -+#define kLenNumMidBits 3 -+#define kLenNumMidSymbols (1 << kLenNumMidBits) -+#define kLenNumHighBits 8 -+#define kLenNumHighSymbols (1 << kLenNumHighBits) -+ -+#define LenChoice 0 -+#define LenChoice2 (LenChoice + 1) -+#define LenLow (LenChoice2 + 1) -+#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) -+#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) -+#define kNumLenProbs (LenHigh + kLenNumHighSymbols) -+ -+ -+#define kNumStates 12 -+#define kNumLitStates 7 -+ -+#define kStartPosModelIndex 4 -+#define kEndPosModelIndex 14 -+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) -+ -+#define kNumPosSlotBits 6 -+#define kNumLenToPosStates 4 -+ -+#define kNumAlignBits 4 -+#define kAlignTableSize (1 << kNumAlignBits) -+ -+#define kMatchMinLen 2 -+ -+#define IsMatch 0 -+#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax)) -+#define IsRepG0 (IsRep + kNumStates) -+#define IsRepG1 (IsRepG0 + kNumStates) -+#define IsRepG2 (IsRepG1 + kNumStates) -+#define IsRep0Long (IsRepG2 + kNumStates) -+#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax)) -+#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) -+#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex) -+#define LenCoder (Align + kAlignTableSize) -+#define RepLenCoder (LenCoder + kNumLenProbs) -+#define Literal (RepLenCoder + kNumLenProbs) -+ -+#if Literal != LZMA_BASE_SIZE -+StopCompilingDueBUG -+#endif -+ -+int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size) -+{ -+ unsigned char prop0; -+ if (size < LZMA_PROPERTIES_SIZE) -+ return LZMA_RESULT_DATA_ERROR; -+ prop0 = propsData[0]; -+ if (prop0 >= (9 * 5 * 5)) -+ return LZMA_RESULT_DATA_ERROR; -+ { -+ for (propsRes->pb = 0; prop0 >= (9 * 5); propsRes->pb++, prop0 -= (9 * 5)); -+ for (propsRes->lp = 0; prop0 >= 9; propsRes->lp++, prop0 -= 9); -+ propsRes->lc = prop0; -+ /* -+ unsigned char remainder = (unsigned char)(prop0 / 9); -+ propsRes->lc = prop0 % 9; -+ propsRes->pb = remainder / 5; -+ propsRes->lp = remainder % 5; -+ */ -+ } -+ -+ #ifdef _LZMA_OUT_READ -+ { -+ int i; -+ propsRes->DictionarySize = 0; -+ for (i = 0; i < 4; i++) -+ propsRes->DictionarySize += (UInt32)(propsData[1 + i]) << (i * 8); -+ if (propsRes->DictionarySize == 0) -+ propsRes->DictionarySize = 1; -+ } -+ #endif -+ return LZMA_RESULT_OK; -+} -+ -+#define kLzmaStreamWasFinishedId (-1) -+ -+int LzmaDecode(CLzmaDecoderState *vs, -+ #ifdef _LZMA_IN_CB -+ ILzmaInCallback *InCallback, -+ #else -+ const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed, -+ #endif -+ unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed) -+{ -+ CProb *p = vs->Probs; -+ SizeT nowPos = 0; -+ Byte previousByte = 0; -+ UInt32 posStateMask = (1 << (vs->Properties.pb)) - 1; -+ UInt32 literalPosMask = (1 << (vs->Properties.lp)) - 1; -+ int lc = vs->Properties.lc; -+ -+ #ifdef _LZMA_OUT_READ -+ -+ UInt32 Range = vs->Range; -+ UInt32 Code = vs->Code; -+ #ifdef _LZMA_IN_CB -+ const Byte *Buffer = vs->Buffer; -+ const Byte *BufferLim = vs->BufferLim; -+ #else -+ const Byte *Buffer = inStream; -+ const Byte *BufferLim = inStream + inSize; -+ #endif -+ int state = vs->State; -+ UInt32 rep0 = vs->Reps[0], rep1 = vs->Reps[1], rep2 = vs->Reps[2], rep3 = vs->Reps[3]; -+ int len = vs->RemainLen; -+ UInt32 globalPos = vs->GlobalPos; -+ UInt32 distanceLimit = vs->DistanceLimit; -+ -+ Byte *dictionary = vs->Dictionary; -+ UInt32 dictionarySize = vs->Properties.DictionarySize; -+ UInt32 dictionaryPos = vs->DictionaryPos; -+ -+ Byte tempDictionary[4]; -+ -+ #ifndef _LZMA_IN_CB -+ *inSizeProcessed = 0; -+ #endif -+ *outSizeProcessed = 0; -+ if (len == kLzmaStreamWasFinishedId) -+ return LZMA_RESULT_OK; -+ -+ if (dictionarySize == 0) -+ { -+ dictionary = tempDictionary; -+ dictionarySize = 1; -+ tempDictionary[0] = vs->TempDictionary[0]; -+ } -+ -+ if (len == kLzmaNeedInitId) -+ { -+ { -+ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp)); -+ UInt32 i; -+ for (i = 0; i < numProbs; i++) -+ p[i] = kBitModelTotal >> 1; -+ rep0 = rep1 = rep2 = rep3 = 1; -+ state = 0; -+ globalPos = 0; -+ distanceLimit = 0; -+ dictionaryPos = 0; -+ dictionary[dictionarySize - 1] = 0; -+ #ifdef _LZMA_IN_CB -+ RC_INIT; -+ #else -+ RC_INIT(inStream, inSize); -+ #endif -+ } -+ len = 0; -+ } -+ while(len != 0 && nowPos < outSize) -+ { -+ UInt32 pos = dictionaryPos - rep0; -+ if (pos >= dictionarySize) -+ pos += dictionarySize; -+ outStream[nowPos++] = dictionary[dictionaryPos] = dictionary[pos]; -+ if (++dictionaryPos == dictionarySize) -+ dictionaryPos = 0; -+ len--; -+ } -+ if (dictionaryPos == 0) -+ previousByte = dictionary[dictionarySize - 1]; -+ else -+ previousByte = dictionary[dictionaryPos - 1]; -+ -+ #else /* if !_LZMA_OUT_READ */ -+ -+ int state = 0; -+ UInt32 rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1; -+ int len = 0; -+ const Byte *Buffer; -+ const Byte *BufferLim; -+ UInt32 Range; -+ UInt32 Code; -+ -+ #ifndef _LZMA_IN_CB -+ *inSizeProcessed = 0; -+ #endif -+ *outSizeProcessed = 0; -+ -+ { -+ UInt32 i; -+ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp)); -+ for (i = 0; i < numProbs; i++) -+ p[i] = kBitModelTotal >> 1; -+ } -+ -+ #ifdef _LZMA_IN_CB -+ RC_INIT; -+ #else -+ RC_INIT(inStream, inSize); -+ #endif -+ -+ #endif /* _LZMA_OUT_READ */ -+ -+ while(nowPos < outSize) -+ { -+ CProb *prob; -+ UInt32 bound; -+ int posState = (int)( -+ (nowPos -+ #ifdef _LZMA_OUT_READ -+ + globalPos -+ #endif -+ ) -+ & posStateMask); -+ -+ prob = p + IsMatch + (state << kNumPosBitsMax) + posState; -+ IfBit0(prob) -+ { -+ int symbol = 1; -+ UpdateBit0(prob) -+ prob = p + Literal + (LZMA_LIT_SIZE * -+ ((( -+ (nowPos -+ #ifdef _LZMA_OUT_READ -+ + globalPos -+ #endif -+ ) -+ & literalPosMask) << lc) + (previousByte >> (8 - lc)))); -+ -+ if (state >= kNumLitStates) -+ { -+ int matchByte; -+ #ifdef _LZMA_OUT_READ -+ UInt32 pos = dictionaryPos - rep0; -+ if (pos >= dictionarySize) -+ pos += dictionarySize; -+ matchByte = dictionary[pos]; -+ #else -+ matchByte = outStream[nowPos - rep0]; -+ #endif -+ do -+ { -+ int bit; -+ CProb *probLit; -+ matchByte <<= 1; -+ bit = (matchByte & 0x100); -+ probLit = prob + 0x100 + bit + symbol; -+ RC_GET_BIT2(probLit, symbol, if (bit != 0) break, if (bit == 0) break) -+ } -+ while (symbol < 0x100); -+ } -+ while (symbol < 0x100) -+ { -+ CProb *probLit = prob + symbol; -+ RC_GET_BIT(probLit, symbol) -+ } -+ previousByte = (Byte)symbol; -+ -+ outStream[nowPos++] = previousByte; -+ #ifdef _LZMA_OUT_READ -+ if (distanceLimit < dictionarySize) -+ distanceLimit++; -+ -+ dictionary[dictionaryPos] = previousByte; -+ if (++dictionaryPos == dictionarySize) -+ dictionaryPos = 0; -+ #endif -+ if (state < 4) state = 0; -+ else if (state < 10) state -= 3; -+ else state -= 6; -+ } -+ else -+ { -+ UpdateBit1(prob); -+ prob = p + IsRep + state; -+ IfBit0(prob) -+ { -+ UpdateBit0(prob); -+ rep3 = rep2; -+ rep2 = rep1; -+ rep1 = rep0; -+ state = state < kNumLitStates ? 0 : 3; -+ prob = p + LenCoder; -+ } -+ else -+ { -+ UpdateBit1(prob); -+ prob = p + IsRepG0 + state; -+ IfBit0(prob) -+ { -+ UpdateBit0(prob); -+ prob = p + IsRep0Long + (state << kNumPosBitsMax) + posState; -+ IfBit0(prob) -+ { -+ #ifdef _LZMA_OUT_READ -+ UInt32 pos; -+ #endif -+ UpdateBit0(prob); -+ -+ #ifdef _LZMA_OUT_READ -+ if (distanceLimit == 0) -+ #else -+ if (nowPos == 0) -+ #endif -+ return LZMA_RESULT_DATA_ERROR; -+ -+ state = state < kNumLitStates ? 9 : 11; -+ #ifdef _LZMA_OUT_READ -+ pos = dictionaryPos - rep0; -+ if (pos >= dictionarySize) -+ pos += dictionarySize; -+ previousByte = dictionary[pos]; -+ dictionary[dictionaryPos] = previousByte; -+ if (++dictionaryPos == dictionarySize) -+ dictionaryPos = 0; -+ #else -+ previousByte = outStream[nowPos - rep0]; -+ #endif -+ outStream[nowPos++] = previousByte; -+ #ifdef _LZMA_OUT_READ -+ if (distanceLimit < dictionarySize) -+ distanceLimit++; -+ #endif -+ -+ continue; -+ } -+ else -+ { -+ UpdateBit1(prob); -+ } -+ } -+ else -+ { -+ UInt32 distance; -+ UpdateBit1(prob); -+ prob = p + IsRepG1 + state; -+ IfBit0(prob) -+ { -+ UpdateBit0(prob); -+ distance = rep1; -+ } -+ else -+ { -+ UpdateBit1(prob); -+ prob = p + IsRepG2 + state; -+ IfBit0(prob) -+ { -+ UpdateBit0(prob); -+ distance = rep2; -+ } -+ else -+ { -+ UpdateBit1(prob); -+ distance = rep3; -+ rep3 = rep2; -+ } -+ rep2 = rep1; -+ } -+ rep1 = rep0; -+ rep0 = distance; -+ } -+ state = state < kNumLitStates ? 8 : 11; -+ prob = p + RepLenCoder; -+ } -+ { -+ int numBits, offset; -+ CProb *probLen = prob + LenChoice; -+ IfBit0(probLen) -+ { -+ UpdateBit0(probLen); -+ probLen = prob + LenLow + (posState << kLenNumLowBits); -+ offset = 0; -+ numBits = kLenNumLowBits; -+ } -+ else -+ { -+ UpdateBit1(probLen); -+ probLen = prob + LenChoice2; -+ IfBit0(probLen) -+ { -+ UpdateBit0(probLen); -+ probLen = prob + LenMid + (posState << kLenNumMidBits); -+ offset = kLenNumLowSymbols; -+ numBits = kLenNumMidBits; -+ } -+ else -+ { -+ UpdateBit1(probLen); -+ probLen = prob + LenHigh; -+ offset = kLenNumLowSymbols + kLenNumMidSymbols; -+ numBits = kLenNumHighBits; -+ } -+ } -+ RangeDecoderBitTreeDecode(probLen, numBits, len); -+ len += offset; -+ } -+ -+ if (state < 4) -+ { -+ int posSlot; -+ state += kNumLitStates; -+ prob = p + PosSlot + -+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << -+ kNumPosSlotBits); -+ RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot); -+ if (posSlot >= kStartPosModelIndex) -+ { -+ int numDirectBits = ((posSlot >> 1) - 1); -+ rep0 = (2 | ((UInt32)posSlot & 1)); -+ if (posSlot < kEndPosModelIndex) -+ { -+ rep0 <<= numDirectBits; -+ prob = p + SpecPos + rep0 - posSlot - 1; -+ } -+ else -+ { -+ numDirectBits -= kNumAlignBits; -+ do -+ { -+ RC_NORMALIZE -+ Range >>= 1; -+ rep0 <<= 1; -+ if (Code >= Range) -+ { -+ Code -= Range; -+ rep0 |= 1; -+ } -+ } -+ while (--numDirectBits != 0); -+ prob = p + Align; -+ rep0 <<= kNumAlignBits; -+ numDirectBits = kNumAlignBits; -+ } -+ { -+ int i = 1; -+ int mi = 1; -+ do -+ { -+ CProb *prob3 = prob + mi; -+ RC_GET_BIT2(prob3, mi, ; , rep0 |= i); -+ i <<= 1; -+ } -+ while(--numDirectBits != 0); -+ } -+ } -+ else -+ rep0 = posSlot; -+ if (++rep0 == (UInt32)(0)) -+ { -+ /* it's for stream version */ -+ len = kLzmaStreamWasFinishedId; -+ break; -+ } -+ } -+ -+ len += kMatchMinLen; -+ #ifdef _LZMA_OUT_READ -+ if (rep0 > distanceLimit) -+ #else -+ if (rep0 > nowPos) -+ #endif -+ return LZMA_RESULT_DATA_ERROR; -+ -+ #ifdef _LZMA_OUT_READ -+ if (dictionarySize - distanceLimit > (UInt32)len) -+ distanceLimit += len; -+ else -+ distanceLimit = dictionarySize; -+ #endif -+ -+ do -+ { -+ #ifdef _LZMA_OUT_READ -+ UInt32 pos = dictionaryPos - rep0; -+ if (pos >= dictionarySize) -+ pos += dictionarySize; -+ previousByte = dictionary[pos]; -+ dictionary[dictionaryPos] = previousByte; -+ if (++dictionaryPos == dictionarySize) -+ dictionaryPos = 0; -+ #else -+ previousByte = outStream[nowPos - rep0]; -+ #endif -+ len--; -+ outStream[nowPos++] = previousByte; -+ } -+ while(len != 0 && nowPos < outSize); -+ } -+ } -+ RC_NORMALIZE; -+ -+ #ifdef _LZMA_OUT_READ -+ vs->Range = Range; -+ vs->Code = Code; -+ vs->DictionaryPos = dictionaryPos; -+ vs->GlobalPos = globalPos + (UInt32)nowPos; -+ vs->DistanceLimit = distanceLimit; -+ vs->Reps[0] = rep0; -+ vs->Reps[1] = rep1; -+ vs->Reps[2] = rep2; -+ vs->Reps[3] = rep3; -+ vs->State = state; -+ vs->RemainLen = len; -+ vs->TempDictionary[0] = tempDictionary[0]; -+ #endif -+ -+ #ifdef _LZMA_IN_CB -+ vs->Buffer = Buffer; -+ vs->BufferLim = BufferLim; -+ #else -+ *inSizeProcessed = (SizeT)(Buffer - inStream); -+ #endif -+ *outSizeProcessed = nowPos; -+ return LZMA_RESULT_OK; -+} -diff -urN linux-2.6.23/fs/squashfs/LzmaDecode.h linux-2.6.23.sqlzma-ng/fs/squashfs/LzmaDecode.h ---- linux-2.6.23/fs/squashfs/LzmaDecode.h 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.23.sqlzma-ng/fs/squashfs/LzmaDecode.h 2007-11-13 19:45:12.000000000 -0500 -@@ -0,0 +1,113 @@ -+/* -+ LzmaDecode.h -+ LZMA Decoder interface -+ -+ LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01) -+ http://www.7-zip.org/ -+ -+ LZMA SDK is licensed under two licenses: -+ 1) GNU Lesser General Public License (GNU LGPL) -+ 2) Common Public License (CPL) -+ It means that you can select one of these two licenses and -+ follow rules of that license. -+ -+ SPECIAL EXCEPTION: -+ Igor Pavlov, as the author of this code, expressly permits you to -+ statically or dynamically link your code (or bind by name) to the -+ interfaces of this file without subjecting your linked code to the -+ terms of the CPL or GNU LGPL. Any modifications or additions -+ to this file, however, are subject to the LGPL or CPL terms. -+*/ -+ -+#ifndef __LZMADECODE_H -+#define __LZMADECODE_H -+ -+#include "LzmaTypes.h" -+ -+/* #define _LZMA_IN_CB */ -+/* Use callback for input data */ -+ -+/* #define _LZMA_OUT_READ */ -+/* Use read function for output data */ -+ -+/* #define _LZMA_PROB32 */ -+/* It can increase speed on some 32-bit CPUs, -+ but memory usage will be doubled in that case */ -+ -+/* #define _LZMA_LOC_OPT */ -+/* Enable local speed optimizations inside code */ -+ -+#ifdef _LZMA_PROB32 -+#define CProb UInt32 -+#else -+#define CProb UInt16 -+#endif -+ -+#define LZMA_RESULT_OK 0 -+#define LZMA_RESULT_DATA_ERROR 1 -+ -+#ifdef _LZMA_IN_CB -+typedef struct _ILzmaInCallback -+{ -+ int (*Read)(void *object, const unsigned char **buffer, SizeT *bufferSize); -+} ILzmaInCallback; -+#endif -+ -+#define LZMA_BASE_SIZE 1846 -+#define LZMA_LIT_SIZE 768 -+ -+#define LZMA_PROPERTIES_SIZE 5 -+ -+typedef struct _CLzmaProperties -+{ -+ int lc; -+ int lp; -+ int pb; -+ #ifdef _LZMA_OUT_READ -+ UInt32 DictionarySize; -+ #endif -+}CLzmaProperties; -+ -+int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size); -+ -+#define LzmaGetNumProbs(Properties) (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((Properties)->lc + (Properties)->lp))) -+ -+#define kLzmaNeedInitId (-2) -+ -+typedef struct _CLzmaDecoderState -+{ -+ CLzmaProperties Properties; -+ CProb *Probs; -+ -+ #ifdef _LZMA_IN_CB -+ const unsigned char *Buffer; -+ const unsigned char *BufferLim; -+ #endif -+ -+ #ifdef _LZMA_OUT_READ -+ unsigned char *Dictionary; -+ UInt32 Range; -+ UInt32 Code; -+ UInt32 DictionaryPos; -+ UInt32 GlobalPos; -+ UInt32 DistanceLimit; -+ UInt32 Reps[4]; -+ int State; -+ int RemainLen; -+ unsigned char TempDictionary[4]; -+ #endif -+} CLzmaDecoderState; -+ -+#ifdef _LZMA_OUT_READ -+#define LzmaDecoderInit(vs) { (vs)->RemainLen = kLzmaNeedInitId; } -+#endif -+ -+int LzmaDecode(CLzmaDecoderState *vs, -+ #ifdef _LZMA_IN_CB -+ ILzmaInCallback *inCallback, -+ #else -+ const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed, -+ #endif -+ unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed); -+ -+#endif -diff -urN linux-2.6.23/fs/squashfs/LzmaTypes.h linux-2.6.23.sqlzma-ng/fs/squashfs/LzmaTypes.h ---- linux-2.6.23/fs/squashfs/LzmaTypes.h 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.23.sqlzma-ng/fs/squashfs/LzmaTypes.h 2007-11-13 19:47:32.000000000 -0500 -@@ -0,0 +1,45 @@ -+/* -+LzmaTypes.h -+ -+Types for LZMA Decoder -+ -+This file written and distributed to public domain by Igor Pavlov. -+This file is part of LZMA SDK 4.40 (2006-05-01) -+*/ -+ -+#ifndef __LZMATYPES_H -+#define __LZMATYPES_H -+ -+#ifndef _7ZIP_BYTE_DEFINED -+#define _7ZIP_BYTE_DEFINED -+typedef unsigned char Byte; -+#endif -+ -+#ifndef _7ZIP_UINT16_DEFINED -+#define _7ZIP_UINT16_DEFINED -+typedef unsigned short UInt16; -+#endif -+ -+#ifndef _7ZIP_UINT32_DEFINED -+#define _7ZIP_UINT32_DEFINED -+#ifdef _LZMA_UINT32_IS_ULONG -+typedef unsigned long UInt32; -+#else -+typedef unsigned int UInt32; -+#endif -+#endif -+ -+/* #define _LZMA_NO_SYSTEM_SIZE_T */ -+/* You can use it, if you don't want */ -+ -+#ifndef _7ZIP_SIZET_DEFINED -+#define _7ZIP_SIZET_DEFINED -+#ifdef _LZMA_NO_SYSTEM_SIZE_T -+typedef UInt32 SizeT; -+#else -+#include -+typedef size_t SizeT; -+#endif -+#endif -+ -+#endif -diff -urN linux-2.6.23/fs/squashfs/Makefile linux-2.6.23.sqlzma-ng/fs/squashfs/Makefile ---- linux-2.6.23/fs/squashfs/Makefile 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.23.sqlzma-ng/fs/squashfs/Makefile 2007-11-13 19:52:56.000000000 -0500 -@@ -0,0 +1,10 @@ -+# -+# Makefile for the linux squashfs routines. -+# -+ -+ -+obj-$(CONFIG_SQUASHFS) += unlzma.o sqlzma.o squashfs.o -+unlzma-y += module.o -+sqlzma-y += uncomp.o -+squashfs-y += inode.o -+squashfs-y += squashfs2_0.o -diff -urN linux-2.6.23/fs/squashfs/inode.c linux-2.6.23.sqlzma-ng/fs/squashfs/inode.c ---- linux-2.6.23/fs/squashfs/inode.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-2.6.23.sqlzma-ng/fs/squashfs/inode.c 2007-11-13 19:14:24.000000000 -0500 -@@ -0,0 +1,2312 @@ -+/* -+ * Squashfs - a compressed read only filesystem for Linux -+ * -+ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 -+ * Phillip Lougher -+ * -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "squashfs.h" -+#include "sqlzma.h" -+ -+#undef KeepPreemptive -+#if defined(CONFIG_PREEMPT) && !defined(UnsquashNoPreempt) -+#define KeepPreemptive -+#endif -+ -+struct sqlzma { -+#ifdef KeepPreemptive -+ struct mutex mtx; -+#endif -+ unsigned char read_data[SQUASHFS_FILE_MAX_SIZE]; -+ struct sqlzma_un un; -+}; -+static DEFINE_PER_CPU(struct sqlzma *, sqlzma); -+ -+#define dpri(fmt, args...) /* printk("%s:%d: " fmt, __func__, __LINE__, ##args) */ -+#define dpri_un(un) dpri("un{%d, {%d %p}, {%d %p}, {%d %p}}\n", \ -+ (un)->un_lzma, (un)->un_a[0].sz, (un)->un_a[0].buf, \ -+ (un)->un_a[1].sz, (un)->un_a[1].buf, \ -+ (un)->un_a[2].sz, (un)->un_a[2].buf) -+ -+static int squashfs_cached_blks; -+ -+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_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 -+}; -+ -+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; -+ 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; -+ -+ bh = kmalloc(((sblk->block_size >> msblk->devblksize_log2) + 1) * -+ sizeof(struct buffer_head *), GFP_KERNEL); -+ if (bh == NULL) -+ goto read_failure; -+ -+ 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; -+ -+ bh[0] = sb_getblk(s, cur_index); -+ if (bh[0] == NULL) -+ goto block_release; -+ -+ for (b = 1; bytes < c_byte; b++) { -+ bh[b] = sb_getblk(s, ++cur_index); -+ if (bh[b] == NULL) -+ goto block_release; -+ bytes += msblk->devblksize; -+ } -+ ll_rw_block(READ, b, bh); -+ } else { -+ if (index < 0 || (index + 2) > sblk->bytes_used) -+ goto read_failure; -+ -+ bh[0] = get_block_length(s, (int *)&cur_index, (int *)&offset, -+ (int *)&c_byte); -+ if (bh[0] == NULL) -+ 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++) { -+ bh[b] = sb_getblk(s, ++cur_index); -+ if (bh[b] == NULL) -+ goto block_release; -+ bytes += msblk->devblksize; -+ } -+ ll_rw_block(READ, b - 1, bh + 1); -+ } -+ -+ if (compressed) { -+ int zlib_err = Z_STREAM_END; -+ int rest, start; -+ enum {Src, Dst}; -+ struct sized_buf sbuf[2]; -+ struct sqlzma *percpu; -+ -+ /* -+ * uncompress block -+ */ -+ -+ for (k = 0; k < b; k++) { -+ wait_on_buffer(bh[k]); -+ if (!buffer_uptodate(bh[k])) -+ goto block_release; -+ } -+ -+ avail_bytes = 0; -+ for (k = 0; !avail_bytes && k < b; k++) { -+ avail_bytes = msblk->devblksize - offset; -+ if (c_byte < avail_bytes) -+ avail_bytes = c_byte; -+ if (avail_bytes) -+ break; -+ offset = 0; -+ brelse(bh[k]); -+ } -+ bytes = 0; -+ if (!avail_bytes) -+ goto block_release; // nothing to be process -+ -+ start = k; -+ /* it disables preemption */ -+ percpu = get_cpu_var(sqlzma); -+#ifdef KeepPreemptive -+ put_cpu_var(sqlzma); -+ mutex_lock(&percpu->mtx); -+#endif -+ -+ for (; k < b; k++) { -+ memcpy(percpu->read_data + bytes, bh[k]->b_data + offset, -+ avail_bytes); -+ bytes += avail_bytes; -+ offset = 0; -+ brelse(bh[k]); -+ avail_bytes = msblk->devblksize - offset; -+ rest = c_byte - bytes; -+ if (rest < avail_bytes) -+ avail_bytes = rest; -+ } -+ -+ sbuf[Src].buf = percpu->read_data; -+ sbuf[Src].sz = bytes; -+ sbuf[Dst].buf = buffer; -+ sbuf[Dst].sz = srclength; -+ dpri_un(&percpu->un); -+ dpri("src %d %p, dst %d %p\n", sbuf[Src].sz, sbuf[Src].buf, -+ sbuf[Dst].sz, sbuf[Dst].buf); -+ zlib_err = sqlzma_un(&percpu->un, sbuf + Src, sbuf + Dst); -+ bytes = percpu->un.un_reslen; -+ -+#ifdef KeepPreemptive -+ mutex_unlock(&percpu->mtx); -+#else -+ put_cpu_var(sqlzma); -+#endif -+ if (unlikely(zlib_err)) { -+ dpri("zlib_err %d\n", zlib_err); -+ goto release_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 = min(c_byte - bytes, msblk->devblksize - offset); -+ -+ 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)); -+ -+ kfree(bh); -+ 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); -+ kfree(bh); -+ return 0; -+} -+ -+ -+SQSH_EXTERN int squashfs_get_cached_block(struct super_block *s, void *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 */ -+ if (msblk->unused_cache_blks == 0) { -+ mutex_unlock(&msblk->block_cache_mutex); -+ wait_event(msblk->waitq, msblk->unused_cache_blks); -+ continue; -+ } -+ -+ i = msblk->next_cache; -+ for (n = 0; n < squashfs_cached_blks; n++) { -+ if (msblk->block_cache[i].block != SQUASHFS_USED_BLK) -+ break; -+ i = (i + 1) % squashfs_cached_blks; -+ } -+ -+ msblk->next_cache = (i + 1) % squashfs_cached_blks; -+ -+ if (msblk->block_cache[i].block == SQUASHFS_INVALID_BLK) { -+ msblk->block_cache[i].data = vmalloc(SQUASHFS_METADATA_SIZE); -+ if (msblk->block_cache[i].data == NULL) { -+ ERROR("Failed to allocate cache block\n"); -+ mutex_unlock(&msblk->block_cache_mutex); -+ goto out; -+ } -+ } -+ -+ msblk->block_cache[i].block = SQUASHFS_USED_BLK; -+ msblk->unused_cache_blks --; -+ mutex_unlock(&msblk->block_cache_mutex); -+ -+ msblk->block_cache[i].length = squashfs_read_data(s, -+ msblk->block_cache[i].data, block, 0, &next_index, -+ SQUASHFS_METADATA_SIZE); -+ -+ if (msblk->block_cache[i].length == 0) { -+ ERROR("Unable to read cache block [%llx:%x]\n", block, offset); -+ mutex_lock(&msblk->block_cache_mutex); -+ msblk->block_cache[i].block = SQUASHFS_INVALID_BLK; -+ msblk->unused_cache_blks ++; -+ smp_mb(); -+ vfree(msblk->block_cache[i].data); -+ wake_up(&msblk->waitq); -+ mutex_unlock(&msblk->block_cache_mutex); -+ goto out; -+ } -+ -+ mutex_lock(&msblk->block_cache_mutex); -+ msblk->block_cache[i].block = block; -+ msblk->block_cache[i].next_index = next_index; -+ msblk->unused_cache_blks ++; -+ smp_mb(); -+ wake_up(&msblk->waitq); -+ TRACE("Read cache block [%llx:%x]\n", block, offset); -+ } -+ -+ if (msblk->block_cache[i].block != block) { -+ mutex_unlock(&msblk->block_cache_mutex); -+ continue; -+ } -+ -+ bytes = msblk->block_cache[i].length - offset; -+ -+ if (bytes < 1) { -+ mutex_unlock(&msblk->block_cache_mutex); -+ goto out; -+ } else if (bytes >= length) { -+ if (buffer) -+ memcpy(buffer, msblk->block_cache[i].data + offset, length); -+ if (msblk->block_cache[i].length - offset == length) { -+ *next_block = msblk->block_cache[i].next_index; -+ *next_offset = 0; -+ } else { -+ *next_block = block; -+ *next_offset = offset + length; -+ } -+ mutex_unlock(&msblk->block_cache_mutex); -+ goto finish; -+ } else { -+ if (buffer) { -+ memcpy(buffer, msblk->block_cache[i].data + offset, bytes); -+ buffer = (char *) buffer + bytes; -+ } -+ block = msblk->block_cache[i].next_index; -+ mutex_unlock(&msblk->block_cache_mutex); -+ length -= bytes; -+ offset = 0; -+ } -+ } -+ -+finish: -+ return return_length; -+out: -+ return 0; -+} -+ -+ -+static int get_fragment_location(struct super_block *s, unsigned int fragment, -+ long long *fragment_start_block, -+ unsigned int *fragment_size) -+{ -+ struct squashfs_sb_info *msblk = s->s_fs_info; -+ long long start_block = -+ msblk->fragment_index[SQUASHFS_FRAGMENT_INDEX(fragment)]; -+ int offset = SQUASHFS_FRAGMENT_INDEX_OFFSET(fragment); -+ struct squashfs_fragment_entry fragment_entry; -+ -+ if (msblk->swap) { -+ struct squashfs_fragment_entry sfragment_entry; -+ -+ if (!squashfs_get_cached_block(s, &sfragment_entry, start_block, offset, -+ sizeof(sfragment_entry), &start_block, -+ (unsigned int *)&offset)) -+ goto out; -+ SQUASHFS_SWAP_FRAGMENT_ENTRY(&fragment_entry, &sfragment_entry); -+ } else -+ if (!squashfs_get_cached_block(s, &fragment_entry, start_block, offset, -+ sizeof(fragment_entry), &start_block, -+ (unsigned int *)&offset)) -+ goto out; -+ -+ *fragment_start_block = fragment_entry.start_block; -+ *fragment_size = fragment_entry.size; -+ -+ return 1; -+ -+out: -+ return 0; -+} -+ -+ -+SQSH_EXTERN void release_cached_fragment(struct squashfs_sb_info *msblk, -+ struct squashfs_fragment_cache *fragment) -+{ -+ mutex_lock(&msblk->fragment_mutex); -+ fragment->locked --; -+ if (fragment->locked == 0) { -+ msblk->unused_frag_blks ++; -+ smp_mb(); -+ wake_up(&msblk->fragment_wait_queue); -+ } -+ mutex_unlock(&msblk->fragment_mutex); -+} -+ -+ -+SQSH_EXTERN -+struct squashfs_fragment_cache *get_cached_fragment(struct super_block *s, -+ long long start_block, int length) -+{ -+ int i, n; -+ struct squashfs_sb_info *msblk = s->s_fs_info; -+ struct squashfs_super_block *sblk = &msblk->sblk; -+ -+ while (1) { -+ mutex_lock(&msblk->fragment_mutex); -+ -+ for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS && -+ msblk->fragment[i].block != start_block; i++); -+ -+ if (i == SQUASHFS_CACHED_FRAGMENTS) { -+ if (msblk->unused_frag_blks == 0) { -+ mutex_unlock(&msblk->fragment_mutex); -+ wait_event(msblk->fragment_wait_queue, msblk->unused_frag_blks); -+ continue; -+ } -+ -+ i = msblk->next_fragment; -+ for (n = 0; n < SQUASHFS_CACHED_FRAGMENTS; n++) { -+ if (msblk->fragment[i].locked == 0) -+ break; -+ i = (i + 1) % SQUASHFS_CACHED_FRAGMENTS; -+ } -+ -+ msblk->next_fragment = (msblk->next_fragment + 1) % -+ SQUASHFS_CACHED_FRAGMENTS; -+ -+ if (msblk->fragment[i].data == NULL) { -+ msblk->fragment[i].data = vmalloc(sblk->block_size); -+ if (msblk->fragment[i].data == NULL) { -+ ERROR("Failed to allocate fragment cache block\n"); -+ mutex_unlock(&msblk->fragment_mutex); -+ goto out; -+ } -+ } -+ -+ msblk->unused_frag_blks --; -+ msblk->fragment[i].block = SQUASHFS_INVALID_BLK; -+ msblk->fragment[i].locked = 1; -+ mutex_unlock(&msblk->fragment_mutex); -+ -+ msblk->fragment[i].length = squashfs_read_data(s, -+ msblk->fragment[i].data, start_block, length, NULL, -+ sblk->block_size); -+ -+ if (msblk->fragment[i].length == 0) { -+ ERROR("Unable to read fragment cache block [%llx]\n", start_block); -+ msblk->fragment[i].locked = 0; -+ msblk->unused_frag_blks ++; -+ smp_mb(); -+ wake_up(&msblk->fragment_wait_queue); -+ goto out; -+ } -+ -+ mutex_lock(&msblk->fragment_mutex); -+ msblk->fragment[i].block = start_block; -+ TRACE("New fragment %d, start block %lld, locked %d\n", -+ i, msblk->fragment[i].block, msblk->fragment[i].locked); -+ mutex_unlock(&msblk->fragment_mutex); -+ break; -+ } -+ -+ if (msblk->fragment[i].locked == 0) -+ msblk->unused_frag_blks --; -+ msblk->fragment[i].locked++; -+ mutex_unlock(&msblk->fragment_mutex); -+ TRACE("Got fragment %d, start block %lld, locked %d\n", i, -+ msblk->fragment[i].block, msblk->fragment[i].locked); -+ break; -+ } -+ -+ return &msblk->fragment[i]; -+ -+out: -+ return NULL; -+} -+ -+ -+static void squashfs_new_inode(struct squashfs_sb_info *msblk, struct inode *i, -+ struct squashfs_base_inode_header *inodeb) -+{ -+ i->i_ino = inodeb->inode_number; -+ i->i_mtime.tv_sec = inodeb->mtime; -+ i->i_atime.tv_sec = inodeb->mtime; -+ i->i_ctime.tv_sec = inodeb->mtime; -+ i->i_uid = msblk->uid[inodeb->uid]; -+ i->i_mode = inodeb->mode; -+ i->i_size = 0; -+ -+ if (inodeb->guid == SQUASHFS_GUIDS) -+ i->i_gid = i->i_uid; -+ else -+ i->i_gid = msblk->guid[inodeb->guid]; -+} -+ -+ -+static squashfs_inode_t squashfs_inode_lookup(struct super_block *s, int ino) -+{ -+ struct squashfs_sb_info *msblk = s->s_fs_info; -+ long long start = msblk->inode_lookup_table[SQUASHFS_LOOKUP_BLOCK(ino - 1)]; -+ int offset = SQUASHFS_LOOKUP_BLOCK_OFFSET(ino - 1); -+ squashfs_inode_t inode; -+ -+ TRACE("Entered squashfs_inode_lookup, inode_number = %d\n", ino); -+ -+ if (msblk->swap) { -+ squashfs_inode_t sinode; -+ -+ if (!squashfs_get_cached_block(s, &sinode, start, offset, -+ sizeof(sinode), &start, (unsigned int *)&offset)) -+ goto out; -+ SQUASHFS_SWAP_INODE_T((&inode), &sinode); -+ } else if (!squashfs_get_cached_block(s, &inode, start, offset, -+ sizeof(inode), &start, (unsigned int *)&offset)) -+ goto out; -+ -+ TRACE("squashfs_inode_lookup, inode = 0x%llx\n", inode); -+ -+ return inode; -+ -+out: -+ return SQUASHFS_INVALID_BLK; -+} -+ -+ -+static void vfs_read_inode(struct inode *i) -+{ -+ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; -+ squashfs_inode_t inode = squashfs_inode_lookup(i->i_sb, i->i_ino); -+ -+ TRACE("Entered vfs_read_inode\n"); -+ -+ if(inode != SQUASHFS_INVALID_BLK) -+ (msblk->read_inode)(i, inode); -+} -+ -+ -+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; -+} -+ -+ -+SQSH_EXTERN struct inode *squashfs_iget(struct super_block *s, -+ squashfs_inode_t inode, unsigned int inode_number) -+{ -+ struct squashfs_sb_info *msblk = s->s_fs_info; -+ struct inode *i = iget_locked(s, inode_number); -+ -+ TRACE("Entered squashfs_iget\n"); -+ -+ if(i && (i->i_state & I_NEW)) { -+ (msblk->read_inode)(i, inode); -+ unlock_new_inode(i); -+ } -+ -+ return i; -+} -+ -+ -+static int squashfs_read_inode(struct inode *i, squashfs_inode_t inode) -+{ -+ struct super_block *s = i->i_sb; -+ struct squashfs_sb_info *msblk = s->s_fs_info; -+ struct squashfs_super_block *sblk = &msblk->sblk; -+ long long block = SQUASHFS_INODE_BLK(inode) + sblk->inode_table_start; -+ unsigned int offset = SQUASHFS_INODE_OFFSET(inode); -+ long long next_block; -+ unsigned int next_offset; -+ union squashfs_inode_header id, sid; -+ struct squashfs_base_inode_header *inodeb = &id.base, *sinodeb = &sid.base; -+ -+ TRACE("Entered squashfs_read_inode\n"); -+ -+ if (msblk->swap) { -+ if (!squashfs_get_cached_block(s, sinodeb, block, offset, -+ sizeof(*sinodeb), &next_block, &next_offset)) -+ goto failed_read; -+ SQUASHFS_SWAP_BASE_INODE_HEADER(inodeb, sinodeb, sizeof(*sinodeb)); -+ } else -+ if (!squashfs_get_cached_block(s, inodeb, block, offset, -+ sizeof(*inodeb), &next_block, &next_offset)) -+ goto failed_read; -+ -+ squashfs_new_inode(msblk, i, inodeb); -+ -+ switch(inodeb->inode_type) { -+ case SQUASHFS_FILE_TYPE: { -+ unsigned int frag_size; -+ long long frag_blk; -+ struct squashfs_reg_inode_header *inodep = &id.reg; -+ struct squashfs_reg_inode_header *sinodep = &sid.reg; -+ -+ if (msblk->swap) { -+ if (!squashfs_get_cached_block(s, sinodep, block, offset, -+ sizeof(*sinodep), &next_block, &next_offset)) -+ goto failed_read; -+ SQUASHFS_SWAP_REG_INODE_HEADER(inodep, sinodep); -+ } else -+ if (!squashfs_get_cached_block(s, inodep, block, offset, -+ sizeof(*inodep), &next_block, &next_offset)) -+ goto failed_read; -+ -+ frag_blk = SQUASHFS_INVALID_BLK; -+ -+ if (inodep->fragment != SQUASHFS_INVALID_FRAG) -+ if(!get_fragment_location(s, inodep->fragment, &frag_blk, -+ &frag_size)) -+ goto failed_read; -+ -+ i->i_nlink = 1; -+ i->i_size = inodep->file_size; -+ i->i_fop = &generic_ro