wok-next view linux/receipt @ rev 7297

Add aufs. Aufs is now compile by itself like ndiswrapper-driver is. This is so the aufs source tar.gz file is not purge with tazdev everytime we need to purge it. Removed linux-aufs receipt. Updated linux, linux-source, and aufs-utils with the new changes.
author Christopher Rogers <slaxemulator@gmail.com>
date Wed Nov 17 00:59:02 2010 +0000 (2010-11-17)
parents 5355ffc461cf
children db069f80c0a0
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.36"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux kernel and modules."
7 DEPENDS="depmod"
8 BUILD_DEPENDS="slitaz-toolchain perl git"
9 MAINTAINER="devel@slitaz.org"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.kernel.org/"
12 WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL"
13 CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
19 # this is code to help update the kernel version faster
20 #for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt)
21 #do
22 # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i
23 #done
24 local _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
25 local AUFSDIR="aufs-${_AUFSVER}"
26 TARBALL=$SOURCES_REPOSITORY/$AUFSDIR.tar.gz
27 if [ -d $WOK/aufs/$AUFSDIR ]; then
28 local AUFSDIR=$WOK/aufs/$AUFSDIR
29 ln -sf $AUFSDIR aufs-${_AUFSVER}
30 elif [ -f $TARBALL ]; then
31 tar xzf $TARBALL
32 cd $AUFSDIR && git checkout origin/aufs2
33 cd $WOK/$PACKAGE
34 else
35 # Aufs2 from git repository
36 git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git $AUFSDIR
37 tar czf $TARBALL $AUFSDIR
38 cd $AUFSDIR && git checkout origin/aufs2
39 cd $WOK/$PACKAGE
40 fi
41 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
42 cp -a $AUFSDIR/*.patch $WOK/$PACKAGE/stuff
43 # We need the real GNU patch
44 [ -L /usr/bin/patch ] && tazpkg get-install patch --forced
45 cd $src
46 # SliTaz db
47 [ -d slitaz ] && rm -rf slitaz 2> /dev/null
48 mkdir slitaz
49 echo "$WGET_URL" > slitaz/url
50 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
51 cp ../stuff/bootloader.sh slitaz
52 # Apply patches
53 while read patch_file; do
54 echo "$patch_file" >> slitaz/patches
55 cp ../stuff/$patch_file slitaz
56 if [ -f done.$patch_file ]; then
57 echo "Skipping $patch_file"
58 continue
59 fi
60 echo "Apply $patch_file"
61 patch -p1 < slitaz/$patch_file || exit 1
62 touch done.$patch_file
63 done <<EOT
64 $PACKAGE-diff-$VERSION.u
65 $PACKAGE-unlzma-$VERSION.u
66 $PACKAGE-header-$VERSION.u
67 $PACKAGE-freeinitrd-$VERSION.u
68 aufs2-base.patch
69 aufs2-standalone.patch
70 aufs2-module-2.6.36.patch
71 aufs2-2.6.36-fix.patch
72 EOT
73 make mrproper
74 cd Documentation/lguest
75 make lguest || return 1
76 cd ../..
77 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
78 make oldconfig
79 ln .config slitaz/config
80 make -j 4 bzImage &&
81 make -j 4 modules &&
82 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
83 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
84 [ -s arch/x86/boot/bzImage ]
85 # Compress all modules.
86 $WOK/$PACKAGE/stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
87 }
89 # Rules to gen a SliTaz package suitable for Tazpkg.
90 genpkg_rules()
91 {
92 local path
93 mkdir $fs/boot
94 cp -a $src/arch/x86/boot/bzImage \
95 $fs/boot/vmlinuz-$VERSION-slitaz
96 # Compress all modules.
97 #./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
98 path=$fs/lib/modules/$VERSION-slitaz/kernel
99 mkdir -p $path
100 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
101 $fs/lib/modules/$VERSION-slitaz
102 # Get the base modules
103 export src
104 export _pkg
105 $src/slitaz/list_modules.sh \
106 $(cat stuff/modules-$VERSION.list) > $src/modules.list
107 while read module; do
108 dir=$(dirname $module)
109 [ -d $path/$dir ] || mkdir -p $path/$dir
110 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
111 done < $src/modules.list
112 # Remove unresolved links
113 rm -f $fs/lib/modules/$VERSION-slitaz/build
114 rm -f $fs/lib/modules/$VERSION-slitaz/source
115 # Cook all packages with a kernel module
116 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
117 do
118 echo tazwok cook ${i%/receipt}
119 done
120 # Check and echo any module in kernel .config that's not added to
121 # one of linux-* pkgs
122 ./stuff/check_modules.sh
123 }
125 # Pre and post install commands for Tazpkg.
126 post_install()
127 {
128 echo "Processing post-install commands..."
129 chroot "$1/" depmod -a $VERSION-slitaz
130 # GRUB stuff.
131 if [ -f "$1/boot/grub/menu.lst" ]; then
132 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
133 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
134 # Add new kernel entry in case of upgrade for installed system.
135 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
136 cat >> $1/boot/grub/menu.lst << EOT
138 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
139 $grub_dev
140 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
141 EOT
142 fi
143 # Display information message.
144 cat <<EOT
145 ----
146 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
148 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
149 $grub_dev
150 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
151 ----
152 EOT
153 fi
154 }
156 clean_wok()
157 {
158 #rm -rf aufs2
159 rm stuff/aufs2-base*
160 rm stuff/aufs2-standalone*
161 #rm stuff/aufs2-kbuild*
162 rm -rf stuff/tmp
163 }