wok view linux/receipt @ rev 3864

Up: linux (2.6.30.4)
author Christophe Lincoln <pankso@slitaz.org>
date Fri Aug 07 23:18:34 2009 +0200 (2009-08-07)
parents 6d2a7e095c2b
children 22410fa562c7
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.30.4"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux kernel and modules."
7 DEPENDS="depmod"
8 BUILD_DEPENDS="slitaz-toolchain perl"
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 {
18 cd $src
19 rm -rf slitaz 2> /dev/null
20 mkdir slitaz
21 echo "$WGET_URL" > slitaz/url
22 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
23 # lzma and misc patches from pascal
24 while read patch_file; do
25 if [ -f done.$patch_file ]; then
26 echo "Skipping $patch_file"
27 continue
28 fi
29 echo "Apply $patch_file"
30 patch -p1 < ../stuff/$patch_file || return 1
31 echo "$patch_file" >> slitaz/patches
32 cp ../stuff/$patch_file slitaz/$patch_file
33 touch done.$patch_file
34 done <<EOT
35 $PACKAGE-utf8-$VERSION.u
36 $PACKAGE-diff-$VERSION.u
37 EOT
38 make mrproper
39 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
40 make oldconfig
41 ln .config slitaz/config
42 make bzImage
43 make modules
44 make INSTALL_MOD_PATH=$PWD/_pkg modules_install
45 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install
46 }
48 # Rules to gen a SliTaz package suitable for Tazpkg.
49 genpkg_rules()
50 {
51 local path
52 mkdir $fs/boot
53 cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz
54 # Compress all modules.
55 # Package module-init-tools is compiled with zlib support.
56 #
57 ./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
58 path=$fs/lib/modules/$VERSION-slitaz/kernel
59 mkdir -p $path
60 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz
61 cp ./stuff/list_modules.sh $src
62 export src
63 export _pkg
64 $src/list_modules.sh $(cat stuff/modules-$VERSION.list) > $src/modules.list
65 while read module; do
66 dir=$(dirname $module)
67 [ -d $path/$dir ] || mkdir -p $path/$dir
68 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
69 done < $src/modules.list
70 # Remove unresolved links
71 rm -f $fs/lib/modules/$VERSION-slitaz/build
72 rm -f $fs/lib/modules/$VERSION-slitaz/source
73 # Package all linux pkgs
74 for i in $(cd $WOK; ls -d linux-*)
75 do
76 tazwok genpkg $i
77 done
78 # Cook all packages with a kernel module
79 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
80 do
81 echo tazwok cook ${i%/receipt}
82 done
83 }
85 # Pre and post install commands for Tazpkg.
86 # GRUB stuf.
87 post_install()
88 {
89 echo "Processing post-install commands..."
90 chroot "$1/" depmod -a $VERSION-slitaz
91 if [ -f "$1/boot/grub/menu.lst" ]; then
92 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/'`
93 grub_dev=`cat $1/boot/grub/menu.lst | grep "root ("`
94 # Add new kernel entry in case of upgrade for installed system.
95 cat >> $1/boot/grub/menu.lst << EOT
97 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
98 $grub_dev
99 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
100 EOT
101 # Display information message.
102 cat <<EOT
103 ----
104 GRUB is installed, these tree lines has been added to the menu.lst:
106 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
107 $grub_dev
108 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
109 ----
110 EOT
111 fi
112 }