Skip to contentSkip to conversation

Tesla is using Buildroot

Buildroot Thomas Petazzoni 11 participants 14 messages May 11, 2018 – May 22, 2018

lore
Share & tools
lore
#0 lore raw

Hello,

I met a few engineers from Tesla at the Embedded Linux Conference in March, who told me they are using Buildroot. Now that their tree is publicly available online, I can share this information.

Their Buildroot tree is at:

https://github.com/teslamotors/buildroot

Unfortunately, it looks a bit ugly in terms of commit history: just a few huge comments that mix tons of changes together. I was told the autopilot configurations are there for now, but infotainment configurations should be added in the near future.

It's of course very nice to see Buildroot being used on board of those vehicles!

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#1 lore raw

Hi,

Quoted 15 lines · Thomas Petazzoni

Hello,

I met a few engineers from Tesla at the Embedded Linux Conference in March, who told me they are using Buildroot. Now that their tree is publicly available online, I can share this information.

Their Buildroot tree is at:

https://github.com/teslamotors/buildroot

Unfortunately, it looks a bit ugly in terms of commit history: just a few huge comments that mix tons of changes together. I was told the autopilot configurations are there for now, but infotainment configurations should be added in the near future.

Quoted 10 lines

It's of course very nice to see Buildroot being used on board of those vehicles!

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

I've had a quick look at what's inside. Here is what I found:
- it seems based on buildroot 2016.05, with backports from more recent versions; but at its core it's still a 2016.05
- there are a few packages tesla-{findutils, grep, bash, gzip, which, rsync} that are here with old versions to work around GPLv3
- there's a tesla-verity package which seems to be a custom init that checks the validity of the verity metadata and interacts with firmware to check soc lock status before calling dmsetup.
- there are a few packages that look like backports: python-dateutil, nanomsg, python-pytz, python-jsonschema
- tesla-binutils is a "real" host binutils (non-cross)
- there's tesla-libsystemd stub that builds a libsystemd with stubbed functions
- it has its own parallel building infrastructure, using the loglinear tool, first introduced in google fiber's buildroot implementation
https://gfiber.googlesource.com/buildroot/
- many packages are patched to modify behaviour, customize build
options: business as usual
- probably many things I've missed

I've added Olof in cc.

Regards,

Anisse

#2 lore raw

This is pretty neat! The main website should really have a prominent list of companies that use Buildroot.

Google/Tesla/GoPro etc etc. It would be good advertisement!

Adam

________________________________
From: buildroot <[email protected]> on behalf of anisse at astier.eu <[email protected]>
Sent: Friday, May 11, 2018 5:55:08 PM
To: Thomas Petazzoni
Cc: Olof Johansson; buildroot at uclibc.org
Subject: Re: [Buildroot] Tesla is using Buildroot

Hi,

Quoted 18 lines · Thomas Petazzoni

Hello,

I met a few engineers from Tesla at the Embedded Linux Conference in March, who told me they are using Buildroot. Now that their tree is publicly available online, I can share this information.

Their Buildroot tree is at:

https://github.com/teslamotors/buildroot

Unfortunately, it looks a bit ugly in terms of commit history: just a few huge comments that mix tons of changes together. I was told the autopilot configurations are there for now, but infotainment configurations should be added in the near future.

It's of course very nice to see Buildroot being used on board of those vehicles!

Quoted 7 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering
https://bootlin.com

I've had a quick look at what's inside. Here is what I found:
- it seems based on buildroot 2016.05, with backports from more recent versions; but at its core it's still a 2016.05
- there are a few packages tesla-{findutils, grep, bash, gzip, which, rsync} that are here with old versions to work around GPLv3
- there's a tesla-verity package which seems to be a custom init that checks the validity of the verity metadata and interacts with firmware to check soc lock status before calling dmsetup.
- there are a few packages that look like backports: python-dateutil, nanomsg, python-pytz, python-jsonschema
- tesla-binutils is a "real" host binutils (non-cross)
- there's tesla-libsystemd stub that builds a libsystemd with stubbed functions
- it has its own parallel building infrastructure, using the loglinear tool, first introduced in google fiber's buildroot implementation
https://gfiber.googlesource.com/buildroot/
- many packages are patched to modify behaviour, customize build
options: business as usual
- probably many things I've missed

