wok-undigest view ovzkernel/receipt @ rev 322

Fix: oxine receipt
author Alexander Medvedev <devl547@gmail.com>
date Sat Jun 11 12:39:02 2011 +0000 (2011-06-11)
parents
children 7771356bd054
line source
1 # SliTaz package receipt.
3 PACKAGE="ovzkernel"
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"
15 EXTRAVERSION="-i686"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 LOCALVERSION="-ovz" ; export LOCALVERSION
22 cd $src
24 [ -d OpenVZ ] && rm -rf openvz || mkdir OpenVZ
26 zcat ../stuff/patch-dzhanibekov.1-combined.gz > OpenVZ/patch-dzhanibekov.1-combined.u
27 cp ../stuff/*.ovz OpenVZ
28 cp ../stuff/*.sh OpenVZ
30 # Apply patches
31 while read patch_file; do
32 echo "$patch_file" >> OpenVZ/patches
33 #~ cp ../stuff/$patch_file OpenVZ
34 if [ -f done.$patch_file ]; then
35 echo "Skipping $patch_file"
36 continue
37 fi
38 echo "Apply $patch_file"
39 patch -p1 < OpenVZ/$patch_file || exit 1
40 touch done.$patch_file
41 done <<EOT
42 patch-dzhanibekov.1-combined.u
43 EOT
44 # Prepare to build
45 make mrproper
47 # Copy old kernel config
48 cp OpenVZ/linux-2.6.32-i686.config.ovz .config
50 # Add LOCALVERSION support
51 sed -i s/CONFIG_LOCALVERSION_AUTO.*/CONFIG_LOCALVERSION_AUTO=y/ .config
53 # Disable Source Versio Control detection
54 [ -f scripts/setlocalversion ] && mv scripts/setlocalversion scripts/setlocalversion.disabled
56 # Apply kernel config and build
57 make oldconfig && \
58 make LOCALVERSION=${LOCALVERSION} prepare
59 make bzImage && \
60 make modules
62 # Install modules and headers
63 make INSTALL_MOD_PATH=$PWD/_pkg modules_install
64 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install
66 # Get kernel release
67 KERNELRELEASE=$( cat include/config/kernel.release 2> /dev/null) ; export KERNELRELEASE
69 [ -s arch/x86/boot/bzImage ] || return 1
70 mkdir -p $PWD/_pkg/boot 2> /dev/null
71 cp -a arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-${KERNELRELEASE}
73 # Compress all modules.
74 $WOK/$PACKAGE/stuff/gztazmod.sh $PWD/_pkg/lib/modules/${KERNELRELEASE}
75 ln System.map System.map-modules
76 ln Module.symvers Module.symvers-modules
77 }
79 # Rules to gen a SliTaz package suitable for Tazpkg.
80 genpkg_rules()
81 {
82 local path
83 KERNELRELEASE=$( cat $src/include/config/kernel.release 2> /dev/null)
84 path=$fs/lib/modules/${KERNELRELEASE}/kernel
86 mkdir -p $fs/lib \
87 $fs/boot \
88 $fs/lib/modules/${KERNELRELEASE} \
89 $path \
90 $fs/etc/ovzkernel
92 #cp -a $_pkg/lib/modules $fs/lib
93 cp -a $_pkg/lib/firmware $fs/lib
94 cp -a $_pkg/boot $fs/
96 #~ # Get the base modules
97 export src
98 export _pkg
100 cp -a $src/include/config/kernel.release $fs/etc/ovzkernel
101 cp -a $_pkg/lib/modules/${KERNELRELEASE}/mo* \
102 $fs/lib/modules/${KERNELRELEASE}
104 $src/OpenVZ/list_modules.sh ${KERNELRELEASE} \
105 $(cat stuff/modules-$VERSION.list) > $src/modules.list
106 while read module; do
107 dir=$(dirname $module)
108 [ -d $path/$dir ] || mkdir -p $path/$dir
109 cp -a $_pkg/lib/modules/${KERNELRELEASE}/kernel/$module $path/$dir
110 done < $src/modules.list
112 # Remove unresolved links
113 rm -f $fs/lib/modules/${KERNELRELEASE}/build
114 rm -f $fs/lib/modules/${KERNELRELEASE}/source
115 # Cook all packages with a kernel module
116 #~ for i in $(cd $WOK ; ls -d ovzkernel-*; cd -)
117 #~ do
118 #~ tazwok cook ${i%/receipt}
119 #~ done
120 }
122 # Pre and post install commands for Tazpkg.
123 post_install()
124 {
125 echo "Processing post-install commands..."
126 KERNELRELEASE=$(cat $1/etc/ovzkernel/kernel.release)
128 chroot "$1/" depmod -a ${KERNELRELEASE}
130 # GRUB stuff.
131 if [ -f "$1/boot/grub/menu.lst" ]; then
132 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
133 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
134 # Add new kernel entry in case of upgrade for installed system.
135 if ! grep -q ${KERNELRELEASE} $1/boot/grub/menu.lst; then
136 cat >> $1/boot/grub/menu.lst << EOT
138 title SliTaz GNU/Linux (Kernel ${KERNELRELEASE})
139 $grub_dev
140 kernel /boot/vmlinuz-${KERNELRELEASE} root=$root_dev
141 EOT
142 fi
143 # Display information message.
144 cat <<EOT
145 ----
146 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
148 title SliTaz GNU/Linux (Kernel ${KERNELRELEASE})
149 $grub_dev
150 kernel /boot/vmlinuz-${KERNELRELEASE} root=$root_dev
151 ----
152 EOT
153 fi
154 }
156 clean_wok()
157 {
158 [ -d ${SOURCE}-${VERSION} ] && rm -rf $SOURCE-$VERSION
159 }