wok-4.x diff linux-libre/receipt @ rev 9257
Add: linux-libre 2.6.37-libre (part 1)
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Tue Mar 15 03:23:44 2011 +0100 (2011-03-15) |
parents | |
children | 67cd1106a33b |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/linux-libre/receipt Tue Mar 15 03:23:44 2011 +0100 1.3 @@ -0,0 +1,168 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="linux-libre" 1.7 +VERSION="2.6.37-libre" 1.8 +CATEGORY="base-system" 1.9 +SHORT_DESC="The Linux Libre kernel and modules." 1.10 +DEPENDS="depmod" 1.11 +BUILD_DEPENDS="slitaz-toolchain perl git lzma patch" 1.12 +MAINTAINER="gokhlayeh@slitaz.org" 1.13 +PROVIDE="linux" 1.14 +TARBALL="linux-$VERSION.tar.bz2" 1.15 +WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" 1.16 +WGET_URL="http://www.fsfla.org/svnwiki/selibre/linux-libre/download/releases/$VERSION/$TARBALL" 1.17 +CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep" 1.18 + 1.19 +# Rules to configure and make the package. 1.20 +compile_rules() 1.21 +{ 1.22 + 1.23 + # this is code to help update the kernel version faster 1.24 + #for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt) 1.25 + #do 1.26 + # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i 1.27 + #done 1.28 + report open-bloc 1.29 + 1.30 + _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` 1.31 + AUFSDIR=$WOK/$PACKAGE/aufs-${_AUFSVER} 1.32 + tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; } 1.33 + cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src 1.34 + cp -a $AUFSDIR/*.patch $WOK/$PACKAGE/stuff 1.35 + cd $src 1.36 + # SliTaz db 1.37 + [ -d $WOK/$PACKAGE/slitaz ] && rm -rf $WOK/$PACKAGE/slitaz 2> /dev/null 1.38 + mkdir $WOK/$PACKAGE/slitaz 1.39 + echo "$WGET_URL" > slitaz/url 1.40 + cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz 1.41 + cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz 1.42 + # Apply patches 1.43 + report step "Applying patches" 1.44 + while read patch_file; do 1.45 + echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches 1.46 + cp $stuff/$patch_file $WOK/$PACKAGE/slitaz 1.47 + if [ -f done.$patch_file ]; then 1.48 + echo "Skipping $patch_file" 1.49 + continue 1.50 + fi 1.51 + echo "Apply $patch_file" 1.52 + patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; } 1.53 + touch done.$patch_file 1.54 + done <<EOT 1.55 +$PACKAGE-diff-$VERSION.u 1.56 +$PACKAGE-unlzma-$VERSION.u 1.57 +$PACKAGE-header-$VERSION.u 1.58 +$PACKAGE-freeinitrd-$VERSION.u 1.59 +aufs2-base.patch 1.60 +aufs2-standalone.patch 1.61 +001-squashfs-decompressors-add-xz-decompressor-module.patch 1.62 +002-squashfs-decompressors-add-boot-time-xz-support.patch 1.63 +003-squashfs-x86-support-xz-compressed-kernel.patch 1.64 +004-squashfs-add-xz-compression-support.patch 1.65 +005-squashfs-add-xz-compression-configuration-option.patch 1.66 +EOT 1.67 + report step "Make kernel proper and then build lguest" 1.68 + make mrproper 1.69 + cd Documentation/lguest 1.70 + make lguest || { report close-bloc; return 1; } 1.71 + cd $src 1.72 + 1.73 + report step "Make bzImage without modules first" 1.74 + # Build bzImage without modules first 1.75 + cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config 1.76 + sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config 1.77 + # We can't keep every driver in staging 1.78 + sed -i -e 's/^CONFIG_RTL8192/#&/' \ 1.79 + -e 's/^CONFIG_R8187SE/#&/' \ 1.80 + -e 's/^CONFIG_RT2870/#&/' .config 1.81 + yes '' | make oldconfig 1.82 + make -j 4 bzImage || { report close-bloc; return 1; } 1.83 + [ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg 1.84 + mv arch/x86/boot/bzImage $PWD/_pkg 1.85 + mv System.map System.map-without-modules 1.86 + 1.87 + report step "Now build bzImage with modules" 1.88 + # Build bzImage with modules 1.89 + cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config 1.90 + make oldconfig 1.91 + ln .config $WOK/$PACKAGE/slitaz/config 1.92 + make -j 4 bzImage && 1.93 + make -j 4 modules && 1.94 + make INSTALL_MOD_PATH=$PWD/_pkg modules_install && 1.95 + make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install && 1.96 + [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; } 1.97 + mkdir -p $PWD/_pkg/boot 2> /dev/null 1.98 + mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz 1.99 + # Compress all modules. 1.100 + report step "Compressing all modules" 1.101 + $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz 1.102 + ln System.map System.map-modules 1.103 + ln Module.symvers Module.symvers-modules 1.104 + report close-bloc 1.105 +} 1.106 + 1.107 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.108 +genpkg_rules() 1.109 +{ 1.110 + local path 1.111 + cp -a $_pkg/boot $fs 1.112 + # Compress all modules. 1.113 + #./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz 1.114 + path=$fs/lib/modules/$VERSION-slitaz/kernel 1.115 + mkdir -p $path 1.116 + cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \ 1.117 + $fs/lib/modules/$VERSION-slitaz 1.118 + # Get the base modules 1.119 + export src 1.120 + export _pkg 1.121 + mkdir $WOK/$PACKAGE/tmp 1.122 + $WOK/$PACKAGE/stuff/list_modules.sh \ 1.123 + $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list 1.124 + while read module; do 1.125 + dir=$(dirname $module) 1.126 + [ -d $path/$dir ] || mkdir -p $path/$dir 1.127 + cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir 1.128 + done < $WOK/$PACKAGE/tmp/modules.list 1.129 + # Remove unresolved links 1.130 + rm -f $fs/lib/modules/$VERSION-slitaz/build 1.131 + rm -f $fs/lib/modules/$VERSION-slitaz/source 1.132 + # Cook all packages with a kernel module 1.133 + for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt) 1.134 + do 1.135 + echo tazwok cook ${i%/receipt} 1.136 + done 1.137 + # Check and echo any module in kernel .config that's not added to 1.138 + # one of linux-* pkgs 1.139 + ./stuff/check_modules.sh 1.140 +} 1.141 + 1.142 +# Pre and post install commands for Tazpkg. 1.143 +post_install() 1.144 +{ 1.145 + echo "Processing post-install commands..." 1.146 + chroot "$1/" depmod -a $VERSION-slitaz 1.147 + # GRUB stuff. 1.148 + if [ -f "$1/boot/grub/menu.lst" ]; then 1.149 + root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1` 1.150 + grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1` 1.151 + # Add new kernel entry in case of upgrade for installed system. 1.152 + if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then 1.153 + cat >> $1/boot/grub/menu.lst << EOT 1.154 + 1.155 +title SliTaz GNU/Linux (Kernel $VERSION-slitaz) 1.156 +$grub_dev 1.157 +kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev 1.158 +EOT 1.159 + fi 1.160 + # Display information message. 1.161 + cat <<EOT 1.162 +---- 1.163 +GRUB is installed, these tree lines must be in your /boot/grub/menu.lst: 1.164 + 1.165 +title SliTaz GNU/Linux (Kernel $VERSION-slitaz) 1.166 +$grub_dev 1.167 +kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev 1.168 +---- 1.169 +EOT 1.170 + fi 1.171 +}