feat: add ARM64 OS flavor

Use an ARM64 Debian rootfs bootstrap because the original source-built userspace path depends on native x86_64 host runtime libraries.
This commit is contained in:
blazblue547-afk committed 2026-06-17 12:16:09 -04:00
1 parent eb8038ef4c
commit 9e86817361
28 files changed
+631 -1411

No files matched your search

+23 -73
View File
@@ -10,30 +10,19 @@ ensure_dirs
normal_rootfs_matches() {
[[ -d "$ROOTFS_STAGING_DIR" ]] || return 1
[[ -f "$ROOTFS_STAGING_DIR/etc/forgeos-nix" ]] || return 1
if truthy "$ENABLE_DESKTOP"; then
[[ -f "$ROOTFS_STAGING_DIR/etc/forgeos-desktop" ]] || return 1
else
[[ ! -f "$ROOTFS_STAGING_DIR/etc/forgeos-desktop" ]] || return 1
fi
[[ ! -f "$ROOTFS_STAGING_DIR/etc/forgeos-desktop" ]] || return 1
[[ ! -f "$ROOTFS_STAGING_DIR/etc/forgeos-doom-emacs" ]] || return 1
}
[[ -f "$OUT_DIR/bzImage" ]] || "$ROOT_DIR/scripts/build-kernel.sh"
[[ -f "$KERNEL_IMAGE" ]] || "$ROOT_DIR/scripts/build-kernel.sh"
if [[ "$DESKTOP" == "gnome" ]]; then
[[ -d "$ROOTFS_STAGING_DIR" && -f "$ROOTFS_STAGING_DIR/etc/gdm3/daemon.conf" ]] || "$ROOT_DIR/scripts/build-gnome-rootfs.sh"
else
normal_rootfs_matches || "$ROOT_DIR/scripts/build-rootfs.sh"
if ! truthy "$ENABLE_DESKTOP"; then
[[ -f "$OUT_DIR/rootfs.cpio.gz" ]] || "$ROOT_DIR/scripts/build-rootfs.sh"
fi
[[ -f "$OUT_DIR/rootfs.cpio.gz" ]] || "$ROOT_DIR/scripts/build-rootfs.sh"
fi
IMAGE_PATH="$OUT_DIR/forgeos-${KERNEL_VERSION}.img"
EFI_LOADER="$OUT_DIR/BOOTX64.EFI"
EFI_KERNEL="$OUT_DIR/FORGEOS.EFI"
EFI_INITRD="$OUT_DIR/rootfs.cpio.gz"
GRUB_CFG="$OUT_DIR/grub.cfg"
ESP_END_MIB=$((1 + ESP_SIZE_MIB))
@@ -63,69 +52,43 @@ set gfxpayload=keep
insmod all_video
insmod gfxterm
terminal_output gfxterm console
set linux_common="root=PARTLABEL=root rootfstype=ext4 rootwait rw console=tty0 loglevel=7 ignore_loglevel earlyprintk=efi,keep vt.global_cursor_default=1"
set linux_common="root=PARTLABEL=root rootfstype=ext4 rootwait rw console=tty0 console=ttyAMA0,115200 loglevel=7 ignore_loglevel"
set initrd_common="rdinit=/sbin/init"
set handoff_common="rdinit=/init forgeos.switch_root=1"
menuentry "ForgeOS - Dell Precision 7720 default" {
menuentry "ForgeOS ARM64 - default" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common i915.enable_psr=0 i915.fastboot=0
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common
}
menuentry "ForgeOS - Intel display only" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common nouveau.modeset=0 i915.enable_psr=0 i915.fastboot=0
}
menuentry "ForgeOS - NVIDIA display only" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common i915.modeset=0
}
menuentry "ForgeOS - firmware framebuffer safe mode" {
menuentry "ForgeOS ARM64 - firmware framebuffer safe mode" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common nomodeset
}
EOF
if [[ "$DESKTOP" != "gnome" ]] && ! truthy "$ENABLE_DESKTOP"; then
if [[ "$DESKTOP" != "gnome" ]]; then
cat >> "$GRUB_CFG" <<'EOF'
menuentry "ForgeOS - initramfs-assisted root default display" {
menuentry "ForgeOS ARM64 - initramfs-assisted root" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common $handoff_common i915.enable_psr=0 i915.fastboot=0
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common $handoff_common
initrd ($esp)/EFI/BOOT/rootfs.cpio.gz
}
menuentry "ForgeOS - initramfs-assisted root fixed GRUB framebuffer" {
menuentry "ForgeOS ARM64 - initramfs framebuffer safe mode" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
set gfxmode=1024x768
set gfxpayload=keep
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common $handoff_common nomodeset video=efifb:1024x768 fbcon=map:0 fbcon=font:VGA8x16
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common $handoff_common nomodeset
initrd ($esp)/EFI/BOOT/rootfs.cpio.gz
}
menuentry "ForgeOS - systemd initramfs default display" {
menuentry "ForgeOS ARM64 - systemd initramfs" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common rdinit=/sbin/init i915.enable_psr=0 i915.fastboot=0
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common rdinit=/sbin/init
initrd ($esp)/EFI/BOOT/rootfs.cpio.gz
}
menuentry "ForgeOS - systemd initramfs framebuffer safe mode" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common $initrd_common nomodeset
initrd ($esp)/EFI/BOOT/rootfs.cpio.gz
}
menuentry "ForgeOS - systemd initramfs fixed GRUB framebuffer" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
set gfxmode=1024x768
set gfxpayload=keep
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common $initrd_common nomodeset video=efifb:1024x768 fbcon=map:0 fbcon=font:VGA8x16
initrd ($esp)/EFI/BOOT/rootfs.cpio.gz
}
menuentry "ForgeOS - EFI stub chainload" {
menuentry "ForgeOS ARM64 - EFI stub chainload" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
chainloader ($esp)/EFI/BOOT/FORGEOS.EFI
}
@@ -133,25 +96,12 @@ EOF
elif [[ "$DESKTOP" == "gnome" ]]; then
cat >> "$GRUB_CFG" <<'EOF'
menuentry "ForgeOS GNOME - graphical target" {
menuentry "ForgeOS ARM64 GNOME - graphical target" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common systemd.unit=graphical.target
}
menuentry "ForgeOS - EFI stub chainload" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
chainloader ($esp)/EFI/BOOT/FORGEOS.EFI
}
EOF
else
cat >> "$GRUB_CFG" <<'EOF'
menuentry "ForgeOS Openbox desktop" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
linux ($esp)/EFI/BOOT/FORGEOS.EFI $linux_common systemd.unit=multi-user.target
}
menuentry "ForgeOS - EFI stub chainload" {
menuentry "ForgeOS ARM64 - EFI stub chainload" {
search --no-floppy --file --set=esp /EFI/BOOT/FORGEOS.EFI
chainloader ($esp)/EFI/BOOT/FORGEOS.EFI
}
@@ -162,8 +112,8 @@ EOF
prepare_efi_loader() {
case "$BOOTLOADER" in
stub)
"$ROOT_DIR/scripts/sign-efi-loader.sh" "$OUT_DIR/bzImage" "$EFI_LOADER"
install -m 0644 "$OUT_DIR/bzImage" "$EFI_KERNEL"
"$ROOT_DIR/scripts/sign-efi-loader.sh" "$KERNEL_IMAGE" "$EFI_LOADER"
install -m 0644 "$KERNEL_IMAGE" "$EFI_KERNEL"
;;
grub)
if truthy "$SECURE_BOOT"; then
@@ -173,11 +123,11 @@ prepare_efi_loader() {
write_grub_config
msg "building GRUB UEFI fallback loader"
grub-mkstandalone \
-O x86_64-efi \
-O "$GRUB_PLATFORM" \
-o "$EFI_LOADER" \
--modules="part_gpt fat search search_fs_file linux chain all_video efi_gop efi_uga gfxterm font video video_fb" \
"boot/grub/grub.cfg=$GRUB_CFG" >/dev/null
install -m 0644 "$OUT_DIR/bzImage" "$EFI_KERNEL"
install -m 0644 "$KERNEL_IMAGE" "$EFI_KERNEL"
;;
*)
die "unsupported BOOTLOADER=$BOOTLOADER"
@@ -208,9 +158,9 @@ truncate -s "$ESP_SIZE" "$ESP_IMAGE"
mkfs.vfat -F 32 -n "$EFI_LABEL" "$ESP_IMAGE" >/dev/null
mmd -i "$ESP_IMAGE" ::/EFI
mmd -i "$ESP_IMAGE" ::/EFI/BOOT
mcopy -i "$ESP_IMAGE" "$EFI_LOADER" ::/EFI/BOOT/BOOTX64.EFI
mcopy -i "$ESP_IMAGE" "$EFI_LOADER" "::/EFI/BOOT/$EFI_BOOT_NAME"
mcopy -i "$ESP_IMAGE" "$EFI_KERNEL" ::/EFI/BOOT/FORGEOS.EFI
if [[ "$DESKTOP" != "gnome" ]] && ! truthy "$ENABLE_DESKTOP"; then
if [[ "$DESKTOP" != "gnome" ]]; then
mcopy -i "$ESP_IMAGE" "$EFI_INITRD" ::/EFI/BOOT/rootfs.cpio.gz
fi