# SliTaz package receipt. PACKAGE="linux-libre" VERSION="2.6.37-libre" CATEGORY="base-system" SHORT_DESC="The Linux Libre kernel and modules." MAINTAINER="gokhlayeh@slitaz.org" PROVIDE="linux" SOURCE="linux" TARBALL="$SOURCE-$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" DEPENDS="depmod" BUILD_DEPENDS="slitaz-toolchain perl git lzma patch" # Rules to configure and make the package. compile_rules() { cd $src # 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 [ ! -x /usr/bin/cook ] && report open-bloc # Check for Aufs and cook it if unbuilt. echo "Checking for Aufs packages..." _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` if [ ! -d "$AUFSDIR" ] && [ -x /usr/bin/cook ]; then # Give info an redirect to /dev/null since aufs got it own log. AUFSDIR=$WOK/aufs/source/aufs-${_AUFSVER} echo "Cook: aufs $_AUFSVER" cook aufs > /dev/null elif [ ! -x /usr/bin/cook ]; then # We only need aufs source. Also cooking now is a bad idea since it # needs linux-module-headers. AUFSDIR=$WOK/aufs/aufs-${_AUFSVER} [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; } fi echo "Copying Aufs files and patches..." cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src cp -a $AUFSDIR/*.patch $stuff # SliTaz db rm -rf $WOK/$PACKAGE/slitaz && mkdir $WOK/$PACKAGE/slitaz echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz # Apply patches echo "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 [ ! -x /usr/bin/cook ] && report step "Compressing all modules" # Compress all modules. $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz ln System.map System.map-modules ln Module.symvers Module.symvers-modules if [ ! -x /usr/bin/cook ]; then report close-bloc fi } # 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 $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 # Check and echo any module in kernel .config that's not added to # one of linux-* pkgs export PACKAGE $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 <