guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARM bootloader installation in Guix


From: Mathieu Othacehe
Subject: Re: ARM bootloader installation in Guix
Date: Thu, 05 Sep 2019 10:32:13 +0200
User-agent: mu4e 1.2.0; emacs 26.3

Hey Danny,

I think the buildroot based importer and the genimage based installation
are both very good ideas! Combined with the system cross-compilation
serie I'm working on, we could turn Guix into a really nice tool to
configure, build and deploy images for a lot of boards.

I had a quick look to your importer. In the current implementation, the
importer outputs buildroot config strings (under the form BR2_ ...) and
we have to store them in gnu/bootloader/u-boot.scm as input of
make-buildroot-u-boot-package.

Would it be possible to keep the parsing/interpretation of those
buildroot config strings in the importer and directly output something
like:

(make-u-boot-package board triplet ... other relevant options)

this way, we do not depend of buildroot outside the importer?

WDYT?

Mathieu


Danny Milosavljevic writes:

> Hi,
>
> I've been thinking of ways to generalize the bootloader installation for
> ARM boards.  One of the most annoying parts of u-boot is that the u-boot 
> project
> does NOT include bootloader installers (something like grub-install does not
> exist in u-boot).
>
> A possible upstream project that builds ARM images is Buildroot (it's 
> basically
> a Linux distribution).
>
> First, it would [probably] be possible to use Buildroot directly, but they 
> have
> different policies like using *specific* u-boot versions, toolchain and 
> compiler
> versions etc--also it takes a LOT of time and space to do that, and for 
> something
> as tiny as u-boot that would be kinda silly.
>
> A second way would be to use the buildroot config files and "genimage.cfg"s
> in order to extract (1) which u-boot configuration to use and (2) have 
> genimage
> build the bootloader parts of the image (or the entire image just with empty 
> rootfs).
>
> For that, we would (for example):
>
> * Read configs/orangepi_zero_defconfig to find:
>   BR2_TARGET_UBOOT=y
>   BR2_TARGET_UBOOT_BOARD_DEFCONFIG="orangepi_zero"
>   BR2_TARGET_UBOOT_NEEDS_DTC=y
>   BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
>   BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin"
>   BR2_TARGET_UBOOT_BOOT_SCRIPT=y
>   BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE="board/orangepi/orangepi-zero/boot.cmd"
>   BR2_PACKAGE_HOST_DOSFSTOOLS=y
>   BR2_PACKAGE_HOST_GENIMAGE=y
>   BR2_PACKAGE_HOST_MTOOLS=y
>   BR2_PACKAGE_HOST_UBOOT_TOOLS=y
>   BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
>   BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/orangepi/orangepi-zero/genimage.cfg"
>
> * Then read board/orangepi/orangepi-zero/genimage.cfg to find:
>
>   image boot.vfat { ... which files to put there }
>   image sdcard.img { ... which files and partitions to put there }
>
> We could reimplement genimage ourselves, but I suggest we just use genimage
> instead (I've packaged it in guix master).
>
> The rootfs size would need to be dynamically adjusted (the "genimage.cfg"s
> usually specify a fixed size)--not sure how annoying that would be.
>
> That way we could generalize u-boot bootloader installation without undue
> maintenance effort on our side.
>
> A possible way forward could be to implement an importer to figure out all
> the boards to put into gnu/bootloader/u-boot.scm, including an installer that
> uses genimage in order to install the bootloader (and, really, ideally
> partitions everything else--so it should run much earlier or else we'd have to
> do extra modifications that could be avoided).
>
> I've started branch "wip-buildroot" in order to do that.
>
> To try it out:
>
> * Invoke: guix import buildroot sheevaplug_defconfig
> * Stick the result into gnu/bootloader/u-boot.scm (with appropriate "define")
> * Build system image using it.
>
> (It's not finished yet but it should provide a basis for discussion...)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]