wok-next view linux-libre/receipt @ rev 19024

syslinux/win32.c: typo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Apr 02 17:08:51 2016 +0200 (2016-04-02)
parents 9e01bc6321ea
children b53ebb2699ba
line source
1 # SliTaz package receipt.
3 PACKAGE="linux-libre"
4 VERSION="2.6.37-gnu"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux Libre kernel and modules."
7 MAINTAINER="gokhlayeh@slitaz.org"
8 LICENSE="GPL2"
9 PROVIDE="linux"
10 TARBALL="$PACKAGE-$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 # this is code to help update the kernel version faster
22 #for i in $(grep -l 'WANTED="linux-libre"' $WOK/*/receipt)
23 #do
24 # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i
25 #done
27 [ ! -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 [ ! -d "$AUFSDIR" ] && [ -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 echo "Cook: aufs $_AUFSVER"
36 cook aufs > /dev/null
37 elif [ ! -x /usr/bin/cook ]; then
38 # We only need aufs source. Also cooking now is a bad idea since it
39 # needs linux-module-headers.
40 AUFSDIR=$WOK/aufs/aufs-${_AUFSVER}
41 [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR
42 tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; }
43 fi
45 echo "Copying Aufs files and patches..."
46 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
47 cp -a $AUFSDIR/*.patch $stuff
49 # SliTaz db
50 rm -rf $WOK/$PACKAGE/slitaz && mkdir $WOK/$PACKAGE/slitaz
51 echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url
52 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz
53 cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz
55 # Apply patches
56 echo "Applying patches..."
57 while read patch_file; do
58 echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches
59 cp $stuff/$patch_file $WOK/$PACKAGE/slitaz
60 if [ -f done.$patch_file ]; then
61 echo "Skipping $patch_file"
62 continue
63 fi
64 echo "Apply $patch_file"
65 patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; }
66 touch done.$patch_file
67 done <<EOT
68 $PACKAGE-diff-$VERSION.u
69 $PACKAGE-header-$VERSION.u
70 $PACKAGE-freeinitrd-$VERSION.u
71 aufs2-base.patch
72 aufs2-standalone.patch
73 001-squashfs-decompressors-add-xz-decompressor-module.patch
74 002-squashfs-decompressors-add-boot-time-xz-support.patch
75 003-squashfs-x86-support-xz-compressed-kernel.patch
76 004-squashfs-add-xz-compression-support.patch
77 005-squashfs-add-xz-compression-configuration-option.patch
78 EOT
80 [ ! -x /usr/bin/cook ] && report step "Make kernel proper and then build lguest"
82 make mrproper
83 cd Documentation/lguest
84 make $MAKEFLAGS lguest || { report close-bloc; return 1; }
85 cd $src
87 [ ! -x /usr/bin/cook ] && report step "Make bzImage without modules first"
89 # Build bzImage without modules first
90 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
91 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
93 # We can't keep every driver in staging
94 sed -i -e 's/^CONFIG_RTL8192/#&/' \
95 -e 's/^CONFIG_R8187SE/#&/' \
96 -e 's/^CONFIG_RT2870/#&/' .config
97 yes '' | make oldconfig
98 make $MAKEFLAGS bzImage || { report close-bloc; return 1; }
99 [ -d $DESTDIR ] || mkdir -p $DESTDIR
100 mv arch/x86/boot/bzImage $DESTDIR
101 mv System.map System.map-without-modules
103 [ ! -x /usr/bin/cook ] && report step "Now build bzImage with modules"
105 # Build bzImage with modules
106 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
107 make oldconfig
108 ln .config $WOK/$PACKAGE/slitaz/config
109 make $MAKEFLAGS bzImage &&
110 make $MAKEFLAGS modules &&
111 make INSTALL_MOD_PATH=$DESTDIR modules_install &&
112 make INSTALL_HDR_PATH=$DESTDIR/usr headers_install &&
113 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; }
114 mkdir -p $DESTDIR/boot 2> /dev/null
115 mv arch/x86/boot/bzImage $DESTDIR/boot/vmlinuz-$VERSION-slitaz
117 [ ! -x /usr/bin/cook ] && report step "Compressing all modules"
119 # Compress all modules.
120 $stuff/gztazmod.sh $DESTDIR/lib/modules/$VERSION-slitaz
121 ln System.map System.map-modules
122 ln Module.symvers Module.symvers-modules
124 if [ ! -x /usr/bin/cook ]; then
125 report close-bloc
126 fi
127 }
129 # Rules to gen a SliTaz package suitable for Tazpkg.
130 genpkg_rules()
131 {
132 local path
133 cp -a $install/boot $fs
134 # Compress all modules.
135 #$stuff/gztazmod.sh $install/lib/modules/$VERSION-slitaz
136 path=$fs/lib/modules/$VERSION-slitaz/kernel
137 mkdir -p $path
138 cp -a $install/lib/modules/$VERSION-slitaz/mo* \
139 $fs/lib/modules/$VERSION-slitaz
140 # Get the base modules
141 export src
142 export _pkg
143 mkdir $WOK/$PACKAGE/tmp
144 $stuff/list_modules.sh \
145 $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
146 while read module; do
147 dir=$(dirname $module)
148 [ -d $path/$dir ] || mkdir -p $path/$dir
149 cp -a $install/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
150 done < $WOK/$PACKAGE/tmp/modules.list
151 # Remove unresolved links
152 rm -f $fs/lib/modules/$VERSION-slitaz/build
153 rm -f $fs/lib/modules/$VERSION-slitaz/source
155 # Pack all packages with a kernel module
156 for i in $(cd $WOK; grep -l '^WANTED="linux-libre"' */receipt); do
157 [ ! -d "$install/lib/modules/$VERSION-slitaz" ] && return 1
158 cook ${i%/receipt}
159 done
161 # Check and echo any module in kernel .config that's not added to
162 # one of linux-* pkgs
163 export PACKAGE
164 $stuff/check_modules.sh
165 }
167 # Pre and post install commands for Tazpkg.
168 post_install()
169 {
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 true
196 }