wok-undigest view ovzkernel/receipt @ rev 991

ovzkernel: remove wrong error triggers
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Apr 21 00:03:36 2013 +0200 (2013-04-21)
parents 923042a937f6
children 01af0e72b841
line source
1 # SliTaz package receipt.
3 PACKAGE="ovzkernel"
4 VERSION="2.6.32"
5 CATEGORY="base-system"
6 SHORT_DESC="Vanilla Linux Kernel for OpenVZ"
7 MAINTAINER="erjo@slitaz.org"
8 DEPENDS="depmod"
9 BUILD_DEPENDS="slitaz-toolchain perl wget"
10 SOURCE="linux"
11 TARBALL="$SOURCE-$VERSION.tar.xz"
12 WEB_SITE="http://www.kernel.org/"
13 WGET_URL="https://www.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 sed -i 's/m elf_x86_64/m64/;s/m elf_i386/m32/' arch/x86/vdso/Makefile
45 sed -i 's|video4linux/ ||' Documentation/Makefile
47 # Prepare to build
48 make mrproper
50 # Copy old kernel config
51 cp OpenVZ/linux-2.6.32-i686.config.ovz .config
53 # Add LOCALVERSION support
54 sed -i s/CONFIG_LOCALVERSION_AUTO.*/CONFIG_LOCALVERSION_AUTO=y/ .config
56 # Disable Source Versio Control detection
57 [ -f scripts/setlocalversion ] &&
58 cp scripts/setlocalversion scripts/setlocalversion.disabled &&
59 sed -i '1!d' scripts/setlocalversion
61 # Apply kernel config and build
62 yes '' | make oldconfig && \
63 make LOCALVERSION=${LOCALVERSION} prepare
64 make bzImage &&
65 make modules &&
67 # Install modules and headers
68 make -j 1 INSTALL_MOD_PATH=$_pkg modules_install 2>&1 | grep -v modules.builtin &&
69 make -j 1 INSTALL_HDR_PATH=$_pkg/usr headers_install
71 # Get kernel release
72 KERNELRELEASE=$( cat include/config/kernel.release 2> /dev/null) ; export KERNELRELEASE
74 [ -s arch/x86/boot/bzImage ] || return 1
75 mkdir -p $_pkg/boot 2> /dev/null
76 cp -a arch/x86/boot/bzImage $_pkg/boot/vmlinuz-${KERNELRELEASE}
78 # Compress all modules.
79 $WOK/$PACKAGE/stuff/gztazmod.sh $_pkg/lib/modules/${KERNELRELEASE}
80 ln System.map System.map-modules
81 ln Module.symvers Module.symvers-modules
82 }
84 # Rules to gen a SliTaz package suitable for Tazpkg.
85 genpkg_rules()
86 {
87 local path
88 KERNELRELEASE=$( cat $src/include/config/kernel.release 2> /dev/null)
89 path=$fs/lib/modules/${KERNELRELEASE}/kernel
91 mkdir -p $fs/lib \
92 $fs/boot \
93 $fs/lib/modules/${KERNELRELEASE} \
94 $path \
95 $fs/etc/ovzkernel
97 #cp -a $_pkg/lib/modules $fs/lib
98 cp -a $_pkg/lib/firmware $fs/lib
99 cp -a $_pkg/boot $fs/
101 #~ # Get the base modules
102 export src
103 export _pkg
105 cp -a $src/include/config/kernel.release $fs/etc/ovzkernel
106 cp -a $_pkg/lib/modules/${KERNELRELEASE}/mo* \
107 $fs/lib/modules/${KERNELRELEASE}
109 $src/OpenVZ/list_modules.sh ${KERNELRELEASE} \
110 $(cat $stuff/modules-$VERSION.list) > $src/modules.list
111 while read module; do
112 dir=$(dirname $module)
113 [ -d $path/$dir ] || mkdir -p $path/$dir
114 cp -a $_pkg/lib/modules/${KERNELRELEASE}/kernel/$module $path/$dir
115 done < $src/modules.list
117 # Remove unresolved links
118 rm -f $fs/lib/modules/${KERNELRELEASE}/build
119 rm -f $fs/lib/modules/${KERNELRELEASE}/source
120 # Cook all packages with a kernel module
121 #~ for i in $(cd $WOK ; ls -d ovzkernel-*; cd -)
122 #~ do
123 #~ tazwok cook ${i%/receipt}
124 #~ done
125 }
127 # Pre and post install commands for Tazpkg.
128 post_install()
129 {
130 echo "Processing post-install commands..."
131 KERNELRELEASE=$(cat $1/etc/ovzkernel/kernel.release)
133 chroot "$1/" depmod -a ${KERNELRELEASE}
135 # GRUB stuff.
136 if [ -f "$1/boot/grub/menu.lst" ]; then
137 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
138 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
139 # Add new kernel entry in case of upgrade for installed system.
140 if ! grep -q ${KERNELRELEASE} $1/boot/grub/menu.lst; then
141 cat >> $1/boot/grub/menu.lst << EOT
143 title SliTaz GNU/Linux (Kernel ${KERNELRELEASE})
144 $grub_dev
145 kernel /boot/vmlinuz-${KERNELRELEASE} root=$root_dev
146 EOT
147 fi
148 # Display information message.
149 cat <<EOT
150 ----
151 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
153 title SliTaz GNU/Linux (Kernel ${KERNELRELEASE})
154 $grub_dev
155 kernel /boot/vmlinuz-${KERNELRELEASE} root=$root_dev
156 ----
157 EOT
158 fi
159 }
161 clean_wok()
162 {
163 [ -d ${SOURCE}-${VERSION} ] && rm -rf $SOURCE-$VERSION
164 }