Creating custom Beaglebone Black image

I found two approaches to generating custom Beaglebone Black image:

  1. Use GitHub - beagleboard/image-builder: Image builder - this will create rootfs from scratch, installing required packages, but it will also install pre-built kernel and u-boot packages.
  2. Use Debian: Getting Started with the BeagleBone Black - Linux Guides - Engineering and Component Solution Forum - TechForum │ Digi-Key - this will build u-boot and kernel from source, but download pre-created rootfs (tar.xz).

How can I combine these two approaches to build u-boot and kernel from sources, and also create rootfs from scratch?

#2 is the output of #1… In your list above

Regards,

So I’ll have just to remove e.g. linux-image-4.19.94-ti-r73 and bb-u-boot-am335x-evm from repo_rcnee_pkg_list in the conf file, since I’ll build and install u-boot and kernel later myself?

#2 was built with this config…

So if that’s what you want to use.

Thank you. When building the rootfs according to #1, there is the following line in configuration file:
repo_rcnee_pkg_version="4.19.94-ti-r73".

It enables installation of various kernel modules:

apt-get -y install libpruio-modules-${repo_rcnee_pkg_version} || true
apt-get -y install rtl8723bu-modules-${repo_rcnee_pkg_version} || true
apt-get -y install rtl8821cu-modules-${repo_rcnee_pkg_version} || true
apt-get -y install qcacld-2.0-modules-${repo_rcnee_pkg_version} || true

This requires kernel package to be installed.
However, if I supply my own kernel, I don’t need kernel package from the repository. Should I remove the line from the configuration and build these modules from source in this case?

Back to the original question, there is a third option to generating a custom BBB image: use the Yocto Project (YP). The YP is a tool that outputs your own custom Linux distribution for embedded devices. A single build produces u-boot, a kernel, a rootfs, and a toolchain for cross-compilation. What’s even better is that the BBB is a reference target for the YP, so you don’t even need to configure a Board Support Package (BSP).

I wrote an article about this recently, you can find it here:

Depending on what you need, Buildroot may be a quicker solution, especially if you have never used Yocto before.
I find it way easier if you want to do custom builds and have built BBB images in the past.