I've added Olof in cc.

Regards,

Anisse
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180512/83146a35/attachment.html>

#3 lore raw
Quoted 49 lines

From: "ratbert90" <[email protected]>
To: anisse at astier.eu, "Thomas Petazzoni" <[email protected]>
Cc: "Olof Johansson" <[email protected]>, buildroot at uclibc.org
Sent: Friday, May 11, 2018 10:22:49 PM
Subject: Re: [Buildroot] Tesla is using Buildroot

This is pretty neat! The main website should really have a prominent list of companies that use Buildroot.

Google/Tesla/GoPro etc etc. It would be good advertisement!

Adam

From: buildroot <[email protected]> on behalf of anisse at astier.eu <[email protected]>
Sent: Friday, May 11, 2018 5:55:08 PM
To: Thomas Petazzoni
Cc: Olof Johansson; buildroot at uclibc.org
Subject: Re: [Buildroot] Tesla is using Buildroot
Hi,

Quoted 19 lines · Thomas Petazzoni

Hello,

I met a few engineers from Tesla at the Embedded Linux Conference in March, who told me they are using Buildroot. Now that their tree is publicly available online, I can share this information.

Their Buildroot tree is at:

[ https://github.com/teslamotors/buildroot |
https://github.com/teslamotors/buildroot ]

Unfortunately, it looks a bit ugly in terms of commit history: just a few huge comments that mix tons of changes together. I was told the autopilot configurations are there for now, but infotainment configurations should be added in the near future.

It's of course very nice to see Buildroot being used on board of those vehicles!

Quoted 7 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering
[ https://bootlin.com/ | https://bootlin.com ]

Quoted 5 lines

I've had a quick look at what's inside. Here is what I found:
- it seems based on buildroot 2016.05, with backports from more recent versions; but at its core it's still a 2016.05
- there are a few packages tesla-{findutils, grep, bash, gzip, which, rsync} that are here with old versions to work around GPLv3

... which highlights the need for some mechanism to blacklist licenses and warn the user in the configuration menu that a package cannot be selected because of license restrictions.

Quoted 8 lines

- there's a tesla-verity package which seems to be a custom init that checks the validity of the verity metadata and interacts with firmware to check soc lock status before calling dmsetup.
- there are a few packages that look like backports: python-dateutil, nanomsg, python-pytz, python-jsonschema
- tesla-binutils is a "real" host binutils (non-cross)
- there's tesla-libsystemd stub that builds a libsystemd with stubbed functions

Makes me wonder why they don't use a BR2_EXTERNAL.

Quoted 13 lines

- it has its own parallel building infrastructure, using the loglinear tool, first introduced in google fiber's buildroot implementation [ https://gfiber.googlesource.com/buildroot/ |
https://gfiber.googlesource.com/buildroot/ ]
- many packages are patched to modify behaviour, customize build
options: business as usual
- probably many things I've missed

I've added Olof in cc.

Regards,

Anisse

Signature · 3 lines
Carlos Santos (Casantos) - DATACOM, P&D
?Marched towards the enemy, spear upright, armed with the certainty
that only the ignorant can have.? ? Epitaph of a volunteer
#4 lore raw
Quoted 17 lines · Carlos Santos
Quoted 8 lines

From: "ratbert90" <[email protected]>
To: anisse at astier.eu, "Thomas Petazzoni" <[email protected]>
Cc: "Olof Johansson" <[email protected]>, buildroot at uclibc.org
Sent: Friday, May 11, 2018 10:22:49 PM
Subject: Re: [Buildroot] Tesla is using Buildroot

[...]

Quoted 8 lines

- there's a tesla-verity package which seems to be a custom init that checks the validity of the verity metadata and interacts with firmware to check soc lock status before calling dmsetup.
- there are a few packages that look like backports: python-dateutil, nanomsg, python-pytz, python-jsonschema
- tesla-binutils is a "real" host binutils (non-cross)
- there's tesla-libsystemd stub that builds a libsystemd with stubbed functions

Quoted 1 line

Makes me wonder why they don't use a BR2_EXTERNAL.

Probably because (AFAIK) it is not yet possible to override base package in a BR2_EXTERNAL. I have tripped on this myself a couple of times, and ended up providing a top-level Makefile in the repo for my BR2_EXTERNAL which downloads a certain version of the Buildroot tarball and applies a couple of patches over it, then proceeds to chain up to the Buildroot Makefiles passing the path BR2_EXTERNAL path down to them (so from the point of view of somebody building, they just download the BR2_EXTERNAL repo and do ?make foo_defconfig && make?).

It would be great to allow overriding base packages in a BR2_EXTERNAL ?

Cheers,

--
Adri?n ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180512/cfb2c8e2/attachment.asc>

#5 lore raw
Quoted 31 lines · Adrian Perez de Castro
Quoted 18 lines · Carlos Santos
Quoted 9 lines

From: "ratbert90" <[email protected]>
To: anisse at astier.eu, "Thomas Petazzoni" <[email protected]

Cc: "Olof Johansson" <[email protected]>, buildroot at uclibc.org
Sent: Friday, May 11, 2018 10:22:49 PM
Subject: Re: [Buildroot] Tesla is using Buildroot

[...]

Quoted 8 lines

- there's a tesla-verity package which seems to be a custom init that checks the validity of the verity metadata and interacts with firmware to check soc lock status before calling dmsetup.
- there are a few packages that look like backports: python-dateutil, nanomsg, python-pytz, python-jsonschema
- tesla-binutils is a "real" host binutils (non-cross)
- there's tesla-libsystemd stub that builds a libsystemd with stubbed functions

Quoted 1 line

Makes me wonder why they don't use a BR2_EXTERNAL.

Probably because (AFAIK) it is not yet possible to override base package in a BR2_EXTERNAL. I have tripped on this myself a couple of times, and ended up providing a top-level Makefile in the repo for my BR2_EXTERNAL which downloads a certain version of the Buildroot tarball and applies a couple of patches over it, then proceeds to chain up to the Buildroot Makefiles passing the path BR2_EXTERNAL path down to them (so from the point of view of somebody building, they just download the BR2_EXTERNAL repo and do ?make foo_defconfig && make?).

Quoted 8 lines

It would be great to allow overriding base packages in a BR2_EXTERNAL ?

Cheers,

--
Adri?n ?

Interesting. My solution is to have a base stock BuildRoot folder and then seperate company folder submodule.
In that submodule is a package directory and a patch directory. Any packages I want to overwrite I just move to
the company/packages folder and then remove the base package from the base package directory.

It's worked great for years that way. With the added benefit that when a new BuildRoot is released, it's as easy as
removing everything but the company folder, dumping the new buildroot into the base directory, and reapplying the
patches.

Adam

Quoted 5 lines

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180512/b665d91a/attachment.html>

#6 lore raw
In reply to Adrian Perez de Castro
Quoted 20 lines · Adrian Perez de Castro
Quoted 17 lines · Carlos Santos
Quoted 8 lines

From: "ratbert90" <[email protected]>
To: anisse at astier.eu, "Thomas Petazzoni" <[email protected]>
Cc: "Olof Johansson" <[email protected]>, buildroot at uclibc.org
Sent: Friday, May 11, 2018 10:22:49 PM
Subject: Re: [Buildroot] Tesla is using Buildroot

[...]

Quoted 8 lines

- there's a tesla-verity package which seems to be a custom init that checks the validity of the verity metadata and interacts with firmware to check soc lock status before calling dmsetup.
- there are a few packages that look like backports: python-dateutil, nanomsg, python-pytz, python-jsonschema
- tesla-binutils is a "real" host binutils (non-cross)
- there's tesla-libsystemd stub that builds a libsystemd with stubbed functions

Quoted 1 line

Makes me wonder why they don't use a BR2_EXTERNAL.

Quoted 8 lines

Probably because (AFAIK) it is not yet possible to override base package in a BR2_EXTERNAL. I have tripped on this myself a couple of times, and ended up providing a top-level Makefile in the repo for my BR2_EXTERNAL which downloads a certain version of the Buildroot tarball and applies a couple of patches over it, then proceeds to chain up to the Buildroot Makefiles passing the path BR2_EXTERNAL path down to them (so from the point of view of somebody building, they just download the BR2_EXTERNAL repo and do ?make foo_defconfig && make?).

I do the same thing. The top level Makefile exports BR2_EXTERNAL="..", there's a target for cloning and checking out a specific Buildroot revision, then there's a wildcard pattern at the end to pass any unrecognized targets up to Buildroot's Makefile, so things like "linux-menuconfig" still work.

It keeps my project repos nicely separated from upstream, and makes it easy to pull in upstream changes.

I also have a few custom targets for taking the generated filesystem images, and packing them up with an installer and manifest.

It would be nice if the manual covered some of these approaches, because when I first started using Buildroot, it wasn't immediately apparent how to do what I needed. Some examples would go a long way in that regard, I might see what I can do about that later.

Quoted 14 lines

It would be great to allow overriding base packages in a BR2_EXTERNAL ?

Cheers,

--
Adri?n ?

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

#7 lore raw
Quoted 40 lines · Joseph Kogut
Quoted 20 lines · Adrian Perez de Castro
Quoted 17 lines · Carlos Santos
Quoted 8 lines

From: "ratbert90" <[email protected]>
To: anisse at astier.eu, "Thomas Petazzoni" <[email protected]>
Cc: "Olof Johansson" <[email protected]>, buildroot at uclibc.org
Sent: Friday, May 11, 2018 10:22:49 PM
Subject: Re: [Buildroot] Tesla is using Buildroot

[...]

Quoted 8 lines

- there's a tesla-verity package which seems to be a custom init that checks the validity of the verity metadata and interacts with firmware to check soc lock status before calling dmsetup.
- there are a few packages that look like backports: python-dateutil, nanomsg, python-pytz, python-jsonschema
- tesla-binutils is a "real" host binutils (non-cross)
- there's tesla-libsystemd stub that builds a libsystemd with stubbed functions

Quoted 1 line

Makes me wonder why they don't use a BR2_EXTERNAL.

Quoted 8 lines

Probably because (AFAIK) it is not yet possible to override base package in a BR2_EXTERNAL. I have tripped on this myself a couple of times, and ended up providing a top-level Makefile in the repo for my BR2_EXTERNAL which downloads a certain version of the Buildroot tarball and applies a couple of patches over it, then proceeds to chain up to the Buildroot Makefiles passing the path BR2_EXTERNAL path down to them (so from the point of view of somebody building, they just download the BR2_EXTERNAL repo and do ?make foo_defconfig && make?).

I do the same thing. The top level Makefile exports BR2_EXTERNAL="..", there's a target for cloning and checking out a specific Buildroot revision, then there's a wildcard pattern at the end to pass any unrecognized targets up to Buildroot's Makefile, so things like "linux-menuconfig" still work.

It keeps my project repos nicely separated from upstream, and makes it easy to pull in upstream changes.

Quoted 7 lines

I also have a few custom targets for taking the generated filesystem images, and packing them up with an installer and manifest.

It would be nice if the manual covered some of these approaches, because when I first started using Buildroot, it wasn't immediately apparent how to do what I needed. Some examples would go a long way in that regard, I might see what I can do about that later.

I liked the split of having third party software in an upstream-based separate buildroot repo, and only proprietary components in BR2_EXTERNAL. That way it's easier to separate out the portion you need to share for compliance (i.e. see current github contents), while having a place to keep confidential material, work on new configs/products/prototypes/internal uses that are not yet released, etc in the BR2_EXTERNAL. As expressed above, wrapping it with a second layer of makefiles makes it relatively easy to deal with.

Removing the upstream package and adding it locally really is no different from replacing the contents in the repo. A rebase would do the same.

-Olof

#13 lore raw
In reply to Carlos Santos
Quoted 55 lines · Carlos Santos
Quoted 49 lines

From: "ratbert90" <[email protected]>
To: anisse at astier.eu, "Thomas Petazzoni" <[email protected]>
Cc: "Olof Johansson" <[email protected]>, buildroot at uclibc.org
Sent: Friday, May 11, 2018 10:22:49 PM
Subject: Re: [Buildroot] Tesla is using Buildroot

This is pretty neat! The main website should really have a prominent list of companies that use Buildroot.

Google/Tesla/GoPro etc etc. It would be good advertisement!

Adam

From: buildroot <[email protected]> on behalf of anisse at astier.eu <[email protected]>
Sent: Friday, May 11, 2018 5:55:08 PM
To: Thomas Petazzoni
Cc: Olof Johansson; buildroot at uclibc.org
Subject: Re: [Buildroot] Tesla is using Buildroot
Hi,

Quoted 19 lines · Thomas Petazzoni

Hello,

I met a few engineers from Tesla at the Embedded Linux Conference in March, who told me they are using Buildroot. Now that their tree is publicly available online, I can share this information.

Their Buildroot tree is at:

[ https://github.com/teslamotors/buildroot |
https://github.com/teslamotors/buildroot ]

Unfortunately, it looks a bit ugly in terms of commit history: just a few huge comments that mix tons of changes together. I was told the autopilot configurations are there for now, but infotainment configurations should be added in the near future.

It's of course very nice to see Buildroot being used on board of those vehicles!

Quoted 7 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering
[ https://bootlin.com/ | https://bootlin.com ]

Quoted 5 lines

I've had a quick look at what's inside. Here is what I found:
- it seems based on buildroot 2016.05, with backports from more recent versions; but at its core it's still a 2016.05
- there are a few packages tesla-{findutils, grep, bash, gzip, which, rsync} that are here with old versions to work around GPLv3

Quoted 3 lines

... which highlights the need for some mechanism to blacklist licenses and warn the user in the configuration menu that a package cannot be selected because of license restrictions.

I think Kconfig could solve this quite nicely. Make a selection menu such that you can choose what licenses you're willing to accept, and then make the respective packages depend on the license config (depends on LICENSE_GPLV3 etc)

Quoted 11 lines
Quoted 9 lines

- there's a tesla-verity package which seems to be a custom init that checks the validity of the verity metadata and interacts with firmware to check soc lock status before calling dmsetup.
- there are a few packages that look like backports: python-dateutil, nanomsg, python-pytz, python-jsonschema
- tesla-binutils is a "real" host binutils (non-cross)
- there's tesla-libsystemd stub that builds a libsystemd with stubbed functions

Makes me wonder why they don't use a BR2_EXTERNAL.

BR2_EXTERNAL is used but by splitting the contents between the buildroot repo and external, and keeping only things you don't want to share in the external one (proprietary apps, experimental work, random internal stuff that won't ship to the outside world and work on unreleased stuff) works well. The way the (separate but corresponding) configuration that's published is generated, the reference to BR2_EXTERNAL doesn't show up.

Quoted 7 lines
Quoted 7 lines

- it has its own parallel building infrastructure, using the loglinear tool, first introduced in google fiber's buildroot implementation [ https://gfiber.googlesource.com/buildroot/ |
https://gfiber.googlesource.com/buildroot/ ]
- many packages are patched to modify behaviour, customize build
options: business as usual
- probably many things I've missed

One thing that I'm not sure has been used all that much elsewhere is that there's a recursive invocation to generate the initramfs, and then build that into the kernel. Could maybe have been done as two separate toplevel builds with postprocessing, but this worked quite well.

-Olof

#8 lore raw
In reply to Olof Johansson
Quoted 10 lines · Olof Johansson
Quoted 9 lines · Joseph Kogut
Quoted 7 lines · Adrian Perez de Castro
Quoted 5 lines · Carlos Santos
Quoted 3 lines

From: "ratbert90" <[email protected]>
To: anisse at astier.eu, "Thomas Petazzoni" <[email protected]>

Makes me wonder why they don't use a BR2_EXTERNAL.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Probably because (AFAIK) it is not yet possible to override base package in a BR2_EXTERNAL. I have tripped on this myself a couple of times, and ended up providing a top-level Makefile in the repo for my BR2_EXTERNAL which downloads a certain version of the Buildroot tarball and applies a couple of patches over it, then proceeds to chain up to the Buildroot Makefiles passing the path BR2_EXTERNAL path down to them (so from the point of view of somebody building, they just download the BR2_EXTERNAL repo and do ?make foo_defconfig && make?).

Since the external mk file is included after all of buildroot's internal packages and infrastructure files, it's possible to re-define variables from buildroot packages in external. In some case this could can be a way to override or patch a buildroot package via BR2_EXTERNAL instead of as a patch to buildroot.

Quoted 6 lines
Quoted 5 lines

I do the same thing. The top level Makefile exports BR2_EXTERNAL="..", there's a target for cloning and checking out a specific Buildroot revision, then there's a wildcard pattern at the end to pass any unrecognized targets up to Buildroot's Makefile, so things like "linux-menuconfig" still work.

Quoted 8 lines

I liked the split of having third party software in an upstream-based separate buildroot repo, and only proprietary components in BR2_EXTERNAL. That way it's easier to separate out the portion you need to share for compliance (i.e. see current github contents), while having a place to keep confidential material, work on new configs/products/prototypes/internal uses that are not yet released, etc in the BR2_EXTERNAL. As expressed above, wrapping it with a second layer of makefiles makes it relatively easy to deal with.

We have a top-level project with a top level Makefile that contains the
BR2_EXTERNAL tree. I.e., the BR2_EXTERNAL tree is the top level
project. Buildroot exists as a git submodule in a directory of this project. We can update buildroot by pulling from upstream and rebasing and can git format-patch a patch to send to the list.

We patch buildroot if:
1. We think the patch is upstreamable.
2. There appears to be no reasonable way to accomplish what we want otherwise.

The top level makefile uses a pattern rule to provide a target for every defconfig that exists in br2-external/configs directory. It'll call buildroot's build with BR2_EXTERNAL and O set build that defconfig into an output directory. Or just do a buildroot *_defconfig call but not actually build.

buildroot sets itself up so that once you go to the output directory, there is a Makefile that will execute any buildroot target (menuconfig, pkg-rebuild, all, etc.) with BR2_EXTERNAL configured.

#9 lore raw
Quoted 3 lines · Trent Piepho
Quoted 2 lines · Olof Johansson
Quoted 1 line · Joseph Kogut

On Sat, May 12, 2018 at 6:27 AM, Adrian Perez de Castro <[email protected]> wrote:

[snip]

Quoted 32 lines
Quoted 6 lines
Quoted 5 lines

I do the same thing. The top level Makefile exports BR2_EXTERNAL="..", there's a target for cloning and checking out a specific Buildroot revision, then there's a wildcard pattern at the end to pass any unrecognized targets up to Buildroot's Makefile, so things like "linux-menuconfig" still work.

Quoted 8 lines

I liked the split of having third party software in an upstream-based separate buildroot repo, and only proprietary components in BR2_EXTERNAL. That way it's easier to separate out the portion you need to share for compliance (i.e. see current github contents), while having a place to keep confidential material, work on new configs/products/prototypes/internal uses that are not yet released, etc in the BR2_EXTERNAL. As expressed above, wrapping it with a second layer of makefiles makes it relatively easy to deal with.

We have a top-level project with a top level Makefile that contains the
BR2_EXTERNAL tree. I.e., the BR2_EXTERNAL tree is the top level
project. Buildroot exists as a git submodule in a directory of this project. We can update buildroot by pulling from upstream and rebasing and can git format-patch a patch to send to the list.

We patch buildroot if:
1. We think the patch is upstreamable.
2. There appears to be no reasonable way to accomplish what we want otherwise.

The top level makefile uses a pattern rule to provide a target for every defconfig that exists in br2-external/configs directory. It'll call buildroot's build with BR2_EXTERNAL and O set build that defconfig into an output directory. Or just do a buildroot *_defconfig call but not actually build.

Quoted 3 lines

buildroot sets itself up so that once you go to the output directory, there is a Makefile that will execute any buildroot target (menuconfig, pkg-rebuild, all, etc.) with BR2_EXTERNAL configured.

That's *exactly* the setup I've developed for one of my projects. I've been
meaning to export this to a buildroot-external superproject that people could reuse...

One thing though: I recently switched from git submodule to git subtree.
Submodules are really painful to work with when there are multiple developers who need to change both the supermodule and submodule. I haven't yet gotten around to using the subtree split functionality to export the upstreamable changes again, but it looks pretty convenient to use.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#10 lore raw

2018-05-15 22:18 GMT+02:00 Arnout Vandecappelle <[email protected]>:

Quoted 39 lines · Trent Piepho
Quoted 3 lines · Olof Johansson
Quoted 2 lines · Joseph Kogut
Quoted 1 line · Adrian Perez de Castro

[snip]

Quoted 32 lines
Quoted 6 lines
Quoted 5 lines

I do the same thing. The top level Makefile exports BR2_EXTERNAL="..", there's a target for cloning and checking out a specific Buildroot revision, then there's a wildcard pattern at the end to pass any unrecognized targets up to Buildroot's Makefile, so things like "linux-menuconfig" still work.

Quoted 8 lines

I liked the split of having third party software in an upstream-based separate buildroot repo, and only proprietary components in BR2_EXTERNAL. That way it's easier to separate out the portion you need to share for compliance (i.e. see current github contents), while having a place to keep confidential material, work on new configs/products/prototypes/internal uses that are not yet released, etc in the BR2_EXTERNAL. As expressed above, wrapping it with a second layer of makefiles makes it relatively easy to deal with.

We have a top-level project with a top level Makefile that contains the
BR2_EXTERNAL tree. I.e., the BR2_EXTERNAL tree is the top level
project. Buildroot exists as a git submodule in a directory of this project. We can update buildroot by pulling from upstream and rebasing and can git format-patch a patch to send to the list.

We patch buildroot if:
1. We think the patch is upstreamable.
2. There appears to be no reasonable way to accomplish what we want otherwise.

The top level makefile uses a pattern rule to provide a target for every defconfig that exists in br2-external/configs directory. It'll call buildroot's build with BR2_EXTERNAL and O set build that defconfig into an output directory. Or just do a buildroot *_defconfig call but not actually build.

Quoted 7 lines
Quoted 3 lines

buildroot sets itself up so that once you go to the output directory, there is a Makefile that will execute any buildroot target (menuconfig, pkg-rebuild, all, etc.) with BR2_EXTERNAL configured.

That's *exactly* the setup I've developed for one of my projects. I've been
meaning to export this to a buildroot-external superproject that people could reuse...

Please do! I'd really would like to have a "best practice" or a sort of boilerplate to use when setting up a new project!

Thanks!

Quoted 20 lines

One thing though: I recently switched from git submodule to git subtree.
Submodules are really painful to work with when there are multiple developers who need to change both the supermodule and submodule. I haven't yet gotten around to using the subtree split functionality to export the upstreamable changes again, but it looks pretty convenient to use.

Regards,
Arnout
--

Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

Signature · 1 line
Profile: http://it.linkedin.com/in/compagnucciangelo
#11 lore raw

Am 19.05.2018 um 13:08 schrieb Angelo Compagnucci:

Quoted 45 lines

2018-05-15 22:18 GMT+02:00 Arnout Vandecappelle <[email protected]>:

Quoted 44 lines · Trent Piepho
Quoted 3 lines · Olof Johansson
Quoted 2 lines · Joseph Kogut
Quoted 1 line · Adrian Perez de Castro

[snip]

Quoted 32 lines
Quoted 6 lines
Quoted 5 lines

I do the same thing. The top level Makefile exports BR2_EXTERNAL="..", there's a target for cloning and checking out a specific Buildroot revision, then there's a wildcard pattern at the end to pass any unrecognized targets up to Buildroot's Makefile, so things like "linux-menuconfig" still work.

Quoted 8 lines

I liked the split of having third party software in an upstream-based separate buildroot repo, and only proprietary components in BR2_EXTERNAL. That way it's easier to separate out the portion you need to share for compliance (i.e. see current github contents), while having a place to keep confidential material, work on new configs/products/prototypes/internal uses that are not yet released, etc in the BR2_EXTERNAL. As expressed above, wrapping it with a second layer of makefiles makes it relatively easy to deal with.

We have a top-level project with a top level Makefile that contains the
BR2_EXTERNAL tree. I.e., the BR2_EXTERNAL tree is the top level
project. Buildroot exists as a git submodule in a directory of this project. We can update buildroot by pulling from upstream and rebasing and can git format-patch a patch to send to the list.

We patch buildroot if:
1. We think the patch is upstreamable.
2. There appears to be no reasonable way to accomplish what we want otherwise.

The top level makefile uses a pattern rule to provide a target for every defconfig that exists in br2-external/configs directory. It'll call buildroot's build with BR2_EXTERNAL and O set build that defconfig into an output directory. Or just do a buildroot *_defconfig call but not actually build.

Quoted 3 lines

buildroot sets itself up so that once you go to the output directory, there is a Makefile that will execute any buildroot target (menuconfig, pkg-rebuild, all, etc.) with BR2_EXTERNAL configured.

That's *exactly* the setup I've developed for one of my projects. I've been
meaning to export this to a buildroot-external superproject that people could reuse...

I use a similar setup, but use the android repo-tool to checkout buildroot itself, additional BR2_EXTERNAL repos and <PACKAGE>_OVERRIDE_SRCDIR repos which are under development (e.g. main application).
The repo-manifest provides the option to copy files from one of the repos to toplevel, which I use (just like android) for the main Makefile. This Makefile then points to our wrapper-Makefile which facilitates building multiple buildroot defconfigs, packing those into an update package, running legal-info and other steps and even trying to "save" an intermediate state of the output-dir just before target-finalize in order to reuse it for continuous application integration.
To keep things clean everything is built in out-of-tree folders, where Buildroot Make-targets can be called as usual.

We have chosen the repo-tool after being frustrated with git-submodules, however it's not without problems either, especially if you work in a team an try to avoid setting up a gerrit-instance.
So one of those day I'll have to look into git subtree...

regards,
Andreas

Quoted 29 lines

Please do! I'd really would like to have a "best practice" or a sort of boilerplate to use when setting up a new project!

Thanks!

Quoted 20 lines

One thing though: I recently switched from git submodule to git subtree.
Submodules are really painful to work with when there are multiple developers who need to change both the supermodule and submodule. I haven't yet gotten around to using the subtree split functionality to export the upstreamable changes again, but it looks pretty convenient to use.

Regards,
Arnout
--

Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

#12 lore raw
Quoted 13 lines · Andreas Naumann

Am 19.05.2018 um 13:08 schrieb Angelo Compagnucci:

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines

The top level makefile uses a pattern rule to provide a target for every defconfig that exists in br2-external/configs directory. It'll call buildroot's build with BR2_EXTERNAL and O set build that defconfig into an output directory. Or just do a buildroot *_defconfig call but not actually build.

buildroot sets itself up so that once you go to the output directory, there is a Makefile that will execute any buildroot target (menuconfig, pkg-rebuild, all, etc.) with BR2_EXTERNAL configured.

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

That's *exactly* the setup I've developed for one of my projects. I've been
meaning to export this to a buildroot-external superproject that people could reuse...

I use a similar setup, but use the android repo-tool to checkout buildroot itself, additional BR2_EXTERNAL repos and <PACKAGE>_OVERRIDE_SRCDIR repos which are under development (e.g. main application).

I've used OVERRIDE_SRCDIR for the packages under development, which were themselves git repositories that were submodules of the master project. Sounds like you've got the same thing but with repo-tool instead of submodules. There were a couple things that weren't that good.

After a updating the source, by working on it or via git, buildroot doesn't detect a change and rebuild it. It is necessary to <pkg>- rebuild it manually. Tracking down which packages to rebuild was a real pain for developers to do after every pull. It seems like buildroot could check srcdir timestamp vs build dir rsync stamp file and do this automatically.

Another problem that the rsync of srcdir into the build dir will not delete files that have been removed from srcdir. If someone used a wildcard in the makefile, e.g SRSCS := $(wildcard *.c), and then renamed a source, the build fails because the build dir will have the old and new source file and try to compile both of them. This could be avoided if buildroot didn't need to rsync the srcdir into the build dir, but instead used the package's (assuming it has one) out-of-tree build feature to compile directly from srcdir with output to the build dir.