Using rootfs overlay in buildroot [buildroot part-4]

If we wanted buildroot to automatically copy some file in root file system in our target, we can use feature called “rootfs overlay”. This feature of buildroot enable us automate copying some file into root file system, usually it’s a configuration file.

$ make menuconfig

  • System configuration
  • – () Root filesystem overlay
    we should fill this option with this:
    board/tryingrootfs/beagleboneblack/rootfs-overlay/
    so it will look like here after we edit it:
    (board/tryingrootfs/beagleboneblack/rootfs-overlay/) Root filesystem overlay

Off course then, we should try it right?
To try it, we should make the directory in our buildroot in our root buildroot
Note: from now on if there’s mentioned “root buildroot” means directory buildroot-2018.02.04/. got it?
$ mkdir -p board/tryingrootfs/beagleboneblack/rootfs-overlay
then let’s demonstrate what this means then? let’s make a new file
$ mkdir -p board/tryingrootfs/beagleboneblack/rootfs-overlay/root
$ touch board/tryingrootfs/beagleboneblack/rootfs-overlay/root/testRootFSOverlay

exit menuconfig and make:
$ make
Now, every file we put in overlay directory will automatically copied to our root file system image. This could make automating configuration file easier and faster.

Leave a Reply

Your email address will not be published.