2013-06-07 18:03:56 +00:00
|
|
|
From a2780be06f7de35a0dd4cc19a68b151176707ae7 Mon Sep 17 00:00:00 2001
|
2012-12-17 16:32:53 +00:00
|
|
|
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
|
|
|
|
Date: Fri, 14 Dec 2012 20:10:21 -0200
|
2013-06-07 18:03:56 +00:00
|
|
|
Subject: [PATCH 458/471] Add bootpath device to the list
|
2012-12-17 16:32:53 +00:00
|
|
|
|
|
|
|
When scanning the devices, always check (and add) the bootpath device if it
|
|
|
|
isn't in the device list.
|
|
|
|
---
|
2013-05-02 20:54:52 +00:00
|
|
|
grub-core/disk/ieee1275/ofdisk.c | 32 ++++++++++++++++++++++++++++++++
|
|
|
|
1 file changed, 32 insertions(+)
|
2012-12-17 16:32:53 +00:00
|
|
|
|
|
|
|
diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c
|
2013-06-07 18:03:56 +00:00
|
|
|
index 2a31ecd..a940771 100644
|
2012-12-17 16:32:53 +00:00
|
|
|
--- a/grub-core/disk/ieee1275/ofdisk.c
|
|
|
|
+++ b/grub-core/disk/ieee1275/ofdisk.c
|
2013-05-02 20:54:52 +00:00
|
|
|
@@ -229,6 +229,10 @@ dev_iterate (const struct grub_ieee1275_devalias *alias)
|
|
|
|
static void
|
|
|
|
scan (void)
|
|
|
|
{
|
2012-12-17 16:32:53 +00:00
|
|
|
+ char *bootpath;
|
|
|
|
+ int bootpath_size;
|
|
|
|
+ char *type;
|
2013-05-02 20:54:52 +00:00
|
|
|
+
|
|
|
|
struct grub_ieee1275_devalias alias;
|
|
|
|
FOR_IEEE1275_DEVALIASES(alias)
|
|
|
|
{
|
|
|
|
@@ -239,6 +243,34 @@ scan (void)
|
|
|
|
|
|
|
|
FOR_IEEE1275_DEVCHILDREN("/", alias)
|
|
|
|
dev_iterate (&alias);
|
2012-12-17 16:32:53 +00:00
|
|
|
+
|
|
|
|
+ if (grub_ieee1275_get_property_length (grub_ieee1275_chosen, "bootpath",
|
|
|
|
+ &bootpath_size)
|
|
|
|
+ || bootpath_size <= 0)
|
|
|
|
+ {
|
|
|
|
+ /* Should never happen. */
|
|
|
|
+ grub_printf ("/chosen/bootpath property missing!\n");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ bootpath = (char *) grub_malloc ((grub_size_t) bootpath_size + 64);
|
|
|
|
+ if (! bootpath)
|
|
|
|
+ {
|
|
|
|
+ grub_print_error ();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", bootpath,
|
|
|
|
+ (grub_size_t) bootpath_size + 1, 0);
|
|
|
|
+ bootpath[bootpath_size] = '\0';
|
|
|
|
+
|
|
|
|
+ type = grub_ieee1275_get_device_type (bootpath);
|
|
|
|
+ if (type && grub_strcmp (type, "block") == 0)
|
|
|
|
+ dev_iterate_real (bootpath, bootpath);
|
|
|
|
+
|
|
|
|
+ grub_free (bootpath);
|
|
|
|
+
|
2013-05-02 20:54:52 +00:00
|
|
|
+ grub_devalias_iterate (dev_iterate_alias);
|
|
|
|
+ grub_children_iterate ("/", dev_iterate);
|
2012-12-17 16:32:53 +00:00
|
|
|
}
|
2013-05-02 20:54:52 +00:00
|
|
|
|
|
|
|
static int
|
2012-12-17 16:32:53 +00:00
|
|
|
--
|
2013-06-07 18:03:56 +00:00
|
|
|
1.8.2.1
|
2012-12-17 16:32:53 +00:00
|
|
|
|