wok-4.x view linux-libre/receipt @ rev 10214
Up: libplist to 1.4.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Fri May 20 23:43:59 2011 +0000 (2011-05-20) |
parents | 0c90dea68e8d |
children | f30610a3393f |
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
26 report open-bloc
28 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
29 AUFSDIR=$WOK/$PACKAGE/aufs-${_AUFSVER}
30 tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; }
31 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
32 cp -a $AUFSDIR/*.patch $WOK/$PACKA$stuff
33 cd $src
34 # SliTaz db
35 [ -d $WOK/$PACKAGE/slitaz ] && rm -rf $WOK/$PACKAGE/slitaz 2> /dev/null
36 mkdir $WOK/$PACKAGE/slitaz
37 echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url
38 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz
39 cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz
40 # Apply patches
41 report step "Applying patches"
42 while read patch_file; do
43 echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches
44 cp $stuff/$patch_file $WOK/$PACKAGE/slitaz
45 if [ -f done.$patch_file ]; then
46 echo "Skipping $patch_file"
47 continue
48 fi
49 echo "Apply $patch_file"
50 patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; }
51 touch done.$patch_file
52 done <<EOT
53 $PACKAGE-diff-$VERSION.u
54 $PACKAGE-unlzma-$VERSION.u
55 $PACKAGE-header-$VERSION.u
56 $PACKAGE-freeinitrd-$VERSION.u
57 aufs2-base.patch
58 aufs2-standalone.patch
59 001-squashfs-decompressors-add-xz-decompressor-module.patch
60 002-squashfs-decompressors-add-boot-time-xz-support.patch
61 003-squashfs-x86-support-xz-compressed-kernel.patch
62 004-squashfs-add-xz-compression-support.patch
63 005-squashfs-add-xz-compression-configuration-option.patch
64 EOT
65 report step "Make kernel proper and then build lguest"
66 make mrproper
67 cd Documentation/lguest
68 make lguest || { report close-bloc; return 1; }
69 cd $src
71 report step "Make bzImage without modules first"
72 # Build bzImage without modules first
73 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
74 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
75 # We can't keep every driver in staging
76 sed -i -e 's/^CONFIG_RTL8192/#&/' \
77 -e 's/^CONFIG_R8187SE/#&/' \
78 -e 's/^CONFIG_RT2870/#&/' .config
79 yes '' | make oldconfig
80 make -j 4 bzImage || { report close-bloc; return 1; }
81 [ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg
82 mv arch/x86/boot/bzImage $PWD/_pkg
83 mv System.map System.map-without-modules
85 report step "Now build bzImage with modules"
86 # Build bzImage with modules
87 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
88 make oldconfig
89 ln .config $WOK/$PACKAGE/slitaz/config
90 make -j 4 bzImage &&
91 make -j 4 modules &&
92 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
93 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
94 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; }
95 mkdir -p $PWD/_pkg/boot 2> /dev/null
96 mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz
97 # Compress all modules.
98 report step "Compressing all modules"
99 $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
100 ln System.map System.map-modules
101 ln Module.symvers Module.symvers-modules
102 report close-bloc
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
130 # Cook all packages with a kernel module
131 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
132 do
133 echo tazwok cook ${i%/receipt}
134 done
135 # Check and echo any module in kernel .config that's not added to
136 # one of linux-* pkgs
137 $stuff/check_modules.sh
138 }
140 # Pre and post install commands for Tazpkg.
141 post_install()
142 {
143 echo "Processing post-install commands..."
144 chroot "$1/" depmod -a $VERSION-slitaz
145 # GRUB stuff.
146 if [ -f "$1/boot/grub/menu.lst" ]; then
147 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
148 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
149 # Add new kernel entry in case of upgrade for installed system.
150 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
151 cat >> $1/boot/grub/menu.lst << EOT
153 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
154 $grub_dev
155 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
156 EOT
157 fi
158 # Display information message.
159 cat <<EOT
160 ----
161 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
163 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
164 $grub_dev
165 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
166 ----
167 EOT
168 fi
169 }