wok view linux/receipt @ rev 3920

linux*: fix list_modules.sh path
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 18 21:01:42 2009 +0200 (2009-08-18)
parents a64e9d9bbe8c
children f8cf76fcf2c8
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 $PACKAGE-freeinitrd-$VERSION.u
38 $PACKAGE-unlzma-$VERSION.u
39 $PACKAGE-hotfix-$VERSION.u
40 EOT
41 make mrproper
42 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
43 make oldconfig
44 ln .config slitaz/config
45 make bzImage &&
46 make modules &&
47 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
48 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
49 [ -s arch/x86/boot/bzImage ]
50 }
52 # Rules to gen a SliTaz package suitable for Tazpkg.
53 genpkg_rules()
54 {
55 local path
56 mkdir $fs/boot
57 cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz
58 # Compress all modules.
59 # Package module-init-tools is compiled with zlib support.
60 #
61 ./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
62 path=$fs/lib/modules/$VERSION-slitaz/kernel
63 mkdir -p $path
64 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz
65 export src
66 export _pkg
67 $src/slitaz/list_modules.sh \
68 $(cat stuff/modules-$VERSION.list) > $src/modules.list
69 while read module; do
70 dir=$(dirname $module)
71 [ -d $path/$dir ] || mkdir -p $path/$dir
72 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
73 done < $src/modules.list
74 # Remove unresolved links
75 rm -f $fs/lib/modules/$VERSION-slitaz/build
76 rm -f $fs/lib/modules/$VERSION-slitaz/source
77 # Package all linux pkgs
78 for i in $(cd $WOK; ls -d linux-*)
79 do
80 tazwok genpkg $i
81 done
82 # Cook all packages with a kernel module
83 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
84 do
85 echo tazwok cook ${i%/receipt}
86 done
87 }
89 # Pre and post install commands for Tazpkg.
90 # GRUB stuf.
91 post_install()
92 {
93 echo "Processing post-install commands..."
94 chroot "$1/" depmod -a $VERSION-slitaz
95 if [ -f "$1/boot/grub/menu.lst" ]; then
96 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/'`
97 grub_dev=`cat $1/boot/grub/menu.lst | grep "root ("`
98 # Add new kernel entry in case of upgrade for installed system.
99 cat >> $1/boot/grub/menu.lst << EOT
101 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
102 $grub_dev
103 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
104 EOT
105 # Display information message.
106 cat <<EOT
107 ----
108 GRUB is installed, these tree lines has been added to the menu.lst:
110 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
111 $grub_dev
112 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
113 ----
114 EOT
115 fi
116 }