From owner-freebsd-current@freebsd.org Mon Aug 1 05:52:32 2016 Return-Path: Delivered-To: freebsd-current@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 11734BABA8B for ; Mon, 1 Aug 2016 05:52:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF3DB1717 for ; Mon, 1 Aug 2016 05:52:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x235.google.com with SMTP id f6so235354730ith.1 for ; Sun, 31 Jul 2016 22:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=3e0iRSDq5mh7OP9vtKicWros8IJDzooncCby/GmCTvE=; b=CzrtQz6qw2jkWxILQYUwpHn/Rb7naZDfW+BYQYb7BN5DQmTQ9A5CJruWmBLoeYbpOt B37CFs4U7elLjCiGt5HfIjxT4cWTIwmZYsq/133fYgNWCrNccgzYwgacI8VKzkKFoqYH JN0TXml+g1g2Y5cjhnLDkQdJIfiO2w/MizOLZyuAYShsl7upNVwmjnJ0617Po8rZMfen wtQ4tJ1WhRTMYC5Nk7oeOtqn8PWZYVgfK5ssHXOyyh3qYOheXxXLdY+Td0A7fIli3i5a mYitN8iA2TMRq2ZQmvqBbTkNKcTot3GP14BsKJIde9d0RCfJpxH2Vs8EUrEq4Ryi47oy xOXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=3e0iRSDq5mh7OP9vtKicWros8IJDzooncCby/GmCTvE=; b=mNCnAiYCttKpiCGAcelMYbEIuohdzj8hxsdKVv3jn6P4Q/bUF9d+dPbnS8Ij/tfp5R gvtgtmKr8TCiPHCotIgVlz6QiG4LZCygQMemL3BxX5c7Y/Kjk4XqjCCTCCusfVpufhx3 7ms38yprCD3TxtOdS2ObCyLKwK24fcGpb+15ienHrtLwzuiXgTKLAinrNQ3ZofBOJq0m 3m/JKHDXKer3QbhiPZCV6bMmJbHWNY5pEZXvlsnJhmHdappLP8ZLtXX5X99fcmBL1s6x dWKwBYq4M0h9kAbCJeyxGFTjxTh0xaF8TpNnhHaTEdidjxw1jOnIh6MChqgOVpHf6lwv TvDQ== X-Gm-Message-State: AEkoous9JvTLPclcywc310WiRSlGnaGZWUn+jtJojhD0OqlIdem+e7SWTGcoA6aYkkKv9rm8MT4CiN3YWl0fGg== X-Received: by 10.36.69.36 with SMTP id y36mr11637346ita.72.1470030751224; Sun, 31 Jul 2016 22:52:31 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.137.131 with HTTP; Sun, 31 Jul 2016 22:52:30 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <5489f1ff-d6db-c0e3-2be3-d3ae115a1f85@freebsd.org> References: <5bf35d8a-9941-9c6e-ea0a-20827ad26466@delphij.net> <5489f1ff-d6db-c0e3-2be3-d3ae115a1f85@freebsd.org> From: Warner Losh Date: Sun, 31 Jul 2016 23:52:30 -0600 X-Google-Sender-Auth: 5si01ciZShQBeNY1m2AYxbGLdNk Message-ID: Subject: Re: EFI boot: can we make loader.efi work as BOOT{x64, aa64, arm, ia32}.efi? To: Nathan Whitehorn Cc: FreeBSD Current Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 05:52:32 -0000 On Sun, Jul 31, 2016 at 12:51 AM, Nathan Whitehorn wrote: > > > On 07/30/16 23:20, Xin Li wrote: >> >> Hi, >> >> I finally got some time to explore the UEFI boot process (kudos to >> everyone who made this work!) and getting myself familiarize with the >> basics. >> >> One quick question -- Is there some technical restriction that prevents >> us from merging boot1.efi and loader.efi into one binary? >> >> Cheers, >> > > No technical reason (and, in fact, when you boot from CD, that's how it > works). The reason they are different is that we traditionally don't mount > the EFI partition and so make installworld can't replace things there. > boot1.efi is a basically static piece of code that doesn't need updates and > can load loader, which does get updates, from a UFS/ZFS system. boot1.efi is anything *BUT* a static piece of code. It was written to be such, but it's functionality is so limited that it is severely limiting what we can do on systems that want to, for example, boot off one partition after updating from another. That cannot be in loader.efi since that's part of the installed package. > loader.efi additionally assumes that it is started from the same partition > that contains the kernel, loader.conf, fstab, etc., which are also generally > not on the EFI partition (except in the CD case). That's likely one of several issues. Our EFI support is immature still. It works great if you have one disk that you want to boot off of. Once you stray far beyond that, there are many dragons. I think trying to merge the two is premature. Warner