[SerialICE] New patch to review for serialice: e989a9c Parse error on mainboard script is fatal

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Sun Nov 25 20:34:56 CET 2012


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1913

-gerrit

commit e989a9c7aff122404dedcddc0ce5be57d12e6453
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Sun Nov 25 21:15:31 2012 +0200

    Parse error on mainboard script is fatal
    
    If there is a parse error in mainboard script, abort execution.
    Previous behaviour incorrectly indicated a "file not found" error
    and continued execution with default/minimal profile.
    
    Change-Id: If69b1394b2ab8b77d7514b600dddb0c19963b440
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 SerialICE/simba/serialice.lua | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/SerialICE/simba/serialice.lua b/SerialICE/simba/serialice.lua
index 9eb287d..406c900 100644
--- a/SerialICE/simba/serialice.lua
+++ b/SerialICE/simba/serialice.lua
@@ -92,8 +92,11 @@ function do_default_setup()
 end
 
 mainboard_file = string.format("%s.lua", string.lower(string.gsub(SerialICE_mainboard, "[ -]", "_")))
-local mainboard_lua = loadfile(mainboard_file)
-if (mainboard_lua) then
+local mainboard_lua, ferr = loadfile(mainboard_file)
+local mainboard_script = io.open(mainboard_file)
+if mainboard_script then
+	io.close(mainboard_script)
+	assert(mainboard_lua, ferr)
 	mainboard_lua()
 	printks(froot, "Mainboard script %s initialized.\n", mainboard_file)
 	do_minimal_setup()



More information about the SerialICE mailing list