this is the first version that support booting linux kernel on riscv. The release of the final version was delayed again and again so i have bootstrapped the rc1 from the git and fixed the path in 25_bli.
Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org --- config/flash-images/grub/11_linux_scon | 139 ++++++++++++------ config/rootfiles/common/aarch64/grub | 64 +------- config/rootfiles/common/riscv64/grub | 64 +------- config/rootfiles/common/x86_64/grub | 70 ++------- lfs/grub | 8 +- .../grub-2.12-rc1-fix_bli_bin_sh_path.patch | 9 ++ .../grub-Handle-R_RISCV_CALL_PLT-reloc.patch | 48 ------ .../grub/grub-Use-zifencei-on-riscv.patch | 47 ------ 8 files changed, 136 insertions(+), 313 deletions(-) create mode 100644 src/patches/grub/grub-2.12-rc1-fix_bli_bin_sh_path.patch delete mode 100644 src/patches/grub/grub-Handle-R_RISCV_CALL_PLT-reloc.patch delete mode 100644 src/patches/grub/grub-Use-zifencei-on-riscv.patch
diff --git a/config/flash-images/grub/11_linux_scon b/config/flash-images/grub/11_linux_scon index 68f554386..e49c857a3 100755 --- a/config/flash-images/grub/11_linux_scon +++ b/config/flash-images/grub/11_linux_scon @@ -18,10 +18,10 @@ set -e # along with GRUB. If not, see http://www.gnu.org/licenses/.
prefix="/usr" -exec_prefix="${prefix}" -datarootdir="${prefix}/share" +exec_prefix="/usr" +datarootdir="/usr/share"
-. "${datarootdir}/grub/grub-mkconfig_lib" +. "$pkgdatadir/grub-mkconfig_lib"
export TEXTDOMAIN=grub export TEXTDOMAINDIR="${datarootdir}/locale" @@ -32,7 +32,7 @@ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then OS=GNU/Linux else OS="${GRUB_DISTRIBUTOR} GNU/Linux" - CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}" + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" fi
# loop-AES arranges things so that /dev/loop/X can be our root device, but @@ -43,21 +43,29 @@ case ${GRUB_DEVICE} in ;; esac
-if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ - || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ - || uses_abstraction "${GRUB_DEVICE}" lvm; then +: ${GRUB_CMDLINE_LINUX_RECOVERY:=single} + +# Default to disabling partition uuid support to maintian compatibility with +# older kernels. +: ${GRUB_DISABLE_LINUX_PARTUUID=true} + +# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter +# and mounting btrfs requires user space scanning, so force UUID in this case. +if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] ) \ + || ( [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ + && [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ] ) \ + || ( ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ + && ! test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}" ) \ + || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then LINUX_ROOT_DEVICE=${GRUB_DEVICE} +elif [ "x${GRUB_DEVICE_UUID}" = "x" ] \ + || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ]; then + LINUX_ROOT_DEVICE=PARTUUID=${GRUB_DEVICE_PARTUUID} else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} fi
-GRUBFS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" - -if [ x"$GRUBFS" = x ]; then - GRUBFS="$(stat -f --printf=%T / || true)" -fi - -case x"$GRUBFS" in +case x"$GRUB_FS" in xbtrfs) rootsubvol="`make_system_path_relative_to_its_root /`" rootsubvol="${rootsubvol#/}" @@ -67,7 +75,7 @@ case x"$GRUBFS" in xzfs) rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`" - LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}" + LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}" ;; esac
@@ -101,7 +109,7 @@ linux_entry () echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} $menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" fi if [ x$type != xrecovery ] ; then - save_default_entry | sed -e "s/^/\t/" + save_default_entry | grub_add_tab fi
# Use ELILO's generic "efifb" when it's known to be available. @@ -123,26 +131,30 @@ linux_entry ()
if [ x$dirname = x/ ]; then if [ -z "${prepare_root_cache}" ]; then - prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/")" + prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | grub_add_tab)" fi printf '%s\n' "${prepare_root_cache}" | sed "s/^/$submenu_indentation/" else if [ -z "${prepare_boot_cache}" ]; then - prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" + prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)" fi printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" fi message="$(gettext_printf "Loading Linux %s ..." ${version})" sed "s/^/$submenu_indentation/" << EOF - echo '$message' + echo '$(echo "$message" | grub_quote)' linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} EOF if test -n "${initrd}" ; then # TRANSLATORS: ramdisk isn't identifier. Should be translated. message="$(gettext_printf "Loading initial ramdisk ...")" + initrd_path= + for i in ${initrd}; do + initrd_path="${initrd_path} ${rel_dirname}/${i}" + done sed "s/^/$submenu_indentation/" << EOF - echo '$message' - initrd ${rel_dirname}/${initrd} + echo '$(echo "$message" | grub_quote)' + initrd $(echo $initrd_path) EOF fi sed "s/^/$submenu_indentation/" << EOF @@ -153,13 +165,15 @@ EOF machine=`uname -m` case "x$machine" in xi?86 | xx86_64) - list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do - if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi - done` ;; + list= + for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do + if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi + done ;; *) - list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do - if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi - done` ;; + list= + for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do + if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi + done ;; esac
case "$machine" in @@ -179,9 +193,19 @@ title_correction_code= # yet, so it's empty. In a submenu it will be equal to '\t' (one tab). submenu_indentation=""
-is_first_entry=true -while [ "x$list" != "x" ] ; do - linux=`version_find_latest $list` +# Perform a reverse version sort on the entire list. +# Temporarily replace the '.old' suffix by ' 1' and append ' 2' for all +# other files to order the '.old' files after their non-old counterpart +# in reverse-sorted order. + +reverse_sorted_list=$(echo $list | tr ' ' '\n' | sed -e 's/.old$/ 1/; / 1$/! s/$/ 2/' | version_sort -r | sed -e 's/ 1$/.old/; s/ 2$//') + +if [ "x$GRUB_TOP_LEVEL" != x ]; then + reverse_sorted_list=$(grub_move_to_front "$GRUB_TOP_LEVEL" ${reverse_sorted_list}) +fi + +is_top_level=true +for linux in ${reverse_sorted_list}; do gettext_printf "Found linux image: %s\n" "$linux" >&2 basename=`basename $linux` dirname=`dirname $linux` @@ -190,9 +214,19 @@ while [ "x$list" != "x" ] ; do alt_version=`echo $version | sed -e "s,.old$,,g"` linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
- initrd= - for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \ - "initrd-${version}" "initramfs-${version}.img" \ + initrd_early= + for i in ${GRUB_EARLY_INITRD_LINUX_STOCK} \ + ${GRUB_EARLY_INITRD_LINUX_CUSTOM}; do + if test -e "${dirname}/${i}" ; then + initrd_early="${initrd_early} ${i}" + fi + done + + initrd_real= + for i in "initrd.img-${version}" "initrd-${version}.img" \ + "initrd-${alt_version}.img.old" "initrd-${version}.gz" \ + "initrd-${alt_version}.gz.old" "initrd-${version}" \ + "initramfs-${version}.img" "initramfs-${alt_version}.img.old" \ "initrd.img-${alt_version}" "initrd-${alt_version}.img" \ "initrd-${alt_version}" "initramfs-${alt_version}.img" \ "initramfs-genkernel-${version}" \ @@ -200,11 +234,22 @@ while [ "x$list" != "x" ] ; do "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do if test -e "${dirname}/${i}" ; then - initrd="$i" + initrd_real="${i}" break fi done
+ initrd= + if test -n "${initrd_early}" || test -n "${initrd_real}"; then + initrd="${initrd_early} ${initrd_real}" + + initrd_display= + for i in ${initrd}; do + initrd_display="${initrd_display} ${dirname}/${i}" + done + gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2 + fi + config= for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do if test -e "${i}" ; then @@ -218,26 +263,36 @@ while [ "x$list" != "x" ] ; do initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr -d "` fi
- if test -n "${initrd}" ; then - gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 - elif test -z "${initramfs}" ; then + if test -z "${initramfs}" && test -z "${initrd_real}" ; then # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs. Since there's # no initrd or builtin initramfs, it can't work here. - linux_root_device_thisversion=${GRUB_DEVICE} + if [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] \ + || [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ]; then + + linux_root_device_thisversion=${GRUB_DEVICE} + else + linux_root_device_thisversion=PARTUUID=${GRUB_DEVICE_PARTUUID} + fi fi
- if [ "x$is_first_entry" = xtrue ]; then + # The GRUB_DISABLE_SUBMENU option used to be different than others since it was + # mentioned in the documentation that has to be set to 'y' instead of 'true' to + # enable it. This caused a lot of confusion to users that set the option to 'y', + # 'yes' or 'true'. This was fixed but all of these values must be supported now. + if [ "x${GRUB_DISABLE_SUBMENU}" = xyes ] || [ "x${GRUB_DISABLE_SUBMENU}" = xy ]; then + GRUB_DISABLE_SUBMENU="true" + fi + + if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xtrue ]; then linux_entry "Serial Console: ${OS}" "${version}" serial \ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} console=ttyS0,115200n8"
- submenu_indentation="\t" + submenu_indentation="$grub_tab"
if [ -z "$boot_device_id" ]; then boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" fi fi - - list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` done
echo "$title_correction_code" diff --git a/config/rootfiles/common/aarch64/grub b/config/rootfiles/common/aarch64/grub index af297b774..ddacba511 100644 --- a/config/rootfiles/common/aarch64/grub +++ b/config/rootfiles/common/aarch64/grub @@ -9,6 +9,7 @@ etc/grub.d/00_cloud etc/grub.d/00_header etc/grub.d/10_linux etc/grub.d/20_linux_xen +etc/grub.d/25_bli etc/grub.d/30_os-prober etc/grub.d/30_uefi-firmware etc/grub.d/40_custom @@ -53,6 +54,8 @@ usr/lib/grub/arm64-efi/bitmap.mod usr/lib/grub/arm64-efi/bitmap.module usr/lib/grub/arm64-efi/bitmap_scale.mod usr/lib/grub/arm64-efi/bitmap_scale.module +usr/lib/grub/arm64-efi/bli.mod +usr/lib/grub/arm64-efi/bli.module usr/lib/grub/arm64-efi/blocklist.mod usr/lib/grub/arm64-efi/blocklist.module usr/lib/grub/arm64-efi/boot.mod @@ -116,6 +119,8 @@ usr/lib/grub/arm64-efi/efifwsetup.mod usr/lib/grub/arm64-efi/efifwsetup.module usr/lib/grub/arm64-efi/efinet.mod usr/lib/grub/arm64-efi/efinet.module +usr/lib/grub/arm64-efi/efitextmode.mod +usr/lib/grub/arm64-efi/efitextmode.module usr/lib/grub/arm64-efi/elf.mod usr/lib/grub/arm64-efi/elf.module usr/lib/grub/arm64-efi/eval.mod @@ -189,6 +194,7 @@ usr/lib/grub/arm64-efi/gcry_twofish.module usr/lib/grub/arm64-efi/gcry_whirlpool.mod usr/lib/grub/arm64-efi/gcry_whirlpool.module usr/lib/grub/arm64-efi/gdb_grub +usr/lib/grub/arm64-efi/gdb_helper.py usr/lib/grub/arm64-efi/geli.mod usr/lib/grub/arm64-efi/geli.module usr/lib/grub/arm64-efi/gettext.mod @@ -201,7 +207,6 @@ usr/lib/grub/arm64-efi/gfxterm_background.mod usr/lib/grub/arm64-efi/gfxterm_background.module usr/lib/grub/arm64-efi/gfxterm_menu.mod usr/lib/grub/arm64-efi/gfxterm_menu.module -usr/lib/grub/arm64-efi/gmodule.pl usr/lib/grub/arm64-efi/gptsync.mod usr/lib/grub/arm64-efi/gptsync.module usr/lib/grub/arm64-efi/gzio.mod @@ -356,6 +361,8 @@ usr/lib/grub/arm64-efi/pbkdf2_test.mod usr/lib/grub/arm64-efi/pbkdf2_test.module usr/lib/grub/arm64-efi/pgp.mod usr/lib/grub/arm64-efi/pgp.module +usr/lib/grub/arm64-efi/plainmount.mod +usr/lib/grub/arm64-efi/plainmount.module usr/lib/grub/arm64-efi/png.mod usr/lib/grub/arm64-efi/png.module usr/lib/grub/arm64-efi/priority_queue.mod @@ -502,61 +509,6 @@ usr/share/grub/unicode.pf2 #usr/share/info/grub.info #usr/share/info/grub.info-1 #usr/share/info/grub.info-2 -#usr/share/locale/ast/LC_MESSAGES/grub.mo -#usr/share/locale/ca/LC_MESSAGES/grub.mo -#usr/share/locale/da/LC_MESSAGES/grub.mo -#usr/share/locale/de/LC_MESSAGES/grub.mo -#usr/share/locale/de@hebrew -#usr/share/locale/de@hebrew/LC_MESSAGES -#usr/share/locale/de@hebrew/LC_MESSAGES/grub.mo -#usr/share/locale/de_CH -#usr/share/locale/de_CH/LC_MESSAGES -#usr/share/locale/de_CH/LC_MESSAGES/grub.mo -#usr/share/locale/en@arabic -#usr/share/locale/en@arabic/LC_MESSAGES -#usr/share/locale/en@arabic/LC_MESSAGES/grub.mo -#usr/share/locale/en@cyrillic -#usr/share/locale/en@cyrillic/LC_MESSAGES -#usr/share/locale/en@cyrillic/LC_MESSAGES/grub.mo -#usr/share/locale/en@greek -#usr/share/locale/en@greek/LC_MESSAGES -#usr/share/locale/en@greek/LC_MESSAGES/grub.mo -#usr/share/locale/en@hebrew -#usr/share/locale/en@hebrew/LC_MESSAGES -#usr/share/locale/en@hebrew/LC_MESSAGES/grub.mo -#usr/share/locale/en@piglatin -#usr/share/locale/en@piglatin/LC_MESSAGES -#usr/share/locale/en@piglatin/LC_MESSAGES/grub.mo -#usr/share/locale/en@quot/LC_MESSAGES/grub.mo -#usr/share/locale/eo/LC_MESSAGES/grub.mo -#usr/share/locale/es/LC_MESSAGES/grub.mo -#usr/share/locale/fi/LC_MESSAGES/grub.mo -#usr/share/locale/fr/LC_MESSAGES/grub.mo -#usr/share/locale/gl/LC_MESSAGES/grub.mo -#usr/share/locale/hr/LC_MESSAGES/grub.mo -#usr/share/locale/hu/LC_MESSAGES/grub.mo -#usr/share/locale/id/LC_MESSAGES/grub.mo -#usr/share/locale/it/LC_MESSAGES/grub.mo -#usr/share/locale/ja/LC_MESSAGES/grub.mo -#usr/share/locale/ko/LC_MESSAGES/grub.mo -#usr/share/locale/lg/LC_MESSAGES/grub.mo -#usr/share/locale/lt/LC_MESSAGES/grub.mo -#usr/share/locale/nb/LC_MESSAGES/grub.mo -#usr/share/locale/nl/LC_MESSAGES/grub.mo -#usr/share/locale/pa/LC_MESSAGES/grub.mo -#usr/share/locale/pl/LC_MESSAGES/grub.mo -#usr/share/locale/pt/LC_MESSAGES/grub.mo -#usr/share/locale/pt_BR/LC_MESSAGES/grub.mo -#usr/share/locale/ro/LC_MESSAGES/grub.mo -#usr/share/locale/ru/LC_MESSAGES/grub.mo -#usr/share/locale/sl/LC_MESSAGES/grub.mo -#usr/share/locale/sr/LC_MESSAGES/grub.mo -#usr/share/locale/sv/LC_MESSAGES/grub.mo -#usr/share/locale/tr/LC_MESSAGES/grub.mo -#usr/share/locale/uk/LC_MESSAGES/grub.mo -#usr/share/locale/vi/LC_MESSAGES/grub.mo -#usr/share/locale/zh_CN/LC_MESSAGES/grub.mo -#usr/share/locale/zh_TW/LC_MESSAGES/grub.mo #usr/share/man/man1/grub-editenv.1 #usr/share/man/man1/grub-file.1 #usr/share/man/man1/grub-fstest.1 diff --git a/config/rootfiles/common/riscv64/grub b/config/rootfiles/common/riscv64/grub index be2fed0a5..ca262f7d0 100644 --- a/config/rootfiles/common/riscv64/grub +++ b/config/rootfiles/common/riscv64/grub @@ -9,6 +9,7 @@ etc/grub.d/00_cloud etc/grub.d/00_header etc/grub.d/10_linux etc/grub.d/20_linux_xen +etc/grub.d/25_bli etc/grub.d/30_os-prober etc/grub.d/30_uefi-firmware etc/grub.d/40_custom @@ -53,6 +54,8 @@ usr/lib/grub/riscv64-efi/bitmap.mod usr/lib/grub/riscv64-efi/bitmap.module usr/lib/grub/riscv64-efi/bitmap_scale.mod usr/lib/grub/riscv64-efi/bitmap_scale.module +usr/lib/grub/riscv64-efi/bli.mod +usr/lib/grub/riscv64-efi/bli.module usr/lib/grub/riscv64-efi/blocklist.mod usr/lib/grub/riscv64-efi/blocklist.module usr/lib/grub/riscv64-efi/boot.mod @@ -116,6 +119,8 @@ usr/lib/grub/riscv64-efi/efifwsetup.mod usr/lib/grub/riscv64-efi/efifwsetup.module usr/lib/grub/riscv64-efi/efinet.mod usr/lib/grub/riscv64-efi/efinet.module +usr/lib/grub/riscv64-efi/efitextmode.mod +usr/lib/grub/riscv64-efi/efitextmode.module usr/lib/grub/riscv64-efi/elf.mod usr/lib/grub/riscv64-efi/elf.module usr/lib/grub/riscv64-efi/eval.mod @@ -189,6 +194,7 @@ usr/lib/grub/riscv64-efi/gcry_twofish.module usr/lib/grub/riscv64-efi/gcry_whirlpool.mod usr/lib/grub/riscv64-efi/gcry_whirlpool.module usr/lib/grub/riscv64-efi/gdb_grub +usr/lib/grub/riscv64-efi/gdb_helper.py usr/lib/grub/riscv64-efi/geli.mod usr/lib/grub/riscv64-efi/geli.module usr/lib/grub/riscv64-efi/gettext.mod @@ -201,7 +207,6 @@ usr/lib/grub/riscv64-efi/gfxterm_background.mod usr/lib/grub/riscv64-efi/gfxterm_background.module usr/lib/grub/riscv64-efi/gfxterm_menu.mod usr/lib/grub/riscv64-efi/gfxterm_menu.module -usr/lib/grub/riscv64-efi/gmodule.pl usr/lib/grub/riscv64-efi/gptsync.mod usr/lib/grub/riscv64-efi/gptsync.module usr/lib/grub/riscv64-efi/gzio.mod @@ -356,6 +361,8 @@ usr/lib/grub/riscv64-efi/pbkdf2_test.mod usr/lib/grub/riscv64-efi/pbkdf2_test.module usr/lib/grub/riscv64-efi/pgp.mod usr/lib/grub/riscv64-efi/pgp.module +usr/lib/grub/riscv64-efi/plainmount.mod +usr/lib/grub/riscv64-efi/plainmount.module usr/lib/grub/riscv64-efi/png.mod usr/lib/grub/riscv64-efi/png.module usr/lib/grub/riscv64-efi/priority_queue.mod @@ -500,61 +507,6 @@ usr/share/grub/unicode.pf2 #usr/share/info/grub.info #usr/share/info/grub.info-1 #usr/share/info/grub.info-2 -#usr/share/locale/ast/LC_MESSAGES/grub.mo -#usr/share/locale/ca/LC_MESSAGES/grub.mo -#usr/share/locale/da/LC_MESSAGES/grub.mo -#usr/share/locale/de/LC_MESSAGES/grub.mo -#usr/share/locale/de@hebrew -#usr/share/locale/de@hebrew/LC_MESSAGES -#usr/share/locale/de@hebrew/LC_MESSAGES/grub.mo -#usr/share/locale/de_CH -#usr/share/locale/de_CH/LC_MESSAGES -#usr/share/locale/de_CH/LC_MESSAGES/grub.mo -#usr/share/locale/en@arabic -#usr/share/locale/en@arabic/LC_MESSAGES -#usr/share/locale/en@arabic/LC_MESSAGES/grub.mo -#usr/share/locale/en@cyrillic -#usr/share/locale/en@cyrillic/LC_MESSAGES -#usr/share/locale/en@cyrillic/LC_MESSAGES/grub.mo -#usr/share/locale/en@greek -#usr/share/locale/en@greek/LC_MESSAGES -#usr/share/locale/en@greek/LC_MESSAGES/grub.mo -#usr/share/locale/en@hebrew -#usr/share/locale/en@hebrew/LC_MESSAGES -#usr/share/locale/en@hebrew/LC_MESSAGES/grub.mo -#usr/share/locale/en@piglatin -#usr/share/locale/en@piglatin/LC_MESSAGES -#usr/share/locale/en@piglatin/LC_MESSAGES/grub.mo -#usr/share/locale/en@quot/LC_MESSAGES/grub.mo -#usr/share/locale/eo/LC_MESSAGES/grub.mo -#usr/share/locale/es/LC_MESSAGES/grub.mo -#usr/share/locale/fi/LC_MESSAGES/grub.mo -#usr/share/locale/fr/LC_MESSAGES/grub.mo -#usr/share/locale/gl/LC_MESSAGES/grub.mo -#usr/share/locale/hr/LC_MESSAGES/grub.mo -#usr/share/locale/hu/LC_MESSAGES/grub.mo -#usr/share/locale/id/LC_MESSAGES/grub.mo -#usr/share/locale/it/LC_MESSAGES/grub.mo -#usr/share/locale/ja/LC_MESSAGES/grub.mo -#usr/share/locale/ko/LC_MESSAGES/grub.mo -#usr/share/locale/lg/LC_MESSAGES/grub.mo -#usr/share/locale/lt/LC_MESSAGES/grub.mo -#usr/share/locale/nb/LC_MESSAGES/grub.mo -#usr/share/locale/nl/LC_MESSAGES/grub.mo -#usr/share/locale/pa/LC_MESSAGES/grub.mo -#usr/share/locale/pl/LC_MESSAGES/grub.mo -#usr/share/locale/pt/LC_MESSAGES/grub.mo -#usr/share/locale/pt_BR/LC_MESSAGES/grub.mo -#usr/share/locale/ro/LC_MESSAGES/grub.mo -#usr/share/locale/ru/LC_MESSAGES/grub.mo -#usr/share/locale/sl/LC_MESSAGES/grub.mo -#usr/share/locale/sr/LC_MESSAGES/grub.mo -#usr/share/locale/sv/LC_MESSAGES/grub.mo -#usr/share/locale/tr/LC_MESSAGES/grub.mo -#usr/share/locale/uk/LC_MESSAGES/grub.mo -#usr/share/locale/vi/LC_MESSAGES/grub.mo -#usr/share/locale/zh_CN/LC_MESSAGES/grub.mo -#usr/share/locale/zh_TW/LC_MESSAGES/grub.mo #usr/share/man/man1/grub-editenv.1 #usr/share/man/man1/grub-file.1 #usr/share/man/man1/grub-fstest.1 diff --git a/config/rootfiles/common/x86_64/grub b/config/rootfiles/common/x86_64/grub index 737fa8ccb..665c0e223 100644 --- a/config/rootfiles/common/x86_64/grub +++ b/config/rootfiles/common/x86_64/grub @@ -10,6 +10,7 @@ etc/grub.d/00_cloud etc/grub.d/00_header etc/grub.d/10_linux etc/grub.d/20_linux_xen +etc/grub.d/25_bli etc/grub.d/30_os-prober etc/grub.d/30_uefi-firmware etc/grub.d/40_custom @@ -230,6 +231,7 @@ usr/lib/grub/i386-pc/gcry_whirlpool.module usr/lib/grub/i386-pc/gdb.mod usr/lib/grub/i386-pc/gdb.module usr/lib/grub/i386-pc/gdb_grub +usr/lib/grub/i386-pc/gdb_helper.py usr/lib/grub/i386-pc/geli.mod usr/lib/grub/i386-pc/geli.module usr/lib/grub/i386-pc/gettext.mod @@ -242,7 +244,6 @@ usr/lib/grub/i386-pc/gfxterm_background.mod usr/lib/grub/i386-pc/gfxterm_background.module usr/lib/grub/i386-pc/gfxterm_menu.mod usr/lib/grub/i386-pc/gfxterm_menu.module -usr/lib/grub/i386-pc/gmodule.pl usr/lib/grub/i386-pc/gptsync.mod usr/lib/grub/i386-pc/gptsync.module usr/lib/grub/i386-pc/gzio.mod @@ -429,6 +430,8 @@ usr/lib/grub/i386-pc/pcidump.mod usr/lib/grub/i386-pc/pcidump.module usr/lib/grub/i386-pc/pgp.mod usr/lib/grub/i386-pc/pgp.module +usr/lib/grub/i386-pc/plainmount.mod +usr/lib/grub/i386-pc/plainmount.module usr/lib/grub/i386-pc/plan9.mod usr/lib/grub/i386-pc/plan9.module usr/lib/grub/i386-pc/play.mod @@ -640,6 +643,8 @@ usr/lib/grub/x86_64-efi/bitmap.mod usr/lib/grub/x86_64-efi/bitmap.module usr/lib/grub/x86_64-efi/bitmap_scale.mod usr/lib/grub/x86_64-efi/bitmap_scale.module +usr/lib/grub/x86_64-efi/bli.mod +usr/lib/grub/x86_64-efi/bli.module usr/lib/grub/x86_64-efi/blocklist.mod usr/lib/grub/x86_64-efi/blocklist.module usr/lib/grub/x86_64-efi/boot.mod @@ -719,6 +724,8 @@ usr/lib/grub/x86_64-efi/efifwsetup.mod usr/lib/grub/x86_64-efi/efifwsetup.module usr/lib/grub/x86_64-efi/efinet.mod usr/lib/grub/x86_64-efi/efinet.module +usr/lib/grub/x86_64-efi/efitextmode.mod +usr/lib/grub/x86_64-efi/efitextmode.module usr/lib/grub/x86_64-efi/ehci.mod usr/lib/grub/x86_64-efi/ehci.module usr/lib/grub/x86_64-efi/elf.mod @@ -794,6 +801,7 @@ usr/lib/grub/x86_64-efi/gcry_twofish.module usr/lib/grub/x86_64-efi/gcry_whirlpool.mod usr/lib/grub/x86_64-efi/gcry_whirlpool.module usr/lib/grub/x86_64-efi/gdb_grub +usr/lib/grub/x86_64-efi/gdb_helper.py usr/lib/grub/x86_64-efi/geli.mod usr/lib/grub/x86_64-efi/geli.module usr/lib/grub/x86_64-efi/gettext.mod @@ -806,7 +814,6 @@ usr/lib/grub/x86_64-efi/gfxterm_background.mod usr/lib/grub/x86_64-efi/gfxterm_background.module usr/lib/grub/x86_64-efi/gfxterm_menu.mod usr/lib/grub/x86_64-efi/gfxterm_menu.module -usr/lib/grub/x86_64-efi/gmodule.pl usr/lib/grub/x86_64-efi/gptsync.mod usr/lib/grub/x86_64-efi/gptsync.module usr/lib/grub/x86_64-efi/gzio.mod @@ -991,6 +998,8 @@ usr/lib/grub/x86_64-efi/pcidump.mod usr/lib/grub/x86_64-efi/pcidump.module usr/lib/grub/x86_64-efi/pgp.mod usr/lib/grub/x86_64-efi/pgp.module +usr/lib/grub/x86_64-efi/plainmount.mod +usr/lib/grub/x86_64-efi/plainmount.module usr/lib/grub/x86_64-efi/play.mod usr/lib/grub/x86_64-efi/play.module usr/lib/grub/x86_64-efi/png.mod @@ -1173,63 +1182,6 @@ usr/share/grub/unicode.pf2 #usr/share/info/grub.info #usr/share/info/grub.info-1 #usr/share/info/grub.info-2 -#usr/share/locale/ast/LC_MESSAGES/grub.mo -#usr/share/locale/ca/LC_MESSAGES/grub.mo -#usr/share/locale/da/LC_MESSAGES/grub.mo -#usr/share/locale/de/LC_MESSAGES/grub.mo -#usr/share/locale/de@hebrew -#usr/share/locale/de@hebrew/LC_MESSAGES -#usr/share/locale/de@hebrew/LC_MESSAGES/grub.mo -#usr/share/locale/de_CH -#usr/share/locale/de_CH/LC_MESSAGES -#usr/share/locale/de_CH/LC_MESSAGES/grub.mo -#usr/share/locale/en@arabic -#usr/share/locale/en@arabic/LC_MESSAGES -#usr/share/locale/en@arabic/LC_MESSAGES/grub.mo -#usr/share/locale/en@cyrillic -#usr/share/locale/en@cyrillic/LC_MESSAGES -#usr/share/locale/en@cyrillic/LC_MESSAGES/grub.mo -#usr/share/locale/en@greek -#usr/share/locale/en@greek/LC_MESSAGES -#usr/share/locale/en@greek/LC_MESSAGES/grub.mo -#usr/share/locale/en@hebrew -#usr/share/locale/en@hebrew/LC_MESSAGES -#usr/share/locale/en@hebrew/LC_MESSAGES/grub.mo -#usr/share/locale/en@piglatin -#usr/share/locale/en@piglatin/LC_MESSAGES -#usr/share/locale/en@piglatin/LC_MESSAGES/grub.mo -#usr/share/locale/en@quot/LC_MESSAGES/grub.mo -#usr/share/locale/eo/LC_MESSAGES/grub.mo -#usr/share/locale/es/LC_MESSAGES/grub.mo -#usr/share/locale/fi/LC_MESSAGES/grub.mo -#usr/share/locale/fr/LC_MESSAGES/grub.mo -#usr/share/locale/gl/LC_MESSAGES/grub.mo -#usr/share/locale/hr/LC_MESSAGES/grub.mo -#usr/share/locale/hu/LC_MESSAGES/grub.mo -#usr/share/locale/id/LC_MESSAGES/grub.mo -#usr/share/locale/it/LC_MESSAGES/grub.mo -#usr/share/locale/ja/LC_MESSAGES/grub.mo -#usr/share/locale/ko/LC_MESSAGES/grub.mo -#usr/share/locale/lg/LC_MESSAGES/grub.mo -#usr/share/locale/lt/LC_MESSAGES/grub.mo -#usr/share/locale/nb/LC_MESSAGES/grub.mo -#usr/share/locale/nl/LC_MESSAGES/grub.mo -#usr/share/locale/pa -#usr/share/locale/pa/LC_MESSAGES -#usr/share/locale/pa/LC_MESSAGES/grub.mo -#usr/share/locale/pl/LC_MESSAGES/grub.mo -#usr/share/locale/pt/LC_MESSAGES/grub.mo -#usr/share/locale/pt_BR/LC_MESSAGES/grub.mo -#usr/share/locale/ro/LC_MESSAGES/grub.mo -#usr/share/locale/ru/LC_MESSAGES/grub.mo -#usr/share/locale/sl/LC_MESSAGES/grub.mo -#usr/share/locale/sr/LC_MESSAGES/grub.mo -#usr/share/locale/sv/LC_MESSAGES/grub.mo -#usr/share/locale/tr/LC_MESSAGES/grub.mo -#usr/share/locale/uk/LC_MESSAGES/grub.mo -#usr/share/locale/vi/LC_MESSAGES/grub.mo -#usr/share/locale/zh_CN/LC_MESSAGES/grub.mo -#usr/share/locale/zh_TW/LC_MESSAGES/grub.mo #usr/share/man/man1/grub-editenv.1 #usr/share/man/man1/grub-file.1 #usr/share/man/man1/grub-fstest.1 diff --git a/lfs/grub b/lfs/grub index e4cd35d78..2db76c627 100644 --- a/lfs/grub +++ b/lfs/grub @@ -24,7 +24,7 @@
include Config
-VER = 2.06 +VER = 2.12-rc1
THISAPP = grub-$(VER) DL_FILE = $(THISAPP).tar.xz @@ -61,7 +61,7 @@ objects = $(DL_FILE) \ $(DL_FILE) = $(DL_FROM)/$(DL_FILE) unifont-7.0.03.pcf.gz = $(DL_FROM)/unifont-7.0.03.pcf.gz
-$(DL_FILE)_BLAKE2 = 2a40b9b03d7bb3b9e7b1309ab274d686f01b3c42e7035ebc6e5a0e59a59c3b7362ba518341664b314cb0dbc8222bb10ea05ce09f08ce9d58a293207cb909e417 +$(DL_FILE)_BLAKE2 = 3ada3d51b8cbae260b8ddeb249d8529f273ca578e5361a24988e6e1bf5ef405e507831862dfcefd35ee1c26068cbdc38eda7a04fe1cec378e945e08c5b00d891 unifont-7.0.03.pcf.gz_BLAKE2 = fb96c1786fcc8c77796c90ce30a2b7d544013bd62cedbf7b027e1894fe75cdbd2044717796cb0e3150db1457fcb58076491d9c0b855621b652fb9a52c0793469
install : $(TARGET) @@ -92,11 +92,9 @@ $(subst %,%_BLAKE2,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) $(DIR_APP_EFI) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-2.06-remove_os_prober_disabled_warning.patch cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-2.02_disable_vga_fallback.patch - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-Use-zifencei-on-riscv.patch - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-Handle-R_RISCV_CALL_PLT-reloc.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-2.12-rc1-fix_bli_bin_sh_path.patch cd $(DIR_APP) && autoreconf -vfi
# Install unifont diff --git a/src/patches/grub/grub-2.12-rc1-fix_bli_bin_sh_path.patch b/src/patches/grub/grub-2.12-rc1-fix_bli_bin_sh_path.patch new file mode 100644 index 000000000..f933f5922 --- /dev/null +++ b/src/patches/grub/grub-2.12-rc1-fix_bli_bin_sh_path.patch @@ -0,0 +1,9 @@ +diff -Naur grub-2.12-rc1.org/util/grub.d/25_bli.in grub-2.12-rc1/util/grub.d/25_bli.in +--- grub-2.12-rc1.org/util/grub.d/25_bli.in 2023-07-10 17:43:48.000000000 +0200 ++++ grub-2.12-rc1/util/grub.d/25_bli.in 2023-11-17 07:07:30.743519612 +0100 +@@ -1,4 +1,4 @@ +-#!/usr/bin/sh ++#!/bin/sh + set -e + + # grub-mkconfig helper script. diff --git a/src/patches/grub/grub-Handle-R_RISCV_CALL_PLT-reloc.patch b/src/patches/grub/grub-Handle-R_RISCV_CALL_PLT-reloc.patch deleted file mode 100644 index f3f12b6f0..000000000 --- a/src/patches/grub/grub-Handle-R_RISCV_CALL_PLT-reloc.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 64be669638e198bc0c7c1a344547265dfacd2470 Mon Sep 17 00:00:00 2001 -From: Khem Raj raj.khem@gmail.com -Date: Mon, 23 Jan 2023 15:29:02 -0800 -Subject: [PATCH] risc-v: Handle R_RISCV_CALL_PLT reloc - -GNU assembler starting 2.40 release always generates R_RISCV_CALL_PLT -reloc for call in assembler [1], similarly llvm does not make -distinction between R_RISCV_CALL_PLT and R_RISCV_CALL [2] - -Upstream-Status: Submitted [https://lists.gnu.org/archive/html/grub-devel/2023-02/msg00143.html] - -[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=70f35d72ef04cd2377... -[2] https://reviews.llvm.org/D132530 - -Upstream-Status: Pending -Signed-off-by: Khem Raj raj.khem@gmail.com ---- - grub-core/kern/riscv/dl.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/grub-core/kern/riscv/dl.c -+++ b/grub-core/kern/riscv/dl.c -@@ -188,6 +188,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t - break; - - case R_RISCV_CALL: -+ case R_RISCV_CALL_PLT: - { - grub_uint32_t *abs_place = place; - grub_ssize_t off = sym_addr - (grub_addr_t) place; ---- a/util/grub-mkimagexx.c -+++ b/util/grub-mkimagexx.c -@@ -1294,6 +1294,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, st - } - break; - case R_RISCV_CALL: -+ case R_RISCV_CALL_PLT: - { - grub_uint32_t hi20, lo12; - -@@ -1725,6 +1726,7 @@ translate_relocation_pe (struct translat - case R_RISCV_BRANCH: - case R_RISCV_JAL: - case R_RISCV_CALL: -+ case R_RISCV_CALL_PLT: - case R_RISCV_PCREL_HI20: - case R_RISCV_PCREL_LO12_I: - case R_RISCV_PCREL_LO12_S: diff --git a/src/patches/grub/grub-Use-zifencei-on-riscv.patch b/src/patches/grub/grub-Use-zifencei-on-riscv.patch deleted file mode 100644 index c575a3116..000000000 --- a/src/patches/grub/grub-Use-zifencei-on-riscv.patch +++ /dev/null @@ -1,47 +0,0 @@ -From f1217c803cec90813eb834dde7829f4961b2a2e4 Mon Sep 17 00:00:00 2001 -From: Khem Raj raj.khem@gmail.com -Date: Thu, 17 Feb 2022 15:07:02 -0800 -Subject: [PATCH] configure.ac: Use _zicsr_zifencei extentions on riscv - -From version 2.38, binutils defaults to ISA spec version 20191213. This -means that the csr read/write (csrr*/csrw*) instructions and fence.i -instruction has separated from the `I` extension, become two standalone -extensions: Zicsr and Zifencei. - -The fix is to specify those extensions explicitely in -march. Since we -are now using binutils 2.38+ in OE this is ok, a more upstreamable fix for -grub will be to detect these extentions, however thats not easy to -implement - -Upstream-Status: Inappropriate [OE specific] -Signed-off-by: Khem Raj raj.khem@gmail.com ---- - configure.ac | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/configure.ac b/configure.ac -index c7fc55a..072f2c9 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -849,14 +849,14 @@ if test x"$platform" != xemu ; then - [grub_cv_target_cc_soft_float="-mgeneral-regs-only"], []) - fi - if test "x$target_cpu" = xriscv32; then -- CFLAGS="$TARGET_CFLAGS -march=rv32imac -mabi=ilp32 -Werror" -+ CFLAGS="$TARGET_CFLAGS -march=rv32imac_zicsr_zifencei -mabi=ilp32 -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], -- [grub_cv_target_cc_soft_float="-march=rv32imac -mabi=ilp32"], []) -+ [grub_cv_target_cc_soft_float="-march=rv32imac_zicsr_zifencei -mabi=ilp32"], []) - fi - if test "x$target_cpu" = xriscv64; then -- CFLAGS="$TARGET_CFLAGS -march=rv64imac -mabi=lp64 -Werror" -+ CFLAGS="$TARGET_CFLAGS -march=rv64imac_zicsr_zifencei -mabi=lp64 -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], -- [grub_cv_target_cc_soft_float="-march=rv64imac -mabi=lp64"], []) -+ [grub_cv_target_cc_soft_float="-march=rv64imac_zicsr_zifencei -mabi=lp64"], []) - fi - if test "x$target_cpu" = xia64; then - CFLAGS="$TARGET_CFLAGS -mno-inline-float-divide -mno-inline-sqrt -Werror" --- -2.35.1 -