wok-next diff linux64/receipt @ rev 18828

cloop: deduplicate support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jan 17 14:10:13 2016 +0100 (2016-01-17)
parents 9e01bc6321ea
children 119e586fb823
line diff
     1.1 --- a/linux64/receipt	Sun Dec 20 15:13:45 2015 +0100
     1.2 +++ b/linux64/receipt	Sun Jan 17 14:10:13 2016 +0100
     1.3 @@ -18,55 +18,53 @@
     1.4  # Rules to gen a SliTaz package suitable for Tazpkg.
     1.5  genpkg_rules()
     1.6  {
     1.7 -    local path
     1.8 -    install=$install/linux64
     1.9 -    src=$WOK/$PACKAGE/source/tmp
    1.10 -    cp -a $install/boot $fs
    1.11 -    path=$fs/lib/modules/$VERSION-slitaz64/kernel
    1.12 -    mkdir -p $path
    1.13 -    cp -a $install/lib/modules/$VERSION-slitaz64/mo* \
    1.14 +	local path
    1.15 +	install=$install/linux64
    1.16 +	src=$WOK/$PACKAGE/source/tmp
    1.17 +	cp -a $install/boot $fs
    1.18 +	path=$fs/lib/modules/$VERSION-slitaz64/kernel
    1.19 +	mkdir -p $path
    1.20 +	cp -a $install/lib/modules/$VERSION-slitaz64/mo* \
    1.21  		$fs/lib/modules/$VERSION-slitaz64
    1.22  
    1.23 -    # Get the base modules
    1.24 -    export src
    1.25 -    export install
    1.26 -    mkdir -p $WOK/$PACKAGE/source/tmp
    1.27 -    $wanted_stuff/list_modules.sh \
    1.28 +	# Get the base modules
    1.29 +	export src
    1.30 +	export install
    1.31 +	mkdir -p $WOK/$PACKAGE/source/tmp
    1.32 +	$wanted_stuff/list_modules.sh \
    1.33  	$(cat $stuff/modules64.list) > $WOK/$PACKAGE/source/tmp/modules.list
    1.34 -    while read module; do
    1.35 -    	dir=$(dirname $module)
    1.36 -    	[ -d $path/$dir ] || mkdir -p $path/$dir
    1.37 -        cp -a $install/lib/modules/$VERSION-slitaz64/kernel/$module $path/$dir
    1.38 -    done < $WOK/$PACKAGE/source/tmp/modules.list
    1.39 -    # Remove unresolved links
    1.40 -    rm -f $fs/lib/modules/$VERSION-slitaz64/build
    1.41 -    rm -f $fs/lib/modules/$VERSION-slitaz64/source
    1.42 -    # Cook all packages with a kernel module
    1.43 -    for i in $(cd $WOK; grep -l 'cook linux64$' */receipt)
    1.44 -    do
    1.45 -    	echo cook ${i%/receipt}
    1.46 -    done
    1.47 -    # Fixed modules.dep to use right path
    1.48 -    # saves 100kb of space too
    1.49 -    sed -i "s|$install||g" $fs/lib/modules/$VERSION-slitaz64/modules.dep
    1.50 -    sed -i "s|99.98.$VERSION-slitaz|$VERSION-slitaz|g" $fs/lib/modules/$VERSION-slitaz64/modules.dep
    1.51 -    # Check and echo any module in kernel .config that's not added to 
    1.52 -    # one of linux-* pkgs
    1.53 +	while read module; do
    1.54 +		dir=$(dirname $module)
    1.55 +		[ -d $path/$dir ] || mkdir -p $path/$dir
    1.56 +		cp -a $install/lib/modules/$VERSION-slitaz64/kernel/$module $path/$dir
    1.57 +	done < $WOK/$PACKAGE/source/tmp/modules.list
    1.58 +	# Remove unresolved links
    1.59 +	rm -f $fs/lib/modules/$VERSION-slitaz64/build
    1.60 +	rm -f $fs/lib/modules/$VERSION-slitaz64/source
    1.61 +	# Cook all packages with a kernel module
    1.62 +	for i in $(cd $WOK; grep -l 'cook linux64$' */receipt); do
    1.63 +		echo cook ${i%/receipt}
    1.64 +	done
    1.65 +	# Fixed modules.dep to use right path
    1.66 +	# saves 100kb of space too
    1.67 +	sed -i "s|$install||g" $fs/lib/modules/$VERSION-slitaz64/modules.dep
    1.68 +	sed -i "s|99.98.$VERSION-slitaz|$VERSION-slitaz|g" $fs/lib/modules/$VERSION-slitaz64/modules.dep
    1.69 +	# Check and echo any module in kernel .config that's not added to 
    1.70 +	# one of linux-* pkgs
    1.71  	$wanted_stuff/check_modules.sh 2>&1 | grep -v files.list
    1.72  }
    1.73  
    1.74  # Pre and post install commands for Tazpkg.
    1.75  post_install()
    1.76  {
    1.77 -    echo "Processing post-install commands..."
    1.78 -    chroot "$root/" depmod -a $VERSION-slitaz64
    1.79 -    # GRUB stuff.
    1.80 -    if [ -f "$root/boot/grub/menu.lst" ]; then
    1.81 -    	root_dev=$(cat $root/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1)
    1.82 +	chroot "$root/" depmod -a $VERSION-slitaz64
    1.83 +	# GRUB stuff.
    1.84 +	if [ -f "$root/boot/grub/menu.lst" ]; then
    1.85 +		root_dev=$(cat $root/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1)
    1.86  		grub_dev=$(cat $root/boot/grub/menu.lst | grep "root (" | head -n 1)
    1.87  		# Add new kernel entry in case of upgrade for installed system.
    1.88  		if ! grep -q $PACKAGE-$VERSION-slitaz64 "$1/boot/grub/menu.lst"; then
    1.89 -    		cat >> "$1/boot/grub/menu.lst" << EOT
    1.90 +			cat >> "$1/boot/grub/menu.lst" <<EOT
    1.91  
    1.92  title SliTaz GNU/Linux (Kernel $VERSION-slitaz64)
    1.93  $grub_dev
    1.94 @@ -74,7 +72,7 @@
    1.95  EOT
    1.96  		fi
    1.97  		# Display information message.
    1.98 -    	cat <<EOT
    1.99 +		cat <<EOT
   1.100  ----
   1.101  GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
   1.102