Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kernel/hypeman
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: kernel/hypeman
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: drpc
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 35 files changed
  • 1 contributor

Commits on Dec 23, 2025

  1. plan

    rgarcia committed Dec 23, 2025
    Configuration menu
    Copy the full SHA
    d09b2d8 View commit details
    Browse the repository at this point in the history

Commits on Dec 24, 2025

  1. feat: add systemd mode for EC2-like VMs

    Replace shell-based init script with Go binary that supports two modes:
    
    ## Exec Mode (existing behavior)
    - Go init runs as PID 1
    - Starts guest-agent in background
    - Runs container entrypoint as child process
    - Used for standard Docker images (nginx, python, etc.)
    
    ## Systemd Mode (new)
    - Auto-detected when image CMD is /sbin/init or /lib/systemd/systemd
    - Go init sets up rootfs, then chroots and execs systemd
    - Systemd becomes PID 1 and manages the full system
    - guest-agent runs as a systemd service (hypeman-agent.service)
    - Enables EC2-like experience: ssh, systemctl, journalctl all work
    
    ## Key changes:
    - lib/system/init/: New Go-based init binary with modular boot phases
    - lib/images/systemd.go: IsSystemdImage() auto-detection from CMD
    - lib/instances/configdisk.go: Passes INIT_MODE to guest
    - lib/system/init/init.sh: Shell wrapper to mount /proc /sys /dev
      before Go runtime (Go requires these during initialization)
    - integration/systemd_test.go: Full E2E test verifying:
      - systemd is PID 1
      - hypeman-agent.service is active
      - journalctl works for viewing logs
    
    ## Boot flow:
    1. Kernel loads initrd with busybox + Go init + guest-agent
    2. init.sh mounts /proc, /sys, /dev (Go runtime needs these)
    3. init.sh execs Go init binary
    4. Go init mounts overlay rootfs, configures network, copies agent
    5. Based on INIT_MODE: exec mode (run entrypoint) or systemd mode (chroot + exec /sbin/init)
    rgarcia committed Dec 24, 2025
    Configuration menu
    Copy the full SHA
    bb45dcb View commit details
    Browse the repository at this point in the history
  2. drpc poc

    rgarcia committed Dec 24, 2025
    Configuration menu
    Copy the full SHA
    5fe29d9 View commit details
    Browse the repository at this point in the history
Loading