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