wok view linux-libre/receipt @ rev 10830
Up: tazusb (3.0) - Handle splitted rootfs, bunch of fixes, new style for doc
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Jun 07 12:28:06 2011 +0200 (2011-06-07) |
parents | 7d021a3625d2 |
children | 903c03d31ebf |
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 MAINTAINER="gokhlayeh@slitaz.org"
8 PROVIDE="linux"
9 SOURCE="linux"
10 TARBALL="$SOURCE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/"
12 WGET_URL="http://www.fsfla.org/svnwiki/selibre/linux-libre/download/releases/$VERSION/$TARBALL"
13 CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep"
15 DEPENDS="depmod"
16 BUILD_DEPENDS="slitaz-toolchain perl git lzma patch"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 cd $src
22 # this is code to help update the kernel version faster
23 #for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt)
24 #do
25 # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i
26 #done
27 [ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report open-bloc
29 # Check for Aufs and cook it if unbuilt.
30 echo "Checking for Aufs packages..."
31 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
32 if [ -x /usr/bin/cook ]; then
33 # Give info an redirect to /dev/null since aufs got it own log.
34 AUFSDIR=$WOK/aufs/source/aufs-${_AUFSVER}
35 [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR
36 echo "Cook: aufs $_AUFSVER"
37 cook aufs > /dev/null
38 elif [ -x /usr/bin/tazwok ]; then
39 # we just need aufs source. Also cooking now is a bad idea since it
40 # needs linux-module-headers. The one your cooking not the one from the web.
41 AUFSDIR=$WOK/aufs/aufs-${_AUFSVER}
42 [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR
43 tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; }
44 fi
46 echo "Copying Aufs files and patches..."
47 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
48 cp -a $AUFSDIR/*.patch $stuff
50 # SliTaz db
51 [ -d $WOK/$PACKAGE/slitaz ] && rm -rf $WOK/$PACKAGE/slitaz 2> /dev/null
52 mkdir $WOK/$PACKAGE/slitaz
53 echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url
54 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz
55 cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz
57 # Apply patches
58 echo "Applying patches"
59 while read patch_file; do
60 echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches
61 cp $stuff/$patch_file $WOK/$PACKAGE/slitaz
62 if [ -f done.$patch_file ]; then
63 echo "Skipping $patch_file"
64 continue
65 fi
66 echo "Apply $patch_file"
67 if [ -x /usr/bin/cook ]; then
68 patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || return 1
69 elif [ -x /usr/bin/tazwok ]; then
70 patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; }
71 fi
72 touch done.$patch_file
73 done <<EOT
74 $PACKAGE-diff-$VERSION.u
75 $PACKAGE-unlzma-$VERSION.u
76 $PACKAGE-header-$VERSION.u
77 $PACKAGE-freeinitrd-$VERSION.u
78 aufs2-base.patch
79 aufs2-standalone.patch
80 001-squashfs-decompressors-add-xz-decompressor-module.patch
81 002-squashfs-decompressors-add-boot-time-xz-support.patch
82 003-squashfs-x86-support-xz-compressed-kernel.patch
83 004-squashfs-add-xz-compression-support.patch
84 005-squashfs-add-xz-compression-configuration-option.patch
85 EOT
86 [ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report step "Make kernel proper and then build lguest"
88 make mrproper
89 cd Documentation/lguest
90 if [ -x /usr/bin/cook ]; then
91 make lguest || return 1
92 elif [ -x /usr/bin/tazwok ]; then
93 make lguest || { report close-bloc; return 1; }
94 fi
95 cd $src
97 [ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report step "Make bzImage without modules first"
99 # Build bzImage without modules first
100 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
101 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
103 # We can't keep every driver in staging
104 sed -i -e 's/^CONFIG_RTL8192/#&/' \
105 -e 's/^CONFIG_R8187SE/#&/' \
106 -e 's/^CONFIG_RT2870/#&/' .config
107 yes '' | make oldconfig
108 make -j 4 bzImage || { report close-bloc; return 1; }
109 [ -d $DESTDIR ] || mkdir -p $DESTDIR
110 mv arch/x86/boot/bzImage $DESTDIR
111 mv System.map System.map-without-modules
113 [ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report step "Now build bzImage with modules"
115 # Build bzImage with modules
116 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
117 make oldconfig
118 ln .config $WOK/$PACKAGE/slitaz/config
119 make -j 4 bzImage &&
120 make -j 4 modules &&
121 make INSTALL_MOD_PATH=$DESTDIR modules_install &&
122 make INSTALL_HDR_PATH=$DESTDIR/usr headers_install &&
123 #[ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; }
124 mkdir -p $DESTDIR/boot 2> /dev/null
125 mv arch/x86/boot/bzImage $DESTDIR/boot/vmlinuz-$VERSION-slitaz
127 # Compress all modules.
128 echo "Compressing all modules"
129 $stuff/gztazmod.sh $DESTDIR/lib/modules/$VERSION-slitaz
130 ln System.map System.map-modules
131 ln Module.symvers Module.symvers-modules
132 [ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report close-bloc
133 }
135 # Rules to gen a SliTaz package suitable for Tazpkg.
136 genpkg_rules()
137 {
138 local path
139 cp -a $_pkg/boot $fs
140 # Compress all modules.
141 $stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
142 path=$fs/lib/modules/$VERSION-slitaz/kernel
143 mkdir -p $path
144 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
145 $fs/lib/modules/$VERSION-slitaz
146 # Get the base modules
147 export src
148 export _pkg
149 mkdir $WOK/$PACKAGE/tmp
150 $stuff/list_modules.sh \
151 $(cat $stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
152 while read module; do
153 dir=$(dirname $module)
154 [ -d $path/$dir ] || mkdir -p $path/$dir
155 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
156 done < $WOK/$PACKAGE/tmp/modules.list
157 # Remove unresolved links
158 rm -f $fs/lib/modules/$VERSION-slitaz/build
159 rm -f $fs/lib/modules/$VERSION-slitaz/source
161 # Check and echo any module in kernel .config that's not added to
162 # one of linux-* pkgs
163 $stuff/check_modules.sh
164 }
166 # Pre and post install commands for Tazpkg.
167 post_install()
168 {
169 echo "Processing post-install commands..."
170 chroot "$1/" depmod -a $VERSION-slitaz
171 # GRUB stuff.
172 if [ -f "$1/boot/grub/menu.lst" ]; then
173 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
174 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
175 # Add new kernel entry in case of upgrade for installed system.
176 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
177 cat >> $1/boot/grub/menu.lst << EOT
179 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
180 $grub_dev
181 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
182 EOT
183 fi
184 # Display information message.
185 cat <<EOT
186 ----
187 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
189 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
190 $grub_dev
191 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
192 ----
193 EOT
194 fi
195 }