I need to automate the creation of a Debian-based custom BBB image that will be used in production. We’re currently using one of the “console-only” pre-built images and then interactively tweaking it via console commands via SSH. Our tweaking procedure includes:
Running apt install for additional needed packages not included in the pre-built image
Running apt remove for packages that we don’t need
Deploying the device overlays to match the hardware that we connect to the BBB header pins
Deploying our application executables
Setting-up systemd entries so that our executables are launched in the proper order
This method of creating custom images with a human interactively inputting commands is error-prone and time-consuming. I want to be able to automate the entire image creation process via a master script on a dedicated build machine (preferably a x64 computer, but I can also purchase a high-performance ARM machine if necessary).
Please advise on the way I should go about doing this. I found the omap-image-builder GitHub repo, but there’s very little documentation and it’s not clear what this tool actual does. It does not mention if the command can be run on a host computer, or if it should be run on a Beaglebone.
I also found this Digikey article that describes how to build the kernel. It also describes how to copy a minimal Debian filesystem prepared by Robert Nelson.
To make things more confusing, there’s this InstallingDebianOn page that doesn’t seem to have any relation with Robert Nelson’s stuff.
I want to be able to generate my own Debian filesystem from scratch with only the minimal packages that we need. How do I go about doing this?
While I appreciate everything Robert Nelson has been doing for the community, it seems that he’s the only one who understands how to create these images, and his notes are scattered across several places on the web. Is it possible for anyone else to replace Robert if he gets hit by a bus? We shouldn’t be relying on a single person.
I have stumbled upon Buildroot since asking my question, and it looks like it may be the ticket. I even found this Buildroot training guide that uses the BBB as a example.
I’m now also considering BusyBox instead of Debian now that I’ve found a way I to generate my own images.
If anyone has been tips to share concerning Buildroot and BBB, they are most certainly welcome!
If I want to add/remove Debian packages from your minimal config, is it as simple as modifying the deb_include list? Will it automatically resolve dependencies if I add packages this way?
these are addon’s for pkgs not in debian… For example if you don’t have the wl1835 (WiFi/BLE), you don’t need bb-wl18xx-firmware… if you don’t have any Firmware devices, nuke… “include_firmware”… and work your way up the *.conf…
deb_additional_pkgs = packages that fail first pass of debootstrap, usually pretty small in minimal, but any iot/xfce example config will have more here…
deb_include = base pkg install, remove what you don’t need…
…
Basically hack away, you can open up scripts/chroot.sh to see the order of everything, let us know if you have any issues, or want to try something… At one time we had a 64MB Debian image, but that was pre-systemd… all it had was apt/perl/bash…
Buildroot/Yocto will always be able to make a smaller install…