wok-stable view linux/receipt @ rev 3622

kismet: up to 2009-06-R1
author Dominique Corbex <domcox@users.sourceforge.net>
date Tue Jun 30 20:34:35 2009 +0200 (2009-06-30)
parents d621346a3d07
children 7df76f20d2c3
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.29.3"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux kernel and modules."
7 DEPENDS="depmod"
8 BUILD_DEPENDS="slitaz-toolchain perl"
9 MAINTAINER="pascal.bellard@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-lzma-$VERSION.u
36 $PACKAGE-utf8-$VERSION.u
37 $PACKAGE-diff-$VERSION.u
38 $PACKAGE-rootdev.u
39 EOT
40 make mrproper
41 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
42 make oldconfig
43 ln .config slitaz/config
44 make bzImage
45 make modules
46 make INSTALL_MOD_PATH=$PWD/_pkg modules_install
47 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install
48 }
50 # Rules to gen a SliTaz package suitable for Tazpkg.
51 genpkg_rules()
52 {
53 local path
54 mkdir $fs/boot
55 cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz
56 # Compress all modules.
57 # Package module-init-tools is compiled with zlib support.
58 #
59 ./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
60 path=$fs/lib/modules/$VERSION-slitaz/kernel
61 mkdir -p $path
62 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz
63 cp ./stuff/list_modules.sh $src
64 export src
65 export _pkg
66 $src/list_modules.sh $(cat stuff/modules-$VERSION.list) > $src/modules.list
67 while read module firmwares; do
68 dir=$(dirname $module)
69 [ -d $path/$dir ] || mkdir -p $path/$dir
70 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
71 done < $src/modules.list
72 for i in $(cat stuff/firmwares-$VERSION.list) ; do
73 dir=$(dirname $i)
74 [ -d $fs/lib/firmware/$dir ] || mkdir -p $fs/lib/firmware/$dir
75 cp -a $_pkg/lib/firmware/$i $fs/lib/firmware/$i
76 done
77 # Remove unresolved links
78 rm -f $fs/lib/modules/$VERSION-slitaz/build
79 rm -f $fs/lib/modules/$VERSION-slitaz/source
80 # Package all linux pkgs
81 for i in $(cd $WOK; ls -d linux-*)
82 do
83 tazwok genpkg $i
84 done
85 # Cook all packages with a kernel module
86 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
87 do
88 echo tazwok cook ${i%/receipt}
89 done
90 # check and echo modules
91 cp ./stuff/check_modules.sh $src
92 $src/check_modules.sh "$VERSION" "$WOK"
94 }
96 # Pre and post install commands for Tazpkg.
97 # GRUB stuf.
98 post_install()
99 {
100 echo "Processing post-install commands..."
101 chroot "$1/" depmod -a $VERSION-slitaz
103 # Update in-kernel module list
104 for module in ohci_hcd vfat msdos nls_utf8 fat snd_hda_intel ; do
105 sed -i "s/$module//" $1/etc/rcS.conf
106 done
108 if [ -f "$1/boot/grub/menu.lst" ]; then
109 if ! grep -q "vmlinuz-$VERSION-slitaz" $1/boot/grub/menu.lst; then
110 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
111 grub_dev=`cat $1/boot/grub/menu.lst | grep "root.* (" | head -n 1`
112 # Add new kernel entry in case of upgrade for installed system.
113 cat >> $1/boot/grub/menu.lst << EOT
115 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
116 $grub_dev
117 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
118 EOT
119 # Display information message.
120 cat <<EOT
121 ----
122 GRUB is installed, these tree lines has been added to the menu.lst:
124 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
125 $grub_dev
126 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
127 ----
128 EOT
129 else
130 echo "Grub menu.lst seems already configured to boot new Kernel..."
131 fi
132 fi
133 }