Create foundational structure for MetalOS - Phase 1 complete

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-28 17:43:20 +00:00
parent 7548ab87cc
commit e66ef697f7
23 changed files with 2580 additions and 12 deletions

53
scripts/create_image.sh Executable file
View File

@@ -0,0 +1,53 @@
#!/bin/bash
# MetalOS - Create bootable disk image
set -e
echo "MetalOS Image Creator"
echo "====================="
BUILD_DIR="build"
ISO_DIR="$BUILD_DIR/iso"
IMAGE="$BUILD_DIR/metalos.img"
# Check if bootloader and kernel exist
if [ ! -f "bootloader/bootx64.efi" ]; then
echo "Error: bootloader/bootx64.efi not found. Run 'make bootloader' first."
exit 1
fi
if [ ! -f "kernel/metalos.bin" ]; then
echo "Error: kernel/metalos.bin not found. Run 'make kernel' first."
exit 1
fi
# Create directories
mkdir -p "$ISO_DIR/EFI/BOOT"
# Copy files
echo "Copying bootloader..."
cp bootloader/bootx64.efi "$ISO_DIR/EFI/BOOT/"
echo "Copying kernel..."
cp kernel/metalos.bin "$ISO_DIR/"
# Create disk image (requires mtools and xorriso)
echo "Creating disk image..."
if command -v xorriso &> /dev/null; then
xorriso -as mkisofs \
-e EFI/BOOT/bootx64.efi \
-no-emul-boot \
-o "$IMAGE" \
"$ISO_DIR"
echo "Success! Created $IMAGE"
else
echo "Warning: xorriso not found. Image not created."
echo "Install with: sudo apt-get install xorriso"
echo ""
echo "Files are ready in $ISO_DIR/"
echo "You can manually create a bootable USB by:"
echo " 1. Format USB with GPT and FAT32 EFI partition"
echo " 2. Copy $ISO_DIR/EFI to the USB"
echo " 3. Copy $ISO_DIR/metalos.bin to the USB"
fi