Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Patching a file in resulting rootfs

Tags:

buildroot

I am using buildroot to create an OS for the Raspberry PI. How do I apply a patch to a file in the resulting rootfs?

For example adding the lines

auto eth0

iface eth0 inet dhcp

to /etc/network/interfaces on the resulting rootfs.

I realize that this can be done with a script after unpacking the rootfs on my target, but I am wondering if it can be automated using buildroot.

like image 451
John Avatar asked Oct 17 '25 12:10

John


1 Answers

First of all take a look at BR2_EXTERNAL mechanism. This way you can manage your project/configurations/package independent from Buildroot tree.

Then look at "Root filesystem overlays (BR2_ROOTFS_OVERLAY)" and "Post-build scripts (BR2_ROOTFS_POST_BUILD_SCRIPT)" in Customizing the generated target filesystem section. They describe both ways, i.e supply your custom file via fs-overlay or run a post-build script and alter the file within this script.

like image 68
yegorich Avatar answered Oct 19 '25 15:10

yegorich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!