wok-undigest view ovzkernel/receipt @ rev 1052
add: efl (1.8.0-beta1)
author | Dominique Corbex <domcox@slitaz.org> |
---|---|
date | Wed Nov 27 21:32:37 2013 +0100 (2013-11-27) |
parents | d69a9ebd2ff0 |
children |
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 LICENSE="GPL2"
9 DEPENDS="depmod"
10 BUILD_DEPENDS="slitaz-toolchain perl wget"
11 SOURCE="linux"
12 TARBALL="$SOURCE-$VERSION.tar.xz"
13 WEB_SITE="http://www.kernel.org/"
14 WGET_URL="https://www.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL"
15 PROVIDE="linux"
16 EXTRAVERSION="-i686"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 LOCALVERSION="-ovz" ; export LOCALVERSION
23 cd $src
25 [ -d OpenVZ ] && rm -rf openvz || mkdir OpenVZ
27 zcat $stuff/patch-dzhanibekov.1-combined.gz > OpenVZ/patch-dzhanibekov.1-combined.u
28 cp $stuff/*.ovz OpenVZ
29 cp $stuff/*.sh OpenVZ
31 # Apply patches
32 while read patch_file; do
33 echo "$patch_file" >> OpenVZ/patches
34 #~ cp $stuff/$patch_file OpenVZ
35 if [ -f done.$patch_file ]; then
36 echo "Skipping $patch_file"
37 continue
38 fi
39 echo "Apply $patch_file"
40 patch -p1 < OpenVZ/$patch_file || exit 1
41 touch done.$patch_file
42 done <<EOT
43 patch-dzhanibekov.1-combined.u
44 EOT
45 sed -i 's/m elf_x86_64/m64/;s/m elf_i386/m32/' arch/x86/vdso/Makefile
46 sed -i 's|video4linux/ ||' Documentation/Makefile
48 # Prepare to build
49 make mrproper
51 # Copy old kernel config
52 cp OpenVZ/linux-2.6.32-i686.config.ovz .config
54 # Add LOCALVERSION support
55 sed -i s/CONFIG_LOCALVERSION_AUTO.*/CONFIG_LOCALVERSION_AUTO=y/ .config
57 # Disable Source Versio Control detection
58 [ -f scripts/setlocalversion ] &&
59 cp scripts/setlocalversion scripts/setlocalversion.disabled &&
60 sed -i '1!d' scripts/setlocalversion
62 # Apply kernel config and build
63 yes '' | make oldconfig && \
64 make LOCALVERSION=${LOCALVERSION} prepare
65 make bzImage &&
66 make modules &&
68 # Install modules and headers
69 make -j 1 INSTALL_MOD_PATH=$_pkg modules_install 2>&1 | grep -v modules.builtin &&
70 make -j 1 INSTALL_HDR_PATH=$_pkg/usr headers_install
72 # Get kernel release
73 KERNELRELEASE=$( cat include/config/kernel.release 2> /dev/null) ; export KERNELRELEASE
75 [ -s arch/x86/boot/bzImage ] || return 1
76 mkdir -p $_pkg/boot 2> /dev/null
77 cp -a arch/x86/boot/bzImage $_pkg/boot/vmlinuz-${KERNELRELEASE}
79 # Compress all modules.
80 $WOK/$PACKAGE/stuff/gztazmod.sh $_pkg/lib/modules/${KERNELRELEASE}
81 ln System.map System.map-modules
82 ln Module.symvers Module.symvers-modules
83 }
85 # Rules to gen a SliTaz package suitable for Tazpkg.
86 genpkg_rules()
87 {
88 local path
89 KERNELRELEASE=$( cat $src/include/config/kernel.release 2> /dev/null)
90 path=$fs/lib/modules/${KERNELRELEASE}/kernel
92 mkdir -p $fs/lib \
93 $fs/boot \
94 $fs/lib/modules/${KERNELRELEASE} \
95 $path \
96 $fs/etc/ovzkernel
98 #cp -a $_pkg/lib/modules $fs/lib
99 cp -a $_pkg/lib/firmware $fs/lib
100 cp -a $_pkg/boot $fs/
102 #~ # Get the base modules
103 export src
104 export _pkg
106 cp -a $src/include/config/kernel.release $fs/etc/ovzkernel
107 cp -a $_pkg/lib/modules/${KERNELRELEASE}/mo* \
108 $fs/lib/modules/${KERNELRELEASE}
110 $src/OpenVZ/list_modules.sh ${KERNELRELEASE} \
111 $(cat $stuff/modules-$VERSION.list) > $src/modules.list
112 while read module; do
113 dir=$(dirname $module)
114 [ -d $path/$dir ] || mkdir -p $path/$dir
115 cp -a $_pkg/lib/modules/${KERNELRELEASE}/kernel/$module $path/$dir
116 done < $src/modules.list
118 # Remove unresolved links
119 rm -f $fs/lib/modules/${KERNELRELEASE}/build
120 rm -f $fs/lib/modules/${KERNELRELEASE}/source
121 # Cook all packages with a kernel module
122 #~ for i in $(cd $WOK ; ls -d ovzkernel-*; cd -)
123 #~ do
124 #~ tazwok cook ${i%/receipt}
125 #~ done
126 }
128 # Pre and post install commands for Tazpkg.
129 post_install()
130 {
131 echo "Processing post-install commands..."
132 KERNELRELEASE=$(cat $1/etc/ovzkernel/kernel.release)
134 chroot "$1/" depmod -a ${KERNELRELEASE}
136 # GRUB stuff.
137 if [ -f "$1/boot/grub/menu.lst" ]; then
138 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
139 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
140 # Add new kernel entry in case of upgrade for installed system.
141 if ! grep -q ${KERNELRELEASE} $1/boot/grub/menu.lst; then
142 cat >> $1/boot/grub/menu.lst << EOT
144 title SliTaz GNU/Linux (Kernel ${KERNELRELEASE})
145 $grub_dev
146 kernel /boot/vmlinuz-${KERNELRELEASE} root=$root_dev
147 EOT
148 fi
149 # Display information message.
150 cat <<EOT
151 ----
152 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
154 title SliTaz GNU/Linux (Kernel ${KERNELRELEASE})
155 $grub_dev
156 kernel /boot/vmlinuz-${KERNELRELEASE} root=$root_dev
157 ----
158 EOT
159 fi
160 }
162 clean_wok()
163 {
164 [ -d ${SOURCE}-${VERSION} ] && rm -rf $SOURCE-$VERSION
165 }