grub2/grub2-s390x-05-grub2-mkconfig.patch
Dr. Werner Fink b05b350108 Accepting request 228323 from home:michael-chang:SLE12
- snapper rollback support (fate#317062)
  * add btrfs_follow_default.patch
  * add suse_btrfs_grub2_install.sh
  * add 80_suse_btrfs_snapshot
  * refresh grub2-snapper-plugin.sh

- add grub2-x86_64-xen subpackage (bnc#863821)

- ieee1275: check for IBM pseries emulated machine (bnc#869964) 
- added patches:
  * grub2-ppc64-build-ppc64-32bit.patch

- Build ppc64 as 32bit
- added patches:
  * grub2-ppc64-build-ppc64-32bit.patch

- Rename PowerPC patches so it will have architecture in it's name 
- added patches:
  * grub2-ppc64le-01-Add-Little-Endian-support-for-Power64-to-the-build.patch
  * grub2-ppc64le-02-Build-grub-as-O1-until-we-add-savegpr-and-restgpr-ro.patch
  * grub2-ppc64le-03-disable-creation-of-vsx-and-altivec-instructions.patch
  * grub2-ppc64le-04-powerpc64-LE-s-linker-knows-how-to-handle-the-undefi.patch
  * grub2-ppc64le-05-grub-install-can-now-recognize-and-install-a-LE-grub.patch
  * grub2-ppc64le-06-set-the-ABI-version-to-0x02-in-the-e_flag-of-the-PPC.patch
  * grub2-ppc64le-07-Add-IEEE1275_ADDR-helper.patch
  * grub2-ppc64le-08-Fix-some-more-warnings-when-casting.patch
  * grub2-ppc64le-09-Add-powerpc64-types.patch
  * grub2-ppc64le-10-powerpc64-is-not-necessarily-BigEndian-anymore.patch
  * grub2-ppc64le-11-Fix-warnings-when-building-powerpc-linux-loader-64bi.patch
  * grub2-ppc64le-12-GRUB_ELF_R_PPC_-processing-is-applicable-only-for-32.patch

OBS-URL: https://build.opensuse.org/request/show/228323
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=81
2014-03-31 19:51:24 +00:00

129 lines
4.7 KiB
Diff

From: Raymund Will <rw@suse.com>
Subject: Enable grub2-mkconfig for s390x-emu
References: fate#314213
Patch-Mainline: no
---
util/grub.d/10_linux.in | 59 ++++++++++++++++++++++++++++++++++++++----------
1 file changed, 47 insertions(+), 12 deletions(-)
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -67,6 +67,21 @@ esac
title_correction_code=
+hotkey=1
+incr_hotkey()
+{
+ [ -z "$hotkey" ] && return
+ expr $hotkey + 1
+}
+print_hotkey()
+{
+ keys="123456789abdfgijklmnoprstuvwyz"
+ if [ -z "$hotkey" ]||[ $hotkey -eq 0 ]||[ $hotkey -gt 30 ]; then
+ return
+ fi
+ echo "--hotkey=$(expr substr $keys $hotkey 1)"
+}
+
linux_entry ()
{
os="$1"
@@ -90,9 +105,11 @@ linux_entry ()
title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;"
grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")"
fi
- echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
+ echo "menuentry '$(echo "$title" | grub_quote)' $(print_hotkey) ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
+ hotkey=$(incr_hotkey)
else
- echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
+ echo "menuentry '$(echo "$os" | grub_quote)' $(print_hotkey) ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
+ hotkey=$(incr_hotkey)
fi
if [ x$type != xrecovery ] ; then
save_default_entry | grub_add_tab
@@ -115,6 +132,7 @@ linux_entry ()
echo " insmod gzio" | sed "s/^/$submenu_indentation/"
+ if [ $PLATFORM != emu ]; then # 'search' does not work for now
if [ x$dirname = x/ ]; then
if [ -z "${prepare_root_cache}" ]; then
prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | grub_add_tab)"
@@ -126,6 +144,7 @@ linux_entry ()
fi
printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
fi
+ fi
message="$(gettext_printf "Loading Linux %s ..." ${version})"
if [ -d /sys/firmware/efi ] && [ "x${GRUB_USE_LINUXEFI}" = "xtrue" ]; then
sed "s/^/$submenu_indentation/" << EOF
@@ -159,16 +178,17 @@ 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-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
- if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
- done` ;;
+case "$machine" in
+ i?86 | x86_64) klist="/boot/vmlinuz-* /vmlinuz-* /boot/kernel-*" ;;
+ s390 | s390x) klist="/boot/image-* /boot/kernel-*" ;;
+ *) klist="/boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* \
+ /boot/kernel-*" ;;
esac
+list=`for i in $klist; do
+ if grub_file_is_not_garbage "$i" ; then
+ echo -n "$i " ;
+ fi
+ done`
case "$machine" in
i?86) GENKERNEL_ARCH="x86" ;;
@@ -178,6 +198,15 @@ case "$machine" in
*) GENKERNEL_ARCH="$machine" ;;
esac
+PLATFORM="native"
+if [ -d /sys/firmware/efi ]&&[ "x${GRUB_USE_LINUXEFI}" = "xtrue" ]; then
+ PLATFORM="efi"
+else
+ case "$machine" in
+ s390*) PLATFORM="emu" ;;
+ esac
+fi
+
prepare_boot_cache=
prepare_root_cache=
boot_device_id=
@@ -194,6 +223,11 @@ while [ "x$list" != "x" ] ; do
basename=`basename $linux`
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
+ if [ $PLATFORM != "emu" ]; then
+ hotkey=0
+ else
+ rel_dirname=$dirname
+ fi
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
alt_version=`echo $version | sed -e "s,\.old$,,g"`
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
@@ -278,7 +312,8 @@ while [ "x$list" != "x" ] ; do
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
# TRANSLATORS: %s is replaced with an OS name
- echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
+ echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' $(print_hotkey) \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
+ hotkey=$(incr_hotkey)
is_top_level=false
fi