[coreboot] New patch to review: 181d45d Set root device while probing boot_devices list

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Mon Sep 5 13:40:17 CEST 2011


Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/200

-gerrit

commit 181d45d266a3e4627c82690a745c0f08018f8cf5
Author: Mathias Krause <mathias.krause at secunet.com>
Date:   Mon Mar 8 11:43:32 2010 +0100

    Set root device while probing boot_devices list
    
    This way we don't need to have absolute paths in the config file itself.
    
    Change-Id: Id1f27a08bd86bc9a872dd52347f19a55532a82e6
    Signed-off-by: Mathias Krause <mathias.krause at secunet.com>
    Signed-off-by: Patrick Georgi <patrick.georgi at secunet.com>
---
 main/grub/grub.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/main/grub/grub.c b/main/grub/grub.c
index 1afdadd..0e8970c 100644
--- a/main/grub/grub.c
+++ b/main/grub/grub.c
@@ -139,11 +139,22 @@ void manual_grub_menulst(void)
 int probe_menulst(char *bootdevice, char *filename)
 {
 	char menulst[256];
-
-	strcpy(menulst, bootdevice);
+	struct builtin *root;
+	int use_root;
+
+	memset(menulst, 0, sizeof(menulst));
+	root = find_command("root");
+	if (root != NULL) {
+		(root->func)(bootdevice, BUILTIN_SCRIPT);
+		use_root = 1;
+	} else {
+		strcpy(menulst, bootdevice);
+		use_root = 0;
+	}
 	strncat(menulst, filename, 256);
+
 	/* Set string to zero: */
-	copy_path_to_filo_bootline(menulst, config_file, 0, 0);
+	copy_path_to_filo_bootline(menulst, config_file, use_root, 0);
 	if (file_open(config_file)) {
 		/* We found a config file. Bail out */
 		/* The valid config file name stays in config_file[] */




More information about the coreboot mailing list