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