Index: gen-kernel =================================================================== --- gen-kernel (revision 221) +++ gen-kernel (working copy) @@ -1,6 +1,7 @@ #!/bin/bash # # Copyright (C) 2006 Brian Brazil +# Copyright (C) 2008 Robert Millan # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,14 +22,15 @@ . config -DEBLOB=$PWD/firmware/deblob-2.6.24.4.1 +DEBLOB=$PWD/firmware/deblob-2.6.26 rm -rf $WORKINGDIR mkdir -p $WORKINGDIR cd $WORKINGDIR -#apt-get source linux-image-2.6.15-$KERNEL_VERSIONPART-386$VERSION -apt-get source linux-image-2.6.24-$KERNEL_VERSIONPART-386 -apt-get --yes build-dep linux-image-2.6.24-$KERNEL_VERSIONPART-386 +apt-get update +apt-get --yes --no-install-recommends install unifdef +apt-get source linux-2.6 +apt-get --yes --no-install-recommends build-dep linux-2.6 function clean_kconfig { #$1 = filename $2 = things to remove @@ -38,9 +40,18 @@ # Remove non-free bits cd linux-*/ rm -rf debian/firmware/* + +# Upstream extraversion is shipped in the patchset, make sure deblob is run +# against the _patched_ tree. +(cd debian/patches/series/ && ls | sort -n) | while read i ; do + sed -e "s/^+ //g" debian/patches/series/$i | while read j ; do + patch -p1 < debian/patches/$j + done + rm -f debian/patches/series/$i +done bash -x $DEBLOB # deblob leaves tg3 broken - remove it -rm ./drivers/net/tg3.c +rm -f ./drivers/net/tg3.c clean_kconfig ./drivers/net/Kconfig 'TIGON3' sed -i '/tg3\.o/d' ./drivers/net/Makefile # Also broken by VIDEOBUF_DVB removal @@ -52,19 +63,33 @@ cd linux-*/ #Changes so it'll compile without some modules -for i in debian/d-i/modules/*; do +(shopt -s nullglob; for i in debian/d-i/modules/*; do sed -i 's/^\([[^ ?][^ ?]*\)$/\1 ?/' $i -done +done) #Changes so it'll compile without firmware #Need to go to previous revision for ABI stuff - long way of saying second last word -sed -i 's/^prev_revision :=.*$/prev_revision := $(word $(words $(wordlist 2,$(words $(prev_revisions)),$(prev_revisions))),$(prev_revisions))/' debian/rules.d/0-common-vars.mk -echo 'skipmodule = true' >> debian/rules.d/0-common-vars.mk # Having less modules is okay for us -sed -i '/\^-\[\^-\]/,/^fi/d' debian/scripts/abi-check # Having less symbols is okay for us +if test -e debian/rules.d/0-common-vars.mk ; then + sed -i 's/^prev_revision :=.*$/prev_revision := $(word $(words $(wordlist 2,$(words $(prev_revisions)),$(prev_revisions))),$(prev_revisions))/' debian/rules.d/0-common-vars.mk + echo 'skipmodule = true' >> debian/rules.d/0-common-vars.mk # Having less modules is okay for us +fi +if test -e debian/config/defines ; then + sed -i debian/config/defines -e "s/^\(abiname:\).*/\1 $((`sed -ne 's/^abiname: //p' debian/config/defines` + 1))/g" +fi +if test -e debian/scripts/abi-check ; then + sed -i '/\^-\[\^-\]/,/^fi/d' debian/scripts/abi-check # Having less symbols is okay for us +fi -# Xen hunk mismatches cause patches to *.orig not to apply -sed -i 's/\(patch -p1\)/\1 --no-backup-if-mismatch/' debian/rules.d/6-binary-custom.mk +if test -e debian/rules.d/6-binary-custom.mk ; then + # Xen hunk mismatches cause patches to *.orig not to apply + sed -i 's/\(patch -p1\)/\1 --no-backup-if-mismatch/' debian/rules.d/6-binary-custom.mk +fi echo | dch -D $RELEASE -v $(sed -n '1s#^.*(\(.*\)).*#\1'${DISTRONAME_L}${KERNEL_VERSION}'#p' debian/changelog) 'Removed firmware' -dpkg-buildpackage -rfakeroot -us -uc +# On the Debian version, dch triggers a debian/control update, which +# makes dpkg-buildpackage abort. Force it here. +test -f debian/rules +debian/rules debian/control-real || true + +dpkg-buildpackage -us -uc