diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index d480e27..5fcc3f2 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -126,82 +126,8 @@ jobs: # Move the compressed image mv sparkos.img.gz release/ - # Create a README for the release - cat > release/README.txt << 'EOF' - SparkOS UEFI-Bootable Disk Image - ================================== - - This package contains a UEFI-bootable disk image with SparkOS. - - Files: - - sparkos.img.gz - Compressed UEFI-bootable disk image (~1GB) - - What's Included: - --------------- - ✓ GPT partition table - ✓ EFI System Partition (ESP) with FAT32 filesystem - ✓ GRUB UEFI bootloader - ✓ Linux kernel - ✓ SparkOS init system - ✓ Busybox utilities - ✓ Basic FHS-compliant filesystem structure - - Boot Support: - ------------ - ✓ UEFI boot (x86_64 systems) - ✓ Automatic boot after 3 seconds - ✓ Console on tty1 - - Quick Start: - ----------- - - 1. Decompress the image: - gunzip sparkos.img.gz - - 2. Write to USB drive (Linux - BE CAREFUL!): - sudo dd if=sparkos.img of=/dev/sdX bs=4M status=progress oflag=sync - - WARNING: Replace /dev/sdX with your actual USB drive device. - This will DESTROY all data on the target drive! - - 3. Boot from USB: - - Insert the USB drive into a UEFI-capable system - - Enter BIOS/UEFI settings (usually F2, F12, DEL, or ESC at boot) - - Select the USB drive as boot device - - SparkOS should boot automatically - - Advanced - Inspect Partitions: - ------------------------------ - - To mount and inspect the partitions: - - # Set up loop device - sudo losetup -fP --show sparkos.img - # Note the loop device name (e.g., /dev/loop0) - - # Mount ESP (EFI System Partition) - sudo mount /dev/loop0p1 /mnt - ls -la /mnt/EFI - sudo umount /mnt - - # Mount root partition - sudo mount /dev/loop0p2 /mnt - ls -la /mnt - sudo umount /mnt - - # Cleanup - sudo losetup -d /dev/loop0 - - Documentation: - ------------- - See the full documentation at: - https://github.com/johndoe6345789/SparkOS - - Support: - ------- - For issues and questions, visit: - https://github.com/johndoe6345789/SparkOS/issues - EOF + # Copy the README for the release + cp config/image-release-readme.txt release/README.txt # Create a ZIP with the image and README cd release || exit 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4724390..5b514bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,68 +81,8 @@ jobs: fi done - # Create README for the release - cat > release/sparkos/RELEASE_README.md << 'HEREDOC_EOF' - # SparkOS Release Package - - This package contains the compiled SparkOS init system and all necessary files to run or build SparkOS. - - ## Contents - - - \`init\` - The compiled init binary (statically linked) - - \`src/\` - Source code for the init system - - \`scripts/\` - Build and setup scripts - - \`config/\` - Configuration files - - \`rootfs/\` - Root filesystem structure - - \`Makefile\` - Build system - - Documentation files (README.md, ARCHITECTURE.md, etc.) - - ## Quick Start - - ### Using the Pre-built Binary - - The \`init\` binary is already compiled and ready to use: - - \`\`\`bash - # Copy to your rootfs - cp init /path/to/your/rootfs/sbin/init - chmod 755 /path/to/your/rootfs/sbin/init - \`\`\` - - ### Rebuilding from Source - - If you need to rebuild: - - \`\`\`bash - # Build the init system - make init - - # Install to rootfs - make install - \`\`\` - - ### Creating a Bootable System - - Follow the instructions in README.md to create a complete bootable system. - - ## System Requirements - - - Linux system with kernel 3.x or later - - Busybox for shell and utilities - - For building: GCC compiler, Make - - ## Documentation - - See README.md for complete documentation, including: - - Building instructions - - Creating bootable images - - Network configuration - - Development guidelines - - ## Support - - For issues and questions, visit: https://github.com/johndoe6345789/SparkOS - HEREDOC_EOF + # Copy README for the release + cp config/RELEASE_README.md release/sparkos/RELEASE_README.md echo "Package prepared in release/sparkos/" ls -la release/sparkos/ diff --git a/Dockerfile b/Dockerfile index dbdf25f..4fdbc13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,42 +56,7 @@ RUN echo "sparkos" > /sparkos/rootfs/etc/hostname && \ echo "spark:x:1000:" >> /sparkos/rootfs/etc/group # Create a test entrypoint -COPY <<'EOF' /sparkos/test.sh -#!/bin/sh -echo "SparkOS Docker Test Environment" -echo "================================" -echo "" -echo "SparkOS init binary: /sparkos/rootfs/sbin/init" -echo "" -echo "Verifying init binary..." -if [ -f /sparkos/rootfs/sbin/init ]; then - echo "✓ Init binary exists" - ls -lh /sparkos/rootfs/sbin/init - echo "" - echo "File type:" - if command -v file >/dev/null 2>&1; then - file /sparkos/rootfs/sbin/init - else - echo " (file command not available)" - fi - echo "" - echo "Dependencies:" - ldd /sparkos/rootfs/sbin/init 2>&1 || echo " Static binary (no dependencies)" -else - echo "✗ Init binary not found!" - exit 1 -fi -echo "" -echo "Root filesystem structure:" -ls -la /sparkos/rootfs/ -echo "" -echo "SparkOS is ready for testing!" -echo "" -echo "To test the init system:" -echo " docker run --rm /sparkos/rootfs/sbin/init --help" -echo "" -EOF - +COPY scripts/test.sh /sparkos/test.sh RUN chmod +x /sparkos/test.sh WORKDIR /sparkos diff --git a/Dockerfile.image b/Dockerfile.image index 5d5545f..c36446b 100644 --- a/Dockerfile.image +++ b/Dockerfile.image @@ -138,29 +138,8 @@ RUN mkdir -p /output /mnt/esp /mnt/root && \ echo "root:x:0:" > /mnt/root/etc/group && \ echo "spark:x:1000:" >> /mnt/root/etc/group && \ \ - # Create README - printf '%s\n' \ - 'SparkOS UEFI-Bootable Image' \ - '' \ - 'This is a UEFI-bootable disk image with:' \ - '- GPT partition table' \ - '- EFI System Partition (ESP) with FAT32 filesystem' \ - '- GRUB UEFI bootloader' \ - '- Linux kernel' \ - '- SparkOS init system' \ - '- Busybox utilities' \ - '' \ - 'The image can be written to a USB drive and booted on UEFI systems:' \ - ' sudo dd if=sparkos.img of=/dev/sdX bs=4M status=progress' \ - ' sudo sync' \ - '' \ - 'Boot options:' \ - '- UEFI boot support (tested on x86_64 systems)' \ - '- Automatic boot after 3 seconds' \ - '- Console on tty1' \ - '' \ - 'For more information, see: https://github.com/johndoe6345789/SparkOS' \ - > /mnt/root/README.txt && \ + # Copy README to root partition + cp /build/config/image-readme.txt /mnt/root/README.txt && \ \ # Sync and unmount echo "Finalizing image..." && \ diff --git a/config/RELEASE_README.md b/config/RELEASE_README.md new file mode 100644 index 0000000..a7339d2 --- /dev/null +++ b/config/RELEASE_README.md @@ -0,0 +1,59 @@ +# SparkOS Release Package + +This package contains the compiled SparkOS init system and all necessary files to run or build SparkOS. + +## Contents + +- `init` - The compiled init binary (statically linked) +- `src/` - Source code for the init system +- `scripts/` - Build and setup scripts +- `config/` - Configuration files +- `rootfs/` - Root filesystem structure +- `Makefile` - Build system +- Documentation files (README.md, ARCHITECTURE.md, etc.) + +## Quick Start + +### Using the Pre-built Binary + +The `init` binary is already compiled and ready to use: + +```bash +# Copy to your rootfs +cp init /path/to/your/rootfs/sbin/init +chmod 755 /path/to/your/rootfs/sbin/init +``` + +### Rebuilding from Source + +If you need to rebuild: + +```bash +# Build the init system +make init + +# Install to rootfs +make install +``` + +### Creating a Bootable System + +Follow the instructions in README.md to create a complete bootable system. + +## System Requirements + +- Linux system with kernel 3.x or later +- Busybox for shell and utilities +- For building: GCC compiler, Make + +## Documentation + +See README.md for complete documentation, including: +- Building instructions +- Creating bootable images +- Network configuration +- Development guidelines + +## Support + +For issues and questions, visit: https://github.com/johndoe6345789/SparkOS diff --git a/config/image-readme.txt b/config/image-readme.txt new file mode 100644 index 0000000..08cc0d6 --- /dev/null +++ b/config/image-readme.txt @@ -0,0 +1,20 @@ +SparkOS UEFI-Bootable Image + +This is a UEFI-bootable disk image with: +- GPT partition table +- EFI System Partition (ESP) with FAT32 filesystem +- GRUB UEFI bootloader +- Linux kernel +- SparkOS init system +- Busybox utilities + +The image can be written to a USB drive and booted on UEFI systems: + sudo dd if=sparkos.img of=/dev/sdX bs=4M status=progress + sudo sync + +Boot options: +- UEFI boot support (tested on x86_64 systems) +- Automatic boot after 3 seconds +- Console on tty1 + +For more information, see: https://github.com/johndoe6345789/SparkOS diff --git a/config/image-release-readme.txt b/config/image-release-readme.txt new file mode 100644 index 0000000..a8d0a38 --- /dev/null +++ b/config/image-release-readme.txt @@ -0,0 +1,73 @@ +SparkOS UEFI-Bootable Disk Image +================================== + +This package contains a UEFI-bootable disk image with SparkOS. + +Files: +- sparkos.img.gz - Compressed UEFI-bootable disk image (~1GB) + +What's Included: +--------------- +✓ GPT partition table +✓ EFI System Partition (ESP) with FAT32 filesystem +✓ GRUB UEFI bootloader +✓ Linux kernel +✓ SparkOS init system +✓ Busybox utilities +✓ Basic FHS-compliant filesystem structure + +Boot Support: +------------ +✓ UEFI boot (x86_64 systems) +✓ Automatic boot after 3 seconds +✓ Console on tty1 + +Quick Start: +----------- + +1. Decompress the image: + gunzip sparkos.img.gz + +2. Write to USB drive (Linux - BE CAREFUL!): + sudo dd if=sparkos.img of=/dev/sdX bs=4M status=progress oflag=sync + + WARNING: Replace /dev/sdX with your actual USB drive device. + This will DESTROY all data on the target drive! + +3. Boot from USB: + - Insert the USB drive into a UEFI-capable system + - Enter BIOS/UEFI settings (usually F2, F12, DEL, or ESC at boot) + - Select the USB drive as boot device + - SparkOS should boot automatically + +Advanced - Inspect Partitions: +------------------------------ + +To mount and inspect the partitions: + +# Set up loop device +sudo losetup -fP --show sparkos.img +# Note the loop device name (e.g., /dev/loop0) + +# Mount ESP (EFI System Partition) +sudo mount /dev/loop0p1 /mnt +ls -la /mnt/EFI +sudo umount /mnt + +# Mount root partition +sudo mount /dev/loop0p2 /mnt +ls -la /mnt +sudo umount /mnt + +# Cleanup +sudo losetup -d /dev/loop0 + +Documentation: +------------- +See the full documentation at: +https://github.com/johndoe6345789/SparkOS + +Support: +------- +For issues and questions, visit: +https://github.com/johndoe6345789/SparkOS/issues diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100644 index 0000000..b35e580 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,32 @@ +#!/bin/sh +echo "SparkOS Docker Test Environment" +echo "================================" +echo "" +echo "SparkOS init binary: /sparkos/rootfs/sbin/init" +echo "" +echo "Verifying init binary..." +if [ -f /sparkos/rootfs/sbin/init ]; then + echo "✓ Init binary exists" + ls -lh /sparkos/rootfs/sbin/init + echo "" + echo "File type:" + if command -v file >/dev/null 2>&1; then + file /sparkos/rootfs/sbin/init + else + echo " (file command not available)" + fi + echo "" + echo "Dependencies:" + ldd /sparkos/rootfs/sbin/init 2>&1 || echo " Static binary (no dependencies)" +else + echo "✗ Init binary not found!" + exit 1 +fi +echo "" +echo "Root filesystem structure:" +ls -la /sparkos/rootfs/ +echo "" +echo "SparkOS is ready for testing!" +echo "" +echo "To test the init system:" +echo " docker run --rm /sparkos/rootfs/sbin/init --help" \ No newline at end of file