Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Incorrect attempt to use root-path
2015-11-15, 12:58
Post: #1
Incorrect attempt to use root-path
It appears that a bug has crept into iPXE whereby what *should* be an unsupported root-path (eg an NFS root) is treated as "supported", resulting in a "Could not open SAN device" error. This looks like quite a recent bug, the version that ships with Ubuntu 14.04 works fine!

The following patch (amending parenthesis closures) fixes the problem; although I'm quite new to iPXE I think this is correct, and will not have any undesirable side-effects:

Code:
angus@ganymede:src$ git diff master lincor -- usr/autoboot.c
diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index 8c6b690..96260d3 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -379,8 +379,8 @@ int netboot ( struct net_device *netdev ) {
         * it may represent an NFS root.
         */
        if ( filename && root_path &&
-            ( ! ( uri_is_absolute ( root_path ) ||
-                  ( xfer_uri_opener ( root_path->scheme ) == NULL ) ) ) ) {
+            ( ! ( uri_is_absolute ( root_path )) ||
+                  ( xfer_uri_opener ( root_path->scheme ) == NULL ) ) ) {
                printf ( "Ignoring unsupported root path\n" );
                uri_put ( root_path );
                root_path = NULL;
Find all posts by this user
Quote this message in a reply
2015-11-21, 20:26
Post: #2
RE: Incorrect attempt to use root-path
Could you gives some more info to reproduce the issue?
An example root-path that you have confirmed to have this issue, as well as version number based on git commit that is shown as 1.0.0+ (gitid).
Both for old version without issue and the new one with issue.

also please try git master to see if it is resolved there, there is also precompiled files available at http://boot.ipxe.org

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2015-11-21, 23:20
Post: #3
RE: Incorrect attempt to use root-path
(2015-11-21 20:26)NiKiZe Wrote:  Could you gives some more info to reproduce the issue?
An example root-path that you have confirmed to have this issue, as well as version number based on git commit that is shown as 1.0.0+ (gitid).
Both for old version without issue and the new one with issue.

also please try git master to see if it is resolved there, there is also precompiled files available at http://boot.ipxe.org

Example root-path (served by dnsmasq, so this is dnsmasq syntax):

Code:
dhcp-option=option:root-path,192.168.200.201:/lincor/terminals

*Working* version is as packaged for Ubuntu 14.04: this is git commit #c3d1e78;
git HEAD on master that I originally tried is commit #ed0d7c4;
My modified (and working) version is based on #ed0d7c4 with the patch shown in my original post;
Very latest master, just pulled a few minutes ago, is commit #309c588, and this still displays the issue.

I tried attaching some screen-grabs but for some reason the upload failed. The error actually reported (by the latest version) is:

Code:
Could not open SAN device: Operation not supported (http://ipxe.org/3c092003)
No more network devices

The working versions (Ubuntu, and latest with my own patch) report instead:

Code:
Ignoring unsupported root path

and then continue to boot properly (and from looking at the code, that warning message is not unexpected).

I haven't tried any pre-built binaries other than that in the Ubuntu 14:04 distro, since I have it working with a simple patch to the latest.
Find all posts by this user
Quote this message in a reply
2015-11-22, 13:35
Post: #4
RE: Incorrect attempt to use root-path
angusj: Can you run a git bisect (http://ipxe.org/howto/bisect) to figure out exactly which commit introduced the bug and report back what git bisect tells you here?
Visit this user's website Find all posts by this user
Quote this message in a reply
2015-11-22, 15:30
Post: #5
RE: Incorrect attempt to use root-path
I suspect the bug crept in while trying to simplify some tests on root_path, in function "netboot(...)", in src/usr/autoboot.c. Result of git bisect:
Code:
53d2d9e3c37d6170341818a254e18d341ee15511 is the first bad commit
commit 53d2d9e3c37d6170341818a254e18d341ee15511
Author: Michael Brown <mcb30@ipxe.org>
Date:   Wed Aug 26 22:35:42 2015 +0100

    [uri] Generalise tftp_uri() to pxe_uri()
    
    Merge the functionality of parse_next_server_and_filename() and
    tftp_uri() into a single pxe_uri(), which takes a server address
    (IPv4/IPv6/none) and a filename, and produces a URI using the rule:
    
     - if the filename is a hierarchical absolute URI (i.e. includes a
       scheme such as "http://" or "tftp://") then use that URI and ignore
       the server address,
    
     - otherwise, if the server address is recognised (according to
       sa_family) then construct a TFTP URI based on the server address,
       port, and filename
    
     - otherwise fail.
    
    Signed-off-by: Michael Brown <mcb30@ipxe.org>

:040000 040000 049d01d87fd2bf3a79e50a272564a91d6cd33963 6d8fc518906fdb4f9ba419c4878742811de7ac55 Msrc
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)