From owner-freebsd-hackers@freebsd.org Sat May 20 11:52:27 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E9BED76595 for ; Sat, 20 May 2017 11:52:27 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE701251 for ; Sat, 20 May 2017 11:52:27 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id 2D499D76594; Sat, 20 May 2017 11:52:27 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CEA5D76593 for ; Sat, 20 May 2017 11:52:27 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FBA11250 for ; Sat, 20 May 2017 11:52:27 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by freefall.freebsd.org (Postfix, from userid 1235) id 2E08A642D; Sat, 20 May 2017 11:52:26 +0000 (UTC) Date: Sat, 20 May 2017 13:52:25 +0200 From: Baptiste Daroussin To: hackers@FreeBSD.org Subject: pxe/efi loader rootpath protocols Message-ID: <20170520115225.chsy4phzznik6ow4@ivaldir.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uul3ndhmpsguhdav" Content-Disposition: inline User-Agent: NeoMutt/20170428 (1.8.2) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 May 2017 11:52:27 -0000 --uul3ndhmpsguhdav Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, In FreeBSD current some changes happened in the loader regarding pxeboot/loader.efi when pxe booting. The goal is to be able to support natively multiple protocols (at first: nfs, tftpfs) in the future http. After having gone some hackish way to avoid problem with chainloading with iPxe chainloading (which I will explain below) I want to move to a proper way. currently in releases if one passes via dhcp root-path ip:path the pxeloader will try look for a nfsroot on the nfs server under the path if one set root-path path the loader will look for a nfsroot under on the nfs server located on the same machine the pxeboot was loader from via tftp To activate the support for tftpfs by default in the loader, I looked for a way to be able to specify the protocol in the dhcp request. The natural direction would have been to add the protocol scheme in the root-path tftp://ip/path and add a new nfs://ip/path Extending the current supported list of root-path (aka not breaking existing setup). While it looked good, I quickly found a problem: chainloading from ipxe which is for example the default for net booting from qemu in bios mode. ipxe already expect a scheme:/ and knows about tftp:/ but expect something else so it will not load the pxeboot but try to boot directly from tftp:/ So I tried to workaround it by not changing the root-path but abusing a dhcp option that defined a tftpserver to specify to the pxeboot it needs to use tftpfs and not nfs. While it worked, not all dhcp servers supports that, and that is still a problem for the day we add http support. The new approach I would like to go with it having a proper URI parser in libstand for pxeboot/loader.efi to use and ignore the issue with iPXE. Tell the people to configure properly their dhcp server (iPXE is provide a user-class information IPXEBOOT) so the dhcp servers can avoid sending root-path to iPXE for machines supposed to boot on pxeboot. The loader issueing a dhcp request itself it will get the proper root-path and will do the right thing. If you see any problem with this approach please tell it quickly. I want to go fast as I want it in FreeBSD 11.1 I will issue a review soon Best regards, Bapt --uul3ndhmpsguhdav Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlkgLfcACgkQY4mL3PG3 Plo3bg//eQNA8Gkn/DV8CCXTVMDrablaBoZUBGHPxVSmLCnTpuLrm+TO31M0H/VP REZGrTeCv0bhjvo9mX50PhEVJVYJXBBtD4ZZohKa9oEJOv8eywcm9ThR/kHV1C49 gSzFFDavWDSVtZtUBztty5M0slOZ4Y6MBYvpn+tUfjuY1uYJ58lIS+X7+4TaMyeU m0qAOuBbHX9anCvHV/GadwippmJVRBgW6Dim5K65Jjwmga7WEzo8XHMW2/9Sg/Bq WtGPY617Fe4wlzwGmyBUnn9LVAIXL7tKGjIPE1IKnEUVv0VCuJsavvjDJU/vwvBW QXYuLCVj0yw1NihnkNZH85w931aZkwSF5lrhUSsG/iz+5U5/5UfpwJGAX5A2HbLF 8dtGX87tYmQChq1xZPxlRM35OJggGKqeUrxrXCFqZyIm+wJuCqNFl+bQcQpOwKIW SK0TU3gkdIrjklZQK4VUzHL0k+eZRqqCPGpGzPBQNHJ9ObXjxcfMhkz1Nn/6klqT Q1vrNvwb+RJG2yuh/cDfClo5RsOs9alUnjI9tmw8c361dPpzbYZgAESUh4Eu3krh gPDN4d/pi5+SJEvKGFVMPYzncoIhWF/pPlLvJjDI+jYq8wFGUYZ+Gl+dKzjZp1CM tC+OizeYblZIBXgSdKkvzc+qz4VbtFoTiOFwjgM1UdvQoaX1b14= =B8Xe -----END PGP SIGNATURE----- --uul3ndhmpsguhdav--