diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..416359f --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +# Build artifacts and large files +*.qcow2 +*.img +*.raw +*.iso + +# Image filesystem +image-fs/ + +# Output directory +output/ + +# Build files +build_files/ + +# Temporary files +*.tmp +*.temp +*~ + +# IDE and editor files +.vscode/ +.idea/ +*.swp +*.swo + +# OS generated files +.DS_Store +Thumbs.db diff --git a/Containerfile b/Containerfile index f90465a..2cf4411 100644 --- a/Containerfile +++ b/Containerfile @@ -26,8 +26,16 @@ RUN apt-get update && apt-get install -y \ locales \ ca-certificates \ tzdata \ + podman \ + skopeo \ && rm -rf /var/lib/apt/lists/* +# Install particle-os specific packages +COPY packages/*.deb /tmp/packages/ +RUN dpkg -i /tmp/packages/bootc_*.deb /tmp/packages/apt-ostree_*.deb || true && \ + apt-get install -f -y && \ + rm -rf /tmp/packages + # Configure locale RUN locale-gen en_US.UTF-8 ENV LANG=en_US.UTF-8 diff --git a/build_files/packages.json b/build_files/packages.json deleted file mode 100644 index 2f3e450..0000000 --- a/build_files/packages.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "packages": { - "core": { - "description": "Core system packages", - "packages": [ - "systemd", - "systemd-sysv", - "udev", - "procps", - "util-linux", - "mount", - "passwd", - "login", - "bash", - "coreutils" - ] - }, - "ostree": { - "description": "OSTree and boot management", - "packages": [ - "ostree", - "ostree-boot" - ] - }, - "kernel": { - "description": "Kernel and boot essentials", - "packages": [ - "linux-image-amd64", - "linux-headers-amd64", - "initramfs-tools" - ] - }, - "tools": { - "description": "Essential command line tools", - "packages": [ - "curl", - "wget", - "vim", - "less", - "locales", - "ca-certificates", - "tzdata" - ] - }, - "development": { - "description": "Development tools (optional)", - "packages": [ - "build-essential", - "git", - "python3", - "python3-pip" - ] - } - }, - "repositories": { - "debian": { - "url": "http://deb.debian.org/debian", - "suite": "trixie", - "components": ["main", "contrib", "non-free"] - } - }, - "post_install": [ - "usr/share/particle-os/firstboot/setup-system.sh", - "usr/share/particle-os/firstboot/configure-network.sh" - ] -} diff --git a/etc/bootupd.conf b/etc/bootupd.conf new file mode 100644 index 0000000..1a4f412 --- /dev/null +++ b/etc/bootupd.conf @@ -0,0 +1,4 @@ +[updates] +enabled = true +registry = "git.raines.xyz" +image = "robojerk/particle-os/simple-cli" diff --git a/etc/hostname b/etc/hostname new file mode 100644 index 0000000..887fc25 --- /dev/null +++ b/etc/hostname @@ -0,0 +1 @@ +simple-cli diff --git a/etc/hosts b/etc/hosts new file mode 100644 index 0000000..547d9e9 --- /dev/null +++ b/etc/hosts @@ -0,0 +1,7 @@ +127.0.0.1 localhost +127.0.1.1 simple-cli + +# The following lines are desirable for IPv6 capable hosts +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters diff --git a/etc/ostree/remotes.d/particle-os.conf b/etc/ostree/remotes.d/particle-os.conf new file mode 100644 index 0000000..7f81641 --- /dev/null +++ b/etc/ostree/remotes.d/particle-os.conf @@ -0,0 +1,3 @@ +[remote "particle-os"] +url=https://git.raines.xyz/robojerk/particle-os +gpg-verify=false diff --git a/etc/systemd/system/default.target b/etc/systemd/system/default.target new file mode 100644 index 0000000..c117e94 --- /dev/null +++ b/etc/systemd/system/default.target @@ -0,0 +1,4 @@ +[Unit] +Description=Simple CLI Default Target +Requires=multi-user.target +AllowIsolate=yes diff --git a/test-boot-full.sh b/test-boot-full.sh new file mode 100755 index 0000000..5f2d8bc --- /dev/null +++ b/test-boot-full.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Test script to boot the simple-cli image with full BIOS/GRUB visibility (headless) + +echo "Testing simple-cli bootable image with full boot process..." +echo "Image: simple-cli.qcow2" +echo "Size: $(ls -lh simple-cli.qcow2 | awk '{print $5}')" + +# Test boot with QEMU (full boot process - BIOS, GRUB, kernel) +echo "Testing full boot process (headless)..." +echo "You should see:" +echo "1. QEMU BIOS screen" +echo "2. GRUB boot menu (if configured)" +echo "3. Kernel loading" +echo "4. System boot" +echo "" +echo "Press Ctrl+C to stop the VM when done testing." + +qemu-system-x86_64 \ + -m 2G \ + -smp 2 \ + -drive file=simple-cli.qcow2,format=qcow2 \ + -boot c \ + -nographic \ + -serial mon:stdio + +echo "Test complete!" diff --git a/test-boot.sh b/test-boot.sh new file mode 100755 index 0000000..01e7d67 --- /dev/null +++ b/test-boot.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Test script to boot the simple-cli image (headless) + +echo "Testing simple-cli bootable image..." +echo "Image: simple-cli.qcow2" +echo "Size: $(ls -lh simple-cli.qcow2 | awk '{print $5}')" + +# Test boot with QEMU (headless with kernel/initrd) +echo "Testing boot process (headless with direct kernel boot)..." +echo "You should see the kernel boot process directly!" +echo "Press Ctrl+C to stop the VM when done testing." + +qemu-system-x86_64 \ + -m 2G \ + -smp 2 \ + -drive file=simple-cli.qcow2,format=qcow2 \ + -boot c \ + -nographic \ + -serial mon:stdio \ + -append "console=ttyS0 root=/dev/sda1 rw" \ + -kernel image-fs/boot/vmlinuz-6.12.38+deb13-amd64 \ + -initrd image-fs/boot/initrd.img-6.12.38+deb13-amd64 + +echo "Test complete!" diff --git a/usr/share/particle-os/firstboot/setup-system.sh b/usr/share/particle-os/firstboot/setup-system.sh index a8cb4dc..0329ae2 100755 --- a/usr/share/particle-os/firstboot/setup-system.sh +++ b/usr/share/particle-os/firstboot/setup-system.sh @@ -1,50 +1,16 @@ #!/bin/bash -# Simple CLI First Boot Setup Script -# Based on Aurora's firstboot pattern +# Simple CLI firstboot setup script -set -euo pipefail +echo "Setting up Simple CLI system..." -echo "=== Simple CLI First Boot Setup ===" - -# Configure system locale -echo "Configuring locale..." -locale-gen en_US.UTF-8 -update-locale LANG=en_US.UTF-8 +# Set hostname +hostnamectl set-hostname simple-cli # Configure timezone -echo "Configuring timezone..." -ln -sf /usr/share/zoneinfo/UTC /etc/localtime +timedatectl set-timezone UTC -# Create user directories -echo "Setting up user directories..." -mkdir -p /home/simple/.config -mkdir -p /home/simple/.local/share -chown -R simple:simple /home/simple - -# Configure systemd services -echo "Configuring systemd services..." -systemctl enable systemd-networkd -systemctl enable systemd-resolved +# Enable systemd services systemctl enable systemd-timesyncd +systemctl enable ostree-remount -# Configure networking -echo "Configuring networking..." -cat > /etc/systemd/network/20-wired.network << EOF -[Match] -Name=en* - -[Network] -DHCP=yes -EOF - -# Configure OSTree -echo "Configuring OSTree..." -mkdir -p /usr/lib/ostree-boot -ostree admin init-fs /usr/lib/ostree-boot - -# Set up bootupd -echo "Configuring bootupd..." -bootupd install - -echo "=== First boot setup complete ===" -echo "System is ready for use!" +echo "Simple CLI setup complete" diff --git a/usr/share/particle-os/just/simple-cli.just b/usr/share/particle-os/just/simple-cli.just index 87ab195..a0d9edf 100644 --- a/usr/share/particle-os/just/simple-cli.just +++ b/usr/share/particle-os/just/simple-cli.just @@ -1,91 +1,28 @@ -# Simple CLI ujust Commands -# Based on Aurora's ujust pattern +# Simple CLI ujust commands -# Show system information -info: +# Show system status +status: #!/usr/bin/env bash - echo "=== Simple CLI System Information ===" + echo "=== Simple CLI System Status ===" + echo "Hostname: $(hostname)" echo "OS: $(cat /etc/os-release | grep PRETTY_NAME | cut -d'"' -f2)" echo "Kernel: $(uname -r)" - echo "Architecture: $(uname -m)" - echo "Hostname: $(hostname)" - echo "Uptime: $(uptime -p)" + echo "Uptime: $(uptime)" echo "================================" -# Show OSTree status -ostree-status: - #!/usr/bin/env bash - echo "=== OSTree Status ===" - ostree status - echo "===================" - # Update system update: #!/usr/bin/env bash echo "Updating Simple CLI system..." - sudo ostree admin upgrade - echo "Update complete. Reboot to apply changes." + sudo bootc upgrade + echo "Update complete" -# Show package information -packages: +# Show OSTree status +ostree-status: #!/usr/bin/env bash - echo "=== Installed Packages ===" - dpkg -l | wc -l - echo "=========================" + ostree status -# Show system services -services: +# Show bootupd status +bootupd-status: #!/usr/bin/env bash - echo "=== System Services ===" - systemctl list-units --type=service --state=running - echo "======================" - -# Show network status -network: - #!/usr/bin/env bash - echo "=== Network Status ===" - ip addr show - echo "=====================" - -# Show disk usage -disk: - #!/usr/bin/env bash - echo "=== Disk Usage ===" - df -h - echo "=================" - -# Show memory usage -memory: - #!/usr/bin/env bash - echo "=== Memory Usage ===" - free -h - echo "===================" - -# Show process information -processes: - #!/usr/bin/env bash - echo "=== Top Processes ===" - ps aux --sort=-%cpu | head -10 - echo "====================" - -# Show system logs -logs: - #!/usr/bin/env bash - echo "=== Recent System Logs ===" - journalctl -n 20 --no-pager - echo "=========================" - -# Help command -help: - @echo "Simple CLI ujust Commands:" - @echo " info - Show system information" - @echo " ostree-status - Show OSTree status" - @echo " update - Update system" - @echo " packages - Show package count" - @echo " services - Show running services" - @echo " network - Show network status" - @echo " disk - Show disk usage" - @echo " memory - Show memory usage" - @echo " processes - Show top processes" - @echo " logs - Show recent logs" - @echo " help - Show this help" + bootupd status