make-grub2 2.43 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/bin/sh
#
#    Copyright (C) 2011  Rubén Rodríguez <ruben@trisquel.info>
#
#    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
#

20
VERSION=5
21 22 23 24
COMPONENT=main

. ./config

Ruben Rodriguez committed
25 26 27 28 29 30 31
apt-get remove -y --force-yes dosfstools
sed '/dosfstools/d' -i debian/control

for i in install_efi_ubuntu_flavours.patch mkconfig_ubuntu_distributor.patch; do
    rm debian/patches/$i
    sed /$i/d debian/patches/series -i
done
32

33 34 35
#Allow passwords https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1311302
sed '/^CLASS/s/class os/class os --unrestricted/' -i util/grub.d/10_linux.in

36 37 38
replace "with Linux" "with Linux-Libre" util
replace "with Linux" "with Linux-Libre" debian
replace "Linux" "Linux-Libre" po
Ruben Rodriguez committed
39 40 41
replace Ubuntu Trisquel .
replace ubuntu trisquel .
find |grep ubuntu|xargs rename s/ubuntu/trisquel/
42

43
#sed 's/\(prefix=@prefix@\)/\1\nGRUB_CMDLINE_EXTRA=$( grep -q nomodeset \/proc\/cmdline \&\& echo nomodeset \|\| echo -n "" )/' util/grub.d/10_linux.in -i
44 45 46 47 48 49 50

cat << EOF >> debian/default/grub

# Trisquel comes without kernel recovery entries to improve security.
GRUB_DISABLE_RECOVERY=true
EOF

51 52 53 54 55 56 57 58
GRUBVERSION=$(head -n1 debian/changelog |/bin/sed 's/.*(//;s/).*//; s/[~+-].*//')

echo $GRUBVERSION 
echo /bin/sed "/GNU GRUB  version/ s/PACKAGE_VERSION/\"$GRUBVERSION\"/" -i grub-core/normal/main.c
/bin/sed "/GNU GRUB  version/ s/PACKAGE_VERSION/\"$GRUBVERSION\"/" -i grub-core/normal/main.c

changelog "Disable rescue mode by default, branding"
#sed "s/-.*)/-${REVISION}trisquel${VERSION})/" -i debian/changelog
59

60 61 62
# Allow Windows and MacOX entries to boot without a password
sed 's/class osx/class osx --unrestricted/; s/class windows/class osx --unrestricted/;' -i ./util/grub.d/30_os-prober.in

63
#apt-get install -y --force-yes kvm-pxe
64
# /dev is needed for KVM support
65
#mount none -t devtmpfs /dev || true
66
compile
67
#umount /dev
68