wok-stable view linux/receipt @ rev 6720

Fixed linux receipt to archive aufs2 right.
author Christopher Rogers <slaxemulator@gmail.com>
date Thu Oct 14 21:15:59 2010 +0000 (2010-10-14)
parents 5b6e682d7c62
children 26ead49dddc4
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.34"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux kernel and modules."
7 DEPENDS="depmod"
8 BUILD_DEPENDS="slitaz-toolchain perl git"
9 MAINTAINER="devel@slitaz.org"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.kernel.org/"
12 WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL"
13 CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 local _AUFSVER="20101014"
19 [ -d "aufs2-$_AUFSVER-$VERSION" ] && rm -rf aufs2-$_AUFSVER-$VERSION
20 TARBALL=$SOURCES_REPOSITORY/aufs2-$_AUFSVER-$VERSION.tar.gz
21 if [ -f $TARBALL ]; then
22 tar xzf $TARBALL
23 cd aufs2-$_AUFSVER-$VERSION && git checkout origin/aufs2-34
24 else
25 # Aufs2 from git repository
26 git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git aufs2-$_AUFSVER-$VERSION
27 tar czf $TARBALL aufs2-$_AUFSVER-$VERSION
28 cd aufs2-$_AUFSVER-$VERSION && git checkout origin/aufs2-34
29 fi
30 #cd aufs2-$_AUFSVER-$VERSION 2>/dev/null
31 cp -a Documentation fs include $src
32 cp -a *.patch ../stuff
33 # We need the real GNU patch
34 [ -L /usr/bin/patch ] && tazpkg get-install patch --forced
35 cd $src
36 # SliTaz db
37 rm -rf slitaz 2> /dev/null
38 mkdir slitaz
39 echo "$WGET_URL" > slitaz/url
40 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
41 cp ../stuff/bootloader.sh slitaz
42 # Apply patches
43 while read patch_file; do
44 echo "$patch_file" >> slitaz/patches
45 cp ../stuff/$patch_file slitaz
46 if [ -f done.$patch_file ]; then
47 echo "Skipping $patch_file"
48 continue
49 fi
50 echo "Apply $patch_file"
51 patch -p1 < slitaz/$patch_file || exit 1
52 touch done.$patch_file
53 done <<EOT
54 $PACKAGE-diff-$VERSION.u
55 $PACKAGE-unlzma-$VERSION.u
56 $PACKAGE-header-$VERSION.u
57 aufs2-base.patch
58 aufs2-kbuild.patch
59 aufs2-standalone.patch
60 $PACKAGE-freeinitrd-$VERSION.u
61 $PACKAGE-squashfs-lzma-$VERSION.u
62 EOT
63 make mrproper
64 cd Documentation/lguest
65 make lguest || return 1
66 cd ../..
67 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
68 make oldconfig
69 ln .config slitaz/config
70 make -j 4 bzImage &&
71 make -j 4 modules &&
72 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
73 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
74 [ -s arch/x86/boot/bzImage ]
75 # Compress all modules.
76 $WOK/$PACKAGE/stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
77 }
79 # Rules to gen a SliTaz package suitable for Tazpkg.
80 genpkg_rules()
81 {
82 local path
83 mkdir $fs/boot
84 cp -a $src/arch/x86/boot/bzImage \
85 $fs/boot/vmlinuz-$VERSION-slitaz
86 # Compress all modules.
87 #./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
88 path=$fs/lib/modules/$VERSION-slitaz/kernel
89 mkdir -p $path
90 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
91 $fs/lib/modules/$VERSION-slitaz
92 # Get the base modules
93 export src
94 export _pkg
95 $src/slitaz/list_modules.sh \
96 $(cat stuff/modules-$VERSION.list) > $src/modules.list
97 while read module; do
98 dir=$(dirname $module)
99 [ -d $path/$dir ] || mkdir -p $path/$dir
100 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
101 done < $src/modules.list
102 # Remove unresolved links
103 rm -f $fs/lib/modules/$VERSION-slitaz/build
104 rm -f $fs/lib/modules/$VERSION-slitaz/source
105 # Cook all packages with a kernel module
106 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
107 do
108 echo tazwok cook ${i%/receipt}
109 done
110 # Check and echo any module in kernel .config that's not added to
111 # one of linux-* pkgs
112 ./stuff/check_modules.sh
113 }
115 # Pre and post install commands for Tazpkg.
116 post_install()
117 {
118 echo "Processing post-install commands..."
119 chroot "$1/" depmod -a $VERSION-slitaz
120 # GRUB stuff.
121 if [ -f "$1/boot/grub/menu.lst" ]; then
122 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
123 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
124 # Add new kernel entry in case of upgrade for installed system.
125 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
126 cat >> $1/boot/grub/menu.lst << EOT
128 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
129 $grub_dev
130 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
131 EOT
132 fi
133 # Display information message.
134 cat <<EOT
135 ----
136 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
138 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
139 $grub_dev
140 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
141 ----
142 EOT
143 fi
144 }
146 clean_wok()
147 {
148 rm -rf aufs2
149 rm stuff/aufs2-*
150 rm -rf stuff/tmp
151 }