wok view linux-libre/receipt @ rev 10637

linux-libre: remove all report (last try to build failed)
author Christophe Lincoln <pankso@slitaz.org>
date Fri May 27 00:23:00 2011 +0200 (2011-05-27)
parents f30610a3393f
children cc1782ebaa81
line source
1 # SliTaz package receipt.
3 PACKAGE="linux-libre"
4 VERSION="2.6.37-libre"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux Libre kernel and modules."
7 DEPENDS="depmod"
8 BUILD_DEPENDS="slitaz-toolchain perl git lzma patch"
9 MAINTAINER="gokhlayeh@slitaz.org"
10 PROVIDE="linux"
11 SOURCE="linux"
12 TARBALL="$SOURCE-$VERSION.tar.bz2"
13 WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/"
14 WGET_URL="http://www.fsfla.org/svnwiki/selibre/linux-libre/download/releases/$VERSION/$TARBALL"
15 CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
21 # this is code to help update the kernel version faster
22 #for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt)
23 #do
24 # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i
25 #done
27 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
28 AUFSDIR=$WOK/$PACKAGE/aufs-${_AUFSVER}
29 if [ -x /usr/bin/tazwok ]; then
30 tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; }
31 fi
32 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
33 cp -a $AUFSDIR/*.patch $WOK/$PACKA$stuff
34 cd $src
35 # SliTaz db
36 [ -d $WOK/$PACKAGE/slitaz ] && rm -rf $WOK/$PACKAGE/slitaz 2> /dev/null
37 mkdir $WOK/$PACKAGE/slitaz
38 echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url
39 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz
40 cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz
41 # Apply patches
42 echo "Applying patches"
43 while read patch_file; do
44 echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches
45 cp $stuff/$patch_file $WOK/$PACKAGE/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 < $WOK/$PACKAGE/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 $PACKAGE-freeinitrd-$VERSION.u
58 aufs2-base.patch
59 aufs2-standalone.patch
60 001-squashfs-decompressors-add-xz-decompressor-module.patch
61 002-squashfs-decompressors-add-boot-time-xz-support.patch
62 003-squashfs-x86-support-xz-compressed-kernel.patch
63 004-squashfs-add-xz-compression-support.patch
64 005-squashfs-add-xz-compression-configuration-option.patch
65 EOT
66 echo "Make kernel proper and then build lguest"
67 make mrproper
68 cd Documentation/lguest
69 make lguest || exit 1
70 cd $src
72 echo "Make bzImage without modules first"
73 # Build bzImage without modules first
74 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
75 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
76 # We can't keep every driver in staging
77 sed -i -e 's/^CONFIG_RTL8192/#&/' \
78 -e 's/^CONFIG_R8187SE/#&/' \
79 -e 's/^CONFIG_RT2870/#&/' .config
80 yes '' | make oldconfig
81 make -j 4 bzImage ||exit 1
82 [ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg
83 mv arch/x86/boot/bzImage $PWD/_pkg
84 mv System.map System.map-without-modules
86 echo "Now build bzImage with modules"
87 # Build bzImage with modules
88 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
89 make oldconfig
90 ln .config $WOK/$PACKAGE/slitaz/config
91 make -j 4 bzImage &&
92 make -j 4 modules &&
93 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
94 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
96 mkdir -p $PWD/_pkg/boot 2> /dev/null
97 mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz
98 # Compress all modules.
99 echo "Compressing all modules"
100 $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
101 ln System.map System.map-modules
102 ln Module.symvers Module.symvers-modules
103 }
105 # Rules to gen a SliTaz package suitable for Tazpkg.
106 genpkg_rules()
107 {
108 local path
109 cp -a $_pkg/boot $fs
110 # Compress all modules.
111 $stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
112 path=$fs/lib/modules/$VERSION-slitaz/kernel
113 mkdir -p $path
114 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
115 $fs/lib/modules/$VERSION-slitaz
116 # Get the base modules
117 export src
118 export _pkg
119 mkdir $WOK/$PACKAGE/tmp
120 $WOK/$PACKA$stuff/list_modules.sh \
121 $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
122 while read module; do
123 dir=$(dirname $module)
124 [ -d $path/$dir ] || mkdir -p $path/$dir
125 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
126 done < $WOK/$PACKAGE/tmp/modules.list
127 # Remove unresolved links
128 rm -f $fs/lib/modules/$VERSION-slitaz/build
129 rm -f $fs/lib/modules/$VERSION-slitaz/source
131 # Check and echo any module in kernel .config that's not added to
132 # one of linux-* pkgs
133 $stuff/check_modules.sh
134 }
136 # Pre and post install commands for Tazpkg.
137 post_install()
138 {
139 echo "Processing post-install commands..."
140 chroot "$1/" depmod -a $VERSION-slitaz
141 # GRUB stuff.
142 if [ -f "$1/boot/grub/menu.lst" ]; then
143 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
144 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
145 # Add new kernel entry in case of upgrade for installed system.
146 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
147 cat >> $1/boot/grub/menu.lst << EOT
149 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
150 $grub_dev
151 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
152 EOT
153 fi
154 # Display information message.
155 cat <<EOT
156 ----
157 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
159 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
160 $grub_dev
161 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
162 ----
163 EOT
164 fi
165 }