#!/bin/bash # # Copyright (C) 2008 Brian Brazil # # 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 # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # set -ex . config rm -rf $WORKINGDIR mkdir -p $WORKINGDIR cd $WORKINGDIR apt-get source linux-ubuntu-modules-2.6.24$VERSION apt-get --yes build-dep linux-ubuntu-modules-2.6.24$VERSION cd linux-ubuntu-modules-2.6.24-* function clean_kconfig { #$1 = filename $2 = things to remove perl -i -ne 'BEGIN{$p=1} if(/^config ('$2')$/){$p=0}elsif(/^(config|endmenu|source|endif)/){$p=1}; print if $p' $1 } # Remove non-free bits rm -f ubuntu/media/drm-poulsbo/mga_ucode.h rm -f ubuntu/media/drm-poulsbo/nv04_graph.c rm -f ubuntu/media/drm-poulsbo/nv10_graph.c rm -f ubuntu/media/drm-poulsbo/nv20_graph.c rm -f ubuntu/media/drm-poulsbo/nv30_graph.c rm -f ubuntu/media/drm-poulsbo/nv40_graph.c rm -f ubuntu/media/drm-poulsbo/r128_cce.c rm -f ubuntu/media/drm-poulsbo/radeon_cp.c sed -i 's#asihpi/##' ubuntu/sound/alsa-driver/pci/Makefile rm -f ubuntu/sound/alsa-driver/pci/asihpi/hpi4000.c sed -i 's#pdplus/##' ubuntu/sound/alsa-driver/pci/Makefile rm -f ubuntu/sound/alsa-driver/pci/pdplus/pdplus-pga-a.c rm -f ubuntu/sound/alsa-driver/pci/pdplus/pdplus-pga-d.c sed -i '/snd-sb16-csp.o/d' ubuntu/sound/alsa-kernel/isa/sb/Makefile rm -f ubuntu/sound/alsa-kernel/isa/sb/sb16_csp_codecs.h sed -i '/cs46xx\//d' ubuntu/sound/alsa-kernel/pci/Makefile rm -f ubuntu/sound/alsa-kernel/pci/cs46xx/cs46xx_image.h rm -rf ubuntu/sound/alsa-kernel/pci/cs46xx/imgs sed -i '/korg1212\//d' ubuntu/sound/alsa-kernel/pci/Makefile rm -f ubuntu/sound/alsa-kernel/pci/korg1212/korg1212-firmware.h clean_kconfig ubuntu/sound/alsa-kernel/pci/Kconfig 'SND_MAESTRO3.*' sed -i '/CONFIG_SND_MAESTRO3/d;' ubuntu/sound/alsa-kernel/pci/Makefile sed -i 's/maestro3\.c//;' ubuntu/sound/alsa-driver/pci/Makefile rm -f ubuntu/sound/alsa-kernel/pci/maestro3.c sed -i '/ymfpci\//d' ubuntu/sound/alsa-kernel/pci/Makefile rm -f ubuntu/sound/alsa-kernel/pci/ymfpci/ymfpci_image.h sed -i '/firmdir/d' debian/rules.d/2-binary-arch.mk sed -i 's/kernel-wedge check/true/' debian/rules.d/3-udebs.mk rm -rf ubuntu-firmware echo | dch -D $RELEASE -v $(sed -n '1s#^.*(\(.*\)).*#\1'${DISTRONAME_L}${LINUX_UBUNTU_MODULES_VERSION}'#p' debian/changelog) "Removed non-free code" dpkg-buildpackage -rfakeroot -us -uc