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

ovzkernel-i686: add gztazmod
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Tue Jan 04 07:32:18 2011 +0100 (2011-01-04)
parents 52400a97dd0d
children ebe51b98b2ad
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
50 #sed -i s/CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=\"-ovz\"/ .config
52 [ -f scripts/setlocalversion ] && mv scripts/setlocalversion scripts/setlocalversion.disabled
53 make oldconfig && \
54 make LOCALVERSION=${LOCALVERSION} prepare
55 exit
56 make bzImage && \
57 make modules
59 make INSTALL_MOD_PATH=$PWD/_pkg modules_install
60 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install
62 KERNELRELEASE=$( cat include/config/kernel.release 2> /dev/null) ; export KERNELRELEASE
64 [ -s arch/x86/boot/bzImage ] || return 1
65 mkdir -p $PWD/_pkg/boot 2> /dev/null
66 cp -a arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-${KERNELRELEASE}
68 # Compress all modules.
69 $WOK/$PACKAGE/stuff/gztazmod.sh $PWD/_pkg/lib/modules/${KERNELRELEASE}
70 ln System.map System.map-modules
71 ln Module.symvers Module.symvers-modules
72 }
74 # Rules to gen a SliTaz package suitable for Tazpkg.
75 genpkg_rules()
76 {
77 mkdir -p $fs/lib \
78 $fs/boot
80 cp -a $_pkg/lib/modules $fs/lib
81 cp -a $_pkg/lib/firmware $fs/lib
82 cp -a $_pkg/boot $fs/
84 #~ # Get the base modules
85 #~ export src
86 #~ export _pkg
87 #~
88 #~ $src/slitaz/list_modules.sh \
89 #~ $(cat stuff/modules-$VERSION.list) > $src/modules.list
90 #~ while read module; do
91 #~ dir=$(dirname $module)
92 #~ [ -d $path/$dir ] || mkdir -p $path/$dir
93 #~ cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
94 #~ done < $src/modules.list
96 # Remove unresolved links
97 rm -f $fs/lib/modules/${KERNELRELEASE}/build
98 rm -f $fs/lib/modules/${KERNELRELEASE}/source
100 }
102 # Pre and post install commands for Tazpkg.
103 post_install()
104 {
105 echo "Processing post-install commands..."
106 # TODO: Remove hardcoded KERNELRELEASE
107 KERNELRELEASE=2.6.32.25-ovz
109 chroot "$1/" depmod -a $KERNELRELEASE
111 # GRUB stuff.
112 if [ -f "$1/boot/grub/menu.lst" ]; then
113 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
114 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
115 # Add new kernel entry in case of upgrade for installed system.
116 if ! grep -q $KERNELRELEASE $1/boot/grub/menu.lst; then
117 cat >> $1/boot/grub/menu.lst << EOT
119 title SliTaz GNU/Linux (Kernel $KERNELRELEASE)
120 $grub_dev
121 kernel /boot/vmlinuz-$KERNELRELEASE root=$root_dev
122 EOT
123 fi
124 # Display information message.
125 cat <<EOT
126 ----
127 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
129 title SliTaz GNU/Linux (Kernel $KERNELRELEASE)
130 $grub_dev
131 kernel /boot/vmlinuz-$KERNELRELEASE root=$root_dev
132 ----
133 EOT
134 fi
135 }