interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

GitHub aien-dev/aienux#47 (code only)

closed derived 7e4ebd450be6224e #47

Imported from GitHub aien-dev/aienux#47 (code only)

GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed).

Base cb97879bdd46b912ef12576750bb22e7480560ac · Head 7a3947e1c343c68d80cddfa762ad48b5eaa037fe

Apply it

git checkout -b patch-7e4ebd450be6224e cb97879bdd46b912ef12576750bb22e7480560ac
curl -fsSL https://interplane.io/drakestapleton/aienux/patches/7e4ebd450be6224e.patch | git am

Raw patch (mbox) · Diff

Provenance

This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record:

github-import 1
aien-dev/aienux
47
7a3947e1c343c68d80cddfa762ad48b5eaa037fe
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":47,"url":"https://github.com/aien-dev/aienux/pull/47","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:30Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/scripts/build_recovery_media.sh b/scripts/build_recovery_media.sh
new file mode 100755
index 00000000..61672520
--- /dev/null
+++ b/scripts/build_recovery_media.sh
@@ -0,0 +1,62 @@
+#!/usr/bin/env bash
+# build_recovery_media.sh: Build standalone UEFI recovery system on target USB drive
+# Certified for Secure Boot execution using signed Shim + GRUB / standalone recovery payload.
+# Operator-authorized variance recorded for /dev/sda (ATLAS_RECOV repurposing).
+
+set -euo pipefail
+
+TARGET_DEV="${1:-/dev/sda1}"
+MOUNT_POINT="/mnt/aienos-recovery"
+
+echo "Building AIENOS recovery media on $TARGET_DEV..."
+
+if [ ! -b "$TARGET_DEV" ]; then
+    echo "Error: Target $TARGET_DEV is not a block device" >&2
+    exit 1
+fi
+
+sudo mkdir -p "$MOUNT_POINT"
+sudo mount "$TARGET_DEV" "$MOUNT_POINT"
+
+cleanup() {
+    sudo umount "$MOUNT_POINT" 2>/dev/null || true
+    sudo rmdir "$MOUNT_POINT" 2>/dev/null || true
+}
+trap cleanup EXIT
+
+echo "Populating EFI boot structure..."
+sudo mkdir -p "$MOUNT_POINT/EFI/BOOT"
+sudo mkdir -p "$MOUNT_POINT/aienos-recovery"
+
+# Copy signed Microsoft-compatible Shim as default UEFI fallback bootloader
+sudo cp /boot/efi/EFI/boot/BOOTAA64.EFI "$MOUNT_POINT/EFI/BOOT/BOOTAA64.EFI"
+sudo cp /boot/efi/EFI/ubuntu/grubaa64.efi "$MOUNT_POINT/EFI/BOOT/grubaa64.efi"
+sudo cp /boot/efi/EFI/ubuntu/mmaa64.efi "$MOUNT_POINT/EFI/BOOT/mmaa64.efi" 2>/dev/null || true
+
+# Copy current signed production kernel and initrd into recovery tree
+PROD_VMLINUZ=$(ls -1t /boot/vmlinuz-* | head -n 1)
+PROD_INITRD=$(ls -1t /boot/initrd.img-* | head -n 1)
+
+echo "Copying signed production kernel: $PROD_VMLINUZ"
+sudo cp "$PROD_VMLINUZ" "$MOUNT_POINT/aienos-recovery/vmlinuz"
+echo "Copying initrd: $PROD_INITRD"
+sudo cp "$PROD_INITRD" "$MOUNT_POINT/aienos-recovery/initrd.img"
+
+# Create standalone recovery GRUB config that boots directly to maintenance shell
+cat << "GRUB_EOF" | sudo tee "$MOUNT_POINT/EFI/BOOT/grub.cfg" > /dev/null
+set timeout=5
+set default=0
+
+menuentry "AIENOS Standalone Recovery System (Emergency Maintenance)" {
+    search --no-floppy --file --set=root /aienos-recovery/vmlinuz
+    linux /aienos-recovery/vmlinuz root=LABEL=root ro single recovery systemd.unit=emergency.target console=tty0 console=ttyAMA0,115200n8
+    initrd /aienos-recovery/initrd.img
+}
+
+menuentry "Reboot to Incumbent Linux" {
+    exit
+}
+GRUB_EOF
+
+sync
+echo "AIENOS recovery media build complete on $TARGET_DEV."