# SliTaz package receipt. PACKED_SIZE="1.3M" UNPACKED_SIZE="2.0M" PACKAGE="kernel-modular" SOURCE="linux" #VERSION="2.6.0" VERSION="2.6.37" CATEGORY="base-system" SHORT_DESC="The Linux kernel and modules" DEPENDS="depmod" BUILD_DEPENDS="slitaz-toolchain perl git lzma" [ -n "$TARGET" ] && BUILD_DEPENDS="$BUILD_DEPENDS uclibc-cross-compiler-$TARGET" || TARGET="i486" MAINTAINER="devel@slitaz.org" TARBALL="$SOURCE-$VERSION.tar.bz2" WEB_SITE="http://www.kernel.org/" WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL" CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep" # Rules to configure and make the package. compile_rules() { if [ ! -s $WOK/busybox/busybox*/rootfs.cpio ]; then tazwok cook busybox fi cp $WOK/busybox/busybox*/rootfs.cpio $src cp $WOK/busybox/busybox*/.config $src/config-busybox # 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 local _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` local AUFSDIR="aufs-${_AUFSVER}" TARBALL=$SOURCES_REPOSITORY/$AUFSDIR.tar.lzma if [ -f $TARBALL ]; then unlzma -c $TARBALL | tar xf - cd $AUFSDIR && git checkout origin/aufs2.1-37 cd $WOK/$PACKAGE else # Aufs2 from git repository git clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs2-standalone.git $AUFSDIR tar cf - $AUFSDIR | lzma e $TARBALL -si cd $AUFSDIR && git checkout origin/aufs2.1-37 cd $WOK/$PACKAGE fi cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src cp -a $AUFSDIR/*.patch $WOK/$PACKAGE/stuff # We need the real GNU patch [ -L /usr/bin/patch ] && tazpkg get-install patch --forced cd $src # SliTaz db [ -d slitaz ] && rm -rf slitaz 2> /dev/null mkdir slitaz echo "$WGET_URL" > slitaz/url cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz cp ../stuff/bootloader.sh slitaz # Apply patches while read patch_file; do echo "$patch_file" >> slitaz/patches cp ../stuff/$patch_file slitaz if [ -f done.$patch_file ]; then echo "Skipping $patch_file" continue fi echo "Apply $patch_file" patch -p1 < slitaz/$patch_file || exit 1 touch done.$patch_file done < /dev/null cp arch/x86/boot/bzImage kernel-modular cp System.map System.map-modular cp .config config-modular mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz # Compress all modules. $WOK/$PACKAGE/stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz ln System.map System.map-modules ln Module.symvers Module.symvers-modules } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir $fs/boot cp -a $_pkg/../$PACKAGE $fs/boot/bzImage cp -a $_pkg/../System.map-${PACKAGE#kernel-} $fs/boot/System.map cp -a $_pkg/../config-${PACKAGE#kernel-} $fs/boot/config cp -a $_pkg/../config-busybox $fs/boot # Compress all modules. #./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz } # 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 $SOURCE-$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 <