mirror of
https://github.com/johndoe6345789/SparkOS.git
synced 2026-04-24 13:34:56 +00:00
Merge pull request #20 from johndoe6345789/copilot/extract-dockerfile-text
Extract embedded text blocks from Dockerfiles and workflows to dedicated files
This commit is contained in:
78
.github/workflows/build-image.yml
vendored
78
.github/workflows/build-image.yml
vendored
@@ -126,82 +126,8 @@ jobs:
|
|||||||
# Move the compressed image
|
# Move the compressed image
|
||||||
mv sparkos.img.gz release/
|
mv sparkos.img.gz release/
|
||||||
|
|
||||||
# Create a README for the release
|
# Copy the README for the release
|
||||||
cat > release/README.txt << 'EOF'
|
cp config/image-release-readme.txt release/README.txt
|
||||||
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
|
|
||||||
|
|
||||||
# Create a ZIP with the image and README
|
# Create a ZIP with the image and README
|
||||||
cd release || exit 1
|
cd release || exit 1
|
||||||
|
|||||||
64
.github/workflows/release.yml
vendored
64
.github/workflows/release.yml
vendored
@@ -81,68 +81,8 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Create README for the release
|
# Copy README for the release
|
||||||
cat > release/sparkos/RELEASE_README.md << 'HEREDOC_EOF'
|
cp config/RELEASE_README.md release/sparkos/RELEASE_README.md
|
||||||
# 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
|
|
||||||
|
|
||||||
echo "Package prepared in release/sparkos/"
|
echo "Package prepared in release/sparkos/"
|
||||||
ls -la release/sparkos/
|
ls -la release/sparkos/
|
||||||
|
|||||||
37
Dockerfile
37
Dockerfile
@@ -56,42 +56,7 @@ RUN echo "sparkos" > /sparkos/rootfs/etc/hostname && \
|
|||||||
echo "spark:x:1000:" >> /sparkos/rootfs/etc/group
|
echo "spark:x:1000:" >> /sparkos/rootfs/etc/group
|
||||||
|
|
||||||
# Create a test entrypoint
|
# Create a test entrypoint
|
||||||
COPY <<'EOF' /sparkos/test.sh
|
COPY scripts/test.sh /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 <image> /sparkos/rootfs/sbin/init --help"
|
|
||||||
echo ""
|
|
||||||
EOF
|
|
||||||
|
|
||||||
RUN chmod +x /sparkos/test.sh
|
RUN chmod +x /sparkos/test.sh
|
||||||
|
|
||||||
WORKDIR /sparkos
|
WORKDIR /sparkos
|
||||||
|
|||||||
@@ -138,29 +138,8 @@ RUN mkdir -p /output /mnt/esp /mnt/root && \
|
|||||||
echo "root:x:0:" > /mnt/root/etc/group && \
|
echo "root:x:0:" > /mnt/root/etc/group && \
|
||||||
echo "spark:x:1000:" >> /mnt/root/etc/group && \
|
echo "spark:x:1000:" >> /mnt/root/etc/group && \
|
||||||
\
|
\
|
||||||
# Create README
|
# Copy README to root partition
|
||||||
printf '%s\n' \
|
cp /build/config/image-readme.txt /mnt/root/README.txt && \
|
||||||
'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 && \
|
|
||||||
\
|
\
|
||||||
# Sync and unmount
|
# Sync and unmount
|
||||||
echo "Finalizing image..." && \
|
echo "Finalizing image..." && \
|
||||||
|
|||||||
59
config/RELEASE_README.md
Normal file
59
config/RELEASE_README.md
Normal file
@@ -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
|
||||||
20
config/image-readme.txt
Normal file
20
config/image-readme.txt
Normal file
@@ -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
|
||||||
73
config/image-release-readme.txt
Normal file
73
config/image-release-readme.txt
Normal file
@@ -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
|
||||||
32
scripts/test.sh
Normal file
32
scripts/test.sh
Normal file
@@ -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 <image> /sparkos/rootfs/sbin/init --help"
|
||||||
Reference in New Issue
Block a user