DarkElvenAngel
Posts: 849
Joined: Tue Mar 20, 2018 9:53 pm

Buildroot building my own packages

Tue Mar 24, 2020 3:02 am

Hello everyone,

I'm hoping I can find someone that can make a little sense of this. I want to install my own programs on to my Buildroot image. I read the manual I get a fair bit of it but I don't really care if my programs are on the menuconfig I just want to build them.

Is there a simple way to do this? I use make files to build my programs they're very simple I don't know CMake or autotools.

In the past I've built binaries on my pi and copied everything. But my Buildroot has different version libraries so I'm having to maintain several versions of libraries when I could somehow build against the the Buildroot ones and call it a day.

I'm hoping someone knows a way to do this or has knowledge of a guide that might help?

I'm building from a fully updated Linux Mint Box to target raspberry Pi 0 W if that is of any help.

Printer_wold
Posts: 20
Joined: Tue Mar 24, 2020 3:33 am

Re: Buildroot building my own packages

Tue Mar 24, 2020 5:57 am

sudo apt-get install gcc-4.8 g++-4.8
sudo apt-get install autotools.

epoch1970
Posts: 5200
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Buildroot building my own packages

Tue Mar 24, 2020 8:59 am

Setup an external tree by defining BR2_EXTERNAL, otherwise you’d have to muck with the config files of the standard BR distro in order to add your packages.
You’ll see your packages under an extra menu in menuconfig.
All details available in the guide or the internet.

To add a new package, I suggest you pick a suitable one from the standard distribution, copy it to your tree and start modifying.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

DarkElvenAngel
Posts: 849
Joined: Tue Mar 20, 2018 9:53 pm

Re: Buildroot building my own packages

Tue Mar 24, 2020 2:06 pm

epoch1970 wrote:
Tue Mar 24, 2020 8:59 am
Setup an external tree by defining BR2_EXTERNAL, otherwise you’d have to muck with the config files of the standard BR distro in order to add your packages.
You’ll see your packages under an extra menu in menuconfig.
All details available in the guide or the internet.

To add a new package, I suggest you pick a suitable one from the standard distribution, copy it to your tree and start modifying.
Do you know if there is a tutorial that has some examples I could follow? The Buildroot manual has some, it would be helpful to have more.

I have to sort out why my build from last night failed now.

DarkElvenAngel
Posts: 849
Joined: Tue Mar 20, 2018 9:53 pm

Re: Buildroot building my own packages

Tue Mar 24, 2020 2:12 pm

Printer_wold wrote:
Tue Mar 24, 2020 5:57 am
sudo apt-get install gcc-4.8 g++-4.8
sudo apt-get install autotools.
Those are old versions of the compiler why would I need them? I have 8.3 installed

I don't know how to use autotools or what it's for... Could you offer some reason why I would install these packages?

Once I have my image sorted out I'll look into autotools

epoch1970
Posts: 5200
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Buildroot building my own packages

Tue Mar 24, 2020 3:03 pm

DarkElvenAngel wrote:
Tue Mar 24, 2020 2:06 pm
Do you know if there is a tutorial that has some examples I could follow? The Buildroot manual has some, it would be helpful to have more.
The subject is vast as BR is meant to integrate in your production process. If there are (good) tutorials, they might not apply to your use-case.
I think the suggested directory structure (title 9.1 in the manual) is a good base.
You can search the buildroot mailing-list, it is a treasure trove of information; once you have precise enough questions, that is.

BTW, I would avoid installing too many dev packages outside of BR. BR has the ability to build "host packages", this should give you all the external tooling you might need, in compatible versions with your target.
If you install redundant OS-native tools (eg via apt-get), and you're not in the right environment, then you might swap tools versions along the process.; then you can get into mysterious errors and have a hard time figuring out why. Or, you won't be able to repeat builds on another host running the same BR install, because of differences in the host OS.
Last edited by epoch1970 on Tue Mar 24, 2020 3:18 pm, edited 1 time in total.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

DarkElvenAngel
Posts: 849
Joined: Tue Mar 20, 2018 9:53 pm

Re: Buildroot building my own packages

Tue Mar 24, 2020 3:17 pm

epoch1970 wrote:
Tue Mar 24, 2020 3:03 pm
DarkElvenAngel wrote:
Tue Mar 24, 2020 2:06 pm
Do you know if there is a tutorial that has some examples I could follow? The Buildroot manual has some, it would be helpful to have more.
The subject is vast as BR is meant to integrate in your production process. If there are (good) tutorials, they might not apply to your use-case.
I think the suggested directory structure (title 9.1 in the manual) is a good base.
You can search the buildroot mailing-list, it is a treasure trove of information; once you have precise enough questions, that is.
Thanks for the suggestion, and your help.

Return to “Advanced users”