wok annotate linux/receipt @ rev 12191

Add pwauth (use system passwd to auth user, maybe used in our CGI tools)
author Christophe Lincoln <pankso@slitaz.org>
date Mon Mar 26 01:27:26 2012 +0200 (2012-03-26)
parents 37280739d841
children 6f536abe4f0b
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@11610 10 WGET_URL="http://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
jozee@4472 70 aufs2-base.patch
slaxemulator@7131 71 aufs2-standalone.patch
slaxemulator@7650 72 001-squashfs-decompressors-add-xz-decompressor-module.patch
slaxemulator@7650 73 002-squashfs-decompressors-add-boot-time-xz-support.patch
slaxemulator@7650 74 003-squashfs-x86-support-xz-compressed-kernel.patch
slaxemulator@7650 75 004-squashfs-add-xz-compression-support.patch
slaxemulator@7650 76 005-squashfs-add-xz-compression-configuration-option.patch
pascal@521 77 EOT
pankso@9731 78
gokhlayeh@11395 79 [ ! -x /usr/bin/cook ] && report step "Make kernel proper and then build lguest"
pankso@9731 80
pankso@3864 81 make mrproper
pascal@4507 82 cd Documentation/lguest
gokhlayeh@11395 83 make $MAKEFLAGS lguest || { report close-bloc; return 1; }
slaxemulator@8681 84 cd $src
pascal@7667 85
gokhlayeh@11395 86 [ ! -x /usr/bin/cook ] && report step "Make bzImage without modules first"
pankso@9731 87
pascal@7667 88 # Build bzImage without modules first
slaxemulator@9546 89 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
pascal@7667 90 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
pankso@9731 91
pascal@7667 92 # We can't keep every driver in staging
pascal@7667 93 sed -i -e 's/^CONFIG_RTL8192/#&/' \
pascal@7667 94 -e 's/^CONFIG_R8187SE/#&/' \
pascal@7667 95 -e 's/^CONFIG_RT2870/#&/' .config
pascal@7667 96 yes '' | make oldconfig
gokhlayeh@11395 97 make $MAKEFLAGS bzImage || { report close-bloc; return 1; }
slaxemulator@7690 98 [ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg
pascal@7667 99 mv arch/x86/boot/bzImage $PWD/_pkg
pascal@7667 100 mv System.map System.map-without-modules
pascal@7667 101
gokhlayeh@11400 102 [ ! -x /usr/bin/cook ] && report step "Now build bzImage with modules"
pankso@9731 103
pascal@7667 104 # Build bzImage with modules
slaxemulator@9546 105 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
erjo@253 106 make oldconfig
slaxemulator@8681 107 ln .config $WOK/$PACKAGE/slitaz/config
gokhlayeh@11395 108 make $MAKEFLAGS bzImage &&
gokhlayeh@11395 109 make $MAKEFLAGS modules &&
pascal@3919 110 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
pascal@3919 111 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
slaxemulator@8681 112 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; }
pascal@7656 113 mkdir -p $PWD/_pkg/boot 2> /dev/null
pascal@7656 114 mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz
pankso@9731 115
gokhlayeh@11395 116 [ ! -x /usr/bin/cook ] && report step "Compressing all modules"
pankso@9731 117
slaxemulator@6719 118 # Compress all modules.
slaxemulator@8681 119 $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
pascal@7667 120 ln System.map System.map-modules
pascal@7667 121 ln Module.symvers Module.symvers-modules
pankso@9731 122
gokhlayeh@11395 123 if [ ! -x /usr/bin/cook ]; then
gokhlayeh@11395 124 report close-bloc
gokhlayeh@11395 125 fi
pankso@3864 126 }
erjo@253 127
pankso@3 128 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@3 129 genpkg_rules()
pankso@3 130 {
pascal@521 131 local path
pascal@7656 132 cp -a $_pkg/boot $fs
pankso@3 133 # Compress all modules.
slaxemulator@9701 134 #$stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
pascal@521 135 path=$fs/lib/modules/$VERSION-slitaz/kernel
pascal@521 136 mkdir -p $path
pankso@5640 137 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
pankso@5640 138 $fs/lib/modules/$VERSION-slitaz
pankso@5640 139 # Get the base modules
pascal@886 140 export src
pascal@886 141 export _pkg
slaxemulator@8728 142 mkdir $WOK/$PACKAGE/tmp
slaxemulator@9701 143 $stuff/list_modules.sh \
slaxemulator@9546 144 $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
pankso@3864 145 while read module; do
pascal@521 146 dir=$(dirname $module)
pankso@535 147 [ -d $path/$dir ] || mkdir -p $path/$dir
pankso@535 148 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
slaxemulator@8728 149 done < $WOK/$PACKAGE/tmp/modules.list
pascal@397 150 # Remove unresolved links
pascal@397 151 rm -f $fs/lib/modules/$VERSION-slitaz/build
pascal@397 152 rm -f $fs/lib/modules/$VERSION-slitaz/source
pankso@5640 153 # Check and echo any module in kernel .config that's not added to
pankso@5640 154 # one of linux-* pkgs
pascal@12037 155 export PACKAGE
pankso@9731 156 $stuff/check_modules.sh
pankso@3 157 }
pankso@3 158
pankso@3 159 # Pre and post install commands for Tazpkg.
pankso@3 160 post_install()
pankso@3 161 {
pascal@521 162 echo "Processing post-install commands..."
pascal@2926 163 chroot "$1/" depmod -a $VERSION-slitaz
pankso@5640 164 # GRUB stuff.
pankso@1154 165 if [ -f "$1/boot/grub/menu.lst" ]; then
pankso@4056 166 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
pankso@4056 167 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
pankso@3864 168 # Add new kernel entry in case of upgrade for installed system.
pankso@4056 169 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
pankso@4056 170 cat >> $1/boot/grub/menu.lst << EOT
pankso@4056 171
pankso@4056 172 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
pankso@4056 173 $grub_dev
pankso@4056 174 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
pankso@4056 175 EOT
pankso@4056 176 fi
pankso@4056 177 # Display information message.
pankso@4056 178 cat <<EOT
pankso@4056 179 ----
pankso@4056 180 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
pankso@1154 181
pankso@1154 182 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
pankso@1154 183 $grub_dev
pankso@4056 184 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
pascal@886 185 ----
pascal@886 186 EOT
pankso@1154 187 fi
pankso@3 188 }