First working revision

At this point, we can generate an SD card image that is composed of an
EFI system partition, a SquashFS root partition (a), a blank root
partition (b), and a data partition.  On the EFI system partition are
the Raspberry Pi firmware and device trees, U-Boot and GRUB.  The
SquashFS filesystem contains the kernel and the whole filesystem tree.

A Raspberry Pi can successfully boot from an SD card containing this
image.  It's not quite usable yet, because there's no writable storage
available, or indeed any way to log in.
This commit is contained in:
2025-08-17 16:01:40 -05:00
parent e267f82db1
commit 9dae022788
10 changed files with 173 additions and 0 deletions

12
boot/grub2/gen-grub-cfg.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
# vim: set sw=4 ts=4 sts=4 et :
vers=${BR2_EXTERNAL_AIMEEOS_VERSION}
br2_vers=${BR2_VERSION_FULL}
cat > "${TARGET_DIR}"/boot/grub.cfg <<EOF
menuentry "Aimee OS ${vers} (Buildroot ${br2_vers}) on \$dev" --class gnu-linux --id "id-\$partuuid" "\$dev" "\$partuuid" {
set root="\$2"
linux "/boot/zImage" root=PARTUUID=\$3 ro
}
EOF

11
boot/grub2/grub.cfg Normal file
View File

@@ -0,0 +1,11 @@
# vim: set ft=sh :
# vim: set sw=4 ts=4 sts=4 et:
load_env
regexp --set 1:disk '(.*),.*' $root
for dev in ($disk,gpt*); do
if [ -f $dev/boot/grub.cfg ]; then
probe --set partuuid --part-uuid $dev
source $dev/boot/grub.cfg
fi
done