# HG changeset patch # User Antoine Bodin # Date 1300155824 -3600 # Node ID abe27fd0192d3b43c11bebbb165abf1781570874 # Parent 13a47f61c87bed836a27f582ffee2a4f91c47b3e Add: linux-libre 2.6.37-libre (part 1) diff -r 13a47f61c87b -r abe27fd0192d lguest-libre/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lguest-libre/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,17 @@ +# SliTaz package receipt. + +PACKAGE="lguest-libre" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel paravirtualization tool." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="lguest" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +WANTED="linux-libre" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/sbin + cp $src/Documentation/lguest/lguest $fs/usr/sbin +} diff -r 13a47f61c87b -r abe27fd0192d linux-libre-acpi/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-acpi/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,50 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-acpi" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel acpi modules." +DEPENDS="linux-libre" +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-acpi" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/acpi drivers/platform/x86/thinkpad_acpi.ko.gz \ + drivers/platform/x86/asus-laptop.ko.gz drivers/platform/x86/eeepc-wmi.ko.gz \ + drivers/platform/x86/msi-laptop.ko.gz drivers/platform/x86/panasonic-laptop.ko.gz \ + drivers/platform/x86/sony-laptop.ko.gz drivers/platform/x86/acer-wmi.ko.gz \ + drivers/platform/x86/hp-wmi.ko.gz drivers/platform/x86/wmi.ko.gz \ + drivers/platform/x86/classmate-laptop.ko.gz drivers/platform/x86/topstar-laptop.ko.gz | \ + while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-agp/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-agp/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,44 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-agp" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel AGP modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-agp" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/char/agp | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-api-headers/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-api-headers/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,49 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-api-headers" +VERSION="2.6.37-libre" +CATEGORY="development" +SHORT_DESC="Kernel headers sanitized for use in userspace." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-api-headers" +SOURCE="linux-libre" +TARBALL="linux-$VERSION.tar.bz2" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +WGET_URL="http://www.fsfla.org/svnwiki/selibre/linux-libre/download/releases/$VERSION/$TARBALL" + +# Rules to compile & install the temporary toolchain. +cook_tmp_toolchain() +{ + cd $src + + make mrproper && + make headers_check && + make INSTALL_HDR_PATH=dest headers_install && + cp -r dest/include/* /tools/include +} + +# Rules to configure and make the package. +compile_rules() +{ + cd $src + + make mrproper && + make headers_check && + make INSTALL_HDR_PATH=$DESTDIR/usr headers_install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr + cp -a $_pkg/usr/include $fs/usr + + rm -f $(find ${fs} -name .install -or -name ..install.cmd) +} + +# Post install commands for Tazpkg. +post_install() +{ + # Removed old linux-libre-headers + rm -rf $1/var/lib/tazpkg/installed/linux-libre-headers 2>/dev/null +} diff -r 13a47f61c87b -r abe27fd0192d linux-libre-appletalk/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-appletalk/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,47 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-appletalk" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel appletalk modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-appletalk" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + + export src + export _pkg + + $WOK/$WANTED/stuff/list_modules.sh drivers/net/appletalk net/appletalk \ + net/802/p8022.ko.gz | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-autofs/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-autofs/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-autofs" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel automounter module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-autofs" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/autofs4 | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-bluetooth/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-bluetooth/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,44 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-bluetooth" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel bluetooth modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-bluetooth" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/bluetooth net/bluetooth | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-bridge/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-bridge/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,44 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-bridge" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel bridge modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-bridge" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh net/bridge | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-btrfs/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-btrfs/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,49 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-btrfs" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel btrfs module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-btrfs" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/${PACKAGE##*-} | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-cifs/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-cifs/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-cifs" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel cifs module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-cifs" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/cifs | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-coda/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-coda/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-coda" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel coda module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-coda" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/coda | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-configfs/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-configfs/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-configfs" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel configfs module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-configfs" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/${PACKAGE##*-} | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-cpufreq/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-cpufreq/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,39 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-cpufreq" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel cpufreq modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-cpufreq" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh arch/x86/kernel/cpu/cpufreq drivers/cpufreq | \ + while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-cramfs/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-cramfs/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-cramfs" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel cramfs module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-cramfs" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/cramfs | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-crypto/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-crypto/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,45 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-crypto" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel crypto modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-crypto" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh arch/x86/crypto crypto drivers/crypto | \ + while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-cryptoloop/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-cryptoloop/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,39 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-cryptoloop" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel cryptoloop modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-cryptoloop" +DEPENDS="linux-libre-crypto" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/block/cryptoloop.ko.gz | \ + while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-dialup/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-dialup/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,46 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-dialup" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel dial-up modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-dialup" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/serial/serial_cs.ko.gz drivers/char/nozomi.ko.gz \ + drivers/usb/serial/option.ko.gz drivers/net/usb/hso.ko.gz | \ + while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-dlm/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-dlm/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,44 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-dlm" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel dlmfs module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-dlm" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Modules paths and list +MOD_PATH="lib/modules/$VERSION-slitaz/kernel" +MODULES="fs/dlm/dlm.ko.gz" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p ${fs}${MOD_PATH} $fs/etc + for module in $MODULES + do + dir=$MOD_PATH/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$MOD_PATH/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-drm/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-drm/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,49 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-drm" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel drm module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-drm" +DEPENDS="linux-libre-agp" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/gpu/drm | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done + + # remove drivers/char/agp kernel modules cause there in linux-agp package + if [ -d $fs/lib/modules/$VERSION-slitaz/kernel/drivers/char/agp ]; then + rm -rf $fs/lib/modules/$VERSION-slitaz/kernel/drivers/char/agp + fi +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-firewire/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-firewire/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,38 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-firewire" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel firewire modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-firewire" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/firewire | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-gfs2/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-gfs2/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-gfs2" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel gfs2 module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-gfs2" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/gfs2 | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-hfs/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-hfs/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-hfs" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel hfs module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-hfs" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/${PACKAGE##*-} | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-hfsplus/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-hfsplus/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,42 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-hfsplus" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel hfsplus module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-hfsplus" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/hfsplus | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} diff -r 13a47f61c87b -r abe27fd0192d linux-libre-hwmon/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-hwmon/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,44 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-hwmon" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel hwmon modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-hwmon" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/hwmon | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-input-misc/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-input-misc/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-input-misc" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel misc. input drivers, including the ATI RemoteWonders." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-input-misc" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/input/misc | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-input-tablet/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-input-tablet/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,38 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-input-tablet" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel tablet input drivers." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-input-tablet" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/input/tablet | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-input-touchscreen/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-input-touchscreen/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,44 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-input-touchscreen" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel touchscreen input drivers." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-input-touchscreen" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/input/touchscreen \ + lib/ts_bm.ko.gz lib/ts_fsm.ko.gz lib/ts_kmp.ko.gz | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-ipv6/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-ipv6/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,44 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-ipv6" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel ipv6 modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-ipv6" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh net/ipv6 | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-irda/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-irda/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,40 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-irda" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel irda modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-irda" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + + export src + export _pkg + + $WOK/$WANTED/stuff/list_modules.sh drivers/net/irda net/irda | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-isdn/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-isdn/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,44 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-isdn" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel isdn modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-isdn" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/isdn | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-jfs/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-jfs/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,42 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-jfs" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel jfs module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-jfs" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/jfs | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} diff -r 13a47f61c87b -r abe27fd0192d linux-libre-joystick/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-joystick/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,46 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-joystick" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel joystick modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-joystick" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/input/joystick drivers/input/gameport \ + drivers/input/input-polldev.ko.gz | \ + while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-kvm/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-kvm/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,41 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-kvm" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel kvm and virtio modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-kvm" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh arch/x86/kvm drivers/virtio drivers/lguest \ + drivers/char/hw_random/virtio-rng.ko.gz \ + drivers/net/virtio_net.ko.gz drivers/block/virtio_blk.ko.gz | \ + while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-logfs/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-logfs/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-logfs" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel logfs module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-logfs" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/${PACKAGE##*-} | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-md/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-md/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,48 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-md" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel md modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-md" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +DEPENDS="linux-libre-crypto" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/md | while read module; do + case "$module" in + crypto/*) continue;; + esac + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-memstick/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-memstick/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,46 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-memstick" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel sony memory stick modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-memstick" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + + export src + export _pkg + + $WOK/$WANTED/stuff/list_modules.sh drivers/memstick | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-minix/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-minix/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-minix" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel minix module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-minix" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/${PACKAGE##*-} | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-mmc/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-mmc/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,45 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-mmc" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel mmc modules (card reader)." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-mmc" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/mmc drivers/misc/tifm_7xx1.ko.gz drivers/misc/iwmc3200top/iwmc3200top.ko.gz| \ + while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-module-headers/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-module-headers/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,148 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-module-headers" +VERSION="2.6.37-libre" +CATEGORY="development" +SHORT_DESC="Header files and scripts for building modules for Linux Libre kernel." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-module-headers" +DEPENDS="slitaz-toolchain" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +KVERSION=$VERSION-slitaz + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` + AUFSDIR="$WOK/$WANTED/aufs-${_AUFSVER}" + path=usr/src/linux-$KVERSION + mkdir -p $fs/lib/modules/$KVERSION + ln -sf /$path $fs/lib/modules/$KVERSION/build + install -D -m644 $src/Makefile \ + $fs/$path/Makefile + install -D -m644 $src/kernel/Makefile \ + $fs/$path/kernel/Makefile + install -D -m644 $src/.config \ + $fs/$path/.config + mkdir -p $fs/$path/include + + for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video xen; do + cp -a $src/include/$i $fs/$path/include/ + done + + # copy arch includes for external modules + mkdir -p $fs/$path/arch/x86 + cp -a $src/arch/x86/include $fs/$path/arch/x86/ + + # copy files necessary for later builds, like nvidia and vmware + cp -a $src/Module.symvers-modules $fs/$path/Module.symvers + cp -a $src/scripts $fs/$path + # fix permissions on scripts dir + chmod og-w -R $fs/$path/scripts + mkdir -p $fs/$path/.tmp_versions + + mkdir -p $fs/$path/arch/x86/kernel + cp -a $src/arch/x86/Makefile $fs/$path/arch/x86/ + cp -a $src/arch/x86/Makefile_32.cpu $fs/$path/arch/x86/ + cp -a $src/arch/x86/kernel/asm-offsets.s $fs/$path/arch/x86/kernel/ + + # add headers for lirc package + mkdir -p $fs/$path/drivers/media/video + cp -a $src/drivers/media/video/*.h $fs/$path/drivers/media/video/ + + for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo ; do + mkdir -p $fs/$path/drivers/media/video/$i + cp -a $src/drivers/media/video/$i/*.h $fs/$path/drivers/media/video/$i + done + + # add docbook makefile + install -D -m644 $src/Documentation/DocBook/Makefile \ + $fs/$path/Documentation/DocBook/Makefile + + # add dm headers + mkdir -p $fs/$path/drivers/md + cp -a $src/drivers/md/*.h $fs/$path/drivers/md + + # add inotify.h + mkdir -p $fs/$path/include/linux + cp -a $src/include/linux/inotify.h $fs/$path/include/linux/ + + # add wireless headers + mkdir -p $fs/$path/net/mac80211/ + cp -a $src/net/mac80211/*.h $fs/$path/net/mac80211/ + + # add dvb headers for external modules + # in reference to: + # http://bugs.archlinux.org/task/9912 + mkdir -p $fs/$path/drivers/media/dvb/dvb-core + cp -a $src/drivers/media/dvb/dvb-core/*.h $fs/$path/drivers/media/dvb/dvb-core/ + + # add dvb headers for external modules + # in reference to: + # http://bugs.archlinux.org/task/11194 + if [ -d $src/include/config/dvb/ ]; then + mkdir -p $fs/$path/include/config/dvb/ + cp $src/include/config/dvb/*.h $fs/$path/include/config/dvb/ + fi + + # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new + # in reference to: + # http://bugs.archlinux.org/task/13146 + mkdir -p $fs/$path/drivers/media/dvb/frontends/ + cp -a $src/drivers/media/dvb/frontends/lgdt330x.h $fs/$path/drivers/media/dvb/frontends/ + cp -a $src/drivers/media/video/msp3400-driver.h $fs/$path/drivers/media/dvb/frontends/ + + # add dvb headers + # in reference to: + # http://bugs.archlinux.org/task/20402 + mkdir -p $fs/$path/drivers/media/dvb/dvb-usb + cp -a $src/drivers/media/dvb/dvb-usb/*.h $fs/$path/drivers/media/dvb/dvb-usb/ + mkdir -p $fs/$path/drivers/media/dvb/frontends + cp -a $src/drivers/media/dvb/frontends/*.h $fs/$path/drivers/media/dvb/frontends/ + mkdir -p $fs/$path/drivers/media/common/tuners + cp -a $src/drivers/media/common/tuners/*.h $fs/$path/drivers/media/common/tuners/ + + # add xfs and shmem for aufs building + mkdir -p $fs/$path/fs/xfs + mkdir -p $fs/$path/mm + cp -a $src/fs/xfs/xfs_sb.h $fs/$path/fs/xfs/xfs_sb.h + + # add headers vor virtualbox + # in reference to: + # http://bugs.archlinux.org/task/14568 + cp -a $src/include/drm $fs/$path/include/ + + # add headers for broadcom wl + # in reference to: + # http://bugs.archlinux.org/task/14568 + cp -a $src/include/trace $fs/$path/include/ + # add headers for crypto modules + # in reference to: + # http://bugs.archlinux.org/task/22081 + cp -a $src/include/crypto $fs/$path/include/ + # copy in Kconfig files + for i in $(find . -name "Kconfig*"); do + mkdir -p $fs/$path/$(echo $i | sed 's|/Kconfig.*||') + cp -a $src/$i $fs/$path/$i + done + + chown -R root.root $fs/$path + find $fs/$path -type d -exec chmod 755 {} \; + # remove unneeded architectures + rm -rf $fs/$path/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa} + +} + +pre_remove() { + if [ -e $1/usr/src/linux ]; then + rm -rf $1/usr/src/linux + fi +} + +post_install() { + # Added soft link to make it easier to point to kernel folder + [ -L $1/usr/src/linux ] && rm -f $1/usr/src/linux + ln -sf /usr/src/linux-$KVERSION $1/usr/src/linux +} diff -r 13a47f61c87b -r abe27fd0192d linux-libre-mwave/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-mwave/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,38 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-mwave" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel ACP Modem driver module (for IBM Thinkpad)" +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-mwave" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/char/mwave | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-ncpfs/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-ncpfs/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-ncpfs" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel ncpfs module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-ncpfs" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/ncpfs | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-netfilter/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-netfilter/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,48 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-netfilter" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel netfilter modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-netfilter" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + + export src + export _pkg + + $WOK/$WANTED/stuff/list_modules.sh net/netfilter net/ipv4/netfilter net/8021q | \ + while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + rm -r $fs/$path/net/ipv6 + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-nfsd/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-nfsd/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-nfsd" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel NFS server module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-nfsd" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/nfsd | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-reiserfs/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-reiserfs/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-reiserfs" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel reiserfs module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-reiserfs" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/reiserfs | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-sched/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-sched/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,41 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-sched" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel sched modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-sched" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + + export src + export _pkg + + $WOK/$WANTED/stuff/list_modules.sh net/sched | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-scsi/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-scsi/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,38 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-scsi" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel scsi modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-scsi" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/scsi | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-sound/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-sound/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,49 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-sound" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel sound modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-sound" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh sound | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + mkdir $fs/lib/firmware + for i in ess korg sun yamaha; do + cp -a $_pkg/lib/firmware/$i $fs/lib/firmware + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done + +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-source/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-source/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,35 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-source" +VERSION="2.6.37-libre" +CATEGORY="development" +SHORT_DESC="The Linux Libre kernel source files." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-source" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +DEPENDS="linux-libre slitaz-toolchain ncurses-dev perl" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` + local AUFSDIR="aufs-${_AUFSVER}" + mkdir -p $fs/usr/src/kernel-patches \ + $fs/lib/modules/$VERSION-slitaz \ + $fs/usr/bin + cp -a $WOK/$WANTED/slitaz $fs/usr/src/kernel-patches + cp -a stuff/buildtaz $fs/usr/src/kernel-patches/slitaz + cp -a stuff/make-tazpkg.u $fs/usr/src/kernel-patches/slitaz + cp -a stuff/get-linux-source $fs/usr/bin + sed -i "s|=XXX|=$VERSION|g" $fs/usr/bin/get-linux-source + # Copy Aufs2 source files + if [ -d $WOK/$WANTED/$AUFSDIR ]; then + mkdir $fs/usr/src/kernel-patches/slitaz/aufs2 + cp -a $WOK/$WANTED/$AUFSDIR/Documentation \ + $WOK/$WANTED/$AUFSDIR/fs $WOK/$WANTED/$AUFSDIR/include \ + $fs/usr/src/kernel-patches/slitaz/aufs2 + fi + ln -s /usr/src/linux-$VERSION \ + $fs/lib/modules/$VERSION-slitaz/source +} diff -r 13a47f61c87b -r abe27fd0192d linux-libre-source/stuff/buildtaz --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-source/stuff/buildtaz Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,80 @@ +#!/bin/sh +# +# buildtaz 1.0 +# This script generate a SliTaz package for linux kernel and modules. +# Inspired from builddeb script. +# +# (C) 2009 SliTaz - GNU General Public License v3. +# +# Author: Eric Joseph-Alexandre + +set -e + +LOCALVERSION=$(grep ^CONFIG_LOCALVERSION $objtree/.config | sed -e "s/CONFIG_LOCALVERSION=\"\(.*\)\"/\1/") +PACKAGE="linux${LOCALVERSION}" +VERSION=${KERNELVERSION} +V=$KERNELRELEASE +DIR="$objtree/taz/$PACKAGE-$VERSION" +fs="$DIR/fs" + +# Setup directories +rm -rf "$objtree/taz" +mkdir -p "$fs/lib" "$fs/boot" + +# Build and install kernel +cp System.map "$fs/boot/System.map-$KERNELRELEASE" +cp $KBUILD_IMAGE "$fs/boot/vmlinuz-$KERNELRELEASE" + +# Build and compress modules if needed +if grep -q '^CONFIG_MODULES=y' .config ; then + INSTALL_MOD_PATH="$fs" make KBUILD_SRC= modules_install + [ -f $objtree/slitaz/gztazmod.sh ] && $objtree/slitaz/gztazmod.sh $fs/lib/modules/${VERSION}${LOCALVERSION} +fi + +# Create Slitaz package +cat > $DIR/receipt <> \$1/boot/grub/menu.lst + fi + + # Display information message. + echo " +---- +GRUB is installed, these tree lines must be in your /boot/grub/menu.lst: + +title SliTaz GNU/Linux (Kernel $V) +\$grub_dev +kernel /boot/vmlinuz-$V root=\$root_dev +---- +" + fi +} +EOT + +# Pack +cd $objtree/taz +tazpkg pack $PACKAGE-$VERSION +mv *.tazpkg $objtree +cd - +exit 0 diff -r 13a47f61c87b -r abe27fd0192d linux-libre-source/stuff/get-linux-source --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-source/stuff/get-linux-source Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,63 @@ +#!/bin/sh + + +source /etc/slitaz/slitaz.conf +SOURCES_REPOSITORY=$SLITAZ_DIR/$SLITAZ_VERSION/src +VERSION=XXX + +url=$(cat /usr/src/kernel-patches/slitaz/url) + +if [ ! -d $SOURCES_REPOSITORY ]; then + mkdir -p $SOURCES_REPOSITORY +fi + +cd /usr/src/ +if [ -f $SOURCE_REPOSITORY/$(basename ${url//bz2/lzma}) ]; then + unlzma -c $SOURCES_REPOSITORY/$(basename ${url//bz2/lzma}) | tar xf - -C $PWD +elif [ -f $SOURCES_REPOSITORY/$(basename $url) ]; then + tar xjf $SOURCES_REPOSITORY/$(basename $url) +else + wget -O $SOURCES_REPOSITORY/$(basename $url) -c $url + tar xjf $SOURCES_REPOSITORY/$(basename $url) +fi + +cp -a /usr/src/kernel-patches/slitaz /usr/src/linux-$VERSION +if [ -d /usr/src/linux-$VERSION/slitaz/aufs2 ]; then + cp -pa /usr/src/linux-$VERSION/slitaz/aufs2/* /usr/src/linux-$VERSION +fi + +# Add tazpkg support +if [ -d "/usr/src/linux-$VERSION/scripts/package" ]; then + cp -pa /usr/src/linux-$VERSION/slitaz/buildtaz /usr/src/linux-$VERSION/scripts/package + cd /usr/src/linux-$VERSION + patch -p1 -i slitaz/make-tazpkg.u +fi + +cd /usr/src/linux-$VERSION +while read patch_file; do + echo "Apply $patch_file" + patch -p1 < slitaz/$patch_file +done < slitaz/patches +[ ! -f System.map ] && cp slitaz/config .config && +make oldconfig && make modules_prepare + + cat <> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-toshiba/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-toshiba/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,38 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-toshiba" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel toshiba module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-toshiba" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Modules paths and list +MOD_PATH="lib/modules/$VERSION-slitaz/kernel" +MODULES="drivers/char/toshiba.ko.gz" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p ${fs}${MOD_PATH} + for module in $MODULES + do + dir=$MOD_PATH/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$MOD_PATH/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} diff -r 13a47f61c87b -r abe27fd0192d linux-libre-udf/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-udf/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,49 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-udf" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel udf module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-udf" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +CONFIG_FILES="/etc/filesystems" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path $fs/etc + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh fs/udf | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + touch $fs/etc/filesystems + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-usb-misc/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-usb-misc/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,38 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-usb-misc" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel misc. USB drivers, including the Lego USB tower." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-usb-misc" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/usb/misc | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-usbdsl/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-usbdsl/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,42 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-usbdsl" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel usb dsl modem modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-usbdsl" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + + export src + export _pkg + + $WOK/$WANTED/stuff/list_modules.sh drivers/usb/atm net/atm | \ + while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-usbip/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-usbip/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,42 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-usbip" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel usbip module." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-usbip" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +PROVIDE="usbip-module" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + export src + export _pkg + $WOK/$WANTED/stuff/list_modules.sh drivers/staging/usbip | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + grep -qs ^${PACKAGE##*-}$ $1/etc/filesystems || \ + echo "${PACKAGE##*-}" >> $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + sed -i "/^${PACKAGE##*-}\$/d" $1/etc/filesystems + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-uwb/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-uwb/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,42 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-uwb" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel uwb modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-uwb" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + + export src + export _pkg + + $WOK/$WANTED/stuff/list_modules.sh drivers/uwb drivers/usb/wusbcore \ + drivers/usb/host/whci | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-video/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-video/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,41 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-video" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel video modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-video" +DEPENDS="linux-libre" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Modules paths and list +MOD_PATH="lib/modules/$VERSION-slitaz/kernel" +MODULES="drivers/video/backlight/lcd.ko.gz +drivers/video/backlight/generic_bl.ko.gz +drivers/gpio/bt8xxgpio.ko.gz" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p ${fs}${MOD_PATH} + for module in $MODULES + do + dir=$MOD_PATH/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$MOD_PATH/$module $fs/$dir + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-wimax/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-wimax/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,45 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-wimax" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel wimax modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-wimax" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + + export src + export _pkg + + $WOK/$WANTED/stuff/list_modules.sh drivers/net/wimax net/wimax | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-wireless/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-wireless/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,51 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-wireless" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel wireless modules." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-wireless" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +DEPENDS="linux-libre-crypto wireless_tools" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$VERSION-slitaz/kernel + mkdir -p $fs/$path + + export src + export _pkg + + $WOK/$WANTED/stuff/list_modules.sh drivers/net/wireless drivers/staging/wlan-ng \ + drivers/staging/rt2860 drivers/staging/rt2870 drivers/staging/echo \ + drivers/leds net/wireless net/mac80211 drivers/staging/rtl8192e/r8192e_pci.ko.gz \ + drivers/staging/rtl8187se/r8187se.ko.gz \ + drivers/staging/rtl8192u/r8192u_usb.ko.gz drivers/staging/crystalhd/crystalhd.ko.gz \ + drivers/staging/sm7xx/sm7xx.ko.gz | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + + for i in $(cat $WOK/$WANTED/stuff/modules-$VERSION.list); do + if [ $fs/lib/modules/$VERSION-slitaz/kernel/$i ]; then + rm -f $fs/lib/modules/$VERSION-slitaz/kernel/$i + fi + done +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $VERSION-slitaz +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre-without-modules/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre-without-modules/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,18 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre-without-modules" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel without module support." +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux-without-modules" +WANTED="linux-libre" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/boot + cp -a $_pkg/bzImage $fs/boot/vmlinuz-$VERSION-slitaz-without-modules +} + diff -r 13a47f61c87b -r abe27fd0192d linux-libre/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/receipt Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,168 @@ +# SliTaz package receipt. + +PACKAGE="linux-libre" +VERSION="2.6.37-libre" +CATEGORY="base-system" +SHORT_DESC="The Linux Libre kernel and modules." +DEPENDS="depmod" +BUILD_DEPENDS="slitaz-toolchain perl git lzma patch" +MAINTAINER="gokhlayeh@slitaz.org" +PROVIDE="linux" +TARBALL="linux-$VERSION.tar.bz2" +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" +WGET_URL="http://www.fsfla.org/svnwiki/selibre/linux-libre/download/releases/$VERSION/$TARBALL" +CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep" + +# Rules to configure and make the package. +compile_rules() +{ + + # this is code to help update the kernel version faster + #for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt) + #do + # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i + #done + report open-bloc + + _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` + AUFSDIR=$WOK/$PACKAGE/aufs-${_AUFSVER} + tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; } + cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src + cp -a $AUFSDIR/*.patch $WOK/$PACKAGE/stuff + cd $src + # SliTaz db + [ -d $WOK/$PACKAGE/slitaz ] && rm -rf $WOK/$PACKAGE/slitaz 2> /dev/null + mkdir $WOK/$PACKAGE/slitaz + echo "$WGET_URL" > slitaz/url + cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz + cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz + # Apply patches + report step "Applying patches" + while read patch_file; do + echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches + cp $stuff/$patch_file $WOK/$PACKAGE/slitaz + if [ -f done.$patch_file ]; then + echo "Skipping $patch_file" + continue + fi + echo "Apply $patch_file" + patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; } + touch done.$patch_file + done < /dev/null + mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz + # Compress all modules. + report step "Compressing all modules" + $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz + ln System.map System.map-modules + ln Module.symvers Module.symvers-modules + report close-bloc +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + cp -a $_pkg/boot $fs + # Compress all modules. + #./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz + path=$fs/lib/modules/$VERSION-slitaz/kernel + mkdir -p $path + cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \ + $fs/lib/modules/$VERSION-slitaz + # Get the base modules + export src + export _pkg + mkdir $WOK/$PACKAGE/tmp + $WOK/$PACKAGE/stuff/list_modules.sh \ + $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list + while read module; do + dir=$(dirname $module) + [ -d $path/$dir ] || mkdir -p $path/$dir + cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir + done < $WOK/$PACKAGE/tmp/modules.list + # Remove unresolved links + rm -f $fs/lib/modules/$VERSION-slitaz/build + rm -f $fs/lib/modules/$VERSION-slitaz/source + # Cook all packages with a kernel module + for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt) + do + echo tazwok cook ${i%/receipt} + done + # Check and echo any module in kernel .config that's not added to + # one of linux-* pkgs + ./stuff/check_modules.sh +} + +# Pre and post install commands for Tazpkg. +post_install() +{ + echo "Processing post-install commands..." + chroot "$1/" depmod -a $VERSION-slitaz + # GRUB stuff. + if [ -f "$1/boot/grub/menu.lst" ]; then + root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1` + grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1` + # Add new kernel entry in case of upgrade for installed system. + if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then + cat >> $1/boot/grub/menu.lst << EOT + +title SliTaz GNU/Linux (Kernel $VERSION-slitaz) +$grub_dev +kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev +EOT + fi + # Display information message. + cat < +Date: Thu, 2 Dec 2010 19:14:37 +0000 (+0200) +Subject: Decompressors: Add boot-time XZ support +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fpkl%2Fsquashfs-xz.git;a=commitdiff_plain;h=c64bc9a229b46db75d7761601dd8ca25385a7780 + +Decompressors: Add boot-time XZ support + +This implements the API defined in +which is used for kernel, initramfs, and initrd decompression. +This patch together with the first patch is enough for +XZ-compressed initramfs and initrd; XZ-compressed kernel will +need arch-specific changes. + +In contrast to other initramfs compression methods, support for +XZ-compressed initramfs is not enabled by default in usr/Kconfig. +This is primarily due to the Kconfig options of the xz_dec +module. It can be good to require that xz_dec is enabled +separately so the user can select only the BCJ filters he needs +when EMBEDDED=y. + +The buffering requirements described in decompress_unxz.c are +stricter than with gzip, so the relevant changes should be done +to the arch-specific code when adding support for XZ-compressed +kernel. Similarly, the heap size in arch-specific pre-boot code +may need to be increased (30 KiB is enough). + +The XZ decompressor needs memmove(), memeq() (memcmp() == 0), +and memzero() (memset(ptr, 0, size)), which aren't available in +all arch-specific pre-boot environments. I'm including simple +versions in decompress_unxz.c, but a cleaner solution would +naturally be nicer. + +Signed-off-by: Lasse Collin +--- + +diff --git a/include/linux/decompress/unxz.h b/include/linux/decompress/unxz.h +new file mode 100644 +index 0000000..41728fc +--- /dev/null ++++ b/include/linux/decompress/unxz.h +@@ -0,0 +1,19 @@ ++/* ++ * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd ++ * ++ * Author: Lasse Collin ++ * ++ * This file has been put into the public domain. ++ * You can do whatever you want with this file. ++ */ ++ ++#ifndef DECOMPRESS_UNXZ_H ++#define DECOMPRESS_UNXZ_H ++ ++int unxz(unsigned char *in, int in_size, ++ int (*fill)(void *dest, unsigned int size), ++ int (*flush)(void *src, unsigned int size), ++ unsigned char *out, int *in_used, ++ void (*error)(char *x)); ++ ++#endif +diff --git a/init/Kconfig b/init/Kconfig +index 2de5b1c..d9fbb0f 100644 +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -123,13 +123,16 @@ config HAVE_KERNEL_BZIP2 + config HAVE_KERNEL_LZMA + bool + ++config HAVE_KERNEL_XZ ++ bool ++ + config HAVE_KERNEL_LZO + bool + + choice + prompt "Kernel compression mode" + default KERNEL_GZIP +- depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_LZO ++ depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO + help + The linux kernel is a kind of self-extracting executable. + Several compression algorithms are available, which differ +@@ -174,6 +177,21 @@ config KERNEL_LZMA + two. Compression is slowest. The kernel size is about 33% + smaller with LZMA in comparison to gzip. + ++config KERNEL_XZ ++ bool "XZ" ++ depends on HAVE_KERNEL_XZ ++ help ++ XZ uses the LZMA2 algorithm and instruction set specific ++ BCJ filters which can improve compression ratio of executable ++ code. The size of the kernel is about 30% smaller with XZ in ++ comparison to gzip. On architectures for which there is a BCJ ++ filter (i386, x86_64, ARM, IA-64, PowerPC, and SPARC), XZ ++ will create a few percent smaller kernel than plain LZMA. ++ ++ The speed is about the same as with LZMA: The decompression ++ speed of XZ is better than that of bzip2 but worse than gzip ++ and LZO. Compression is slow. ++ + config KERNEL_LZO + bool "LZO" + depends on HAVE_KERNEL_LZO +diff --git a/lib/Kconfig b/lib/Kconfig +index 6090314..45960e1 100644 +--- a/lib/Kconfig ++++ b/lib/Kconfig +@@ -122,6 +122,9 @@ config DECOMPRESS_BZIP2 + config DECOMPRESS_LZMA + tristate + ++config DECOMPRESS_XZ ++ tristate ++ + config DECOMPRESS_LZO + select LZO_DECOMPRESS + tristate +diff --git a/lib/Makefile b/lib/Makefile +index f2f98dd..06e3d8a 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -75,6 +75,7 @@ obj-$(CONFIG_RAID6_PQ) += raid6/ + lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o + lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o + lib-$(CONFIG_DECOMPRESS_LZMA) += decompress_unlzma.o ++lib-$(CONFIG_DECOMPRESS_XZ) += decompress_unxz.o + lib-$(CONFIG_DECOMPRESS_LZO) += decompress_unlzo.o + + obj-$(CONFIG_TEXTSEARCH) += textsearch.o +diff --git a/lib/decompress.c b/lib/decompress.c +index a760681..3d766b7 100644 +--- a/lib/decompress.c ++++ b/lib/decompress.c +@@ -8,6 +8,7 @@ + + #include + #include ++#include + #include + #include + +@@ -23,6 +24,9 @@ + #ifndef CONFIG_DECOMPRESS_LZMA + # define unlzma NULL + #endif ++#ifndef CONFIG_DECOMPRESS_XZ ++# define unxz NULL ++#endif + #ifndef CONFIG_DECOMPRESS_LZO + # define unlzo NULL + #endif +@@ -36,6 +40,7 @@ static const struct compress_format { + { {037, 0236}, "gzip", gunzip }, + { {0x42, 0x5a}, "bzip2", bunzip2 }, + { {0x5d, 0x00}, "lzma", unlzma }, ++ { {0xfd, 0x37}, "xz", unxz }, + { {0x89, 0x4c}, "lzo", unlzo }, + { {0, 0}, NULL, NULL } + }; +diff --git a/lib/decompress_unxz.c b/lib/decompress_unxz.c +new file mode 100644 +index 0000000..cecd23d +--- /dev/null ++++ b/lib/decompress_unxz.c +@@ -0,0 +1,397 @@ ++/* ++ * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd ++ * ++ * Author: Lasse Collin ++ * ++ * This file has been put into the public domain. ++ * You can do whatever you want with this file. ++ */ ++ ++/* ++ * Important notes about in-place decompression ++ * ++ * At least on x86, the kernel is decompressed in place: the compressed data ++ * is placed to the end of the output buffer, and the decompressor overwrites ++ * most of the compressed data. There must be enough safety margin to ++ * guarantee that the write position is always behind the read position. ++ * ++ * The safety margin for XZ with LZMA2 or BCJ+LZMA2 is calculated below. ++ * Note that the margin with XZ is bigger than with Deflate (gzip)! ++ * ++ * The worst case for in-place decompression is that the beginning of ++ * the file is compressed extremely well, and the rest of the file is ++ * uncompressible. Thus, we must look for worst-case expansion when the ++ * compressor is encoding uncompressible data. ++ * ++ * The structure of the .xz file in case of a compresed kernel is as follows. ++ * Sizes (as bytes) of the fields are in parenthesis. ++ * ++ * Stream Header (12) ++ * Block Header: ++ * Block Header (8-12) ++ * Compressed Data (N) ++ * Block Padding (0-3) ++ * CRC32 (4) ++ * Index (8-20) ++ * Stream Footer (12) ++ * ++ * Normally there is exactly one Block, but let's assume that there are ++ * 2-4 Blocks just in case. Because Stream Header and also Block Header ++ * of the first Block don't make the decompressor produce any uncompressed ++ * data, we can ignore them from our calculations. Block Headers of possible ++ * additional Blocks have to be taken into account still. With these ++ * assumptions, it is safe to assume that the total header overhead is ++ * less than 128 bytes. ++ * ++ * Compressed Data contains LZMA2 or BCJ+LZMA2 encoded data. Since BCJ ++ * doesn't change the size of the data, it is enough to calculate the ++ * safety margin for LZMA2. ++ * ++ * LZMA2 stores the data in chunks. Each chunk has a header whose size is ++ * a maximum of 6 bytes, but to get round 2^n numbers, let's assume that ++ * the maximum chunk header size is 8 bytes. After the chunk header, there ++ * may be up to 64 KiB of actual payload in the chunk. Often the payload is ++ * quite a bit smaller though; to be safe, let's assume that an average ++ * chunk has only 32 KiB of payload. ++ * ++ * The maximum uncompressed size of the payload is 2 MiB. The minimum ++ * uncompressed size of the payload is in practice never less than the ++ * payload size itself. The LZMA2 format would allow uncompressed size ++ * to be less than the payload size, but no sane compressor creates such ++ * files. LZMA2 supports storing uncompressible data in uncompressed form, ++ * so there's never a need to create payloads whose uncompressed size is ++ * smaller than the compressed size. ++ * ++ * The assumption, that the uncompressed size of the payload is never ++ * smaller than the payload itself, is valid only when talking about ++ * the payload as a whole. It is possible that the payload has parts where ++ * the decompressor consumes more input than it produces output. Calculating ++ * the worst case for this would be tricky. Instead of trying to do that, ++ * let's simply make sure that the decompressor never overwrites any bytes ++ * of the payload which it is currently reading. ++ * ++ * Now we have enough information to calculate the safety margin. We need ++ * - 128 bytes for the .xz file format headers; ++ * - 8 bytes per every 32 KiB of uncompressed size (one LZMA2 chunk header ++ * per chunk, each chunk having average payload size of 32 KiB); and ++ * - 64 KiB (biggest possible LZMA2 chunk payload size) to make sure that ++ * the decompressor never overwrites anything from the LZMA2 chunk ++ * payload it is currently reading. ++ * ++ * We get the following formula: ++ * ++ * safety_margin = 128 + uncompressed_size * 8 / 32768 + 65536 ++ * = 128 + (uncompressed_size >> 12) + 65536 ++ * ++ * For comparision, according to arch/x86/boot/compressed/misc.c, the ++ * equivalent formula for Deflate is this: ++ * ++ * safety_margin = 18 + (uncompressed_size >> 12) + 32768 ++ * ++ * Thus, when updating Deflate-only in-place kernel decompressor to ++ * support XZ, the fixed overhead has to be increased from 18+32768 bytes ++ * to 128+65536 bytes. ++ */ ++ ++/* ++ * STATIC is defined to "static" if we are being built for kernel ++ * decompression (pre-boot code). will define ++ * STATIC to empty if it wasn't already defined. Since we will need to ++ * know later if we are being used for kernel decompression, we define ++ * XZ_PREBOOT here. ++ */ ++#ifdef STATIC ++# define XZ_PREBOOT ++#endif ++#ifdef __KERNEL__ ++# include ++#endif ++#define XZ_EXTERN STATIC ++ ++#ifndef XZ_PREBOOT ++# include ++# include ++#else ++/* ++ * Use the internal CRC32 code instead of kernel's CRC32 module, which ++ * is not available in early phase of booting. ++ */ ++#define XZ_INTERNAL_CRC32 1 ++ ++/* ++ * For boot time use, we enable only the BCJ filter of the current ++ * architecture or none if no BCJ filter is available for the architecture. ++ */ ++#ifdef CONFIG_X86 ++# define XZ_DEC_X86 ++#endif ++#ifdef CONFIG_PPC ++# define XZ_DEC_POWERPC ++#endif ++#ifdef CONFIG_ARM ++# define XZ_DEC_ARM ++#endif ++#ifdef CONFIG_IA64 ++# define XZ_DEC_IA64 ++#endif ++#ifdef CONFIG_SPARC ++# define XZ_DEC_SPARC ++#endif ++ ++/* ++ * This will get the basic headers so that memeq() and others ++ * can be defined. ++ */ ++#include "xz/xz_private.h" ++ ++/* ++ * Replace the normal allocation functions with the versions from ++ * . vfree() needs to support vfree(NULL) ++ * when XZ_DYNALLOC is used, but the pre-boot free() doesn't support it. ++ * Workaround it here because the other decompressors don't need it. ++ */ ++#undef kmalloc ++#undef kfree ++#undef vmalloc ++#undef vfree ++#define kmalloc(size, flags) malloc(size) ++#define kfree(ptr) free(ptr) ++#define vmalloc(size) malloc(size) ++#define vfree(ptr) do { if (ptr != NULL) free(ptr); } while (0) ++ ++/* ++ * FIXME: Not all basic memory functions are provided in architecture-specific ++ * files (yet). We define our own versions here for now, but this should be ++ * only a temporary solution. ++ * ++ * memeq and memzero are not used much and any remotely sane implementation ++ * is fast enough. memcpy/memmove speed matters in multi-call mode, but ++ * the kernel image is decompressed in single-call mode, in which only ++ * memcpy speed can matter and only if there is a lot of uncompressible data ++ * (LZMA2 stores uncompressible chunks in uncompressed form). Thus, the ++ * functions below should just be kept small; it's probably not worth ++ * optimizing for speed. ++ */ ++ ++#ifndef memeq ++static bool memeq(const void *a, const void *b, size_t size) ++{ ++ const uint8_t *x = a; ++ const uint8_t *y = b; ++ size_t i; ++ ++ for (i = 0; i < size; ++i) ++ if (x[i] != y[i]) ++ return false; ++ ++ return true; ++} ++#endif ++ ++#ifndef memzero ++static void memzero(void *buf, size_t size) ++{ ++ uint8_t *b = buf; ++ uint8_t *e = b + size; ++ ++ while (b != e) ++ *b++ = '\0'; ++} ++#endif ++ ++#ifndef memmove ++/* Not static to avoid a conflict with the prototype in the Linux headers. */ ++void *memmove(void *dest, const void *src, size_t size) ++{ ++ uint8_t *d = dest; ++ const uint8_t *s = src; ++ size_t i; ++ ++ if (d < s) { ++ for (i = 0; i < size; ++i) ++ d[i] = s[i]; ++ } else if (d > s) { ++ i = size; ++ while (i-- > 0) ++ d[i] = s[i]; ++ } ++ ++ return dest; ++} ++#endif ++ ++/* ++ * Since we need memmove anyway, would use it as memcpy too. ++ * Commented out for now to avoid breaking things. ++ */ ++/* ++#ifndef memcpy ++# define memcpy memmove ++#endif ++*/ ++ ++#include "xz/xz_crc32.c" ++#include "xz/xz_dec_stream.c" ++#include "xz/xz_dec_lzma2.c" ++#include "xz/xz_dec_bcj.c" ++ ++#endif /* XZ_PREBOOT */ ++ ++/* Size of the input and output buffers in multi-call mode */ ++#define XZ_IOBUF_SIZE 4096 ++ ++/* ++ * This function implements the API defined in . ++ * ++ * This wrapper will automatically choose single-call or multi-call mode ++ * of the native XZ decoder API. The single-call mode can be used only when ++ * both input and output buffers are available as a single chunk, i.e. when ++ * fill() and flush() won't be used. ++ */ ++STATIC int INIT unxz(unsigned char *in, int in_size, ++ int (*fill)(void *dest, unsigned int size), ++ int (*flush)(void *src, unsigned int size), ++ unsigned char *out, int *in_used, ++ void (*error)(char *x)) ++{ ++ struct xz_buf b; ++ struct xz_dec *s; ++ enum xz_ret ret; ++ bool must_free_in = false; ++ ++#if XZ_INTERNAL_CRC32 ++ xz_crc32_init(); ++#endif ++ ++ if (in_used != NULL) ++ *in_used = 0; ++ ++ if (fill == NULL && flush == NULL) ++ s = xz_dec_init(XZ_SINGLE, 0); ++ else ++ s = xz_dec_init(XZ_DYNALLOC, (uint32_t)-1); ++ ++ if (s == NULL) ++ goto error_alloc_state; ++ ++ if (flush == NULL) { ++ b.out = out; ++ b.out_size = (size_t)-1; ++ } else { ++ b.out_size = XZ_IOBUF_SIZE; ++ b.out = malloc(XZ_IOBUF_SIZE); ++ if (b.out == NULL) ++ goto error_alloc_out; ++ } ++ ++ if (in == NULL) { ++ must_free_in = true; ++ in = malloc(XZ_IOBUF_SIZE); ++ if (in == NULL) ++ goto error_alloc_in; ++ } ++ ++ b.in = in; ++ b.in_pos = 0; ++ b.in_size = in_size; ++ b.out_pos = 0; ++ ++ if (fill == NULL && flush == NULL) { ++ ret = xz_dec_run(s, &b); ++ } else { ++ do { ++ if (b.in_pos == b.in_size && fill != NULL) { ++ if (in_used != NULL) ++ *in_used += b.in_pos; ++ ++ b.in_pos = 0; ++ ++ in_size = fill(in, XZ_IOBUF_SIZE); ++ if (in_size < 0) { ++ /* ++ * This isn't an optimal error code ++ * but it probably isn't worth making ++ * a new one either. ++ */ ++ ret = XZ_BUF_ERROR; ++ break; ++ } ++ ++ b.in_size = in_size; ++ } ++ ++ ret = xz_dec_run(s, &b); ++ ++ if (flush != NULL && (b.out_pos == b.out_size ++ || (ret != XZ_OK && b.out_pos > 0))) { ++ /* ++ * Setting ret here may hide an error ++ * returned by xz_dec_run(), but probably ++ * it's not too bad. ++ */ ++ if (flush(b.out, b.out_pos) != (int)b.out_pos) ++ ret = XZ_BUF_ERROR; ++ ++ b.out_pos = 0; ++ } ++ } while (ret == XZ_OK); ++ ++ if (must_free_in) ++ free(in); ++ ++ if (flush != NULL) ++ free(b.out); ++ } ++ ++ if (in_used != NULL) ++ *in_used += b.in_pos; ++ ++ xz_dec_end(s); ++ ++ switch (ret) { ++ case XZ_STREAM_END: ++ return 0; ++ ++ case XZ_MEM_ERROR: ++ /* This can occur only in multi-call mode. */ ++ error("XZ decompressor ran out of memory"); ++ break; ++ ++ case XZ_FORMAT_ERROR: ++ error("Input is not in the XZ format (wrong magic bytes)"); ++ break; ++ ++ case XZ_OPTIONS_ERROR: ++ error("Input was encoded with settings that are not " ++ "supported by this XZ decoder"); ++ break; ++ ++ case XZ_DATA_ERROR: ++ case XZ_BUF_ERROR: ++ error("XZ-compressed data is corrupt"); ++ break; ++ ++ default: ++ error("Bug in the XZ decompressor"); ++ break; ++ } ++ ++ return -1; ++ ++error_alloc_in: ++ if (flush != NULL) ++ free(b.out); ++ ++error_alloc_out: ++ xz_dec_end(s); ++ ++error_alloc_state: ++ error("XZ decompressor ran out of memory"); ++ return -1; ++} ++ ++/* ++ * This macro is used by architecture-specific files to decompress ++ * the kernel image. ++ */ ++#define decompress unxz +diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh +index 5958fff..55caecd 100644 +--- a/scripts/gen_initramfs_list.sh ++++ b/scripts/gen_initramfs_list.sh +@@ -243,6 +243,8 @@ case "$arg" in + echo "$output_file" | grep -q "\.gz$" && compr="gzip -9 -f" + echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f" + echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f" ++ echo "$output_file" | grep -q "\.xz$" && \ ++ compr="xz --check=crc32 --lzma2=dict=1MiB" + echo "$output_file" | grep -q "\.lzo$" && compr="lzop -9 -f" + echo "$output_file" | grep -q "\.cpio$" && compr="cat" + shift +diff --git a/usr/Kconfig b/usr/Kconfig +index e2721f5..9f51a29 100644 +--- a/usr/Kconfig ++++ b/usr/Kconfig +@@ -72,6 +72,18 @@ config RD_LZMA + Support loading of a LZMA encoded initial ramdisk or cpio buffer + If unsure, say N. + ++config RD_XZ ++ bool "Support initial ramdisks compressed using XZ" ++ depends on BLK_DEV_INITRD && XZ_DEC=y ++ select DECOMPRESS_XZ ++ help ++ Support loading of a XZ encoded initial ramdisk or cpio buffer. ++ ++ If this option is inactive, say Y to "XZ decompression support" ++ under "Library routines" first. ++ ++ If unsure, say N. ++ + config RD_LZO + bool "Support initial ramdisks compressed using LZO" if EMBEDDED + default !EMBEDDED +@@ -139,6 +151,15 @@ config INITRAMFS_COMPRESSION_LZMA + three. Compression is slowest. The initramfs size is about 33% + smaller with LZMA in comparison to gzip. + ++config INITRAMFS_COMPRESSION_XZ ++ bool "XZ" ++ depends on RD_XZ ++ help ++ XZ uses the LZMA2 algorithm. The initramfs size is about 30% ++ smaller with XZ in comparison to gzip. Decompression speed ++ is better than that of bzip2 but worse than gzip and LZO. ++ Compression is slow. ++ + config INITRAMFS_COMPRESSION_LZO + bool "LZO" + depends on RD_LZO +diff --git a/usr/Makefile b/usr/Makefile +index 6b4b6da..5845a13 100644 +--- a/usr/Makefile ++++ b/usr/Makefile +@@ -15,6 +15,9 @@ suffix_$(CONFIG_INITRAMFS_COMPRESSION_BZIP2) = .bz2 + # Lzma + suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZMA) = .lzma + ++# XZ ++suffix_$(CONFIG_INITRAMFS_COMPRESSION_XZ) = .xz ++ + # Lzo + suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZO) = .lzo + +@@ -48,7 +51,7 @@ endif + quiet_cmd_initfs = GEN $@ + cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input) + +-targets := initramfs_data.cpio.gz initramfs_data.cpio.bz2 initramfs_data.cpio.lzma initramfs_data.cpio.lzo initramfs_data.cpio ++targets := initramfs_data.cpio.gz initramfs_data.cpio.bz2 initramfs_data.cpio.lzma initramfs_data.cpio.xz initramfs_data.cpio.lzo initramfs_data.cpio + # do not try to update files included in initramfs + $(deps_initramfs): ; + diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/003-squashfs-x86-support-xz-compressed-kernel.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/003-squashfs-x86-support-xz-compressed-kernel.patch Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,128 @@ +From: Lasse Collin +Date: Thu, 2 Dec 2010 19:14:57 +0000 (+0200) +Subject: x86: Support XZ-compressed kernel +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fpkl%2Fsquashfs-xz.git;a=commitdiff_plain;h=d4ad78414e5312126127b1f88cdaf8584af3eef1 + +x86: Support XZ-compressed kernel + +This integrates the XZ decompression code to the x86 +pre-boot code. + +mkpiggy.c is updated to reserve about 32 KiB more buffer safety +margin for kernel decompression. It is done unconditionally for +all decompressors to keep the code simpler. + +The XZ decompressor needs around 30 KiB of heap, so the heap size +is increased to 32 KiB on both x86-32 and x86-64. + +Documentation/x86/boot.txt is updated to list the XZ magic number. + +With the x86 BCJ filter in XZ, XZ-compressed x86 kernel tends to be +a few percent smaller than the equivalent LZMA-compressed kernel. + +Signed-off-by: Lasse Collin +--- + +diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt +index 30b43e1..3988cde 100644 +--- a/Documentation/x86/boot.txt ++++ b/Documentation/x86/boot.txt +@@ -621,9 +621,9 @@ Protocol: 2.08+ + The payload may be compressed. The format of both the compressed and + uncompressed data should be determined using the standard magic + numbers. The currently supported compression formats are gzip +- (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A) and LZMA +- (magic number 5D 00). The uncompressed payload is currently always ELF +- (magic number 7F 45 4C 46). ++ (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A), LZMA ++ (magic number 5D 00), and XZ (magic number FD 37). The uncompressed ++ payload is currently always ELF (magic number 7F 45 4C 46). + + Field name: payload_length + Type: read +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index cea0cd9..f3db0d7 100644 +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -51,6 +51,7 @@ config X86 + select HAVE_KERNEL_GZIP + select HAVE_KERNEL_BZIP2 + select HAVE_KERNEL_LZMA ++ select HAVE_KERNEL_XZ + select HAVE_KERNEL_LZO + select HAVE_HW_BREAKPOINT + select HAVE_MIXED_BREAKPOINTS_REGS +diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile +index 0c22955..09664ef 100644 +--- a/arch/x86/boot/compressed/Makefile ++++ b/arch/x86/boot/compressed/Makefile +@@ -4,7 +4,7 @@ + # create a compressed vmlinux image from the original vmlinux + # + +-targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.lzo head_$(BITS).o misc.o string.o cmdline.o early_serial_console.o piggy.o ++targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo head_$(BITS).o misc.o string.o cmdline.o early_serial_console.o piggy.o + + KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 + KBUILD_CFLAGS += -fno-strict-aliasing -fPIC +@@ -49,12 +49,15 @@ $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE + $(call if_changed,bzip2) + $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE + $(call if_changed,lzma) ++$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE ++ $(call if_changed,xzkern) + $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE + $(call if_changed,lzo) + + suffix-$(CONFIG_KERNEL_GZIP) := gz + suffix-$(CONFIG_KERNEL_BZIP2) := bz2 + suffix-$(CONFIG_KERNEL_LZMA) := lzma ++suffix-$(CONFIG_KERNEL_XZ) := xz + suffix-$(CONFIG_KERNEL_LZO) := lzo + + quiet_cmd_mkpiggy = MKPIGGY $@ +diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c +index 8f7bef8..6d4cab7 100644 +--- a/arch/x86/boot/compressed/misc.c ++++ b/arch/x86/boot/compressed/misc.c +@@ -139,6 +139,10 @@ static int lines, cols; + #include "../../../../lib/decompress_unlzma.c" + #endif + ++#ifdef CONFIG_KERNEL_XZ ++#include "../../../../lib/decompress_unxz.c" ++#endif ++ + #ifdef CONFIG_KERNEL_LZO + #include "../../../../lib/decompress_unlzo.c" + #endif +diff --git a/arch/x86/boot/compressed/mkpiggy.c b/arch/x86/boot/compressed/mkpiggy.c +index 5c22812..646aa78 100644 +--- a/arch/x86/boot/compressed/mkpiggy.c ++++ b/arch/x86/boot/compressed/mkpiggy.c +@@ -74,7 +74,7 @@ int main(int argc, char *argv[]) + + offs = (olen > ilen) ? olen - ilen : 0; + offs += olen >> 12; /* Add 8 bytes for each 32K block */ +- offs += 32*1024 + 18; /* Add 32K + 18 bytes slack */ ++ offs += 64*1024 + 128; /* Add 64K + 128 bytes slack */ + offs = (offs+4095) & ~4095; /* Round to a 4K boundary */ + + printf(".section \".rodata..compressed\",\"a\",@progbits\n"); +diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h +index 3b62ab5..5e1a2ee 100644 +--- a/arch/x86/include/asm/boot.h ++++ b/arch/x86/include/asm/boot.h +@@ -32,11 +32,7 @@ + #define BOOT_HEAP_SIZE 0x400000 + #else /* !CONFIG_KERNEL_BZIP2 */ + +-#ifdef CONFIG_X86_64 +-#define BOOT_HEAP_SIZE 0x7000 +-#else +-#define BOOT_HEAP_SIZE 0x4000 +-#endif ++#define BOOT_HEAP_SIZE 0x8000 + + #endif /* !CONFIG_KERNEL_BZIP2 */ + diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/004-squashfs-add-xz-compression-support.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/004-squashfs-add-xz-compression-support.patch Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,183 @@ +From: Phillip Lougher +Date: Thu, 9 Dec 2010 02:02:29 +0000 (+0000) +Subject: Squashfs: add XZ compression support +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fpkl%2Fsquashfs-xz.git;a=commitdiff_plain;h=d3e6969b9ff1f3a3c6bf3da71433c77046aa80e4 + +Squashfs: add XZ compression support + +Add XZ decompressor wrapper code. + +Signed-off-by: Phillip Lougher +--- + +diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h +index c5137fc..39533fe 100644 +--- a/fs/squashfs/squashfs_fs.h ++++ b/fs/squashfs/squashfs_fs.h +@@ -238,6 +238,7 @@ struct meta_index { + #define ZLIB_COMPRESSION 1 + #define LZMA_COMPRESSION 2 + #define LZO_COMPRESSION 3 ++#define XZ_COMPRESSION 4 + + struct squashfs_super_block { + __le32 s_magic; +diff --git a/fs/squashfs/xz_wrapper.c b/fs/squashfs/xz_wrapper.c +new file mode 100644 +index 0000000..053fe35 +--- /dev/null ++++ b/fs/squashfs/xz_wrapper.c +@@ -0,0 +1,153 @@ ++/* ++ * Squashfs - a compressed read only filesystem for Linux ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 ++ * Phillip Lougher ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2, ++ * or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++ * ++ * xz_wrapper.c ++ */ ++ ++ ++#include ++#include ++#include ++#include ++ ++#include "squashfs_fs.h" ++#include "squashfs_fs_sb.h" ++#include "squashfs_fs_i.h" ++#include "squashfs.h" ++#include "decompressor.h" ++ ++struct squashfs_xz { ++ struct xz_dec *state; ++ struct xz_buf buf; ++}; ++ ++static void *squashfs_xz_init(struct squashfs_sb_info *msblk) ++{ ++ int block_size = max_t(int, msblk->block_size, SQUASHFS_METADATA_SIZE); ++ ++ struct squashfs_xz *stream = kmalloc(sizeof(*stream), GFP_KERNEL); ++ if (stream == NULL) ++ goto failed; ++ stream->state = xz_dec_init(XZ_PREALLOC, block_size); ++ if (stream->state == NULL) ++ goto failed; ++ ++ return stream; ++ ++failed: ++ ERROR("Failed to allocate xz workspace\n"); ++ kfree(stream); ++ return NULL; ++} ++ ++ ++static void squashfs_xz_free(void *strm) ++{ ++ struct squashfs_xz *stream = strm; ++ ++ if (stream) { ++ xz_dec_end(stream->state); ++ kfree(stream); ++ } ++} ++ ++ ++static int squashfs_xz_uncompress(struct squashfs_sb_info *msblk, void **buffer, ++ struct buffer_head **bh, int b, int offset, int length, int srclength, ++ int pages) ++{ ++ enum xz_ret xz_err; ++ int avail, total = 0, k = 0, page = 0; ++ struct squashfs_xz *stream = msblk->stream; ++ ++ mutex_lock(&msblk->read_data_mutex); ++ ++ xz_dec_reset(stream->state); ++ stream->buf.in_pos = 0; ++ stream->buf.in_size = 0; ++ stream->buf.out_pos = 0; ++ stream->buf.out_size = PAGE_CACHE_SIZE; ++ stream->buf.out = buffer[page++]; ++ ++ do { ++ if (stream->buf.in_pos == stream->buf.in_size && k < b) { ++ avail = min(length, msblk->devblksize - offset); ++ length -= avail; ++ wait_on_buffer(bh[k]); ++ if (!buffer_uptodate(bh[k])) ++ goto release_mutex; ++ ++ if (avail == 0) { ++ offset = 0; ++ put_bh(bh[k++]); ++ continue; ++ } ++ ++ stream->buf.in = bh[k]->b_data + offset; ++ stream->buf.in_size = avail; ++ stream->buf.in_pos = 0; ++ offset = 0; ++ } ++ ++ if (stream->buf.out_pos == stream->buf.out_size ++ && page < pages) { ++ stream->buf.out = buffer[page++]; ++ stream->buf.out_pos = 0; ++ total += PAGE_CACHE_SIZE; ++ } ++ ++ xz_err = xz_dec_run(stream->state, &stream->buf); ++ ++ if (stream->buf.in_pos == stream->buf.in_size && k < b) ++ put_bh(bh[k++]); ++ } while (xz_err == XZ_OK); ++ ++ if (xz_err != XZ_STREAM_END) { ++ ERROR("xz_dec_run error, data probably corrupt\n"); ++ goto release_mutex; ++ } ++ ++ if (k < b) { ++ ERROR("xz_uncompress error, input remaining\n"); ++ goto release_mutex; ++ } ++ ++ total += stream->buf.out_pos; ++ mutex_unlock(&msblk->read_data_mutex); ++ return total; ++ ++release_mutex: ++ mutex_unlock(&msblk->read_data_mutex); ++ ++ for (; k < b; k++) ++ put_bh(bh[k]); ++ ++ return -EIO; ++} ++ ++const struct squashfs_decompressor squashfs_xz_comp_ops = { ++ .init = squashfs_xz_init, ++ .free = squashfs_xz_free, ++ .decompress = squashfs_xz_uncompress, ++ .id = XZ_COMPRESSION, ++ .name = "xz", ++ .supported = 1 ++}; ++ diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/005-squashfs-add-xz-compression-configuration-option.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/005-squashfs-add-xz-compression-configuration-option.patch Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,86 @@ +From: Phillip Lougher +Date: Thu, 9 Dec 2010 02:08:31 +0000 (+0000) +Subject: Squashfs: Add XZ compression configuration option +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fpkl%2Fsquashfs-xz.git;a=commitdiff_plain;h=e23d468968e608de27328888240de27d7582ad52 + +Squashfs: Add XZ compression configuration option + +Signed-off-by: Phillip Lougher +--- + +diff --git a/fs/squashfs/Kconfig b/fs/squashfs/Kconfig +index e5f63da..e96d99a 100644 +--- a/fs/squashfs/Kconfig ++++ b/fs/squashfs/Kconfig +@@ -53,6 +53,22 @@ config SQUASHFS_LZO + + If unsure, say N. + ++config SQUASHFS_XZ ++ bool "Include support for XZ compressed file systems" ++ depends on SQUASHFS ++ default n ++ select XZ_DEC ++ help ++ Saying Y here includes support for reading Squashfs file systems ++ compressed with XZ compresssion. XZ gives better compression than ++ the default zlib compression, at the expense of greater CPU and ++ memory overhead. ++ ++ XZ is not the standard compression used in Squashfs and so most ++ file systems will be readable without selecting this option. ++ ++ If unsure, say N. ++ + config SQUASHFS_EMBEDDED + bool "Additional option for memory-constrained systems" + depends on SQUASHFS +diff --git a/fs/squashfs/Makefile b/fs/squashfs/Makefile +index 7672bac..cecf2be 100644 +--- a/fs/squashfs/Makefile ++++ b/fs/squashfs/Makefile +@@ -7,3 +7,4 @@ squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o + squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o + squashfs-$(CONFIG_SQUASHFS_XATTR) += xattr.o xattr_id.o + squashfs-$(CONFIG_SQUASHFS_LZO) += lzo_wrapper.o ++squashfs-$(CONFIG_SQUASHFS_XZ) += xz_wrapper.o +diff --git a/fs/squashfs/decompressor.c b/fs/squashfs/decompressor.c +index 24af9ce..ac333b8 100644 +--- a/fs/squashfs/decompressor.c ++++ b/fs/squashfs/decompressor.c +@@ -46,6 +46,12 @@ static const struct squashfs_decompressor squashfs_lzo_unsupported_comp_ops = { + }; + #endif + ++#ifndef CONFIG_SQUASHFS_XZ ++static const struct squashfs_decompressor squashfs_xz_unsupported_comp_ops = { ++ NULL, NULL, NULL, XZ_COMPRESSION, "xz", 0 ++}; ++#endif ++ + static const struct squashfs_decompressor squashfs_unknown_comp_ops = { + NULL, NULL, NULL, 0, "unknown", 0 + }; +@@ -58,6 +64,11 @@ static const struct squashfs_decompressor *decompressor[] = { + #else + &squashfs_lzo_unsupported_comp_ops, + #endif ++#ifdef CONFIG_SQUASHFS_XZ ++ &squashfs_xz_comp_ops, ++#else ++ &squashfs_xz_unsupported_comp_ops, ++#endif + &squashfs_unknown_comp_ops + }; + +diff --git a/fs/squashfs/squashfs.h b/fs/squashfs/squashfs.h +index 5d45569..1096e2e 100644 +--- a/fs/squashfs/squashfs.h ++++ b/fs/squashfs/squashfs.h +@@ -107,3 +107,6 @@ extern const struct squashfs_decompressor squashfs_zlib_comp_ops; + + /* lzo_wrapper.c */ + extern const struct squashfs_decompressor squashfs_lzo_comp_ops; ++ ++/* xz_wrapper.c */ ++extern const struct squashfs_decompressor squashfs_xz_comp_ops; diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/aufs2-2.6.36-fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/aufs2-2.6.36-fix.patch Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,130 @@ +diff --git a/fs/file_table.c b/fs/file_table.c +index a04bdd8..fbf8908 100644 +--- a/fs/file_table.c ++++ b/fs/file_table.c +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -34,7 +33,6 @@ struct files_stat_struct files_stat = { + .max_files = NR_FILE + }; + +-DECLARE_LGLOCK(files_lglock); + DEFINE_LGLOCK(files_lglock); + + /* SLAB cache for file structures */ +@@ -394,37 +392,6 @@ void file_sb_list_del(struct file *file) + } + } + +-#ifdef CONFIG_SMP +- +-/* +- * These macros iterate all files on all CPUs for a given superblock. +- * files_lglock must be held globally. +- */ +-#define do_file_list_for_each_entry(__sb, __file) \ +-{ \ +- int i; \ +- for_each_possible_cpu(i) { \ +- struct list_head *list; \ +- list = per_cpu_ptr((__sb)->s_files, i); \ +- list_for_each_entry((__file), list, f_u.fu_list) +- +-#define while_file_list_for_each_entry \ +- } \ +-} +- +-#else +- +-#define do_file_list_for_each_entry(__sb, __file) \ +-{ \ +- struct list_head *list; \ +- list = &(sb)->s_files; \ +- list_for_each_entry((__file), list, f_u.fu_list) +- +-#define while_file_list_for_each_entry \ +-} +- +-#endif +- + int fs_may_remount_ro(struct super_block *sb) + { + struct file *file; +diff --git a/fs/statfs.c b/fs/statfs.c +index 30ea8c8..9025c98 100644 +--- a/fs/statfs.c ++++ b/fs/statfs.c +@@ -61,6 +61,7 @@ int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf) + buf->f_frsize = buf->f_bsize; + return retval; + } ++EXPORT_SYMBOL(statfs_by_dentry); + + int vfs_statfs(struct path *path, struct kstatfs *buf) + { +diff --git a/include/linux/fs.h b/include/linux/fs.h +index 63d069b..741d296 100644 +--- a/include/linux/fs.h ++++ b/include/linux/fs.h +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + + /* + * It's silly to have NR_OPEN bigger than NR_FILE, but you can change +@@ -1814,6 +1815,7 @@ extern struct vfsmount *collect_mounts(struct path *); + extern void drop_collected_mounts(struct vfsmount *); + extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, + struct vfsmount *); ++extern int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf); + extern int vfs_statfs(struct path *, struct kstatfs *); + extern int statfs_by_dentry(struct dentry *, struct kstatfs *); + extern int freeze_super(struct super_block *super); +@@ -2481,5 +2483,39 @@ int __init get_filesystem_list(char *buf); + #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ + (flag & FMODE_NONOTIFY))) + ++ ++DECLARE_LGLOCK(files_lglock); ++ ++#ifdef CONFIG_SMP ++ ++/* ++ * These macros iterate all files on all CPUs for a given superblock. ++ * files_lglock must be held globally. ++ */ ++#define do_file_list_for_each_entry(__sb, __file) \ ++{ \ ++ int i; \ ++ for_each_possible_cpu(i) { \ ++ struct list_head *list; \ ++ list = per_cpu_ptr((__sb)->s_files, i); \ ++ list_for_each_entry((__file), list, f_u.fu_list) ++ ++#define while_file_list_for_each_entry \ ++ } \ ++} ++ ++#else ++ ++#define do_file_list_for_each_entry(__sb, __file) \ ++{ \ ++ struct list_head *list; \ ++ list = &(sb)->s_files; \ ++ list_for_each_entry((__file), list, f_u.fu_list) ++ ++#define while_file_list_for_each_entry \ ++} ++ ++#endif ++ + #endif /* __KERNEL__ */ + #endif /* _LINUX_FS_H */ diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/aufs2-base.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/aufs2-base.patch Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,78 @@ +aufs2.1 base patch for linux-2.6.37 + +diff --git a/fs/namei.c b/fs/namei.c +index 4ff7ca5..a8c583f 100644 +--- a/fs/namei.c ++++ b/fs/namei.c +@@ -1161,12 +1161,12 @@ out: + * needs parent already locked. Doesn't follow mounts. + * SMP-safe. + */ +-static struct dentry *lookup_hash(struct nameidata *nd) ++struct dentry *lookup_hash(struct nameidata *nd) + { + return __lookup_hash(&nd->last, nd->path.dentry, nd); + } + +-static int __lookup_one_len(const char *name, struct qstr *this, ++int __lookup_one_len(const char *name, struct qstr *this, + struct dentry *base, int len) + { + unsigned long hash; +diff --git a/fs/splice.c b/fs/splice.c +index ce2f025..ff0ae69 100644 +--- a/fs/splice.c ++++ b/fs/splice.c +@@ -1092,8 +1092,8 @@ EXPORT_SYMBOL(generic_splice_sendpage); + /* + * Attempt to initiate a splice from pipe to file. + */ +-static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, +- loff_t *ppos, size_t len, unsigned int flags) ++long do_splice_from(struct pipe_inode_info *pipe, struct file *out, ++ loff_t *ppos, size_t len, unsigned int flags) + { + ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, + loff_t *, size_t, unsigned int); +@@ -1120,9 +1120,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, + /* + * Attempt to initiate a splice from a file to a pipe. + */ +-static long do_splice_to(struct file *in, loff_t *ppos, +- struct pipe_inode_info *pipe, size_t len, +- unsigned int flags) ++long do_splice_to(struct file *in, loff_t *ppos, ++ struct pipe_inode_info *pipe, size_t len, ++ unsigned int flags) + { + ssize_t (*splice_read)(struct file *, loff_t *, + struct pipe_inode_info *, size_t, unsigned int); +diff --git a/include/linux/namei.h b/include/linux/namei.h +index 05b441d..91bc74e 100644 +--- a/include/linux/namei.h ++++ b/include/linux/namei.h +@@ -73,6 +73,9 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *, + extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, + int (*open)(struct inode *, struct file *)); + ++extern struct dentry *lookup_hash(struct nameidata *nd); ++extern int __lookup_one_len(const char *name, struct qstr *this, ++ struct dentry *base, int len); + extern struct dentry *lookup_one_len(const char *, struct dentry *, int); + + extern int follow_down(struct path *); +diff --git a/include/linux/splice.h b/include/linux/splice.h +index 997c3b4..be9a153 100644 +--- a/include/linux/splice.h ++++ b/include/linux/splice.h +@@ -89,4 +89,10 @@ extern int splice_grow_spd(struct pipe_inode_info *, struct splice_pipe_desc *); + extern void splice_shrink_spd(struct pipe_inode_info *, + struct splice_pipe_desc *); + ++extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out, ++ loff_t *ppos, size_t len, unsigned int flags); ++extern long do_splice_to(struct file *in, loff_t *ppos, ++ struct pipe_inode_info *pipe, size_t len, ++ unsigned int flags); ++ + #endif diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/aufs2-kbuild.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/aufs2-kbuild.patch Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,35 @@ +aufs2.1 kbuild patch for linux-2.6.37 + +diff --git a/fs/Kconfig b/fs/Kconfig +index 771f457..bb1a52f 100644 +--- a/fs/Kconfig ++++ b/fs/Kconfig +@@ -191,6 +191,7 @@ source "fs/romfs/Kconfig" + source "fs/sysv/Kconfig" + source "fs/ufs/Kconfig" + source "fs/exofs/Kconfig" ++source "fs/aufs/Kconfig" + + endif # MISC_FILESYSTEMS + +diff --git a/fs/Makefile b/fs/Makefile +index a7f7cef..95dd4d3 100644 +--- a/fs/Makefile ++++ b/fs/Makefile +@@ -121,3 +121,4 @@ obj-$(CONFIG_BTRFS_FS) += btrfs/ + obj-$(CONFIG_GFS2_FS) += gfs2/ + obj-$(CONFIG_EXOFS_FS) += exofs/ + obj-$(CONFIG_CEPH_FS) += ceph/ ++obj-$(CONFIG_AUFS_FS) += aufs/ +diff --git a/include/linux/Kbuild b/include/linux/Kbuild +index 97319a8..7ebb4b4 100644 +--- a/include/linux/Kbuild ++++ b/include/linux/Kbuild +@@ -60,6 +60,7 @@ header-y += atmppp.h + header-y += atmsap.h + header-y += atmsvc.h + header-y += audit.h ++header-y += aufs_type.h + header-y += auto_fs.h + header-y += auto_fs4.h + header-y += auxvec.h diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/aufs2-module-2.6.36.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/aufs2-module-2.6.36.patch Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,47 @@ +diff --git a/ubuntu/aufs/branch.c b/ubuntu/aufs/branch.c +index cd4463c..ff6b158 100644 +--- a/fs/aufs/branch.c ++++ b/fs/aufs/branch.c +@@ -22,6 +22,8 @@ + + #include + #include ++#include ++#include + #include "aufs.h" + + /* +@@ -851,7 +853,8 @@ static int au_br_mod_files_ro(struct super_block *sb, aufs_bindex_t bindex) + goto out; + + /* no need file_list_lock() since sbinfo is locked? defered? */ +- list_for_each_entry(file, &sb->s_files, f_u.fu_list) { ++ lg_global_lock(files_lglock); ++ do_file_list_for_each_entry(sb, file) { + if (special_file(file->f_dentry->d_inode->i_mode)) + continue; + +@@ -861,6 +864,7 @@ static int au_br_mod_files_ro(struct super_block *sb, aufs_bindex_t bindex) + err = -EBUSY; + FiMustNoWaiters(file); + fi_read_unlock(file); ++ lg_global_unlock(files_lglock); + goto out_free; + } + +@@ -889,10 +893,13 @@ static int au_br_mod_files_ro(struct super_block *sb, aufs_bindex_t bindex) + if (p) { + a = p; + a[n++] = hf; +- } else ++ } else { ++ lg_global_unlock(files_lglock); + goto out_free; ++ } + } +- } ++ } while_file_list_for_each_entry; ++ lg_global_unlock(files_lglock); + + err = 0; + if (n) diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/aufs2-standalone.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/aufs2-standalone.patch Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,289 @@ +aufs2.1 standalone patch for linux-2.6.37 + +diff --git a/fs/file_table.c b/fs/file_table.c +index c3dee38..f529e4d 100644 +--- a/fs/file_table.c ++++ b/fs/file_table.c +@@ -393,6 +393,8 @@ void file_sb_list_del(struct file *file) + } + } + ++EXPORT_SYMBOL(file_sb_list_del); ++ + #ifdef CONFIG_SMP + + /* +diff --git a/fs/inode.c b/fs/inode.c +index ae2727a..2c8071a 100644 +--- a/fs/inode.c ++++ b/fs/inode.c +@@ -82,6 +82,7 @@ static struct hlist_head *inode_hashtable __read_mostly; + * the i_state of an inode while it is in use.. + */ + DEFINE_SPINLOCK(inode_lock); ++EXPORT_SYMBOL(inode_lock); + + /* + * iprune_sem provides exclusion between the kswapd or try_to_free_pages +diff --git a/fs/namei.c b/fs/namei.c +index a8c583f..b020c45 100644 +--- a/fs/namei.c ++++ b/fs/namei.c +@@ -347,6 +347,7 @@ int deny_write_access(struct file * file) + + return 0; + } ++EXPORT_SYMBOL(deny_write_access); + + /** + * path_get - get a reference to a path +@@ -1165,6 +1166,7 @@ struct dentry *lookup_hash(struct nameidata *nd) + { + return __lookup_hash(&nd->last, nd->path.dentry, nd); + } ++EXPORT_SYMBOL(lookup_hash); + + int __lookup_one_len(const char *name, struct qstr *this, + struct dentry *base, int len) +@@ -1187,6 +1189,7 @@ int __lookup_one_len(const char *name, struct qstr *this, + this->hash = end_name_hash(hash); + return 0; + } ++EXPORT_SYMBOL(__lookup_one_len); + + /** + * lookup_one_len - filesystem helper to lookup single pathname component +diff --git a/fs/namespace.c b/fs/namespace.c +index 3dbfc07..3998762 100644 +--- a/fs/namespace.c ++++ b/fs/namespace.c +@@ -1321,6 +1321,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg, + } + return 0; + } ++EXPORT_SYMBOL(iterate_mounts); + + static void cleanup_group_ids(struct vfsmount *mnt, struct vfsmount *end) + { +diff --git a/fs/notify/group.c b/fs/notify/group.c +index d309f38..f0e9568 100644 +--- a/fs/notify/group.c ++++ b/fs/notify/group.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + #include + #include "fsnotify.h" +@@ -70,6 +71,7 @@ void fsnotify_put_group(struct fsnotify_group *group) + if (atomic_dec_and_test(&group->refcnt)) + fsnotify_destroy_group(group); + } ++EXPORT_SYMBOL(fsnotify_put_group); + + /* + * Create a new fsnotify_group and hold a reference for the group returned. +@@ -102,3 +104,4 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops) + + return group; + } ++EXPORT_SYMBOL(fsnotify_alloc_group); +diff --git a/fs/notify/mark.c b/fs/notify/mark.c +index 325185e..adede09 100644 +--- a/fs/notify/mark.c ++++ b/fs/notify/mark.c +@@ -113,6 +113,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark) + if (atomic_dec_and_test(&mark->refcnt)) + mark->free_mark(mark); + } ++EXPORT_SYMBOL(fsnotify_put_mark); + + /* + * Any time a mark is getting freed we end up here. +@@ -190,6 +191,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark) + if (unlikely(atomic_dec_and_test(&group->num_marks))) + fsnotify_final_destroy_group(group); + } ++EXPORT_SYMBOL(fsnotify_destroy_mark); + + void fsnotify_set_mark_mask_locked(struct fsnotify_mark *mark, __u32 mask) + { +@@ -277,6 +279,7 @@ err: + + return ret; + } ++EXPORT_SYMBOL(fsnotify_add_mark); + + /* + * clear any marks in a group in which mark->flags & flags is true +@@ -332,6 +335,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark, + atomic_set(&mark->refcnt, 1); + mark->free_mark = free_mark; + } ++EXPORT_SYMBOL(fsnotify_init_mark); + + static int fsnotify_mark_destroy(void *ignored) + { +diff --git a/fs/open.c b/fs/open.c +index 4197b9e..912817a 100644 +--- a/fs/open.c ++++ b/fs/open.c +@@ -60,6 +60,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs, + mutex_unlock(&dentry->d_inode->i_mutex); + return ret; + } ++EXPORT_SYMBOL(do_truncate); + + static long do_sys_truncate(const char __user *pathname, loff_t length) + { +diff --git a/fs/splice.c b/fs/splice.c +index ff0ae69..1c9e9b0 100644 +--- a/fs/splice.c ++++ b/fs/splice.c +@@ -1116,6 +1116,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out, + + return splice_write(pipe, out, ppos, len, flags); + } ++EXPORT_SYMBOL(do_splice_from); + + /* + * Attempt to initiate a splice from a file to a pipe. +@@ -1142,6 +1143,7 @@ long do_splice_to(struct file *in, loff_t *ppos, + + return splice_read(in, ppos, pipe, len, flags); + } ++EXPORT_SYMBOL(do_splice_to); + + /** + * splice_direct_to_actor - splices data directly between two non-pipes +diff --git a/security/commoncap.c b/security/commoncap.c +index 64c2ed9..e58b5d8 100644 +--- a/security/commoncap.c ++++ b/security/commoncap.c +@@ -929,3 +929,4 @@ int cap_file_mmap(struct file *file, unsigned long reqprot, + } + return ret; + } ++EXPORT_SYMBOL(cap_file_mmap); +diff --git a/security/device_cgroup.c b/security/device_cgroup.c +index 8d9c48f..29108aa 100644 +--- a/security/device_cgroup.c ++++ b/security/device_cgroup.c +@@ -515,6 +515,7 @@ found: + + return -EPERM; + } ++EXPORT_SYMBOL(devcgroup_inode_permission); + + int devcgroup_inode_mknod(int mode, dev_t dev) + { +diff --git a/security/security.c b/security/security.c +index 1b798d3..3b7d2ca 100644 +--- a/security/security.c ++++ b/security/security.c +@@ -360,6 +360,7 @@ int security_path_mkdir(struct path *dir, struct dentry *dentry, int mode) + return 0; + return security_ops->path_mkdir(dir, dentry, mode); + } ++EXPORT_SYMBOL(security_path_mkdir); + + int security_path_rmdir(struct path *dir, struct dentry *dentry) + { +@@ -367,6 +368,7 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry) + return 0; + return security_ops->path_rmdir(dir, dentry); + } ++EXPORT_SYMBOL(security_path_rmdir); + + int security_path_unlink(struct path *dir, struct dentry *dentry) + { +@@ -374,6 +376,7 @@ int security_path_unlink(struct path *dir, struct dentry *dentry) + return 0; + return security_ops->path_unlink(dir, dentry); + } ++EXPORT_SYMBOL(security_path_unlink); + + int security_path_symlink(struct path *dir, struct dentry *dentry, + const char *old_name) +@@ -382,6 +385,7 @@ int security_path_symlink(struct path *dir, struct dentry *dentry, + return 0; + return security_ops->path_symlink(dir, dentry, old_name); + } ++EXPORT_SYMBOL(security_path_symlink); + + int security_path_link(struct dentry *old_dentry, struct path *new_dir, + struct dentry *new_dentry) +@@ -390,6 +394,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir, + return 0; + return security_ops->path_link(old_dentry, new_dir, new_dentry); + } ++EXPORT_SYMBOL(security_path_link); + + int security_path_rename(struct path *old_dir, struct dentry *old_dentry, + struct path *new_dir, struct dentry *new_dentry) +@@ -400,6 +405,7 @@ int security_path_rename(struct path *old_dir, struct dentry *old_dentry, + return security_ops->path_rename(old_dir, old_dentry, new_dir, + new_dentry); + } ++EXPORT_SYMBOL(security_path_rename); + + int security_path_truncate(struct path *path) + { +@@ -407,6 +413,7 @@ int security_path_truncate(struct path *path) + return 0; + return security_ops->path_truncate(path); + } ++EXPORT_SYMBOL(security_path_truncate); + + int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, + mode_t mode) +@@ -415,6 +422,7 @@ int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, + return 0; + return security_ops->path_chmod(dentry, mnt, mode); + } ++EXPORT_SYMBOL(security_path_chmod); + + int security_path_chown(struct path *path, uid_t uid, gid_t gid) + { +@@ -422,6 +430,7 @@ int security_path_chown(struct path *path, uid_t uid, gid_t gid) + return 0; + return security_ops->path_chown(path, uid, gid); + } ++EXPORT_SYMBOL(security_path_chown); + + int security_path_chroot(struct path *path) + { +@@ -498,6 +507,7 @@ int security_inode_readlink(struct dentry *dentry) + return 0; + return security_ops->inode_readlink(dentry); + } ++EXPORT_SYMBOL(security_inode_readlink); + + int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd) + { +@@ -512,6 +522,7 @@ int security_inode_permission(struct inode *inode, int mask) + return 0; + return security_ops->inode_permission(inode, mask); + } ++EXPORT_SYMBOL(security_inode_permission); + + int security_inode_setattr(struct dentry *dentry, struct iattr *attr) + { +@@ -611,6 +622,7 @@ int security_file_permission(struct file *file, int mask) + + return fsnotify_perm(file, mask); + } ++EXPORT_SYMBOL(security_file_permission); + + int security_file_alloc(struct file *file) + { +@@ -638,6 +650,7 @@ int security_file_mmap(struct file *file, unsigned long reqprot, + return ret; + return ima_file_mmap(file, prot); + } ++EXPORT_SYMBOL(security_file_mmap); + + int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot, + unsigned long prot) diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/bootloader.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/bootloader.sh Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,220 @@ +#!/bin/sh +# +# This script creates a floppy image set from a linux bzImage and can merge +# a cmdline and/or one or more initramfs. +# The total size can not exceed 15M because INT 15H function 87H limitations. +# +# (C) 2009 Pascal Bellard - GNU General Public License v3. + +usage() +{ +cat <> 8)) + done | xargs echo -en | \ + dd bs=2 conv=notrunc of=$3 seek=$(( $1 / 2 )) 2> /dev/null + [ -n "$DEBUG" ] && printf "store16(%04X) = %04X\n" $1 $2 1>&2 +} + +# write a 32 bits data +# usage: storelong offset data32 file +storelong() +{ + n=$2; i=4; while [ $i -ne 0 ]; do + printf '\\\\x%02X' $(($n & 255)) + i=$(($i-1)); n=$(($n >> 8)) + done | xargs echo -en | \ + dd bs=4 conv=notrunc of=$3 seek=$(( $1 / 4 )) 2> /dev/null + [ -n "$DEBUG" ] && printf "storelong(%04X) = %08X\n" $1 $2 1>&2 +} + +# read a 32 bits data +# usage: getlong offset file +getlong() +{ + dd if=$2 bs=1 skip=$(( $1 )) count=4 2> /dev/null | \ + hexdump -e '"" 1/4 "%d" "\n"' +} + +floppyset() +{ + # bzImage offsets + CylinderCount=496 + SetupSzOfs=497 + FlagsOfs=498 + SyssizeOfs=500 + VideoModeOfs=506 + RootDevOfs=508 + CodeAdrOfs=0x214 + RamfsAdrOfs=0x218 + RamfsLenOfs=0x21C + ArgPtrOfs=0x228 + + # boot+setup address + SetupBase=0x90000 + + stacktop=0x9E00 + + bs=/tmp/bs$$ + + # Get and patch boot sector + # See http://hg.slitaz.org/wok/raw-file/711d076b277c/linux/stuff/linux-header-2.6.34.u + dd if=$KERNEL bs=512 count=1 of=$bs 2> /dev/null + uudecode < /dev/null +begin-base64 644 - +/L+6nWgAkAcGF4n8McC5HQDzq1sfD6mg8X1ABlfFd3ixBvOlZWaPR3gGH8ZF ++D/6l1hB6DQBvgACA3QO6HYBWwseKAJ0LFNH6AoBXuhmAbAgzRCwCM0QTuhl +ATwIdAOIBK05NigCdPDoPgE8CnXgiHz+ieb/TBD/TBi/9AGBTRz/gMdFMACc +sBCxBUi0k4lEHLABiUQUmGaY0+BIZgMFZtPoaAAQB7+AACn4nHMCAccx21BW +6J4AXrkAgLSH/kQczRVYnXfcoRoCvxwCsQk4RBxyuJPNE+oAACCQsEYoyL7b +AejSAF3rI4D5E3IEOMF3a4D+AnIEOOZ3bGCB/QAGdCoGUlFTlrQCULEGtQTB +xQSwDyHoBJAnFEAn6IwA/s117LAgzRDitOiWAJjNE2FSUCjIdwKwAZg5+HIC +ifhQtALNE5VeWFpyoJVBjuGAxwJPdFFOdfSM4ZU4wXVFiMj+xrEBOOZ1O4j0 +/sW2AID9UHIwOi7wAXIqtQBgvt4B/kQMU+gxAFvoOAB1FlKYzRO4AQLNE1rQ +1Dpk/nXqRgjkdeVh64sWB7AxLAO0DrsHAM0QPA1088OwDejv/6wIwHX4w79s +BLFbZQINuA0BZToNdArNFnT0mM0Wju9Hw1g6AEluc2VydCBkaXNrIDEuBw0A +AA== +==== +EOT + + # Get setup + setupsz=$(getlong $SetupSzOfs $bs) + setupszb=$(( $setupsz & 255 )) + dd if=$KERNEL bs=512 skip=1 count=$setupszb 2> /dev/null >> $bs + + if [ -n "$TRACKS" ]; then + [ -n "$DEBUG" ] && echo -n "--tracks " 1>&2 + n=$(getlong $CylinderCount $bs) + store16 $CylinderCount $(( ($n & -256) + $TRACKS )) $bs + fi + if [ -n "$FLAGS" ]; then + [ -n "$DEBUG" ] && echo -n "--flags " 1>&2 + store16 $FlagsOfs $FLAGS $bs + fi + if [ -n "$VIDEO" ]; then + [ -n "$DEBUG" ] && echo -n "--video " 1>&2 + store16 $VideoModeOfs $VIDEO $bs + fi + if [ -n "$RDEV" ]; then + [ -n "$DEBUG" ] && echo -n "--rdev " 1>&2 + n=$(stat -c '0x%02t%02T' $RDEV 2> /dev/null) + [ -n "$n" ] || n=$RDEV + store16 $RootDevOfs $n $bs + fi + + # Store cmdline after setup + if [ -n "$CMDLINE" ]; then + [ -n "$DEBUG" ] && echo -n "--cmdline '$CMDLINE' " 1>&2 + echo -n "$CMDLINE" | dd bs=512 count=1 conv=sync 2> /dev/null >> $bs + storelong $ArgPtrOfs $(( $SetupBase + $stacktop )) $bs + fi + + # Compute initramfs size + initrdlen=0 + padding=0 + for i in $( echo $INITRD | sed 's/,/ /' ); do + [ -s "$i" ] || continue + [ -n "$DEBUG" ] && echo "--initrd $i " 1>&2 + initrdlen=$(( $initrdlen + $padding )) + padding=$(stat -c %s $i) + initrdlen=$(( $initrdlen + $padding )) + padding=$(( 4096 - ($padding & 4095) )) + [ $padding -eq 4096 ] && padding=0 + done + Ksize=$(( $(getlong $SyssizeOfs $bs)*16 )) + Kpad=$(( (($Ksize+4095)/4096)*4096 - Ksize )) + if [ $initrdlen -ne 0 ]; then + [ -n "$DEBUG" ] && echo "initrdlen = $initrdlen " 1>&2 + Kbase=$(getlong $CodeAdrOfs $bs) + storelong $RamfsAdrOfs \ + $(( (0x1000000 - $initrdlen) & 0xFFFF0000 )) $bs + storelong $RamfsLenOfs $(( ($initrdlen + 3) & -4 )) $bs + fi + + # Output boot sector + setup + cmdline + dd if=$bs 2> /dev/null + + # Output kernel code + dd if=$KERNEL bs=512 skip=$(( $setupszb + 1 )) 2> /dev/null + + # Pad to next sector + Kpad=$(( 512 - ($(stat -c %s $KERNEL) & 511) )) + [ $Kpad -eq 512 ] || dd if=/dev/zero bs=1 count=$Kpad 2> /dev/null + + # Output initramfs + padding=0 + for i in $( echo $INITRD | sed 's/,/ /' ); do + [ -s "$i" ] || continue + [ $padding -ne 0 ] && dd if=/dev/zero bs=1 count=$padding 2> /dev/null + dd if=$i 2> /dev/null + padding=$(( 4 - ($(stat -c %s $i) & 3) )) + [ $padding -eq 4 ] && padding=0 + done + + # Cleanup + rm -f $bs +} + +if [ "$FORMAT" == "0" ]; then # unsplitted + floppyset > $PREFIX + exit +fi +floppyset | split -b ${FORMAT}k /dev/stdin floppy$$ +i=1 +ls floppy$$* | while read file ; do + output=$PREFIX$(printf "%03d" $i) + cat $file /dev/zero | dd bs=1k count=$FORMAT conv=sync of=$output 2> /dev/null + echo $output + rm -f $file + i=$(( $i + 1 )) +done diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/check_modules.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/check_modules.sh Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,54 @@ +#!/bin/sh +# Echo any module in kernel .config that's not added to one of linux-libre-* pkgs +# (c) SliTaz - GNU General Public License. +# 20090618 +# 20100528 +# +#. /etc/slitaz/slitaz.conf + +#WOK=$LOCAL_REPOSITORY/wok +WOK=$(cd `dirname $0` && pwd | sed 's/wok.*/wok/') +VERSION=`grep ^VERSION= $WOK/linux-libre/receipt | cut -d "=" -f2 | sed -e 's/"//g'` +src="$WOK/linux-libre/linux-$VERSION" + +cd $src +mkdir -p $WOK/$PACKAGE/tmp +rm -f $WOK/$PACKAGE/tmp/* + +echo -e "\nChecking for modules selected in .config but not in linux-libre-* pkgs" +echo "======================================================================" + +# create a packaged modules list +cat ../stuff/modules-"$VERSION".list >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list + +for i in $(cd $WOK; ls -d linux-libre-*) +do + tazpath="taz/$i-$VERSION" + for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko.gz") + do + basename $j >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list + done +done +# get the original list in .config +for i in $(find $_pkg -iname "*.ko.gz") +do + basename $i >> $WOK/$PACKAGE/tmp/originial-"$VERSION".list +done +# compare original .config and pkged modules +for i in $(cat $WOK/$PACKAGE/tmp/originial-$VERSION.list) +do + if ! grep -qs "$i" $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list ; then + modpath=`find $_pkg -iname "$i"` + echo "Orphan module: $i" + echo "$i : $modpath" >> $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list + fi +done +if [ -f $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list ]; then + echo "======================================================================" + echo -e "Check linux-libre/tmp/unpackaged-modules-$VERSION.list for mod path\n" +else + echo -e "\nAll modules are packaged\n" + echo "======================================================================" + echo "" + rm -rf $WOK/$PACKAGE/tmp +fi diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/gztazmod.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/gztazmod.sh Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,67 @@ +#!/bin/sh +# gztazmod.sh: Compress Linux kernel modules for SliTaz GNU/Linux. +# 2007/10/04 - GNU General Public License. +# + +# We do our work in the kernel version modules directory. +if [ -z "$1" ] ; then + echo "" + echo -e "\033[1musage:\033[0m `basename $0` path/to/kernel-version" + echo "" + exit 1 +fi + +if [ ! -r "$1" ] ; then + echo "" + echo -e "Error : $1 does not exist." + echo "" + exit 1 +fi + +cd $1 + +# Status functions. +status() +{ + local CHECK=$? + echo -en "\\033[70G[ " + if [ $CHECK = 0 ]; then + echo -en "\\033[1;33mOK" + else + echo -en "\\033[1;31mFailed" + fi + echo -e "\\033[0;39m ]" +} + +# Script start. +echo "" +echo "Starting gztazmod.sh to build compressed kernel modules... " +echo "" + +# Find all modules. +echo -n "Searching all modules to compress them... " +find . -name "*.ko" -exec lzma e '{}' '{}'.gz \; 2> /dev/null +status +find . -name "*.ko" -exec rm '{}' \; + +# Build a new temporary modules.dep. +echo -n "Building tmp.dep... " +sed 's/\.ko.gz/.ko/g' modules.dep > tmp.dep +sed -i 's/\.ko.gz/.ko/g' tmp.dep +sed -i 's/\.ko/.ko.gz/g' tmp.dep +status + +# Destroy original modules.dep +echo -n "Destroying modules.dep... " +rm modules.dep +status + +# Remove tmp.dep to modules.dep. +echo -n "Removing tmp.dep to modules.dep... " +mv tmp.dep modules.dep +status + +# Script end. +echo "" +echo "Kernel modules `basename $1` are ready." +echo "" diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/linux-libre-diff-2.6.37-libre.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/linux-libre-diff-2.6.37-libre.u Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,40 @@ +--- linux-2.6.30.6/arch/x86/vdso/Makefile ++++ linux-2.6.30.6/arch/x86/vdso/Makefile +@@ -104,10 +104,12 @@ + $(foreach H,$(filter-out FORCE,$^),\ + if grep -q VDSO32_SYSENTER_RETURN $H; \ + then diff -u $(@D)/.tmp_$(@F) $H; \ +- else sed /VDSO32_SYSENTER_RETURN/d $(@D)/.tmp_$(@F) | \ +- diff -u - $H; fi &&) : ;\ ++ else sed /VDSO32_SYSENTER_RETURN/d $(@D)/.tmp_$(@F) > \ ++ $(@D)/.tmp_$(@F).$$ ; \ ++ diff -u $(@D)/.tmp_$(@F).$$ $H; fi &&) : ;\ + then mv -f $(@D)/.tmp_$(@F) $@; \ +- else rm -f $(@D)/.tmp_$(@F); exit 1; \ ++ else rm -f $(@D)/.tmp_$(@F)*; exit 1; \ ++ rm -f $(@D)/.tmp_$(@F)*; \ + fi + endef + + +--- linux-2.6.34/scripts/Makefile.lib ++++ linux-2.6.34/scripts/Makefile.lib +@@ -204,7 +204,8 @@ + # --------------------------------------------------------------------------- + + quiet_cmd_gzip = GZIP $@ +-cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \ ++cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) && \ ++ ( which advdef > /dev/null && advdef -z $@ ; true ) || \ + (rm -f $@ ; false) + + +@@ -238,7 +239,7 @@ + + quiet_cmd_lzma = LZMA $@ + cmd_lzma = (cat $(filter-out FORCE,$^) | \ +- lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ ++ lzma e -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ + (rm -f $@ ; false) + + quiet_cmd_lzo = LZO $@ diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/linux-libre-freeinitrd-2.6.37-libre.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/linux-libre-freeinitrd-2.6.37-libre.u Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,129 @@ +--- linux-2.6.30.4/arch/x86/mm/init.c ++++ linux-2.6.30.4/arch/x86/mm/init.c +@@ -366,7 +366,7 @@ + */ + set_memory_rw(begin, (end - begin) >> PAGE_SHIFT); + +- printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10); ++ if (what) printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10); + + for (; addr < end; addr += PAGE_SIZE) { + ClearPageReserved(virt_to_page(addr)); + +--- linux-2.6.30.4/init/initramfs.c ++++ linux-2.6.30.4/init/initramfs.c +@@ -374,6 +374,52 @@ + [Reset] = do_reset, + }; + ++#include ++#define INITRD_PAGE ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024) ++#define INITRD_DOT (1024*1024) ++ ++static void free_rootfs_mem(unsigned long start, unsigned long end) ++{ ++ free_init_pages(NULL, start, end); ++} ++ ++static void _free_initrd(unsigned long initrd_start, unsigned long initrd_end, ++ void (*free_initrd_mem)(unsigned long, unsigned long)); ++ ++static struct { ++ int offset, last, inptr, freed; ++ char *max; ++} fill; ++ ++static void release_inbuf(unsigned n) ++{ ++ if (n >= INITRD_PAGE) { ++ unsigned rem = n % INITRD_PAGE; ++ unsigned end = initrd_start + n - rem; ++ _free_initrd(initrd_start, end, free_rootfs_mem); ++ fill.freed += n - rem; ++ if (fill.freed >= INITRD_DOT) { ++ fill.freed -= INITRD_DOT; ++ printk("."); ++ } ++ initrd_start = end; ++ fill.offset = rem; ++ } ++} ++ ++static int fill_buffer(void *buffer, unsigned size) ++{ ++ int max = fill.max - (char *) initrd_start - fill.offset; ++ if (max > size) max = size; ++ if (max > INITRD_PAGE) max = INITRD_PAGE; ++ memcpy(buffer, (void *)(initrd_start + fill.offset), max); ++ release_inbuf(fill.offset); ++ fill.offset += max; ++ fill.inptr += fill.last; ++ fill.last = max; ++ return max; ++} ++ + static int __init write_buffer(char *buf, unsigned len) + { + count = len; +@@ -418,6 +463,7 @@ + decompress_fn decompress; + const char *compress_name; + static __initdata char msg_buf[64]; ++ int early_free_initrd = (buf == (char *) initrd_start); + + header_buf = kmalloc(110, GFP_KERNEL); + symlink_buf = kmalloc(PATH_MAX + N_ALIGN(PATH_MAX) + 1, GFP_KERNEL); +@@ -431,11 +478,16 @@ + message = NULL; + while (!message && len) { + loff_t saved_offset = this_header; ++ fill.offset = buf - (char *) initrd_start; ++ fill.max = buf + len; ++ fill.inptr = fill.last = fill.freed = 0; + if (*buf == '0' && !(this_header & 3)) { + state = Start; + written = write_buffer(buf, len); + buf += written; + len -= written; ++ if (early_free_initrd) ++ release_inbuf(buf - (char *) initrd_start); + continue; + } + if (!*buf) { +@@ -447,7 +497,12 @@ + this_header = 0; + decompress = decompress_method(buf, len, &compress_name); + if (decompress) { +- res = decompress(buf, len, NULL, flush_buffer, NULL, ++ if (early_free_initrd) { ++ res = decompress(NULL, 0, fill_buffer, ++ flush_buffer, NULL, &my_inptr, error); ++ my_inptr += fill.inptr; ++ } ++ else res = decompress(buf, len, NULL, flush_buffer, NULL, + &my_inptr, error); + if (res) + error("decompressor failed"); +@@ -488,7 +546,8 @@ + #include + #include + +-static void __init free_initrd(void) ++static void _free_initrd(unsigned long initrd_start, unsigned long initrd_end, ++ void (*free_initrd_mem)(unsigned long, unsigned long)) + { + #ifdef CONFIG_KEXEC + unsigned long crashk_start = (unsigned long)__va(crashk_res.start); +@@ -516,6 +574,12 @@ + #endif + free_initrd_mem(initrd_start, initrd_end); + skip: ++ ; ++} ++ ++static void __init free_initrd(void) ++{ ++ _free_initrd(initrd_start, initrd_end, free_initrd_mem); + initrd_start = 0; + initrd_end = 0; + } diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/linux-libre-header-2.6.37-libre.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/linux-libre-header-2.6.37-libre.u Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,469 @@ +--- linux-2.6.30.6/arch/x86/boot/header.S ++++ linux-2.6.30.6/arch/x86/boot/header.S +@@ -6,7 +6,7 @@ + * Based on bootsect.S and setup.S + * modified by more people than can be counted + * +- * Rewritten as a common file by H. Peter Anvin (Apr 2007) ++ * Rewritten Pascal Bellard (Nov 2009) + * + * BIG FAT NOTE: We're in real mode using 64k segments. Therefore segment + * addresses must be multiplied by 16 to obtain their respective linear +@@ -27,6 +27,8 @@ + + BOOTSEG = 0x07C0 /* original address of boot-sector */ + SYSSEG = 0x1000 /* historical load address >> 4 */ ++INITSEG = 0x9000 /* boot address >> 4 */ ++SETUPSEG = 0x9020 /* setup address >> 4 */ + + #ifndef SVGA_MODE + #define SVGA_MODE ASK_VGA +@@ -40,53 +42,412 @@ + #define ROOT_RDONLY 1 + #endif + ++/* some extra features */ ++#define EDIT_CMDLINE on hotkey ++#define SHOW_REGS show int13 status & parameters ++ + .code16 + .section ".bstext", "ax" + + .global bootsect_start + bootsect_start: ++ cld # assume nothing ++stacktop = 0x9E00 # in 0x8000 .. 0xA000 ++zeroed = 48+10 # gdt + zeroed registers ++ movw $stacktop-12-zeroed, %di # stacktop is an arbitrary value >= ++ # length of bootsect + length of ++ # setup + room for stack; ++ # 12 is disk parm size. ++ pushw $INITSEG ++ popw %es # %es = INITSEG ++ ++ pushw %es ++ popw %ss # %ss and %es already contain INITSEG ++ movw %di, %sp # put stack at INITSEG:stacktop-... ++ ++# Many BIOS's default disk parameter tables will not recognize ++# multi-sector reads beyond the maximum sector number specified ++# in the default diskette parameter tables - this may mean 7 ++# sectors in some cases. ++# ++# Since single sector reads are slow and out of the question, ++# we must take care of this by creating new parameter tables ++# (for the first disk) in RAM. We can set the maximum sector ++# count to 36 - the most we will encounter on an ED 2.88. ++# ++# High doesn't hurt. Low does. Let's use the max: 63 ++# ++# Segments are as follows: %es = %ss = INITSEG, ++ ++ xorw %ax, %ax # %ax = 0 ++ movw $zeroed/2, %cx # clear gdt + offset, %ds, limits ++ rep # don't worry about cld ++ stosw # already done above ++ popw %bx # offset = 0 ++ popw %ds # %ds = 0 ++ popw %gs # %gs = 0 ++ ++ movb setup_sects+0x7C00, %al # read bootsector + setup (%ds = 0) ++ incw %ax ++ ++ pushw %es ++ pushw %di # %ds:%bx+0x78 is parameter table address ++ ldsw 0x78(%bx), %si # %ds:%si is source ++ movb $6, %cl # copy 12 bytes ++ rep # don't worry about cld ++ movsw # already done above ++ popl %gs:0x78(%bx) # update parameter table address ++ pushw %es ++ popw %ds # now %ds = %es = %ss = INITSEG ++ movb $63, 0x4-12(%di) # patch sector count, %di = stacktop ++ cli ++ ++ xchg %ax, %di # sector count ++ popw %ax # limits = 0 ++ incw %cx # cylinder 0, sector 1 ++ call read_first_sectors # read setup ++ ++offset_version = 0xE ++ movw $0x200,%si ++ addw offset_version(%si),%si # starting protocol 2.00, Kernel 1.3.73 ++ call putstr # show which kernel we are loading ++ ++# The cmdline can be entered and modifed at boot time. ++# Only characters before the cursor are passed to the kernel. ++ popw %bx # clear %bx ++ orw cmd_line_ptr, %bx ++ jz nocmdline ++ pushw %bx ++ incw %di ++ call read_sectors ++ popw %si ++ call putstr ++#ifdef EDIT_CMDLINE ++cmdlp: ++ movb $0x20, %al # clear end of line ++ int $0x10 # with Space ++ movb $8, %al # and BackSpace ++ int $0x10 ++ decw %si ++cmdget: ++ call wait4key ++ cmpb $8, %al # BackSpace ? ++ je cmdbs ++ movb %al, (%si) # store char ++ lodsw # %si += 2 ++cmdbs: ++#if 1 ++ cmpw %si,cmd_line_ptr ++ je cmdget ++#endif ++ call putc # set %ah and %bx ++ cmpb $10, %al # Enter ? ++ jne cmdlp ++ movb %bh,-2(%si) # set end of string and remove CR ++endcmdline: ++#endif ++nocmdline: + +- # Normalize the start address +- ljmp $BOOTSEG, $start2 +- +-start2: +- movw %cs, %ax +- movw %ax, %ds +- movw %ax, %es +- movw %ax, %ss +- xorw %sp, %sp +- sti +- cld +- +- movw $bugger_off_msg, %si ++# This routine loads the system at address SYSSEG, making sure ++# no 64kB boundaries are crossed. We try to load it as fast as ++# possible, loading whole tracks whenever we can. ++ ++ramdisk_image = 0x0218 ++ramdisk_size = 0x021C ++ movw %sp, %si # for bootsect_gdt ++ decw 16(%si) # bootsect_src = 64Kb ++ decw 24(%si) # bootsect_dst = 64Kb ++ movw $syssize, %di ++type_of_loader = 0x210 ++loadflags = 0x211 ++heap_end_ptr = 0x224 ++ksyssize = 500 ++ orw $0x80FF, type_of_loader-ksyssize(%di) # loader type = 0xFF ++ movw $stacktop-0x200, heap_end_ptr-ksyssize(%di) ++ movb $0x10, %al # destination = 0x100000 ++ movb $5, %cl ++initrdlp: ++ decw %ax ++ movb $0x93,%ah ++ movw %ax, 28(%si) # bootsect_dst_base+2 ++ movb $(SYSSEG/4096), %al # source = SYSSEG ++ movw %ax, 20(%si) # bootsect_src_base+2 ++ cbw ++ cwde ++ shlw %cl, %ax ++ decw %ax ++ addl (%di),%eax ++ shrl %cl, %eax ++syslp: ++ pushw $SYSSEG ++ popw %es ++ movw $128,%di # 64Kb ++ subw %di, %ax # max 32M > int 15 limit ++ pushf ++ jnc not_last ++ addw %ax, %di ++not_last: ++ xorw %bx, %bx # clear %bx ++ pushw %ax ++#if defined(SHOW_REGS) ++ pushw %si ++ call read_sectors ++ popw %si ++#else ++ call read_sectors ++#endif ++ movw $0x8000, %cx # full 64K ++ movb $0x87, %ah ++ incb 28(%si) # bootsect_dst_base+2 ++ int $0x15 # max 16M ++ popw %ax ++ popf ++ ja syslp ++ movw ramdisk_image+2,%ax ++ movw $ramdisk_size,%di ++ movb $9, %cl ++ cmpb %al,28(%si) ++ jb initrdlp ++ ++# This procedure turns off the floppy drive motor, so ++# that we enter the kernel in a known state, and ++# don't have to worry about it later. ++ ++#if 1 ++kill_motor: ++ xchgw %ax, %bx # reset FDC ++ int $0x13 ++#else ++kill_motor: ++ movw $0x3f2, %dx ++ xchgw %ax, %bx ++ outb %al, %dx ++#endif + +-msg_loop: +- lodsb +- andb %al, %al +- jz bs_die +- movb $0xe, %ah +- movw $7, %bx ++# After that (everything loaded), we jump to the setup-routine ++# loaded directly after the bootblock: ++# Segments are as follows: %ds = %ss = INITSEG ++ ++ ljmp $SETUPSEG, $0 ++ ++# read_sectors reads %di sectors into %es:0 buffer. ++# %es:0 is updated to the next memory location. ++# First, sectors are read sector by sector until ++# sector per track count is known. Then they are ++# read track by track. ++# Assume no error on first track. ++ ++#define FLOPPY_CYLINDERS 80 /* 80 cylinders minimum */ ++#define FLOPPY_HEADS 2 /* 2 heads minimum */ ++#define FLOPPY_SECTORS 18 /* 18 sectors minimum */ ++ ++#ifdef SHOW_REGS ++print_loop: ++ movb $0x6 + 'A' - 1, %al ++ subb %cl, %al ++ movw $regs, %si # caller %si is saved ++ call putcs # putc(%al) + putstr(%si) ++# it will print out all of the registers. ++ popw %bp # load word into %si ++ jmp print_all # print %bp (status) ++#endif ++check_limits: ++#ifndef SHOW_REGS ++ popw %dx ++#endif ++ cmpb $FLOPPY_SECTORS+1, %cl # 18 sectors minimum ++ jb check_head ++ cmpb %al, %cl # max sector known ? ++ ja next_head # no -> store it ++check_head: ++ cmpb $FLOPPY_HEADS, %dh # 2 heads minimum ++ jb check_cylinder ++ cmpb %ah, %dh # max head known ? ++ ja next_cylinder # no -> store it ++check_cylinder: ++ pushaw ++#ifdef SHOW_REGS ++ cmpw $0x600,%bp # disk changed ? ++ je reset_floppy ++ pushw %es # print %es (named EX) ++ pushw %dx # print %dx ++ pushw %cx # print %cx ++ pushw %bx # print %bx ++ xchgw %ax, %si ++ movb $2,%ah ++ pushw %ax # print %ax ++ movb $6,%cl ++print_all: ++ movb $4, %ch # 4 hex digits ++print_digit: ++ rolw $4, %bp # rotate to use low 4 bits ++ movb $0x0f, %al ++ andw %bp, %ax # %al = mask for nybble ++ addb $0x90, %al # convert %al to ascii hex ++ daa # in only four instructions! ++ adcb $0x40, %al ++ daa ++ call putc # set %ah and %bx ++ decb %ch ++ jnz print_digit ++ movb $0x20, %al # SPACE + int $0x10 +- jmp msg_loop +- +-bs_die: +- # Allow the user to press a key, then reboot +- xorw %ax, %ax ++ loop print_loop ++ call wait ++ cbw # %ah = 0 ++reset_floppy: ++#else ++ cbw # %ah = 0 ++#endif ++ int $0x13 # reset controler ++ popaw ++read_sectorslp: ++ pushw %dx # some bios break dx... ++ pushw %ax # limits ++ subb %cl, %al # sectors remaining in track ++ ja tolastsect ++ movb $1, %al # 1 sector mini ++tolastsect: ++ cbw ++ cmpw %di, %ax ++ jb more1trk ++ movw %di, %ax # sectors to read ++more1trk: ++ pushw %ax # save context ++ movb $2, %ah # cmd: read chs ++ int $0x13 ++#ifdef SHOW_REGS ++ xchgw %ax, %bp # status ++#endif ++# ifdef SHOW_REGS ++ popw %si # save %ax ++ popw %ax # limits ++ popw %dx ++# else ++ popw %dx # save %ax ++ popw %ax # limits ++# endif ++ jc check_limits ++ xchgw %ax, %bp ++# ifdef SHOW_REGS ++update_regs: ++ incw %cx # next sector ++ movw %cx, %fs ++ addb $2,%bh # next location ++ decw %di # update sector counter ++ jz putcdot ++ decw %si ++ jnz update_regs ++# else ++ addw %dx,%cx # next sector ++ addb %dl,%bh ++ addb %dl,%bh # next location ++ subw %dx,%di # update sector counter ++ popw %dx ++ jz putcdot ++# endif ++read_sectors: ++ movw %fs, %cx ++ xchgw %ax, %bp ++ cmpb %al,%cl # reach sector limit ? ++ jne bdendlp ++next_head: ++ movb %cl,%al ++ incb %dh # next head ++ movb $1,%cl # first sector ++ cmpb %ah, %dh # reach head limit ? ++ jne bdendlp ++next_cylinder: ++ movb %dh,%ah ++# NOTE : support 256 cylinders max ++ incb %ch # next cylinder ++read_first_sectors: ++ movb $0,%dh # first head ++cylinder_count = 496 ++ cmpb $FLOPPY_CYLINDERS,%ch # reach cylinder limit ? ++ jb bdendlp ++ cmpb cylinder_count, %ch ++ jb bdendlp ++next_floppy: ++ movb $0,%ch # first cylinder ++ pushaw ++ movw $swap_floppy,%si ++ incb 12(%si) ++ pushw %bx ++ call putstr ++ popw %bx ++waitfloppy: ++ call wait ++ jne waitfloppydone ++ pushw %dx # some bios break dx... ++ cbw ++ int $0x13 # reset FDC ++ movw $0x201,%ax ++# cwd ++# movw $1,%cx ++ int $0x13 # read first sector ++ popw %dx ++ rclb $1,%ah # floppy changed 06=>0D no error 00 ++ cmpb -2(%si), %ah # 0D then 00 ++ jne waitfloppy # no => try again ++ incw %si ++ orb %ah,%ah # was 00 ? ++ jne waitfloppy ++waitfloppydone: ++ popaw ++bdendlp: ++ jmp read_sectorslp ++ ++putcdot: ++ pushw %ss ++ popw %es # restore es ++ movb $0x2e+3, %al # loading... message 2e = . ++putclf: ++ subb $3, %al ++putc: ++ movb $0xe, %ah ++ movw $7, %bx # one dot each 64k ++ int $0x10 ++ cmp $0xd, %al # CR ? ++ je putclf ++ ret ++ ++putstr: ++ movb $0xd, %al # CR ++putcs: ++ call putc ++ lodsb ++ orb %al,%al # end of string is \0 ++ jnz putcs ++ ret ++ ++clock = 0x46C ++wait: ++wait4key: ++ movw $clock, %di ++#define DELAY 5 ++ movb $(DELAY*182)/10,%cl ++ addb %gs:(%di),%cl ++waitkbd: ++ movw $0x10D, %ax # test keyboard, timeout => CR ++ cmpb %gs:(%di),%cl ++ je waitdone + int $0x16 +- int $0x19 ++ jz waitkbd ++ cbw ++ int $0x16 # eat char ++ movw %di, %gs # disable timeout ++ incw %di # clear Z ++waitdone: ++ ret + +- # int 0x19 should never return. In case it does anyway, +- # invoke the BIOS reset code... +- ljmp $0xf000,$0xfff0 +- +- .section ".bsdata", "a" +-bugger_off_msg: +- .ascii "Direct booting from floppy is no longer supported.\r\n" +- .ascii "Please use a boot loader program instead.\r\n" +- .ascii "\n" +- .ascii "Remove disk and press any key to reboot . . .\r\n" +- .byte 0 ++#ifdef SHOW_REGS ++regs: .asciz "X:" ++#endif + ++swap_floppy: .ascii "Insert disk 1" ++ .ascii "." ++ .byte 7,13,0 + + # Kernel attributes; used by setup. This is part 1 of the + # header, from the old boot sector. diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/linux-libre-unlzma-2.6.37-libre.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/linux-libre-unlzma-2.6.37-libre.u Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,268 @@ +--- linux-2.6.30.4/init/initramfs.c ++++ linux-2.6.30.4/init/initramfs.c +@@ -425,7 +425,8 @@ + return len - count; + } + +-static int __init flush_buffer(void *bufv, unsigned len) ++#define flush_buffer cpio_flush_buffer ++int __init flush_buffer(void *bufv, unsigned len) + { + char *buf = (char *) bufv; + int written; + +--- linux-2.6.30.4/lib/decompress_unlzma.c ++++ linux-2.6.30.4/lib/decompress_unlzma.c +@@ -278,6 +278,10 @@ + size_t global_pos; + int(*flush)(void*, unsigned int); + struct lzma_header *header; ++ int is_cpio_flush; ++ uint8_t **buffer_index; ++ int next_index; ++ int max_index; + }; + + struct cstate { +@@ -294,6 +298,14 @@ + static inline uint8_t INIT peek_old_byte(struct writer *wr, + uint32_t offs) + { ++ if (wr->is_cpio_flush) { ++ int32_t pos; ++ while (offs > wr->header->dict_size) ++ offs -= wr->header->dict_size; ++ pos = wr->buffer_pos - offs; ++ return wr->buffer_index[pos / LZMA_IOBUF_SIZE] ++ [pos % LZMA_IOBUF_SIZE]; ++ } + if (!wr->flush) { + int32_t pos; + while (offs > wr->header->dict_size) +@@ -309,8 +321,41 @@ + + } + ++static inline void INIT write_byte_if_cpio(struct writer *wr, uint8_t byte) ++{ ++ if (wr->buffer_pos % LZMA_IOBUF_SIZE == 0) { ++ // if the following large_malloc fails, the initramfs ++ // whould not be load with is_cpio_flush forced 0 too. ++ // Remember we do not allocate historic buffer. ++ // Let's assume it will never fail ! ++ if (wr->next_index >= wr->max_index) { ++ // realloc wr->buffer_index ++ uint8_t **p = wr->buffer_index; ++ wr->buffer_index = (uint8_t **) ++ large_malloc(LZMA_IOBUF_SIZE + ++ sizeof(*p) * wr->max_index); ++ if (wr->max_index) { ++ memcpy(wr->buffer_index, p, ++ sizeof(*p) * wr->max_index); ++ free(p); ++ } ++ wr->max_index += LZMA_IOBUF_SIZE / sizeof(*p); ++ } ++ wr->buffer_index[wr->next_index++] = ++ (uint8_t *) large_malloc(LZMA_IOBUF_SIZE); ++ } ++ wr->buffer_index[wr->buffer_pos / LZMA_IOBUF_SIZE] ++ [wr->buffer_pos % LZMA_IOBUF_SIZE] = ++ wr->previous_byte = byte; ++ wr->buffer_pos++; ++} ++ + static inline void INIT write_byte(struct writer *wr, uint8_t byte) + { ++ if (wr->is_cpio_flush) { ++ write_byte_if_cpio(wr, byte); ++ return; ++ } + wr->buffer[wr->buffer_pos++] = wr->previous_byte = byte; + if (wr->flush && wr->buffer_pos == wr->header->dict_size) { + wr->buffer_pos = 0; +@@ -328,7 +373,21 @@ + static inline void INIT copy_bytes(struct writer *wr, + uint32_t rep0, int len) + { +- do { ++ if (wr->is_cpio_flush) { ++ int32_t pos; ++ uint32_t offs = rep0; ++ while (offs > wr->header->dict_size) ++ offs -= wr->header->dict_size; ++ pos = wr->buffer_pos - offs; ++ do { ++ write_byte_if_cpio(wr, ++ wr->buffer_index[pos / LZMA_IOBUF_SIZE] ++ [pos % LZMA_IOBUF_SIZE]); ++ pos++; ++ len--; ++ } while (len != 0 && wr->buffer_pos < wr->header->dst_size); ++ } ++ else do { + copy_byte(wr, rep0); + len--; + } while (len != 0 && wr->buffer_pos < wr->header->dst_size); +@@ -339,6 +398,9 @@ + int pos_state, uint16_t *prob, + int lc, uint32_t literal_pos_mask) { + int mi = 1; ++ static const int state[LZMA_NUM_STATES] = ++ { 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5 }; ++ + rc_update_bit_0(rc, prob); + prob = (p + LZMA_LITERAL + + (LZMA_LIT_SIZE +@@ -369,18 +431,13 @@ + rc_get_bit(rc, prob_lit, &mi); + } + write_byte(wr, mi); +- if (cst->state < 4) +- cst->state = 0; +- else if (cst->state < 10) +- cst->state -= 3; +- else +- cst->state -= 6; ++ cst->state = state[cst->state]; + } + + static inline void INIT process_bit1(struct writer *wr, struct rc *rc, + struct cstate *cst, uint16_t *p, + int pos_state, uint16_t *prob) { +- int offset; ++ int offset; + uint16_t *prob_len; + int num_bits; + int len; +@@ -396,7 +453,7 @@ + prob = p + LZMA_LEN_CODER; + } else { + rc_update_bit_1(rc, prob); +- prob = p + LZMA_IS_REP_G0 + cst->state; ++ prob += LZMA_IS_REP_G0 - LZMA_IS_REP; + if (rc_is_bit_0(rc, prob)) { + rc_update_bit_0(rc, prob); + prob = (p + LZMA_IS_REP_0_LONG +@@ -417,13 +474,13 @@ + uint32_t distance; + + rc_update_bit_1(rc, prob); +- prob = p + LZMA_IS_REP_G1 + cst->state; ++ prob += LZMA_IS_REP_G1 - LZMA_IS_REP_G0; + if (rc_is_bit_0(rc, prob)) { + rc_update_bit_0(rc, prob); + distance = cst->rep1; + } else { + rc_update_bit_1(rc, prob); +- prob = p + LZMA_IS_REP_G2 + cst->state; ++ prob += LZMA_IS_REP_G2 - LZMA_IS_REP_G1; + if (rc_is_bit_0(rc, prob)) { + rc_update_bit_0(rc, prob); + distance = cst->rep2; +@@ -444,24 +501,24 @@ + prob_len = prob + LZMA_LEN_CHOICE; + if (rc_is_bit_0(rc, prob_len)) { + rc_update_bit_0(rc, prob_len); +- prob_len = (prob + LZMA_LEN_LOW ++ prob_len += LZMA_LEN_LOW - LZMA_LEN_CHOICE + + (pos_state << +- LZMA_LEN_NUM_LOW_BITS)); ++ LZMA_LEN_NUM_LOW_BITS); + offset = 0; + num_bits = LZMA_LEN_NUM_LOW_BITS; + } else { + rc_update_bit_1(rc, prob_len); +- prob_len = prob + LZMA_LEN_CHOICE_2; ++ prob_len += LZMA_LEN_CHOICE_2 - LZMA_LEN_CHOICE; + if (rc_is_bit_0(rc, prob_len)) { + rc_update_bit_0(rc, prob_len); +- prob_len = (prob + LZMA_LEN_MID ++ prob_len += LZMA_LEN_MID - LZMA_LEN_CHOICE_2 + + (pos_state << +- LZMA_LEN_NUM_MID_BITS)); ++ LZMA_LEN_NUM_MID_BITS); + offset = 1 << LZMA_LEN_NUM_LOW_BITS; + num_bits = LZMA_LEN_NUM_MID_BITS; + } else { + rc_update_bit_1(rc, prob_len); +- prob_len = prob + LZMA_LEN_HIGH; ++ prob_len += LZMA_LEN_HIGH - LZMA_LEN_CHOICE_2; + offset = ((1 << LZMA_LEN_NUM_LOW_BITS) + + (1 << LZMA_LEN_NUM_MID_BITS)); + num_bits = LZMA_LEN_NUM_HIGH_BITS; +@@ -529,6 +586,7 @@ + void(*error_fn)(char *x) + ) + { ++ extern int cpio_flush_buffer(void*, unsigned int); + struct lzma_header header; + int lc, pb, lp; + uint32_t pos_state_mask; +@@ -563,6 +621,10 @@ + wr.global_pos = 0; + wr.previous_byte = 0; + wr.buffer_pos = 0; ++ wr.is_cpio_flush = 0; ++ if (flush == cpio_flush_buffer) ++ wr.is_cpio_flush = 1; ++ wr.buffer_index = NULL; + + rc_init(&rc, fill, inbuf, in_len); + +@@ -596,23 +658,23 @@ + if (header.dict_size == 0) + header.dict_size = 1; + +- if (output) ++ if (output || wr.is_cpio_flush) + wr.buffer = output; + else { + wr.bufsize = MIN(header.dst_size, header.dict_size); + wr.buffer = large_malloc(wr.bufsize); + } +- if (wr.buffer == NULL) ++ if (wr.buffer == NULL && !wr.is_cpio_flush) + goto exit_1; + + num_probs = LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp)); + p = (uint16_t *) large_malloc(num_probs * sizeof(*p)); + if (p == 0) + goto exit_2; +- num_probs = LZMA_LITERAL + (LZMA_LIT_SIZE << (lc + lp)); ++ num_probs += LZMA_LITERAL - LZMA_BASE_SIZE; + for (i = 0; i < num_probs; i++) + p[i] = (1 << RC_MODEL_TOTAL_BITS) >> 1; +- ++ wr.max_index = wr.next_index = 0; + rc_init_code(&rc); + + while (get_pos(&wr) < header.dst_size) { +@@ -631,12 +693,25 @@ + + if (posp) + *posp = rc.ptr-rc.buffer; +- if (wr.flush) ++ if (wr.is_cpio_flush) { ++ int i; ++ for (i = 0; i < wr.next_index -1; i++) { ++ wr.flush(wr.buffer_index[i], LZMA_IOBUF_SIZE); ++ large_free(wr.buffer_index[i]); ++ } ++ if (i < wr.next_index) { ++ wr.flush(wr.buffer_index[i], ++ wr.buffer_pos % LZMA_IOBUF_SIZE); ++ large_free(wr.buffer_index[i]); ++ } ++ large_free(wr.buffer_index); ++ } ++ else if (wr.flush) + wr.flush(wr.buffer, wr.buffer_pos); + ret = 0; + large_free(p); + exit_2: +- if (!output) ++ if (!output && !wr.is_cpio_flush) + large_free(wr.buffer); + exit_1: + if (!buf) diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/linux-squashfs-lzma-2.6.34.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/linux-squashfs-lzma-2.6.34.u Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,649 @@ +--- linux-2.6.30.6/include/linux/decompress/bunzip2_mm.h ++++ linux-2.6.30.6/include/linux/decompress/bunzip2_mm.h +@@ -0,0 +1,13 @@ ++#ifndef BUNZIP2_MM_H ++#define BUNZIP2_MM_H ++ ++#ifdef STATIC ++/* Code active when included from pre-boot environment: */ ++#define INIT ++#else ++/* Compile for initramfs/initrd code only */ ++#define INIT __init ++static void(*error)(char *m); ++#endif ++ ++#endif + +--- linux-2.6.30.6/include/linux/decompress/inflate_mm.h ++++ linux-2.6.30.6/include/linux/decompress/inflate_mm.h +@@ -0,0 +1,13 @@ ++#ifndef INFLATE_MM_H ++#define INFLATE_MM_H ++ ++#ifdef STATIC ++/* Code active when included from pre-boot environment: */ ++#define INIT ++#else ++/* Compile for initramfs/initrd code only */ ++#define INIT __init ++static void(*error)(char *m); ++#endif ++ ++#endif + +#--- linux-2.6.30.6/include/linux/decompress/mm.h +#+++ linux-2.6.30.6/include/linux/decompress/mm.h +@@ -63,8 +63,6 @@ + + #define set_error_fn(x) + +-#define INIT +- + #else /* STATIC */ + + /* Code active when compiled standalone for use when loading ramdisk: */ +@@ -84,10 +82,8 @@ + #define large_malloc(a) vmalloc(a) + #define large_free(a) vfree(a) + +-static void(*error)(char *m); + #define set_error_fn(x) error = x; + +-#define INIT __init + #define STATIC + + #include + +--- linux-2.6.30.6/include/linux/decompress/unlzma_mm.h ++++ linux-2.6.30.6/include/linux/decompress/unlzma_mm.h +@@ -0,0 +1,20 @@ ++#ifndef UNLZMA_MM_H ++#define UNLZMA_MM_H ++ ++#ifdef STATIC ++ ++/* Code active when included from pre-boot environment: */ ++#define INIT ++ ++#elif defined(CONFIG_DECOMPRESS_LZMA_NEEDED) ++ ++/* Make it available to non initramfs/initrd code */ ++#define INIT ++#include ++#else ++ ++/* Compile for initramfs/initrd code only */ ++#define INIT __init ++#endif ++ ++#endif + +--- linux-2.6.30.6/lib/Kconfig ++++ linux-2.6.30.6/lib/Kconfig +@@ -117,6 +117,9 @@ + config DECOMPRESS_LZMA + tristate + ++config DECOMPRESS_LZMA_NEEDED ++ boolean ++ + config DECOMPRESS_LZO + select LZO_DECOMPRESS + tristate + +--- linux-2.6.30.6/lib/decompress_bunzip2.c ++++ linux-2.6.30.6/lib/decompress_bunzip2.c +@@ -52,6 +52,7 @@ + #include + #endif /* STATIC */ + ++#include + #include + + #ifndef INT_MAX + +--- linux-2.6.30.6/lib/decompress_inflate.c ++++ linux-2.6.30.6/lib/decompress_inflate.c +@@ -23,6 +23,7 @@ + + #endif /* STATIC */ + ++#include + #include + + #define GZIP_IOBUF_SIZE (16*1024) + +--- linux-2.6.30.6/lib/decompress_unlzma.c ++++ linux-2.6.30.6/lib/decompress_unlzma.c +@@ -36,6 +36,7 @@ + #include + #endif /* STATIC */ + ++#include + #include + + #define MIN(a, b) (((a) < (b)) ? (a) : (b)) +@@ -88,7 +89,7 @@ + } + + /* Called twice: once at startup and once in rc_normalize() */ +-static void INIT rc_read(struct rc *rc) ++static void INIT rc_read(struct rc *rc, void(*error)(char *x)) + { + rc->buffer_size = rc->fill((char *)rc->buffer, LZMA_IOBUF_SIZE); + if (rc->buffer_size <= 0) +@@ -115,13 +116,13 @@ + rc->range = 0xFFFFFFFF; + } + +-static inline void INIT rc_init_code(struct rc *rc) ++static inline void INIT rc_init_code(struct rc *rc, void(*error)(char *x)) + { + int i; + + for (i = 0; i < 5; i++) { + if (rc->ptr >= rc->buffer_end) +- rc_read(rc); ++ rc_read(rc, error); + rc->code = (rc->code << 8) | *rc->ptr++; + } + } +@@ -134,32 +135,33 @@ + } + + /* Called twice, but one callsite is in inline'd rc_is_bit_0_helper() */ +-static void INIT rc_do_normalize(struct rc *rc) ++static void INIT rc_do_normalize(struct rc *rc, void(*error)(char *x)) + { + if (rc->ptr >= rc->buffer_end) +- rc_read(rc); ++ rc_read(rc, error); + rc->range <<= 8; + rc->code = (rc->code << 8) | *rc->ptr++; + } +-static inline void INIT rc_normalize(struct rc *rc) ++static inline void INIT rc_normalize(struct rc *rc, void(*error)(char *x)) + { + if (rc->range < (1 << RC_TOP_BITS)) +- rc_do_normalize(rc); ++ rc_do_normalize(rc, error); + } + + /* Called 9 times */ + /* Why rc_is_bit_0_helper exists? + *Because we want to always expose (rc->code < rc->bound) to optimizer + */ +-static inline uint32_t INIT rc_is_bit_0_helper(struct rc *rc, uint16_t *p) ++static inline uint32_t INIT rc_is_bit_0_helper(struct rc *rc, uint16_t *p, ++ void (*error)(char *x)) + { +- rc_normalize(rc); ++ rc_normalize(rc, error); + rc->bound = *p * (rc->range >> RC_MODEL_TOTAL_BITS); + return rc->bound; + } +-static inline int INIT rc_is_bit_0(struct rc *rc, uint16_t *p) ++static inline int INIT rc_is_bit_0(struct rc *rc, uint16_t *p, void(*error)(char *x)) + { +- uint32_t t = rc_is_bit_0_helper(rc, p); ++ uint32_t t = rc_is_bit_0_helper(rc, p, error); + return rc->code < t; + } + +@@ -177,9 +179,9 @@ + } + + /* Called 4 times in unlzma loop */ +-static int INIT rc_get_bit(struct rc *rc, uint16_t *p, int *symbol) ++static int INIT rc_get_bit(struct rc *rc, uint16_t *p, int *symbol, void(*error)(char *x)) + { +- if (rc_is_bit_0(rc, p)) { ++ if (rc_is_bit_0(rc, p, error)) { + rc_update_bit_0(rc, p); + *symbol *= 2; + return 0; +@@ -191,9 +193,9 @@ + } + + /* Called once */ +-static inline int INIT rc_direct_bit(struct rc *rc) ++static inline int INIT rc_direct_bit(struct rc *rc , void(*error)(char *x)) + { +- rc_normalize(rc); ++ rc_normalize(rc, error); + rc->range >>= 1; + if (rc->code >= rc->range) { + rc->code -= rc->range; +@@ -204,13 +206,14 @@ + + /* Called twice */ + static inline void INIT +-rc_bit_tree_decode(struct rc *rc, uint16_t *p, int num_levels, int *symbol) ++rc_bit_tree_decode(struct rc *rc, uint16_t *p, int num_levels, int *symbol, ++ void(*error)(char *x)) + { + int i = num_levels; + + *symbol = 1; + while (i--) +- rc_get_bit(rc, p + *symbol, symbol); ++ rc_get_bit(rc, p + *symbol, symbol, error); + *symbol -= 1 << num_levels; + } + +@@ -406,7 +409,8 @@ + static inline void INIT process_bit0(struct writer *wr, struct rc *rc, + struct cstate *cst, uint16_t *p, + int pos_state, uint16_t *prob, +- int lc, uint32_t literal_pos_mask) { ++ int lc, uint32_t literal_pos_mask, ++ void(*error)(char *x)) { + int mi = 1; + static const int state[LZMA_NUM_STATES] = + { 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5 }; +@@ -427,7 +431,7 @@ + match_byte <<= 1; + bit = match_byte & 0x100; + prob_lit = prob + 0x100 + bit + mi; +- if (rc_get_bit(rc, prob_lit, &mi)) { ++ if (rc_get_bit(rc, prob_lit, &mi, error)) { + if (!bit) + break; + } else { +@@ -438,7 +442,7 @@ + } + while (mi < 0x100) { + uint16_t *prob_lit = prob + mi; +- rc_get_bit(rc, prob_lit, &mi); ++ rc_get_bit(rc, prob_lit, &mi, error); + } + write_byte(wr, mi); + cst->state = state[cst->state]; +@@ -446,7 +453,8 @@ + + static inline void INIT process_bit1(struct writer *wr, struct rc *rc, + struct cstate *cst, uint16_t *p, +- int pos_state, uint16_t *prob) { ++ int pos_state, uint16_t *prob, ++ void(*error)(char *x)) { + int offset; + uint16_t *prob_len; + int num_bits; +@@ -454,7 +459,7 @@ + + rc_update_bit_1(rc, prob); + prob = p + LZMA_IS_REP + cst->state; +- if (rc_is_bit_0(rc, prob)) { ++ if (rc_is_bit_0(rc, prob, error)) { + rc_update_bit_0(rc, prob); + cst->rep3 = cst->rep2; + cst->rep2 = cst->rep1; +@@ -464,13 +469,13 @@ + } else { + rc_update_bit_1(rc, prob); + prob += LZMA_IS_REP_G0 - LZMA_IS_REP; +- if (rc_is_bit_0(rc, prob)) { ++ if (rc_is_bit_0(rc, prob, error)) { + rc_update_bit_0(rc, prob); + prob = (p + LZMA_IS_REP_0_LONG + + (cst->state << + LZMA_NUM_POS_BITS_MAX) + + pos_state); +- if (rc_is_bit_0(rc, prob)) { ++ if (rc_is_bit_0(rc, prob, error)) { + rc_update_bit_0(rc, prob); + + cst->state = cst->state < LZMA_NUM_LIT_STATES ? +@@ -485,13 +490,13 @@ + + rc_update_bit_1(rc, prob); + prob += LZMA_IS_REP_G1 - LZMA_IS_REP_G0; +- if (rc_is_bit_0(rc, prob)) { ++ if (rc_is_bit_0(rc, prob, error)) { + rc_update_bit_0(rc, prob); + distance = cst->rep1; + } else { + rc_update_bit_1(rc, prob); + prob += LZMA_IS_REP_G2 - LZMA_IS_REP_G1; +- if (rc_is_bit_0(rc, prob)) { ++ if (rc_is_bit_0(rc, prob, error)) { + rc_update_bit_0(rc, prob); + distance = cst->rep2; + } else { +@@ -509,7 +514,7 @@ + } + + prob_len = prob + LZMA_LEN_CHOICE; +- if (rc_is_bit_0(rc, prob_len)) { ++ if (rc_is_bit_0(rc, prob_len, error)) { + rc_update_bit_0(rc, prob_len); + prob_len += LZMA_LEN_LOW - LZMA_LEN_CHOICE + + (pos_state << +@@ -519,7 +524,7 @@ + } else { + rc_update_bit_1(rc, prob_len); + prob_len += LZMA_LEN_CHOICE_2 - LZMA_LEN_CHOICE; +- if (rc_is_bit_0(rc, prob_len)) { ++ if (rc_is_bit_0(rc, prob_len, error)) { + rc_update_bit_0(rc, prob_len); + prob_len += LZMA_LEN_MID - LZMA_LEN_CHOICE_2 + + (pos_state << +@@ -535,7 +540,7 @@ + } + } + +- rc_bit_tree_decode(rc, prob_len, num_bits, &len); ++ rc_bit_tree_decode(rc, prob_len, num_bits, &len, error); + len += offset; + + if (cst->state < 4) { +@@ -550,7 +555,7 @@ + << LZMA_NUM_POS_SLOT_BITS); + rc_bit_tree_decode(rc, prob, + LZMA_NUM_POS_SLOT_BITS, +- &pos_slot); ++ &pos_slot, error); + if (pos_slot >= LZMA_START_POS_MODEL_INDEX) { + int i, mi; + num_bits = (pos_slot >> 1) - 1; +@@ -563,7 +568,7 @@ + num_bits -= LZMA_NUM_ALIGN_BITS; + while (num_bits--) + cst->rep0 = (cst->rep0 << 1) | +- rc_direct_bit(rc); ++ rc_direct_bit(rc, error); + prob = p + LZMA_ALIGN; + cst->rep0 <<= LZMA_NUM_ALIGN_BITS; + num_bits = LZMA_NUM_ALIGN_BITS; +@@ -571,7 +576,7 @@ + i = 1; + mi = 1; + while (num_bits--) { +- if (rc_get_bit(rc, prob + mi, &mi)) ++ if (rc_get_bit(rc, prob + mi, &mi, error)) + cst->rep0 |= i; + i <<= 1; + } +@@ -588,12 +593,12 @@ + + + +-STATIC inline int INIT unlzma(unsigned char *buf, int in_len, ++STATIC int INIT unlzma(unsigned char *buf, int in_len, + int(*fill)(void*, unsigned int), + int(*flush)(void*, unsigned int), + unsigned char *output, + int *posp, +- void(*error_fn)(char *x) ++ void(*error)(char *x) + ) + { + extern int cpio_flush_buffer(void*, unsigned int); +@@ -610,7 +615,6 @@ + unsigned char *inbuf; + int ret = -1; + +- set_error_fn(error_fn); + + if (buf) + inbuf = buf; +@@ -638,7 +642,7 @@ + + for (i = 0; i < sizeof(header); i++) { + if (rc.ptr >= rc.buffer_end) +- rc_read(&rc); ++ rc_read(&rc, error); + ((unsigned char *)&header)[i] = *rc.ptr++; + } + +@@ -683,17 +687,17 @@ + for (i = 0; i < num_probs; i++) + p[i] = (1 << RC_MODEL_TOTAL_BITS) >> 1; + wr.max_index = wr.next_index = 0; +- rc_init_code(&rc); ++ rc_init_code(&rc, error); + + while (get_pos(&wr) < header.dst_size) { + int pos_state = get_pos(&wr) & pos_state_mask; + uint16_t *prob = p + LZMA_IS_MATCH + + (cst.state << LZMA_NUM_POS_BITS_MAX) + pos_state; +- if (rc_is_bit_0(&rc, prob)) ++ if (rc_is_bit_0(&rc, prob, error)) + process_bit0(&wr, &rc, &cst, p, pos_state, prob, +- lc, literal_pos_mask); ++ lc, literal_pos_mask, error); + else { +- process_bit1(&wr, &rc, &cst, p, pos_state, prob); ++ process_bit1(&wr, &rc, &cst, p, pos_state, prob, error); + if (cst.rep0 == 0) + break; + } +@@ -727,6 +731,9 @@ + exit_0: + return ret; + } ++#if defined(CONFIG_DECOMPRESS_LZMA_NEEDED) && !defined(PREBOOT) ++EXPORT_SYMBOL(unlzma); ++#endif + + #ifdef PREBOOT + STATIC int INIT decompress(unsigned char *buf, int in_len, + +--- linux-2.6.34/fs/squashfs/Kconfig ++++ linux-2.6.34/fs/squashfs/Kconfig +@@ -26,6 +26,12 @@ + + If unsure, say N. + ++config SQUASHFS_LZMA ++ bool "Include support for LZMA compressed file systems" ++ depends on SQUASHFS ++ select DECOMPRESS_LZMA ++ select DECOMPRESS_LZMA_NEEDED ++ + config SQUASHFS_EMBEDDED + + bool "Additional option for memory-constrained systems" + +--- linux-2.6.34/fs/squashfs/Makefile ++++ linux-2.6.34/fs/squashfs/Makefile +@@ -5,3 +5,4 @@ + obj-$(CONFIG_SQUASHFS) += squashfs.o + squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o + squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o ++squashfs-$(CONFIG_SQUASHFS_LZMA) += lzma_wrapper.o + +--- linux-2.6.34/fs/squashfs/decompressor.c ++++ linux-2.6.34/fs/squashfs/decompressor.c +@@ -50,7 +50,11 @@ + + static const struct squashfs_decompressor *decompressor[] = { + &squashfs_zlib_comp_ops, ++#ifdef CONFIG_SQUASHFS_LZMA ++ &squashfs_lzma_comp_ops, ++#else + &squashfs_lzma_unsupported_comp_ops, ++#endif + &squashfs_lzo_unsupported_comp_ops, + &squashfs_unknown_comp_ops + }; + +--- linux-2.6.34/fs/squashfs/lzma_wrapper.c ++++ linux-2.6.34/fs/squashfs/lzma_wrapper.c +@@ -0,0 +1,152 @@ ++/* ++ * Squashfs - a compressed read only filesystem for Linux ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 ++ * Phillip Lougher ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2, ++ * or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++ * ++ * lzma_wrapper.c ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "squashfs_fs.h" ++#include "squashfs_fs_sb.h" ++#include "squashfs_fs_i.h" ++#include "squashfs.h" ++#include "decompressor.h" ++ ++struct squashfs_lzma { ++ void *input; ++ void *output; ++}; ++ ++/* decompress_unlzma.c is currently non re-entrant... */ ++DEFINE_MUTEX(lzma_mutex); ++ ++/* decompress_unlzma.c doesn't provide any context in its callbacks... */ ++static int lzma_error; ++ ++static void error(char *m) ++{ ++ ERROR("unlzma error: %s\n", m); ++ lzma_error = 1; ++} ++ ++ ++static void *lzma_init(struct squashfs_sb_info *msblk) ++{ ++ struct squashfs_lzma *stream = kzalloc(sizeof(*stream), GFP_KERNEL); ++ if (stream == NULL) ++ goto failed; ++ stream->input = vmalloc(msblk->block_size); ++ if (stream->input == NULL) ++ goto failed; ++ stream->output = vmalloc(msblk->block_size); ++ if (stream->output == NULL) ++ goto failed2; ++ ++ return stream; ++ ++failed2: ++ vfree(stream->input); ++failed: ++ ERROR("failed to allocate lzma workspace\n"); ++ kfree(stream); ++ return NULL; ++} ++ ++ ++static void lzma_free(void *strm) ++{ ++ struct squashfs_lzma *stream = strm; ++ ++ if (stream) { ++ vfree(stream->input); ++ vfree(stream->output); ++ } ++ kfree(stream); ++} ++ ++ ++static int lzma_uncompress(struct squashfs_sb_info *msblk, void **buffer, ++ struct buffer_head **bh, int b, int offset, int length, int srclength, ++ int pages) ++{ ++ struct squashfs_lzma *stream = msblk->stream; ++ void *buff = stream->input; ++ int avail, i, bytes = length, res; ++ ++ mutex_lock(&lzma_mutex); ++ ++ for (i = 0; i < b; i++) { ++ wait_on_buffer(bh[i]); ++ if (!buffer_uptodate(bh[i])) ++ goto block_release; ++ ++ avail = min(bytes, msblk->devblksize - offset); ++ memcpy(buff, bh[i]->b_data + offset, avail); ++ buff += avail; ++ bytes -= avail; ++ offset = 0; ++ put_bh(bh[i]); ++ } ++ ++ lzma_error = 0; ++ res = unlzma(stream->input, length, NULL, NULL, stream->output, NULL, ++ error); ++ if (res || lzma_error) ++ goto failed; ++ ++ /* uncompressed size is stored in the LZMA header (5 byte offset) */ ++ res = bytes = get_unaligned_le32(stream->input + 5); ++ for (i = 0, buff = stream->output; bytes && i < pages; i++) { ++ avail = min_t(int, bytes, PAGE_CACHE_SIZE); ++ memcpy(buffer[i], buff, avail); ++ buff += avail; ++ bytes -= avail; ++ } ++ if (bytes) ++ goto failed; ++ ++ mutex_unlock(&lzma_mutex); ++ return res; ++ ++block_release: ++ for (; i < b; i++) ++ put_bh(bh[i]); ++ ++failed: ++ mutex_unlock(&lzma_mutex); ++ ++ ERROR("lzma decompression failed, data probably corrupt\n"); ++ return -EIO; ++} ++ ++const struct squashfs_decompressor squashfs_lzma_comp_ops = { ++ .init = lzma_init, ++ .free = lzma_free, ++ .decompress = lzma_uncompress, ++ .id = LZMA_COMPRESSION, ++ .name = "lzma", ++ .supported = 1 ++}; ++ + +--- linux-2.6.34/fs/squashfs/squashfs.h ++++ linux-2.6.34/fs/squashfs/squashfs.h +@@ -94,3 +94,6 @@ + + /* zlib_wrapper.c */ + extern const struct squashfs_decompressor squashfs_zlib_comp_ops; ++ ++/* lzma wrapper.c */ ++extern const struct squashfs_decompressor squashfs_lzma_comp_ops; + +--- linux-2.6.34/lib/Makefile ++++ linux-2.6.34/lib/Makefile +@@ -69,7 +69,7 @@ obj-$(CONFIG_LZO_DECOMPRESS) += lzo/ + + lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o + lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o +-lib-$(CONFIG_DECOMPRESS_LZMA) += decompress_unlzma.o ++obj-$(CONFIG_DECOMPRESS_LZMA) += decompress_unlzma.o + lib-$(CONFIG_DECOMPRESS_LZO) += decompress_unlzo.o + + obj-$(CONFIG_TEXTSEARCH) += textsearch.o + diff -r 13a47f61c87b -r abe27fd0192d linux-libre/stuff/list_modules.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-libre/stuff/list_modules.sh Tue Mar 15 03:23:44 2011 +0100 @@ -0,0 +1,43 @@ +#!/bin/sh +# list_modules.sh: list Linux kernel modules for SliTaz GNU/Linux. +# 2008/06/07 - GNU General Public License. +# + +find_modules() +{ +find $_pkg/lib/modules/*-slitaz/kernel/$1 -type f -exec basename {} \; +} + +if [ -z "$1" ] ; then + cat 1>&2 <list + +EOT + exit 1 +fi + +if [ -z "$(ls -d $_pkg/lib/modules/*-slitaz/kernel/$1 2> /dev/null)" ] ; then + cat 1>&2 <