Skip to contentSkip to conversation

tools: fix dependency for ipxe and rombios

PATCH Superseded Wei Liu 2 participants 6 messages Jul 17, 2018 – Jul 18, 2018

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 tools: fix dependency for ipxe and rombios

It appears that the test in 01d631028 for ipxe's dependency on rombios is not good enough. Configuring with --disable-rombios doesn't disable ipxe.

Fix it by testing the dependency in AC_ARG_ENABLE and AC_ARG_WITH at the same time. We intentionally omit help string in AC_ARG_ENABLE so that it is not visible to users.

---
Cc: Ian Jackson <[email protected]>

---
 tools/configure    | 23 +++++++++++++++++++----
 tools/configure.ac | 15 ++++++++++-----
 2 files changed, 29 insertions(+), 9 deletions(-)
tools/configure +19 -4
index 3b55fb2e36..d8a833a968 100755
@@ -1498,6 +1498,16 @@ Optional Features:
                           for Linux or NetBSD x86, otherwise off)
   --enable-rombios        Enable ROMBIOS, (DEFAULT is on if qemu-traditional
                           is enabled, otherwise off)
+if test "x$enable_rombios" = "xno"; then :
+
+        ipxe="n"
+
+else
+
+        ipxe="y"
+
+fi
+]
   --enable-systemd        Enable systemd support (default is DISABLED)
 
 Optional Packages:
@@ -4604,6 +4614,11 @@ _ACEOF
 
 fi
 
+# Check whether --enable-ipxe was given.
+if test "${enable_ipxe+set}" = set; then :
+  enableval=$enable_ipxe;
+fi
+
 
 # Check whether --with-system-ipxe was given.
 if test "${with_system_ipxe+set}" = set; then :
