wok-undigest view ovzkernel-i686/receipt @ rev 208

Add: ovzkernel-i686 patched kernel for OpenVZ
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sun Jan 02 23:15:54 2011 +0100 (2011-01-02)
parents
children 6969430bceea
line source
1 # SliTaz package receipt.
3 PACKAGE="ovzkernel-i686"
4 VERSION="2.6.32"
5 CATEGORY="system"
6 SHORT_DESC="Vanilla Linux Kernel for OpenVZ"
7 MAINTAINER="erjo@slitaz.org"
8 DEPENDS="depmod"
9 BUILD_DEPENDS="slitaz-toolchain perl"
10 SOURCE="linux"
11 TARBALL="$SOURCE-$VERSION.tar.bz2"
12 WEB_SITE="http://www.kernel.org/"
13 WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL"
14 PROVIDE="linux"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 LOCALVERSION="-ovz" ; export LOCALVERSION
21 cd $src
23 [ -d OpenVZ ] && rm -rf openvz || mkdir OpenVZ
25 zcat ../stuff/patch-dzhanibekov.1-combined.gz > OpenVZ/patch-dzhanibekov.1-combined.u
26 cp ../stuff/*.ovz OpenVZ
28 # Apply patches
29 while read patch_file; do
30 echo "$patch_file" >> OpenVZ/patches
31 #~ cp ../stuff/$patch_file OpenVZ
32 if [ -f done.$patch_file ]; then
33 echo "Skipping $patch_file"
34 continue
35 fi
36 echo "Apply $patch_file"
37 patch -p1 < OpenVZ/$patch_file || exit 1
38 touch done.$patch_file
39 done <<EOT
40 patch-dzhanibekov.1-combined.u
41 EOT
43 make mrproper
45 #cp OpenVZ/kernel-2.6.32-i686-ovz.config .config
46 cp OpenVZ/linux-2.6.32-i686.config.ovz .config
48 # Add LOCALVERSION support
49 sed -i s/CONFIG_LOCALVERSION_AUTO.*/CONFIG_LOCALVERSION_AUTO=y/ .config
51 make oldconfig && \
52 make LOCALVERSION=${LOCALVERSION} prepare
54 make bzImage && \
55 make modules
57 make INSTALL_MOD_PATH=$PWD/_pkg modules_install
58 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install
60 KERNELRELEASE=$( cat include/config/kernel.release 2> /dev/null) ; export KERNELRELEASE
62 [ -s arch/x86/boot/bzImage ] || return 1
63 mkdir -p $PWD/_pkg/boot 2> /dev/null
64 cp -a arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-${KERNELRELEASE}
66 # Compress all modules.
67 #$WOK/$PACKAGE/stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
68 ln System.map System.map-modules
69 ln Module.symvers Module.symvers-modules
70 }
72 # Rules to gen a SliTaz package suitable for Tazpkg.
73 genpkg_rules()
74 {
75 mkdir -p $fs/lib \
76 $fs/boot
78 cp -a $_pkg/lib/modules $fs/lib
79 cp -a $_pkg/lib/firmware $fs/lib
80 cp -a $_pkg/boot $fs/
82 #~ # Get the base modules
83 #~ export src
84 #~ export _pkg
85 #~
86 #~ $src/slitaz/list_modules.sh \
87 #~ $(cat stuff/modules-$VERSION.list) > $src/modules.list
88 #~ while read module; do
89 #~ dir=$(dirname $module)
90 #~ [ -d $path/$dir ] || mkdir -p $path/$dir
91 #~ cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
92 #~ done < $src/modules.list
94 # Remove unresolved links
95 rm -f $fs/lib/modules/${KERNELRELEASE}/build
96 rm -f $fs/lib/modules/${KERNELRELEASE}/source
98 }
100 # Pre and post install commands for Tazpkg.
101 post_install()
102 {
103 echo "Processing post-install commands..."
104 KERNELRELEASE=2.6.32.25-ovz
106 chroot "$1/" depmod -a $KERNELRELEASE
108 # GRUB stuff.
109 if [ -f "$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 if ! grep -q $KERNELRELEASE $1/boot/grub/menu.lst; then
114 cat >> $1/boot/grub/menu.lst << EOT
116 title SliTaz GNU/Linux (Kernel $KERNELRELEASE)
117 $grub_dev
118 kernel /boot/vmlinuz-$KERNELRELEASE root=$root_dev
119 EOT
120 fi
121 # Display information message.
122 cat <<EOT
123 ----
124 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
126 title SliTaz GNU/Linux (Kernel $KERNELRELEASE)
127 $grub_dev
128 kernel /boot/vmlinuz-$KERNELRELEASE root=$root_dev
129 ----
130 EOT
131 fi
132 }