Experiments with my Raspberry Pi 4 Model B with a 3.5" TFT display.
The original goal was to build a PipBoy for my boy. I may still end up there, but now the focus is on learning, and to build a small system with my own kernel and rootfs (no distro). Since experimenting with kernel builds includes re-build and re-load perhaps 50 times in a day, building on RPi, or using a SD-card is not feasible. Instead cross-compilation and network booting is used. The basic installation is described in the RPi documentation and is not repeated here.
Recommended use:
- Clone this repo, and setup the environment as described below
- Cross compile - Build on your Linux PC rather than on the RPi simplifies and saves a lot of time
- Kernel build - Build a small kernel
- Initrd - Build an initrd with a custom rootfs
- Network boot - Removes the need of an SD-card. Your PC is used as a dhcp+tftp server
The raspberry-pi.sh
script is used for most tasks.
./raspberry-pi.sh # Invoke without parameters for a help printout
./raspberry-pi.sh env # Shows the environment that will be used
./raspberry-pi.sh versions # Shows sw versions and download status
eval $(./raspberry-pi.sh env) # Define the variables in your shell
The $RASPBERRYPI_WORKSPACE
variable points to a directory where all
stuff is stored by default. Files that are supposed to be downloaded
are searched for in $HOME/Downloads/
and $ARCHIVE
.
Options to raspberry-pi.sh
can be specified on the command line,
like --kver=linux-6.8
or as an environment variable like
export __kver=linux-6.8
.
Example:
export RASPBERRYPI_WORKSPACE=$HOME/tmp/raspberrypi # (or something better)
#export ARCHIVE=$HOME/archive # (optional)
# For network boot:
export __id=... # The serial number of your rpi4
export __local_addr='192.168.40.1/24' # Local address of your tftp server
The "id" can be found on your RPi with:
grep Serial /proc/cpuinfo | cut -d ' ' -f 2 | cut -c 9-16