Add fwsetup command (pjones)

- More ppc fixes (IBM)
This commit is contained in:
Peter Jones 2012-05-25 15:01:32 -04:00
parent aa709fb61d
commit f3c723cdda
3 changed files with 109 additions and 2 deletions

View File

@ -0,0 +1,43 @@
From 28d9f3965f095a765ec8aaa589b4e04608b69901 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 25 May 2012 14:57:38 -0400
Subject: [PATCH] Don't set boot device on ppc-ieee1275
This started with the problem that powerkvm doesn't have /dev/nvram and so
there is no way to set boot-device.
---
util/grub-install.in | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/util/grub-install.in b/util/grub-install.in
index 293b756..2503aa0 100644
--- a/util/grub-install.in
+++ b/util/grub-install.in
@@ -818,14 +818,16 @@ elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ]
fi
fi
- "$nvsetenv" boot-device "$boot_device" || {
- # TRANSLATORS: The %s will be replaced by an external program name.
- gettext_printf "\`%s' failed.\n" "$nvsetenv" 1>&2
- gettext "You will have to set \`boot-device' variable manually. At the IEEE1275 prompt, type:" 1>&2
- echo 1>&2
- echo " setenv boot-device $boot_device" 1>&2
- exit 1
- }
+ if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ]; then
+ "$nvsetenv" boot-device "$boot_device" || {
+ # TRANSLATORS: The %s will be replaced by an external program name.
+ gettext_printf "\`%s' failed.\n" "$nvsetenv" 1>&2
+ gettext "You will have to set \`boot-device' variable manually. At the IEEE1275 prompt, type:" 1>&2
+ echo 1>&2
+ echo " setenv boot-device $boot_device" 1>&2
+ exit 1
+ }
+ fi
fi
elif [ x"${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = xmips-arc ]; then
dvhtool -d "${install_device}" --unix-to-vh "{grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" grub
--
1.7.10.1

View File

@ -0,0 +1,59 @@
From 03f6e77635f4f311a2c7bdd581f6202fa52feef7 Mon Sep 17 00:00:00 2001
From: Valdimir Serbinenko <phcoder@gmail.com>
Date: Sun, 13 May 2012 18:23:02 +0000
Subject: [PATCH] Don't scan device tree if flag is set.
Don't scan device tree if GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS is
set.
=== modified file 'grub-core/disk/ieee1275/ofdisk.c'
---
grub-core/disk/ieee1275/ofdisk.c | 3 ++-
grub-core/kern/ieee1275/cmain.c | 3 +++
include/grub/ieee1275/ieee1275.h | 2 ++
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c
index 56fed0a..6b734f7 100644
--- a/grub-core/disk/ieee1275/ofdisk.c
+++ b/grub-core/disk/ieee1275/ofdisk.c
@@ -159,7 +159,8 @@ scan (void)
}
grub_devalias_iterate (dev_iterate_alias);
- grub_ieee1275_devices_iterate (dev_iterate);
+ if (!grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS))
+ grub_ieee1275_devices_iterate (dev_iterate);
}
static int
diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c
index 9e80757..e04ce5b 100644
--- a/grub-core/kern/ieee1275/cmain.c
+++ b/grub-core/kern/ieee1275/cmain.c
@@ -88,6 +88,9 @@ grub_ieee1275_find_options (void)
if (rc >= 0 && !grub_strcmp (tmp, "Emulated PC"))
is_qemu = 1;
+ if (rc >= 0 && grub_strncmp (tmp, "IBM", 3) == 0)
+ grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS);
+
if (grub_strncmp (tmp, "PowerMac", sizeof ("PowerMac") - 1) == 0)
grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS);
diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h
index fb85db9..99a4bc1 100644
--- a/include/grub/ieee1275/ieee1275.h
+++ b/include/grub/ieee1275/ieee1275.h
@@ -116,6 +116,8 @@ enum grub_ieee1275_flag
1 address cell is used on PowerMacs.
*/
GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS,
+
+ GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS
};
extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag);
--
1.7.10.1

View File

@ -39,7 +39,7 @@
Name: grub2 Name: grub2
Epoch: 1 Epoch: 1
Version: 2.0 Version: 2.0
Release: 0.30.beta5%{?dist} Release: 0.31.beta5%{?dist}
Summary: Bootloader with support for Linux, Multiboot and more Summary: Bootloader with support for Linux, Multiboot and more
Group: System Environment/Base Group: System Environment/Base
@ -61,7 +61,8 @@ Patch8: grub2-2.0-no-png-in-texi.patch
Patch9: grub-2.00-Fix-module-trampoline-for-ppc.patch Patch9: grub-2.00-Fix-module-trampoline-for-ppc.patch
Patch10: grub-2.00-add-fw_path-search.patch Patch10: grub-2.00-add-fw_path-search.patch
Patch11: grub-2.00-Add-fwsetup.patch Patch11: grub-2.00-Add-fwsetup.patch
Patch12: grub-2.00-ppc-no-tree-scanning.patch
Patch13: grub-2.00-Dont-set-boot-on-ppc.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -385,6 +386,10 @@ fi
%doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 %doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0
%changelog %changelog
* Fri May 25 2012 Peter Jones <pjones@redhat.com> - 2.0-0.31.beta5
- Add fwsetup command (pjones)
- More ppc fixes (IBM)
* Tue May 22 2012 Peter Jones <pjones@redhat.com> - 2.0-0.30.beta5 * Tue May 22 2012 Peter Jones <pjones@redhat.com> - 2.0-0.30.beta5
- Fix the /other/ grub2-tools require to include epoch. - Fix the /other/ grub2-tools require to include epoch.