From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::22e; helo=mail-wr0-x22e.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x22e.google.com (mail-wr0-x22e.google.com [IPv6:2a00:1450:400c:c0c::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 304AB2035A7B1 for ; Thu, 16 Nov 2017 08:04:46 -0800 (PST) Received: by mail-wr0-x22e.google.com with SMTP id w95so4411329wrc.2 for ; Thu, 16 Nov 2017 08:08:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=H2mZs21Z88KLvUs1Gsh/F6IT6BdMtpWNaq8ADj4NsdE=; b=DOHwD/shKNnVyU0mt/2FLBNNMhLDeAaxx/ISF99CtGikrXTPvmmGCVqVveJIJg3SVP SqMMt9Ct3BrGt6P3gEPb8uV30eTeHGBLUPADxIewWNRGO9aNzA3B0iy4Qy+pKDbz0mur P2+D7M/Do2ISGw6MBH/ctrpjMey/1+myE4BxI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=H2mZs21Z88KLvUs1Gsh/F6IT6BdMtpWNaq8ADj4NsdE=; b=FYVxyXL9EpTuFl34GW8ORi2PDBk1VnIJQ8x7fjMqAhkxh45q5lw0ZGv/fiZumlO/PL hhpVf50uVtvNC7J5M4N7XqR+5+At0pCYUDP+IRfAzLePMgvaAcrAS6uGuMkeLECTFdyP F3Y1125/fx6Wnb5WRn1qSeeQWRN7gsxEW8gV4bDdLNpNQM9CYgmukbppfMhKk+9N7EjF qV2MyxsBIDcH2rWCesVt3P7IB5dWxaeVSdIikMB/lUsLLuJfR+W1KnyDbq5ualOsTRGD GVqT5ZHuAqXAkYhg86y/xPtev8F/6mbR/RNVLSFdYPHj8Cwt9Qhy3BtgBnHT7gYmpPBU aaAQ== X-Gm-Message-State: AJaThX7EDQvD1CpvplAUlpvF91yPmha/c0MvyK8IscwvO21ch1AcMBTq lPgPlpmkQAygZrwscvfPlDceWw== X-Google-Smtp-Source: AGs4zMbsllxNc/bZEeHMtlxgd5bZnl8X3gwARIyd0e8E9Vh/f2crW+TH6WAV6zoAMY1wHtEJ4BTN6Q== X-Received: by 10.223.175.100 with SMTP id z91mr1838905wrc.138.1510848534929; Thu, 16 Nov 2017 08:08:54 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id j21sm876531wre.86.2017.11.16.08.08.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Nov 2017 08:08:53 -0800 (PST) Date: Thu, 16 Nov 2017 16:08:51 +0000 From: Leif Lindholm To: Haojian Zhuang Cc: "edk2-devel@lists.01.org" , Fathi Boudra Message-ID: <20171116160851.5eha5aahdk4mosxx@bivouac.eciton.net> References: <5efb001e-f292-9f22-edae-a617147749c6@linaro.org> <20171108135322.stnmshxqjaxu5xhx@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: GRUB issue on device priority X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Nov 2017 16:04:47 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Apologies for delay in responding. On Thu, Nov 09, 2017 at 04:41:55PM +0800, Haojian Zhuang wrote: > > > In the HiKey platform, I prepared the same driver for both eMMC and > > > SD. So the device paths are in below. > > > SD: /HardwareVendor(0d51905b-b77e-452a-a2c0-eca0cc8d514a)[9: 00 e0 23 f7 00 00 00 00 00 ]/UnknownMessaging(1a)/EndEntire > > > eMMC: /HardwareVendor(0d51905b-b77e-452a-a2c0-eca0cc8d514a)[9: 00 d0 23 f7 00 00 00 00 00]/UnknownMessaging(1d)/Ctrl(0)/EndEntire > > > > > > #define MSG_SD_DP 0x1A > > > #define MSG_EMMC_DP 0x1D > > > > > > In the second level, the device paths are different. > > > > > > And GRUB resort the sequence by ascending order (with above > > > code). So SD device always gets higher priority than eMMC device. > > > > > > If we always use installer to install OS, it may not an issue. Since > > > installer could create grub.cfg by itself. But it imports another > > > issue on lacking of persistent variable storage. And we need to > > > deploy system without installer on embedded device. > > > > Yes, this is the bit which is interesting, and why I requested you > > post this problem to edk2-devel. > > > > I believe that we need to have a sensible way to deal with embedded > > platforms that do not have operating systems "installed" to them, but > > rather written as images to flash devices. > > > > So, can you clarify a few things for me?: > > - Where is GRUB located in your (pre-SD) system? > > In eMMC. > > > - Where is GRUB located in your SD system? > > In SD. > > > - Are you looking for a way to support GRUB being located on either > > eMMC or SD? Or are you looking to always have GRUB loaded from eMMC? > > GRUB could be located in either in eMMC or SD. OK, so which one should be loaded in preference if both exist? I.e., what if you write a GRUB to eMMC via USB uplink, and at some later point you insert an uSD card? One (hackish, but at least predictable) way of resolving this would be to implement a PlatformBootManagerLib that never connects more than one of those devices. Alternatively one that always disconnects the one not used for booting. (Yes, I always argue that we should try to use a single library across most/all ARM platforms, but in order to figure out the useful abstractions that would make this possible, it would be worth to have some different versions implementing different features.) / Leif