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