@@ -4615,11 +4630,11 @@ if test "${with_system_ipxe+set}" = set; then :
         /*)  ipxe_path=$withval ;;
         *) as_fn_error $? "IPXE specified, but is not an absolute path" "$LINENO" 5 ;;
     esac
+    if test "x$enable_rombios" = "xno"; then :
 
-    # IPXE depends on Rombios
-    if test "x$enable_rombios" = "xno"; then
-        as_fn_error $? "Rombios is required for using IPXE" "$LINENO" 5
-    fi
+        ipxe_path=
+
+fi
 
 fi
 
tools/configure.ac +10 -5
index 0f85472602..4e2f31cf03 100644
@@ -244,6 +244,13 @@ AS_IF([test "x$ovmf" = "xy" -o -n "$ovmf_path" ], [
                        [OVMF path])
 ])
 
+AC_ARG_ENABLE([ipxe],
+    AS_IF([test "x$enable_rombios" = "xno"], [
+        ipxe="n"
+    ], [
+        ipxe="y"
+    ])
+])
 AC_ARG_WITH([system-ipxe],
     AS_HELP_STRING([--with-system-ipxe@<:@=PATH@:>@],
        [Use system supplied IPXE PATH instead of building and installing
@@ -255,11 +262,9 @@ AC_ARG_WITH([system-ipxe],
         /*)  ipxe_path=$withval ;;
         *) AC_MSG_ERROR([IPXE specified, but is not an absolute path]) ;;
     esac
-
-    # IPXE depends on Rombios
-    if test "x$enable_rombios" = "xno"; then
-        AC_MSG_ERROR([Rombios is required for using IPXE])
-    fi
+    AS_IF([test "x$enable_rombios" = "xno"], [
+        ipxe_path=
+    ], [])
 ],[])
 AS_IF([test "x$ipxe" = "xy" -o -n "$ipxe_path" ], [
     AC_DEFINE_UNQUOTED([IPXE_PATH],
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

Wei Liu writes ("[PATCH] tools: fix dependency for ipxe and rombios"):

Quoted 7 lines

It appears that the test in 01d631028 for ipxe's dependency on rombios is not good enough. Configuring with --disable-rombios doesn't disable ipxe.

Fix it by testing the dependency in AC_ARG_ENABLE and AC_ARG_WITH at the same time. We intentionally omit help string in AC_ARG_ENABLE so that it is not visible to users.

But there is already
AX_ARG_DEFAULT_ENABLE([ipxe], [Disable IPXE])
so now you are defining this argument twice.

Looking at the code for seabios as an example, this is quite tangled.

My reading of the autoconf FM is that the design intent is that one should support *either* --with/without, *or* --enable/disable. So I think what we ought to support is:
--with-seabios=/PATH
--with-seabios use our version
--without-seabios disable support for seabios

But, actually, we support these:
--enable-seabios
--disable-seabios
--with-system-seabios=/path
--without-system-seabios
And their interactions are weird. I haven't conclusively analysed the combinations of these things, but one very odd thing is that --without-system-seabios disables building our own seabios!

So I'm sorry to say that I think the answer is to revert 01d631028a02 and to replace it with a patch which introduces
--with-ipxe=/PATH
--with-ipxe like --enable-ipxe, but also sets path to ""
--without-ipxe same as --disable-ipxe

Sorry for not spotting earlier that we had --enable-ipxe already.

If you want to keep your current approach then certainly you mustn't duplicate the definition of the --enable-ipxe argument. But you also have to think clearly about how --enable-ipxe ought to interact with --with-system-ipxe and the corresponding rombios options.

What do think ?

ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author
#2 lore raw
Quoted 6 lines · Ian Jackson

So I'm sorry to say that I think the answer is to revert 01d631028a02 and to replace it with a patch which introduces
--with-ipxe=/PATH
--with-ipxe like --enable-ipxe, but also sets path to ""
--without-ipxe same as --disable-ipxe

I think this makes sense.

Reversion would be tricky because there is a subsequent patch that touches code should be reverted and other bits.

I will write a patch on top of staging instead.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author
#3 lore raw
Quoted 7 lines · Wei Liu
Quoted 6 lines · Ian Jackson

So I'm sorry to say that I think the answer is to revert 01d631028a02 and to replace it with a patch which introduces
--with-ipxe=/PATH
--with-ipxe like --enable-ipxe, but also sets path to ""
--without-ipxe same as --disable-ipxe

FAOD do you suggest we get rid of --with-system-ipxe? That seems to deviate from other options.

If we don't ditch it, we will have:

--with-ipxe enable building and use in-tree ipxe.
--without-ipxe disable in-tree ipxe, no ipxe (in-tree or system
provided) will be used.
--with-system-ipxe=PATH disable building in-tree ipxe, use ipxe specified
by user.

But honestly I don't see the advantage of this other than keeping options consistent.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw

Wei Liu writes ("Re: [PATCH] tools: fix dependency for ipxe and rombios"):

Quoted 10 lines · Wei Liu
Quoted 6 lines · Ian Jackson
Quoted 5 lines

So I'm sorry to say that I think the answer is to revert 01d631028a02 and to replace it with a patch which introduces
--with-ipxe=/PATH
--with-ipxe like --enable-ipxe, but also sets path to ""
--without-ipxe same as --disable-ipxe

FAOD do you suggest we get rid of --with-system-ipxe? That seems to deviate from other options.

Yes.

Quoted 10 lines

If we don't ditch it, we will have:

--with-ipxe enable building and use in-tree ipxe.
--without-ipxe disable in-tree ipxe, no ipxe (in-tree or system
provided) will be used.
--with-system-ipxe=PATH disable building in-tree ipxe, use ipxe specified
by user.

But honestly I don't see the advantage of this other than keeping options consistent.

Well, normally --with-system-foo=PATH would mean both "please use PATH when building" and "please bake PATH into your program".

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author
#5 lore raw
Quoted 22 lines · Ian Jackson

Wei Liu writes ("Re: [PATCH] tools: fix dependency for ipxe and rombios"):

Quoted 10 lines · Wei Liu
Quoted 6 lines · Ian Jackson
Quoted 5 lines

So I'm sorry to say that I think the answer is to revert 01d631028a02 and to replace it with a patch which introduces
--with-ipxe=/PATH
--with-ipxe like --enable-ipxe, but also sets path to ""
--without-ipxe same as --disable-ipxe

FAOD do you suggest we get rid of --with-system-ipxe? That seems to deviate from other options.

Yes.

Quoted 8 lines

If we don't ditch it, we will have:

--with-ipxe enable building and use in-tree ipxe.
--without-ipxe disable in-tree ipxe, no ipxe (in-tree or system
provided) will be used.
--with-system-ipxe=PATH disable building in-tree ipxe, use ipxe specified
by user.

Quoted 5 lines
Quoted 2 lines

But honestly I don't see the advantage of this other than keeping options consistent.

Well, normally --with-system-foo=PATH would mean both "please use PATH when building" and "please bake PATH into your program".

And that's exactly what we want here, right? If --with-system-ipxe=/PATH is specified, the PATH is baked into libxl.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel