diff options
author | Florian Boor <florian.boor@kernelconcepts.de> | 2008-07-17 19:04:31 +0000 |
---|---|---|
committer | Florian Boor <florian.boor@kernelconcepts.de> | 2008-07-17 19:04:31 +0000 |
commit | 7e0a1576c8bae32c418a5fab4d7c936ecee814f6 (patch) | |
tree | 3f90f88a34caece6cf3b9bb7d0f1fe021a4a1078 | |
parent | 6585d160cdf126f48562d2ceb3ed2eb38aed2ace (diff) | |
parent | fcbe107913b10643d1ba8ac137de273e12e8854a (diff) |
merge of '05e9902f277de28b4e08c6bb6aff89f8862b84ac'
and '912f388483a3e1703ca89d7b2309723fd3407420'
94 files changed, 6906 insertions, 2472 deletions
diff --git a/conf/distro/include/moko-autorev.inc b/conf/distro/include/moko-autorev.inc index c411149cd9..9043345134 100644 --- a/conf/distro/include/moko-autorev.inc +++ b/conf/distro/include/moko-autorev.inc @@ -21,7 +21,6 @@ SRCREV_pn-openmoko-agpsui ?= "${AUTOREV}" SRCREV_pn-openmoko-alsa-scenarios ?= "${AUTOREV}" SRCREV_pn-openmoko-appearance ?= "${AUTOREV}" SRCREV_pn-openmoko-appmanager2 ?= "${AUTOREV}" -SRCREV_pn-openmoko-appearance ?= "${AUTOREV}" SRCREV_pn-openmoko-browser2 ?= "${AUTOREV}" SRCREV_pn-openmoko-calculator2 ?= "${AUTOREV}" SRCREV_pn-openmoko-common2 ?= "${AUTOREV}" diff --git a/conf/distro/include/preferred-om-2008-versions.inc b/conf/distro/include/preferred-om-2008-versions.inc index a9fbb3067d..a03f42fe0d 100644 --- a/conf/distro/include/preferred-om-2008-versions.inc +++ b/conf/distro/include/preferred-om-2008-versions.inc @@ -1555,8 +1555,8 @@ PREFERRED_VERSION_python-pymp3 ?= "0.3.4" PREFERRED_VERSION_python-pyrad ?= "0.8" PREFERRED_VERSION_python-pyraf ?= "1.4" PREFERRED_VERSION_python-pyreverse ?= "0.5.2" -PREFERRED_VERSION_python-pyrex ?= "0.9.5.1a" -PREFERRED_VERSION_python-pyrex-native ?= "0.9.5.1a" +PREFERRED_VERSION_python-pyrex ?= "0.9.8" +PREFERRED_VERSION_python-pyrex-native ?= "0.9.8" PREFERRED_VERSION_python-pyro ?= "3.7" PREFERRED_VERSION_python-pyserial ?= "2.2" PREFERRED_VERSION_python-pytester ?= "0.6.0" diff --git a/conf/distro/include/sane-srcdates.inc b/conf/distro/include/sane-srcdates.inc index 10a0330f17..f248a81bba 100644 --- a/conf/distro/include/sane-srcdates.inc +++ b/conf/distro/include/sane-srcdates.inc @@ -52,7 +52,7 @@ SRCDATE_gtkhtml2 ?= "20060323" # Enlightenment Foundation Libraries # Caution: This is not alphabetically, but (roughly) dependency-sorted. # Please leave it like that. -EFL_SRCDATE ?= "20080610" +EFL_SRCDATE ?= "20080716" SRCDATE_edb-native ?= "${EFL_SRCDATE}" SRCDATE_edb ?= "${EFL_SRCDATE}" SRCDATE_eet-native ?= "${EFL_SRCDATE}" diff --git a/conf/distro/include/sane-srcrevs.inc b/conf/distro/include/sane-srcrevs.inc index f646ee55cb..feb237cea6 100644 --- a/conf/distro/include/sane-srcrevs.inc +++ b/conf/distro/include/sane-srcrevs.inc @@ -72,6 +72,7 @@ SRCREV_pn-linux-bfin ?= "3758" SRCREV_pn-linux-hackndev-2.6 ?= "1308" SRCREV_pn-linux-ixp4xx ?= "1066" SRCREV_pn-linux-openmoko ?= "5ccaca2adb1c37b5955a4733f68ae08a755e3d78" +SRCREV_pn-linux-openmoko-devel ?= "9c058ff0d2641df3c36fc3300acb72078d2c41d4" SRCREV_pn-llvm-gcc4 ?= "374" SRCREV_pn-llvm-gcc4-cross ?= "374" SRCREV_pn-maemo-mapper ?= "118" @@ -100,30 +101,19 @@ SRCREV_pn-osb-nrcore ?= "126" SRCREV_pn-openmoko-agpsui ?= "7" SRCREV_pn-openmoko-alsa-scenarios ?= "4406" SRCREV_pn-openmoko-appearance ?= "3262" -SRCREV_pn-openmoko-appmanager ?= "1851" -SRCREV_pn-openmoko-appmanager2 ?= "3442" +SRCREV_pn-openmoko-appmanager2 ?= "4530" SRCREV_pn-openmoko-browser2 ?= "4172" -SRCREV_pn-openmoko-calculator ?= "2404" SRCREV_pn-openmoko-calculator2 ?= "3655" -SRCREV_pn-openmoko-common ?= "397" SRCREV_pn-openmoko-common2 ?= "3259" -SRCREV_pn-openmoko-contacts ?= "2298" SRCREV_pn-openmoko-contacts2 ?= "418" -SRCREV_pn-openmoko-dates ?= "467" SRCREV_pn-openmoko-dates2 ?= "673" -SRCREV_pn-openmoko-dialer ?= "2811" SRCREV_pn-openmoko-dialer2 ?= "4343" SRCREV_pn-openmoko-feedreader2 ?= "3645" -SRCREV_pn-openmoko-finger-demo ?= "1671" SRCREV_pn-openmoko-firststart2 ?= "3158" SRCREV_pn-openmoko-footer ?= "2354" -SRCREV_pn-openmoko-icon-theme-standard ?= "2232" SRCREV_pn-openmoko-icon-theme-standard2 ?= "4232" SRCREV_pn-openmoko-icon-theme-standard2-qvga ?= "4232" -SRCREV_pn-openmoko-keyboard ?= "1631" -SRCREV_pn-openmoko-libs ?= "2367" SRCREV_pn-openmoko-mediaplayer2 ?= "4173" -SRCREV_pn-openmoko-messages ?= "2276" SRCREV_pn-openmoko-messages2 ?= "4340" SRCREV_pn-openmoko-panel-battery ?= "3360" SRCREV_pn-openmoko-panel-bt ?= "4331" @@ -136,22 +126,12 @@ SRCREV_pn-openmoko-panel-mainmenu ?= "2567" SRCREV_pn-openmoko-panel-memory ?= "3903" SRCREV_pn-openmoko-panel-usb ?= "3360" SRCREV_pn-openmoko-panel-wifi ?= "4344" -SRCREV_pn-openmoko-sample2 ?= "3528" -SRCREV_pn-openmoko-session ?= "152" SRCREV_pn-openmoko-sample2 ?= "3537" -SRCREV_pn-openmoko-simplemediaplayer ?= "1688" SRCREV_pn-openmoko-sound-theme-standard2 ?= "4271" -SRCREV_pn-openmoko-stylus-demo ?= "2324" -SRCREV_pn-openmoko-stylus-demo-simple ?= "1818" -SRCREV_pn-openmoko-taskmanager ?= "1663" -SRCREV_pn-openmoko-tasks ?= "320" SRCREV_pn-openmoko-tasks2 ?= "399" SRCREV_pn-openmoko-terminal2 ?= "4039" -SRCREV_pn-openmoko-theme-standard ?= "4167" -SRCREV_pn-openmoko-theme-standard-qvga ?= "4167" SRCREV_pn-openmoko-theme-standard2 ?= "4338" SRCREV_pn-openmoko-theme-standard2-qvga ?= "3425" -SRCREV_pn-openmoko-today ?= "3056" SRCREV_pn-openmoko-today2 ?= "4168" SRCREV_pn-openmoko-today2-folders ?= "3704" SRCREV_pn-openmoko-toolchain-scripts ?= "4430" @@ -185,6 +165,7 @@ SRCREV_pn-sjf2410-linux-native ?= "4268" SRCREV_pn-sphyrna ?= "45" SRCREV_pn-tmut ?= "60" SRCREV_pn-u-boot-openmoko ?= "4297" +SRCREV_pn-u-boot-openmoko-devel ?= "ba029a1426bfca169572bf80d50a8b190a6b0e19" SRCREV_pn-usbpath ?= "3172" SRCREV_pn-usbpath-native ?= "3172" SRCREV_pn-webkit-gtk ?= "35062" diff --git a/packages/freesmartphone/python-odeviced/.mtn2git_empty b/packages/busybox/busybox-1.11.1/.mtn2git_empty index e69de29bb2..e69de29bb2 100644 --- a/packages/freesmartphone/python-odeviced/.mtn2git_empty +++ b/packages/busybox/busybox-1.11.1/.mtn2git_empty diff --git a/packages/busybox/busybox-1.11.1/defconfig b/packages/busybox/busybox-1.11.1/defconfig new file mode 100644 index 0000000000..a7b8ed53a0 --- /dev/null +++ b/packages/busybox/busybox-1.11.1/defconfig @@ -0,0 +1,777 @@ +# +# Automatically generated make config: don't edit +# Busybox version: 1.9.1 +# Thu Feb 14 11:54:00 2008 +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Busybox Settings +# + +# +# General Configuration +# +# CONFIG_NITPICK is not set +# CONFIG_DESKTOP is not set +# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set +# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_SHOW_USAGE=y +# CONFIG_FEATURE_VERBOSE_USAGE is not set +CONFIG_FEATURE_COMPRESS_USAGE=y +# CONFIG_FEATURE_INSTALLER is not set +CONFIG_LOCALE_SUPPORT=y +CONFIG_GETOPT_LONG=y +CONFIG_FEATURE_DEVPTS=y +# CONFIG_FEATURE_CLEAN_UP is not set +CONFIG_FEATURE_PIDFILE=y +CONFIG_FEATURE_SUID=y +CONFIG_FEATURE_SUID_CONFIG=y +CONFIG_FEATURE_SUID_CONFIG_QUIET=y +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_PREFER_APPLETS is not set +CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +CONFIG_FEATURE_SYSLOG=y +CONFIG_FEATURE_HAVE_RPC=y + +# +# Build Options +# +# CONFIG_STATIC is not set +# CONFIG_BUILD_LIBBUSYBOX is not set +# CONFIG_FEATURE_INDIVIDUAL is not set +# CONFIG_FEATURE_SHARED_BUSYBOX is not set +CONFIG_LFS=y + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_WERROR is not set +CONFIG_NO_DEBUG_LIB=y +# CONFIG_DMALLOC is not set +# CONFIG_EFENCE is not set +# CONFIG_INCLUDE_SUSv2 is not set + +# +# Installation Options +# +# CONFIG_INSTALL_NO_USR is not set +CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_INSTALL_APPLET_DONT is not set +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_PREFIX="./_install" + +# +# Busybox Library Tuning +# +CONFIG_PASSWORD_MINLEN=6 +CONFIG_MD5_SIZE_VS_SPEED=2 +CONFIG_FEATURE_FAST_TOP=y +# CONFIG_FEATURE_ETC_NETWORKS is not set +CONFIG_FEATURE_EDITING=y +CONFIG_FEATURE_EDITING_MAX_LEN=1024 +CONFIG_FEATURE_EDITING_FANCY_KEYS=y +# CONFIG_FEATURE_EDITING_VI is not set +CONFIG_FEATURE_EDITING_HISTORY=15 +CONFIG_FEATURE_EDITING_SAVEHISTORY=y +CONFIG_FEATURE_TAB_COMPLETION=y +CONFIG_FEATURE_USERNAME_COMPLETION=y +CONFIG_FEATURE_EDITING_FANCY_PROMPT=y +CONFIG_FEATURE_COPYBUF_KB=4 +CONFIG_MONOTONIC_SYSCALL=y +CONFIG_IOCTL_HEX2STR_ERROR=y + +# +# Applets +# + +# +# Archival Utilities +# +CONFIG_AR=y +# CONFIG_FEATURE_AR_LONG_FILENAMES is not set +CONFIG_BUNZIP2=y +# CONFIG_BZIP2 is not set +CONFIG_CPIO=y +# CONFIG_DPKG is not set +# CONFIG_DPKG_DEB is not set +# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set +CONFIG_GUNZIP=y +# CONFIG_FEATURE_GUNZIP_UNCOMPRESS is not set +CONFIG_GZIP=y +# CONFIG_RPM2CPIO is not set +# CONFIG_RPM is not set +# CONFIG_FEATURE_RPM_BZ2 is not set +CONFIG_TAR=y +CONFIG_FEATURE_TAR_CREATE=y +CONFIG_FEATURE_TAR_BZIP2=y +# CONFIG_FEATURE_TAR_LZMA is not set +CONFIG_FEATURE_TAR_FROM=y +CONFIG_FEATURE_TAR_GZIP=y +# CONFIG_FEATURE_TAR_COMPRESS is not set +# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set +# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set +CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y +# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set +# CONFIG_UNCOMPRESS is not set +# CONFIG_UNLZMA is not set +# CONFIG_FEATURE_LZMA_FAST is not set +CONFIG_UNZIP=y + +# +# Common options for cpio and tar +# +# CONFIG_FEATURE_UNARCHIVE_TAPE is not set +# CONFIG_FEATURE_DEB_TAR_GZ is not set +# CONFIG_FEATURE_DEB_TAR_BZ2 is not set +# CONFIG_FEATURE_DEB_TAR_LZMA is not set + +# +# Coreutils +# +CONFIG_BASENAME=y +# CONFIG_CAL is not set +CONFIG_CAT=y +# CONFIG_CATV is not set +CONFIG_CHGRP=y +CONFIG_CHMOD=y +CONFIG_CHOWN=y +CONFIG_CHROOT=y +# CONFIG_CKSUM is not set +# CONFIG_COMM is not set +CONFIG_CP=y +CONFIG_CUT=y +CONFIG_DATE=y +# CONFIG_FEATURE_DATE_ISOFMT is not set +CONFIG_DD=y +CONFIG_FEATURE_DD_SIGNAL_HANDLING=y +# CONFIG_FEATURE_DD_IBS_OBS is not set +CONFIG_DF=y +# CONFIG_FEATURE_DF_INODE is not set +CONFIG_DIRNAME=y +# CONFIG_DOS2UNIX is not set +# CONFIG_UNIX2DOS is not set +CONFIG_DU=y +CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y +CONFIG_ECHO=y +CONFIG_FEATURE_FANCY_ECHO=y +CONFIG_ENV=y +CONFIG_FEATURE_ENV_LONG_OPTIONS=y +# CONFIG_EXPAND is not set +# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set +CONFIG_EXPR=y +# CONFIG_EXPR_MATH_SUPPORT_64 is not set +CONFIG_FALSE=y +# CONFIG_FOLD is not set +CONFIG_HEAD=y +# CONFIG_FEATURE_FANCY_HEAD is not set +# CONFIG_HOSTID is not set +CONFIG_ID=y +# CONFIG_INSTALL is not set +# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set +# CONFIG_LENGTH is not set +CONFIG_LN=y +CONFIG_LOGNAME=y +CONFIG_LS=y +CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_FEATURE_LS_USERNAME=y +CONFIG_FEATURE_LS_COLOR=y +# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set +CONFIG_MD5SUM=y +CONFIG_MKDIR=y +CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y +CONFIG_MKFIFO=y +CONFIG_MKNOD=y +CONFIG_MV=y +# CONFIG_FEATURE_MV_LONG_OPTIONS is not set +# CONFIG_NICE is not set +CONFIG_NOHUP=y +CONFIG_OD=y +# CONFIG_PRINTENV is not set +CONFIG_PRINTF=y +CONFIG_PWD=y +CONFIG_READLINK=y +CONFIG_FEATURE_READLINK_FOLLOW=y +CONFIG_REALPATH=y +CONFIG_RM=y +CONFIG_RMDIR=y +CONFIG_SEQ=y +# CONFIG_SHA1SUM is not set +CONFIG_SLEEP=y +CONFIG_FEATURE_FANCY_SLEEP=y +CONFIG_SORT=y +CONFIG_FEATURE_SORT_BIG=y +# CONFIG_SPLIT is not set +# CONFIG_FEATURE_SPLIT_FANCY is not set +# CONFIG_STAT is not set +# CONFIG_FEATURE_STAT_FORMAT is not set +CONFIG_STTY=y +# CONFIG_SUM is not set +CONFIG_SYNC=y +CONFIG_TAIL=y +CONFIG_FEATURE_FANCY_TAIL=y +CONFIG_TEE=y +# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set +CONFIG_TEST=y +# CONFIG_FEATURE_TEST_64 is not set +CONFIG_TOUCH=y +CONFIG_TR=y +CONFIG_FEATURE_TR_CLASSES=y +# CONFIG_FEATURE_TR_EQUIV is not set +CONFIG_TRUE=y +CONFIG_TTY=y +CONFIG_UNAME=y +# CONFIG_UNEXPAND is not set +# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set +CONFIG_UNIQ=y +CONFIG_USLEEP=y +# CONFIG_UUDECODE is not set +# CONFIG_UUENCODE is not set +CONFIG_WC=y +# CONFIG_FEATURE_WC_LARGE is not set +CONFIG_WHO=y +CONFIG_WHOAMI=y +CONFIG_YES=y + +# +# Common options for cp and mv +# +# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set + +# +# Common options for ls, more and telnet +# +CONFIG_FEATURE_AUTOWIDTH=y + +# +# Common options for df, du, ls +# +CONFIG_FEATURE_HUMAN_READABLE=y + +# +# Common options for md5sum, sha1sum +# +CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y + +# +# Console Utilities +# +CONFIG_CHVT=y +CONFIG_CLEAR=y +CONFIG_DEALLOCVT=y +CONFIG_DUMPKMAP=y +# CONFIG_KBD_MODE is not set +CONFIG_LOADFONT=y +CONFIG_LOADKMAP=y +CONFIG_OPENVT=y +CONFIG_RESET=y +# CONFIG_RESIZE is not set +# CONFIG_FEATURE_RESIZE_PRINT is not set +CONFIG_SETCONSOLE=y +# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set +# CONFIG_SETKEYCODES is not set +# CONFIG_SETLOGCONS is not set + +# +# Debian Utilities +# +CONFIG_MKTEMP=y +# CONFIG_PIPE_PROGRESS is not set +CONFIG_RUN_PARTS=y +CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y +# CONFIG_FEATURE_RUN_PARTS_FANCY is not set +CONFIG_START_STOP_DAEMON=y +CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y +CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y +CONFIG_WHICH=y + +# +# Editors +# +CONFIG_AWK=y +CONFIG_FEATURE_AWK_MATH=y +CONFIG_CMP=y +CONFIG_DIFF=y +CONFIG_FEATURE_DIFF_BINARY=y +CONFIG_FEATURE_DIFF_DIR=y +# CONFIG_FEATURE_DIFF_MINIMAL is not set +# CONFIG_ED is not set +CONFIG_PATCH=y +CONFIG_SED=y +CONFIG_VI=y +CONFIG_FEATURE_VI_MAX_LEN=1024 +CONFIG_FEATURE_VI_8BIT=y +CONFIG_FEATURE_VI_COLON=y +CONFIG_FEATURE_VI_YANKMARK=y +CONFIG_FEATURE_VI_SEARCH=y +CONFIG_FEATURE_VI_USE_SIGNALS=y +# CONFIG_FEATURE_VI_DOT_CMD is not set +# CONFIG_FEATURE_VI_READONLY is not set +# CONFIG_FEATURE_VI_SETOPTS is not set +# CONFIG_FEATURE_VI_SET is not set +CONFIG_FEATURE_VI_WIN_RESIZE=y +CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y +CONFIG_FEATURE_ALLOW_EXEC=y + +# +# Finding Utilities +# +CONFIG_FIND=y +CONFIG_FEATURE_FIND_PRINT0=y +CONFIG_FEATURE_FIND_MTIME=y +CONFIG_FEATURE_FIND_MMIN=y +CONFIG_FEATURE_FIND_PERM=y +CONFIG_FEATURE_FIND_TYPE=y +CONFIG_FEATURE_FIND_XDEV=y +CONFIG_FEATURE_FIND_MAXDEPTH=y +CONFIG_FEATURE_FIND_NEWER=y +# CONFIG_FEATURE_FIND_INUM is not set +CONFIG_FEATURE_FIND_EXEC=y +CONFIG_FEATURE_FIND_USER=y +CONFIG_FEATURE_FIND_GROUP=y +CONFIG_FEATURE_FIND_NOT=y +CONFIG_FEATURE_FIND_DEPTH=y +CONFIG_FEATURE_FIND_PAREN=y +CONFIG_FEATURE_FIND_SIZE=y +CONFIG_FEATURE_FIND_PRUNE=y +# CONFIG_FEATURE_FIND_DELETE is not set +CONFIG_FEATURE_FIND_PATH=y +CONFIG_FEATURE_FIND_REGEX=y +# CONFIG_FEATURE_FIND_CONTEXT is not set +CONFIG_GREP=y +CONFIG_FEATURE_GREP_EGREP_ALIAS=y +CONFIG_FEATURE_GREP_FGREP_ALIAS=y +CONFIG_FEATURE_GREP_CONTEXT=y +CONFIG_XARGS=y +# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set +# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set +# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set +# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set + +# +# Init Utilities +# +# CONFIG_INIT is not set +# CONFIG_DEBUG_INIT is not set +# CONFIG_FEATURE_USE_INITTAB is not set +# CONFIG_FEATURE_INIT_SCTTY is not set +# CONFIG_FEATURE_INIT_SYSLOG is not set +# CONFIG_FEATURE_EXTRA_QUIET is not set +# CONFIG_FEATURE_INIT_COREDUMPS is not set +# CONFIG_FEATURE_INITRD is not set +# CONFIG_HALT is not set +# CONFIG_MESG is not set + +# +# Login/Password Management Utilities +# +# CONFIG_FEATURE_SHADOWPASSWDS is not set +# CONFIG_USE_BB_SHADOW is not set +# CONFIG_USE_BB_PWD_GRP is not set +# CONFIG_ADDGROUP is not set +# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set +# CONFIG_DELGROUP is not set +# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set +# CONFIG_ADDUSER is not set +# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set +# CONFIG_DELUSER is not set +# CONFIG_GETTY is not set +# CONFIG_FEATURE_UTMP is not set +# CONFIG_FEATURE_WTMP is not set +# CONFIG_LOGIN is not set +# CONFIG_PAM is not set +# CONFIG_LOGIN_SCRIPTS is not set +# CONFIG_FEATURE_NOLOGIN is not set +# CONFIG_FEATURE_SECURETTY is not set +# CONFIG_PASSWD is not set +# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set +# CONFIG_CRYPTPW is not set +# CONFIG_CHPASSWD is not set +# CONFIG_SU is not set +# CONFIG_FEATURE_SU_SYSLOG is not set +# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set +# CONFIG_SULOGIN is not set +# CONFIG_VLOCK is not set + +# +# Linux Ext2 FS Progs +# +CONFIG_CHATTR=y +CONFIG_FSCK=y +# CONFIG_LSATTR is not set + +# +# Linux Module Utilities +# +CONFIG_INSMOD=y +# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set +CONFIG_RMMOD=y +CONFIG_LSMOD=y +# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set +CONFIG_MODPROBE=y +CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS=y +CONFIG_FEATURE_MODPROBE_FANCY_ALIAS=y + +# +# Options common to multiple modutils +# +CONFIG_FEATURE_CHECK_TAINTED_MODULE=y +# CONFIG_FEATURE_2_4_MODULES is not set +CONFIG_FEATURE_2_6_MODULES=y +# CONFIG_FEATURE_QUERY_MODULE_INTERFACE is not set + +# +# Linux System Utilities +# +CONFIG_DMESG=y +CONFIG_FEATURE_DMESG_PRETTY=y +CONFIG_FBSET=y +CONFIG_FEATURE_FBSET_FANCY=y +CONFIG_FEATURE_FBSET_READMODE=y +# CONFIG_FDFLUSH is not set +# CONFIG_FDFORMAT is not set +CONFIG_FDISK=y +CONFIG_FDISK_SUPPORT_LARGE_DISKS=y +CONFIG_FEATURE_FDISK_WRITABLE=y +# CONFIG_FEATURE_AIX_LABEL is not set +# CONFIG_FEATURE_SGI_LABEL is not set +# CONFIG_FEATURE_SUN_LABEL is not set +# CONFIG_FEATURE_OSF_LABEL is not set +# CONFIG_FEATURE_FDISK_ADVANCED is not set +# CONFIG_FREERAMDISK is not set +CONFIG_FSCK_MINIX=y +CONFIG_MKFS_MINIX=y + +# +# Minix filesystem support +# +CONFIG_FEATURE_MINIX2=y +# CONFIG_GETOPT is not set +CONFIG_HEXDUMP=y +# CONFIG_HD is not set +# CONFIG_FEATURE_HEXDUMP_REVERSE is not set +CONFIG_HWCLOCK=y +CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y +CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y +# CONFIG_IPCRM is not set +# CONFIG_IPCS is not set +CONFIG_LOSETUP=y +# CONFIG_MDEV is not set +# CONFIG_FEATURE_MDEV_CONF is not set +# CONFIG_FEATURE_MDEV_EXEC is not set +# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set +CONFIG_MKSWAP=y +# CONFIG_FEATURE_MKSWAP_V0 is not set +CONFIG_MORE=y +CONFIG_FEATURE_USE_TERMIOS=y +CONFIG_MOUNT=y +# CONFIG_FEATURE_MOUNT_HELPERS is not set +CONFIG_FEATURE_MOUNT_NFS=y +# CONFIG_FEATURE_MOUNT_CIFS is not set +CONFIG_FEATURE_MOUNT_FLAGS=y +CONFIG_FEATURE_MOUNT_FSTAB=y +CONFIG_PIVOT_ROOT=y +CONFIG_RDATE=y +# CONFIG_READPROFILE is not set +# CONFIG_SETARCH is not set +CONFIG_SWAPONOFF=y +CONFIG_SWITCH_ROOT=y +CONFIG_UMOUNT=y +# CONFIG_FEATURE_UMOUNT_ALL is not set + +# +# Common options for mount/umount +# +CONFIG_FEATURE_MOUNT_LOOP=y +# CONFIG_FEATURE_MTAB_SUPPORT is not set + +# +# Miscellaneous Utilities +# +# CONFIG_ADJTIMEX is not set +# CONFIG_BBCONFIG is not set +# CONFIG_CHRT is not set +# CONFIG_CROND is not set +# CONFIG_DEBUG_CROND_OPTION is not set +# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set +# CONFIG_CRONTAB is not set +CONFIG_DC=y +# CONFIG_DEVFSD is not set +# CONFIG_DEVFSD_MODLOAD is not set +# CONFIG_DEVFSD_FG_NP is not set +# CONFIG_DEVFSD_VERBOSE is not set +# CONFIG_FEATURE_DEVFS is not set +# CONFIG_EJECT is not set +# CONFIG_LAST is not set +CONFIG_LESS=y +CONFIG_FEATURE_LESS_MAXLINES=9999999 +CONFIG_FEATURE_LESS_BRACKETS=y +CONFIG_FEATURE_LESS_FLAGS=y +# CONFIG_FEATURE_LESS_FLAGCS is not set +# CONFIG_FEATURE_LESS_MARKS is not set +# CONFIG_FEATURE_LESS_REGEXP is not set +# CONFIG_HDPARM is not set +# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set +# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set +# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set +# CONFIG_MAKEDEVS is not set +# CONFIG_FEATURE_MAKEDEVS_LEAF is not set +# CONFIG_FEATURE_MAKEDEVS_TABLE is not set +# CONFIG_MICROCOM is not set +# CONFIG_MOUNTPOINT is not set +# CONFIG_MT is not set +# CONFIG_RAIDAUTORUN is not set +# CONFIG_READAHEAD is not set +# CONFIG_RUNLEVEL is not set +# CONFIG_RX is not set +CONFIG_STRINGS=y +# CONFIG_SETSID is not set +# CONFIG_TASKSET is not set +# CONFIG_FEATURE_TASKSET_FANCY is not set +CONFIG_TIME=y +# CONFIG_TTYSIZE is not set +# CONFIG_WATCHDOG is not set + +# +# Networking Utilities +# +CONFIG_FEATURE_IPV6=y +CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y +# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +# CONFIG_ARP is not set +# CONFIG_ARPING is not set +# CONFIG_DNSD is not set +# CONFIG_ETHER_WAKE is not set +# CONFIG_FAKEIDENTD is not set +# CONFIG_FTPGET is not set +# CONFIG_FTPPUT is not set +# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +CONFIG_HOSTNAME=y +# CONFIG_HTTPD is not set +# CONFIG_FEATURE_HTTPD_RANGES is not set +# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set +# CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP is not set +# CONFIG_FEATURE_HTTPD_SETUID is not set +# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set +# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set +# CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES is not set +# CONFIG_FEATURE_HTTPD_CGI is not set +# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set +# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set +# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set +# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set +# CONFIG_FEATURE_HTTPD_PROXY is not set +CONFIG_IFCONFIG=y +CONFIG_FEATURE_IFCONFIG_STATUS=y +# CONFIG_FEATURE_IFCONFIG_SLIP is not set +# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set +CONFIG_FEATURE_IFCONFIG_HW=y +# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set +CONFIG_IFUPDOWN=y +CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate" +# CONFIG_FEATURE_IFUPDOWN_IP is not set +# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set +CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN=y +CONFIG_FEATURE_IFUPDOWN_IPV4=y +CONFIG_FEATURE_IFUPDOWN_IPV6=y +CONFIG_FEATURE_IFUPDOWN_MAPPING=y +# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +# CONFIG_INETD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set +# CONFIG_FEATURE_INETD_RPC is not set +CONFIG_IP=y +CONFIG_FEATURE_IP_ADDRESS=y +CONFIG_FEATURE_IP_LINK=y +CONFIG_FEATURE_IP_ROUTE=y +CONFIG_FEATURE_IP_TUNNEL=y +# CONFIG_FEATURE_IP_RULE is not set +# CONFIG_FEATURE_IP_SHORT_FORMS is not set +# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_IPADDR is not set +# CONFIG_IPLINK is not set +# CONFIG_IPROUTE is not set +# CONFIG_IPTUNNEL is not set +# CONFIG_IPRULE is not set +# CONFIG_IPCALC is not set +# CONFIG_FEATURE_IPCALC_FANCY is not set +# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set +# CONFIG_NAMEIF is not set +# CONFIG_FEATURE_NAMEIF_EXTENDED is not set +CONFIG_NC=y +CONFIG_NC_SERVER=y +CONFIG_NC_EXTRA=y +CONFIG_NETSTAT=y +# CONFIG_FEATURE_NETSTAT_WIDE is not set +CONFIG_NSLOOKUP=y +CONFIG_PING=y +CONFIG_PING6=y +# CONFIG_PSCAN is not set +CONFIG_FEATURE_FANCY_PING=y +CONFIG_ROUTE=y +# CONFIG_SLATTACH is not set +CONFIG_TELNET=y +# CONFIG_FEATURE_TELNET_TTYPE is not set +CONFIG_FEATURE_TELNET_AUTOLOGIN=y +CONFIG_TELNETD=y +# CONFIG_FEATURE_TELNETD_STANDALONE is not set +CONFIG_TFTP=y +CONFIG_FEATURE_TFTP_GET=y +CONFIG_FEATURE_TFTP_PUT=y +# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set +# CONFIG_DEBUG_TFTP is not set +CONFIG_TRACEROUTE=y +# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set +# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set +# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +CONFIG_APP_UDHCPD=y +# CONFIG_APP_DHCPRELAY is not set +CONFIG_APP_DUMPLEASES=y +# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set +CONFIG_APP_UDHCPC=y +CONFIG_FEATURE_UDHCPC_ARPING=y +# CONFIG_FEATURE_UDHCP_DEBUG is not set +# CONFIG_FEATURE_RFC3397 is not set +CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 +# CONFIG_VCONFIG is not set +CONFIG_WGET=y +CONFIG_FEATURE_WGET_STATUSBAR=y +CONFIG_FEATURE_WGET_AUTHENTICATION=y +CONFIG_FEATURE_WGET_LONG_OPTIONS=y +# CONFIG_ZCIP is not set + +# +# Process Utilities +# +CONFIG_FREE=y +CONFIG_FUSER=y +CONFIG_KILL=y +CONFIG_KILLALL=y +# CONFIG_KILLALL5 is not set +# CONFIG_NMETER is not set +# CONFIG_PGREP is not set +CONFIG_PIDOF=y +# CONFIG_FEATURE_PIDOF_SINGLE is not set +# CONFIG_FEATURE_PIDOF_OMIT is not set +# CONFIG_PKILL is not set +CONFIG_PS=y +CONFIG_FEATURE_PS_WIDE=y +CONFIG_RENICE=y +CONFIG_BB_SYSCTL=y +CONFIG_TOP=y +CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y +CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y +# CONFIG_FEATURE_TOP_DECIMALS is not set +# CONFIG_FEATURE_TOPMEM is not set +CONFIG_UPTIME=y +CONFIG_WATCH=y + +# +# Shells +# +CONFIG_FEATURE_SH_IS_ASH=y +# CONFIG_FEATURE_SH_IS_HUSH is not set +# CONFIG_FEATURE_SH_IS_MSH is not set +# CONFIG_FEATURE_SH_IS_NONE is not set +CONFIG_ASH=y + +# +# Ash Shell Options +# +CONFIG_ASH_JOB_CONTROL=y +CONFIG_ASH_READ_NCHARS=y +CONFIG_ASH_READ_TIMEOUT=y +CONFIG_ASH_ALIAS=y +CONFIG_ASH_MATH_SUPPORT=y +# CONFIG_ASH_MATH_SUPPORT_64 is not set +CONFIG_ASH_GETOPTS=y +# CONFIG_ASH_BUILTIN_ECHO is not set +CONFIG_ASH_BUILTIN_TEST=y +# CONFIG_ASH_CMDCMD is not set +# CONFIG_ASH_MAIL is not set +CONFIG_ASH_OPTIMIZE_FOR_SIZE=y +# CONFIG_ASH_RANDOM_SUPPORT is not set +CONFIG_ASH_EXPAND_PRMT=y +# CONFIG_HUSH is not set +# CONFIG_HUSH_HELP is not set +# CONFIG_HUSH_INTERACTIVE is not set +# CONFIG_HUSH_JOB is not set +# CONFIG_HUSH_TICK is not set +# CONFIG_HUSH_IF is not set +# CONFIG_HUSH_LOOPS is not set +# CONFIG_LASH is not set +# CONFIG_MSH is not set + +# +# Bourne Shell Options +# +CONFIG_FEATURE_SH_EXTRA_QUIET=y +# CONFIG_FEATURE_SH_STANDALONE is not set +# CONFIG_CTTYHACK is not set + +# +# System Logging Utilities +# +CONFIG_SYSLOGD=y +CONFIG_FEATURE_ROTATE_LOGFILE=y +CONFIG_FEATURE_REMOTE_LOG=y +CONFIG_FEATURE_IPC_SYSLOG=y +CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16 +CONFIG_LOGREAD=y +CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y +CONFIG_KLOGD=y +CONFIG_LOGGER=y + +# +# Runit Utilities +# +# CONFIG_RUNSV is not set +# CONFIG_RUNSVDIR is not set +# CONFIG_SV is not set +# CONFIG_SVLOGD is not set +# CONFIG_CHPST is not set +# CONFIG_SETUIDGID is not set +# CONFIG_ENVUIDGID is not set +# CONFIG_ENVDIR is not set +# CONFIG_SOFTLIMIT is not set +# CONFIG_CHCON is not set +# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set +# CONFIG_GETENFORCE is not set +# CONFIG_GETSEBOOL is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_MATCHPATHCON is not set +# CONFIG_RESTORECON is not set +# CONFIG_RUNCON is not set +# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETFILES is not set +# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_SETSEBOOL is not set +# CONFIG_SESTATUS is not set + +# +# ipsvd utilities +# +# CONFIG_TCPSVD is not set +# CONFIG_UDPSVD is not set diff --git a/packages/busybox/busybox-1.11.1/udhcpscript.patch b/packages/busybox/busybox-1.11.1/udhcpscript.patch new file mode 100644 index 0000000000..fc21d440cd --- /dev/null +++ b/packages/busybox/busybox-1.11.1/udhcpscript.patch @@ -0,0 +1,17 @@ + +# +# Patch managed by http://www.holgerschurig.de/patcher.html +# + +--- busybox-1.00-rc3/examples/udhcp/simple.script~udhcpscript ++++ busybox-1.00-rc3/examples/udhcp/simple.script +@@ -17,8 +17,7 @@ + /sbin/ifconfig $interface $ip $BROADCAST $NETMASK + + if [ -n "$router" ] ; then +- echo "deleting routers" +- while route del default gw 0.0.0.0 dev $interface ; do ++ while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do + : + done + diff --git a/packages/busybox/busybox_1.11.1.bb b/packages/busybox/busybox_1.11.1.bb new file mode 100644 index 0000000000..67c52939cb --- /dev/null +++ b/packages/busybox/busybox_1.11.1.bb @@ -0,0 +1,22 @@ +require busybox.inc +PR = "r0" + +SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \ + file://udhcpscript.patch;patch=1 \ + file://busybox-cron \ + file://busybox-httpd \ + file://busybox-udhcpd \ + file://default.script \ + file://hwclock.sh \ + file://mount.busybox \ + file://syslog \ + file://syslog.conf \ + file://umount.busybox \ + file://defconfig" + +EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX}" + +do_configure () { + install -m 0644 ${WORKDIR}/defconfig ${S}/.config + cml1_do_configure +} diff --git a/packages/cacao/cacao-native_0.99.2.bb b/packages/cacao/cacao-native_0.99.2.bb index 943a2890ea..1fd4ed8296 100644 --- a/packages/cacao/cacao-native_0.99.2.bb +++ b/packages/cacao/cacao-native_0.99.2.bb @@ -2,6 +2,6 @@ require cacao-native.inc PR = "r0" -SRC_URI = "http://www.complang.tuwien.ac.at/cacaojvm/download/cacao-${PV}/cacao-${PV}.tar.bz2;md5sum=a5641452c7ba173060c99ed700950b3d" +SRC_URI = "http://www.complang.tuwien.ac.at/cacaojvm/download/cacao-${PV}/cacao-${PV}.tar.bz2;md5sum=912e353a26c88ba5f5f59ebb9f688e2f" diff --git a/packages/cacao/cacao_0.99.2.bb b/packages/cacao/cacao_0.99.2.bb index 5618213d2d..57ee1027a9 100644 --- a/packages/cacao/cacao_0.99.2.bb +++ b/packages/cacao/cacao_0.99.2.bb @@ -2,7 +2,7 @@ require cacao.inc PR = "r0" -SRC_URI = "http://www.complang.tuwien.ac.at/cacaojvm/download/cacao-${PV}/cacao-${PV}.tar.bz2;md5sum=a5641452c7ba173060c99ed700950b3d \ +SRC_URI = "http://www.complang.tuwien.ac.at/cacaojvm/download/cacao-${PV}/cacao-${PV}.tar.bz2;md5sum=912e353a26c88ba5f5f59ebb9f688e2f \ " # Quirks for Nokia N800: diff --git a/packages/cacao/cacaoh-native_0.99.2.bb b/packages/cacao/cacaoh-native_0.99.2.bb index 11735d4f31..594e79f7de 100644 --- a/packages/cacao/cacaoh-native_0.99.2.bb +++ b/packages/cacao/cacaoh-native_0.99.2.bb @@ -2,4 +2,4 @@ require cacaoh-native.inc PR = "r0" -SRC_URI = "http://www.complang.tuwien.ac.at/cacaojvm/download/cacao-${PV}/cacao-${PV}.tar.bz2;md5sum=a5641452c7ba173060c99ed700950b3d" +SRC_URI = "http://www.complang.tuwien.ac.at/cacaojvm/download/cacao-${PV}/cacao-${PV}.tar.bz2;md5sum=912e353a26c88ba5f5f59ebb9f688e2f" diff --git a/packages/dsplink/codec-engine_2.10.bb b/packages/dsplink/codec-engine_2.10.bb index b26a8cbc94..199df5ac62 100644 --- a/packages/dsplink/codec-engine_2.10.bb +++ b/packages/dsplink/codec-engine_2.10.bb @@ -13,11 +13,43 @@ PV = "2.10" # Look for tarball at https://www-a.ti.com/downloads/sds_support/targetcontent/CE/index.html SRC_URI = "http://install.tarball.in.source.dir/codec_engine_2_10_01.tar.gz \ -" + file://xdcpaths.mak \ + " S = "${WORKDIR}/codec_engine_2_10_01" +# Path to the dir where the TI tools are unpacked +TITOOLSDIR ?= "/OE/TI" +# Path under TITOOLSDIR where dspbios is unpacked +TIBIOSDIR ?= "bios_5_32_03" +TIXDCTOOLSDIR ?= "${TIBIOSDIR}/xdctools" +# Path under TITOOLSDIR where the dsp toolchain is unpacked +TICGTOOLSDIR ?= "cg6x_6_1_2" + PARALLEL_MAKE = "" + +do_configure() { + cp ${WORKDIR}/xdcpaths.mak ${S}/examples/ + sed -i -e s:SEDME_TITOOLS_BASEPATH:${TITOOLSDIR}:g \ + -e s:SEDME_BIOSUNPACKDIR:${TITOOLSDIR}/${TIBIOSDIR}:g \ + -e 's:SEDME_S:${S}:g' \ + -e s:SEDME_XDCTOOLSUNPACKDIR:${TITOOLSDIR}/${TIXDCTOOLSDIR}:g \ + -e s:/db/toolsrc/library/tools/vendors/mvl/arm/mvl4.0-new/montavista/pro/devkit/arm/v5t_le:${CROSS_DIR}:g \ + -e s:bin/arm_v5t_le-gcc:bin/${TARGET_PREFIX}gcc:g \ + -e s:/db/toolsrc/library/tools/vendors/ti/c6x/6.0.16/Linux:${TITOOLSDIR}/${TICGTOOLSDIR}:g \ + ${S}/examples/xdcpaths.mak + + sed -i -e s:/db/toolsrc/library/tools/vendors/mvl/arm/mvl4.0-new/montavista/pro/devkit/arm/v5t_le:${CROSS_DIR}:g \ + -e s:/db/toolsrc/library/tools/vendors/ti/c6x/6.0.16/Linux:${TITOOLSDIR}/${TICGTOOLSDIR}:g \ + ${S}/examples/user.bld + + for cfg in ${S}/examples/ti/sdo/ce/examples/apps/image_copy/package/cfg/*/*cfg ; do + sed -i -e s:arm_v5t_le-:${TAGET_PREFIX}:g $cfg + done + + echo -n "${CFLAGS} -I${TITOOLSDIR}/${TIXDCTOOLSDIR}/packages -I${S}/packages -I${S}/cetools/packages" > ${S}/examples/ti/sdo/ce/examples/apps/speech/linuxonly/app/compiler.opt +} + do_compile() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS cd ${S}/cetools/packages/ti/sdo/linuxutils/cmem @@ -46,6 +78,9 @@ do_compile() { KERNEL_VERSION=${KERNEL_VERSION} \ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ AR="${KERNEL_AR}" + +# oe_runmake -C ${S}/examples/ti/sdo/ce/examples/apps + } do_install() { diff --git a/packages/dsplink/dsplink.inc b/packages/dsplink/dsplink.inc index d9c3c07e02..9e9dff888f 100644 --- a/packages/dsplink/dsplink.inc +++ b/packages/dsplink/dsplink.inc @@ -11,6 +11,13 @@ S = "${WORKDIR}/dsplink_1_50/dsplink" # Needed for buildscripts export DSPLINK = "${S}" +# Path to the dir where the TI tools are unpacked +TITOOLSDIR ?= "/OE/TI" +# Path under TITOOLSDIR where dspbios is unpacked +TIBIOSDIR ?= "bios_5_32_03" +# Path under TITOOLSDIR where the dsp toolchain is unpacked +TICGTOOLSDIR ?= "cg6x_6_1_2" + DSPLINKPLATFORM ?= "Davinci" DSPLINKPLATFORM_omap5912osk = "OMAP" @@ -48,6 +55,8 @@ KERNELARMFLAGS_armv7a = "-c -nostdinc -include $(BASE_OSINC)/linux/autoconf.h -i -Wdeclaration-after-statement -Os -marm -mabi=aapcs-linux \ -D__KERNEL__ -mno-thumb-interwork -msoft-float -fno-optimize-sibling-calls -g -fno-stack-protector -Wno-pointer-sign -g -DUSE_UDEV=1 -DOS_LINUX -DLINUX_KERNEL" +DSPFLAGS = "-q -pdr -pdv -pden -ml3 -mv64+ " + export DSPLINKPLATFORM export DSPLINKDSP @@ -59,7 +68,7 @@ do_configure () { sed -i -e s:SED_ME_SOURCEDIR:${S}:g \ -e s:SED_ME_GPPDISTRO:openembedded:g \ -e s:SED_ME_KERNELVERSION:${KERNEL_VERSION}:g \ - -e s:SED_ME_DSPDISTRO:openembedded:g \ + -e s:SED_ME_DSPDISTRO:c64xx_5.xx_linux:g \ -e s:SED_ME_PLATFORM:${DSPLINKPLATFORM}:g \ -e s:SED_ME_DSP:${DSPLINKDSP}:g \ -e s:SED_ME_SOC:${DSPLINKSOC}:g \ @@ -73,6 +82,11 @@ do_configure () { -e 's:SEDME_USER_ARMFLAGS:${USERARMFLAGS}:g' \ ${S}/make/Linux/openembedded.mk + sed -i -e s:SEDME_TITOOLS_BASEPATH:${TITOOLSDIR}:g \ + -e s:SEDME_BIOSUNPACKDIR:${TIBIOSDIR}:g \ + -e s:SEDME_CGTOOLSDIR:${TICGTOOLSDIR}:g \ + -e 's:SEDME_DSPFLAGS:${DSPFLAGS}:g' \ + ${S}/make/DspBios/c64xx_5.xx_linux.mk } PARALLEL_MAKE = "" @@ -92,6 +106,9 @@ do_compile () { sed -i -e 's:gcc${KERNEL_CCSUFFIX}:gcc:' ${S}/make/Linux/openembedded.mk oe_runmake -C ${S}/gpp/src/samples + + oe_runmake -C ${S}/dsp/src + oe_runmake -C ${S}/dsp/src/samples } do_install () { diff --git a/packages/dsplink/dsplink_1.50.bb b/packages/dsplink/dsplink_1.50.bb index cba9bf1f97..9132389923 100644 --- a/packages/dsplink/dsplink_1.50.bb +++ b/packages/dsplink/dsplink_1.50.bb @@ -1,6 +1,6 @@ require dsplink.inc -PR = "r8" +PR = "r9" PE = "1" PV = "1.50" diff --git a/packages/dsplink/dsplink_1.51.00.08.bb b/packages/dsplink/dsplink_1.51.00.08.bb index d4a71b437e..36ac50f4cf 100644 --- a/packages/dsplink/dsplink_1.51.00.08.bb +++ b/packages/dsplink/dsplink_1.51.00.08.bb @@ -1,6 +1,6 @@ require dsplink.inc -PR = "r8" +PR = "r9" PE = "1" PV = "1.51" diff --git a/packages/dsplink/files/CURRENTCFG.MK b/packages/dsplink/files/CURRENTCFG.MK index 1f932f2b77..55959854e1 100644 --- a/packages/dsplink/files/CURRENTCFG.MK +++ b/packages/dsplink/files/CURRENTCFG.MK @@ -48,7 +48,7 @@ export DSPPLATFORM := SED_ME_PLATFORM # Target GPP and DSP devices # ========================================================= export GPPDEVICE := SED_ME_PLATFORM -export DSPDEVICE := SED_ME_DSP +export DSPDEVICE := SED_ME_DSP # ========================================================= diff --git a/packages/dsplink/files/c64xx_5.xx_linux.mk b/packages/dsplink/files/c64xx_5.xx_linux.mk index d0b27d7a55..ea806fff4e 100644 --- a/packages/dsplink/files/c64xx_5.xx_linux.mk +++ b/packages/dsplink/files/c64xx_5.xx_linux.mk @@ -35,8 +35,8 @@ USE_DISTRIBUTION := 1 # ---------------------------------------------------------------------------- # Base directory for the DSP OS # ---------------------------------------------------------------------------- -BASE_INSTALL := /opt/ti-tools -BASE_SABIOS := $(BASE_INSTALL)/bios +BASE_INSTALL := SEDME_TITOOLS_BASEPATH +BASE_SABIOS := $(BASE_INSTALL)/SEDME_BIOSUNPACKDIR BASE_BUILDOS := $(BASE_SABIOS)/packages/ti/bios # ---------------------------------------------------------------------------- @@ -47,7 +47,7 @@ XDCTOOLS_DIR := $(BASE_SABIOS)/xdctools # ---------------------------------------------------------------------------- # Base for code generation tools - compiler, linker, archiver etc. # ---------------------------------------------------------------------------- -BASE_CGTOOLS := $(BASE_INSTALL)/c6000/cgtools +BASE_CGTOOLS := $(BASE_INSTALL)/SEDME_CGTOOLSDIR BASE_CGTOOLSBIN := $(BASE_CGTOOLS)/bin # ---------------------------------------------------------------------------- @@ -135,7 +135,7 @@ CC_SW_REL := -o3 # ---------------------------------------------------------------------------- # Standard flags for the compiler # ---------------------------------------------------------------------------- -STD_CC_FLAGS := -q -pdr -pdv -pden -ml3 -mv6400 -d"CHIP_DM642" +STD_CC_FLAGS := SEDME_DSPFLAGS -d"CHIP_DM642" # ---------------------------------------------------------------------------- # Standard flags for the compiler when building an executable diff --git a/packages/dsplink/files/xdcpaths.mak b/packages/dsplink/files/xdcpaths.mak new file mode 100644 index 0000000000..3df3bf6305 --- /dev/null +++ b/packages/dsplink/files/xdcpaths.mak @@ -0,0 +1,232 @@ +# +# ======== xdcpaths.mak ======== +# definition of XDC paths and commands +# +# This makefile constructs the "search path" for the XDC tools where it finds +# numerous components and packages needed to build Codec Engine examples and +# programs. +# +# USER NOTE: +# 1) you must specify various <component>_INSTALL_DIRs directores below to +# reflect your installation, where <component> is CE for Codec Engine, +# BIOS for DSP/BIOS, etc. +# 2) you must specify compiler path and name in CGTOOLS_* variables below +# 3) you can remove some of the devices from the "DEVICES" list and/or remove +# some of the types of binaries from the "PROGRAMS" list to reduce +# the build time (and possibly avoid checking for presence of a component +# you don't need) + + + +# (Optional) Remove from this list the devices you're not interested in building +DEVICES := DM6446 DM355 DM6437 DM648 DM6467 + +# (Optional) Remove from the list the types of programs you're not intersted in +# building: +# APP_CLIENT -- Arm client for codecs running on the DSP, on dual-CPU systems +# DSP_SERVER -- DSP server with the codecs, running on the DSP, on dual-CPUs +# APP_LOCAL -- Client+codecs in a single program, whether Arm only or DSP only +PROGRAMS := APP_CLIENT DSP_SERVER APP_LOCAL + + +# (Mandatory) Specify where various components are installed. +# What you need depends on what device(s) you're building for, what type(s) of +# programs you are building for, and whether your Codec Engine distribution +# is a "big" one that contains all the minor components in its "cetools" +# directory. The legend: +# CE - Codec Engine (needed for Arm and for DSP) +# XDC - XDC tools (Arm and DSP) +# BIOS - DSP/BIOS (DSP only) +# XDAIS - XDAIS header files (Arm and DSP) +# FC - Framework components, various resource managers (ARM and DSP) +# CMEM - Continuous memory manager (Arm only) +# DSPLINK - Arm<->DSP communication software (Arm + DSP) +# +# you can omit directory specifications for the components you think you don't +# need (will be warned if you do, based on your DEVICES + PROGRAMS selection +# above). + +CE_INSTALL_DIR := SEDME_S +XDC_INSTALL_DIR := SEDME_XDCTOOLSUNPACKDIR +BIOS_INSTALL_DIR := SEDME_BIOSUNPACKDIR + +# no need to specify the installation directories below if your CE installation +# has cetools/ directory on top +USE_CETOOLS_IF_EXISTS := 1 +XDAIS_INSTALL_DIR := _your_xDAIS_installation_directory/xdais_6_10_01 +DSPLINK_INSTALL_DIR := _your_DSPLink_installation_directory/dsplink-davinci-v1.50-prebuilt +CMEM_INSTALL_DIR := _your_CMEM_installation_directory/cmem_2_10 +FC_INSTALL_DIR := _your_FC_installation_directory/framework_components_2_10_01 +BIOSUTILS_INSTALL_DIR := _your_BIOSUTILS_installation_directory/biosutils + + +# (Mandatory) specify correct compiler paths and names for the architectures +# you'll be building for: + +# compiler path and name for Montavista Arm 9 toolchain. NOTE: make sure the +# directory you specify has a "bin" subdirectory +CGTOOLS_MVARM9 = /db/toolsrc/library/tools/vendors/mvl/arm/mvl4.0-new/montavista/pro/devkit/arm/v5t_le +CC_MVARM9 = bin/arm_v5t_le-gcc + +# compiler path and name for TI C64x toolchain. NOTE: make sure the +# directory you specify has a "bin" subdirectory +CGTOOLS_C64P = /db/toolsrc/library/tools/vendors/ti/c6x/6.0.16/Linux +CC_C64P = bin/cl6x + +# ----------------------------------------------------------------------------- + +# figure out what categories of devices we are to build for +ifneq (,$(findstring DM6446,$(DEVICES))) + DEVICES_DAVINCI := 1 +endif +ifneq (,$(findstring DM6467,$(DEVICES))) + DEVICES_DAVINCI := 1 +endif +ifneq (,$(findstring DM355,$(DEVICES))) + DEVICES_ARMONLY := 1 +endif +ifneq (,$(findstring DM6437,$(DEVICES))) + DEVICES_DSPONLY := 1 +endif +ifneq (,$(findstring DM648,$(DEVICES))) + DEVICES_DSPONLY := 1 +endif + +# determine which components are necessary based on DEVICES and PROGRAMS +REQUIRE_CE := 1 +REQUIRE_XDC := 1 +REQUIRE_XDAIS := 1 +REQUIRE_FC := 1 + +ifneq (,$(findstring DM6446,$(DEVICES))) + ifneq (, $(findstring APP_CLIENT, $(PROGRAMS) )) + REQUIRE_LINK := 1 + REQUIRE_CMEM := 1 + endif + ifneq (, $(findstring DSP_SERVER, $(PROGRAMS) )) + REQUIRE_LINK := 1 + REQUIRE_BIOS := 1 + endif +endif + +ifneq (,$(findstring DM6467,$(DEVICES))) + ifneq (, $(findstring APP_CLIENT, $(PROGRAMS) )) + REQUIRE_LINK := 1 + REQUIRE_CMEM := 1 + endif + ifneq (, $(findstring DSP_SERVER, $(PROGRAMS) )) + REQUIRE_LINK := 1 + REQUIRE_BIOS := 1 + endif +endif + +ifneq (,$(findstring DM355,$(DEVICES))) + ifneq (, $(findstring APP_LOCAL, $(PROGRAMS) )) + REQUIRE_CMEM := 1 + endif +endif + +ifneq (,$(findstring DM6437,$(DEVICES))) + ifneq (, $(findstring APP_LOCAL, $(PROGRAMS) )) + REQUIRE_BIOS := 1 + endif +endif + +ifneq (,$(findstring DM648,$(DEVICES))) + ifneq (, $(findstring APP_LOCAL, $(PROGRAMS) )) + REQUIRE_BIOS := 1 + endif +endif + + +# Build the XDC path from the necessary components, verifying along the way +# that the required compoments are present +XDC_PATH := + +ERRMSG = which is invalid (could not find file "$(TEST_FILE)"). Set this in <codec engine examples>/xdcpaths.mak! See the build documentation to correct this error. + +# CE_INSTALL_DIR is the location of your Codec Engine. +ifeq ($(REQUIRE_CE), 1) + TEST_FILE := $(CE_INSTALL_DIR)/packages/ti/sdo/ce/package.xdc + ifeq ($(wildcard $(TEST_FILE)),) + $(error CE_INSTALL_DIR is set to "$(CE_INSTALL_DIR)", $(ERRMSG)) + endif + XDC_PATH := $(CE_INSTALL_DIR)/packages +endif + +# Add cetools to XDCPATH if 1) $(USE_CETOOLS_IF_EXISTS) is set, and +# 2) the CE distribution has "cetools/" +USING_CETOOLS := 0 +ifeq ($(USE_CETOOLS_IF_EXISTS), 1) + ifneq ($(wildcard $(CE_INSTALL_DIR)/cetools),) + USING_CETOOLS := 1 + XDC_PATH := $(CE_INSTALL_DIR)/cetools/packages;$(XDC_PATH) + endif +endif +ifeq ($(USING_CETOOLS),0) + # XDAIS_INSTALL_DIR is the location of your XDAIS distribution + ifeq ($(REQUIRE_XDAIS), 1) + TEST_FILE := $(XDAIS_INSTALL_DIR)/packages/ti/xdais/package.xdc + ifeq ($(wildcard $(TEST_FILE)),) + $(error XDAIS_INSTALL_DIR is set to "$(XDAIS_INSTALL_DIR)", $(ERRMSG)) + endif + XDC_PATH := $(XDC_PATH);$(XDAIS_INSTALL_DIR)/packages + endif + + # DSPLINK_INSTALL_DIR is the location of your DSPLINK distribution + ifeq ($(REQUIRE_LINK), 1) + TEST_FILE := $(DSPLINK_INSTALL_DIR)/packages/dsplink/gpp/package.xdc + ifeq ($(wildcard $(TEST_FILE)),) + $(error DSPLINK_INSTALL_DIR is set to "$(DSPLINK_INSTALL_DIR)", $(ERRMSG)) + endif + XDC_PATH := $(XDC_PATH);$(DSPLINK_INSTALL_DIR)/packages + endif + + # CMEM_INSTALL_DIR is the location of your CMEM distribution + ifeq ($(REQUIRE_CMEM), 1) + TEST_FILE := $(CMEM_INSTALL_DIR)/packages/ti/sdo/linuxutils/cmem/package.xdc + ifeq ($(wildcard $(TEST_FILE)),) + $(error CMEM_INSTALL_DIR is set to "$(CMEM_INSTALL_DIR)", $(ERRMSG)) + endif + XDC_PATH := $(XDC_PATH);$(CMEM_INSTALL_DIR)/packages + endif + + # FC_INSTALL_DIR is the location of your Frameworks Components distribution + ifeq ($(REQUIRE_FC), 1) + TEST_FILE := $(FC_INSTALL_DIR)/packages/ti/sdo/fc/dskt2/package.xdc + ifeq ($(wildcard $(TEST_FILE)),) + $(error FC_INSTALL_DIR is set to "$(FC_INSTALL_DIR)", $(ERRMSG)) + endif + XDC_PATH := $(XDC_PATH);$(FC_INSTALL_DIR)/packages + endif + + # BIOSUTILS_INSTALL_DIR is the location of your BIOSUTILS distribution + ifeq ($(REQUIRE_BIOS), 1) + TEST_FILE := $(BIOSUTILS_INSTALL_DIR)/packages/ti/bios/utils/package.xdc + ifeq ($(wildcard $(TEST_FILE)),) + $(error BIOSUTILS_INSTALL_DIR is set to "$(BIOSUTILS_INSTALL_DIR)", $(ERRMSG)) + endif + XDC_PATH := $(XDC_PATH);$(BIOSUTILS_INSTALL_DIR)/packages + endif + +endif + +# BIOS_INSTALL_DIR is the location of your BIOS distribution +ifeq ($(REQUIRE_BIOS), 1) + TEST_FILE := $(BIOS_INSTALL_DIR)/packages/ti/bios/package.xdc + ifeq ($(wildcard $(TEST_FILE)),) + $(error BIOS_INSTALL_DIR is set to "$(BIOS_INSTALL_DIR)", $(ERRMSG)) + endif + XDC_PATH := $(XDC_PATH);$(BIOS_INSTALL_DIR)/packages +endif + +# XDC_INSTALL_DIR is the location of your XDCTOOLS installation. +ifeq ($(REQUIRE_XDC), 1) + TEST_FILE := $(XDC_INSTALL_DIR)/packages/xdc/package.xdc + ifeq ($(wildcard $(TEST_FILE)),) + $(error XDC_INSTALL_DIR is set to "$(XDC_INSTALL_DIR)", $(ERRMSG)) + endif +endif + +# XDC_PATH is complete. Any other components you could add as +# XDC_PATH := <your component>/packages;$(XDC_PATH) diff --git a/packages/freesmartphone/python-odeviced/om-gta02/.mtn2git_empty b/packages/fluidsynth/.mtn2git_empty index e69de29bb2..e69de29bb2 100644 --- a/packages/freesmartphone/python-odeviced/om-gta02/.mtn2git_empty +++ b/packages/fluidsynth/.mtn2git_empty diff --git a/packages/fluidsynth/fluidsynth_1.0.8.bb b/packages/fluidsynth/fluidsynth_1.0.8.bb new file mode 100644 index 0000000000..075140c92f --- /dev/null +++ b/packages/fluidsynth/fluidsynth_1.0.8.bb @@ -0,0 +1,14 @@ +DESCRIPTION = "Fluidsynth is a software synthesizer" +HOMEPAGE = "http://www.fluidsynth.org/" +SECTION = "libs/multimedia" +LICENSE = "GPLv2" +DEPENDS = "alsa-lib ncurses" + +SRC_URI = "http://savannah.nongnu.org/download/fluid/${P}.tar.gz" + +inherit autotools pkgconfig lib_package + +do_stage() { + autotools_stage_all +} + diff --git a/packages/freesmartphone/python-odeviced/odeviced b/packages/freesmartphone/python-odeviced/odeviced deleted file mode 100644 index 52d3a1d196..0000000000 --- a/packages/freesmartphone/python-odeviced/odeviced +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# -# odeviced This shell script starts and stops the open device daemon. -# -# chkconfig: 345 90 20 -# description: py-odeviced is the open device daemon -# processname: python - -PATH=/bin:/usr/bin:/sbin:/usr/sbin -NAME=odeviced - -[ -f /etc/default/rcS ] && . /etc/default/rcS - -case "$1" in - start) - echo -n "Starting open device daemon: " - start-stop-daemon --start --pidfile /var/run/${NAME}.pid --make-pidfile --background -x /usr/bin/odeviced - if [ $? = 0 ]; then - echo "(ok)" - else - echo "(failed)" - fi - ;; - stop) - echo -n "Stopping open device daemon: " - start-stop-daemon --stop --pidfile /var/run/${NAME}.pid --oknodo - rm -f /var/run/${NAME}.pid - echo "(done)" - ;; - restart|force-reload) - $0 stop - $0 start - ;; - *) - echo "Usage: /etc/init.d/odeviced {start|stop|restart|force-reload}" - exit 1 - ;; -esac - -exit 0 diff --git a/packages/freesmartphone/python-odeviced/odeviced.conf b/packages/freesmartphone/python-odeviced/odeviced.conf deleted file mode 100644 index e69de29bb2..0000000000 --- a/packages/freesmartphone/python-odeviced/odeviced.conf +++ /dev/null diff --git a/packages/freesmartphone/python-odeviced/om-gta02/odeviced.conf b/packages/freesmartphone/python-odeviced/om-gta02/odeviced.conf deleted file mode 100644 index 0076639f98..0000000000 --- a/packages/freesmartphone/python-odeviced/om-gta02/odeviced.conf +++ /dev/null @@ -1,8 +0,0 @@ -[idlenotifier] -# don't read from accellerometers for now -ignoreinput=2,3 - -[input] -# don't read from accellerometers for now -ignoreinput=2,3 - diff --git a/packages/freesmartphone/python-odeviced_git.bb b/packages/freesmartphone/python-odeviced_git.bb deleted file mode 100644 index 121a434585..0000000000 --- a/packages/freesmartphone/python-odeviced_git.bb +++ /dev/null @@ -1,35 +0,0 @@ -DESCRIPTION = "The Open Device Daemon Prototype in Python" -HOMEPAGE = "http://www.freesmartphone.org/mediawiki/index.php/Implementations/OpenDeviceDaemon" -AUTHOR = "Michael 'Mickey' Lauer <mlauer@vanille-media.de>" -SECTION = "console/network" -DEPENDS = "python-cython-native python-pyrex-native" -LICENSE = "GPLv2" -PV = "0.7.9+gitr${SRCREV}" -PR = "r2" - -inherit distutils update-rc.d - -INITSCRIPT_NAME = "odeviced" -INITSCRIPT_PARAMS = "defaults 21" - -SRC_URI = "${FREESMARTPHONE_GIT}/python-odeviced.git;protocol=git;branch=master \ - file://odeviced \ - file://odeviced.conf" -S = "${WORKDIR}/git" - -do_install_append() { - install -d ${D}${sysconfdir}/init.d/ - install -m 0755 ${WORKDIR}/odeviced ${D}${sysconfdir}/init.d/ - install -m 0644 ${WORKDIR}/odeviced.conf ${D}${sysconfdir} - install -d ${D}${sysconfdir}/dbus-1/system.d/ - mv -f ${D}${datadir}/etc/dbus-1/system.d/odeviced.conf ${D}${sysconfdir}/dbus-1/system.d/ -} - -RDEPENDS_${PN} += "\ - python-dbus \ - python-pygobject \ - python-pyrtc \ - python-syslog \ -" - -FILES_${PN} += "${sysconfdir}" diff --git a/packages/freesmartphone/python-oeventd/oeventd b/packages/freesmartphone/python-oeventd/oeventd deleted file mode 100644 index 8ed467b079..0000000000 --- a/packages/freesmartphone/python-oeventd/oeventd +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# -# odeviced This shell script starts and stops the open event daemon. -# -# chkconfig: 345 90 20 -# description: py-oeventd is the open evend daemon -# processname: python - -PATH=/bin:/usr/bin:/sbin:/usr/sbin -NAME=oeventd - -[ -f /etc/default/rcS ] && . /etc/default/rcS - -case "$1" in - start) - echo -n "Starting open event daemon: " - start-stop-daemon --start --pidfile /var/run/${NAME}.pid --make-pidfile --background -x /usr/bin/oeventd - if [ $? = 0 ]; then - echo "(ok)" - else - echo "(failed)" - fi - ;; - stop) - echo -n "Stopping open event daemon: " - start-stop-daemon --stop --pidfile /var/run/${NAME}.pid --oknodo - rm -f /var/run/${NAME}.pid - echo "(done)" - ;; - restart|force-reload) - $0 stop - $0 start - ;; - *) - echo "Usage: /etc/init.d/oeventd {start|stop|restart|force-reload}" - exit 1 - ;; -esac - -exit 0 diff --git a/packages/freesmartphone/python-oeventd_git.bb b/packages/freesmartphone/python-oeventd_git.bb deleted file mode 100644 index c08e1af3b7..0000000000 --- a/packages/freesmartphone/python-oeventd_git.bb +++ /dev/null @@ -1,34 +0,0 @@ -DESCRIPTION = "The Open Event Daemon Prototype in Python" -HOMEPAGE = "http://www.freesmartphone.org/mediawiki/index.php/Implementations/OpenEventDaemon" -AUTHOR = "Michael 'Mickey' Lauer <mlauer@vanille-media.de>" -SECTION = "console/network" -DEPENDS = "python-cython-native python-pyrex-native" -LICENSE = "GPLv2" -PV = "0.0.0+gitr${SRCREV}" -PR = "r1" - -inherit distutils update-rc.d - -INITSCRIPT_NAME = "oeventd" -INITSCRIPT_PARAMS = "defaults 21" - -SRC_URI = "\ - ${FREESMARTPHONE_GIT}/eventd.git;protocol=git;branch=master \ - file://oeventd \ -" -S = "${WORKDIR}/git" - -do_install_append() { - install -d ${D}${sysconfdir}/init.d/ - install -m 0755 ${WORKDIR}/oeventd ${D}${sysconfdir}/init.d/ - install -d ${D}${sysconfdir}/dbus-1/system.d/ - mv -f ${D}${datadir}/etc/dbus-1/system.d/oeventd.conf ${D}${sysconfdir}/dbus-1/system.d/ -} - -RDEPENDS_${PN} += "\ - python-dbus \ - python-pygobject \ - python-syslog \ -" - -FILES_${PN} += "${sysconfdir}" diff --git a/packages/freesmartphone/python-ophoned/ophoned b/packages/freesmartphone/python-ophoned/ophoned deleted file mode 100644 index edc800711a..0000000000 --- a/packages/freesmartphone/python-ophoned/ophoned +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# -# ophoned This shell script starts and stops the open phone daemon. -# -# chkconfig: 345 90 20 -# description: py-ophoned is the open phone daemon -# processname: python - -PATH=/bin:/usr/bin:/sbin:/usr/sbin -NAME=ophoned - -[ -f /etc/default/rcS ] && . /etc/default/rcS - -case "$1" in - start) - echo -n "Starting open phone daemon: " - start-stop-daemon --start --pidfile /var/run/${NAME}.pid --make-pidfile --background -x /usr/bin/ophoned - if [ $? = 0 ]; then - echo "(ok)" - else - echo "(failed)" - fi - ;; - stop) - echo -n "Stopping open phone daemon: " - start-stop-daemon --stop --pidfile /var/run/${NAME}.pid --oknodo - rm -f /var/run/${NAME}.pid - echo "(done)" - ;; - restart|force-reload) - $0 stop - $0 start - ;; - *) - echo "Usage: /etc/init.d/ophoned {start|stop|restart|force-reload}" - exit 1 - ;; -esac - -exit 0 diff --git a/packages/freesmartphone/python-ophoned_git.bb b/packages/freesmartphone/python-ophoned_git.bb deleted file mode 100644 index 7f30f4c24a..0000000000 --- a/packages/freesmartphone/python-ophoned_git.bb +++ /dev/null @@ -1,35 +0,0 @@ -DESCRIPTION = "The Open Phone Daemon (Python Implementation)" -HOMEPAGE = "http://www.freesmartphone.org/mediawiki/index.php/Implementations/OpenPhoneServer" -AUTHOR = "Michael 'Mickey' Lauer <mlauer@vanille-media.de>" -SECTION = "console/network" -DEPENDS = "python-cython-native python-pyrex-native" -LICENSE = "GPLv2" -PV = "0.0.0+gitr${SRCREV}" -PR = "r1" - -inherit distutils update-rc.d - -INITSCRIPT_NAME = "ophoned" -INITSCRIPT_PARAMS = "defaults 21" - -SRC_URI = "${FREESMARTPHONE_GIT}/python-ophoned.git;protocol=git;branch=master \ - file://ophoned" -S = "${WORKDIR}/git" - -do_install_append() { - install -d ${D}${sysconfdir}/init.d/ - install -m 0755 ${WORKDIR}/ophoned ${D}${sysconfdir}/init.d/ -# install -m 0644 ${WORKDIR}/ophoned.conf ${D}${sysconfdir} - install -d ${D}${sysconfdir}/dbus-1/system.d/ - mv -f ${D}${datadir}/etc/dbus-1/system.d/ophoned.conf ${D}${sysconfdir}/dbus-1/system.d/ -} - -RDEPENDS_${PN} += "\ - python-dbus \ - python-pygobject \ - python-pyrtc \ - python-pyserial \ - python-syslog \ -" - -FILES_${PN} += "${sysconfdir}" diff --git a/packages/freesmartphone/python-ousaged/ousaged b/packages/freesmartphone/python-ousaged/ousaged deleted file mode 100644 index 7b62d7f93c..0000000000 --- a/packages/freesmartphone/python-ousaged/ousaged +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# -# odeviced This shell script starts and stops the open device daemon. -# -# chkconfig: 345 90 20 -# description: py-ousaged is the open usage daemon -# processname: python - -PATH=/bin:/usr/bin:/sbin:/usr/sbin -NAME=odeviced - -[ -f /etc/default/rcS ] && . /etc/default/rcS - -case "$1" in - start) - echo -n "Starting open usage daemon: " - start-stop-daemon --start --pidfile /var/run/${NAME}.pid --make-pidfile --background -x /usr/bin/ousaged - if [ $? = 0 ]; then - echo "(ok)" - else - echo "(failed)" - fi - ;; - stop) - echo -n "Stopping open usage daemon: " - start-stop-daemon --stop --pidfile /var/run/${NAME}.pid --oknodo - rm -f /var/run/${NAME}.pid - echo "(done)" - ;; - restart|force-reload) - $0 stop - $0 start - ;; - *) - echo "Usage: /etc/init.d/ousaged {start|stop|restart|force-reload}" - exit 1 - ;; -esac - -exit 0 diff --git a/packages/freesmartphone/python-ousaged_git.bb b/packages/freesmartphone/python-ousaged_git.bb deleted file mode 100644 index 1188da34a3..0000000000 --- a/packages/freesmartphone/python-ousaged_git.bb +++ /dev/null @@ -1,36 +0,0 @@ -DESCRIPTION = "The Open Usage Daemon Prototype in Python" -HOMEPAGE = "http://www.freesmartphone.org/mediawiki/index.php/Implementations/OpenUsageDaemon" -AUTHOR = "Michael 'Mickey' Lauer <mlauer@vanille-media.de>" -SECTION = "console/network" -DEPENDS = "python-cython-native python-pyrex-native" -LICENSE = "GPLv2" -PV = "0.7.9+gitr${SRCREV}" -PR = "r1" - -inherit distutils update-rc.d - -INITSCRIPT_NAME = "ousaged" -INITSCRIPT_PARAMS = "defaults 21" - -SRC_URI = "\ - ${FREESMARTPHONE_GIT}/usaged.git;protocol=git;branch=master \ - file://ousaged \ -" -S = "${WORKDIR}/git" - -do_install_append() { - install -d ${D}${sysconfdir}/init.d/ - install -m 0755 ${WORKDIR}/ousaged ${D}${sysconfdir}/init.d/ - install -d ${D}${sysconfdir}/dbus-1/system.d/ - mv -f ${D}${datadir}/etc/dbus-1/system.d/ousaged.conf ${D}${sysconfdir}/dbus-1/system.d/ -} - -RDEPENDS_${PN} += "\ - python-dbus \ - python-pygobject \ - python-pyrtc \ - python-syslog \ - python-odeviced \ -" - -FILES_${PN} += "${sysconfdir}" diff --git a/packages/images/fso-console-image.bb b/packages/images/fso-console-image.bb index 3de1e51da9..2c168b7e19 100644 --- a/packages/images/fso-console-image.bb +++ b/packages/images/fso-console-image.bb @@ -9,4 +9,5 @@ IMAGE_INSTALL = "\ ${AUDIO_INSTALL} \ ${TOOLS_INSTALL} \ ${PYTHON_INSTALL} \ + frameworkd \ " diff --git a/packages/images/fso-image-console.bb b/packages/images/fso-image-console.bb new file mode 100644 index 0000000000..8e0e360f9c --- /dev/null +++ b/packages/images/fso-image-console.bb @@ -0,0 +1,13 @@ +#------------------------------------------------------ +# freesmartphone.org Console Image Recipe +#------------------------------------------------------ + +require fso-image.bb + +IMAGE_INSTALL = "\ + ${BASE_INSTALL} \ + ${AUDIO_INSTALL} \ + ${TOOLS_INSTALL} \ + ${PYTHON_INSTALL} \ +" + diff --git a/packages/images/fso-image-light.bb b/packages/images/fso-image-light.bb index 921c636b12..a3bf1f7eb5 100644 --- a/packages/images/fso-image-light.bb +++ b/packages/images/fso-image-light.bb @@ -12,21 +12,3 @@ IMAGE_INSTALL = "\ ${PYTHON_INSTALL} \ ${ZHONE_INSTALL} \ " - -inherit image - -# perform some convenience tweaks to the rootfs -mickey_rootfs_postprocess() { - curdir=$PWD - cd ${IMAGE_ROOTFS} - date "+%m%d%H%M%Y" >./etc/timestamp - echo "alias pico=nano" >>./etc/profile - echo "alias fso='cd /local/pkg/fso'" >>./etc/profile - mkdir -p ./local/pkg - echo >>./etc/fstab - echo "# NFS Host" >>./etc/fstab - echo "192.168.0.200:/local/pkg /local/pkg nfs noauto,nolock,soft,rsize=32768,wsize=32768 0 0" >>./etc/fstab - cd $curdir -} - -ROOTFS_POSTPROCESS_COMMAND += "mickey_rootfs_postprocess" diff --git a/packages/images/fso-image.bb b/packages/images/fso-image.bb index 33f83d89a0..5d6b21647e 100644 --- a/packages/images/fso-image.bb +++ b/packages/images/fso-image.bb @@ -41,9 +41,11 @@ X_INSTALL = "\ TOOLS_INSTALL = "\ # bash \ htop \ + iptables \ lsof \ mickeydbus \ mickeyterm \ + mtd-utils \ nano \ powertop \ s3c24xx-gpio \ @@ -96,7 +98,7 @@ IMAGE_INSTALL = "\ inherit image # perform some convenience tweaks to the rootfs -mickey_rootfs_postprocess() { +fso_rootfs_postprocess() { curdir=$PWD cd ${IMAGE_ROOTFS} date "+%m%d%H%M%Y" >./etc/timestamp @@ -110,4 +112,4 @@ mickey_rootfs_postprocess() { cd $curdir } -ROOTFS_POSTPROCESS_COMMAND += "mickey_rootfs_postprocess" +ROOTFS_POSTPROCESS_COMMAND += "fso_rootfs_postprocess" diff --git a/packages/linux/linux-omap2-git/beagleboard/i2c-omap-race-fix.diff b/packages/linux/linux-omap2-git/beagleboard/i2c-omap-race-fix.diff new file mode 100644 index 0000000000..6eb33f76b7 --- /dev/null +++ b/packages/linux/linux-omap2-git/beagleboard/i2c-omap-race-fix.diff @@ -0,0 +1,118 @@ +From linux-omap-owner@vger.kernel.org Tue Jul 15 21:23:13 2008 +Received: from localhost + ([127.0.0.1] helo=dominion ident=koen) + by dominion.dominion.void with esmtp (Exim 4.69) + (envelope-from <linux-omap-owner@vger.kernel.org>) + id 1KIq7E-0004FX-VS + for koen@localhost; Tue, 15 Jul 2008 21:23:13 +0200 +Received: from xs.service.utwente.nl [130.89.5.250] + by dominion with POP3 (fetchmail-6.3.6) + for <koen@localhost> (single-drop); Tue, 15 Jul 2008 21:23:12 +0200 (CEST) +Received: from mail.service.utwente.nl ([130.89.5.254]) by exchange.service.utwente.nl with Microsoft SMTPSVC(6.0.3790.3959); + Tue, 15 Jul 2008 21:01:02 +0200 +Received: from mx.utwente.nl ([130.89.2.12]) by mail.service.utwente.nl with Microsoft SMTPSVC(6.0.3790.3959); + Tue, 15 Jul 2008 21:01:01 +0200 +Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) + by mx.utwente.nl (8.12.10/SuSE Linux 0.7) with ESMTP id m6FJ0qDf031889 + for <k.kooi@student.utwente.nl>; Tue, 15 Jul 2008 21:00:52 +0200 +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1756776AbYGOTAV (ORCPT <rfc822;k.kooi@student.utwente.nl>); + Tue, 15 Jul 2008 15:00:21 -0400 +Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755065AbYGOTAV + (ORCPT <rfc822;linux-omap-outgoing>); + Tue, 15 Jul 2008 15:00:21 -0400 +Received: from utopia.booyaka.com ([72.9.107.138]:35569 "EHLO + utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1756776AbYGOTAU (ORCPT + <rfc822;linux-omap@vger.kernel.org>); Tue, 15 Jul 2008 15:00:20 -0400 +Received: (qmail 2982 invoked by uid 526); 15 Jul 2008 19:00:18 -0000 +Date: Tue, 15 Jul 2008 13:00:18 -0600 (MDT) +From: Paul Walmsley <paul@pwsan.com> +To: linux-omap@vger.kernel.org +Subject: [PATCH] i2c-omap: close suspected race between omap_i2c_idle() and + omap_i2c_isr() +Message-ID: <alpine.DEB.1.00.0807151259180.467@utopia.booyaka.com> +User-Agent: Alpine 1.00 (DEB 882 2007-12-20) +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +Sender: linux-omap-owner@vger.kernel.org +Precedence: bulk +List-ID: <linux-omap.vger.kernel.org> +X-Mailing-List: linux-omap@vger.kernel.org +X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact servicedesk@icts.utwente.nl for more information. +X-UTwente-MailScanner: Found to be clean +X-UTwente-MailScanner-From: linux-omap-owner@vger.kernel.org +X-Spam-Status: No +X-OriginalArrivalTime: 15 Jul 2008 19:01:01.0610 (UTC) FILETIME=[1FBA68A0:01C8E6AD] + + +omap_i2c_idle() sets an internal flag, "dev->idle", instructing its +ISR to decline interrupts. It sets this flag before it actually masks +the interrupts on the I2C controller. This is problematic, since an +I2C interrupt could arrive after dev->idle is set, but before the +interrupt source is masked. When this happens, Linux disables the I2C +controller's IRQ, causing all future transactions on the bus to fail. + +Symptoms, happening on about 7% of boots: + + irq 56: nobody cared (try booting with the "irqpoll" option) + <warning traceback here> + Disabling IRQ #56 + i2c_omap i2c_omap.1: controller timed out + +In omap_i2c_idle(), this patch sets dev->idle only after the interrupt +mask write to the I2C controller has left the ARM write buffer. +That's probably the major offender. For additional prophylaxis, in +omap_i2c_unidle(), the patch clears the dev->idle flag before +interrupts are enabled, rather than afterwards. + +The patch has survived twenty-two reboots on the 3430SDP here without +wedging I2C1. Not absolutely dispositive, but promising! + + +Signed-off-by: Paul Walmsley <paul@pwsan.com> +--- + + drivers/i2c/busses/i2c-omap.c | 10 ++++++++-- + 1 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c +index 55779f5..ed7e9ad 100644 +--- a/drivers/i2c/busses/i2c-omap.c ++++ b/drivers/i2c/busses/i2c-omap.c +@@ -209,22 +209,28 @@ static void omap_i2c_unidle(struct omap_i2c_dev *dev) + if (dev->iclk != NULL) + clk_enable(dev->iclk); + clk_enable(dev->fclk); ++ dev->idle = 0; + if (dev->iestate) + omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate); +- dev->idle = 0; + } + + static void omap_i2c_idle(struct omap_i2c_dev *dev) + { + u16 iv; + +- dev->idle = 1; + dev->iestate = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG); + omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, 0); + if (dev->rev1) + iv = omap_i2c_read_reg(dev, OMAP_I2C_IV_REG); + else + omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, dev->iestate); ++ /* ++ * The wmb() is to ensure that the I2C interrupt mask write ++ * reaches the I2C controller before the dev->idle store ++ * occurs. ++ */ ++ wmb(); ++ dev->idle = 1; + clk_disable(dev->fclk); + if (dev->iclk != NULL) + clk_disable(dev->iclk); +-- +To unsubscribe from this list: send the line "unsubscribe linux-omap" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + diff --git a/packages/linux/linux-omap2_git.bb b/packages/linux/linux-omap2_git.bb index 53bcd297d9..cf16b6a2f6 100644 --- a/packages/linux/linux-omap2_git.bb +++ b/packages/linux/linux-omap2_git.bb @@ -2,10 +2,11 @@ require linux-omap.inc FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/linux-omap2-git/${MACHINE}" -SRCREV = "7786cd7a00ae0b18923185789380a88052f4eee7" +SRCREV = "d3b3ae0fe6c71641da19c8de466ec366d39847e3" -PV = "2.6.25+2.6.26-rc9+${PR}+git${SRCREV}" -PR = "r44" +PV = "2.6.26" +#PV = "2.6.25+2.6.26-rc9+${PR}+git${SRCREV}" +PR = "r45" SRC_URI = "git://source.mvista.com/git/linux-omap-2.6.git;protocol=git \ file://defconfig" @@ -30,6 +31,7 @@ SRC_URI_append_beagleboard = " file://no-harry-potter.diff;patch=1 \ file://07-set-burst-size.diff;patch=1 \ file://cache-display-fix.patch;patch=1 \ file://serialfix.diff;patch=1 \ + file://i2c-omap-race-fix.diff;patch=1 \ " SRC_URI_append_omap3evm = " file://no-harry-potter.diff;patch=1 \ diff --git a/packages/linux/linux-openmoko/0001-squashfs-with-lzma.patch b/packages/linux/linux-openmoko/0001-squashfs-with-lzma.patch new file mode 100644 index 0000000000..04d47fe16f --- /dev/null +++ b/packages/linux/linux-openmoko/0001-squashfs-with-lzma.patch @@ -0,0 +1,5342 @@ + +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 <stddef.h> */
++
++#ifndef _7ZIP_SIZET_DEFINED
++#define _7ZIP_SIZET_DEFINED
++#ifdef _LZMA_NO_SYSTEM_SIZE_T
++typedef UInt32 SizeT;
++#else
++#include <stddef.h>
++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 <phillip@lougher.demon.co.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 <linux/sched.h> ++#include <linux/exportfs.h> ++ ++#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_fops; ++ i->i_mode |= S_IFREG; ++ i->i_blocks = ((i->i_size - 1) >> 9) + 1; ++ SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk; ++ SQUASHFS_I(i)->u.s1.fragment_size = frag_size; ++ SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->u.s1.block_list_start = next_block; ++ SQUASHFS_I(i)->offset = next_offset; ++ i->i_data.a_ops = &squashfs_aops; ++ ++ TRACE("File inode %x:%x, start_block %llx, " ++ "block_list_start %llx, offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ inodep->start_block, next_block, ++ next_offset); ++ break; ++ } ++ case SQUASHFS_LREG_TYPE: { ++ unsigned int frag_size; ++ long long frag_blk; ++ struct squashfs_lreg_inode_header *inodep = &id.lreg; ++ struct squashfs_lreg_inode_header *sinodep = &sid.lreg; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_LREG_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 = inodep->nlink; ++ i->i_size = inodep->file_size; ++ i->i_fop = &generic_ro_fops; ++ i->i_mode |= S_IFREG; ++ i->i_blocks = ((i->i_size - 1) >> 9) + 1; ++ SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk; ++ SQUASHFS_I(i)->u.s1.fragment_size = frag_size; ++ SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->u.s1.block_list_start = next_block; ++ SQUASHFS_I(i)->offset = next_offset; ++ i->i_data.a_ops = &squashfs_aops; ++ ++ TRACE("File inode %x:%x, start_block %llx, " ++ "block_list_start %llx, offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ inodep->start_block, next_block, ++ next_offset); ++ break; ++ } ++ case SQUASHFS_DIR_TYPE: { ++ struct squashfs_dir_inode_header *inodep = &id.dir; ++ struct squashfs_dir_inode_header *sinodep = &sid.dir; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_DIR_INODE_HEADER(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, inodep, block, offset, ++ sizeof(*inodep), &next_block, &next_offset)) ++ goto failed_read; ++ ++ i->i_nlink = inodep->nlink; ++ i->i_size = inodep->file_size; ++ i->i_op = &squashfs_dir_inode_ops; ++ i->i_fop = &squashfs_dir_ops; ++ i->i_mode |= S_IFDIR; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->offset = inodep->offset; ++ SQUASHFS_I(i)->u.s2.directory_index_count = 0; ++ SQUASHFS_I(i)->u.s2.parent_inode = inodep->parent_inode; ++ ++ TRACE("Directory inode %x:%x, start_block %x, offset " ++ "%x\n", SQUASHFS_INODE_BLK(inode), ++ offset, inodep->start_block, ++ inodep->offset); ++ break; ++ } ++ case SQUASHFS_LDIR_TYPE: { ++ struct squashfs_ldir_inode_header *inodep = &id.ldir; ++ struct squashfs_ldir_inode_header *sinodep = &sid.ldir; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_LDIR_INODE_HEADER(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, inodep, block, offset, ++ sizeof(*inodep), &next_block, &next_offset)) ++ goto failed_read; ++ ++ i->i_nlink = inodep->nlink; ++ i->i_size = inodep->file_size; ++ i->i_op = &squashfs_dir_inode_ops; ++ i->i_fop = &squashfs_dir_ops; ++ i->i_mode |= S_IFDIR; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->offset = inodep->offset; ++ SQUASHFS_I(i)->u.s2.directory_index_start = next_block; ++ SQUASHFS_I(i)->u.s2.directory_index_offset = next_offset; ++ SQUASHFS_I(i)->u.s2.directory_index_count = inodep->i_count; ++ SQUASHFS_I(i)->u.s2.parent_inode = inodep->parent_inode; ++ ++ TRACE("Long directory inode %x:%x, start_block %x, offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ inodep->start_block, inodep->offset); ++ break; ++ } ++ case SQUASHFS_SYMLINK_TYPE: { ++ struct squashfs_symlink_inode_header *inodep = &id.symlink; ++ struct squashfs_symlink_inode_header *sinodep = &sid.symlink; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_SYMLINK_INODE_HEADER(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, inodep, block, offset, ++ sizeof(*inodep), &next_block, &next_offset)) ++ goto failed_read; ++ ++ i->i_nlink = inodep->nlink; ++ i->i_size = inodep->symlink_size; ++ i->i_op = &page_symlink_inode_operations; ++ i->i_data.a_ops = &squashfs_symlink_aops; ++ i->i_mode |= S_IFLNK; ++ SQUASHFS_I(i)->start_block = next_block; ++ SQUASHFS_I(i)->offset = next_offset; ++ ++ TRACE("Symbolic link inode %x:%x, start_block %llx, offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ next_block, next_offset); ++ break; ++ } ++ case SQUASHFS_BLKDEV_TYPE: ++ case SQUASHFS_CHRDEV_TYPE: { ++ struct squashfs_dev_inode_header *inodep = &id.dev; ++ struct squashfs_dev_inode_header *sinodep = &sid.dev; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_DEV_INODE_HEADER(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, inodep, block, offset, ++ sizeof(*inodep), &next_block, &next_offset)) ++ goto failed_read; ++ ++ i->i_nlink = inodep->nlink; ++ i->i_mode |= (inodeb->inode_type == SQUASHFS_CHRDEV_TYPE) ? ++ S_IFCHR : S_IFBLK; ++ init_special_inode(i, i->i_mode, old_decode_dev(inodep->rdev)); ++ ++ TRACE("Device inode %x:%x, rdev %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, inodep->rdev); ++ break; ++ } ++ case SQUASHFS_FIFO_TYPE: ++ case SQUASHFS_SOCKET_TYPE: { ++ struct squashfs_ipc_inode_header *inodep = &id.ipc; ++ struct squashfs_ipc_inode_header *sinodep = &sid.ipc; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_IPC_INODE_HEADER(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, inodep, block, offset, ++ sizeof(*inodep), &next_block, &next_offset)) ++ goto failed_read; ++ ++ i->i_nlink = inodep->nlink; ++ i->i_mode |= (inodeb->inode_type == SQUASHFS_FIFO_TYPE) ++ ? S_IFIFO : S_IFSOCK; ++ init_special_inode(i, i->i_mode, 0); ++ break; ++ } ++ default: ++ ERROR("Unknown inode type %d in squashfs_iget!\n", ++ inodeb->inode_type); ++ goto failed_read1; ++ } ++ ++ return 1; ++ ++failed_read: ++ ERROR("Unable to read inode [%llx:%x]\n", block, offset); ++ ++failed_read1: ++ make_bad_inode(i); ++ return 0; ++} ++ ++ ++static int read_inode_lookup_table(struct super_block *s) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ unsigned int length = SQUASHFS_LOOKUP_BLOCK_BYTES(sblk->inodes); ++ ++ TRACE("In read_inode_lookup_table, length %d\n", length); ++ ++ /* Allocate inode lookup table */ ++ msblk->inode_lookup_table = kmalloc(length, GFP_KERNEL); ++ if (msblk->inode_lookup_table == NULL) { ++ ERROR("Failed to allocate inode lookup table\n"); ++ return 0; ++ } ++ ++ if (!squashfs_read_data(s, (char *) msblk->inode_lookup_table, ++ sblk->lookup_table_start, length | ++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, length)) { ++ ERROR("unable to read inode lookup table\n"); ++ return 0; ++ } ++ ++ if (msblk->swap) { ++ int i; ++ long long block; ++ ++ for (i = 0; i < SQUASHFS_LOOKUP_BLOCKS(sblk->inodes); i++) { ++ /* XXX */ ++ SQUASHFS_SWAP_LOOKUP_BLOCKS((&block), ++ &msblk->inode_lookup_table[i], 1); ++ msblk->inode_lookup_table[i] = block; ++ } ++ } ++ ++ return 1; ++} ++ ++ ++static int read_fragment_index_table(struct super_block *s) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ unsigned int length = SQUASHFS_FRAGMENT_INDEX_BYTES(sblk->fragments); ++ ++ if(length == 0) ++ return 1; ++ ++ /* Allocate fragment index table */ ++ msblk->fragment_index = kmalloc(length, GFP_KERNEL); ++ if (msblk->fragment_index == NULL) { ++ ERROR("Failed to allocate fragment index table\n"); ++ return 0; ++ } ++ ++ if (!squashfs_read_data(s, (char *) msblk->fragment_index, ++ sblk->fragment_table_start, length | ++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, length)) { ++ ERROR("unable to read fragment index table\n"); ++ return 0; ++ } ++ ++ if (msblk->swap) { ++ int i; ++ long long fragment; ++ ++ for (i = 0; i < SQUASHFS_FRAGMENT_INDEXES(sblk->fragments); i++) { ++ /* XXX */ ++ SQUASHFS_SWAP_FRAGMENT_INDEXES((&fragment), ++ &msblk->fragment_index[i], 1); ++ msblk->fragment_index[i] = fragment; ++ } ++ } ++ ++ return 1; ++} ++ ++ ++static int readahead_metadata(struct super_block *s) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ int i; ++ ++ squashfs_cached_blks = SQUASHFS_CACHED_BLKS; ++ ++ /* Init inode_table block pointer array */ ++ msblk->block_cache = kmalloc(sizeof(struct squashfs_cache) * ++ squashfs_cached_blks, GFP_KERNEL); ++ if (msblk->block_cache == NULL) { ++ ERROR("Failed to allocate block cache\n"); ++ goto failed; ++ } ++ ++ for (i = 0; i < squashfs_cached_blks; i++) ++ msblk->block_cache[i].block = SQUASHFS_INVALID_BLK; ++ ++ msblk->next_cache = 0; ++ msblk->unused_cache_blks = squashfs_cached_blks; ++ ++ return 1; ++ ++failed: ++ return 0; ++} ++ ++ ++static int supported_squashfs_filesystem(struct squashfs_sb_info *msblk, int silent) ++{ ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ ++ msblk->read_inode = squashfs_read_inode; ++ msblk->read_blocklist = read_blocklist; ++ msblk->read_fragment_index_table = read_fragment_index_table; ++ ++ if (sblk->s_major == 1) { ++ if (!squashfs_1_0_supported(msblk)) { ++ SERROR("Major/Minor mismatch, Squashfs 1.0 filesystems " ++ "are unsupported\n"); ++ SERROR("Please recompile with Squashfs 1.0 support enabled\n"); ++ return 0; ++ } ++ } else if (sblk->s_major == 2) { ++ if (!squashfs_2_0_supported(msblk)) { ++ SERROR("Major/Minor mismatch, Squashfs 2.0 filesystems " ++ "are unsupported\n"); ++ SERROR("Please recompile with Squashfs 2.0 support enabled\n"); ++ return 0; ++ } ++ } else if(sblk->s_major != SQUASHFS_MAJOR || sblk->s_minor > ++ SQUASHFS_MINOR) { ++ SERROR("Major/Minor mismatch, trying to mount newer %d.%d " ++ "filesystem\n", sblk->s_major, sblk->s_minor); ++ SERROR("Please update your kernel\n"); ++ return 0; ++ } ++ ++ return 1; ++} ++ ++ ++static int squashfs_fill_super(struct super_block *s, void *data, int silent) ++{ ++ struct squashfs_sb_info *msblk; ++ struct squashfs_super_block *sblk; ++ int i, err; ++ char b[BDEVNAME_SIZE]; ++ struct inode *root; ++ ++ TRACE("Entered squashfs_fill_superblock\n"); ++ ++ err = -ENOMEM; ++ s->s_fs_info = kzalloc(sizeof(struct squashfs_sb_info), GFP_KERNEL); ++ if (s->s_fs_info == NULL) { ++ ERROR("Failed to allocate superblock\n"); ++ goto failure; ++ } ++ msblk = s->s_fs_info; ++ ++ sblk = &msblk->sblk; ++ ++ msblk->devblksize = sb_min_blocksize(s, BLOCK_SIZE); ++ msblk->devblksize_log2 = ffz(~msblk->devblksize); ++ ++ //mutex_init(&msblk->read_data_mutex); ++ mutex_init(&msblk->read_page_mutex); ++ mutex_init(&msblk->block_cache_mutex); ++ mutex_init(&msblk->fragment_mutex); ++ mutex_init(&msblk->meta_index_mutex); ++ ++ init_waitqueue_head(&msblk->waitq); ++ init_waitqueue_head(&msblk->fragment_wait_queue); ++ ++ /* sblk->bytes_used is checked in squashfs_read_data to ensure reads are not ++ * beyond filesystem end. As we're using squashfs_read_data to read sblk here, ++ * first set sblk->bytes_used to a useful value */ ++ err = -EINVAL; ++ sblk->bytes_used = sizeof(struct squashfs_super_block); ++ if (!squashfs_read_data(s, (char *) sblk, SQUASHFS_START, ++ sizeof(struct squashfs_super_block) | ++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, sizeof(struct squashfs_super_block))) { ++ SERROR("unable to read superblock\n"); ++ goto failed_mount; ++ } ++ ++ /* Check it is a SQUASHFS superblock */ ++ s->s_magic = sblk->s_magic; ++ msblk->swap = 0; ++ dpri("magic 0x%x\n", sblk->s_magic); ++ switch (sblk->s_magic) { ++ struct squashfs_super_block ssblk; ++ ++ case SQUASHFS_MAGIC_SWAP: ++ /*FALLTHROUGH*/ ++ case SQUASHFS_MAGIC_LZMA_SWAP: ++ WARNING("Mounting a different endian SQUASHFS " ++ "filesystem on %s\n", bdevname(s->s_bdev, b)); ++ ++ SQUASHFS_SWAP_SUPER_BLOCK(&ssblk, sblk); ++ memcpy(sblk, &ssblk, sizeof(struct squashfs_super_block)); ++ msblk->swap = 1; ++ /*FALLTHROUGH*/ ++ case SQUASHFS_MAGIC: ++ case SQUASHFS_MAGIC_LZMA: ++ break; ++ default: ++ SERROR("Can't find a SQUASHFS superblock on %s\n", ++ bdevname(s->s_bdev, b)); ++ goto failed_mount; ++ } ++ ++ { ++ struct sqlzma *p; ++ dpri("block_size %d\n", sblk->block_size); ++ BUG_ON(sblk->block_size > sizeof(p->read_data)); ++ } ++ ++ /* Check the MAJOR & MINOR versions */ ++ if(!supported_squashfs_filesystem(msblk, silent)) ++ goto failed_mount; ++ ++ /* Check the filesystem does not extend beyond the end of the ++ block device */ ++ if(sblk->bytes_used < 0 || sblk->bytes_used > i_size_read(s->s_bdev->bd_inode)) ++ goto failed_mount; ++ ++ /* Check the root inode for sanity */ ++ if (SQUASHFS_INODE_OFFSET(sblk->root_inode) > SQUASHFS_METADATA_SIZE) ++ goto failed_mount; ++ ++ TRACE("Found valid superblock on %s\n", bdevname(s->s_bdev, b)); ++ TRACE("Inodes are %scompressed\n", SQUASHFS_UNCOMPRESSED_INODES(sblk->flags) ++ ? "un" : ""); ++ TRACE("Data is %scompressed\n", SQUASHFS_UNCOMPRESSED_DATA(sblk->flags) ++ ? "un" : ""); ++ TRACE("Check data is %spresent in the filesystem\n", ++ SQUASHFS_CHECK_DATA(sblk->flags) ? "" : "not "); ++ TRACE("Filesystem size %lld bytes\n", sblk->bytes_used); ++ TRACE("Block size %d\n", sblk->block_size); ++ TRACE("Number of inodes %d\n", sblk->inodes); ++ if (sblk->s_major > 1) ++ TRACE("Number of fragments %d\n", sblk->fragments); ++ TRACE("Number of uids %d\n", sblk->no_uids); ++ TRACE("Number of gids %d\n", sblk->no_guids); ++ TRACE("sblk->inode_table_start %llx\n", sblk->inode_table_start); ++ TRACE("sblk->directory_table_start %llx\n", sblk->directory_table_start); ++ if (sblk->s_major > 1) ++ TRACE("sblk->fragment_table_start %llx\n", sblk->fragment_table_start); ++ TRACE("sblk->uid_start %llx\n", sblk->uid_start); ++ ++ s->s_maxbytes = MAX_LFS_FILESIZE; ++ s->s_flags |= MS_RDONLY; ++ s->s_op = &squashfs_super_ops; ++ ++ if (readahead_metadata(s) == 0) ++ goto failed_mount; ++ ++ /* Allocate read_page block */ ++ err = -ENOMEM; ++ msblk->read_page = vmalloc(sblk->block_size); ++ if (msblk->read_page == NULL) { ++ ERROR("Failed to allocate read_page block\n"); ++ goto failed_mount; ++ } ++ ++ /* Allocate uid and gid tables */ ++ msblk->uid = kmalloc((sblk->no_uids + sblk->no_guids) * ++ sizeof(unsigned int), GFP_KERNEL); ++ if (msblk->uid == NULL) { ++ ERROR("Failed to allocate uid/gid table\n"); ++ goto failed_mount; ++ } ++ msblk->guid = msblk->uid + sblk->no_uids; ++ ++ dpri("swap %d\n", msblk->swap); ++ err = -EINVAL; ++ if (msblk->swap) { ++ unsigned int *suid; ++ ++ err = -ENOMEM; ++ suid = kmalloc(sizeof(*suid) * (sblk->no_uids + sblk->no_guids), ++ GFP_KERNEL); ++ if (unlikely(!suid)) ++ goto failed_mount; ++ ++ err = -EINVAL; ++ if (!squashfs_read_data(s, (char *)suid, sblk->uid_start, ++ ((sblk->no_uids + sblk->no_guids) * ++ sizeof(unsigned int)) | ++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, (sblk->no_uids + sblk->no_guids) * sizeof(unsigned int))) { ++ ERROR("unable to read uid/gid table\n"); ++ kfree(suid); ++ goto failed_mount; ++ } ++ ++ SQUASHFS_SWAP_DATA(msblk->uid, suid, (sblk->no_uids + ++ sblk->no_guids), (sizeof(unsigned int) * 8)); ++ kfree(suid); ++ } else ++ if (!squashfs_read_data(s, (char *) msblk->uid, sblk->uid_start, ++ ((sblk->no_uids + sblk->no_guids) * ++ sizeof(unsigned int)) | ++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, (sblk->no_uids + sblk->no_guids) * sizeof(unsigned int))) { ++ ERROR("unable to read uid/gid table\n"); ++ goto failed_mount; ++ } ++ ++ ++ if (sblk->s_major == 1 && squashfs_1_0_supported(msblk)) ++ goto allocate_root; ++ ++ err = -ENOMEM; ++ msblk->fragment = kzalloc(sizeof(struct squashfs_fragment_cache) * ++ SQUASHFS_CACHED_FRAGMENTS, GFP_KERNEL); ++ if (msblk->fragment == NULL) { ++ ERROR("Failed to allocate fragment block cache\n"); ++ goto failed_mount; ++ } ++ ++ for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++) { ++ msblk->fragment[i].block = SQUASHFS_INVALID_BLK; ++ } ++ ++ msblk->next_fragment = 0; ++ msblk->unused_frag_blks = SQUASHFS_CACHED_FRAGMENTS; ++ ++ /* Allocate and read fragment index table */ ++ if (msblk->read_fragment_index_table(s) == 0) ++ goto failed_mount; ++ ++ if(sblk->s_major < 3 || sblk->lookup_table_start == SQUASHFS_INVALID_BLK) ++ goto allocate_root; ++ ++ /* Allocate and read inode lookup table */ ++ if (read_inode_lookup_table(s) == 0) ++ goto failed_mount; ++ ++ s->s_op = &squashfs_export_super_ops; ++ s->s_export_op = &squashfs_export_ops; ++ ++allocate_root: ++ dpri("alloate_root\n"); ++ root = new_inode(s); ++ if ((msblk->read_inode)(root, sblk->root_inode) == 0) { ++ iput(root); ++ goto failed_mount; ++ } ++ insert_inode_hash(root); ++ ++ s->s_root = d_alloc_root(root); ++ if (s->s_root == NULL) { ++ ERROR("Root inode create failed\n"); ++ iput(root); ++ goto failed_mount; ++ } ++ ++ TRACE("Leaving squashfs_fill_super\n"); ++ return 0; ++ ++failed_mount: ++ kfree(msblk->inode_lookup_table); ++ kfree(msblk->fragment_index); ++ kfree(msblk->fragment); ++ kfree(msblk->uid); ++ vfree(msblk->read_page); ++ kfree(msblk->block_cache); ++ kfree(msblk->fragment_index_2); ++ kfree(s->s_fs_info); ++ s->s_fs_info = NULL; ++ failure: ++ return err; ++} ++ ++ ++static int squashfs_statfs(struct dentry *dentry, struct kstatfs *buf) ++{ ++ struct squashfs_sb_info *msblk = dentry->d_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ ++ TRACE("Entered squashfs_statfs\n"); ++ ++ buf->f_type = sblk->s_magic; ++ buf->f_bsize = sblk->block_size; ++ buf->f_blocks = ((sblk->bytes_used - 1) >> sblk->block_log) + 1; ++ buf->f_bfree = buf->f_bavail = 0; ++ buf->f_files = sblk->inodes; ++ buf->f_ffree = 0; ++ buf->f_namelen = SQUASHFS_NAME_LEN; ++ ++ return 0; ++} ++ ++ ++static int squashfs_symlink_readpage(struct file *file, struct page *page) ++{ ++ struct inode *inode = page->mapping->host; ++ int index = page->index << PAGE_CACHE_SHIFT, length, bytes, avail_bytes; ++ long long block = SQUASHFS_I(inode)->start_block; ++ int offset = SQUASHFS_I(inode)->offset; ++ void *pageaddr = kmap(page); ++ ++ TRACE("Entered squashfs_symlink_readpage, page index %ld, start block " ++ "%llx, offset %x\n", page->index, ++ SQUASHFS_I(inode)->start_block, ++ SQUASHFS_I(inode)->offset); ++ ++ for (length = 0; length < index; length += bytes) { ++ bytes = squashfs_get_cached_block(inode->i_sb, NULL, block, ++ offset, PAGE_CACHE_SIZE, &block, ++ (unsigned int *)&offset); ++ if (bytes == 0) { ++ ERROR("Unable to read symbolic link [%llx:%x]\n", block, offset); ++ goto skip_read; ++ } ++ } ++ ++ if (length != index) { ++ ERROR("(squashfs_symlink_readpage) length != index\n"); ++ bytes = 0; ++ goto skip_read; ++ } ++ ++ avail_bytes = min_t(int, i_size_read(inode) - length, PAGE_CACHE_SIZE); ++ ++ bytes = squashfs_get_cached_block(inode->i_sb, pageaddr, block, offset, ++ avail_bytes, &block, (unsigned int *)&offset); ++ if (bytes == 0) ++ ERROR("Unable to read symbolic link [%llx:%x]\n", block, offset); ++ ++skip_read: ++ memset(pageaddr + bytes, 0, PAGE_CACHE_SIZE - bytes); ++ kunmap(page); ++ flush_dcache_page(page); ++ SetPageUptodate(page); ++ unlock_page(page); ++ ++ return 0; ++} ++ ++ ++static struct meta_index *locate_meta_index(struct inode *inode, int index, int offset) ++{ ++ struct meta_index *meta = NULL; ++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; ++ int i; ++ ++ mutex_lock(&msblk->meta_index_mutex); ++ ++ TRACE("locate_meta_index: index %d, offset %d\n", index, offset); ++ ++ if (msblk->meta_index == NULL) ++ goto not_allocated; ++ ++ for (i = 0; i < SQUASHFS_META_NUMBER; i ++) { ++ if (msblk->meta_index[i].inode_number == inode->i_ino && ++ msblk->meta_index[i].offset >= offset && ++ msblk->meta_index[i].offset <= index && ++ msblk->meta_index[i].locked == 0) { ++ TRACE("locate_meta_index: entry %d, offset %d\n", i, ++ msblk->meta_index[i].offset); ++ meta = &msblk->meta_index[i]; ++ offset = meta->offset; ++ } ++ } ++ ++ if (meta) ++ meta->locked = 1; ++ ++not_allocated: ++ mutex_unlock(&msblk->meta_index_mutex); ++ ++ return meta; ++} ++ ++ ++static struct meta_index *empty_meta_index(struct inode *inode, int offset, int skip) ++{ ++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; ++ struct meta_index *meta = NULL; ++ int i; ++ ++ mutex_lock(&msblk->meta_index_mutex); ++ ++ TRACE("empty_meta_index: offset %d, skip %d\n", offset, skip); ++ ++ if (msblk->meta_index == NULL) { ++ msblk->meta_index = kmalloc(sizeof(struct meta_index) * ++ SQUASHFS_META_NUMBER, GFP_KERNEL); ++ if (msblk->meta_index == NULL) { ++ ERROR("Failed to allocate meta_index\n"); ++ goto failed; ++ } ++ for (i = 0; i < SQUASHFS_META_NUMBER; i++) { ++ msblk->meta_index[i].inode_number = 0; ++ msblk->meta_index[i].locked = 0; ++ } ++ msblk->next_meta_index = 0; ++ } ++ ++ for (i = SQUASHFS_META_NUMBER; i && ++ msblk->meta_index[msblk->next_meta_index].locked; i --) ++ msblk->next_meta_index = (msblk->next_meta_index + 1) % ++ SQUASHFS_META_NUMBER; ++ ++ if (i == 0) { ++ TRACE("empty_meta_index: failed!\n"); ++ goto failed; ++ } ++ ++ TRACE("empty_meta_index: returned meta entry %d, %p\n", ++ msblk->next_meta_index, ++ &msblk->meta_index[msblk->next_meta_index]); ++ ++ meta = &msblk->meta_index[msblk->next_meta_index]; ++ msblk->next_meta_index = (msblk->next_meta_index + 1) % ++ SQUASHFS_META_NUMBER; ++ ++ meta->inode_number = inode->i_ino; ++ meta->offset = offset; ++ meta->skip = skip; ++ meta->entries = 0; ++ meta->locked = 1; ++ ++failed: ++ mutex_unlock(&msblk->meta_index_mutex); ++ return meta; ++} ++ ++ ++static void release_meta_index(struct inode *inode, struct meta_index *meta) ++{ ++ meta->locked = 0; ++ smp_mb(); ++} ++ ++ ++static int read_block_index(struct super_block *s, int blocks, char *block_list, ++ long long *start_block, int *offset) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ unsigned int *block_listp; ++ int block = 0; ++ ++ if (msblk->swap) { ++ char *sblock_list; ++ ++ sblock_list = kmalloc(blocks << 2, GFP_KERNEL); ++ if (unlikely(!sblock_list)) ++ goto failure; ++ ++ if (!squashfs_get_cached_block(s, sblock_list, *start_block, ++ *offset, blocks << 2, start_block, (unsigned int *)offset)) { ++ ERROR("Fail reading block list [%llx:%x]\n", *start_block, *offset); ++ kfree(sblock_list); ++ goto failure; ++ } ++ SQUASHFS_SWAP_INTS(((unsigned int *)block_list), ++ ((unsigned int *)sblock_list), blocks); ++ kfree(sblock_list); ++ } else { ++ if (!squashfs_get_cached_block(s, block_list, *start_block, ++ *offset, blocks << 2, start_block, (unsigned int *)offset)) { ++ ERROR("Fail reading block list [%llx:%x]\n", *start_block, *offset); ++ goto failure; ++ } ++ } ++ ++ for (block_listp = (unsigned int *) block_list; blocks; ++ block_listp++, blocks --) ++ block += SQUASHFS_COMPRESSED_SIZE_BLOCK(*block_listp); ++ ++ return block; ++ ++failure: ++ return -1; ++} ++ ++ ++#define SIZE 256 ++ ++static inline int calculate_skip(int blocks) { ++ int skip = (blocks - 1) / ((SQUASHFS_SLOTS * SQUASHFS_META_ENTRIES + 1) * SQUASHFS_META_INDEXES); ++ return skip >= 7 ? 7 : skip + 1; ++} ++ ++ ++static int get_meta_index(struct inode *inode, int index, ++ long long *index_block, int *index_offset, ++ long long *data_block, char *block_list) ++{ ++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ int skip = calculate_skip(i_size_read(inode) >> sblk->block_log); ++ int offset = 0; ++ struct meta_index *meta; ++ struct meta_entry *meta_entry; ++ long long cur_index_block = SQUASHFS_I(inode)->u.s1.block_list_start; ++ int cur_offset = SQUASHFS_I(inode)->offset; ++ long long cur_data_block = SQUASHFS_I(inode)->start_block; ++ int i; ++ ++ index /= SQUASHFS_META_INDEXES * skip; ++ ++ while (offset < index) { ++ meta = locate_meta_index(inode, index, offset + 1); ++ ++ if (meta == NULL) { ++ meta = empty_meta_index(inode, offset + 1, skip); ++ if (meta == NULL) ++ goto all_done; ++ } else { ++ if(meta->entries == 0) ++ goto failed; ++ /* XXX */ ++ offset = index < meta->offset + meta->entries ? index : ++ meta->offset + meta->entries - 1; ++ /* XXX */ ++ meta_entry = &meta->meta_entry[offset - meta->offset]; ++ cur_index_block = meta_entry->index_block + sblk->inode_table_start; ++ cur_offset = meta_entry->offset; ++ cur_data_block = meta_entry->data_block; ++ TRACE("get_meta_index: offset %d, meta->offset %d, " ++ "meta->entries %d\n", offset, meta->offset, meta->entries); ++ TRACE("get_meta_index: index_block 0x%llx, offset 0x%x" ++ " data_block 0x%llx\n", cur_index_block, ++ cur_offset, cur_data_block); ++ } ++ ++ for (i = meta->offset + meta->entries; i <= index && ++ i < meta->offset + SQUASHFS_META_ENTRIES; i++) { ++ int blocks = skip * SQUASHFS_META_INDEXES; ++ ++ while (blocks) { ++ int block = blocks > (SIZE >> 2) ? (SIZE >> 2) : blocks; ++ int res = read_block_index(inode->i_sb, block, block_list, ++ &cur_index_block, &cur_offset); ++ ++ if (res == -1) ++ goto failed; ++ ++ cur_data_block += res; ++ blocks -= block; ++ } ++ ++ meta_entry = &meta->meta_entry[i - meta->offset]; ++ meta_entry->index_block = cur_index_block - sblk->inode_table_start; ++ meta_entry->offset = cur_offset; ++ meta_entry->data_block = cur_data_block; ++ meta->entries ++; ++ offset ++; ++ } ++ ++ TRACE("get_meta_index: meta->offset %d, meta->entries %d\n", ++ meta->offset, meta->entries); ++ ++ release_meta_index(inode, meta); ++ } ++ ++all_done: ++ *index_block = cur_index_block; ++ *index_offset = cur_offset; ++ *data_block = cur_data_block; ++ ++ return offset * SQUASHFS_META_INDEXES * skip; ++ ++failed: ++ release_meta_index(inode, meta); ++ return -1; ++} ++ ++ ++static long long read_blocklist(struct inode *inode, int index, ++ int readahead_blks, char *block_list, ++ unsigned short **block_p, unsigned int *bsize) ++{ ++ long long block_ptr; ++ int offset; ++ long long block; ++ int res = get_meta_index(inode, index, &block_ptr, &offset, &block, ++ block_list); ++ ++ TRACE("read_blocklist: res %d, index %d, block_ptr 0x%llx, offset" ++ " 0x%x, block 0x%llx\n", res, index, block_ptr, offset, block); ++ ++ if(res == -1) ++ goto failure; ++ ++ index -= res; ++ ++ while (index) { ++ int blocks = index > (SIZE >> 2) ? (SIZE >> 2) : index; ++ int res = read_block_index(inode->i_sb, blocks, block_list, ++ &block_ptr, &offset); ++ if (res == -1) ++ goto failure; ++ block += res; ++ index -= blocks; ++ } ++ ++ if (read_block_index(inode->i_sb, 1, block_list, &block_ptr, &offset) == -1) ++ goto failure; ++ *bsize = *((unsigned int *) block_list); ++ ++ return block; ++ ++failure: ++ return 0; ++} ++ ++ ++static int squashfs_readpage(struct file *file, struct page *page) ++{ ++ struct inode *inode = page->mapping->host; ++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ unsigned char *block_list = NULL; ++ long long block; ++ unsigned int bsize, i; ++ int bytes; ++ int index = page->index >> (sblk->block_log - PAGE_CACHE_SHIFT); ++ void *pageaddr; ++ struct squashfs_fragment_cache *fragment = NULL; ++ char *data_ptr = msblk->read_page; ++ ++ int mask = (1 << (sblk->block_log - PAGE_CACHE_SHIFT)) - 1; ++ int start_index = page->index & ~mask; ++ int end_index = start_index | mask; ++ int file_end = i_size_read(inode) >> sblk->block_log; ++ int sparse = 0; ++ ++ TRACE("Entered squashfs_readpage, page index %lx, start block %llx\n", ++ page->index, SQUASHFS_I(inode)->start_block); ++ ++ if (page->index >= ((i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> ++ PAGE_CACHE_SHIFT)) ++ goto out; ++ ++ if (SQUASHFS_I(inode)->u.s1.fragment_start_block == SQUASHFS_INVALID_BLK ++ || index < file_end) { ++ block_list = kmalloc(SIZE, GFP_KERNEL); ++ if (block_list == NULL) { ++ ERROR("Failed to allocate block_list\n"); ++ goto error_out; ++ } ++ ++ block = (msblk->read_blocklist)(inode, index, 1, block_list, NULL, &bsize); ++ if (block == 0) ++ goto error_out; ++ ++ if (bsize == 0) { /* hole */ ++ bytes = index == file_end ? ++ (i_size_read(inode) & (sblk->block_size - 1)) : sblk->block_size; ++ sparse = 1; ++ } else { ++ mutex_lock(&msblk->read_page_mutex); ++ ++ bytes = squashfs_read_data(inode->i_sb, msblk->read_page, block, ++ bsize, NULL, sblk->block_size); ++ ++ if (bytes == 0) { ++ ERROR("Unable to read page, block %llx, size %x\n", block, bsize); ++ mutex_unlock(&msblk->read_page_mutex); ++ goto error_out; ++ } ++ } ++ } else { ++ fragment = get_cached_fragment(inode->i_sb, ++ SQUASHFS_I(inode)-> u.s1.fragment_start_block, ++ SQUASHFS_I(inode)->u.s1.fragment_size); ++ ++ if (fragment == NULL) { ++ ERROR("Unable to read page, block %llx, size %x\n", ++ SQUASHFS_I(inode)->u.s1.fragment_start_block, ++ (int) SQUASHFS_I(inode)->u.s1.fragment_size); ++ goto error_out; ++ } ++ bytes = i_size_read(inode) & (sblk->block_size - 1); ++ data_ptr = fragment->data + SQUASHFS_I(inode)->u.s1.fragment_offset; ++ } ++ ++ for (i = start_index; i <= end_index && bytes > 0; i++, ++ bytes -= PAGE_CACHE_SIZE, data_ptr += PAGE_CACHE_SIZE) { ++ struct page *push_page; ++ int avail = sparse ? 0 : min_t(unsigned int, bytes, PAGE_CACHE_SIZE); ++ ++ TRACE("bytes %d, i %d, available_bytes %d\n", bytes, i, avail); ++ ++ push_page = (i == page->index) ? page : ++ grab_cache_page_nowait(page->mapping, i); ++ ++ if (!push_page) ++ continue; ++ ++ if (PageUptodate(push_page)) ++ goto skip_page; ++ ++ pageaddr = kmap_atomic(push_page, KM_USER0); ++ memcpy(pageaddr, data_ptr, avail); ++ memset(pageaddr + avail, 0, PAGE_CACHE_SIZE - avail); ++ kunmap_atomic(pageaddr, KM_USER0); ++ flush_dcache_page(push_page); ++ SetPageUptodate(push_page); ++skip_page: ++ unlock_page(push_page); ++ if(i != page->index) ++ page_cache_release(push_page); ++ } ++ ++ if (SQUASHFS_I(inode)->u.s1.fragment_start_block == SQUASHFS_INVALID_BLK ++ || index < file_end) { ++ if (!sparse) ++ mutex_unlock(&msblk->read_page_mutex); ++ kfree(block_list); ++ } else ++ release_cached_fragment(msblk, fragment); ++ ++ return 0; ++ ++error_out: ++ SetPageError(page); ++out: ++ pageaddr = kmap_atomic(page, KM_USER0); ++ memset(pageaddr, 0, PAGE_CACHE_SIZE); ++ kunmap_atomic(pageaddr, KM_USER0); ++ flush_dcache_page(page); ++ if (!PageError(page)) ++ SetPageUptodate(page); ++ unlock_page(page); ++ ++ kfree(block_list); ++ return 0; ++} ++ ++ ++static int get_dir_index_using_offset(struct super_block *s, ++ long long *next_block, unsigned int *next_offset, ++ long long index_start, unsigned int index_offset, int i_count, ++ long long f_pos) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ int i, length = 0; ++ struct squashfs_dir_index index; ++ ++ TRACE("Entered get_dir_index_using_offset, i_count %d, f_pos %d\n", ++ i_count, (unsigned int) f_pos); ++ ++ f_pos =- 3; ++ if (f_pos == 0) ++ goto finish; ++ ++ for (i = 0; i < i_count; i++) { ++ if (msblk->swap) { ++ struct squashfs_dir_index sindex; ++ squashfs_get_cached_block(s, &sindex, index_start, index_offset, ++ sizeof(sindex), &index_start, &index_offset); ++ SQUASHFS_SWAP_DIR_INDEX(&index, &sindex); ++ } else ++ squashfs_get_cached_block(s, &index, index_start, index_offset, ++ sizeof(index), &index_start, &index_offset); ++ ++ if (index.index > f_pos) ++ break; ++ ++ squashfs_get_cached_block(s, NULL, index_start, index_offset, ++ index.size + 1, &index_start, &index_offset); ++ ++ length = index.index; ++ *next_block = index.start_block + sblk->directory_table_start; ++ } ++ ++ *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE; ++ ++finish: ++ return length + 3; ++} ++ ++ ++static int get_dir_index_using_name(struct super_block *s, ++ long long *next_block, unsigned int *next_offset, ++ long long index_start, unsigned int index_offset, int i_count, ++ const char *name, int size) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ int i, length = 0; ++ struct squashfs_dir_index *index; ++ char *str; ++ ++ TRACE("Entered get_dir_index_using_name, i_count %d\n", i_count); ++ ++ str = kmalloc(sizeof(struct squashfs_dir_index) + ++ (SQUASHFS_NAME_LEN + 1) * 2, GFP_KERNEL); ++ if (str == NULL) { ++ ERROR("Failed to allocate squashfs_dir_index\n"); ++ goto failure; ++ } ++ ++ index = (struct squashfs_dir_index *) (str + SQUASHFS_NAME_LEN + 1); ++ strncpy(str, name, size); ++ str[size] = '\0'; ++ ++ for (i = 0; i < i_count; i++) { ++ if (msblk->swap) { ++ struct squashfs_dir_index sindex; ++ squashfs_get_cached_block(s, &sindex, index_start, index_offset, ++ sizeof(sindex), &index_start, &index_offset); ++ SQUASHFS_SWAP_DIR_INDEX(index, &sindex); ++ } else ++ squashfs_get_cached_block(s, index, index_start, index_offset, ++ sizeof(struct squashfs_dir_index), &index_start, &index_offset); ++ ++ squashfs_get_cached_block(s, index->name, index_start, index_offset, ++ index->size + 1, &index_start, &index_offset); ++ ++ index->name[index->size + 1] = '\0'; ++ ++ if (strcmp(index->name, str) > 0) ++ break; ++ ++ length = index->index; ++ *next_block = index->start_block + sblk->directory_table_start; ++ } ++ ++ *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE; ++ kfree(str); ++ ++failure: ++ return length + 3; ++} ++ ++ ++static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) ++{ ++ struct inode *i = file->f_dentry->d_inode; ++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ long long next_block = SQUASHFS_I(i)->start_block + ++ sblk->directory_table_start; ++ int next_offset = SQUASHFS_I(i)->offset, length = 0, dir_count; ++ struct squashfs_dir_header dirh; ++ struct squashfs_dir_entry *dire; ++ ++ TRACE("Entered squashfs_readdir [%llx:%x]\n", next_block, next_offset); ++ ++ dire = kmalloc(sizeof(struct squashfs_dir_entry) + ++ SQUASHFS_NAME_LEN + 1, GFP_KERNEL); ++ if (dire == NULL) { ++ ERROR("Failed to allocate squashfs_dir_entry\n"); ++ goto finish; ++ } ++ ++ while(file->f_pos < 3) { ++ char *name; ++ int size, i_ino; ++ ++ if(file->f_pos == 0) { ++ name = "."; ++ size = 1; ++ i_ino = i->i_ino; ++ } else { ++ name = ".."; ++ size = 2; ++ i_ino = SQUASHFS_I(i)->u.s2.parent_inode; ++ } ++ TRACE("Calling filldir(%x, %s, %d, %d, %d, %d)\n", ++ (unsigned int) dirent, name, size, (int) ++ file->f_pos, i_ino, squashfs_filetype_table[1]); ++ ++ if (filldir(dirent, name, size, file->f_pos, i_ino, ++ squashfs_filetype_table[1]) < 0) { ++ TRACE("Filldir returned less than 0\n"); ++ goto finish; ++ } ++ file->f_pos += size; ++ } ++ ++ length = get_dir_index_using_offset(i->i_sb, &next_block, ++ (unsigned int *)&next_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_start, ++ SQUASHFS_I(i)->u.s2.directory_index_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_count, file->f_pos); ++ ++ while (length < i_size_read(i)) { ++ /* read directory header */ ++ if (msblk->swap) { ++ struct squashfs_dir_header sdirh; ++ ++ if (!squashfs_get_cached_block(i->i_sb, &sdirh, next_block, ++ next_offset, sizeof(sdirh), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdirh); ++ SQUASHFS_SWAP_DIR_HEADER(&dirh, &sdirh); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, &dirh, next_block, ++ next_offset, sizeof(dirh), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(dirh); ++ } ++ ++ dir_count = dirh.count + 1; ++ while (dir_count--) { ++ if (msblk->swap) { ++ struct squashfs_dir_entry sdire; ++ if (!squashfs_get_cached_block(i->i_sb, &sdire, next_block, ++ next_offset, sizeof(sdire), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdire); ++ SQUASHFS_SWAP_DIR_ENTRY(dire, &sdire); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, dire, next_block, ++ next_offset, sizeof(*dire), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(*dire); ++ } ++ ++ if (!squashfs_get_cached_block(i->i_sb, dire->name, next_block, ++ next_offset, dire->size + 1, &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += dire->size + 1; ++ ++ if (file->f_pos >= length) ++ continue; ++ ++ dire->name[dire->size + 1] = '\0'; ++ ++ TRACE("Calling filldir(%x, %s, %d, %d, %x:%x, %d, %d)\n", ++ (unsigned int) dirent, dire->name, dire->size + 1, ++ (int) file->f_pos, dirh.start_block, dire->offset, ++ dirh.inode_number + dire->inode_number, ++ squashfs_filetype_table[dire->type]); ++ ++ if (filldir(dirent, dire->name, dire->size + 1, file->f_pos, ++ dirh.inode_number + dire->inode_number, ++ squashfs_filetype_table[dire->type]) < 0) { ++ TRACE("Filldir returned less than 0\n"); ++ goto finish; ++ } ++ file->f_pos = length; ++ } ++ } ++ ++finish: ++ kfree(dire); ++ return 0; ++ ++failed_read: ++ ERROR("Unable to read directory block [%llx:%x]\n", next_block, ++ next_offset); ++ kfree(dire); ++ return 0; ++} ++ ++ ++static struct dentry *squashfs_lookup(struct inode *i, struct dentry *dentry, ++ struct nameidata *nd) ++{ ++ const unsigned char *name = dentry->d_name.name; ++ int len = dentry->d_name.len; ++ struct inode *inode = NULL; ++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ long long next_block = SQUASHFS_I(i)->start_block + ++ sblk->directory_table_start; ++ int next_offset = SQUASHFS_I(i)->offset, length = 0, dir_count; ++ struct squashfs_dir_header dirh; ++ struct squashfs_dir_entry *dire; ++ ++ TRACE("Entered squashfs_lookup [%llx:%x]\n", next_block, next_offset); ++ ++ dire = kmalloc(sizeof(struct squashfs_dir_entry) + ++ SQUASHFS_NAME_LEN + 1, GFP_KERNEL); ++ if (dire == NULL) { ++ ERROR("Failed to allocate squashfs_dir_entry\n"); ++ goto exit_lookup; ++ } ++ ++ if (len > SQUASHFS_NAME_LEN) ++ goto exit_lookup; ++ ++ length = get_dir_index_using_name(i->i_sb, &next_block, (unsigned int *)&next_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_start, ++ SQUASHFS_I(i)->u.s2.directory_index_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_count, name, len); ++ ++ while (length < i_size_read(i)) { ++ /* read directory header */ ++ if (msblk->swap) { ++ struct squashfs_dir_header sdirh; ++ if (!squashfs_get_cached_block(i->i_sb, &sdirh, next_block, ++ next_offset, sizeof(sdirh), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdirh); ++ SQUASHFS_SWAP_DIR_HEADER(&dirh, &sdirh); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, &dirh, next_block, ++ next_offset, sizeof(dirh), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(dirh); ++ } ++ ++ dir_count = dirh.count + 1; ++ while (dir_count--) { ++ if (msblk->swap) { ++ struct squashfs_dir_entry sdire; ++ if (!squashfs_get_cached_block(i->i_sb, &sdire, next_block, ++ next_offset, sizeof(sdire), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdire); ++ SQUASHFS_SWAP_DIR_ENTRY(dire, &sdire); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, dire, next_block, ++ next_offset, sizeof(*dire), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(*dire); ++ } ++ ++ if (!squashfs_get_cached_block(i->i_sb, dire->name, next_block, ++ next_offset, dire->size + 1, &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += dire->size + 1; ++ ++ if (name[0] < dire->name[0]) ++ goto exit_lookup; ++ ++ if ((len == dire->size + 1) && !strncmp(name, dire->name, len)) { ++ squashfs_inode_t ino = SQUASHFS_MKINODE(dirh.start_block, ++ dire->offset); ++ ++ TRACE("calling squashfs_iget for directory entry %s, inode" ++ " %x:%x, %d\n", name, dirh.start_block, dire->offset, ++ dirh.inode_number + dire->inode_number); ++ ++ inode = squashfs_iget(i->i_sb, ino, dirh.inode_number + dire->inode_number); ++ ++ goto exit_lookup; ++ } ++ } ++ } ++ ++exit_lookup: ++ kfree(dire); ++ if (inode) ++ return d_splice_alias(inode, dentry); ++ d_add(dentry, inode); ++ return ERR_PTR(0); ++ ++failed_read: ++ ERROR("Unable to read directory block [%llx:%x]\n", next_block, ++ next_offset); ++ goto exit_lookup; ++} ++ ++ ++static int squashfs_remount(struct super_block *s, int *flags, char *data) ++{ ++ *flags |= MS_RDONLY; ++ return 0; ++} ++ ++ ++static void squashfs_put_super(struct super_block *s) ++{ ++ int i; ++ ++ if (s->s_fs_info) { ++ struct squashfs_sb_info *sbi = s->s_fs_info; ++ if (sbi->block_cache) ++ for (i = 0; i < squashfs_cached_blks; i++) ++ if (sbi->block_cache[i].block != SQUASHFS_INVALID_BLK) ++ vfree(sbi->block_cache[i].data); ++ if (sbi->fragment) ++ for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++) ++ vfree(sbi->fragment[i].data); ++ kfree(sbi->fragment); ++ kfree(sbi->block_cache); ++ vfree(sbi->read_page); ++ kfree(sbi->uid); ++ kfree(sbi->fragment_index); ++ kfree(sbi->fragment_index_2); ++ kfree(sbi->meta_index); ++ kfree(s->s_fs_info); ++ s->s_fs_info = NULL; ++ } ++} ++ ++ ++static int squashfs_get_sb(struct file_system_type *fs_type, int flags, ++ const char *dev_name, void *data, struct vfsmount *mnt) ++{ ++ return get_sb_bdev(fs_type, flags, dev_name, data, squashfs_fill_super, ++ mnt); ++} ++ ++static void free_sqlzma(void) ++{ ++ int cpu; ++ struct sqlzma *p; ++ ++ for_each_online_cpu(cpu) { ++ p = per_cpu(sqlzma, cpu); ++ if (p) { ++#ifdef KeepPreemptive ++ mutex_destroy(&p->mtx); ++#endif ++ sqlzma_fin(&p->un); ++ kfree(p); ++ } ++ } ++} ++ ++static int __init init_squashfs_fs(void) ++{ ++ struct sqlzma *p; ++ int cpu; ++ int err = init_inodecache(); ++ if (err) ++ goto out; ++ ++ for_each_online_cpu(cpu) { ++ dpri("%d: %p\n", cpu, per_cpu(sqlzma, cpu)); ++ err = -ENOMEM; ++ p = kmalloc(sizeof(struct sqlzma), GFP_KERNEL); ++ if (p) { ++#ifdef KeepPreemptive ++ mutex_init(&p->mtx); ++#endif ++ err = sqlzma_init(&p->un, 1, 0); ++ if (unlikely(err)) { ++ ERROR("Failed to intialize uncompress workspace\n"); ++ break; ++ } ++ per_cpu(sqlzma, cpu) = p; ++ err = 0; ++ } else ++ break; ++ } ++ if (unlikely(err)) { ++ free_sqlzma(); ++ goto out; ++ } ++ ++ printk(KERN_INFO "squashfs: version 3.3 (2007/10/31) " ++ "Phillip Lougher\n" ++ "squashfs: LZMA suppport for slax.org by jro\n"); ++ ++ err = register_filesystem(&squashfs_fs_type); ++ if (err) { ++ free_sqlzma(); ++ destroy_inodecache(); ++ } ++ ++out: ++ return err; ++} ++ ++ ++static void __exit exit_squashfs_fs(void) ++{ ++ unregister_filesystem(&squashfs_fs_type); ++ free_sqlzma(); ++ destroy_inodecache(); ++} ++ ++ ++static struct kmem_cache * squashfs_inode_cachep; ++ ++ ++static struct inode *squashfs_alloc_inode(struct super_block *sb) ++{ ++ struct squashfs_inode_info *ei; ++ ei = kmem_cache_alloc(squashfs_inode_cachep, GFP_KERNEL); ++ return ei ? &ei->vfs_inode : NULL; ++} ++ ++ ++static void squashfs_destroy_inode(struct inode *inode) ++{ ++ kmem_cache_free(squashfs_inode_cachep, SQUASHFS_I(inode)); ++} ++ ++ ++static void init_once(struct kmem_cache *cachep, void *foo) ++{ ++ struct squashfs_inode_info *ei = foo; ++ ++ inode_init_once(&ei->vfs_inode); ++} ++ ++ ++static int __init init_inodecache(void) ++{ ++ squashfs_inode_cachep = kmem_cache_create("squashfs_inode_cache", ++ sizeof(struct squashfs_inode_info), 0, ++ SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT, init_once); ++ if (squashfs_inode_cachep == NULL) ++ return -ENOMEM; ++ return 0; ++} ++ ++ ++static void destroy_inodecache(void) ++{ ++ kmem_cache_destroy(squashfs_inode_cachep); ++} ++ ++ ++module_init(init_squashfs_fs); ++module_exit(exit_squashfs_fs); ++MODULE_DESCRIPTION("squashfs 3.2-r2-CVS, a compressed read-only filesystem, and LZMA suppport for slax.org"); ++MODULE_AUTHOR("Phillip Lougher <phillip@lougher.demon.co.uk>, and LZMA suppport for slax.org by jro"); ++MODULE_LICENSE("GPL"); +diff -urN linux-2.6.23/fs/squashfs/module.c linux-2.6.23.sqlzma-ng/fs/squashfs/module.c +--- linux-2.6.23/fs/squashfs/module.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/module.c 2007-11-13 19:51:33.000000000 -0500 +@@ -0,0 +1,36 @@ ++ ++/* ++ * Copyright (C) 2006-2007 Junjiro Okajima ++ * Copyright (C) 2006-2007 Tomas Matejicek, slax.org ++ * ++ * LICENSE follows the described one in lzma.txt. ++ */ ++ ++/* $Id: module.c,v 1.1 2007/11/05 05:43:36 jro Exp $ */ ++ ++#include <linux/init.h> ++#include <linux/module.h> ++ ++#include "LzmaDecode.c" ++ ++EXPORT_SYMBOL(LzmaDecodeProperties); ++EXPORT_SYMBOL(LzmaDecode); ++ ++#if 0 ++static int __init unlzma_init(void) ++{ ++ return 0; ++} ++ ++static void __exit unlzma_exit(void) ++{ ++} ++ ++module_init(unlzma_init); ++module_exit(unlzma_exit); ++#endif ++ ++MODULE_LICENSE("GPL"); ++MODULE_VERSION("$Id: module.c,v 1.1 2007/11/05 05:43:36 jro Exp $"); ++MODULE_DESCRIPTION("LZMA uncompress. " ++ "A tiny wrapper for LzmaDecode.c in LZMA SDK from www.7-zip.org."); +diff -urN linux-2.6.23/fs/squashfs/sqlzma.h linux-2.6.23.sqlzma-ng/fs/squashfs/sqlzma.h +--- linux-2.6.23/fs/squashfs/sqlzma.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/sqlzma.h 2007-11-13 19:09:21.000000000 -0500 +@@ -0,0 +1,83 @@ ++/* ++ * Copyright (C) 2006 Junjiro Okajima ++ * Copyright (C) 2006 Tomas Matejicek, slax.org ++ * ++ * LICENSE follows the described one in lzma. ++ */ ++ ++/* $Id: sqlzma.h,v 1.15 2007/11/09 14:42:12 jro Exp $ */ ++ ++#ifndef __sqlzma_h__ ++#define __sqlzma_h__ ++ ++#ifndef __KERNEL__ ++#include <stdlib.h> ++#include <string.h> ++#include <zlib.h> ++#ifdef _REENTRANT ++#include <pthread.h> ++#endif ++#else ++#include <linux/zlib.h> ++#endif ++#define _7ZIP_BYTE_DEFINED ++ ++/* ++ * detect the compression method automatically by the first byte of compressed ++ * data. ++ * according to rfc1950, the first byte of zlib compression must be 0x?8. ++ */ ++#define is_lzma(c) (c == 0x5d) ++ ++/* ---------------------------------------------------------------------- */ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#ifndef __KERNEL__ ++/* for mksquashfs only */ ++struct sqlzma_opts { ++ unsigned int try_lzma:1; ++ unsigned int dicsize; ++}; ++int sqlzma_cm(struct sqlzma_opts *opts, z_stream *stream, Bytef *next_in, uInt ++ avail_in, Bytef *next_out, uInt avail_out); ++#endif ++ ++/* ---------------------------------------------------------------------- */ ++/* ++ * Three patterns for sqlzma uncompression. very dirty code. ++ * - kernel space (squashfs kernel module) ++ * - user space with pthread (mksquashfs) ++ * - user space without pthread (unsquashfs) ++ */ ++ ++struct sized_buf { ++ unsigned int sz; ++ unsigned char *buf; ++}; ++ ++enum {SQUN_PROB, SQUN_RESULT, SQUN_LAST}; ++struct sqlzma_un { ++ int un_lzma; ++ struct sized_buf un_a[SQUN_LAST]; ++ unsigned char un_prob[31960]; /* unlzma 64KB - 1MB */ ++ z_stream un_stream; ++#define un_cmbuf un_stream.next_in ++#define un_cmlen un_stream.avail_in ++#define un_resbuf un_stream.next_out ++#define un_resroom un_stream.avail_out ++#define un_reslen un_stream.total_out ++}; ++ ++int sqlzma_init(struct sqlzma_un *un, int do_lzma, unsigned int res_sz); ++int sqlzma_un(struct sqlzma_un *un, struct sized_buf *src, struct sized_buf *dst); ++void sqlzma_fin(struct sqlzma_un *un); ++ ++/* ---------------------------------------------------------------------- */ ++ ++#ifdef __cplusplus ++}; ++#endif ++#endif +diff -urN linux-2.6.23/fs/squashfs/squashfs.h linux-2.6.23.sqlzma-ng/fs/squashfs/squashfs.h +--- linux-2.6.23/fs/squashfs/squashfs.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/squashfs.h 2007-11-13 18:58:41.000000000 -0500 +@@ -0,0 +1,86 @@ ++/* ++ * Squashfs - a compressed read only filesystem for Linux ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 ++ * Phillip Lougher <phillip@lougher.demon.co.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. ++ * ++ * squashfs.h ++ */ ++ ++#ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY ++#undef CONFIG_SQUASHFS_1_0_COMPATIBILITY ++#endif ++ ++#ifdef SQUASHFS_TRACE ++#define TRACE(s, args...) printk(KERN_NOTICE "SQUASHFS: "s, ## args) ++#else ++#define TRACE(s, args...) {} ++#endif ++ ++#define ERROR(s, args...) printk(KERN_ERR "SQUASHFS error: "s, ## args) ++ ++#define SERROR(s, args...) do { \ ++ if (!silent) \ ++ printk(KERN_ERR "SQUASHFS error: "s, ## args);\ ++ } while(0) ++ ++#define WARNING(s, args...) printk(KERN_WARNING "SQUASHFS: "s, ## args) ++ ++static inline struct squashfs_inode_info *SQUASHFS_I(struct inode *inode) ++{ ++ return list_entry(inode, struct squashfs_inode_info, vfs_inode); ++} ++ ++#if defined(CONFIG_SQUASHFS_1_0_COMPATIBILITY ) || defined(CONFIG_SQUASHFS_2_0_COMPATIBILITY) ++#define SQSH_EXTERN ++extern unsigned int squashfs_read_data(struct super_block *s, char *buffer, ++ long long index, unsigned int length, ++ long long *next_index, int srclength); ++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); ++extern void release_cached_fragment(struct squashfs_sb_info *msblk, struct ++ squashfs_fragment_cache *fragment); ++extern struct squashfs_fragment_cache *get_cached_fragment(struct super_block ++ *s, long long start_block, ++ int length); ++extern struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode, unsigned int inode_number); ++extern const struct address_space_operations squashfs_symlink_aops; ++extern const struct address_space_operations squashfs_aops; ++extern struct inode_operations squashfs_dir_inode_ops; ++#else ++#define SQSH_EXTERN static ++#endif ++ ++#ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY ++extern int squashfs_1_0_supported(struct squashfs_sb_info *msblk); ++#else ++static inline int squashfs_1_0_supported(struct squashfs_sb_info *msblk) ++{ ++ return 0; ++} ++#endif ++ ++#ifdef CONFIG_SQUASHFS_2_0_COMPATIBILITY ++extern int squashfs_2_0_supported(struct squashfs_sb_info *msblk); ++#else ++static inline int squashfs_2_0_supported(struct squashfs_sb_info *msblk) ++{ ++ return 0; ++} ++#endif +diff -urN linux-2.6.23/fs/squashfs/squashfs2_0.c linux-2.6.23.sqlzma-ng/fs/squashfs/squashfs2_0.c +--- linux-2.6.23/fs/squashfs/squashfs2_0.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/squashfs2_0.c 2007-11-13 18:58:41.000000000 -0500 +@@ -0,0 +1,740 @@ ++/* ++ * Squashfs - a compressed read only filesystem for Linux ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 ++ * Phillip Lougher <phillip@lougher.demon.co.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. ++ * ++ * squashfs2_0.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 "squashfs.h" ++static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir); ++static struct dentry *squashfs_lookup_2(struct inode *, struct dentry *, ++ struct nameidata *); ++ ++static struct file_operations squashfs_dir_ops_2 = { ++ .read = generic_read_dir, ++ .readdir = squashfs_readdir_2 ++}; ++ ++static struct inode_operations squashfs_dir_inode_ops_2 = { ++ .lookup = squashfs_lookup_2 ++}; ++ ++static unsigned char squashfs_filetype_table[] = { ++ DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_FIFO, DT_SOCK ++}; ++ ++static int read_fragment_index_table_2(struct super_block *s) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ ++ if (!(msblk->fragment_index_2 = kmalloc(SQUASHFS_FRAGMENT_INDEX_BYTES_2 ++ (sblk->fragments), GFP_KERNEL))) { ++ ERROR("Failed to allocate uid/gid table\n"); ++ return 0; ++ } ++ ++ if (SQUASHFS_FRAGMENT_INDEX_BYTES_2(sblk->fragments) && ++ !squashfs_read_data(s, (char *) ++ msblk->fragment_index_2, ++ sblk->fragment_table_start, ++ SQUASHFS_FRAGMENT_INDEX_BYTES_2 ++ (sblk->fragments) | ++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, SQUASHFS_FRAGMENT_INDEX_BYTES_2(sblk->fragments))) { ++ ERROR("unable to read fragment index table\n"); ++ return 0; ++ } ++ ++ if (msblk->swap) { ++ int i; ++ unsigned int fragment; ++ ++ for (i = 0; i < SQUASHFS_FRAGMENT_INDEXES_2(sblk->fragments); ++ i++) { ++ SQUASHFS_SWAP_FRAGMENT_INDEXES_2((&fragment), ++ &msblk->fragment_index_2[i], 1); ++ msblk->fragment_index_2[i] = fragment; ++ } ++ } ++ ++ return 1; ++} ++ ++ ++static int get_fragment_location_2(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_2[SQUASHFS_FRAGMENT_INDEX_2(fragment)]; ++ int offset = SQUASHFS_FRAGMENT_INDEX_OFFSET_2(fragment); ++ struct squashfs_fragment_entry_2 fragment_entry; ++ ++ if (msblk->swap) { ++ struct squashfs_fragment_entry_2 sfragment_entry; ++ ++ if (!squashfs_get_cached_block(s, (char *) &sfragment_entry, ++ start_block, offset, ++ sizeof(sfragment_entry), &start_block, ++ &offset)) ++ goto out; ++ SQUASHFS_SWAP_FRAGMENT_ENTRY_2(&fragment_entry, &sfragment_entry); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) &fragment_entry, ++ start_block, offset, ++ sizeof(fragment_entry), &start_block, ++ &offset)) ++ goto out; ++ ++ *fragment_start_block = fragment_entry.start_block; ++ *fragment_size = fragment_entry.size; ++ ++ return 1; ++ ++out: ++ return 0; ++} ++ ++ ++static void squashfs_new_inode(struct squashfs_sb_info *msblk, struct inode *i, ++ struct squashfs_base_inode_header_2 *inodeb, unsigned int ino) ++{ ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ ++ i->i_ino = ino; ++ i->i_mtime.tv_sec = sblk->mkfs_time; ++ i->i_atime.tv_sec = sblk->mkfs_time; ++ i->i_ctime.tv_sec = sblk->mkfs_time; ++ i->i_uid = msblk->uid[inodeb->uid]; ++ i->i_mode = inodeb->mode; ++ i->i_nlink = 1; ++ i->i_size = 0; ++ if (inodeb->guid == SQUASHFS_GUIDS) ++ i->i_gid = i->i_uid; ++ else ++ i->i_gid = msblk->guid[inodeb->guid]; ++} ++ ++ ++static int squashfs_read_inode_2(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; ++ unsigned int block = SQUASHFS_INODE_BLK(inode) + ++ sblk->inode_table_start; ++ unsigned int offset = SQUASHFS_INODE_OFFSET(inode); ++ unsigned int ino = SQUASHFS_MK_VFS_INODE(block - ++ sblk->inode_table_start, offset); ++ long long next_block; ++ unsigned int next_offset; ++ union squashfs_inode_header_2 id, sid; ++ struct squashfs_base_inode_header_2 *inodeb = &id.base, ++ *sinodeb = &sid.base; ++ ++ TRACE("Entered squashfs_read_inode_2\n"); ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, (char *) sinodeb, block, ++ offset, sizeof(*sinodeb), &next_block, ++ &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_BASE_INODE_HEADER_2(inodeb, sinodeb, ++ sizeof(*sinodeb)); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) inodeb, block, ++ offset, sizeof(*inodeb), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ squashfs_new_inode(msblk, i, inodeb, ino); ++ ++ switch(inodeb->inode_type) { ++ case SQUASHFS_FILE_TYPE: { ++ struct squashfs_reg_inode_header_2 *inodep = &id.reg; ++ struct squashfs_reg_inode_header_2 *sinodep = &sid.reg; ++ long long frag_blk; ++ unsigned int frag_size = 0; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, (char *) ++ sinodep, block, offset, ++ sizeof(*sinodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_REG_INODE_HEADER_2(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) ++ inodep, block, offset, ++ sizeof(*inodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ frag_blk = SQUASHFS_INVALID_BLK; ++ if (inodep->fragment != SQUASHFS_INVALID_FRAG && ++ !get_fragment_location_2(s, ++ inodep->fragment, &frag_blk, &frag_size)) ++ goto failed_read; ++ ++ i->i_size = inodep->file_size; ++ i->i_fop = &generic_ro_fops; ++ i->i_mode |= S_IFREG; ++ i->i_mtime.tv_sec = inodep->mtime; ++ i->i_atime.tv_sec = inodep->mtime; ++ i->i_ctime.tv_sec = inodep->mtime; ++ i->i_blocks = ((i->i_size - 1) >> 9) + 1; ++ SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk; ++ SQUASHFS_I(i)->u.s1.fragment_size = frag_size; ++ SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->u.s1.block_list_start = next_block; ++ SQUASHFS_I(i)->offset = next_offset; ++ i->i_data.a_ops = &squashfs_aops; ++ ++ TRACE("File inode %x:%x, start_block %x, " ++ "block_list_start %llx, offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ inodep->start_block, next_block, ++ next_offset); ++ break; ++ } ++ case SQUASHFS_DIR_TYPE: { ++ struct squashfs_dir_inode_header_2 *inodep = &id.dir; ++ struct squashfs_dir_inode_header_2 *sinodep = &sid.dir; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, (char *) ++ sinodep, block, offset, ++ sizeof(*sinodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_DIR_INODE_HEADER_2(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) ++ inodep, block, offset, ++ sizeof(*inodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ i->i_size = inodep->file_size; ++ i->i_op = &squashfs_dir_inode_ops_2; ++ i->i_fop = &squashfs_dir_ops_2; ++ i->i_mode |= S_IFDIR; ++ i->i_mtime.tv_sec = inodep->mtime; ++ i->i_atime.tv_sec = inodep->mtime; ++ i->i_ctime.tv_sec = inodep->mtime; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->offset = inodep->offset; ++ SQUASHFS_I(i)->u.s2.directory_index_count = 0; ++ SQUASHFS_I(i)->u.s2.parent_inode = 0; ++ ++ TRACE("Directory inode %x:%x, start_block %x, offset " ++ "%x\n", SQUASHFS_INODE_BLK(inode), ++ offset, inodep->start_block, ++ inodep->offset); ++ break; ++ } ++ case SQUASHFS_LDIR_TYPE: { ++ struct squashfs_ldir_inode_header_2 *inodep = &id.ldir; ++ struct squashfs_ldir_inode_header_2 *sinodep = &sid.ldir; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, (char *) ++ sinodep, block, offset, ++ sizeof(*sinodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_LDIR_INODE_HEADER_2(inodep, ++ sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) ++ inodep, block, offset, ++ sizeof(*inodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ i->i_size = inodep->file_size; ++ i->i_op = &squashfs_dir_inode_ops_2; ++ i->i_fop = &squashfs_dir_ops_2; ++ i->i_mode |= S_IFDIR; ++ i->i_mtime.tv_sec = inodep->mtime; ++ i->i_atime.tv_sec = inodep->mtime; ++ i->i_ctime.tv_sec = inodep->mtime; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->offset = inodep->offset; ++ SQUASHFS_I(i)->u.s2.directory_index_start = next_block; ++ SQUASHFS_I(i)->u.s2.directory_index_offset = ++ next_offset; ++ SQUASHFS_I(i)->u.s2.directory_index_count = ++ inodep->i_count; ++ SQUASHFS_I(i)->u.s2.parent_inode = 0; ++ ++ TRACE("Long directory inode %x:%x, start_block %x, " ++ "offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ inodep->start_block, inodep->offset); ++ break; ++ } ++ case SQUASHFS_SYMLINK_TYPE: { ++ struct squashfs_symlink_inode_header_2 *inodep = ++ &id.symlink; ++ struct squashfs_symlink_inode_header_2 *sinodep = ++ &sid.symlink; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, (char *) ++ sinodep, block, offset, ++ sizeof(*sinodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_SYMLINK_INODE_HEADER_2(inodep, ++ sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) ++ inodep, block, offset, ++ sizeof(*inodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ i->i_size = inodep->symlink_size; ++ i->i_op = &page_symlink_inode_operations; ++ i->i_data.a_ops = &squashfs_symlink_aops; ++ i->i_mode |= S_IFLNK; ++ SQUASHFS_I(i)->start_block = next_block; ++ SQUASHFS_I(i)->offset = next_offset; ++ ++ TRACE("Symbolic link inode %x:%x, start_block %llx, " ++ "offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ next_block, next_offset); ++ break; ++ } ++ case SQUASHFS_BLKDEV_TYPE: ++ case SQUASHFS_CHRDEV_TYPE: { ++ struct squashfs_dev_inode_header_2 *inodep = &id.dev; ++ struct squashfs_dev_inode_header_2 *sinodep = &sid.dev; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, (char *) ++ sinodep, block, offset, ++ sizeof(*sinodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_DEV_INODE_HEADER_2(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) ++ inodep, block, offset, ++ sizeof(*inodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ i->i_mode |= (inodeb->inode_type == ++ SQUASHFS_CHRDEV_TYPE) ? S_IFCHR : ++ S_IFBLK; ++ init_special_inode(i, i->i_mode, ++ old_decode_dev(inodep->rdev)); ++ ++ TRACE("Device inode %x:%x, rdev %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ inodep->rdev); ++ break; ++ } ++ case SQUASHFS_FIFO_TYPE: ++ case SQUASHFS_SOCKET_TYPE: { ++ ++ i->i_mode |= (inodeb->inode_type == SQUASHFS_FIFO_TYPE) ++ ? S_IFIFO : S_IFSOCK; ++ init_special_inode(i, i->i_mode, 0); ++ break; ++ } ++ default: ++ ERROR("Unknown inode type %d in squashfs_iget!\n", ++ inodeb->inode_type); ++ goto failed_read1; ++ } ++ ++ return 1; ++ ++failed_read: ++ ERROR("Unable to read inode [%x:%x]\n", block, offset); ++ ++failed_read1: ++ return 0; ++} ++ ++ ++static int get_dir_index_using_offset(struct super_block *s, long long ++ *next_block, unsigned int *next_offset, ++ long long index_start, ++ unsigned int index_offset, int i_count, ++ long long f_pos) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ int i, length = 0; ++ struct squashfs_dir_index_2 index; ++ ++ TRACE("Entered get_dir_index_using_offset, i_count %d, f_pos %d\n", ++ i_count, (unsigned int) f_pos); ++ ++ if (f_pos == 0) ++ goto finish; ++ ++ for (i = 0; i < i_count; i++) { ++ if (msblk->swap) { ++ struct squashfs_dir_index_2 sindex; ++ squashfs_get_cached_block(s, (char *) &sindex, ++ index_start, index_offset, ++ sizeof(sindex), &index_start, ++ &index_offset); ++ SQUASHFS_SWAP_DIR_INDEX_2(&index, &sindex); ++ } else ++ squashfs_get_cached_block(s, (char *) &index, ++ index_start, index_offset, ++ sizeof(index), &index_start, ++ &index_offset); ++ ++ if (index.index > f_pos) ++ break; ++ ++ squashfs_get_cached_block(s, NULL, index_start, index_offset, ++ index.size + 1, &index_start, ++ &index_offset); ++ ++ length = index.index; ++ *next_block = index.start_block + sblk->directory_table_start; ++ } ++ ++ *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE; ++ ++finish: ++ return length; ++} ++ ++ ++static int get_dir_index_using_name(struct super_block *s, long long ++ *next_block, unsigned int *next_offset, ++ long long index_start, ++ unsigned int index_offset, int i_count, ++ const char *name, int size) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ int i, length = 0; ++ struct squashfs_dir_index_2 *index; ++ char *str; ++ ++ TRACE("Entered get_dir_index_using_name, i_count %d\n", i_count); ++ ++ if (!(str = kmalloc(sizeof(struct squashfs_dir_index) + ++ (SQUASHFS_NAME_LEN + 1) * 2, GFP_KERNEL))) { ++ ERROR("Failed to allocate squashfs_dir_index\n"); ++ goto failure; ++ } ++ ++ index = (struct squashfs_dir_index_2 *) (str + SQUASHFS_NAME_LEN + 1); ++ strncpy(str, name, size); ++ str[size] = '\0'; ++ ++ for (i = 0; i < i_count; i++) { ++ if (msblk->swap) { ++ struct squashfs_dir_index_2 sindex; ++ squashfs_get_cached_block(s, (char *) &sindex, ++ index_start, index_offset, ++ sizeof(sindex), &index_start, ++ &index_offset); ++ SQUASHFS_SWAP_DIR_INDEX_2(index, &sindex); ++ } else ++ squashfs_get_cached_block(s, (char *) index, ++ index_start, index_offset, ++ sizeof(struct squashfs_dir_index_2), ++ &index_start, &index_offset); ++ ++ squashfs_get_cached_block(s, index->name, index_start, ++ index_offset, index->size + 1, ++ &index_start, &index_offset); ++ ++ index->name[index->size + 1] = '\0'; ++ ++ if (strcmp(index->name, str) > 0) ++ break; ++ ++ length = index->index; ++ *next_block = index->start_block + sblk->directory_table_start; ++ } ++ ++ *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE; ++ kfree(str); ++failure: ++ return length; ++} ++ ++ ++static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir) ++{ ++ struct inode *i = file->f_dentry->d_inode; ++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ long long next_block = SQUASHFS_I(i)->start_block + ++ sblk->directory_table_start; ++ int next_offset = SQUASHFS_I(i)->offset, length = 0, ++ dir_count; ++ struct squashfs_dir_header_2 dirh; ++ struct squashfs_dir_entry_2 *dire; ++ ++ TRACE("Entered squashfs_readdir_2 [%llx:%x]\n", next_block, next_offset); ++ ++ if (!(dire = kmalloc(sizeof(struct squashfs_dir_entry) + ++ SQUASHFS_NAME_LEN + 1, GFP_KERNEL))) { ++ ERROR("Failed to allocate squashfs_dir_entry\n"); ++ goto finish; ++ } ++ ++ length = get_dir_index_using_offset(i->i_sb, &next_block, &next_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_start, ++ SQUASHFS_I(i)->u.s2.directory_index_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_count, ++ file->f_pos); ++ ++ while (length < i_size_read(i)) { ++ /* read directory header */ ++ if (msblk->swap) { ++ struct squashfs_dir_header_2 sdirh; ++ ++ if (!squashfs_get_cached_block(i->i_sb, (char *) &sdirh, ++ next_block, next_offset, sizeof(sdirh), ++ &next_block, &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdirh); ++ SQUASHFS_SWAP_DIR_HEADER_2(&dirh, &sdirh); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, (char *) &dirh, ++ next_block, next_offset, sizeof(dirh), ++ &next_block, &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(dirh); ++ } ++ ++ dir_count = dirh.count + 1; ++ while (dir_count--) { ++ if (msblk->swap) { ++ struct squashfs_dir_entry_2 sdire; ++ if (!squashfs_get_cached_block(i->i_sb, (char *) ++ &sdire, next_block, next_offset, ++ sizeof(sdire), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdire); ++ SQUASHFS_SWAP_DIR_ENTRY_2(dire, &sdire); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, (char *) ++ dire, next_block, next_offset, ++ sizeof(*dire), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(*dire); ++ } ++ ++ if (!squashfs_get_cached_block(i->i_sb, dire->name, ++ next_block, next_offset, ++ dire->size + 1, &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ length += dire->size + 1; ++ ++ if (file->f_pos >= length) ++ continue; ++ ++ dire->name[dire->size + 1] = '\0'; ++ ++ TRACE("Calling filldir(%x, %s, %d, %d, %x:%x, %d)\n", ++ (unsigned int) dirent, dire->name, ++ dire->size + 1, (int) file->f_pos, ++ dirh.start_block, dire->offset, ++ squashfs_filetype_table[dire->type]); ++ ++ if (filldir(dirent, dire->name, dire->size + 1, ++ file->f_pos, SQUASHFS_MK_VFS_INODE( ++ dirh.start_block, dire->offset), ++ squashfs_filetype_table[dire->type]) ++ < 0) { ++ TRACE("Filldir returned less than 0\n"); ++ goto finish; ++ } ++ file->f_pos = length; ++ } ++ } ++ ++finish: ++ kfree(dire); ++ return 0; ++ ++failed_read: ++ ERROR("Unable to read directory block [%llx:%x]\n", next_block, ++ next_offset); ++ kfree(dire); ++ return 0; ++} ++ ++ ++static struct dentry *squashfs_lookup_2(struct inode *i, struct dentry *dentry, ++ struct nameidata *nd) ++{ ++ const unsigned char *name = dentry->d_name.name; ++ int len = dentry->d_name.len; ++ struct inode *inode = NULL; ++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ long long next_block = SQUASHFS_I(i)->start_block + ++ sblk->directory_table_start; ++ int next_offset = SQUASHFS_I(i)->offset, length = 0, ++ dir_count; ++ struct squashfs_dir_header_2 dirh; ++ struct squashfs_dir_entry_2 *dire; ++ int sorted = sblk->s_major == 2 && sblk->s_minor >= 1; ++ ++ TRACE("Entered squashfs_lookup_2 [%llx:%x]\n", next_block, next_offset); ++ ++ if (!(dire = kmalloc(sizeof(struct squashfs_dir_entry) + ++ SQUASHFS_NAME_LEN + 1, GFP_KERNEL))) { ++ ERROR("Failed to allocate squashfs_dir_entry\n"); ++ goto exit_loop; ++ } ++ ++ if (len > SQUASHFS_NAME_LEN) ++ goto exit_loop; ++ ++ length = get_dir_index_using_name(i->i_sb, &next_block, &next_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_start, ++ SQUASHFS_I(i)->u.s2.directory_index_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_count, name, ++ len); ++ ++ while (length < i_size_read(i)) { ++ /* read directory header */ ++ if (msblk->swap) { ++ struct squashfs_dir_header_2 sdirh; ++ if (!squashfs_get_cached_block(i->i_sb, (char *) &sdirh, ++ next_block, next_offset, sizeof(sdirh), ++ &next_block, &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdirh); ++ SQUASHFS_SWAP_DIR_HEADER_2(&dirh, &sdirh); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, (char *) &dirh, ++ next_block, next_offset, sizeof(dirh), ++ &next_block, &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(dirh); ++ } ++ ++ dir_count = dirh.count + 1; ++ while (dir_count--) { ++ if (msblk->swap) { ++ struct squashfs_dir_entry_2 sdire; ++ if (!squashfs_get_cached_block(i->i_sb, (char *) ++ &sdire, next_block,next_offset, ++ sizeof(sdire), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdire); ++ SQUASHFS_SWAP_DIR_ENTRY_2(dire, &sdire); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, (char *) ++ dire, next_block,next_offset, ++ sizeof(*dire), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(*dire); ++ } ++ ++ if (!squashfs_get_cached_block(i->i_sb, dire->name, ++ next_block, next_offset, dire->size + 1, ++ &next_block, &next_offset)) ++ goto failed_read; ++ ++ length += dire->size + 1; ++ ++ if (sorted && name[0] < dire->name[0]) ++ goto exit_loop; ++ ++ if ((len == dire->size + 1) && !strncmp(name, ++ dire->name, len)) { ++ squashfs_inode_t ino = ++ SQUASHFS_MKINODE(dirh.start_block, ++ dire->offset); ++ unsigned int inode_number = SQUASHFS_MK_VFS_INODE(dirh.start_block, ++ dire->offset); ++ ++ TRACE("calling squashfs_iget for directory " ++ "entry %s, inode %x:%x, %lld\n", name, ++ dirh.start_block, dire->offset, ino); ++ ++ inode = squashfs_iget(i->i_sb, ino, inode_number); ++ ++ goto exit_loop; ++ } ++ } ++ } ++ ++exit_loop: ++ kfree(dire); ++ d_add(dentry, inode); ++ return ERR_PTR(0); ++ ++failed_read: ++ ERROR("Unable to read directory block [%llx:%x]\n", next_block, ++ next_offset); ++ goto exit_loop; ++} ++ ++ ++int squashfs_2_0_supported(struct squashfs_sb_info *msblk) ++{ ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ ++ msblk->read_inode = squashfs_read_inode_2; ++ msblk->read_fragment_index_table = read_fragment_index_table_2; ++ ++ sblk->bytes_used = sblk->bytes_used_2; ++ sblk->uid_start = sblk->uid_start_2; ++ sblk->guid_start = sblk->guid_start_2; ++ sblk->inode_table_start = sblk->inode_table_start_2; ++ sblk->directory_table_start = sblk->directory_table_start_2; ++ sblk->fragment_table_start = sblk->fragment_table_start_2; ++ ++ return 1; ++} +diff -urN linux-2.6.23/fs/squashfs/uncomp.c linux-2.6.23.sqlzma-ng/fs/squashfs/uncomp.c +--- linux-2.6.23/fs/squashfs/uncomp.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/uncomp.c 2007-11-13 19:40:29.000000000 -0500 +@@ -0,0 +1,221 @@ ++/* ++ * Copyright (C) 2006, 2007 Junjiro Okajima ++ * Copyright (C) 2006, 2007 Tomas Matejicek, slax.org ++ * ++ * LICENSE follows the described one in lzma.txt. ++ */ ++ ++/* $Id: uncomp.c,v 1.1 2007/11/05 05:43:36 jro Exp $ */ ++ ++/* extract some parts from lzma443/C/7zip/Compress/LZMA_C/LzmaTest.c */ ++ ++#ifndef __KERNEL__ ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++#include <errno.h> ++#include <assert.h> ++#include <pthread.h> ++#define unlikely(x) __builtin_expect(!!(x), 0) ++#define BUG_ON(x) assert(!(x)) ++/* sqlzma buffers are always larger than a page. true? */ ++#define kmalloc(sz,gfp) malloc(sz) ++#define kfree(p) free(p) ++#define zlib_inflate(s, f) inflate(s, f) ++#define zlib_inflateInit(s) inflateInit(s) ++#define zlib_inflateReset(s) inflateReset(s) ++#define zlib_inflateEnd(s) inflateEnd(s) ++#else ++#include <linux/init.h> ++#include <linux/module.h> ++#include <linux/kernel.h> ++#include <linux/vmalloc.h> ++#ifndef WARN_ON_ONCE ++#define WARN_ON_ONCE(b) WARN_ON(b) ++#endif ++#endif /* __KERNEL__ */ ++ ++#include "sqlzma.h" ++#include "LzmaDecode.h" ++ ++static int LzmaUncompress(struct sqlzma_un *un) ++{ ++ int err, i, ret; ++ SizeT outSize, inProcessed, outProcessed, srclen; ++ /* it's about 24-80 bytes structure, if int is 32-bit */ ++ CLzmaDecoderState state; ++ unsigned char *dst, *src, a[8]; ++ struct sized_buf *sbuf; ++ ++ /* Decode LZMA properties and allocate memory */ ++ err = -EINVAL; ++ src = un->un_cmbuf; ++ ret = LzmaDecodeProperties(&state.Properties, src, LZMA_PROPERTIES_SIZE); ++ src += LZMA_PROPERTIES_SIZE; ++ if (unlikely(ret != LZMA_RESULT_OK)) ++ goto out; ++ i = LzmaGetNumProbs(&state.Properties); ++ if (unlikely(i <= 0)) ++ i = 1; ++ i *= sizeof(CProb); ++ sbuf = un->un_a + SQUN_PROB; ++ if (unlikely(sbuf->sz < i)) { ++ if (sbuf->buf && sbuf->buf != un->un_prob) ++ kfree(sbuf->buf); ++#ifdef __KERNEL__ ++ printk("%s:%d: %d --> %d\n", __func__, __LINE__, sbuf->sz, i); ++#else ++ printf("%d --> %d\n", sbuf->sz, i); ++#endif ++ err = -ENOMEM; ++ sbuf->sz = 0; ++ sbuf->buf = kmalloc(i, GFP_ATOMIC); ++ if (unlikely(!sbuf->buf)) ++ goto out; ++ sbuf->sz = i; ++ } ++ state.Probs = (void*)sbuf->buf; ++ ++ /* Read uncompressed size */ ++ memcpy(a, src, sizeof(a)); ++ src += sizeof(a); ++ outSize = a[0] | (a[1] << 8) | (a[2] << 16) | (a[3] << 24); ++ ++ err = -EINVAL; ++ dst = un->un_resbuf; ++ if (unlikely(!dst || outSize > un->un_reslen)) ++ goto out; ++ un->un_reslen = outSize; ++ srclen = un->un_cmlen - (src - un->un_cmbuf); ++ ++ /* Decompress */ ++ err = LzmaDecode(&state, src, srclen, &inProcessed, dst, outSize, ++ &outProcessed); ++ if (err) ++ err = -EINVAL; ++ ++ out: ++#ifndef __KERNEL__ ++ if (err) ++ fprintf(stderr, "err %d\n", err); ++#endif ++ return err; ++} ++ ++int sqlzma_un(struct sqlzma_un *un, struct sized_buf *src, ++ struct sized_buf *dst) ++{ ++ int err, by_lzma = 0; ++ if (un->un_lzma && is_lzma(*src->buf)) { ++ by_lzma = 1; ++ un->un_cmbuf = src->buf; ++ un->un_cmlen = src->sz; ++ un->un_resbuf = dst->buf; ++ un->un_reslen = dst->sz; ++ ++ /* this library is thread-safe */ ++ err = LzmaUncompress(un); ++ goto out; ++ } ++ ++ err = zlib_inflateReset(&un->un_stream); ++ if (unlikely(err != Z_OK)) ++ goto out; ++ un->un_stream.next_in = src->buf; ++ un->un_stream.avail_in = src->sz; ++ un->un_stream.next_out = dst->buf; ++ un->un_stream.avail_out = dst->sz; ++ err = zlib_inflate(&un->un_stream, Z_FINISH); ++ if (err == Z_STREAM_END) ++ err = 0; ++ ++ out: ++ if (err) { ++#ifdef __KERNEL__ ++ WARN_ON_ONCE(1); ++#else ++ char a[64] = "ZLIB "; ++ if (by_lzma) { ++ strcpy(a, "LZMA "); ++#ifdef _REENTRANT ++ strerror_r(err, a + 5, sizeof(a) - 5); ++#else ++ strncat(a, strerror(err), sizeof(a) - 5); ++#endif ++ } else ++ strncat(a, zError(err), sizeof(a) - 5); ++ fprintf(stderr, "%s: %.*s\n", __func__, sizeof(a), a); ++#endif ++ } ++ return err; ++} ++ ++int sqlzma_init(struct sqlzma_un *un, int do_lzma, unsigned int res_sz) ++{ ++ int err; ++ ++ err = -ENOMEM; ++ un->un_lzma = do_lzma; ++ memset(un->un_a, 0, sizeof(un->un_a)); ++ un->un_a[SQUN_PROB].buf = un->un_prob; ++ un->un_a[SQUN_PROB].sz = sizeof(un->un_prob); ++ if (res_sz) { ++ un->un_a[SQUN_RESULT].buf = kmalloc(res_sz, GFP_KERNEL); ++ if (unlikely(!un->un_a[SQUN_RESULT].buf)) ++ return err; ++ un->un_a[SQUN_RESULT].sz = res_sz; ++ } ++ ++ un->un_stream.next_in = NULL; ++ un->un_stream.avail_in = 0; ++#ifdef __KERNEL__ ++ un->un_stream.workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL); ++ if (unlikely(!un->un_stream.workspace)) ++ return err; ++#else ++ un->un_stream.opaque = NULL; ++ un->un_stream.zalloc = Z_NULL; ++ un->un_stream.zfree = Z_NULL; ++#endif ++ err = zlib_inflateInit(&un->un_stream); ++ if (unlikely(err == Z_MEM_ERROR)) ++ return -ENOMEM; ++ BUG_ON(err); ++ return err; ++} ++ ++void sqlzma_fin(struct sqlzma_un *un) ++{ ++ int i; ++ for (i = 0; i < SQUN_LAST; i++) ++ if (un->un_a[i].buf && un->un_a[i].buf != un->un_prob) ++ kfree(un->un_a[i].buf); ++ BUG_ON(zlib_inflateEnd(&un->un_stream) != Z_OK); ++} ++ ++#ifdef __KERNEL__ ++EXPORT_SYMBOL(sqlzma_un); ++EXPORT_SYMBOL(sqlzma_init); ++EXPORT_SYMBOL(sqlzma_fin); ++ ++#if 0 ++static int __init sqlzma_init(void) ++{ ++ return 0; ++} ++ ++static void __exit sqlzma_exit(void) ++{ ++} ++ ++module_init(sqlzma_init); ++module_exit(sqlzma_exit); ++#endif ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Junjiro Okajima <sfjro at users dot sf dot net>"); ++MODULE_VERSION("$Id: uncomp.c,v 1.1 2007/11/05 05:43:36 jro Exp $"); ++MODULE_DESCRIPTION("LZMA uncompress for squashfs. " ++ "Some functions for squashfs to support LZMA and " ++ "a tiny wrapper for LzmaDecode.c in LZMA SDK from www.7-zip.org."); ++#endif +diff -urN linux-2.6.23/include/linux/squashfs_fs.h linux-2.6.23.sqlzma-ng/include/linux/squashfs_fs.h +--- linux-2.6.23/include/linux/squashfs_fs.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/include/linux/squashfs_fs.h 2007-11-13 19:12:41.000000000 -0500 +@@ -0,0 +1,937 @@ ++#ifndef SQUASHFS_FS ++#define SQUASHFS_FS ++ ++/* ++ * Squashfs ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 ++ * Phillip Lougher <phillip@lougher.demon.co.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. ++ * ++ * squashfs_fs.h ++ */ ++ ++#ifndef CONFIG_SQUASHFS_2_0_COMPATIBILITY ++#define CONFIG_SQUASHFS_2_0_COMPATIBILITY ++#endif ++ ++#define SQUASHFS_CACHED_FRAGMENTS CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE ++#define SQUASHFS_MAJOR 3 ++#define SQUASHFS_MINOR 1 ++#define SQUASHFS_MAGIC 0x73717368 ++#define SQUASHFS_MAGIC_SWAP 0x68737173 ++#define SQUASHFS_MAGIC_LZMA 0x71736873 ++#define SQUASHFS_MAGIC_LZMA_SWAP 0x73687371 ++#define SQUASHFS_START 0 ++ ++/* size of metadata (inode and directory) blocks */ ++#define SQUASHFS_METADATA_SIZE 8192 ++#define SQUASHFS_METADATA_LOG 13 ++ ++/* default size of data blocks */ ++#define SQUASHFS_FILE_SIZE 131072 ++#define SQUASHFS_FILE_LOG 17 ++ ++#define SQUASHFS_FILE_MAX_SIZE 1048576 ++ ++/* Max number of uids and gids */ ++#define SQUASHFS_UIDS 256 ++#define SQUASHFS_GUIDS 255 ++ ++/* Max length of filename (not 255) */ ++#define SQUASHFS_NAME_LEN 256 ++ ++#define SQUASHFS_INVALID ((long long) 0xffffffffffff) ++#define SQUASHFS_INVALID_FRAG ((unsigned int) 0xffffffff) ++#define SQUASHFS_INVALID_BLK ((long long) -1) ++#define SQUASHFS_USED_BLK ((long long) -2) ++ ++/* Filesystem flags */ ++#define SQUASHFS_NOI 0 ++#define SQUASHFS_NOD 1 ++#define SQUASHFS_CHECK 2 ++#define SQUASHFS_NOF 3 ++#define SQUASHFS_NO_FRAG 4 ++#define SQUASHFS_ALWAYS_FRAG 5 ++#define SQUASHFS_DUPLICATE 6 ++#define SQUASHFS_EXPORT 7 ++ ++#define SQUASHFS_BIT(flag, bit) ((flag >> bit) & 1) ++ ++#define SQUASHFS_UNCOMPRESSED_INODES(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_NOI) ++ ++#define SQUASHFS_UNCOMPRESSED_DATA(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_NOD) ++ ++#define SQUASHFS_UNCOMPRESSED_FRAGMENTS(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_NOF) ++ ++#define SQUASHFS_NO_FRAGMENTS(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_NO_FRAG) ++ ++#define SQUASHFS_ALWAYS_FRAGMENTS(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_ALWAYS_FRAG) ++ ++#define SQUASHFS_DUPLICATES(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_DUPLICATE) ++ ++#define SQUASHFS_EXPORTABLE(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_EXPORT) ++ ++#define SQUASHFS_CHECK_DATA(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_CHECK) ++ ++#define SQUASHFS_MKFLAGS(noi, nod, check_data, nof, no_frag, always_frag, \ ++ duplicate_checking, exportable) (noi | (nod << 1) | (check_data << 2) \ ++ | (nof << 3) | (no_frag << 4) | (always_frag << 5) | \ ++ (duplicate_checking << 6) | (exportable << 7)) ++ ++/* Max number of types and file types */ ++#define SQUASHFS_DIR_TYPE 1 ++#define SQUASHFS_FILE_TYPE 2 ++#define SQUASHFS_SYMLINK_TYPE 3 ++#define SQUASHFS_BLKDEV_TYPE 4 ++#define SQUASHFS_CHRDEV_TYPE 5 ++#define SQUASHFS_FIFO_TYPE 6 ++#define SQUASHFS_SOCKET_TYPE 7 ++#define SQUASHFS_LDIR_TYPE 8 ++#define SQUASHFS_LREG_TYPE 9 ++ ++/* 1.0 filesystem type definitions */ ++#define SQUASHFS_TYPES 5 ++#define SQUASHFS_IPC_TYPE 0 ++ ++/* Flag whether block is compressed or uncompressed, bit is set if block is ++ * uncompressed */ ++#define SQUASHFS_COMPRESSED_BIT (1 << 15) ++ ++#define SQUASHFS_COMPRESSED_SIZE(B) (((B) & ~SQUASHFS_COMPRESSED_BIT) ? \ ++ (B) & ~SQUASHFS_COMPRESSED_BIT : SQUASHFS_COMPRESSED_BIT) ++ ++#define SQUASHFS_COMPRESSED(B) (!((B) & SQUASHFS_COMPRESSED_BIT)) ++ ++#define SQUASHFS_COMPRESSED_BIT_BLOCK (1 << 24) ++ ++#define SQUASHFS_COMPRESSED_SIZE_BLOCK(B) ((B) & \ ++ ~SQUASHFS_COMPRESSED_BIT_BLOCK) ++ ++#define SQUASHFS_COMPRESSED_BLOCK(B) (!((B) & SQUASHFS_COMPRESSED_BIT_BLOCK)) ++ ++/* ++ * Inode number ops. Inodes consist of a compressed block number, and an ++ * uncompressed offset within that block ++ */ ++#define SQUASHFS_INODE_BLK(a) ((unsigned int) ((a) >> 16)) ++ ++#define SQUASHFS_INODE_OFFSET(a) ((unsigned int) ((a) & 0xffff)) ++ ++#define SQUASHFS_MKINODE(A, B) ((squashfs_inode_t)(((squashfs_inode_t) (A)\ ++ << 16) + (B))) ++ ++/* Compute 32 bit VFS inode number from squashfs inode number */ ++#define SQUASHFS_MK_VFS_INODE(a, b) ((unsigned int) (((a) << 8) + \ ++ ((b) >> 2) + 1)) ++/* XXX */ ++ ++/* Translate between VFS mode and squashfs mode */ ++#define SQUASHFS_MODE(a) ((a) & 0xfff) ++ ++/* fragment and fragment table defines */ ++#define SQUASHFS_FRAGMENT_BYTES(A) ((A) * sizeof(struct squashfs_fragment_entry)) ++ ++#define SQUASHFS_FRAGMENT_INDEX(A) (SQUASHFS_FRAGMENT_BYTES(A) / \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_FRAGMENT_INDEX_OFFSET(A) (SQUASHFS_FRAGMENT_BYTES(A) % \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_FRAGMENT_INDEXES(A) ((SQUASHFS_FRAGMENT_BYTES(A) + \ ++ SQUASHFS_METADATA_SIZE - 1) / \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_FRAGMENT_INDEX_BYTES(A) (SQUASHFS_FRAGMENT_INDEXES(A) *\ ++ sizeof(long long)) ++ ++/* inode lookup table defines */ ++#define SQUASHFS_LOOKUP_BYTES(A) ((A) * sizeof(squashfs_inode_t)) ++ ++#define SQUASHFS_LOOKUP_BLOCK(A) (SQUASHFS_LOOKUP_BYTES(A) / \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_LOOKUP_BLOCK_OFFSET(A) (SQUASHFS_LOOKUP_BYTES(A) % \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_LOOKUP_BLOCKS(A) ((SQUASHFS_LOOKUP_BYTES(A) + \ ++ SQUASHFS_METADATA_SIZE - 1) / \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_LOOKUP_BLOCK_BYTES(A) (SQUASHFS_LOOKUP_BLOCKS(A) *\ ++ sizeof(long long)) ++ ++/* cached data constants for filesystem */ ++#define SQUASHFS_CACHED_BLKS 8 ++ ++#define SQUASHFS_MAX_FILE_SIZE_LOG 64 ++ ++#define SQUASHFS_MAX_FILE_SIZE ((long long) 1 << \ ++ (SQUASHFS_MAX_FILE_SIZE_LOG - 2)) ++ ++#define SQUASHFS_MARKER_BYTE 0xff ++ ++/* meta index cache */ ++#define SQUASHFS_META_INDEXES (SQUASHFS_METADATA_SIZE / sizeof(unsigned int)) ++#define SQUASHFS_META_ENTRIES 31 ++#define SQUASHFS_META_NUMBER 8 ++#define SQUASHFS_SLOTS 4 ++ ++struct meta_entry { ++ long long data_block; ++ unsigned int index_block; ++ unsigned short offset; ++ unsigned short pad; ++}; ++ ++struct meta_index { ++ unsigned int inode_number; ++ unsigned int offset; ++ unsigned short entries; ++ unsigned short skip; ++ unsigned short locked; ++ unsigned short pad; ++ struct meta_entry meta_entry[SQUASHFS_META_ENTRIES]; ++}; ++ ++ ++/* ++ * definitions for structures on disk ++ */ ++ ++typedef long long squashfs_block_t; ++typedef long long squashfs_inode_t; ++ ++struct squashfs_super_block { ++ unsigned int s_magic; ++ unsigned int inodes; ++ unsigned int bytes_used_2; ++ unsigned int uid_start_2; ++ unsigned int guid_start_2; ++ unsigned int inode_table_start_2; ++ unsigned int directory_table_start_2; ++ unsigned int s_major:16; ++ unsigned int s_minor:16; ++ unsigned int block_size_1:16; ++ unsigned int block_log:16; ++ unsigned int flags:8; ++ unsigned int no_uids:8; ++ unsigned int no_guids:8; ++ unsigned int mkfs_time /* time of filesystem creation */; ++ squashfs_inode_t root_inode; ++ unsigned int block_size; ++ unsigned int fragments; ++ unsigned int fragment_table_start_2; ++ long long bytes_used; ++ long long uid_start; ++ long long guid_start; ++ long long inode_table_start; ++ long long directory_table_start; ++ long long fragment_table_start; ++ long long lookup_table_start; ++} __attribute__ ((packed)); ++ ++struct squashfs_dir_index { ++ unsigned int index; ++ unsigned int start_block; ++ unsigned char size; ++ unsigned char name[0]; ++} __attribute__ ((packed)); ++ ++#define SQUASHFS_BASE_INODE_HEADER \ ++ unsigned int inode_type:4; \ ++ unsigned int mode:12; \ ++ unsigned int uid:8; \ ++ unsigned int guid:8; \ ++ unsigned int mtime; \ ++ unsigned int inode_number; ++ ++struct squashfs_base_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++} __attribute__ ((packed)); ++ ++struct squashfs_ipc_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ unsigned int nlink; ++} __attribute__ ((packed)); ++ ++struct squashfs_dev_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ unsigned int nlink; ++ unsigned short rdev; ++} __attribute__ ((packed)); ++ ++struct squashfs_symlink_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ unsigned int nlink; ++ unsigned short symlink_size; ++ char symlink[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_reg_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ squashfs_block_t start_block; ++ unsigned int fragment; ++ unsigned int offset; ++ unsigned int file_size; ++ unsigned short block_list[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_lreg_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ unsigned int nlink; ++ squashfs_block_t start_block; ++ unsigned int fragment; ++ unsigned int offset; ++ long long file_size; ++ unsigned short block_list[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_dir_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ unsigned int nlink; ++ unsigned int file_size:19; ++ unsigned int offset:13; ++ unsigned int start_block; ++ unsigned int parent_inode; ++} __attribute__ ((packed)); ++ ++struct squashfs_ldir_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ unsigned int nlink; ++ unsigned int file_size:27; ++ unsigned int offset:13; ++ unsigned int start_block; ++ unsigned int i_count:16; ++ unsigned int parent_inode; ++ struct squashfs_dir_index index[0]; ++} __attribute__ ((packed)); ++ ++union squashfs_inode_header { ++ struct squashfs_base_inode_header base; ++ struct squashfs_dev_inode_header dev; ++ struct squashfs_symlink_inode_header symlink; ++ struct squashfs_reg_inode_header reg; ++ struct squashfs_lreg_inode_header lreg; ++ struct squashfs_dir_inode_header dir; ++ struct squashfs_ldir_inode_header ldir; ++ struct squashfs_ipc_inode_header ipc; ++}; ++ ++struct squashfs_dir_entry { ++ unsigned int offset:13; ++ unsigned int type:3; ++ unsigned int size:8; ++ unsigned int inode_number:16; ++ char name[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_dir_header { ++ unsigned int count:8; ++ unsigned int start_block; ++ unsigned int inode_number; ++} __attribute__ ((packed)); ++ ++struct squashfs_fragment_entry { ++ long long start_block; ++ unsigned int size; ++ unsigned int pending; ++} __attribute__ ((packed)); ++ ++extern int squashfs_uncompress_block(void *d, int dstlen, void *s, int srclen); ++extern int squashfs_uncompress_init(void); ++extern int squashfs_uncompress_exit(void); ++ ++/* ++ * macros to convert each packed bitfield structure from little endian to big ++ * endian and vice versa. These are needed when creating or using a filesystem ++ * on a machine with different byte ordering to the target architecture. ++ * ++ */ ++ ++#define SQUASHFS_SWAP_START \ ++ int bits;\ ++ int b_pos;\ ++ unsigned long long val;\ ++ unsigned char *s;\ ++ unsigned char *d; ++ ++#define SQUASHFS_SWAP_SUPER_BLOCK(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_super_block));\ ++ SQUASHFS_SWAP((s)->s_magic, d, 0, 32);\ ++ SQUASHFS_SWAP((s)->inodes, d, 32, 32);\ ++ SQUASHFS_SWAP((s)->bytes_used_2, d, 64, 32);\ ++ SQUASHFS_SWAP((s)->uid_start_2, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->guid_start_2, d, 128, 32);\ ++ SQUASHFS_SWAP((s)->inode_table_start_2, d, 160, 32);\ ++ SQUASHFS_SWAP((s)->directory_table_start_2, d, 192, 32);\ ++ SQUASHFS_SWAP((s)->s_major, d, 224, 16);\ ++ SQUASHFS_SWAP((s)->s_minor, d, 240, 16);\ ++ SQUASHFS_SWAP((s)->block_size_1, d, 256, 16);\ ++ SQUASHFS_SWAP((s)->block_log, d, 272, 16);\ ++ SQUASHFS_SWAP((s)->flags, d, 288, 8);\ ++ SQUASHFS_SWAP((s)->no_uids, d, 296, 8);\ ++ SQUASHFS_SWAP((s)->no_guids, d, 304, 8);\ ++ SQUASHFS_SWAP((s)->mkfs_time, d, 312, 32);\ ++ SQUASHFS_SWAP((s)->root_inode, d, 344, 64);\ ++ SQUASHFS_SWAP((s)->block_size, d, 408, 32);\ ++ SQUASHFS_SWAP((s)->fragments, d, 440, 32);\ ++ SQUASHFS_SWAP((s)->fragment_table_start_2, d, 472, 32);\ ++ SQUASHFS_SWAP((s)->bytes_used, d, 504, 64);\ ++ SQUASHFS_SWAP((s)->uid_start, d, 568, 64);\ ++ SQUASHFS_SWAP((s)->guid_start, d, 632, 64);\ ++ SQUASHFS_SWAP((s)->inode_table_start, d, 696, 64);\ ++ SQUASHFS_SWAP((s)->directory_table_start, d, 760, 64);\ ++ SQUASHFS_SWAP((s)->fragment_table_start, d, 824, 64);\ ++ SQUASHFS_SWAP((s)->lookup_table_start, d, 888, 64);\ ++} ++ ++#define SQUASHFS_SWAP_BASE_INODE_CORE(s, d, n)\ ++ SQUASHFS_MEMSET(s, d, n);\ ++ SQUASHFS_SWAP((s)->inode_type, d, 0, 4);\ ++ SQUASHFS_SWAP((s)->mode, d, 4, 12);\ ++ SQUASHFS_SWAP((s)->uid, d, 16, 8);\ ++ SQUASHFS_SWAP((s)->guid, d, 24, 8);\ ++ SQUASHFS_SWAP((s)->mtime, d, 32, 32);\ ++ SQUASHFS_SWAP((s)->inode_number, d, 64, 32); ++ ++#define SQUASHFS_SWAP_BASE_INODE_HEADER(s, d, n) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, n)\ ++} ++ ++#define SQUASHFS_SWAP_IPC_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_ipc_inode_header))\ ++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\ ++} ++ ++#define SQUASHFS_SWAP_DEV_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_dev_inode_header)); \ ++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->rdev, d, 128, 16);\ ++} ++ ++#define SQUASHFS_SWAP_SYMLINK_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_symlink_inode_header));\ ++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->symlink_size, d, 128, 16);\ ++} ++ ++#define SQUASHFS_SWAP_REG_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_reg_inode_header));\ ++ SQUASHFS_SWAP((s)->start_block, d, 96, 64);\ ++ SQUASHFS_SWAP((s)->fragment, d, 160, 32);\ ++ SQUASHFS_SWAP((s)->offset, d, 192, 32);\ ++ SQUASHFS_SWAP((s)->file_size, d, 224, 32);\ ++} ++ ++#define SQUASHFS_SWAP_LREG_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_lreg_inode_header));\ ++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 128, 64);\ ++ SQUASHFS_SWAP((s)->fragment, d, 192, 32);\ ++ SQUASHFS_SWAP((s)->offset, d, 224, 32);\ ++ SQUASHFS_SWAP((s)->file_size, d, 256, 64);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_dir_inode_header));\ ++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->file_size, d, 128, 19);\ ++ SQUASHFS_SWAP((s)->offset, d, 147, 13);\ ++ SQUASHFS_SWAP((s)->start_block, d, 160, 32);\ ++ SQUASHFS_SWAP((s)->parent_inode, d, 192, 32);\ ++} ++ ++#define SQUASHFS_SWAP_LDIR_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_ldir_inode_header));\ ++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->file_size, d, 128, 27);\ ++ SQUASHFS_SWAP((s)->offset, d, 155, 13);\ ++ SQUASHFS_SWAP((s)->start_block, d, 168, 32);\ ++ SQUASHFS_SWAP((s)->i_count, d, 200, 16);\ ++ SQUASHFS_SWAP((s)->parent_inode, d, 216, 32);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_INDEX(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_index));\ ++ SQUASHFS_SWAP((s)->index, d, 0, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 32, 32);\ ++ SQUASHFS_SWAP((s)->size, d, 64, 8);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_header));\ ++ SQUASHFS_SWAP((s)->count, d, 0, 8);\ ++ SQUASHFS_SWAP((s)->start_block, d, 8, 32);\ ++ SQUASHFS_SWAP((s)->inode_number, d, 40, 32);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_ENTRY(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_entry));\ ++ SQUASHFS_SWAP((s)->offset, d, 0, 13);\ ++ SQUASHFS_SWAP((s)->type, d, 13, 3);\ ++ SQUASHFS_SWAP((s)->size, d, 16, 8);\ ++ SQUASHFS_SWAP((s)->inode_number, d, 24, 16);\ ++} ++ ++#define SQUASHFS_SWAP_FRAGMENT_ENTRY(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_fragment_entry));\ ++ SQUASHFS_SWAP((s)->start_block, d, 0, 64);\ ++ SQUASHFS_SWAP((s)->size, d, 64, 32);\ ++} ++ ++#define SQUASHFS_SWAP_INODE_T(s, d) SQUASHFS_SWAP_LONG_LONGS(s, d, 1) ++ ++#define SQUASHFS_SWAP_SHORTS(s, d, n) {\ ++ int entry;\ ++ int bit_position;\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, n * 2);\ ++ for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += \ ++ 16)\ ++ SQUASHFS_SWAP(s[entry], d, bit_position, 16);\ ++} ++ ++#define SQUASHFS_SWAP_INTS(s, d, n) {\ ++ int entry;\ ++ int bit_position;\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, n * 4);\ ++ for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += \ ++ 32)\ ++ SQUASHFS_SWAP(s[entry], d, bit_position, 32);\ ++} ++ ++#define SQUASHFS_SWAP_LONG_LONGS(s, d, n) {\ ++ int entry;\ ++ int bit_position;\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, n * 8);\ ++ for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += \ ++ 64)\ ++ SQUASHFS_SWAP(s[entry], d, bit_position, 64);\ ++} ++ ++#define SQUASHFS_SWAP_DATA(s, d, n, bits) {\ ++ int entry;\ ++ int bit_position;\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, n * bits / 8);\ ++ for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += \ ++ bits)\ ++ SQUASHFS_SWAP(s[entry], d, bit_position, bits);\ ++} ++ ++#define SQUASHFS_SWAP_FRAGMENT_INDEXES(s, d, n) SQUASHFS_SWAP_LONG_LONGS(s, d, n) ++#define SQUASHFS_SWAP_LOOKUP_BLOCKS(s, d, n) SQUASHFS_SWAP_LONG_LONGS(s, d, n) ++ ++#ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY ++ ++struct squashfs_base_inode_header_1 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:4; /* index into uid table */ ++ unsigned int guid:4; /* index into guid table */ ++} __attribute__ ((packed)); ++ ++struct squashfs_ipc_inode_header_1 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:4; /* index into uid table */ ++ unsigned int guid:4; /* index into guid table */ ++ unsigned int type:4; ++ unsigned int offset:4; ++} __attribute__ ((packed)); ++ ++struct squashfs_dev_inode_header_1 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:4; /* index into uid table */ ++ unsigned int guid:4; /* index into guid table */ ++ unsigned short rdev; ++} __attribute__ ((packed)); ++ ++struct squashfs_symlink_inode_header_1 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:4; /* index into uid table */ ++ unsigned int guid:4; /* index into guid table */ ++ unsigned short symlink_size; ++ char symlink[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_reg_inode_header_1 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:4; /* index into uid table */ ++ unsigned int guid:4; /* index into guid table */ ++ unsigned int mtime; ++ unsigned int start_block; ++ unsigned int file_size:32; ++ unsigned short block_list[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_dir_inode_header_1 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:4; /* index into uid table */ ++ unsigned int guid:4; /* index into guid table */ ++ unsigned int file_size:19; ++ unsigned int offset:13; ++ unsigned int mtime; ++ unsigned int start_block:24; ++} __attribute__ ((packed)); ++ ++union squashfs_inode_header_1 { ++ struct squashfs_base_inode_header_1 base; ++ struct squashfs_dev_inode_header_1 dev; ++ struct squashfs_symlink_inode_header_1 symlink; ++ struct squashfs_reg_inode_header_1 reg; ++ struct squashfs_dir_inode_header_1 dir; ++ struct squashfs_ipc_inode_header_1 ipc; ++}; ++ ++#define SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, n) \ ++ SQUASHFS_MEMSET(s, d, n);\ ++ SQUASHFS_SWAP((s)->inode_type, d, 0, 4);\ ++ SQUASHFS_SWAP((s)->mode, d, 4, 12);\ ++ SQUASHFS_SWAP((s)->uid, d, 16, 4);\ ++ SQUASHFS_SWAP((s)->guid, d, 20, 4); ++ ++#define SQUASHFS_SWAP_BASE_INODE_HEADER_1(s, d, n) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, n)\ ++} ++ ++#define SQUASHFS_SWAP_IPC_INODE_HEADER_1(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \ ++ sizeof(struct squashfs_ipc_inode_header_1));\ ++ SQUASHFS_SWAP((s)->type, d, 24, 4);\ ++ SQUASHFS_SWAP((s)->offset, d, 28, 4);\ ++} ++ ++#define SQUASHFS_SWAP_DEV_INODE_HEADER_1(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \ ++ sizeof(struct squashfs_dev_inode_header_1));\ ++ SQUASHFS_SWAP((s)->rdev, d, 24, 16);\ ++} ++ ++#define SQUASHFS_SWAP_SYMLINK_INODE_HEADER_1(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \ ++ sizeof(struct squashfs_symlink_inode_header_1));\ ++ SQUASHFS_SWAP((s)->symlink_size, d, 24, 16);\ ++} ++ ++#define SQUASHFS_SWAP_REG_INODE_HEADER_1(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \ ++ sizeof(struct squashfs_reg_inode_header_1));\ ++ SQUASHFS_SWAP((s)->mtime, d, 24, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 56, 32);\ ++ SQUASHFS_SWAP((s)->file_size, d, 88, 32);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_INODE_HEADER_1(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \ ++ sizeof(struct squashfs_dir_inode_header_1));\ ++ SQUASHFS_SWAP((s)->file_size, d, 24, 19);\ ++ SQUASHFS_SWAP((s)->offset, d, 43, 13);\ ++ SQUASHFS_SWAP((s)->mtime, d, 56, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 88, 24);\ ++} ++ ++#endif ++ ++#ifdef CONFIG_SQUASHFS_2_0_COMPATIBILITY ++ ++struct squashfs_dir_index_2 { ++ unsigned int index:27; ++ unsigned int start_block:29; ++ unsigned char size; ++ unsigned char name[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_base_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++} __attribute__ ((packed)); ++ ++struct squashfs_ipc_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++} __attribute__ ((packed)); ++ ++struct squashfs_dev_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++ unsigned short rdev; ++} __attribute__ ((packed)); ++ ++struct squashfs_symlink_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++ unsigned short symlink_size; ++ char symlink[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_reg_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++ unsigned int mtime; ++ unsigned int start_block; ++ unsigned int fragment; ++ unsigned int offset; ++ unsigned int file_size:32; ++ unsigned short block_list[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_dir_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++ unsigned int file_size:19; ++ unsigned int offset:13; ++ unsigned int mtime; ++ unsigned int start_block:24; ++} __attribute__ ((packed)); ++ ++struct squashfs_ldir_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++ unsigned int file_size:27; ++ unsigned int offset:13; ++ unsigned int mtime; ++ unsigned int start_block:24; ++ unsigned int i_count:16; ++ struct squashfs_dir_index_2 index[0]; ++} __attribute__ ((packed)); ++ ++union squashfs_inode_header_2 { ++ struct squashfs_base_inode_header_2 base; ++ struct squashfs_dev_inode_header_2 dev; ++ struct squashfs_symlink_inode_header_2 symlink; ++ struct squashfs_reg_inode_header_2 reg; ++ struct squashfs_dir_inode_header_2 dir; ++ struct squashfs_ldir_inode_header_2 ldir; ++ struct squashfs_ipc_inode_header_2 ipc; ++}; ++ ++struct squashfs_dir_header_2 { ++ unsigned int count:8; ++ unsigned int start_block:24; ++} __attribute__ ((packed)); ++ ++struct squashfs_dir_entry_2 { ++ unsigned int offset:13; ++ unsigned int type:3; ++ unsigned int size:8; ++ char name[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_fragment_entry_2 { ++ unsigned int start_block; ++ unsigned int size; ++} __attribute__ ((packed)); ++ ++#define SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, n)\ ++ SQUASHFS_MEMSET(s, d, n);\ ++ SQUASHFS_SWAP((s)->inode_type, d, 0, 4);\ ++ SQUASHFS_SWAP((s)->mode, d, 4, 12);\ ++ SQUASHFS_SWAP((s)->uid, d, 16, 8);\ ++ SQUASHFS_SWAP((s)->guid, d, 24, 8);\ ++ ++#define SQUASHFS_SWAP_BASE_INODE_HEADER_2(s, d, n) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, n)\ ++} ++ ++#define SQUASHFS_SWAP_IPC_INODE_HEADER_2(s, d) \ ++ SQUASHFS_SWAP_BASE_INODE_HEADER_2(s, d, sizeof(struct squashfs_ipc_inode_header_2)) ++ ++#define SQUASHFS_SWAP_DEV_INODE_HEADER_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \ ++ sizeof(struct squashfs_dev_inode_header_2)); \ ++ SQUASHFS_SWAP((s)->rdev, d, 32, 16);\ ++} ++ ++#define SQUASHFS_SWAP_SYMLINK_INODE_HEADER_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \ ++ sizeof(struct squashfs_symlink_inode_header_2));\ ++ SQUASHFS_SWAP((s)->symlink_size, d, 32, 16);\ ++} ++ ++#define SQUASHFS_SWAP_REG_INODE_HEADER_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \ ++ sizeof(struct squashfs_reg_inode_header_2));\ ++ SQUASHFS_SWAP((s)->mtime, d, 32, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 64, 32);\ ++ SQUASHFS_SWAP((s)->fragment, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->offset, d, 128, 32);\ ++ SQUASHFS_SWAP((s)->file_size, d, 160, 32);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_INODE_HEADER_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \ ++ sizeof(struct squashfs_dir_inode_header_2));\ ++ SQUASHFS_SWAP((s)->file_size, d, 32, 19);\ ++ SQUASHFS_SWAP((s)->offset, d, 51, 13);\ ++ SQUASHFS_SWAP((s)->mtime, d, 64, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 96, 24);\ ++} ++ ++#define SQUASHFS_SWAP_LDIR_INODE_HEADER_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \ ++ sizeof(struct squashfs_ldir_inode_header_2));\ ++ SQUASHFS_SWAP((s)->file_size, d, 32, 27);\ ++ SQUASHFS_SWAP((s)->offset, d, 59, 13);\ ++ SQUASHFS_SWAP((s)->mtime, d, 72, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 104, 24);\ ++ SQUASHFS_SWAP((s)->i_count, d, 128, 16);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_INDEX_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_index_2));\ ++ SQUASHFS_SWAP((s)->index, d, 0, 27);\ ++ SQUASHFS_SWAP((s)->start_block, d, 27, 29);\ ++ SQUASHFS_SWAP((s)->size, d, 56, 8);\ ++} ++#define SQUASHFS_SWAP_DIR_HEADER_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_header_2));\ ++ SQUASHFS_SWAP((s)->count, d, 0, 8);\ ++ SQUASHFS_SWAP((s)->start_block, d, 8, 24);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_ENTRY_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_entry_2));\ ++ SQUASHFS_SWAP((s)->offset, d, 0, 13);\ ++ SQUASHFS_SWAP((s)->type, d, 13, 3);\ ++ SQUASHFS_SWAP((s)->size, d, 16, 8);\ ++} ++ ++#define SQUASHFS_SWAP_FRAGMENT_ENTRY_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_fragment_entry_2));\ ++ SQUASHFS_SWAP((s)->start_block, d, 0, 32);\ ++ SQUASHFS_SWAP((s)->size, d, 32, 32);\ ++} ++ ++#define SQUASHFS_SWAP_FRAGMENT_INDEXES_2(s, d, n) SQUASHFS_SWAP_INTS(s, d, n) ++ ++/* fragment and fragment table defines */ ++#define SQUASHFS_FRAGMENT_BYTES_2(A) (A * sizeof(struct squashfs_fragment_entry_2)) ++ ++#define SQUASHFS_FRAGMENT_INDEX_2(A) (SQUASHFS_FRAGMENT_BYTES_2(A) / \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_FRAGMENT_INDEX_OFFSET_2(A) (SQUASHFS_FRAGMENT_BYTES_2(A) % \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_FRAGMENT_INDEXES_2(A) ((SQUASHFS_FRAGMENT_BYTES_2(A) + \ ++ SQUASHFS_METADATA_SIZE - 1) / \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_FRAGMENT_INDEX_BYTES_2(A) (SQUASHFS_FRAGMENT_INDEXES_2(A) *\ ++ sizeof(int)) ++ ++#endif ++ ++#ifdef __KERNEL__ ++ ++/* ++ * macros used to swap each structure entry, taking into account ++ * bitfields and different bitfield placing conventions on differing ++ * architectures ++ */ ++ ++#include <asm/byteorder.h> ++ ++#ifdef __BIG_ENDIAN ++ /* convert from little endian to big endian */ ++#define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, \ ++ tbits, b_pos) ++#else ++ /* convert from big endian to little endian */ ++#define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, \ ++ tbits, 64 - tbits - b_pos) ++#endif ++ ++#define _SQUASHFS_SWAP(value, p, pos, tbits, SHIFT) {\ ++ b_pos = pos % 8;\ ++ val = 0;\ ++ s = (unsigned char *)p + (pos / 8);\ ++ d = ((unsigned char *) &val) + 7;\ ++ for(bits = 0; bits < (tbits + b_pos); bits += 8) \ ++ *d-- = *s++;\ ++ value = (val >> (SHIFT))/* & ((1 << tbits) - 1)*/;\ ++} ++ ++#define SQUASHFS_MEMSET(s, d, n) memset(s, 0, n); ++ ++#endif ++#endif +diff -urN linux-2.6.23/include/linux/squashfs_fs_i.h linux-2.6.23.sqlzma-ng/include/linux/squashfs_fs_i.h +--- linux-2.6.23/include/linux/squashfs_fs_i.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/include/linux/squashfs_fs_i.h 2007-11-13 18:58:41.000000000 -0500 +@@ -0,0 +1,45 @@ ++#ifndef SQUASHFS_FS_I ++#define SQUASHFS_FS_I ++/* ++ * Squashfs ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 ++ * Phillip Lougher <phillip@lougher.demon.co.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. ++ * ++ * squashfs_fs_i.h ++ */ ++ ++struct squashfs_inode_info { ++ long long start_block; ++ unsigned int offset; ++ union { ++ struct { ++ long long fragment_start_block; ++ unsigned int fragment_size; ++ unsigned int fragment_offset; ++ long long block_list_start; ++ } s1; ++ struct { ++ long long directory_index_start; ++ unsigned int directory_index_offset; ++ unsigned int directory_index_count; ++ unsigned int parent_inode; ++ } s2; ++ } u; ++ struct inode vfs_inode; ++}; ++#endif +diff -urN linux-2.6.23/include/linux/squashfs_fs_sb.h linux-2.6.23.sqlzma-ng/include/linux/squashfs_fs_sb.h +--- linux-2.6.23/include/linux/squashfs_fs_sb.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/include/linux/squashfs_fs_sb.h 2007-11-13 19:19:28.000000000 -0500 +@@ -0,0 +1,76 @@ ++#ifndef SQUASHFS_FS_SB ++#define SQUASHFS_FS_SB ++/* ++ * Squashfs ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 ++ * Phillip Lougher <phillip@lougher.demon.co.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. ++ * ++ * squashfs_fs_sb.h ++ */ ++ ++#include <linux/squashfs_fs.h> ++ ++struct squashfs_cache { ++ long long block; ++ int length; ++ long long next_index; ++ char *data; ++}; ++ ++struct squashfs_fragment_cache { ++ long long block; ++ int length; ++ unsigned int locked; ++ char *data; ++}; ++ ++struct squashfs_sb_info { ++ struct squashfs_super_block sblk; ++ int devblksize; ++ int devblksize_log2; ++ int swap; ++ struct squashfs_cache *block_cache; ++ struct squashfs_fragment_cache *fragment; ++ int next_cache; ++ int next_fragment; ++ int next_meta_index; ++ unsigned int *uid; ++ unsigned int *guid; ++ long long *fragment_index; ++ unsigned int *fragment_index_2; ++ char *read_page; ++ //struct mutex read_data_mutex; ++ struct mutex read_page_mutex; ++ struct mutex block_cache_mutex; ++ struct mutex fragment_mutex; ++ struct mutex meta_index_mutex; ++ wait_queue_head_t waitq; ++ wait_queue_head_t fragment_wait_queue; ++ struct meta_index *meta_index; ++ //z_stream stream; ++ long long *inode_lookup_table; ++ int unused_cache_blks; ++ int unused_frag_blks; ++ int (*read_inode)(struct inode *i, squashfs_inode_t \ ++ inode); ++ long long (*read_blocklist)(struct inode *inode, int \ ++ index, int readahead_blks, char *block_list, \ ++ unsigned short **block_p, unsigned int *bsize); ++ int (*read_fragment_index_table)(struct super_block *s); ++}; ++#endif + diff --git a/packages/linux/linux-openmoko/0002-squashfs-initrd.patch b/packages/linux/linux-openmoko/0002-squashfs-initrd.patch new file mode 100644 index 0000000000..cd2c678058 --- /dev/null +++ b/packages/linux/linux-openmoko/0002-squashfs-initrd.patch @@ -0,0 +1,55 @@ +diff -urN linux-2.6.23/init/do_mounts_rd.c linux-2.6.23.sqlzma-ng/init/do_mounts_rd.c +--- linux-2.6.23/init/do_mounts_rd.c 2007-10-09 16:31:38.000000000 -0400 ++++ linux-2.6.23.sqlzma-ng/init/do_mounts_rd.c 2007-11-13 18:58:41.000000000 -0500 +@@ -5,6 +5,7 @@ + #include <linux/ext2_fs.h> + #include <linux/romfs_fs.h> + #include <linux/cramfs_fs.h> ++#include <linux/squashfs_fs.h> + #include <linux/initrd.h> + #include <linux/string.h> + +@@ -39,6 +40,7 @@ + * numbers could not be found. + * + * We currently check for the following magic numbers: ++ * squashfs + * minix + * ext2 + * romfs +@@ -53,6 +55,7 @@ + struct ext2_super_block *ext2sb; + struct romfs_super_block *romfsb; + struct cramfs_super *cramfsb; ++ struct squashfs_super_block *squashfsb; + int nblocks = -1; + unsigned char *buf; + +@@ -64,6 +67,7 @@ + ext2sb = (struct ext2_super_block *) buf; + romfsb = (struct romfs_super_block *) buf; + cramfsb = (struct cramfs_super *) buf; ++ squashfsb = (struct squashfs_super_block *) buf; + memset(buf, 0xe5, size); + + /* +@@ -101,6 +105,18 @@ + goto done; + } + ++ /* squashfs is at block zero too */ ++ if (squashfsb->s_magic == SQUASHFS_MAGIC) { ++ printk(KERN_NOTICE ++ "RAMDISK: squashfs filesystem found at block %d\n", ++ start_block); ++ if (squashfsb->s_major < 3) ++ nblocks = (squashfsb->bytes_used_2+BLOCK_SIZE-1)>>BLOCK_SIZE_BITS; ++ else ++ nblocks = (squashfsb->bytes_used+BLOCK_SIZE-1)>>BLOCK_SIZE_BITS; ++ goto done; ++ } ++ + /* + * Read block 1 to test for minix and ext2 superblock + */ + diff --git a/packages/linux/linux-openmoko/0003-squashfs-force-O2.patch b/packages/linux/linux-openmoko/0003-squashfs-force-O2.patch new file mode 100644 index 0000000000..550077b9fa --- /dev/null +++ b/packages/linux/linux-openmoko/0003-squashfs-force-O2.patch @@ -0,0 +1,17 @@ +The kernel patch from the squashfs-3.1r2 release did not compile on my +armeb-linux-gcc 4.1.1 when optimizing for size (-Os). This works around +that problem by using optimization flag -O2 instead for these two files. + +Signed-off-by: Leon Woestenberg <leonw@mailcan.com> + +Index: linux-2.6.19/fs/squashfs/Makefile +=================================================================== +--- linux-2.6.19.orig/fs/squashfs/Makefile ++++ linux-2.6.19/fs/squashfs/Makefile +@@ -5,3 +5,6 @@ + obj-$(CONFIG_SQUASHFS) += squashfs.o + squashfs-y += inode.o + squashfs-y += squashfs2_0.o ++ ++CFLAGS_squashfs2_0.o = "-O2" ++CFLAGS_inode.o = "-O2" diff --git a/packages/linux/linux-openmoko/0004-squashfs-Kconfig.patch b/packages/linux/linux-openmoko/0004-squashfs-Kconfig.patch new file mode 100644 index 0000000000..f2b3db9942 --- /dev/null +++ b/packages/linux/linux-openmoko/0004-squashfs-Kconfig.patch @@ -0,0 +1,61 @@ +diff -urN linux-2.6.23/fs/Kconfig linux-2.6.23.sqlzma-ng/fs/Kconfig +--- linux-2.6.23/fs/Kconfig 2007-10-09 16:31:38.000000000 -0400 ++++ linux-2.6.23.sqlzma-ng/fs/Kconfig 2007-11-13 18:58:41.000000000 -0500 +@@ -1364,6 +1364,56 @@ + + If unsure, say N. + ++config SQUASHFS ++ tristate "SquashFS 3.3 - Squashed file system support" ++ select ZLIB_INFLATE ++ help ++ Saying Y here includes support for SquashFS 3.3 (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 1 Mbytes (default ++ block size 128K). SquashFS 3.3 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 option for memory-constrained systems" ++ depends on SQUASHFS ++ default n ++ help ++ Saying Y here allows you to specify cache size. ++ ++ 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 VXFS_FS + tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)" + depends on BLOCK + diff --git a/packages/linux/linux-openmoko/0005-squashfs-Makefile.patch b/packages/linux/linux-openmoko/0005-squashfs-Makefile.patch new file mode 100644 index 0000000000..b0ec4cebb8 --- /dev/null +++ b/packages/linux/linux-openmoko/0005-squashfs-Makefile.patch @@ -0,0 +1,12 @@ +diff -urN linux-2.6.24/fs/Makefile linux-2.6.24.sqlzma-ng/fs/Makefile +--- linux-2.6.24/fs/Makefile 2007-11-13 21:24:14.000000000 -0500 ++++ linux-2.6.24.sqlzma-ng/fs/Makefile 2007-11-13 21:19:15.000000000 -0500 +@@ -72,6 +72,7 @@ + obj-$(CONFIG_JBD2) += jbd2/ + obj-$(CONFIG_EXT2_FS) += ext2/ + obj-$(CONFIG_CRAMFS) += cramfs/ ++obj-$(CONFIG_SQUASHFS) += squashfs/ + obj-y += ramfs/ + obj-$(CONFIG_HUGETLBFS) += hugetlbfs/ + obj-$(CONFIG_CODA_FS) += coda/ + diff --git a/packages/linux/linux-openmoko_2.6.24+git.bb b/packages/linux/linux-openmoko_2.6.24+git.bb index 46f80898bf..b1faefbd20 100644 --- a/packages/linux/linux-openmoko_2.6.24+git.bb +++ b/packages/linux/linux-openmoko_2.6.24+git.bb @@ -6,12 +6,18 @@ DESCRIPTION = "Linux 2.6.x (development) kernel for FIC SmartPhones shipping w/ PV = "${KERNEL_RELEASE}+gitr${SRCREV}" PR = "r0" -SRC_URI = "git://git.openmoko.org/git/kernel.git;protocol=git;branch=stable" +SRC_URI = "git://git.openmoko.org/git/kernel.git;protocol=git;branch=stable \ + file://0001-squashfs-with-lzma.patch;patch=1 \ + file://0002-squashfs-initrd.patch;patch=1 \ + file://0003-squashfs-force-O2.patch;patch=1 \ + file://0004-squashfs-Kconfig.patch;patch=1 \ + file://0005-squashfs-Makefile.patch;patch=1" S = "${WORKDIR}/git" do_configure_prepend() { cp -f ${S}/defconfig-${CONFIG_NAME} ${WORKDIR}/defconfig + echo CONFIG_SQUASHFS=m >>${WORKDIR}/defconfig } ############################################################## diff --git a/packages/linux/linux-rp-2.6.26/zaurus-i2c-init.patch b/packages/linux/linux-rp-2.6.26/zaurus-i2c-init.patch new file mode 100644 index 0000000000..40214e42b0 --- /dev/null +++ b/packages/linux/linux-rp-2.6.26/zaurus-i2c-init.patch @@ -0,0 +1,68 @@ +Typo in poodle chunk fixed: set_pxa_i2c_info->pxa_set_i2c_info. + +From: Mark Brown <broonie@opensource.wolfsonmicro.com> +To: Richard Purdie <rpurdie@rpsys.net> +Date: Wed, 16 Jul 2008 23:19:36 +0100 +Message-Id: <1216246776-4500-1-git-send-email-broonie@opensource.wolfsonmicro.com> +List-Id: ARM Linux kernel discussions + <linux-arm-kernel.lists.arm.linux.org.uk> + +Both spitz and poodle have audio codecs on their primary I2C bus so need +to call pxa_set_i2c_info() to set it up during init. Tested on spitz by +Stanislav. + +Reported-by: Stanislav Brabec <utx@penguin.cz> +Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> +--- + arch/arm/mach-pxa/poodle.c | 2 ++ + arch/arm/mach-pxa/spitz.c | 2 ++ + 2 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c +index 39612cf..510018b 100644 +--- a/arch/arm/mach-pxa/poodle.c ++++ b/arch/arm/mach-pxa/poodle.c +@@ -36,6 +36,7 @@ + #include <asm/arch/pxa2xx-gpio.h> + #include <asm/arch/mmc.h> + #include <asm/arch/udc.h> ++#include <asm/arch/i2c.h> + #include <asm/arch/irda.h> + #include <asm/arch/poodle.h> + #include <asm/arch/pxafb.h> +@@ -387,6 +388,7 @@ static void __init poodle_init(void) + pxa_set_udc_info(&udc_info); + pxa_set_mci_info(&poodle_mci_platform_data); + pxa_set_ficp_info(&poodle_ficp_platform_data); ++ pxa_set_i2c_info(NULL); + + platform_scoop_config = &poodle_pcmcia_config; + +diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c +index 35616a5..e2bde09 100644 +--- a/arch/arm/mach-pxa/spitz.c ++++ b/arch/arm/mach-pxa/spitz.c +@@ -38,6 +38,7 @@ + #include <asm/arch/pxa-regs.h> + #include <asm/arch/pxa2xx-regs.h> + #include <asm/arch/pxa2xx-gpio.h> ++#include <asm/arch/i2c.h> + #include <asm/arch/irda.h> + #include <asm/arch/mmc.h> + #include <asm/arch/ohci.h> +@@ -572,6 +573,7 @@ static void __init common_init(void) + pxa_set_ficp_info(&spitz_ficp_platform_data); + set_pxa_fb_parent(&spitzssp_device.dev); + set_pxa_fb_info(&spitz_pxafb_info); ++ pxa_set_i2c_info(NULL); + } + + #if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI) +-- +1.5.6.2 + + +------------------------------------------------------------------- +List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel +FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php +Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php diff --git a/packages/linux/linux-rp_2.6.26.bb b/packages/linux/linux-rp_2.6.26.bb index b2d378dd8e..74ed5920e8 100644 --- a/packages/linux/linux-rp_2.6.26.bb +++ b/packages/linux/linux-rp_2.6.26.bb @@ -1,6 +1,6 @@ require linux-rp.inc -PR = "r0" +PR = "r1" DEFAULT_PREFERENCE = "-1" DEFAULT_PREFERENCE_qemuarm = "-1" @@ -35,6 +35,7 @@ SRC_URI = "${KERNELORG_MIRROR}pub/linux/kernel/v2.6/linux-2.6.26.tar.bz2 \ ${RPSRC}/poodle_pm-r6.patch;patch=1 \ ${RPSRC}/poodle_lcd_hack-r0.patch;patch=1 \ ${RPSRC}/poodle_asoc_fix-r1.patch;patch=1 \ + file://zaurus-i2c-init.patch;patch=1;status=upstream \ ${RPSRC}/logo_oh-r1.patch.bz2;patch=1;status=unmergable \ ${RPSRC}/pxa-linking-bug.patch;patch=1;status=unmergable \ file://hostap-monitor-mode.patch;patch=1;status=unmergable \ diff --git a/packages/freesmartphone/python-oeventd/.mtn2git_empty b/packages/openmoko-3rdparty/.mtn2git_empty index e69de29bb2..e69de29bb2 100644 --- a/packages/freesmartphone/python-oeventd/.mtn2git_empty +++ b/packages/openmoko-3rdparty/.mtn2git_empty diff --git a/packages/openmoko-apps/omext_0.2.bb b/packages/openmoko-3rdparty/omext_0.2.bb index 203b84e3df..203b84e3df 100644 --- a/packages/openmoko-apps/omext_0.2.bb +++ b/packages/openmoko-3rdparty/omext_0.2.bb diff --git a/packages/openmoko-apps/openmoko-gps_0.0.1+svnr9.bb b/packages/openmoko-3rdparty/openmoko-gps_0.0.1+svnr9.bb index 71a9f3cdb6..71a9f3cdb6 100644 --- a/packages/openmoko-apps/openmoko-gps_0.0.1+svnr9.bb +++ b/packages/openmoko-3rdparty/openmoko-gps_0.0.1+svnr9.bb diff --git a/packages/openmoko2/settingsgui_0.7+0.8-beta.bb b/packages/openmoko-3rdparty/settingsgui_0.7+0.8-beta.bb index f0d6f84ce6..f0d6f84ce6 100644 --- a/packages/openmoko2/settingsgui_0.7+0.8-beta.bb +++ b/packages/openmoko-3rdparty/settingsgui_0.7+0.8-beta.bb diff --git a/packages/openmoko-apps/.mtn2git_empty b/packages/openmoko-apps/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 --- a/packages/openmoko-apps/.mtn2git_empty +++ /dev/null diff --git a/packages/openmoko-apps/files/.mtn2git_empty b/packages/openmoko-apps/files/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 --- a/packages/openmoko-apps/files/.mtn2git_empty +++ /dev/null diff --git a/packages/openmoko-apps/files/unbreak-messages.patch b/packages/openmoko-apps/files/unbreak-messages.patch deleted file mode 100644 index c8d3413c0b..0000000000 --- a/packages/openmoko-apps/files/unbreak-messages.patch +++ /dev/null @@ -1,29 +0,0 @@ -Index: sms-membership-window.c -=================================================================== ---- sms-membership-window.c (wersja 1565) -+++ openmoko-messages/src/sms-membership-window.c (kopia robocza) -@@ -36,9 +36,6 @@ - #define SMS_MEMBERSHIP_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SMS_TYPE_MEMBERSHIP_WINDOW, SmsMembershipWindowPrivate))
-
- typedef struct _SmsMembershipWindowPrivate SmsMembershipWindowPrivate;
--typedef gboolean (*GtkTreeModelFilterVisibleFunc) (GtkTreeModel *model,
-- GtkTreeIter *iter,
-- gpointer data);
-
- struct _SmsMembershipWindowPrivate
- {
-Index: main.c -=================================================================== ---- main.c (wersja 1565) -+++ openmoko-messages/src/main.c (kopia robocza) -@@ -41,10 +41,6 @@ - - #include <gtk/gtk.h> - --typedef gboolean (*GtkTreeModelFilterVisibleFunc) (GtkTreeModel *model, -- GtkTreeIter *iter, -- gpointer data); -- - gboolean init_dbus (MessengerData* d) - { - DBusError error; diff --git a/packages/openmoko-apps/openmoko-appmanager_svn.bb b/packages/openmoko-apps/openmoko-appmanager_svn.bb deleted file mode 100644 index 7acc872bc1..0000000000 --- a/packages/openmoko-apps/openmoko-appmanager_svn.bb +++ /dev/null @@ -1,7 +0,0 @@ -DESCRIPTION = "The Openmoko Application Manager" -SECTION = "openmoko/applications" -DEPENDS += "ipkg" -PV = "0.0.1+svnr${SRCREV}" - -inherit openmoko - diff --git a/packages/openmoko-apps/openmoko-calculator_svn.bb b/packages/openmoko-apps/openmoko-calculator_svn.bb deleted file mode 100644 index 39c180cc05..0000000000 --- a/packages/openmoko-apps/openmoko-calculator_svn.bb +++ /dev/null @@ -1,9 +0,0 @@ -DESCRIPTION = "The Openmoko Calculator Application" -SECTION = "openmoko/applications" -AUTHOR = "Rodolphe Ortalo <rodolphe.ortalo@free.fr>" - -PV = "0.0.3+svnr${SRCREV}" -PR = "r0" - -inherit openmoko - diff --git a/packages/openmoko-apps/openmoko-dialer_svn.bb b/packages/openmoko-apps/openmoko-dialer_svn.bb deleted file mode 100644 index 8a0f3fd999..0000000000 --- a/packages/openmoko-apps/openmoko-dialer_svn.bb +++ /dev/null @@ -1,9 +0,0 @@ -DESCRIPTION = "The Openmoko Dialer" -SECTION = "openmoko/applications" -PV = "0.0.1+svnr${SRCREV}" - -inherit openmoko - -DEPENDS += " eds-dbus libgsmd" - - diff --git a/packages/openmoko-apps/openmoko-footer_svn.bb b/packages/openmoko-apps/openmoko-footer_svn.bb deleted file mode 100644 index 83ab7ab045..0000000000 --- a/packages/openmoko-apps/openmoko-footer_svn.bb +++ /dev/null @@ -1,6 +0,0 @@ -DESCRIPTION = "The Openmoko Footer" -SECTION = "openmoko/applications" -PV = "0.0.1+svnr${SRCREV}" - -inherit openmoko - diff --git a/packages/openmoko-apps/openmoko-messages_svn.bb b/packages/openmoko-apps/openmoko-messages_svn.bb deleted file mode 100644 index a79353b603..0000000000 --- a/packages/openmoko-apps/openmoko-messages_svn.bb +++ /dev/null @@ -1,7 +0,0 @@ -DESCRIPTION = "The Openmoko Messaging Application" -SECTION = "openmoko/applications" - -PV = "0.0.1+svnr${SRCREV}" -PR = "r2" - -inherit openmoko diff --git a/packages/openmoko-apps/openmoko-simplemediaplayer_svn.bb b/packages/openmoko-apps/openmoko-simplemediaplayer_svn.bb deleted file mode 100644 index c90d35e3d5..0000000000 --- a/packages/openmoko-apps/openmoko-simplemediaplayer_svn.bb +++ /dev/null @@ -1,19 +0,0 @@ -DESCRIPTION = "The Openmoko Media Player" -SECTION = "openmoko/applications" -DEPENDS += "alsa-lib dbus-glib id3lib libvorbis" -PV = "0.0.1+svnr${SRCREV}" -PR = "r1" - -inherit openmoko - -PARALLEL_MAKE ="" - -do_install_prepend() { - touch mkinstalldirs -} - - -FILES_${PN} += " \ - ${datadir}/images \ - ${libdir}/bmp/*/*.so \ - " diff --git a/packages/openmoko-apps/openmoko-taskmanager_svn.bb b/packages/openmoko-apps/openmoko-taskmanager_svn.bb deleted file mode 100644 index e7725bee44..0000000000 --- a/packages/openmoko-apps/openmoko-taskmanager_svn.bb +++ /dev/null @@ -1,6 +0,0 @@ -DESCRIPTION = "The Openmoko Task Manager" -SECTION = "openmoko/applications" -PV = "0.0.1+svnr${SRCREV}" - -inherit openmoko - diff --git a/packages/openmoko-apps/openmoko-terminal/.mtn2git_empty b/packages/openmoko-apps/openmoko-terminal/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 --- a/packages/openmoko-apps/openmoko-terminal/.mtn2git_empty +++ /dev/null diff --git a/packages/openmoko-apps/openmoko-terminal/gtkterm2rc b/packages/openmoko-apps/openmoko-terminal/gtkterm2rc deleted file mode 100644 index d68f01ab57..0000000000 --- a/packages/openmoko-apps/openmoko-terminal/gtkterm2rc +++ /dev/null @@ -1,85 +0,0 @@ -## -# 1=RIGHT, 2=TOP, 3=BOTTOM, 4=LEFT -## -notebookPanel=3 - -## -# 0=HIDDEN, 1=LEFT, 2=RIGHT -## -terminalScrollbar=2 - -## -# 0=NO SCROLLBAR -## -maxScrollbackBuffer=999 - -## -# 0=FALSE, 1=TRUE -## -quitPRGonExitLastTerminal=1 - -## -# 0=FALSE, 1=TRUE -## -showTabsByOneTerminal=0 - -## -#A Font name: use gnome-font-properties to look at available fonts -## -terminalFont=BitStream Vera Sans Mono 11 - -## -# Separator for marking with mouse -## -worldClass=-A-Za-z0-9/_:.,?+%= - -## -# 0=FALSE, 1=TRUE -## -scrollOnKeyStroke=1 - -## -# 0=FALSE, 1=TRUE -## -scrollOnOutput=0 - -## -# 0=FALSE, 1=TRUE -## -blink=1 - -## -# 0=FALSE, 1=TRUE -## -beep=1 - -## -# x y Default Terminal Size in pix -## -terminalSize=80 25 - -## -# NEW COLOR Definition -## -red=0x0000 0xcccc 0x0000 0xaaaa 0x0000 0xaaaa 0x6666 0xaaaa 0x0000 0xcccc 0x5555 0xffff 0x5555 0xffff 0x5555 0xffff 0x5555 0xffff -grn=0x0000 0xcccc 0x0000 0x0000 0xaaaa 0x5555 0x6666 0x0000 0xaaaa 0xcccc 0x5555 0x5555 0xffff 0xffff 0x5555 0x5555 0xffff 0xffff -blu=0x0000 0xcccc 0x0000 0x0000 0x0000 0x0000 0xffff 0xaaaa 0xaaaa 0xcccc 0x5555 0x5555 0x5555 0x5555 0xffff 0xffff 0xffff 0xffff - -## -# COLOR Definition -## - -## -# First section -## -[section] -match= -worldClass=-A-Za-z0-9/_:.,?+%= -scrollOnKeyStroke=1 -scrollOnOutput=0 -beep=1 -blink=1 -red=0x0000 0xcccc 0x0000 0xaaaa 0x0000 0xaaaa 0x6666 0xaaaa 0x0000 0x0000 0x5555 0xffff 0x5555 0xffff 0x5555 0xffff 0x5555 0xffff -grn=0x0000 0xcccc 0x0000 0x0000 0xaaaa 0x5555 0x6666 0x0000 0xaaaa 0xcccc 0x5555 0x5555 0xffff 0xffff 0x5555 0x5555 0xffff 0xffff -blu=0x0000 0xcccc 0x0000 0x0000 0x0000 0x0000 0xffff 0xaaaa 0xaaaa 0x0000 0x5555 0x5555 0x5555 0x5555 0xffff 0xffff 0xffff 0xffff - diff --git a/packages/openmoko-apps/openmoko-terminal/openmoko-terminal.desktop b/packages/openmoko-apps/openmoko-terminal/openmoko-terminal.desktop deleted file mode 100644 index ced7c0b8e2..0000000000 --- a/packages/openmoko-apps/openmoko-terminal/openmoko-terminal.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Terminal -Comment=Command Line Interface Terminal -Exec=gtkterm2 -Icon=openmoko-terminal -Terminal=false -Type=Application -Categories=GTK;Application;PIM;Office -MimeType=text/x-vcard; -SingleInstance=false -StartupNotify=true diff --git a/packages/openmoko-apps/openmoko-terminal/openmoko-terminal.png b/packages/openmoko-apps/openmoko-terminal/openmoko-terminal.png Binary files differdeleted file mode 100644 index 56e8e59628..0000000000 --- a/packages/openmoko-apps/openmoko-terminal/openmoko-terminal.png +++ /dev/null diff --git a/packages/openmoko-apps/openmoko-terminal_svn.bb b/packages/openmoko-apps/openmoko-terminal_svn.bb deleted file mode 100644 index 1a33b03598..0000000000 --- a/packages/openmoko-apps/openmoko-terminal_svn.bb +++ /dev/null @@ -1,34 +0,0 @@ -DESCRIPTION = "The Openmoko Command Line Console" -SECTION = "openmoko/applications" -RDEPENDS += "gtkterm2" -PV = "1.0.0" -PR = "r1" - -inherit openmoko - -SRC_URI = "file://openmoko-terminal.png \ - file://openmoko-terminal.desktop \ - file://gtkterm2rc" - -do_install() { - install -d ${D}${sysconfdir}/skel - install -d ${D}${datadir}/pixmaps - install -d ${D}${datadir}/applications - install -m 0644 ${WORKDIR}/openmoko-terminal.png ${D}${datadir}/pixmaps/ - install -m 0644 ${WORKDIR}/openmoko-terminal.desktop ${D}${datadir}/applications/ - install -m 0644 ${WORKDIR}/gtkterm2rc ${D}${sysconfdir}/skel/.gtkterm2rc -} - -pkg_postinst_openmoko-terminal() { -#!/bin/sh -e -if [ "x$D" != "x" ]; then - exit 1 # don't run at image generation time -else - if [ -e "$HOME/.gtkterm2rc" ]; then - echo "not overriding $HOME/.gtkterm2rc" - else - echo "installing $HOME/.gtkterm2rc from /etc/skel" - cp -f ${sysconfdir}/skel/.gtkterm2rc $HOME/ - fi -fi -} diff --git a/packages/openmoko-inputmethods/.mtn2git_empty b/packages/openmoko-inputmethods/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 --- a/packages/openmoko-inputmethods/.mtn2git_empty +++ /dev/null diff --git a/packages/openmoko-inputmethods/openmoko-keyboard_svn.bb b/packages/openmoko-inputmethods/openmoko-keyboard_svn.bb deleted file mode 100644 index e5dc9264d0..0000000000 --- a/packages/openmoko-inputmethods/openmoko-keyboard_svn.bb +++ /dev/null @@ -1,20 +0,0 @@ -DESCRIPTION = "Matchbox virtual keyboard for X11 - Openmoko fork" -LICENSE = "GPL" -DEPENDS = "libfakekey expat libxft" -SECTION = "openmoko/inputmethods" -PV = "0.0+svnr${SRCREV}" -PR = "r1" - -inherit openmoko autotools pkgconfig gettext - -SRC_URI = "${OPENMOKO_MIRROR}/src/target/${OPENMOKO_RELEASE}/inputmethods;module=${PN};proto=http" - -S = "${WORKDIR}/${PN}" - -EXTRA_OECONF = "--disable-cairo" - -FILES_${PN} = "${bindir}/* \ - ${datadir}/applications \ - ${datadir}/pixmaps \ - ${datadir}/openmoko-keyboard" - diff --git a/packages/openmoko-panel-plugins/openmoko-panel-gsm_svn.bb b/packages/openmoko-panel-plugins/openmoko-panel-gsm_svn.bb index d90c6a4de7..e8a5bc877d 100644 --- a/packages/openmoko-panel-plugins/openmoko-panel-gsm_svn.bb +++ b/packages/openmoko-panel-plugins/openmoko-panel-gsm_svn.bb @@ -1,6 +1,6 @@ DESCRIPTION = "Shows the GSM / GPRS status in the Openmoko panel" -DEPENDS = "libgsmd libnotify" +DEPENDS = "libmokogsmd2 libnotify" PV = "0.1.0+svn${SVNREV}" -PR = "r1" +PR = "r2" inherit openmoko-panel-plugin diff --git a/packages/openmoko-pim/.mtn2git_empty b/packages/openmoko-pim/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 --- a/packages/openmoko-pim/.mtn2git_empty +++ /dev/null diff --git a/packages/openmoko-pim/files/.mtn2git_empty b/packages/openmoko-pim/files/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 --- a/packages/openmoko-pim/files/.mtn2git_empty +++ /dev/null diff --git a/packages/openmoko-pim/files/index.theme b/packages/openmoko-pim/files/index.theme deleted file mode 100644 index 4e9cf67820..0000000000 --- a/packages/openmoko-pim/files/index.theme +++ /dev/null @@ -1,654 +0,0 @@ -[Icon Theme] -Name=Hicolor -Comment=Fallback icon theme -Hidden=true -Directories=192x192/apps,128x128/actions,128x128/apps,128x128/devices,128x128/filesystems,128x128/mimetypes,96x96/actions,96x96/apps,96x96/devices,96x96/filesystems,96x96/mimetypes,72x72/apps,64x64/actions,64x64/apps,64x64/devices,64x64/filesystems,64x64/mimetypes,48x48/actions,48x48/apps,48x48/devices,48x48/filesystems,48x48/mimetypes,36x36/apps,32x32/actions,32x32/apps,32x32/devices,32x32/filesystems,32x32/mimetypes,22x22/actions,22x22/apps,22x22/devices,22x22/filesystems,22x22/mimetypes,16x16/actions,16x16/apps,16x16/devices,16x16/filesystems,16x16/mimetypes,scalable/actions,scalable/apps,scalable/devices,scalable/filesystems,scalable/mimetypes,16x16/stock/chart,16x16/stock/code,16x16/stock/data,16x16/stock/document,16x16/stock/form,16x16/stock/generic,16x16/stock/image,16x16/stock/io,16x16/stock/media,16x16/stock/navigation,16x16/stock/net,16x16/stock/object,16x16/stock/table,16x16/stock/text,24x24/actions,24x24/apps,24x24/devices,24x24/filesystems,24x24/mimetypes,24x24/stock/chart,24x24/stock/code,24x24/stock/data,24x24/stock/document,24x24/stock/form,24x24/stock/generic,24x24/stock/image,24x24/stock/io,24x24/stock/media,24x24/stock/navigation,24x24/stock/net,24x24/stock/object,24x24/stock/table,24x24/stock/text,32x32/stock/chart,32x32/stock/code,32x32/stock/data,32x32/stock/document,32x32/stock/form,32x32/stock/generic,32x32/stock/image,32x32/stock/io,32x32/stock/media,32x32/stock/navigation,32x32/stock/net,32x32/stock/object,32x32/stock/table,32x32/stock/text,36x36/stock/chart,36x36/stock/code,36x36/stock/data,36x36/stock/document,36x36/stock/form,36x36/stock/generic,36x36/stock/image,36x36/stock/io,36x36/stock/media,36x36/stock/navigation,36x36/stock/net,36x36/stock/object,36x36/stock/table,36x36/stock/text,48x48/stock/chart,48x48/stock/code,48x48/stock/data,48x48/stock/document,48x48/stock/form,48x48/stock/generic,48x48/stock/image,48x48/stock/io,48x48/stock/media,48x48/stock/navigation,48x48/stock/net,48x48/stock/object,48x48/stock/table,48x48/stock/text,scalable/emblems,192x192/emblems,96x96/emblems,72x72/emblems,48x48/emblems,36x36/emblems,24x24/emblems,16x16/emblems,12x12/emblems - -[16x16/actions] -Size=16 -Context=Actions -Type=Threshold - -[16x16/apps] -Size=16 -Context=Applications -Type=Threshold - -[16x16/devices] -Size=16 -Context=Devices -Type=Threshold - -[16x16/filesystems] -Size=16 -Context=FileSystems -Type=Threshold - -[16x16/mimetypes] -Size=16 -Context=MimeTypes -Type=Threshold - -[22x22/actions] -Size=22 -Context=Actions -Type=Threshold - -[22x22/apps] -Size=22 -Context=Applications -Type=Threshold - -[22x22/devices] -Size=22 -Context=Devices -Type=Threshold - -[22x22/filesystems] -Size=22 -Context=FileSystems -Type=Threshold - -[22x22/mimetypes] -Size=22 -Context=MimeTypes -Type=Threshold - -[24x24/actions] -Size=24 -Context=Actions -Type=Threshold - -[24x24/apps] -Size=24 -Context=Applications -Type=Threshold - -[24x24/devices] -Size=24 -Context=Devices -Type=Threshold - -[24x24/filesystems] -Size=24 -Context=FileSystems -Type=Threshold - -[24x24/mimetypes] -Size=24 -Context=MimeTypes -Type=Threshold - -[32x32/actions] -Size=32 -Context=Actions -Type=Threshold - -[32x32/apps] -Size=32 -Context=Applications -Type=Threshold - -[32x32/devices] -Size=32 -Context=Devices -Type=Threshold - -[32x32/filesystems] -Size=32 -Context=FileSystems -Type=Threshold - -[32x32/mimetypes] -Size=32 -Context=MimeTypes -Type=Threshold - -[36x36/apps] -Size=36 -Context=Applications -Type=Threshold - -[48x48/actions] -Size=48 -Context=Actions -Type=Threshold - -[48x48/apps] -Size=48 -Context=Applications -Type=Threshold - -[48x48/devices] -Size=48 -Context=Devices -Type=Threshold - -[48x48/filesystems] -Size=48 -Context=FileSystems -Type=Threshold - -[48x48/mimetypes] -Size=48 -Context=MimeTypes -Type=Threshold - -[64x64/actions] -Size=64 -Context=Actions -Type=Threshold - -[64x64/apps] -Size=64 -Context=Applications -Type=Threshold - -[64x64/devices] -Size=64 -Context=Devices -Type=Threshold - -[64x64/filesystems] -Size=64 -Context=FileSystems -Type=Threshold - -[64x64/mimetypes] -Size=64 -Context=MimeTypes -Type=Threshold - -[72x72/apps] -Size=72 -Context=Applications -Type=Threshold - -[96x96/actions] -Size=96 -Context=Actions -Type=Threshold - -[96x96/apps] -Size=96 -Context=Applications -Type=Threshold - -[96x96/devices] -Size=96 -Context=Devices -Type=Threshold - -[96x96/filesystems] -Size=96 -Context=FileSystems -Type=Threshold - -[96x96/mimetypes] -Size=96 -Context=MimeTypes -Type=Threshold - -[128x128/actions] -Size=128 -Context=Actions -Type=Threshold - -[128x128/apps] -Size=128 -Context=Applications -Type=Threshold - -[128x128/devices] -Size=128 -Context=Devices -Type=Threshold - -[128x128/filesystems] -Size=128 -Context=FileSystems -Type=Threshold - -[128x128/mimetypes] -Size=128 -Context=MimeTypes -Type=Threshold - -[192x192/apps] -Size=192 -Context=Applications -Type=Threshold - - -[scalable/actions] -MinSize=1 -Size=128 -MaxSize=256 -Context=Actions -Type=Scalable - -[scalable/apps] -MinSize=1 -Size=128 -MaxSize=256 -Context=Applications -Type=Scalable - -[scalable/devices] -MinSize=1 -Size=128 -MaxSize=256 -Context=Devices -Type=Scalable - -[scalable/filesystems] -MinSize=1 -Size=128 -MaxSize=256 -Context=FileSystems -Type=Scalable - -[scalable/mimetypes] -MinSize=1 -Size=128 -MaxSize=256 -Context=MimeTypes -Type=Scalable - -[16x16/stock/chart] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/code] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/data] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/document] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/form] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/generic] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/image] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/io] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/media] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/navigation] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/net] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/object] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/table] -Size=16 -Context=Stock -Type=Threshold - -[16x16/stock/text] -Size=16 -Context=Stock -Type=Threshold - -[24x24/stock/chart] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/code] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/data] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/document] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/form] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/generic] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/image] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/io] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/media] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/navigation] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/net] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/object] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/table] -Size=24 -Context=Stock -Type=Threshold - -[24x24/stock/text] -Size=24 -Context=Stock -Type=Threshold - -[32x32/stock/chart] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/code] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/data] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/document] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/form] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/generic] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/image] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/io] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/media] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/navigation] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/net] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/object] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/table] -Size=32 -Context=Stock -Type=Threshold - -[32x32/stock/text] -Size=32 -Context=Stock -Type=Threshold - -[36x36/stock/chart] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/code] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/data] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/document] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/form] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/generic] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/image] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/io] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/media] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/navigation] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/net] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/object] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/table] -Size=36 -Context=Stock -Type=Threshold - -[36x36/stock/text] -Size=36 -Context=Stock -Type=Threshold - -[48x48/stock/chart] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/code] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/data] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/document] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/form] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/generic] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/image] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/io] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/media] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/navigation] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/net] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/object] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/table] -Size=48 -Context=Stock -Type=Threshold - -[48x48/stock/text] -Size=48 -Context=Stock -Type=Threshold - -[scalable/emblems] -MinSize=1 -Size=128 -MaxSize=256 -Context=Emblems -Type=Scalable - -[192x192/emblems] -Size=192 -Context=Emblems -Type=Threshold - -[96x96/emblems] -Size=96 -Context=Emblems -Type=Threshold - -[72x72/emblems] -Size=72 -Context=Emblems -Type=Threshold - -[48x48/emblems] -Size=48 -Context=Emblems -Type=Threshold - -[36x36/emblems] -Size=36 -Context=Emblems -Type=Threshold - -[24x24/emblems] -Size=24 -Context=Emblems -Type=Threshold - -[16x16/emblems] -Size=16 -Context=Emblems -Type=Threshold - -[12x12/emblems] -Size=12 -Context=Emblems -Type=Threshold - diff --git a/packages/openmoko-pim/files/intltool-update.in b/packages/openmoko-pim/files/intltool-update.in deleted file mode 100644 index 0342a2740c..0000000000 --- a/packages/openmoko-pim/files/intltool-update.in +++ /dev/null @@ -1,1089 +0,0 @@ -#!@INTLTOOL_PERL@ -# -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*- - -# -# The Intltool Message Updater -# -# Copyright (C) 2000-2003 Free Software Foundation. -# -# Intltool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# version 2 published by the Free Software Foundation. -# -# Intltool 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, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. -# -# Authors: Kenneth Christiansen <kenneth@gnu.org> -# Maciej Stachowiak -# Darin Adler <darin@bentspoon.com> - -## Release information -my $PROGRAM = "intltool-update"; -my $VERSION = "0.35.0"; -my $PACKAGE = "intltool"; - -## Loaded modules -use strict; -use Getopt::Long; -use Cwd; -use File::Copy; -use File::Find; - -## Scalars used by the option stuff -my $HELP_ARG = 0; -my $VERSION_ARG = 0; -my $DIST_ARG = 0; -my $POT_ARG = 0; -my $HEADERS_ARG = 0; -my $MAINTAIN_ARG = 0; -my $REPORT_ARG = 0; -my $VERBOSE = 0; -my $GETTEXT_PACKAGE = ""; -my $OUTPUT_FILE = ""; - -my @languages; -my %varhash = (); -my %po_files_by_lang = (); - -# Regular expressions to categorize file types. -# FIXME: Please check if the following is correct - -my $xml_support = -"xml(?:\\.in)*|". # http://www.w3.org/XML/ (Note: .in is not required) -"ui|". # Bonobo specific - User Interface desc. files -"lang|". # ? -"glade2?(?:\\.in)*|". # Glade specific - User Interface desc. files (Note: .in is not required) -"scm(?:\\.in)*|". # ? (Note: .in is not required) -"oaf(?:\\.in)+|". # DEPRECATED: Replaces by Bonobo .server files -"etspec|". # ? -"server(?:\\.in)+|". # Bonobo specific -"sheet(?:\\.in)+|". # ? -"schemas(?:\\.in)+|". # GConf specific -"pong(?:\\.in)+|". # DEPRECATED: PONG is not used [by GNOME] any longer. -"kbd(?:\\.in)+"; # GOK specific. - -my $ini_support = -"icon(?:\\.in)+|". # http://www.freedesktop.org/Standards/icon-theme-spec -"desktop(?:\\.in)+|". # http://www.freedesktop.org/Standards/menu-spec -"caves(?:\\.in)+|". # GNOME Games specific -"directory(?:\\.in)+|". # http://www.freedesktop.org/Standards/menu-spec -"soundlist(?:\\.in)+|". # GNOME specific -"keys(?:\\.in)+|". # GNOME Mime database specific -"theme(?:\\.in)+|". # http://www.freedesktop.org/Standards/icon-theme-spec -"service(?:\\.in)+"; # DBus specific - -my $buildin_gettext_support = -"c|y|cs|cc|cpp|c\\+\\+|h|hh|gob|py"; - -## Always flush buffer when printing -$| = 1; - -## Sometimes the source tree will be rooted somewhere else. -my $SRCDIR = "."; -my $POTFILES_in; - -$SRCDIR = $ENV{"srcdir"} if $ENV{"srcdir"}; -$POTFILES_in = "<$SRCDIR/POTFILES.in"; - -my $devnull = ($^O eq 'MSWin32' ? 'NUL:' : '/dev/null'); - -## Handle options -GetOptions -( - "help" => \$HELP_ARG, - "version" => \$VERSION_ARG, - "dist|d" => \$DIST_ARG, - "pot|p" => \$POT_ARG, - "headers|s" => \$HEADERS_ARG, - "maintain|m" => \$MAINTAIN_ARG, - "report|r" => \$REPORT_ARG, - "verbose|x" => \$VERBOSE, - "gettext-package|g=s" => \$GETTEXT_PACKAGE, - "output-file|o=s" => \$OUTPUT_FILE, - ) or &Console_WriteError_InvalidOption; - -&Console_Write_IntltoolHelp if $HELP_ARG; -&Console_Write_IntltoolVersion if $VERSION_ARG; - -my $arg_count = ($DIST_ARG > 0) - + ($POT_ARG > 0) - + ($HEADERS_ARG > 0) - + ($MAINTAIN_ARG > 0) - + ($REPORT_ARG > 0); - -&Console_Write_IntltoolHelp if $arg_count > 1; - -# --version and --help don't require a module name -my $MODULE = $GETTEXT_PACKAGE || &FindPackageName || "unknown"; - -if ($POT_ARG) -{ - &GenerateHeaders; - &GeneratePOTemplate; -} -elsif ($HEADERS_ARG) -{ - &GenerateHeaders; -} -elsif ($MAINTAIN_ARG) -{ - &FindLeftoutFiles; -} -elsif ($REPORT_ARG) -{ - &GenerateHeaders; - &GeneratePOTemplate; - &Console_Write_CoverageReport; -} -elsif ((defined $ARGV[0]) && $ARGV[0] =~ /^[a-z]/) -{ - my $lang = $ARGV[0]; - - ## Report error if the language file supplied - ## to the command line is non-existent - &Console_WriteError_NotExisting("$SRCDIR/$lang.po") - if ! -s "$SRCDIR/$lang.po"; - - if (!$DIST_ARG) - { - print "Working, please wait..." if $VERBOSE; - &GenerateHeaders; - &GeneratePOTemplate; - } - &POFile_Update ($lang, $OUTPUT_FILE); - &Console_Write_TranslationStatus ($lang, $OUTPUT_FILE); -} -else -{ - &Console_Write_IntltoolHelp; -} - -exit; - -######### - -sub Console_Write_IntltoolVersion -{ - print <<_EOF_; -${PROGRAM} (${PACKAGE}) $VERSION -Written by Kenneth Christiansen, Maciej Stachowiak, and Darin Adler. - -Copyright (C) 2000-2003 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -_EOF_ - exit; -} - -sub Console_Write_IntltoolHelp -{ - print <<_EOF_; -Usage: ${PROGRAM} [OPTION]... LANGCODE -Updates PO template files and merge them with the translations. - -Mode of operation (only one is allowed): - -p, --pot generate the PO template only - -s, --headers generate the header files in POTFILES.in - -m, --maintain search for left out files from POTFILES.in - -r, --report display a status report for the module - -d, --dist merge LANGCODE.po with existing PO template - -Extra options: - -g, --gettext-package=NAME override PO template name, useful with --pot - -o, --output-file=FILE write merged translation to FILE - -x, --verbose display lots of feedback - --help display this help and exit - --version output version information and exit - -Examples of use: -${PROGRAM} --pot just create a new PO template -${PROGRAM} xy create new PO template and merge xy.po with it - -Report bugs to http://bugzilla.gnome.org/ (product name "$PACKAGE") -or send email to <xml-i18n-tools\@gnome.org>. -_EOF_ - exit; -} - -sub echo_n -{ - my $str = shift; - my $ret = `echo "$str"`; - - $ret =~ s/\n$//; # do we need the "s" flag? - - return $ret; -} - -sub POFile_DetermineType ($) -{ - my $type = $_; - my $gettext_type; - - my $xml_regex = "(?:" . $xml_support . ")"; - my $ini_regex = "(?:" . $ini_support . ")"; - my $buildin_regex = "(?:" . $buildin_gettext_support . ")"; - - if ($type =~ /\[type: gettext\/([^\]].*)]/) - { - $gettext_type=$1; - } - elsif ($type =~ /schemas(\.in)+$/) - { - $gettext_type="schemas"; - } - elsif ($type =~ /glade2?(\.in)*$/) - { - $gettext_type="glade"; - } - elsif ($type =~ /scm(\.in)*$/) - { - $gettext_type="scheme"; - } - elsif ($type =~ /keys(\.in)+$/) - { - $gettext_type="keys"; - } - - # bucket types - - elsif ($type =~ /$xml_regex$/) - { - $gettext_type="xml"; - } - elsif ($type =~ /$ini_regex$/) - { - $gettext_type="ini"; - } - elsif ($type =~ /$buildin_regex$/) - { - $gettext_type="buildin"; - } - else - { - $gettext_type="unknown"; - } - - return "gettext\/$gettext_type"; -} - -sub TextFile_DetermineEncoding ($) -{ - my $gettext_code="ASCII"; # All files are ASCII by default - my $filetype=`file $_ | cut -d ' ' -f 2`; - - if ($? eq "0") - { - if ($filetype =~ /^(ISO|UTF)/) - { - chomp ($gettext_code = $filetype); - } - elsif ($filetype =~ /^XML/) - { - $gettext_code="UTF-8"; # We asume that .glade and other .xml files are UTF-8 - } - } - - return $gettext_code; -} - -sub isNotValidMissing -{ - my ($file) = @_; - - return if $file =~ /^\{arch\}\/.*$/; - return if $file =~ /^$varhash{"PACKAGE"}-$varhash{"VERSION"}\/.*$/; -} - -sub FindLeftoutFiles -{ - my (@buf_i18n_plain, - @buf_i18n_xml, - @buf_i18n_xml_unmarked, - @buf_i18n_ini, - @buf_potfiles, - @buf_potfiles_ignore, - @buf_allfiles, - @buf_allfiles_sorted, - @buf_potfiles_sorted - ); - - ## Search and find all translatable files - find sub { - push @buf_i18n_plain, "$File::Find::name" if /\.($buildin_gettext_support)$/; - push @buf_i18n_xml, "$File::Find::name" if /\.($xml_support)$/; - push @buf_i18n_ini, "$File::Find::name" if /\.($ini_support)$/; - push @buf_i18n_xml_unmarked, "$File::Find::name" if /\.(schemas(\.in)+)$/; - }, ".."; - - - open POTFILES, $POTFILES_in or die "$PROGRAM: there's no POTFILES.in!\n"; - @buf_potfiles = grep !/^(#|\s*$)/, <POTFILES>; - close POTFILES; - - foreach (@buf_potfiles) { - s/^\[.*]\s*//; - } - - print "Searching for missing translatable files...\n" if $VERBOSE; - - ## Check if we should ignore some found files, when - ## comparing with POTFILES.in - foreach my $ignore ("POTFILES.skip", "POTFILES.ignore") - { - (-s $ignore) or next; - - if ("$ignore" eq "POTFILES.ignore") - { - print "The usage of POTFILES.ignore is deprecated. Please consider moving the\n". - "content of this file to POTFILES.skip.\n"; - } - - print "Found $ignore: Ignoring files...\n" if $VERBOSE; - open FILE, "<$ignore" or die "ERROR: Failed to open $ignore!\n"; - - while (<FILE>) - { - push @buf_potfiles_ignore, $_ unless /^(#|\s*$)/; - } - close FILE; - - @buf_potfiles = (@buf_potfiles_ignore, @buf_potfiles); - } - - foreach my $file (@buf_i18n_plain) - { - my $in_comment = 0; - my $in_macro = 0; - - open FILE, "<$file"; - while (<FILE>) - { - # Handle continued multi-line comment. - if ($in_comment) - { - next unless s-.*\*/--; - $in_comment = 0; - } - - # Handle continued macro. - if ($in_macro) - { - $in_macro = 0 unless /\\$/; - next; - } - - # Handle start of macro (or any preprocessor directive). - if (/^\s*\#/) - { - $in_macro = 1 if /^([^\\]|\\.)*\\$/; - next; - } - - # Handle comments and quoted text. - while (m-(/\*|//|\'|\")-) # \' and \" keep emacs perl mode happy - { - my $match = $1; - if ($match eq "/*") - { - if (!s-/\*.*?\*/--) - { - s-/\*.*--; - $in_comment = 1; - } - } - elsif ($match eq "//") - { - s-//.*--; - } - else # ' or " - { - if (!s-$match([^\\]|\\.)*?$match-QUOTEDTEXT-) - { - warn "mismatched quotes at line $. in $file\n"; - s-$match.*--; - } - } - } - - if (/\.GetString ?\(QUOTEDTEXT/) - { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - ## Remove the first 3 chars and add newline - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } - last; - } - - if (/_\(QUOTEDTEXT/) - { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - ## Remove the first 3 chars and add newline - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } - last; - } - } - close FILE; - } - - foreach my $file (@buf_i18n_xml) - { - open FILE, "<$file"; - - while (<FILE>) - { - # FIXME: share the pattern matching code with intltool-extract - if (/\s_[-A-Za-z0-9._:]+\s*=\s*\"([^"]+)\"/ || /<_[^>]+>/ || /translatable=\"yes\"/) - { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } - last; - } - } - close FILE; - } - - foreach my $file (@buf_i18n_ini) - { - open FILE, "<$file"; - while (<FILE>) - { - if (/_(.*)=/) - { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } - last; - } - } - close FILE; - } - - foreach my $file (@buf_i18n_xml_unmarked) - { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } - } - - - @buf_allfiles_sorted = sort (@buf_allfiles); - @buf_potfiles_sorted = sort (@buf_potfiles); - - my %in2; - foreach (@buf_potfiles_sorted) - { - $in2{$_} = 1; - } - - my @result; - - foreach (@buf_allfiles_sorted) - { - if (!exists($in2{$_})) - { - push @result, $_ - } - } - - my @buf_potfiles_notexist; - - foreach (@buf_potfiles_sorted) - { - chomp (my $dummy = $_); - if ("$dummy" ne "" and ! -f "../$dummy") - { - push @buf_potfiles_notexist, $_; - } - } - - ## Save file with information about the files missing - ## if any, and give information about this procedure. - if (@result + @buf_potfiles_notexist > 0) - { - if (@result) - { - print "\n" if $VERBOSE; - unlink "missing"; - open OUT, ">missing"; - print OUT @result; - close OUT; - warn "\e[1mThe following files contain translations and are currently not in use. Please\e[0m\n". - "\e[1mconsider adding these to the POTFILES.in file, located in the po/ directory.\e[0m\n\n"; - print STDERR @result, "\n"; - warn "If some of these files are left out on purpose then please add them to\n". - "POTFILES.skip instead of POTFILES.in. A file \e[1m'missing'\e[0m containing this list\n". - "of left out files has been written in the current directory.\n"; - } - if (@buf_potfiles_notexist) - { - unlink "notexist"; - open OUT, ">notexist"; - print OUT @buf_potfiles_notexist; - close OUT; - warn "\n" if ($VERBOSE or @result); - warn "\e[1mThe following files do not exist anymore:\e[0m\n\n"; - warn @buf_potfiles_notexist, "\n"; - warn "Please remove them from POTFILES.in or POTFILES.skip. A file \e[1m'notexist'\e[0m\n". - "containing this list of absent files has been written in the current directory.\n"; - } - } - - ## If there is nothing to complain about, notify the user - else { - print "\nAll files containing translations are present in POTFILES.in.\n" if $VERBOSE; - } -} - -sub Console_WriteError_InvalidOption -{ - ## Handle invalid arguments - print STDERR "Try `${PROGRAM} --help' for more information.\n"; - exit 1; -} - -sub GenerateHeaders -{ - my $EXTRACT = "@INTLTOOL_EXTRACT@"; - chomp $EXTRACT; - - $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} if $ENV{"INTLTOOL_EXTRACT"}; - - ## Generate the .h header files, so we can allow glade and - ## xml translation support - if (! -x "$EXTRACT") - { - print STDERR "\n *** The intltool-extract script wasn't found!" - ."\n *** Without it, intltool-update can not generate files.\n"; - exit; - } - else - { - open (FILE, $POTFILES_in) or die "$PROGRAM: POTFILES.in not found.\n"; - - while (<FILE>) - { - chomp; - next if /^\[\s*encoding/; - - ## Find xml files in POTFILES.in and generate the - ## files with help from the extract script - - my $gettext_type= &POFile_DetermineType ($1); - - if (/\.($xml_support|$ini_support)$/ || /^\[/) - { - s/^\[[^\[].*]\s*//; - - my $filename = "../$_"; - - if ($VERBOSE) - { - system ($EXTRACT, "--update", "--srcdir=$SRCDIR", - "--type=$gettext_type", $filename); - } - else - { - system ($EXTRACT, "--update", "--type=$gettext_type", - "--srcdir=$SRCDIR", "--quiet", $filename); - } - } - } - close FILE; - } -} - -# -# Generate .pot file from POTFILES.in -# -sub GeneratePOTemplate -{ - my $XGETTEXT = $ENV{"XGETTEXT"} || "@INTLTOOL_XGETTEXT@"; - my $XGETTEXT_ARGS = $ENV{"XGETTEXT_ARGS"} || ''; - chomp $XGETTEXT; - - if (! -x $XGETTEXT) - { - print STDERR " *** xgettext is not found on this system!\n". - " *** Without it, intltool-update can not extract strings.\n"; - exit; - } - - print "Building $MODULE.pot...\n" if $VERBOSE; - - open INFILE, $POTFILES_in; - unlink "POTFILES.in.temp"; - open OUTFILE, ">POTFILES.in.temp" or die("Cannot open POTFILES.in.temp for writing"); - - my $gettext_support_nonascii = 0; - - # checks for GNU gettext >= 0.12 - my $dummy = `$XGETTEXT --version --from-code=UTF-8 >$devnull 2>$devnull`; - if ($? == 0) - { - $gettext_support_nonascii = 1; - } - else - { - # urge everybody to upgrade gettext - print STDERR "WARNING: This version of gettext does not support extracting non-ASCII\n". - " strings. That means you should install a version of gettext\n". - " that supports non-ASCII strings (such as GNU gettext >= 0.12),\n". - " or have to let non-ASCII strings untranslated. (If there is any)\n"; - } - - my $encoding = "ASCII"; - my $forced_gettext_code; - my @temp_headers; - my $encoding_problem_is_reported = 0; - - while (<INFILE>) - { - next if (/^#/ or /^\s*$/); - - chomp; - - my $gettext_code; - - if (/^\[\s*encoding:\s*(.*)\s*\]/) - { - $forced_gettext_code=$1; - } - elsif (/\.($xml_support|$ini_support)$/ || /^\[/) - { - s/^\[.*]\s*//; - print OUTFILE "../$_.h\n"; - push @temp_headers, "../$_.h"; - $gettext_code = &TextFile_DetermineEncoding ("../$_.h") if ($gettext_support_nonascii and not defined $forced_gettext_code); - } - else - { - if ($SRCDIR eq ".") { - print OUTFILE "../$_\n"; - } else { - print OUTFILE "$SRCDIR/../$_\n"; - } - $gettext_code = &TextFile_DetermineEncoding ("../$_") if ($gettext_support_nonascii and not defined $forced_gettext_code); - } - - next if (! $gettext_support_nonascii); - - if (defined $forced_gettext_code) - { - $encoding=$forced_gettext_code; - } - elsif (defined $gettext_code and "$encoding" ne "$gettext_code") - { - if ($encoding eq "ASCII") - { - $encoding=$gettext_code; - } - elsif ($gettext_code ne "ASCII") - { - # Only report once because the message is quite long - if (! $encoding_problem_is_reported) - { - print STDERR "WARNING: You should use the same file encoding for all your project files,\n". - " but $PROGRAM thinks that most of the source files are in\n". - " $encoding encoding, while \"$_\" is (likely) in\n". - " $gettext_code encoding. If you are sure that all translatable strings\n". - " are in same encoding (say UTF-8), please \e[1m*prepend*\e[0m the following\n". - " line to POTFILES.in:\n\n". - " [encoding: UTF-8]\n\n". - " and make sure that configure.in/ac checks for $PACKAGE >= 0.27 .\n". - "(such warning message will only be reported once.)\n"; - $encoding_problem_is_reported = 1; - } - } - } - } - - close OUTFILE; - close INFILE; - - unlink "$MODULE.pot"; - my @xgettext_argument=("$XGETTEXT", - "--add-comments", - "--directory\=\.", - "--output\=$MODULE\.pot", - "--files-from\=\.\/POTFILES\.in\.temp"); - my $XGETTEXT_KEYWORDS = &FindPOTKeywords; - push @xgettext_argument, $XGETTEXT_KEYWORDS; - my $MSGID_BUGS_ADDRESS = &FindMakevarsBugAddress; - push @xgettext_argument, "--msgid-bugs-address\=$MSGID_BUGS_ADDRESS" if $MSGID_BUGS_ADDRESS; - push @xgettext_argument, "--from-code\=$encoding" if ($gettext_support_nonascii); - push @xgettext_argument, $XGETTEXT_ARGS if $XGETTEXT_ARGS; - my $xgettext_command = join ' ', @xgettext_argument; - - # intercept xgettext error message - print "Running $xgettext_command\n" if $VERBOSE; - my $xgettext_error_msg = `$xgettext_command 2>\&1`; - my $command_failed = $?; - - unlink "POTFILES.in.temp"; - - print "Removing generated header (.h) files..." if $VERBOSE; - unlink foreach (@temp_headers); - print "done.\n" if $VERBOSE; - - if (! $command_failed) - { - if (! -e "$MODULE.pot") - { - print "None of the files in POTFILES.in contain strings marked for translation.\n" if $VERBOSE; - } - else - { - print "Wrote $MODULE.pot\n" if $VERBOSE; - } - } - else - { - if ($xgettext_error_msg =~ /--from-code/) - { - # replace non-ASCII error message with a more useful one. - print STDERR "ERROR: xgettext failed to generate PO template file because there is non-ASCII\n". - " string marked for translation. Please make sure that all strings marked\n". - " for translation are in uniform encoding (say UTF-8), then \e[1m*prepend*\e[0m the\n". - " following line to POTFILES.in and rerun $PROGRAM:\n\n". - " [encoding: UTF-8]\n\n"; - } - else - { - print STDERR "$xgettext_error_msg"; - if (-e "$MODULE.pot") - { - # is this possible? - print STDERR "ERROR: xgettext failed but still managed to generate PO template file.\n". - " Please consult error message above if there is any.\n"; - } - else - { - print STDERR "ERROR: xgettext failed to generate PO template file. Please consult\n". - " error message above if there is any.\n"; - } - } - exit (1); - } -} - -sub POFile_Update -{ - -f "$MODULE.pot" or die "$PROGRAM: $MODULE.pot does not exist.\n"; - - my $MSGMERGE = $ENV{"MSGMERGE"} || "@INTLTOOL_MSGMERGE@"; - my ($lang, $outfile) = @_; - - print "Merging $SRCDIR/$lang.po with $MODULE.pot..." if $VERBOSE; - - my $infile = "$SRCDIR/$lang.po"; - $outfile = "$SRCDIR/$lang.po" if ($outfile eq ""); - - # I think msgmerge won't overwrite old file if merge is not successful - system ("$MSGMERGE", "-o", $outfile, $infile, "$MODULE.pot"); -} - -sub Console_WriteError_NotExisting -{ - my ($file) = @_; - - ## Report error if supplied language file is non-existing - print STDERR "$PROGRAM: $file does not exist!\n"; - print STDERR "Try '$PROGRAM --help' for more information.\n"; - exit; -} - -sub GatherPOFiles -{ - my @po_files = glob ("./*.po"); - - @languages = map (&POFile_GetLanguage, @po_files); - - foreach my $lang (@languages) - { - $po_files_by_lang{$lang} = shift (@po_files); - } -} - -sub POFile_GetLanguage ($) -{ - s/^(.*\/)?(.+)\.po$/$2/; - return $_; -} - -sub Console_Write_TranslationStatus -{ - my ($lang, $output_file) = @_; - my $MSGFMT = $ENV{"MSGFMT"} || "@INTLTOOL_MSGFMT@"; - - $output_file = "$SRCDIR/$lang.po" if ($output_file eq ""); - - system ("$MSGFMT", "-o", "$devnull", "--verbose", $output_file); -} - -sub Console_Write_CoverageReport -{ - my $MSGFMT = $ENV{"MSGFMT"} || "@INTLTOOL_MSGFMT@"; - - &GatherPOFiles; - - foreach my $lang (@languages) - { - print "$lang: "; - &POFile_Update ($lang, ""); - } - - print "\n\n * Current translation support in $MODULE \n\n"; - - foreach my $lang (@languages) - { - print "$lang: "; - system ("$MSGFMT", "-o", "$devnull", "--verbose", "$SRCDIR/$lang.po"); - } -} - -sub SubstituteVariable -{ - my ($str) = @_; - - # always need to rewind file whenever it has been accessed - seek (CONF, 0, 0); - - # cache each variable. varhash is global to we can add - # variables elsewhere. - while (<CONF>) - { - if (/^(\w+)=(.*)$/) - { - ($varhash{$1} = $2) =~ s/^["'](.*)["']$/$1/; - } - } - - if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/) - { - my $rest = $3; - my $untouched = $1; - my $sub = ""; - # Ignore recursive definitions of variables - $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ /\${?$2}?/; - - return SubstituteVariable ("$untouched$sub$rest"); - } - - # We're using Perl backticks ` and "echo -n" here in order to - # expand any shell escapes (such as backticks themselves) in every variable - return echo_n ($str); -} - -sub CONF_Handle_Open -{ - my $base_dirname = getcwd(); - $base_dirname =~ s@.*/@@; - - my ($conf_in, $src_dir); - - if ($base_dirname =~ /^po(-.+)?$/) - { - if (-f "Makevars") - { - my $makefile_source; - - local (*IN); - open (IN, "<Makevars") || die "can't open Makevars: $!"; - - while (<IN>) - { - if (/^top_builddir[ \t]*=/) - { - $src_dir = $_; - $src_dir =~ s/^top_builddir[ \t]*=[ \t]*([^ \t\n\r]*)/$1/; - - chomp $src_dir; - if (-f "$src_dir" . "/configure.ac") { - $conf_in = "$src_dir" . "/configure.ac" . "\n"; - } else { - $conf_in = "$src_dir" . "/configure.in" . "\n"; - } - last; - } - } - close IN; - - $conf_in || die "Cannot find top_builddir in Makevars."; - } - elsif (-f "../configure.ac") - { - $conf_in = "../configure.ac"; - } - elsif (-f "../configure.in") - { - $conf_in = "../configure.in"; - } - else - { - my $makefile_source; - - local (*IN); - open (IN, "<Makefile") || return; - - while (<IN>) - { - if (/^top_srcdir[ \t]*=/) - { - $src_dir = $_; - $src_dir =~ s/^top_srcdir[ \t]*=[ \t]*([^ \t\n\r]*)/$1/; - - chomp $src_dir; - $conf_in = "$src_dir" . "/configure.in" . "\n"; - - last; - } - } - close IN; - - $conf_in || die "Cannot find top_srcdir in Makefile."; - } - - open (CONF, "<$conf_in"); - } - else - { - print STDERR "$PROGRAM: Unable to proceed.\n" . - "Make sure to run this script inside the po directory.\n"; - exit; - } -} - -sub FindPackageName -{ - my $version; - my $domain = &FindMakevarsDomain; - my $name = $domain || "untitled"; - - &CONF_Handle_Open; - - my $conf_source; { - local (*IN); - open (IN, "<&CONF") || return $name; - seek (IN, 0, 0); - local $/; # slurp mode - $conf_source = <IN>; - close IN; - } - - # priority for getting package name: - # 1. GETTEXT_PACKAGE - # 2. first argument of AC_INIT (with >= 2 arguments) - # 3. first argument of AM_INIT_AUTOMAKE (with >= 2 argument) - - # /^AM_INIT_AUTOMAKE\([\s\[]*([^,\)\s\]]+)/m - # the \s makes this not work, why? - if ($conf_source =~ /^AM_INIT_AUTOMAKE\(([^,\)]+),([^,\)]+)/m) - { - ($name, $version) = ($1, $2); - $name =~ s/[\[\]\s]//g; - $version =~ s/[\[\]\s]//g; - $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/); - $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/); - $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/); - $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/); - } - - if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)/m) - { - ($name, $version) = ($1, $2); - $name =~ s/[\[\]\s]//g; - $version =~ s/[\[\]\s]//g; - $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/); - $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/); - $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/); - $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/); - } - - # \s makes this not work, why? - $name = $1 if $conf_source =~ /^GETTEXT_PACKAGE=\[?([^\n\]]+)/m; - - # m4 macros AC_PACKAGE_NAME, AC_PACKAGE_VERSION etc. have same value - # as corresponding $PACKAGE_NAME, $PACKAGE_VERSION etc. shell variables. - $name =~ s/\bAC_PACKAGE_/\$PACKAGE_/g; - - $name = $domain if $domain; - - $name = SubstituteVariable ($name); - $name =~ s/^["'](.*)["']$/$1/; - - return $name if $name; -} - - -sub FindPOTKeywords -{ - - my $keywords = "--keyword\=\_ --keyword\=N\_ --keyword\=U\_ --keyword\=Q\_"; - my $varname = "XGETTEXT_OPTIONS"; - my $make_source; { - local (*IN); - open (IN, "<Makevars") || (open(IN, "<Makefile.in.in") && ($varname = "XGETTEXT_KEYWORDS")) || return $keywords; - seek (IN, 0, 0); - local $/; # slurp mode - $make_source = <IN>; - close IN; - } - - $keywords = $1 if $make_source =~ /^$varname[ ]*=\[?([^\n\]]+)/m; - - return $keywords; -} - -sub FindMakevarsDomain -{ - - my $domain = ""; - my $makevars_source; { - local (*IN); - open (IN, "<Makevars") || return $domain; - seek (IN, 0, 0); - local $/; # slurp mode - $makevars_source = <IN>; - close IN; - } - - $domain = $1 if $makevars_source =~ /^DOMAIN[ ]*=\[?([^\n\]\$]+)/m; - $domain =~ s/^\s+//; - $domain =~ s/\s+$//; - - return $domain; -} - -sub FindMakevarsBugAddress -{ - - my $address = ""; - my $makevars_source; { - local (*IN); - open (IN, "<Makevars") || return undef; - seek (IN, 0, 0); - local $/; # slurp mode - $makevars_source = <IN>; - close IN; - } - - $address = $1 if $makevars_source =~ /^MSGID_BUGS_ADDRESS[ ]*=\[?([^\n\]\$]+)/m; - $address =~ s/^\s+//; - $address =~ s/\s+$//; - - return $address; -} diff --git a/packages/openmoko-pim/files/openmoko-dates.desktop b/packages/openmoko-pim/files/openmoko-dates.desktop deleted file mode 100644 index f13cadeb9a..0000000000 --- a/packages/openmoko-pim/files/openmoko-dates.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Dates -Comment=Dates -Exec=dates -Icon=openmoko-dates -Terminal=false -Type=Application -Categories=GTK;Application;PIM;Office -MimeType=text/x-vcard; -SingleInstance=false -StartupNotify=true diff --git a/packages/openmoko-pim/files/openmoko-dates.png b/packages/openmoko-pim/files/openmoko-dates.png Binary files differdeleted file mode 100644 index ebe04f4096..0000000000 --- a/packages/openmoko-pim/files/openmoko-dates.png +++ /dev/null diff --git a/packages/openmoko-pim/files/stock_contact.png b/packages/openmoko-pim/files/stock_contact.png Binary files differdeleted file mode 100644 index 123b4485ac..0000000000 --- a/packages/openmoko-pim/files/stock_contact.png +++ /dev/null diff --git a/packages/openmoko-pim/files/stock_person.png b/packages/openmoko-pim/files/stock_person.png Binary files differdeleted file mode 100644 index 2b1328b4e2..0000000000 --- a/packages/openmoko-pim/files/stock_person.png +++ /dev/null diff --git a/packages/openmoko-pim/openmoko-contacts_svn.bb b/packages/openmoko-pim/openmoko-contacts_svn.bb deleted file mode 100644 index 49177e1c4d..0000000000 --- a/packages/openmoko-pim/openmoko-contacts_svn.bb +++ /dev/null @@ -1,31 +0,0 @@ -DESCRIPTION = "The Openmoko address book" -LICENSE = "GPL" -SECTION = "openmoko/pim" -DEPENDS += "glib-2.0 gtk+ libglade eds-dbus gnome-vfs openmoko-libs" -RDEPENDS = "gnome-vfs-plugin-file libedata-book" -RRECOMMENDS = "gnome-vfs-plugin-http" -PV = "0.1+svnr${SRCREV}" -PR = "r3" - -inherit openmoko - -SRC_URI += "\ - file://intltool-update.in \ - file://stock_contact.png \ - file://stock_person.png" - -EXTRA_OECONF = "--enable-gnome-vfs" - -do_configure_prepend() { - install -m 644 ${WORKDIR}/intltool-update.in ${S} -} - -do_install_append () { - install -d ${D}/${datadir}/pixmaps - install -m 0644 ${WORKDIR}/stock_contact.png ${D}/${datadir}/pixmaps - install -m 0644 ${WORKDIR}/stock_person.png ${D}/${datadir}/pixmaps -} - -FILES_${PN} += "${datadir}/pixmaps/stock_contact.png \ - ${datadir}/pixmaps/stock_person.png" - diff --git a/packages/openmoko-pim/openmoko-dates_svn.bb b/packages/openmoko-pim/openmoko-dates_svn.bb deleted file mode 100644 index b43b738131..0000000000 --- a/packages/openmoko-pim/openmoko-dates_svn.bb +++ /dev/null @@ -1,29 +0,0 @@ -DESCRIPTION = "The Openmoko Dates Application" -SECTION = "openmoko/pim" -LICENSE = "GPL" -DEPENDS = "glib-2.0 gtk+ libglade eds-dbus openmoko-libs" -RDEPENDS = "libedata-cal" -PV = "0.1+svnr${SRCREV}" -PR = "r9" - -inherit gnome autotools pkgconfig gtk-icon-cache - -SRC_URI = "svn://svn.o-hand.com/repos/dates/branches/;module=openmoko;proto=http \ - file://openmoko-dates.png \ - file://openmoko-dates.desktop" - -S = "${WORKDIR}/openmoko" - -EXTRA_OECONF = "--enable-omoko" - -do_install_append () { - rm -rf ${D}${datadir}/icons - rm -rf ${D}${datadir}/applications/dates.desktop - install -d ${D}/${datadir}/pixmaps - install -m 0644 ${WORKDIR}/openmoko-dates.png ${D}/${datadir}/pixmaps/ - install -m 0644 ${WORKDIR}/openmoko-dates.desktop ${D}${datadir}/applications/ -} - -FILES_${PN} += "${datadir}/pixmaps \ - ${datadir}/dates/" - diff --git a/packages/openmoko-pim/openmoko-tasks_svn.bb b/packages/openmoko-pim/openmoko-tasks_svn.bb deleted file mode 100644 index 08acf4e9d3..0000000000 --- a/packages/openmoko-pim/openmoko-tasks_svn.bb +++ /dev/null @@ -1,15 +0,0 @@ -DESCRIPTION = "The Openmoko Tasks Application" -SECTION = "openmoko/pim" -LICENSE = "GPL" -DEPENDS = "glib-2.0 gtk+ libglade eds-dbus openmoko-libs" -RDEPENDS = "libedata-cal" -PV = "0.1+svnr${SRCREV}" -PR = "r0" - -inherit gnome autotools pkgconfig gtk-icon-cache - -SRC_URI = "svn://svn.o-hand.com/repos/tasks/;module=trunk;proto=http" -S = "${WORKDIR}/trunk" - -EXTRA_OECONF = "--enable-omoko --disable-gtk" - diff --git a/packages/openmoko-pim/openmoko-today_svn.bb b/packages/openmoko-pim/openmoko-today_svn.bb deleted file mode 100644 index b26a2e8156..0000000000 --- a/packages/openmoko-pim/openmoko-today_svn.bb +++ /dev/null @@ -1,8 +0,0 @@ -DESCRIPTION = "Openmoko Today application." -SECTION = "openmoko/pim" -LICENSE = "GPL" -DEPENDS = "openmoko-libs eds-dbus startup-notification" -PV = "0.1+svnr${SRCREV}" - -inherit autotools pkgconfig gtk-icon-cache openmoko - diff --git a/packages/openmoko-tools/.mtn2git_empty b/packages/openmoko-tools/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 --- a/packages/openmoko-tools/.mtn2git_empty +++ /dev/null diff --git a/packages/openmoko-tools/openmoko-chordmaster_svn.bb b/packages/openmoko-tools/openmoko-chordmaster_svn.bb deleted file mode 100644 index 9c6716c929..0000000000 --- a/packages/openmoko-tools/openmoko-chordmaster_svn.bb +++ /dev/null @@ -1,6 +0,0 @@ -DESCRIPTION = "A guitar chord database for Openmoko" -SECTION = "openmoko/tools" -PV = "0.0.1+svn${SRCDATE}" - -inherit openmoko - diff --git a/packages/python/python-2.5.2/default-is-optimized.patch b/packages/python/python-2.5.2/default-is-optimized.patch index 6beeb6e022..072bf0b059 100644 --- a/packages/python/python-2.5.2/default-is-optimized.patch +++ b/packages/python/python-2.5.2/default-is-optimized.patch @@ -1,7 +1,7 @@ -Index: Python-2.5.1/Python/compile.c +Index: Python-2.5.2/Python/compile.c =================================================================== ---- Python-2.5.1.orig/Python/compile.c -+++ Python-2.5.1/Python/compile.c +--- Python-2.5.2.orig/Python/compile.c ++++ Python-2.5.2/Python/compile.c @@ -30,7 +30,7 @@ #include "symtable.h" #include "opcode.h" @@ -11,3 +11,38 @@ Index: Python-2.5.1/Python/compile.c /* ISSUES: +Index: Python-2.5.2/Modules/main.c +=================================================================== +--- Python-2.5.2.orig/Modules/main.c ++++ Python-2.5.2/Modules/main.c +@@ -40,7 +40,7 @@ static char **orig_argv; + static int orig_argc; + + /* command line options */ +-#define BASE_OPTS "c:dEhim:OQ:StuUvVW:xX?" ++#define BASE_OPTS "c:dEhim:ONQ:StuUvVW:xX?" + + #ifndef RISCOS + #define PROGRAM_OPTS BASE_OPTS +@@ -68,8 +68,7 @@ Options and arguments (and corresponding + "; + static char *usage_2 = "\ + -m mod : run library module as a script (terminates option list)\n\ +--O : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)\n\ +--OO : remove doc-strings in addition to the -O optimizations\n\ ++-N : do NOT optimize generated bytecode\n\ + -Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n\ + -S : don't imply 'import site' on initialization\n\ + -t : issue warnings about inconsistent tab usage (-tt: issue errors)\n\ +@@ -302,7 +301,10 @@ Py_Main(int argc, char **argv) + break; + + case 'O': +- Py_OptimizeFlag++; ++ fprintf(stderr, "-O is already default in this version. Ignoring\n"); ++ ++ case 'N': ++ Py_OptimizeFlag=0; + break; + + case 'S': diff --git a/packages/python/python-evas_cvs.bb b/packages/python/python-evas_cvs.bb index 92f4466a24..57e28b28ed 100644 --- a/packages/python/python-evas_cvs.bb +++ b/packages/python/python-evas_cvs.bb @@ -3,6 +3,10 @@ DEPENDS += "evas" PV = "0.2.1+cvs${SRCDATE}" PR = "r0" +do_compile_prepend() { + touch include/evas/__init__.py +} + do_stage() { distutils_stage_all } diff --git a/packages/python/python_2.5.2.bb b/packages/python/python_2.5.2.bb index 22aac7c9ee..9617871fff 100644 --- a/packages/python/python_2.5.2.bb +++ b/packages/python/python_2.5.2.bb @@ -6,7 +6,7 @@ PRIORITY = "optional" DEPENDS = "python-native readline zlib gdbm openssl sqlite3 tcl tk" DEPENDS_sharprom = "python-native readline zlib gdbm openssl" # bump this on every change in contrib/python/generate-manifest-2.5.py -PR = "ml4" +PR = "ml6" PYTHON_MAJMIN = "2.5" diff --git a/packages/rsync/rsync.inc b/packages/rsync/rsync.inc index 7ec83293ff..75f4c46303 100644 --- a/packages/rsync/rsync.inc +++ b/packages/rsync/rsync.inc @@ -7,7 +7,7 @@ DEPENDS += "popt" inherit autotools -SRC_URI = "http://rsync.samba.org/ftp/rsync/old-versions/rsync-${PV}.tar.gz" +SRC_URI = "http://rsync.samba.org/ftp/rsync/src/rsync-${PV}.tar.gz" EXTRA_OEMAKE='STRIP=""' diff --git a/packages/rsync/rsync_2.6.9.bb b/packages/rsync/rsync_2.6.9.bb index 067df4f2f3..77cb0b2b67 100644 --- a/packages/rsync/rsync_2.6.9.bb +++ b/packages/rsync/rsync_2.6.9.bb @@ -1,5 +1,5 @@ require rsync.inc -PR = "r2" +PR = "r3" SRC_URI += "file://rsyncd.conf" diff --git a/packages/rsync/rsync_3.0.0.bb b/packages/rsync/rsync_3.0.0.bb index 99bec628d3..cd8a986f8f 100644 --- a/packages/rsync/rsync_3.0.0.bb +++ b/packages/rsync/rsync_3.0.0.bb @@ -1,6 +1,6 @@ require rsync.inc -PR = "r0" +PR = "r1" SRC_URI += "\ file://m4.patch;patch=1 \ diff --git a/packages/freesmartphone/python-ophoned/.mtn2git_empty b/packages/serial-utils/.mtn2git_empty index e69de29bb2..e69de29bb2 100644 --- a/packages/freesmartphone/python-ophoned/.mtn2git_empty +++ b/packages/serial-utils/.mtn2git_empty diff --git a/packages/openmoko-tools/pty-forward-native.bb b/packages/serial-utils/pty-forward-native.bb index 972070d6b6..972070d6b6 100644 --- a/packages/openmoko-tools/pty-forward-native.bb +++ b/packages/serial-utils/pty-forward-native.bb diff --git a/packages/openmoko-tools/serial-forward.bb b/packages/serial-utils/serial-forward.bb index 3cc33770d6..3cc33770d6 100644 --- a/packages/openmoko-tools/serial-forward.bb +++ b/packages/serial-utils/serial-forward.bb diff --git a/packages/stress/stress_0.18.8.bb b/packages/stress/stress_1.0.0.bb index 58812c95db..58812c95db 100644 --- a/packages/stress/stress_0.18.8.bb +++ b/packages/stress/stress_1.0.0.bb diff --git a/packages/freesmartphone/python-ousaged/.mtn2git_empty b/packages/tangogps/.mtn2git_empty index e69de29bb2..e69de29bb2 100644 --- a/packages/freesmartphone/python-ousaged/.mtn2git_empty +++ b/packages/tangogps/.mtn2git_empty diff --git a/packages/tangogps/tangogps_0.9.0.3.bb b/packages/tangogps/tangogps_0.9.0.3.bb new file mode 100644 index 0000000000..f980b0bb04 --- /dev/null +++ b/packages/tangogps/tangogps_0.9.0.3.bb @@ -0,0 +1,10 @@ +LICENSE = "GPLv2" +SECTION = "x11/applications" +PRIORITY = "optional" +DESCRIPTION = "lightweight and fast mapping application" +DEPENDS = "curl gtk+ gconf gpsd" +RDEPENDS = "gpsd" + +SRC_URI = "http://www.tangogps.org/downloads/${PN}-${PV}.tar.gz" + +inherit autotools diff --git a/packages/u-boot/u-boot_git.bb b/packages/u-boot/u-boot_git.bb index df8b43014c..6ccc6f2614 100644 --- a/packages/u-boot/u-boot_git.bb +++ b/packages/u-boot/u-boot_git.bb @@ -1,14 +1,14 @@ require u-boot.inc PR="r11" -SRCREV_davinci-sffsdr = "a524e112b424c6843800ea2f19d3a8cf01d0aa94" +SRCREV_davinci-sffsdr = "699f05125509249072a0b865c8d35520d97cd501" +SRCREV_davinci-dvevm = "699f05125509249072a0b865c8d35520d97cd501" SRCREV_beagleboard = "bde63587622c4b830a27d1ddf7265843de9e994f" SRCREV_neuros-osd2 = "70ee511d37ca99afee00edc27be36d0af2832bbc" SRC_URI = "git://www.denx.de/git/u-boot.git;protocol=git " SRC_URI_sequoia = "git://www.denx.de/git/u-boot.git;protocol=git;tag=cf3b41e0c1111dbb865b6e34e9f3c3d3145a6093 " SRC_URI_neuros-osd2 = "git://git.neurostechnology.com/git/u-boot;protocol=git;branch=neuros" -SRC_URI_append_davinci-sffsdr = " file://sffsdr-u-boot.patch;patch=1 " SRC_URI_append_beagleboard = "file://base.patch;patch=1 \ file://name.patch;patch=1 \ diff --git a/packages/vlc/vlc-davinci_0.8.6h.bb b/packages/vlc/vlc-davinci_0.8.6h.bb index 9ed6d46fd2..9d64cb4901 100644 --- a/packages/vlc/vlc-davinci_0.8.6h.bb +++ b/packages/vlc/vlc-davinci_0.8.6h.bb @@ -1,12 +1,12 @@ -DESCRIPTION = "Video player and streamer - GPE edition" +DESCRIPTION = "Video player and streamer - davinci edition" HOMEPAGE = "http://www.videolan.org" LICENSE = "GPL" PRIORITY = "optional" SECTION = "multimedia" -SRCREV = "116b6dff4996f494b54fc0f05695ba792086ea9e" +SRCREV = "fa02f65b17429432d13a108f73744f33709dd01c" -PR = "r1" +PR = "r2" PV = "0.8.6h+${PR}+gitr${SRCREV}" @@ -45,12 +45,18 @@ do_configure() { libtoolize --force autoreconf --force -i oe_runconf + rm config.log + sed -i -e s:-L/usr/lib:-L${STAGING_LIBDIR}/:g vlc-config } do_stage() { autotools_stage_all } +do_compile() { + ${S}/compile +} + RCONFLICTS_${PN} = "vlc" FILES_${PN} += "${bindir}/vlc \ |