wok view linux/receipt @ rev 9544

tiff: Patched overflows that could lead to aribitrary code execution when parsing a malformed image file. Thanks slackware for having this.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat Apr 09 07:21:58 2011 +0000 (2011-04-09)
parents 0c90dea68e8d
children 7b21f33f4f6a
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.37.6"
5 BASE_VERSION="${VERSION%.*}"
6 # the one below is when your using the newer base version
7 #BASE_VERSION="$VERSION"
8 CATEGORY="base-system"
9 SHORT_DESC="The Linux kernel and modules."
10 DEPENDS="depmod"
11 if [ "$BASE_VERSION" != "$VERSION" ]; then
12 BUILD_DEPENDS="linux-patch perl git lzma patch"
13 else
14 BUILD_DEPENDS="perl git lzma patch"
15 fi
16 MAINTAINER="devel@slitaz.org"
17 TARBALL="$PACKAGE-$BASE_VERSION.tar.bz2"
18 WEB_SITE="http://www.kernel.org/"
19 WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL"
20 CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep"
22 # Rules to configure and make the package.
23 compile_rules()
24 {
26 # this is code to help update the kernel version faster
27 #for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt)
28 #do
29 # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i
30 #done
31 report open-bloc
33 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
34 AUFSDIR=$WOK/$PACKAGE/aufs-${_AUFSVER}
35 tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; }
36 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
37 cp -a $AUFSDIR/*.patch $WOK/$PACKAGE/stuff
38 cd $src
39 # SliTaz db
40 [ -d $WOK/$PACKAGE/slitaz ] && rm -rf $WOK/$PACKAGE/slitaz 2> /dev/null
41 mkdir $WOK/$PACKAGE/slitaz
42 echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url
43 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz
44 cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz
45 # Apply patches
46 report step "Applying patches"
47 while read patch_file; do
48 echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches
49 cp $stuff/$patch_file $WOK/$PACKAGE/slitaz
50 if [ -f done.$patch_file ]; then
51 echo "Skipping $patch_file"
52 continue
53 fi
54 echo "Apply $patch_file"
55 patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; }
56 touch done.$patch_file
57 done <<EOT
58 $PACKAGE-diff-$BASE_VERSION.u
59 $PACKAGE-unlzma-$BASE_VERSION.u
60 $PACKAGE-header-$BASE_VERSION.u
61 $PACKAGE-freeinitrd-$BASE_VERSION.u
62 aufs2-base.patch
63 aufs2-standalone.patch
64 001-squashfs-decompressors-add-xz-decompressor-module.patch
65 002-squashfs-decompressors-add-boot-time-xz-support.patch
66 003-squashfs-x86-support-xz-compressed-kernel.patch
67 004-squashfs-add-xz-compression-support.patch
68 005-squashfs-add-xz-compression-configuration-option.patch
69 EOT
70 report step "Make kernel proper and then build lguest"
71 make mrproper
72 cd Documentation/lguest
73 make lguest || { report close-bloc; return 1; }
74 cd $src
76 report step "Make bzImage without modules first"
77 # Build bzImage without modules first
78 cp -f $stuff/$PACKAGE-$BASE_VERSION-slitaz.config .config
79 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
80 # We can't keep every driver in staging
81 sed -i -e 's/^CONFIG_RTL8192/#&/' \
82 -e 's/^CONFIG_R8187SE/#&/' \
83 -e 's/^CONFIG_RT2870/#&/' .config
84 yes '' | make oldconfig
85 make -j 4 bzImage || { report close-bloc; return 1; }
86 [ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg
87 mv arch/x86/boot/bzImage $PWD/_pkg
88 mv System.map System.map-without-modules
90 report step "Now build bzImage with modules"
91 # Build bzImage with modules
92 cp -f $stuff/$PACKAGE-$BASE_VERSION-slitaz.config .config
93 make oldconfig
94 ln .config $WOK/$PACKAGE/slitaz/config
95 make -j 4 bzImage &&
96 make -j 4 modules &&
97 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
98 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
99 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; }
100 mkdir -p $PWD/_pkg/boot 2> /dev/null
101 mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz
102 # Compress all modules.
103 report step "Compressing all modules"
104 $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
105 ln System.map System.map-modules
106 ln Module.symvers Module.symvers-modules
107 report close-bloc
108 }
110 # Rules to gen a SliTaz package suitable for Tazpkg.
111 genpkg_rules()
112 {
113 local path
114 cp -a $_pkg/boot $fs
115 # Compress all modules.
116 #./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
117 path=$fs/lib/modules/$VERSION-slitaz/kernel
118 mkdir -p $path
119 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
120 $fs/lib/modules/$VERSION-slitaz
121 # Get the base modules
122 export src
123 export _pkg
124 mkdir $WOK/$PACKAGE/tmp
125 $WOK/$PACKAGE/stuff/list_modules.sh \
126 $(cat $stuff/modules-$BASE_VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
127 while read module; do
128 dir=$(dirname $module)
129 [ -d $path/$dir ] || mkdir -p $path/$dir
130 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
131 done < $WOK/$PACKAGE/tmp/modules.list
132 # Remove unresolved links
133 rm -f $fs/lib/modules/$VERSION-slitaz/build
134 rm -f $fs/lib/modules/$VERSION-slitaz/source
135 # Cook all packages with a kernel module
136 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
137 do
138 echo tazwok cook ${i%/receipt}
139 done
140 # Check and echo any module in kernel .config that's not added to
141 # one of linux-* pkgs
142 ./stuff/check_modules.sh
143 }
145 # Pre and post install commands for Tazpkg.
146 post_install()
147 {
148 echo "Processing post-install commands..."
149 chroot "$1/" depmod -a $VERSION-slitaz
150 # GRUB stuff.
151 if [ -f "$1/boot/grub/menu.lst" ]; then
152 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
153 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
154 # Add new kernel entry in case of upgrade for installed system.
155 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
156 cat >> $1/boot/grub/menu.lst << EOT
158 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
159 $grub_dev
160 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
161 EOT
162 fi
163 # Display information message.
164 cat <<EOT
165 ----
166 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
168 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
169 $grub_dev
170 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
171 ----
172 EOT
173 fi
174 }