Subject: Re: [bug#31404] Add installer support for u-boot imx6 boards.

From: Danny Milosavljevic <[email-masked]>
Date: Fri, 11 May 2018 12:29:26 +0200

Hi Vagrant,

On Thu, 10 May 2018 10:47:54 -0700
Vagrant Cascadian <[email-masked]> wrote:

> Add support to install u-boot for wandboard and mx6cuboxi, and add
> u-boot target and installer support for novena.
> 
> Tested using GuixSD on wandboard solo and novena. The mx6cuboxi target
> uses the same device offsets, and worked with manual installation.

Cool!

> It should be noted that the offsets for installing u-boot.img on imx6
> targets conflict with a typical GPT partition table header; works fine
> with dos partition table headers. I'm not sure what safeguards could be
> added to detect that. This also may not be unique to imx6 targets
> (e.g. pine64 u-boot/atf also has a similar issue).

Yeah, and Allwinner A10, A20, R40 etc have the same problem.  I've talked
to parted upstream about it so that at least the new partition tables are
not created in a stupid way - but movement is slow.

> Also, the novena patch has a known flaw, in that it requires copying the
> u-boot.img file to the first partition rather than writing it to a raw
> offset on the mmc device.

Yeah, I guess it's fine to use mtools in the installer.

> Not sure how to handle that exactly, as partitioning is typically a
> manual process in guixsd?

Yeah, for a first step we could just check sanity (in this case check
whether mcat failed or not).

> If nothing else, merging only the wandboard and mx6cuboxi patches and
> only including the u-boot target for novena might make sense. Another
> option would be to patch novena to load u-boot.img from an offset rather
> than a filesystem, though I doubt that will be accepted in u-boot
> upstream.

There are lots of boards which need that setup anyway - most notably
x86_64 UEFI systems - so we have to handle the case anyway.

I vote for using mtools.

I applied your patches to guix master.