wok-current view linux/receipt @ rev 8122

Fixed aufs and linux to use lzma-alone for compressing aufs.
author Christopher Rogers <slaxemulator@gmail.com>
date Mon Jan 24 01:08:20 2011 +0000 (2011-01-24)
parents 601a71b6e02e
children 489898e9f029
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.37"
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.lzma
27 if [ -f $TARBALL ]; then
28 lzma-alone d $TARBALL $AUFSDIR.tar
29 tar xf $AUFSDIR.tar
30 if [ -f $AUFSDIR.tar ]; then
31 rm -f $AUFSDIR.tar
32 fi
33 cd $AUFSDIR && git checkout origin/aufs2.1-37
34 cd $WOK/$PACKAGE
35 else
36 # Aufs2 from git repository
37 git clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs2-standalone.git $AUFSDIR
38 tar cf $AUFSDIR.tar $AUFSDIR
39 lzma-alone e $AUFSDIR.tar $TARBALL
40 if [ -f $AUFSDIR.tar ]; then
41 rm -f $AUFSDIR.tar
42 fi
43 cd $AUFSDIR && git checkout origin/aufs2.1-37
44 cd $WOK/$PACKAGE
45 fi
46 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
47 cp -a $AUFSDIR/*.patch $WOK/$PACKAGE/stuff
48 # We need the real GNU patch
49 [ -L /usr/bin/patch ] && tazpkg get-install patch --forced
50 cd $src
51 # SliTaz db
52 [ -d slitaz ] && rm -rf slitaz 2> /dev/null
53 mkdir slitaz
54 echo "$WGET_URL" > slitaz/url
55 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
56 cp ../stuff/bootloader.sh slitaz
57 # Apply patches
58 while read patch_file; do
59 echo "$patch_file" >> slitaz/patches
60 cp ../stuff/$patch_file slitaz
61 if [ -f done.$patch_file ]; then
62 echo "Skipping $patch_file"
63 continue
64 fi
65 echo "Apply $patch_file"
66 patch -p1 < slitaz/$patch_file || exit 1
67 touch done.$patch_file
68 done <<EOT
69 $PACKAGE-diff-$VERSION.u
70 $PACKAGE-unlzma-$VERSION.u
71 $PACKAGE-header-$VERSION.u
72 $PACKAGE-freeinitrd-$VERSION.u
73 aufs2-base.patch
74 aufs2-standalone.patch
75 001-squashfs-decompressors-add-xz-decompressor-module.patch
76 002-squashfs-decompressors-add-boot-time-xz-support.patch
77 003-squashfs-x86-support-xz-compressed-kernel.patch
78 004-squashfs-add-xz-compression-support.patch
79 005-squashfs-add-xz-compression-configuration-option.patch
80 EOT
81 make mrproper
82 cd Documentation/lguest
83 make lguest || return 1
84 cd ../..
86 # Build bzImage without modules first
87 cp -f ../stuff/$PACKAGE-$VERSION-slitaz.config .config
88 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
89 # We can't keep every driver in staging
90 sed -i -e 's/^CONFIG_RTL8192/#&/' \
91 -e 's/^CONFIG_R8187SE/#&/' \
92 -e 's/^CONFIG_RT2870/#&/' .config
93 yes '' | make oldconfig
94 make -j 4 bzImage || return 1
95 [ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg
96 mv arch/x86/boot/bzImage $PWD/_pkg
97 mv System.map System.map-without-modules
99 # Build bzImage with modules
100 cp -f ../stuff/$PACKAGE-$VERSION-slitaz.config .config
101 make oldconfig
102 ln .config slitaz/config
103 make -j 4 bzImage &&
104 make -j 4 modules &&
105 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
106 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
107 [ -s arch/x86/boot/bzImage ] || return 1
108 mkdir -p $PWD/_pkg/boot 2> /dev/null
109 mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz
110 # Compress all modules.
111 $WOK/$PACKAGE/stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
112 ln System.map System.map-modules
113 ln Module.symvers Module.symvers-modules
114 }
116 # Rules to gen a SliTaz package suitable for Tazpkg.
117 genpkg_rules()
118 {
119 local path
120 cp -a $_pkg/boot $fs
121 # Compress all modules.
122 #./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
123 path=$fs/lib/modules/$VERSION-slitaz/kernel
124 mkdir -p $path
125 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
126 $fs/lib/modules/$VERSION-slitaz
127 # Get the base modules
128 export src
129 export _pkg
130 $src/slitaz/list_modules.sh \
131 $(cat stuff/modules-$VERSION.list) > $src/modules.list
132 while read module; do
133 dir=$(dirname $module)
134 [ -d $path/$dir ] || mkdir -p $path/$dir
135 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
136 done < $src/modules.list
137 # Remove unresolved links
138 rm -f $fs/lib/modules/$VERSION-slitaz/build
139 rm -f $fs/lib/modules/$VERSION-slitaz/source
140 # Cook all packages with a kernel module
141 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
142 do
143 echo tazwok cook ${i%/receipt}
144 done
145 # Check and echo any module in kernel .config that's not added to
146 # one of linux-* pkgs
147 ./stuff/check_modules.sh
148 }
150 # Pre and post install commands for Tazpkg.
151 post_install()
152 {
153 echo "Processing post-install commands..."
154 chroot "$1/" depmod -a $VERSION-slitaz
155 # GRUB stuff.
156 if [ -f "$1/boot/grub/menu.lst" ]; then
157 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
158 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
159 # Add new kernel entry in case of upgrade for installed system.
160 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
161 cat >> $1/boot/grub/menu.lst << EOT
163 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
164 $grub_dev
165 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
166 EOT
167 fi
168 # Display information message.
169 cat <<EOT
170 ----
171 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
173 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
174 $grub_dev
175 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
176 ----
177 EOT
178 fi
179 }
181 clean_wok()
182 {
183 #rm -rf aufs2
184 rm stuff/aufs2-base*
185 rm stuff/aufs2-standalone*
186 rm stuff/aufs2-kbuild*
187 rm -rf stuff/tmp
188 }