wok-6.x annotate linux/receipt @ rev 12287
syslinux: merge md5sum, kbdmap and linux. kbdmap will append the kernel cmdline
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Apr 15 17:51:38 2012 +0200 (2012-04-15) |
parents | 41cee386ada1 |
children | a8baf2428b53 |
rev | line source |
---|---|
pankso@3 | 1 # SliTaz package receipt. |
pankso@3 | 2 |
pankso@3 | 3 PACKAGE="linux" |
pankso@12285 | 4 VERSION="3.2.14" |
pankso@12285 | 5 KBASEVER="${VERSION:0:3}" |
pankso@3 | 6 CATEGORY="base-system" |
pankso@3 | 7 SHORT_DESC="The Linux kernel and modules." |
pankso@3864 | 8 MAINTAINER="devel@slitaz.org" |
pankso@12285 | 9 TARBALL="$PACKAGE-$KBASEVER.tar.xz" |
pankso@3 | 10 WEB_SITE="http://www.kernel.org/" |
pankso@12285 | 11 WGET_URL="http://www.kernel.org/pub/linux/kernel/v3.0/$TARBALL" |
pankso@12285 | 12 CONFIG_FILES="/lib/modules/$KBASEVER-slitaz/modules.dep" |
pankso@3 | 13 |
pankso@9731 | 14 DEPENDS="depmod" |
pankso@12285 | 15 BUILD_DEPENDS="slitaz-toolchain perl git lzma patch uclibc-cross-compiler-x86_64" |
pankso@12285 | 16 [ "$KBASEVER" != "$VERSION" ] && PATCH="http://www.kernel.org/pub/linux/kernel/v3.0/patch-$VERSION.xz" |
pankso@9731 | 17 |
pankso@3 | 18 # Rules to configure and make the package. |
pankso@3 | 19 compile_rules() |
pankso@3 | 20 { |
pankso@9731 | 21 cd $src |
slaxemulator@7131 | 22 # this is code to help update the kernel version faster |
slaxemulator@7131 | 23 #for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt) |
slaxemulator@7131 | 24 #do |
slaxemulator@7131 | 25 # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i |
slaxemulator@7131 | 26 #done |
slaxemulator@8616 | 27 |
gokhlayeh@11395 | 28 [ ! -x /usr/bin/cook ] && report open-bloc |
pankso@9731 | 29 |
pankso@9731 | 30 # Check for Aufs and cook it if unbuilt. |
pankso@9731 | 31 echo "Checking for Aufs packages..." |
pankso@12285 | 32 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` |
pankso@12285 | 33 if [ -x /usr/bin/cook ]; then |
gokhlayeh@11395 | 34 # Give info an redirect to /dev/null since aufs got it own log. |
gokhlayeh@11395 | 35 AUFSDIR=$WOK/aufs/source/aufs-${_AUFSVER} |
pankso@12285 | 36 [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR |
pankso@12285 | 37 #echo "Cook: aufs $_AUFSVER" |
pankso@12285 | 38 cook aufs --getsrc --extract > /dev/null |
pankso@12285 | 39 elif [ -x /usr/bin/tazwok ]; then |
pankso@12285 | 40 # we just need aufs source. Also cooking now is a bad idea since it |
pankso@12285 | 41 # needs linux-module-headers. The one your cooking not the one from the web. |
gokhlayeh@11395 | 42 AUFSDIR=$WOK/aufs/aufs-${_AUFSVER} |
gokhlayeh@11395 | 43 [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR |
gokhlayeh@11395 | 44 tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; } |
pankso@9731 | 45 fi |
pankso@12285 | 46 echo "cook:linux" > $command |
pankso@12285 | 47 |
pankso@9731 | 48 echo "Copying Aufs files and patches..." |
slaxemulator@7297 | 49 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src |
pankso@12285 | 50 cp -a $AUFSDIR/aufs3-*.patch $stuff |
pankso@12285 | 51 |
pankso@4251 | 52 # SliTaz db |
pankso@12285 | 53 [ -d $WOK/$PACKAGE/source/slitaz ] && rm -rf $WOK/$PACKAGE/source/slitaz 2> /dev/null |
pankso@12285 | 54 mkdir -p $WOK/$PACKAGE/source/slitaz |
slaxemulator@9337 | 55 echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url |
pankso@12285 | 56 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/source/slitaz |
pankso@12285 | 57 cp $stuff/bootloader.sh $WOK/$PACKAGE/source/slitaz |
pankso@9731 | 58 |
pankso@5640 | 59 # Apply patches |
pankso@9731 | 60 echo "Applying patches..." |
pascal@521 | 61 while read patch_file; do |
pankso@12285 | 62 echo "$patch_file" >> $WOK/$PACKAGE/source/slitaz/patches |
pankso@12285 | 63 cp $stuff/$patch_file $WOK/$PACKAGE/source/slitaz |
pascal@1442 | 64 if [ -f done.$patch_file ]; then |
pascal@1442 | 65 echo "Skipping $patch_file" |
pascal@1442 | 66 continue |
pascal@1442 | 67 fi |
pascal@521 | 68 echo "Apply $patch_file" |
pankso@12285 | 69 if [ -x /usr/bin/cook ]; then |
pankso@12285 | 70 patch -p1 < $WOK/$PACKAGE/source/slitaz/$patch_file || return 1 |
pankso@12285 | 71 elif [ -x /usr/bin/tazwok ]; then |
pankso@12285 | 72 patch -p1 < $WOK/$PACKAGE/source/slitaz/$patch_file || { report close-bloc; return 1; } |
pankso@12285 | 73 fi |
pascal@1442 | 74 touch done.$patch_file |
pascal@521 | 75 done <<EOT |
pankso@12285 | 76 $PACKAGE-diff.u |
pankso@12285 | 77 $PACKAGE-header.u |
pankso@12285 | 78 $PACKAGE-freeinitrd.u |
pankso@12285 | 79 aufs3-base.patch |
pankso@12285 | 80 aufs3-standalone.patch |
pankso@12285 | 81 aufs3-loopback.patch |
pankso@12285 | 82 aufs3-proc_map.patch |
pankso@12285 | 83 channel-negative-one-maxim.patch |
pankso@12285 | 84 mac80211.compat08082009.wl_frag+ack_v1.patch |
pascal@521 | 85 EOT |
pankso@9731 | 86 |
pankso@12285 | 87 if [ "$KBASEVER" != "$VERSION" ]; then |
pankso@12285 | 88 if [ -f $SOURCES_REPOSITORY/$(basename $PATCH) ]; then |
pankso@12285 | 89 xzcat $SOURCES_REPOSITORY/$(basename $PATCH) | patch -Np1 |
pankso@12285 | 90 touch done.patch-$VERSION |
pankso@12285 | 91 else |
pankso@12285 | 92 wget $PATCH -O $SRC/$(basename $PATCH) |
pankso@12285 | 93 xzcat $SRC/$(basename $PATCH) | patch -Np1 |
pankso@12285 | 94 touch done.patch-$VERSION |
pankso@12285 | 95 fi |
pankso@12285 | 96 fi |
pankso@12285 | 97 |
pankso@12285 | 98 sed -i 's|SUBLEVEL =.*|SUBLEVEL =|g' Makefile |
pankso@12285 | 99 |
gokhlayeh@11395 | 100 [ ! -x /usr/bin/cook ] && report step "Make kernel proper and then build lguest" |
pankso@9731 | 101 |
pankso@3864 | 102 make mrproper |
pankso@12285 | 103 cd Documentation/virtual/lguest |
pankso@12285 | 104 if [ -x /usr/bin/cook ]; then |
pankso@12285 | 105 make lguest || return 1 |
pankso@12285 | 106 elif [ -x /usr/bin/tazwok ]; then |
pankso@12285 | 107 make lguest || { report close-bloc; return 1; } |
pankso@12285 | 108 fi |
slaxemulator@8681 | 109 cd $src |
pascal@7667 | 110 |
gokhlayeh@11395 | 111 [ ! -x /usr/bin/cook ] && report step "Make bzImage without modules first" |
pankso@9731 | 112 |
pascal@7667 | 113 # Build bzImage without modules first |
pankso@12285 | 114 cp -f $stuff/$PACKAGE-slitaz.config .config |
pascal@7667 | 115 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config |
pankso@9731 | 116 |
pascal@7667 | 117 # We can't keep every driver in staging |
pascal@7667 | 118 sed -i -e 's/^CONFIG_RTL8192/#&/' \ |
pascal@7667 | 119 -e 's/^CONFIG_R8187SE/#&/' \ |
pascal@7667 | 120 -e 's/^CONFIG_RT2870/#&/' .config |
pascal@7667 | 121 yes '' | make oldconfig |
pankso@12285 | 122 if [ -x /usr/bin/cook ]; then |
pankso@12285 | 123 make -j 4 bzImage || exit 1 |
pankso@12285 | 124 elif [ -x /usr/bin/tazwok ]; then |
pankso@12285 | 125 make -j 4 bzImage || { report close-bloc; return 1; } |
pankso@12285 | 126 fi |
pankso@12285 | 127 [ -d $DESTDIR ] || mkdir -p $DESTDIR |
pankso@12285 | 128 mv arch/x86/boot/bzImage $DESTDIR |
pascal@7667 | 129 mv System.map System.map-without-modules |
pascal@7667 | 130 |
gokhlayeh@11400 | 131 [ ! -x /usr/bin/cook ] && report step "Now build bzImage with modules" |
pankso@9731 | 132 |
pascal@7667 | 133 # Build bzImage with modules |
pankso@12285 | 134 cp -f $stuff/$PACKAGE-slitaz.config .config |
pankso@12285 | 135 #make oldconfig |
pankso@12285 | 136 ln .config $WOK/$PACKAGE/source/slitaz/config |
pankso@12285 | 137 make -j 4 bzImage && |
pankso@12285 | 138 make -j 4 modules && |
pankso@12285 | 139 make INSTALL_MOD_PATH=$DESTDIR modules_install && |
pankso@12285 | 140 make INSTALL_HDR_PATH=$DESTDIR/usr headers_install && |
pankso@12285 | 141 if [ -x /usr/bin/cook ]; then |
pankso@12285 | 142 [ -s arch/x86/boot/bzImage ] || return 1 |
pankso@12285 | 143 elif [ -x /usr/bin/tazwok ]; then |
pankso@12285 | 144 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; } |
pankso@12285 | 145 fi |
pankso@12285 | 146 mkdir -p $DESTDIR/boot 2> /dev/null |
pankso@12285 | 147 mv arch/x86/boot/bzImage $DESTDIR/boot/vmlinuz-$VERSION-slitaz |
pankso@12285 | 148 |
pankso@12285 | 149 [ ! -x /usr/bin/cook ] && report step "Make bzImage64 without modules first" |
pankso@12285 | 150 |
pankso@12285 | 151 # Build bzImage64 without modules first |
pankso@12285 | 152 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config64 .config |
pankso@12285 | 153 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config |
pankso@12285 | 154 |
pankso@12285 | 155 # We can't keep every driver in staging |
pankso@12285 | 156 sed -i -e 's/^CONFIG_RTL8192/#&/' \ |
pankso@12285 | 157 -e 's/^CONFIG_R8187SE/#&/' \ |
pankso@12285 | 158 -e 's/^CONFIG_RT2870/#&/' .config |
pankso@12285 | 159 yes '' | make ARCH=x86_64 oldconfig |
pankso@12285 | 160 if [ -x /usr/bin/cook ]; then |
pankso@12285 | 161 make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- bzImage || exit 1 |
pankso@12285 | 162 elif [ -x /usr/bin/tazwok ]; then |
pankso@12285 | 163 make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- bzImage || { report close-bloc; return 1; } |
pankso@12285 | 164 fi |
pankso@12285 | 165 [ -d $PWD/_pkg ] || mkdir -p $DESTDIR/linux64 |
pankso@12285 | 166 mv arch/x86/boot/bzImage $DESTDIR/linux64 |
pankso@12285 | 167 mv System.map System.map-without-modules64 |
pankso@12285 | 168 |
pankso@12285 | 169 [ ! -x /usr/bin/cook ] && report step "Now build bzImage64 with modules" |
pankso@12285 | 170 |
pankso@12285 | 171 # Build bzImage64 with modules |
pankso@12285 | 172 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config64 .config |
pankso@12285 | 173 #make ARCH=x86_64 oldconfig |
pankso@12285 | 174 ln .config $WOK/$PACKAGE/slitaz/config64 |
pankso@12285 | 175 make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- bzImage && |
pankso@12285 | 176 make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- modules && |
pankso@12285 | 177 make ARCH=x86_64 INSTALL_MOD_PATH=$DESTDIR/linux64 modules_install && |
pankso@12285 | 178 make ARCH=x86_64 INSTALL_HDR_PATH=$DESTDIR/linux64/usr headers_install && |
pankso@12285 | 179 if [ -x /usr/bin/cook ]; then |
pankso@12285 | 180 [ -s arch/x86/boot/bzImage ] || return 1 |
pankso@12285 | 181 elif [ -x /usr/bin/tazwok ]; then |
pankso@12285 | 182 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; } |
pankso@12285 | 183 fi |
pankso@12285 | 184 mkdir -p $DESTDIR/linux64/boot 2> /dev/null |
pankso@12285 | 185 mv arch/x86/boot/bzImage $DESTDIR/linux64/boot/vmlinuz-$VERSION-slitaz |
pankso@12285 | 186 ln System.map System.map-modules64 |
pankso@12285 | 187 ln Module.symvers Module.symvers-modules64 |
pankso@9731 | 188 |
gokhlayeh@11395 | 189 [ ! -x /usr/bin/cook ] && report step "Compressing all modules" |
pankso@9731 | 190 |
slaxemulator@6719 | 191 # Compress all modules. |
pankso@12285 | 192 $stuff/gztazmod.sh $DESTDIR/lib/modules/$KBASEVER-slitaz |
pankso@12285 | 193 $stuff/gztazmod.sh $DESTDIR/linux64/lib/modules/$KBASEVER-slitaz |
pascal@7667 | 194 ln System.map System.map-modules |
pascal@7667 | 195 ln Module.symvers Module.symvers-modules |
pankso@9731 | 196 |
gokhlayeh@11395 | 197 if [ ! -x /usr/bin/cook ]; then |
gokhlayeh@11395 | 198 report close-bloc |
gokhlayeh@11395 | 199 fi |
pankso@3864 | 200 } |
erjo@253 | 201 |
pankso@3 | 202 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@3 | 203 genpkg_rules() |
pankso@3 | 204 { |
pascal@521 | 205 local path |
pascal@7656 | 206 cp -a $_pkg/boot $fs |
pankso@3 | 207 # Compress all modules. |
pankso@12285 | 208 #$stuff/gztazmod.sh $_pkg/lib/modules/$KBASEVER-slitaz |
pankso@12285 | 209 path=$fs/lib/modules/$KBASEVER-slitaz/kernel |
pascal@521 | 210 mkdir -p $path |
pankso@12285 | 211 cp -a $_pkg/lib/modules/$KBASEVER-slitaz/mo* \ |
pankso@12285 | 212 $fs/lib/modules/$KBASEVER-slitaz |
pankso@5640 | 213 # Get the base modules |
pascal@886 | 214 export src |
pascal@886 | 215 export _pkg |
pankso@12285 | 216 mkdir -p $WOK/$PACKAGE/source/tmp |
slaxemulator@9701 | 217 $stuff/list_modules.sh \ |
pankso@12285 | 218 $(cat $stuff/modules.list) > $WOK/$PACKAGE/source/tmp/modules.list |
pankso@3864 | 219 while read module; do |
pascal@521 | 220 dir=$(dirname $module) |
pankso@535 | 221 [ -d $path/$dir ] || mkdir -p $path/$dir |
pankso@12285 | 222 cp -a $_pkg/lib/modules/$KBASEVER-slitaz/kernel/$module $path/$dir |
pankso@12285 | 223 done < $WOK/$PACKAGE/source/tmp/modules.list |
pascal@397 | 224 # Remove unresolved links |
pankso@12285 | 225 rm -f $fs/lib/modules/$KBASEVER-slitaz/build |
pankso@12285 | 226 rm -f $fs/lib/modules/$KBASEVER-slitaz/source |
pankso@12285 | 227 # Cook all packages with a kernel module |
pankso@12285 | 228 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt) |
pankso@12285 | 229 do |
pankso@12285 | 230 echo tazwok cook ${i%/receipt} |
pankso@12285 | 231 done |
pankso@12285 | 232 # Fixed modules.dep to use right path |
pankso@12285 | 233 # saves 100kb of space too |
pankso@12285 | 234 sed -i "s|$_pkg||g" $fs/lib/modules/$KBASEVER-slitaz/modules.dep |
pankso@12285 | 235 sed -i "s|99.98.$KBASEVER-slitaz|$KBASEVER-slitaz|g" $fs/lib/modules/$KBASEVER-slitaz/modules.dep |
pankso@5640 | 236 # Check and echo any module in kernel .config that's not added to |
pankso@5640 | 237 # one of linux-* pkgs |
pankso@9731 | 238 $stuff/check_modules.sh |
pankso@3 | 239 } |
pankso@3 | 240 |
pankso@3 | 241 # Pre and post install commands for Tazpkg. |
pankso@3 | 242 post_install() |
pankso@3 | 243 { |
pascal@521 | 244 echo "Processing post-install commands..." |
pankso@12285 | 245 chroot "$1/" depmod -a $KBASEVER-slitaz |
pankso@5640 | 246 # GRUB stuff. |
pankso@1154 | 247 if [ -f "$1/boot/grub/menu.lst" ]; then |
pankso@4056 | 248 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1` |
pankso@4056 | 249 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1` |
pankso@3864 | 250 # Add new kernel entry in case of upgrade for installed system. |
pankso@4056 | 251 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then |
pankso@4056 | 252 cat >> $1/boot/grub/menu.lst << EOT |
pankso@4056 | 253 |
pankso@4056 | 254 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
pankso@4056 | 255 $grub_dev |
pankso@4056 | 256 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
pankso@4056 | 257 EOT |
pankso@4056 | 258 fi |
pankso@4056 | 259 # Display information message. |
pankso@4056 | 260 cat <<EOT |
pankso@4056 | 261 ---- |
pankso@4056 | 262 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst: |
pankso@1154 | 263 |
pankso@1154 | 264 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
pankso@1154 | 265 $grub_dev |
pankso@4056 | 266 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
pascal@886 | 267 ---- |
pascal@886 | 268 EOT |
pankso@1154 | 269 fi |
pankso@3 | 270 } |