Skip to contentSkip to conversation

Buildroot cleanup

RFC PATCH New angus salkeld 4 participants 6 messages Sep 8, 2009 – Sep 9, 2009

lore
Share & tools
lore
#0 lore raw

cover Buildroot cleanup

Comments inline.

Quoted 32 lines · Thomas Petazzoni

Hello,

I would like to propose a few patches to start a cleanup of Buildroot. My goal is not only to cleanup Buildroot internally, but also to clean it up so that it is easier to understand for our users.

This thread is meant to be a preliminary discussion only and is not yet a request for inclusion, because :

* Some of the proposed changes remove features that I think confuse our users and are not central in Buildroot operation, but others might have different opinion on the matter ;

* The changes are relatively invasive and I did only limited testing on them.

* The documentation is not updated with the changes. I'm waiting for the community opinion on the changes before spending time to update the documentation

While the commit logs gives all the details, I would like to give an quick overview of the proposed changes :

1. Remove the "project" feature.

This feature is meant to allow an user to build a Linux system for several similar platforms where the differences are only in Busybox, kernel and U-Boot configuration. While this feature might be useful in some very specific cases, my opinion is that it adds far too much complexity in Buildroot compared to the added-value it gives.

Quoted 9 lines

Removing this feature allows to instantly make the directory layout a lot simpler to understand for a newcomer (no strane project_build_ARCH directory anymore !)

2. Remove the BOARD/LOCAL feature.

This mechanism is a duplication of something that could already be done in a different way: by adding a new target in target/device/.

Quite a few of our engineers like this feature.
When you are testing that a change doesn't break other targets it is nice to have a shell per "board" and just be able to run "make" in each to re-build.

Is the O= a direct replacement for this?

Quoted 13 lines

3. By default, put the output directories in a single directory, named output/.

Nothing complex, it just clarifies the tree for a new user.

4. Remove BR2_TOPDIR_PREFIX and BR2_TOPDIR_SUFFIX

The same thing can be done with O=

5. Rename the output directories with more sensible names.

In the output directory, we now have

Quoted 8 lines

- build/ where all the packages are built
- images/ where the final kernel and rootfs images are stored
- staging/ the staging directory (containing the development files and libraries compiled for the target)
- target/ which contains the target root filesystem
- host/ which contains all the host programs
- stamps/ which contains the stamps files

We have a a number of boards to build and this is going put the burden on the end user to handle moving the output directory around. Not very user friendly for people who use buildroot in anything but the simplest case.

Please still support the ability to build multiple targets within the same buildroot (in configuration). One option would be to make "O=<dir>" a configuration option (defaulting to the output directory).

Another suggestion would be to completely separate out the toolchain into a new package "buildcross.git" that only builds the cross toolchain and then buildroot always uses the external toolchain. It would make buildroot's toolchain setup simpler (one toolchain mode). And make sharing toolchains more obvious.

Regards
Angus Salkeld

Quoted 7 lines

Thanks for your input,

Thomas
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#1 lore raw

cover Buildroot cleanup

Hi,

Quoted 5 lines · angus salkeld

Another suggestion would be to completely separate out the toolchain into a new package "buildcross.git" that only builds the cross toolchain and then buildroot always uses the external toolchain. It would make buildroot's toolchain setup simpler (one toolchain mode). And make sharing toolchains more obvious.

I like that idea. Can't really judge if it would be a success, but it seems like a nice solution that has the potential to simplify things.

Sven

#2 lore raw

cover Buildroot cleanup

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sven" == Sven Neumann <[email protected]> writes:

Sven> Hi,

Quoted 5 lines · angus salkeld
Quoted 5 lines

Another suggestion would be to completely separate out the toolchain into a new package "buildcross.git" that only builds the cross toolchain and then buildroot always uses the external toolchain. It would make buildroot's toolchain setup simpler (one toolchain mode). And make sharing toolchains more obvious.

Sven> I like that idea. Can't really judge if it would be a success, but it Sven> seems like a nice solution that has the potential to simplify things.

I have been thinking about it myself. *REALLY* supporting toolchains for all the different architectures / variants, uclibc and (e)glibc and following up on compiler bugs takes quite some effort (and noone seems willing to do it for buildroot), so maybe the best long term solution is simply to deprecate the toolchain building stuff and just recommend crosstool-ng instead?

This would make BR less selfcontained / one-stop-shop though.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

cover Buildroot cleanup

Le Tue, 08 Sep 2009 23:27:41 +0200,
Peter Korsgaard <[email protected]> a ?crit :

Quoted 6 lines

I have been thinking about it myself. *REALLY* supporting toolchains for all the different architectures / variants, uclibc and (e)glibc and following up on compiler bugs takes quite some effort (and noone seems willing to do it for buildroot), so maybe the best long term solution is simply to deprecate the toolchain building stuff and just recommend crosstool-ng instead?

That was my plan...

Quoted 1 line

This would make BR less selfcontained / one-stop-shop though.

until I met Buildroot users (I mean not end-users but organizations using Buildroot as the build system they ship with their devices) who told me that the selfcontained nature of BR was something they really liked.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#4 lore raw

cover Buildroot cleanup

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hi,

Thomas> That was my plan...

Quoted 1 line
Quoted 1 line

This would make BR less selfcontained / one-stop-shop though.

Thomas> until I met Buildroot users (I mean not end-users but organizations Thomas> using Buildroot as the build system they ship with their devices) who Thomas> told me that the selfcontained nature of BR was something they really Thomas> liked.

Yes, I know - I like it myself ;) But maybe integrating crosstool-ng support would be good enough?

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

cover Buildroot cleanup

In reply to angus salkeld

Hello,

Thanks for your comments!

Le Wed, 09 Sep 2009 07:54:25 +1200,
"angus salkeld" <[email protected]> a ?crit :

Quoted 10 lines
Quoted 6 lines

2. Remove the BOARD/LOCAL feature.

This mechanism is a duplication of something that could already
be done in a different way: by adding a new target in target/device/.

Quite a few of our engineers like this feature.
When you are testing that a change doesn't break other targets it is nice to have a shell per "board" and just be able to run "make" in each to re-build.

Let's say your vendor name is Foo and you have two boards Bar1 and Bar2. Then you would create the following directories:

target/device/foo/bar1
target/device/foo/bar2

In these directories you would have :

* foo_bar1_defconfig and foo_bar2_defconfig, which are the default Buildroot configuration for the two boards

* The Linux kernel configuration file

* Optionnaly, a Busybox configuration file

* Optionnaly, a target skeleton and a device table

Then, to build a board, you would just do :

make foo_bar1_defconfig
make

or for the other board:

make foo_bar2_defconfig
make

This is a mechanism that currently exists, you can try it by yourself to verify it matches your requirements. I think the BOARD/LOCAL feature is just a duplication of this.

Of course, there's an obvious lack of documentation on this mechanism. But this is something I'm working on currently.

Quoted 9 lines
Quoted 8 lines
     - build/    where all the packages are built
     - images/   where the final kernel and rootfs images are stored
     - staging/  the staging directory (containing the development
files and libraries compiled for the target)
     - target/   which contains the target root filesystem
     - host/     which contains all the host programs
     - stamps/   which contains the stamps files
Quoted 8 lines

We have a a number of boards to build and this is going put the burden on the end user to handle moving the output directory around. Not very user friendly for people who use buildroot in anything but the simplest case.

Please still support the ability to build multiple targets within the same buildroot (in configuration). One option would be to make "O=<dir>" a configuration option (defaulting to the output directory).

That could be an option, if that makes it easier to use for your users.

Sincerly,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com