wok-stable annotate linux/receipt @ rev 12465
Up e2fsprogs (1.44.2)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Mar 04 18:42:23 2019 +0100 (2019-03-04) |
parents | 3f61dd5a209d |
children |
rev | line source |
---|---|
pankso@3 | 1 # SliTaz package receipt. |
pankso@3 | 2 |
pankso@3 | 3 PACKAGE="linux" |
slaxemulator@9546 | 4 VERSION="2.6.37" |
pankso@3 | 5 CATEGORY="base-system" |
pankso@3 | 6 SHORT_DESC="The Linux kernel and modules." |
pankso@3864 | 7 MAINTAINER="devel@slitaz.org" |
slaxemulator@9546 | 8 TARBALL="$PACKAGE-$VERSION.tar.bz2" |
pankso@3 | 9 WEB_SITE="http://www.kernel.org/" |
pascal@12383 | 10 WGET_URL="ftp://www.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL" |
pascal@1909 | 11 CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep" |
pankso@3 | 12 |
pankso@9731 | 13 DEPENDS="depmod" |
pascal@11610 | 14 BUILD_DEPENDS="slitaz-toolchain perl git lzma patch" |
pankso@9731 | 15 |
pankso@3 | 16 # Rules to configure and make the package. |
pankso@3 | 17 compile_rules() |
pankso@3 | 18 { |
pankso@9731 | 19 cd $src |
slaxemulator@7131 | 20 # this is code to help update the kernel version faster |
slaxemulator@7131 | 21 #for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt) |
slaxemulator@7131 | 22 #do |
slaxemulator@7131 | 23 # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i |
slaxemulator@7131 | 24 #done |
slaxemulator@8616 | 25 |
gokhlayeh@11395 | 26 [ ! -x /usr/bin/cook ] && report open-bloc |
pankso@9731 | 27 |
pankso@9731 | 28 # Check for Aufs and cook it if unbuilt. |
pankso@9731 | 29 echo "Checking for Aufs packages..." |
slaxemulator@8681 | 30 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` |
gokhlayeh@11395 | 31 if [ ! -d "$AUFSDIR" ] && [ -x /usr/bin/cook ]; then |
gokhlayeh@11395 | 32 # Give info an redirect to /dev/null since aufs got it own log. |
gokhlayeh@11395 | 33 AUFSDIR=$WOK/aufs/source/aufs-${_AUFSVER} |
gokhlayeh@11395 | 34 echo "Cook: aufs $_AUFSVER" |
gokhlayeh@11395 | 35 cook aufs > /dev/null |
gokhlayeh@11395 | 36 elif [ ! -x /usr/bin/cook ]; then |
gokhlayeh@11395 | 37 # We only need aufs source. Also cooking now is a bad idea since it |
gokhlayeh@11395 | 38 # needs linux-module-headers. |
gokhlayeh@11395 | 39 AUFSDIR=$WOK/aufs/aufs-${_AUFSVER} |
gokhlayeh@11395 | 40 [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR |
gokhlayeh@11395 | 41 tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; } |
pankso@9731 | 42 fi |
pankso@9731 | 43 |
pankso@9731 | 44 echo "Copying Aufs files and patches..." |
slaxemulator@7297 | 45 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src |
pankso@9732 | 46 cp -a $AUFSDIR/*.patch $stuff |
pankso@9731 | 47 |
pankso@4251 | 48 # SliTaz db |
pankso@9731 | 49 rm -rf $WOK/$PACKAGE/slitaz && mkdir $WOK/$PACKAGE/slitaz |
slaxemulator@9337 | 50 echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url |
slaxemulator@8681 | 51 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz |
slaxemulator@8681 | 52 cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz |
pankso@9731 | 53 |
pankso@5640 | 54 # Apply patches |
pankso@9731 | 55 echo "Applying patches..." |
pascal@521 | 56 while read patch_file; do |
slaxemulator@8681 | 57 echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches |
slaxemulator@8681 | 58 cp $stuff/$patch_file $WOK/$PACKAGE/slitaz |
pascal@1442 | 59 if [ -f done.$patch_file ]; then |
pascal@1442 | 60 echo "Skipping $patch_file" |
pascal@1442 | 61 continue |
pascal@1442 | 62 fi |
pascal@521 | 63 echo "Apply $patch_file" |
slaxemulator@8681 | 64 patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; } |
pascal@1442 | 65 touch done.$patch_file |
pascal@521 | 66 done <<EOT |
slaxemulator@9546 | 67 $PACKAGE-diff-$VERSION.u |
slaxemulator@9546 | 68 $PACKAGE-header-$VERSION.u |
slaxemulator@9546 | 69 $PACKAGE-freeinitrd-$VERSION.u |
pascal@12382 | 70 $PACKAGE-perf_event-$VERSION.u |
jozee@4472 | 71 aufs2-base.patch |
slaxemulator@7131 | 72 aufs2-standalone.patch |
slaxemulator@7650 | 73 001-squashfs-decompressors-add-xz-decompressor-module.patch |
slaxemulator@7650 | 74 002-squashfs-decompressors-add-boot-time-xz-support.patch |
slaxemulator@7650 | 75 003-squashfs-x86-support-xz-compressed-kernel.patch |
slaxemulator@7650 | 76 004-squashfs-add-xz-compression-support.patch |
slaxemulator@7650 | 77 005-squashfs-add-xz-compression-configuration-option.patch |
pascal@12457 | 78 $PACKAGE-CVE-2016-5195.u |
pascal@521 | 79 EOT |
pankso@9731 | 80 |
gokhlayeh@11395 | 81 [ ! -x /usr/bin/cook ] && report step "Make kernel proper and then build lguest" |
pankso@9731 | 82 |
pankso@3864 | 83 make mrproper |
pascal@4507 | 84 cd Documentation/lguest |
gokhlayeh@11395 | 85 make $MAKEFLAGS lguest || { report close-bloc; return 1; } |
slaxemulator@8681 | 86 cd $src |
pascal@7667 | 87 |
gokhlayeh@11395 | 88 [ ! -x /usr/bin/cook ] && report step "Make bzImage without modules first" |
pankso@9731 | 89 |
pascal@7667 | 90 # Build bzImage without modules first |
slaxemulator@9546 | 91 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config |
pascal@7667 | 92 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config |
pankso@9731 | 93 |
pascal@7667 | 94 # We can't keep every driver in staging |
pascal@7667 | 95 sed -i -e 's/^CONFIG_RTL8192/#&/' \ |
pascal@7667 | 96 -e 's/^CONFIG_R8187SE/#&/' \ |
pascal@7667 | 97 -e 's/^CONFIG_RT2870/#&/' .config |
pascal@7667 | 98 yes '' | make oldconfig |
gokhlayeh@11395 | 99 make $MAKEFLAGS bzImage || { report close-bloc; return 1; } |
slaxemulator@7690 | 100 [ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg |
pascal@7667 | 101 mv arch/x86/boot/bzImage $PWD/_pkg |
pascal@7667 | 102 mv System.map System.map-without-modules |
pascal@7667 | 103 |
gokhlayeh@11400 | 104 [ ! -x /usr/bin/cook ] && report step "Now build bzImage with modules" |
pankso@9731 | 105 |
pascal@7667 | 106 # Build bzImage with modules |
slaxemulator@9546 | 107 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config |
erjo@253 | 108 make oldconfig |
slaxemulator@8681 | 109 ln .config $WOK/$PACKAGE/slitaz/config |
gokhlayeh@11395 | 110 make $MAKEFLAGS bzImage && |
gokhlayeh@11395 | 111 make $MAKEFLAGS modules && |
pascal@3919 | 112 make INSTALL_MOD_PATH=$PWD/_pkg modules_install && |
pascal@3919 | 113 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install && |
slaxemulator@8681 | 114 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; } |
pascal@7656 | 115 mkdir -p $PWD/_pkg/boot 2> /dev/null |
pascal@7656 | 116 mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz |
pankso@9731 | 117 |
gokhlayeh@11395 | 118 [ ! -x /usr/bin/cook ] && report step "Compressing all modules" |
pankso@9731 | 119 |
slaxemulator@6719 | 120 # Compress all modules. |
slaxemulator@8681 | 121 $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz |
pascal@7667 | 122 ln System.map System.map-modules |
pascal@7667 | 123 ln Module.symvers Module.symvers-modules |
pankso@9731 | 124 |
gokhlayeh@11395 | 125 if [ ! -x /usr/bin/cook ]; then |
gokhlayeh@11395 | 126 report close-bloc |
gokhlayeh@11395 | 127 fi |
pankso@3864 | 128 } |
erjo@253 | 129 |
pankso@3 | 130 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@3 | 131 genpkg_rules() |
pankso@3 | 132 { |
pascal@521 | 133 local path |
pascal@7656 | 134 cp -a $_pkg/boot $fs |
pankso@3 | 135 # Compress all modules. |
slaxemulator@9701 | 136 #$stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz |
pascal@521 | 137 path=$fs/lib/modules/$VERSION-slitaz/kernel |
pascal@521 | 138 mkdir -p $path |
pankso@5640 | 139 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \ |
pankso@5640 | 140 $fs/lib/modules/$VERSION-slitaz |
pankso@5640 | 141 # Get the base modules |
pascal@886 | 142 export src |
pascal@886 | 143 export _pkg |
slaxemulator@8728 | 144 mkdir $WOK/$PACKAGE/tmp |
slaxemulator@9701 | 145 $stuff/list_modules.sh \ |
slaxemulator@9546 | 146 $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list |
pankso@3864 | 147 while read module; do |
pascal@521 | 148 dir=$(dirname $module) |
pankso@535 | 149 [ -d $path/$dir ] || mkdir -p $path/$dir |
pankso@535 | 150 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir |
slaxemulator@8728 | 151 done < $WOK/$PACKAGE/tmp/modules.list |
pascal@397 | 152 # Remove unresolved links |
pascal@397 | 153 rm -f $fs/lib/modules/$VERSION-slitaz/build |
pascal@397 | 154 rm -f $fs/lib/modules/$VERSION-slitaz/source |
pankso@5640 | 155 # Check and echo any module in kernel .config that's not added to |
pankso@5640 | 156 # one of linux-* pkgs |
pascal@12037 | 157 export PACKAGE |
pankso@9731 | 158 $stuff/check_modules.sh |
pankso@3 | 159 } |
pankso@3 | 160 |
pankso@3 | 161 # Pre and post install commands for Tazpkg. |
pankso@3 | 162 post_install() |
pankso@3 | 163 { |
pascal@521 | 164 echo "Processing post-install commands..." |
pascal@2926 | 165 chroot "$1/" depmod -a $VERSION-slitaz |
pankso@5640 | 166 # GRUB stuff. |
pankso@1154 | 167 if [ -f "$1/boot/grub/menu.lst" ]; then |
pankso@4056 | 168 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1` |
pankso@4056 | 169 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1` |
pankso@3864 | 170 # Add new kernel entry in case of upgrade for installed system. |
pankso@4056 | 171 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then |
pankso@4056 | 172 cat >> $1/boot/grub/menu.lst << EOT |
pankso@4056 | 173 |
pankso@4056 | 174 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
pankso@4056 | 175 $grub_dev |
pankso@4056 | 176 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
pankso@4056 | 177 EOT |
pankso@4056 | 178 fi |
pankso@4056 | 179 # Display information message. |
pankso@4056 | 180 cat <<EOT |
pankso@4056 | 181 ---- |
pankso@4056 | 182 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst: |
pankso@1154 | 183 |
pankso@1154 | 184 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
pankso@1154 | 185 $grub_dev |
pankso@4056 | 186 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
pascal@886 | 187 ---- |
pascal@886 | 188 EOT |
pankso@1154 | 189 fi |
pankso@3 | 190 } |