wok view linux64/receipt @ rev 14175

Up linux (3.2.40)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Mar 10 13:32:17 2013 +0100 (2013-03-10)
parents d9abc342bfd6
children ad59999b3fce
line source
1 # SliTaz package receipt.
3 PACKAGE="linux64"
4 VERSION="3.2.40"
5 KBASEVER="${VERSION:0:3}"
6 CATEGORY="base-system"
7 SHORT_DESC="The Linux 64 bits kernel and modules."
8 MAINTAINER="devel@slitaz.org"
9 WEB_SITE="http://www.kernel.org/"
10 WANTED="linux"
11 PROVIDE="linux"
12 CONFIG_FILES="/lib/modules/$KBASEVER-slitaz/modules.dep"
14 DEPENDS="depmod"
16 # Rules to gen a SliTaz package suitable for Tazpkg.
17 genpkg_rules()
18 {
19 local path
20 _pkg=$_pkg/linux64
21 cp -a $_pkg/boot $fs
22 path=$fs/lib/modules/$KBASEVER-slitaz/kernel
23 mkdir -p $path
24 cp -a $_pkg/lib/modules/$KBASEVER-slitaz/mo* \
25 $fs/lib/modules/$KBASEVER-slitaz
26 [ "$KBASEVER" != "$VERSION" ] &&
27 ln -s $KBASEVER-slitaz $fs/lib/modules/$VERSION-slitaz
28 # Get the base modules
29 export src
30 export _pkg
31 mkdir -p $WOK/$PACKAGE/source/tmp
32 $wanted_stuff/list_modules.sh \
33 $(cat $stuff/modules64.list) > $WOK/$PACKAGE/source/tmp/modules.list
34 while read module; do
35 dir=$(dirname $module)
36 [ -d $path/$dir ] || mkdir -p $path/$dir
37 cp -a $_pkg/lib/modules/$KBASEVER-slitaz/kernel/$module $path/$dir
38 done < $WOK/$PACKAGE/source/tmp/modules.list
39 # Remove unresolved links
40 rm -f $fs/lib/modules/$KBASEVER-slitaz/build
41 rm -f $fs/lib/modules/$KBASEVER-slitaz/source
42 # Cook all packages with a kernel module
43 for i in $(cd $WOK; grep -l 'cook linux$' */receipt)
44 do
45 echo cook ${i%/receipt}
46 done
47 # Fixed modules.dep to use right path
48 # saves 100kb of space too
49 sed -i "s|$_pkg||g" $fs/lib/modules/$KBASEVER-slitaz/modules.dep
50 sed -i "s|99.98.$KBASEVER-slitaz|$KBASEVER-slitaz|g" $fs/lib/modules/$KBASEVER-slitaz/modules.dep
51 # Check and echo any module in kernel .config that's not added to
52 # one of linux-* pkgs
53 $wanted_stuff/check_modules.sh 2>&1 | grep -v files.list
54 }
56 # Pre and post install commands for Tazpkg.
57 post_install()
58 {
59 echo "Processing post-install commands..."
60 chroot "$1/" depmod -a $KBASEVER-slitaz
61 # GRUB stuff.
62 if [ -f "$1/boot/grub/menu.lst" ]; then
63 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
64 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
65 # Add new kernel entry in case of upgrade for installed system.
66 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
67 cat >> $1/boot/grub/menu.lst << EOT
69 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
70 $grub_dev
71 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
72 EOT
73 fi
74 # Display information message.
75 cat <<EOT
76 ----
77 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
79 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
80 $grub_dev
81 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
82 ----
83 EOT
84 fi
85 }