grub2: upgrade and improve GRUB2 helper for ecne.

This commit is contained in:
Luis Guzmán 2024-11-10 06:42:46 +00:00
parent b6591de7ed
commit 193c89753f

View file

@ -2,7 +2,7 @@
# #
# Copyright (C) 2011-2017 Ruben Rodriguez <ruben@trisquel.info> # Copyright (C) 2011-2017 Ruben Rodriguez <ruben@trisquel.info>
# Copyright (C) 2019 Mason Hock <mason@masonhock.com> # Copyright (C) 2019 Mason Hock <mason@masonhock.com>
# Copyright (C) 2021 Luis Guzman <ark@switnet.org> # Copyright (C) 2024 Luis Guzman <ark@switnet.org>
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
VERSION=7 VERSION=8
COMPONENT=main COMPONENT=main
DEPENDS=base-files DEPENDS=base-files
@ -28,40 +28,46 @@ DEPENDS=base-files
# http://grub.johnlane.ie/ # http://grub.johnlane.ie/
## updated to 2.04-1 on https://aur.archlinux.org/packages/grub-luks-keyfile/ ## updated to 2.04-1 on https://aur.archlinux.org/packages/grub-luks-keyfile/
for i in $DATA/*.patch; do for i in $DATA/*.patch; do
echo Applying patch $i patch_p1 $i
patch --no-backup-if-mismatch -p1 < $i
done done
#apt-get remove -y --force-yes dosfstools # Remove patch renaming GNU/Linux as default distributor.
#sed '/dosfstools/d' -i debian/control remove_patch ubuntu-zfs-mkconfig-ubuntu-distributor.patch
sed '/mkfs.minix/s/-B $BLKSIZE//g' -i tests/util/grub-fs-tester.in
#remove_patch install-efi-ubuntu-flavours.patch # Allow passwords https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1311302
remove_patch mkconfig-ubuntu-distributor.patch for i in $(grep -rl 'CLASS="' util/grub.d/|grep -v 30_os-prober.in)
do
#Allow passwords https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1311302 echo "> Allow password with --unrestricted at: $i"
/bin/sed '/CLASS=/s/class os/class os --unrestricted/' -i util/grub.d/* debian/patches/mkconfig-other-inits.patch sed '/CLASS=/s/class os/class os --unrestricted/' -i $i
done
echo "> Allow password with --unrestricted at: util/grub.d/30_os-prober.in"
sed 's/--class os /--class os --unrestricted /' -i util/grub.d/30_os-prober.in
replace "with Linux" "with Linux-Libre" util replace "with Linux" "with Linux-Libre" util
replace "with Linux" "with Linux-Libre" debian replace "with Linux" "with Linux-Libre" debian
replace "Linux" "Linux-Libre" po replace "Linux" "Linux-Libre" po
replace Kubuntu Triskel .
replace kubuntu triskel .
replace Ubuntu Trisquel . replace Ubuntu Trisquel .
replace ubuntu trisquel . replace ubuntu trisquel .
find |grep ubuntu|xargs rename s/ubuntu/trisquel/ find . |grep ubuntu|xargs rename s/ubuntu/trisquel/
#Prevent "replace"ment break patches # Prevent "replace"ment break patches
sed -i '/^trisquel/s|-trisquel|-ubuntu|g' debian/patches/series sed -i '/^trisquel/s|-trisquel|-ubuntu|g' debian/patches/series
#Avoid the use of signed grub efi package # Avoid the use of signed grub efi package
sed -i '/Recommends:/s|grub-efi-amd64-signed|grub-efi-amd64|' debian/control sed -i '/Recommends:/s|grub-efi-amd64-signed|grub-efi-amd64|' debian/control
# Allow Windows and MacOX entries to boot without a password # 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 #sed 's/class osx/class osx --unrestricted/; s/class windows/class osx --unrestricted/;' -i ./util/grub.d/30_os-prober.in
sed -i '/set -e/aexit 77' tests/grub_cmd_set_date.in sed -i '/set -e/aexit 77' tests/grub_cmd_set_date.in
# Remove this change once building on a trisquel schroot # Apply in case not building on a Trisquel schroot
sed -i '/SB_EFI_VENDOR ?/s|=.*|= trisquel|' debian/rules if [ $(dpkg-vendor --query vendor) != "Trisquel" ]; then
sed -i '/DPKG_VENDOR ?/s|=.*|= Trisquel|' debian/rules
sed -i '/SB_EFI_VENDOR ?/s|=.*|= trisquel|' debian/rules
fi
changelog "skip test grub_cmd_set_date.in" changelog "skip test grub_cmd_set_date.in"