customize-rootfs.txt 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // -*- mode:doc -*- ;
  2. [[rootfs-custom]]
  3. Customizing the generated target filesystem
  4. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. Besides changing one or another configuration through +make *config+,
  6. there are a few ways to customize the resulting target filesystem.
  7. * Customize the target filesystem directly and rebuild the image. The
  8. target filesystem is available under +output/target/+. You can
  9. simply make your changes here and run make afterwards - this will
  10. rebuild the target filesystem image. This method allows you to do
  11. anything to the target filesystem, but if you decide to completely
  12. rebuild your toolchain and tools, these changes will be lost.
  13. _Changes do not survive the +make clean+ command_.
  14. * Create your own 'target skeleton'. You can start with the default
  15. skeleton available under +system/skeleton+ and then customize it to
  16. suit your needs. The +BR2_ROOTFS_SKELETON_CUSTOM+ and
  17. +BR2_ROOTFS_SKELETON_CUSTOM_PATH+ will allow you to specify the
  18. location of your custom skeleton. These options can be found in the
  19. +System configuration+ menu. At build time, the contents of the
  20. skeleton are copied to output/target before any package
  21. installation.
  22. * In the Buildroot configuration, you can specify the path to a
  23. *post-build script*, that gets called 'after' Buildroot builds all the
  24. selected software, but 'before' the rootfs packages are
  25. assembled. The +BR2_ROOTFS_POST_BUILD_SCRIPT+ will allow you to
  26. specify the location of your post-build script. This option can be
  27. found in the +System configuration+ menu. The destination root
  28. filesystem folder is given as the first argument to this script,
  29. and this script can then be used to copy programs, static data or
  30. any other needed file to your target filesystem. You should,
  31. however, use this feature with care. Whenever you find that a
  32. certain package generates wrong or unneeded files, you should fix
  33. that package rather than work around it with a post-build cleanup
  34. script. _Among these first 3 methods, this one should be preferred_.
  35. * A special package, 'customize', stored in +package/customize+ can be
  36. used. You can put all the files that you want to see in the final
  37. target root filesystem in +package/customize/source+, and then
  38. enable this special package in the configuration system. _This
  39. method is marked as deprecated_.