Feature Suggestion: "config.txt"-based control for inc/exclusion of /boot/firmware files

Open
#29 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
raspberry-pi, shell

Research direction

Start by tracing how the current build populates /boot/firmware and where a supplied config.txt could be read. Compare the requested device-tree, kernel, overlay, and firmware-file selections against the existing image-building flow; done means the configuration reliably produces the intended smaller image.

Written by the indexing model from the issue text.

Description

Can I suggest a feature for achieving even-smaller resultant images, by allowing a user to supply a "config.txt" file, which could be read to manipulate the inclusion/exclusion of files that normally end up in /boot/firmware? For example, lets say a user has this in their config.txt file...
...against this text string (for example, destined for a headless Compute Module 4 with on-board storage, but no WiFi/Bluetooth module)...

#arch=v8+
#model=bcm2711-rpi-cm4
disable_overscan=1
disable_splash=1
dtoverlay=disable-bt
dtoverlay=disable-wifi
dtoverlay=i2c-fan,emc2301,i2c_csi_dsi
dtparam=watchdog=on
gpu_mem=16

This could instruct to add the bcm2711-rpi-cm4.dtb device tree base, the latest Pi arm64 v8+ kernel8.img, and, through via a match-all regex expression with the multi-line flag...

^dtoverlay=(.+?)[,\n$]

...to include the disable-bt, disable-wifi and i2c-fan device tree overlays. Another possibility is, by searching for gpu_mem=16, to determine whether or not to use the smaller fixup4cd.dat and start4cd.elf firmware files over the full size fixup4.dat and start.elf ones (subject to if the intended Pi board/CPU model uses them).

Dominant language
Shell
Stars
129
Forks
16
Avg merge
2d 14h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/pi-gen-micro

All issues in raspberrypi/pi-gen-micro

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.