From: Maxime Ripard Date: Fri, 17 Nov 2017 09:27:13 +0100 Subject: [U-Boot] [PATCH 3/4] sunxi: Add default partition scheme In-Reply-To: <716f0816-ec3c-e581-2332-7ab1dbe53a11@arm.com> References: <20171115101151.11382-1-maxime.ripard@free-electrons.com> <20171115101151.11382-4-maxime.ripard@free-electrons.com> <5945773e-f80f-8205-41d8-6a68f7263cde@suse.de> <20171116112113.enn6bdjjpnbnbe4b@flea> <716f0816-ec3c-e581-2332-7ab1dbe53a11@arm.com> Message-ID: <20171117082713.wjqfjigwi65pu5pr@flea> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On Thu, Nov 16, 2017 at 11:41:57AM +0000, Andre Przywara wrote: > >> If I understand this correctly, these are default settings for > >> U-Boot's "mtdparts default" command, which honestly I didn't even > >> know existed so far. > > > > No, this has nothing to do with MTD. It's a default GPT partitioning > > scheme. And only when you want to create the table from U-Boot, it > > will not mangle with any pre-existing partition table if there is any > > (unless you tell U-Boot to overwrite it, of course). > > This is what I tried to say: It only affects you if you use U-Boot's > partitioning command, which you probably won't do if you are running an > off-the-shelf distribution installer. Is that understanding correct? It is :) > >> So in a distribution scenario I wouldn't expect somebody to actually use > >> this. Instead you boot from a (possibly unpartitioned) SD card with just > >> U-Boot on it or from SPI flash, then launch an installer from somewhere > >> (PXE, USB drive) and let it do its job. No U-Boot partition involved. > >> And even if you use mtdpart, you can always override these default > >> settings on the command line. > > > > Like I was telling Alexander, that makes a number of assumptions, the > > two most obvious one being that you have an installer and that you > > want to use it, both with reasonable reasons on why they wouldn't be > > true. > > > > More tailored fit distros like ELBE, yocto or Buildroot will not have > > an installer in the first place but an image. > > > > And even if you have an installer for the distro you want to use, if > > you ever go to production, you will not use it since the time spent to > > flash a pre-filled image compared to running the installer is > > significantly lower. And time is money :) > > > > Just like plugging / unplugging microSD card isn't really realistic in > > that scenario. > > I don't argue this (see above) and surely understand that generic > installers don't fly when it comes to bootstrapping devices. > > But my understanding is that both Alex and Karsten don't really care > about this usage scenario, but instead are more looking into generic > distribution installers, which use U-Boot merely to launch grub. > > Actually I wanted to help you out here by pointing out that their > concerns don't really apply to this patch ;-) It's good that we agree then :) > >> Does mtdparts even use partition tables (MBR/GPT)? mtd sounds quite > >> Android-y/embedded to me (passing partition information via command line). > >> > >> So apart from that I think it's good to have a default FAT/ESP > >> partition, also for storing the environment. > > > > What is the typical size of the files you usually put in there? My > > actual question being is 128MB enough, way too big or too small? The > > environment is just 128kB big at the moment, so it looks wayyyyy to > > big for me, but I have no idea what is usually stored in an ESP > > partition. > > 128MB is actually quite fine. I tend to use 150MB or 100MB. The Ubuntu > arm64 kernel is around 20MB, and you may want to store more than one of > those on the ESP, along with an initrd. I understand that distributions > may not use the ESP for that, but their own /boot partition. But this is > their choice. Also other OSes (BSDs?) want to use the ESP, so being too > miserly here may backfire. Ok. Given Alexander and Emmanuel answers, I guess that would cover it too, so we can leave it that way :) > Do you feel that's too big? We are talking about at least 8GB eMMCs > mostly here, right? Yeah, well, I guess I don't like wasted space. If you give me the choice between a partition mostly unused or the ability to store one more ripped CD, I'll take the latter any day. But if you guys need that space, I'm totally fine with it. > >> In a MBR/GPT scenario I would expect a big partition covering the whole > >> device causes headache later on. > > > > What kind of headaches? > > Just thinking if an installer wants to add partitions (swap, /home, ...) > it might be easier if some space is actually left unpartitioned. > But that's just my non-embedded experience, where adding partitions is > easier and safer, compared to deleting or resizing an existing partition. I guess I also have a side question here. How do the installers deal with the ESP partition? Would they create a new filesystem on it no matter what, or are they a bit smarter than that? My actual question being what will happen if one stores the U-Boot environment on that partition, and then runs an installer? Would the environment be gone? Thanks! Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: