make-linux-lts-xenial 4.72 KB
Newer Older
1 2
#!/bin/sh
#
3
#    Copyright (C) 2008-2018  Ruben Rodriguez <ruben@trisquel.info>
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#
#    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
#


21
VERSION=2
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

. ./config

for PATCH in $DATA/*.patch ; do
  echo $PATCH
  patch -p1 < $PATCH
done

rm -rf /tmp/preserve
mkdir /tmp/preserve
PRESERVE=$(grep '^+++' $DATA/silent-accept-firmware.patch | /bin/sed 's/+++ //; s/\t.*//;' | cut -d/ -f2- | sort -u )
for FILE in $PRESERVE; do
  cp $FILE /tmp/preserve --parents -a
done

sh $DATA/deblob-4.4 --force
sed 's/bnx2.*fw/$(DEBLOBBED)/' -i firmware/Makefile

cp /tmp/preserve/* . -a

# Remove ZFS
rm zfs spl debian/scripts/misc/update-zfs.sh -rf
#sed '/zfs/d; /spl/d' -i debian.master/reconstruct
45
/bin/sed 's/spl-dkms, zfs-dkms//' -i debian/control debian.master/control.d/vars.generic debian.master/control.d/vars.*
46
/bin/sed '/^define build_zfs/,/^endef/d; /^define install_zfs/,/^endef/d; /zfs/d' -i debian/rules.d/2-binary-arch.mk
47 48
/bin/sed '/ifeq ($(do_zfs),false)/,/endif/d' -i debian/rules
/bin/sed  '/zfs/d' -i debian.master/rules.d/* debian.master/d-i/modules/fs-core-modules debian.master/control.d/generic.inclusion-list debian.master/abi/*/*/*.modules debian/rules debian.master/control.d/vars.*
49 50 51 52 53 54

# Remove VBox
rm ubuntu/vbox* -rf
sed /vbox/d -i debian.master/info/RECONCILE debian.master/control.d/generic.inclusion-list ubuntu/Makefile debian.xenial/control.d/generic.inclusion-list
sed '/vbox/d' -i debian.master/reconstruct

55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
# The upstream release number for abi is on line 7 of the trisquel changelog, not 1.
#sed '/^release :=/s/1s/7s/' debian/rules.d/0-common-vars.mk -i
# For abi calculation, start counting from the previous release (upstream)
sed '/^revisions :=/ s/tac/tail -n +3 | tac/' debian/rules.d/0-common-vars.mk -i
# But keep the trisquel version number for $revision
rpl 'revision ?= $(word $(words $(revisions)),$(revisions))' 'revision := $(shell sed -n "1 s/^$(src_pkg_name)\ .*($(release)-\(.*\)).*$$/\1/p" $(DEBIAN)/changelog)' debian/rules.d/0-common-vars.mk

# Ignore the missing modules we remove
cat << EOF > debian.master/abi/$(ls debian.master/abi/ -1)/modules.ignore
spl
splat
vboxguest
vboxsf
vboxvideo
zavl
zcommon
znvpair
zpios
zunicode
EOF
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97

line=$(grep -n ')-Ubuntu' debian/rules.d/0-common-vars.mk|cut -d: -f1)
sed $(expr $line - 1 ),$(expr $line + 1 )d debian/rules.d/0-common-vars.mk -i
sed s/family=ubuntu/family=trisquel/ -i debian/rules.d/0-common-vars.mk

rename s/ubuntu/trisquel/ debian.*/config/config.common.ubuntu 

find debian* -type f -name *control* -exec sed 's/ with Ubuntu patches//; s/Linux/Linux-libre/g' -i {} \;

# Descriptions should not change based on the build arch
sed 's/on DESC//; s/PKGVER on/PKGVER/; /^ DESC.$/d;' debian*/control.d/flavour-control.stub -i

sed '/^firmware/d' ./debian*/abi/*/fwinfo -i
echo > ./debian.master/d-i/firmware/nic-modules
echo > ./debian.master/d-i/firmware/scsi-modules
echo > ./debian.xenial/d-i/firmware/nic-modules
echo > ./debian.xenial/d-i/firmware/scsi-modules

# Use BFQ scheduler in lowlatency kernels
tee -a debian.xenial/config/config.common.trisquel << EOF >> debian.master/config/config.common.trisquel
CONFIG_IOSCHED_BFQ=y
CONFIG_CGROUP_BFQIO=y
CONFIG_BFQ_GROUP_IOSCHED=y
98
# CONFIG_DEFAULT_BFQ is not set
99 100 101
EOF
cat << EOF >> debian.master/config/i386/config.flavour.lowlatency
CONFIG_DEFAULT_BFQ=y
102 103 104 105 106
CONFIG_DEFAULT_IOSCHED="bfq"
EOF
cat << EOF >> debian.master/config/amd64/config.flavour.lowlatency
CONFIG_DEFAULT_BFQ=y
CONFIG_DEFAULT_IOSCHED="bfq"
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
EOF
cp debian.master/config/i386/config.flavour.lowlatency debian.master/config/amd64/config.flavour.lowlatency
cp debian.master/config/i386/config.flavour.lowlatency debian.xenial/config/i386/config.flavour.lowlatency
cp debian.xenial/config/i386/config.flavour.lowlatency debian.xenial/config/amd64/config.flavour.lowlatency

# Disable using udev as a fallback for firmware loading
replace "CONFIG_FW_LOADER_USER_HELPER=y" "CONFIG_FW_LOADER_USER_HELPER=n" debian.master/config
replace "CONFIG_FW_LOADER_USER_HELPER=y" "CONFIG_FW_LOADER_USER_HELPER=n" debian.xenial/config

changelog "Removed non-free bits"

cp debian/changelog debian.master/changelog
cp debian/changelog debian.xenial/changelog

compile