[SeaBIOS] iasl-option not working

Michael S. Tsirkin mst at redhat.com
Thu Aug 30 11:38:34 CEST 2012


On Wed, Aug 29, 2012 at 09:38:00PM -0400, Kevin O'Connor wrote:
> Hi Michael,
> 
> I was running through the SeaBIOS release checks when I found that the
> new iasl-option code in the Makefile seems to choke on older versions
> of iasl (for example, version 20120123 as shipped with fc13).  Can you
> verify if the iasl detection still works properly for you with the
> patch below?
> 
> -Kevin

So I think using -h is a bad idea: it failed once
it might fail again.
How about the following patch instead?
Tested with latest iasl from git (which needs -Pn)
and with F17 version (which does not).

-->

Makefile: fix iasl option detection

IASL option detection relied on iasl -h exit status which
is not very robust: -h is not expected to be used
from scripts. In particular combination of -h with
any option seems to succeed with some old
versions of iasl (e.g. version 20120123 as shipped with fc13).

Instead, supply a dummy input file and run iasl on it
to test option support.

Signed-off-by: Michael S. Tsirkin <mst at redhat.com>

---

diff --git a/Makefile b/Makefile
index 72ee152..0ab9f9f 100644
--- a/Makefile
+++ b/Makefile
@@ -221,14 +221,15 @@ $(OUT)vgabios.bin: $(OUT)vgabios.bin.raw tools/buildrom.py
 
 ################ DSDT build rules
 
-iasl-option=$(shell if "$(1)" "$(2)" -h > /dev/null 2>&1 \
-    ; then echo "$(2)"; else echo "$(3)"; fi ;)
+iasl-option=$(shell cp src/iasl-test.dsl $(1)/iasl-test.dsl; \
+    if "$(2)" "$(3)" $(1)/iasl-test.dsl > /dev/null 2>&1 \
+    ; then echo "$(3)"; else echo "$(4)"; fi ;)
 
 $(OUT)%.hex: src/%.dsl ./tools/acpi_extract_preprocess.py ./tools/acpi_extract.py
 	@echo "  Compiling IASL $@"
 	$(Q)cpp -P $< > $(OUT)$*.dsl.i.orig
 	$(Q)$(PYTHON) ./tools/acpi_extract_preprocess.py $(OUT)$*.dsl.i.orig > $(OUT)$*.dsl.i
-	$(Q)$(IASL) $(call iasl-option,$(IASL),-Pn,) -vs -l -tc -p $(OUT)$* $(OUT)$*.dsl.i
+	$(Q)$(IASL) $(call iasl-option,$(OUT),$(IASL),-Pn,) -vs -l -tc -p $(OUT)$* $(OUT)$*.dsl.i
 	$(Q)$(PYTHON) ./tools/acpi_extract.py $(OUT)$*.lst > $(OUT)$*.off
 	$(Q)cat $(OUT)$*.off > $@
 
diff --git a/src/iasl-test.dsl b/src/iasl-test.dsl
index e69de29..1a8b95e 100644
--- a/src/iasl-test.dsl
+++ b/src/iasl-test.dsl
@@ -0,0 +1,6 @@
+DefinitionBlock ("iasl-test.aml", "TEST", 0x01, "TSTC", "TESTIASLCMP", 0x1)
+{
+
+        Device (TEST) {
+        }
+}



More information about the SeaBIOS mailing list