Blob Blame History Raw
From a43e6e889fe44cae8a4da73ac3d81c1389fee905 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 13 Mar 2009 10:34:50 +0100
Subject: [PATCH] s390-tools-1.8.0-zipl-timeout

---
 zipl/src/job.c  |   11 ++++++++++-
 zipl/src/scan.c |    2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/zipl/src/job.c b/zipl/src/job.c
index 388e63a..fe3286e 100644
--- a/zipl/src/job.c
+++ b/zipl/src/job.c
@@ -1318,6 +1318,7 @@ create_fake_menu(struct scan_token *scan)
 	int i, j, pos, numsec, size, defaultpos;
 	char *name;
 	char *target;
+	char *timeout;
 	char *seclist[1024];
 	char *defaultsection;
 	char buf[1024];
@@ -1327,6 +1328,7 @@ create_fake_menu(struct scan_token *scan)
 	numsec = 0;
 	name = NULL;
 	target = NULL;
+	timeout = NULL;
 	for (i = 0; (int) scan[i].id != 0; i++) {
 		if (scan[i].id == scan_id_section_heading) {
 			name = scan[i].content.section.name;
@@ -1343,6 +1345,10 @@ create_fake_menu(struct scan_token *scan)
 		    scan[i].content.keyword.keyword == scan_keyword_target &&
 		    !strcmp(DEFAULTBOOT_SECTION, name))
 			target = scan[i].content.keyword.value;
+
+		if (scan[i].id == scan_id_keyword_assignment &&
+		    scan[i].content.keyword.keyword == scan_keyword_timeout)
+			timeout = scan[i].content.keyword.value;
 	}
 	get_default_section(scan, &defaultsection, &j);
 
@@ -1396,7 +1402,10 @@ create_fake_menu(struct scan_token *scan)
 	scan[i].id = scan_id_keyword_assignment;
 	scan[i].line = i;
 	scan[i].content.keyword.keyword = scan_keyword_timeout;
-	scan[i++].content.keyword.value = misc_strdup("15");
+	if (timeout)
+		scan[i++].content.keyword.value = misc_strdup(timeout);
+	else
+		scan[i++].content.keyword.value = misc_strdup("15");
 
 	pos = i;
 	for (i = 0; i<numsec; i++) {
diff --git a/zipl/src/scan.c b/zipl/src/scan.c
index 7227a33..caca3cf 100644
--- a/zipl/src/scan.c
+++ b/zipl/src/scan.c
@@ -33,7 +33,7 @@ enum scan_key_state scan_key_table[SCAN_SECTION_NUM][SCAN_KEYWORD_NUM] = {
  *			     rs                                 enu
  */
 /* defaultboot	*/
-	{opt, inv, inv, inv, inv, inv, inv, inv, req, inv, inv, opt, inv, inv},
+	{opt, inv, inv, inv, inv, inv, inv, inv, req, inv, opt, opt, inv, inv},
 /* ipl		*/
 	{inv, inv, inv, req, opt, opt, opt, inv, opt, inv, inv, inv, inv, inv},
 /* segment load */
-- 
1.6.0.6