From owner-freebsd-hackers@freebsd.org Sun Mar 24 22:55:46 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66E46154736C for ; Sun, 24 Mar 2019 22:55:46 +0000 (UTC) (envelope-from lc525@cam.ac.uk) Received: from ppsw-30.csi.cam.ac.uk (ppsw-30.csi.cam.ac.uk [131.111.8.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3DF6C103 for ; Sun, 24 Mar 2019 22:55:44 +0000 (UTC) (envelope-from lc525@cam.ac.uk) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cam.ac.uk; s=20180806.ppsw; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ikJGdQDobyV8t4imhSbPuUVFZg3VyU2kJhgFV3Ty6ro=; b=NIGq6rYjZPagms8mAq+oQuSdTU yQez4EHU+W3XsPY6rHqSYfX153H0KmUjROOyHfQJ6OWMh7rpheNEKrbrrWcVeexMWu7FASDE/2SMm D1A0G7ASke2czv2Pmi93bXYxolMaLK+BJ5pdgnwFsEeBYYsgLZN0Sb6U3pdPRCo54wdo=; X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from host81-158-109-169.range81-158.btcentralplus.com ([81.158.109.169]:57310 helo=[192.168.50.98]) by ppsw-30.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (PLAIN:lc525) (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1h8C1g-000SsP-ec (Exim 4.91) (return-path ); Sun, 24 Mar 2019 22:55:36 +0000 Subject: Re: netboot from NFS in an UEFI environment To: Rebecca Cran , freebsd-hackers@freebsd.org References: <2fafa521-0d34-522b-9a39-0689efbd7f3a@cam.ac.uk> <5e06c19f-4d95-afc5-155b-a1b2d3bed88b@bluestop.org> From: Lucian Carata Openpgp: id=BC9780C1939D37116415A1171AFE0D9B85AA6C3E Autocrypt: addr=lc525@cam.ac.uk; prefer-encrypt=mutual; keydata= mQINBFBJy24BEAC46IqhthUGwYfnmgYgSW9BPTK7P87t1zbpO3fQ//wqA3rvZmmHw8KHvTNZ r/YLXgFck9rGBY4uen1S4pla83B4gg9i3+oj15NnIAqFx1s2tWTRLcmhuEcxo4OAwnBXcVQk qe05Q7cwP2XjNqHz8R0HQNkxu2vGj6BVd5daSz+RCnc5peU0yPpaYLNTg6Z28/u5v8SUNo0L pU4il6N6+FGLVH4hRBgRDcrMp/1NLjOqRdq5Ul+49EF7Nnx8OniRp8fn60J6ilf5v/Zat3cD 1AjyBsbXeLZpkH2Peh22DjEr+MBrsW5Aqv/AadWAG1sUhl3LpNgU0I2e9W9eo7oYPCsKHxtM gK5/fg8IrC+fSghD5xpTUuPttRtUZPdomX8HK12yCJP9uLsf3oVPudBOkO8t4XsfNPsoTIHS cjI2bOQ2ZAV6HPYVqOuRd9AmV/0qHJbFrbzw694ZCZ+CnivKNWSANWVTgLtDd15oPQAoKZut SI1chHyTcT8/U/98QaJ7D3i+PB/xgIQmBYfnCzuNHdfsSONaiwzeiBxksUftnzHp4c0SlS34 Lom47DjuBN3+6Qae4AP475AFfwxWee1VWY7Jzc/YyM8gh7HeGKHEIOoygC/hBFBeGQOmlQTo uMoKfAm7V+ycMPWzQzddRembJs2IretTnkY7Xy33uhO5oAfGnwARAQABtB9MdWNpYW4gQ2Fy YXRhIDxsYzUyNUBjYW0uYWMudWs+iQJUBBMBCAA+A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6+gWJSgZduQzlpQ3Kkx5d1K8uusH57mOqpcHZgEoZs2APHpc7EvQ6E3B8Zra1Ey0FGA6kuB QtPk1+7AZ9cw5mB+k6UV7CK6jtoOnhWbDQY7ygvvfXACCPXYxO9aXqMHHkhUmJJHfST+XmS1 ZrxDABqLnjm5l/f5m1VQ1xB89fgSzdOQEOQ= Message-ID: <321ae3e8-dfd2-8119-fe80-98bec2721cb7@cam.ac.uk> Date: Sun, 24 Mar 2019 22:55:36 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <5e06c19f-4d95-afc5-155b-a1b2d3bed88b@bluestop.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 1A3DF6C103 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cam.ac.uk header.s=20180806.ppsw header.b=NIGq6rYj; spf=pass (mx1.freebsd.org: domain of lc525@cam.ac.uk designates 131.111.8.130 as permitted sender) smtp.mailfrom=lc525@cam.ac.uk X-Spamd-Result: default: False [-5.09 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:131.111.0.0/16]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DKIM_TRACE(0.00)[cam.ac.uk:+]; RCVD_IN_DNSWL_MED(-0.20)[130.8.111.131.list.dnswl.org : 127.0.11.2]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.01)[mx.cam.ac.uk,mx.cam.ac.uk,mx.cam.ac.uk]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-0.94)[ip: (-1.71), ipnet: 131.111.0.0/16(-0.85), asn: 786(-2.04), country: GB(-0.09)]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_PBL(0.00)[169.109.158.81.zen.spamhaus.org : 127.0.0.10]; ASN(0.00)[asn:786, ipnet:131.111.0.0/16, country:GB]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[cam.ac.uk:s=20180806.ppsw]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(0.00)[cam.ac.uk.dwl.dnswl.org : 127.0.11.2]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cam.ac.uk]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RBL_COMPOSITE_RCVD_IN_DNSWL_MED_DWL_DNSWL_MED(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Mar 2019 22:55:46 -0000 I am indeed passing root-path as {NFS-server-IP}:path/to/freebsd/root But it looks to me loader.efi doesn't look at root-path at all (at least not until it fails). I see it first searches for a device (currdev) and when it finds one (net0 in my case when PXE booting) it tries to determine whether it is a valid device in sanity_check_currdev() by doing: > stat("/boot/defaults/loader.conf") > stat("/boot/kernel/kernel") Of course, having no other information at this stage (as in, the actual root path), this fails. Now, I've tried overwriting currdev (by explicitly setting rootdev) but without success. The manual says "currdev Selects the default device. Syntax for devices is odd." but I don't know whether it would be possible to pass information about both the device and a root path (for example). All the pieces seem to be there, as you mention. So before digging deeper I thought I would ask whether this is a supported scenario or not (i.e should it "just work"), or whether I'm doing something obviously silly. in iPXE I'm currently doing: chain nfs://{path/to/loader.efi} root-path={NFS-server-IP}:path/to/freebsd/root dhcp.root-path={same as root-path} I'm passing root-path manually instead of through DHCP as I've been playing around with various options to see what might work; i've checked that when loader.efi starts it does have root-path set correctly (by executing `show root-path`) --- Lucian On 3/22/19 3:40 AM, Rebecca Cran wrote: > On 3/20/19 11:21 AM, Lucian Carata wrote: > >> Looking through the source code (stand/efi/loader/main.c) I see that there is an attempt to list devices, with a comment saying "this handle list is only for netboot" -- which shows that at least netbooting on UEFI has been considered, but I'm not sure how to pass the path of the NFS root so that the boot continues. >> >> Any ideas on how to do this (or something equivalent) would be greatly appreciated. > > > stand/efi/conf.c does have nfs_fsops, so it should be supported. Maybe an obvious question, but have you tried setting the DHCP option 'root-path' ? > > > -- > > Rebecca Cran >