Repository navigation
Engine OS 5.x boot process
Carl Kittelberger edited this page Jul 13, 2026
·
1 revision
-
U-Boot loads
zImage(kernel) andDTBfrom boot partition - Kernel boots with
console=ttyS0,115200(serial console on UART) -
systemd PID 1 starts, scans
/usr/lib/systemd/system/for units -
etc.mount mounts
/etcas OverlayFS:- lowerdir=/etc (read-only base rootfs)
- upperdir=/data/system/etc/overlay (writable overlay)
- workdir=/data/system/etc/.work
-
var.mount mounts
/varas OverlayFS (same pattern) -
overlayfs-setup.service runs
systemd-tmpfiles --create --remove /etc/az01/overlayfs.conf(wipes certain files from overlay) -
systemd scans
/etc/systemd/system/for enabled services (AFTER overlay is mounted) - Services start in dependency order
systemd scans /etc/systemd/system ONCE at boot, AFTER the /etc overlay is mounted. Any files placed in the overlay AFTER this point are invisible to systemd until daemon-reload is called.
This means:
- Overlay-only SSH persistence cannot work for enabling new services
- The sshd.service hardlink must be in the base rootfs (not the overlay)
- No vendor unit in 5.0.3 calls
daemon-reload
Must modify the base rootfs in the AZ01 image:
- Add
sshd.servicehardlink at/etc/systemd/system/multi-user.target.wants/sshd.service - Add
authorized_keysat/root/.ssh/authorized_keys - Recompress rootfs as xz
- Repack AZ01 image with correct SHA1 hashes
-
Location:
/usr/bin/az01-script-runner(compiled ELF) - Port: UDP 36895 (0x901f in network byte order)
- Binding: 127.0.0.1 (localhost only)
-
Function: Receives commands via
recvfrom(), executes viasystem() - Buffer: 256 bytes
- Error handling: Prints "Command received was longer than buffer - ignoring" if command exceeds buffer
- Status: Factory/development service, not accessible from network
| Service | Purpose |
|---|---|
connman.service |
Network manager (D-Bus) |
az01-script-runner.service |
Local UDP command executor |
engine.service |
Main Engine application |
overlayfs-setup.service |
Applies overlayfs.conf wipe rules |
sshd.service |
OpenSSH server (NOT enabled by default) |
ip6tables.service |
IPv6 firewall |
az01-usbsata-fixer.service |
USB/SATA fixer (compiled binary) |
az0x-data-mkfs.service |
Data partition formatting (shell script) |
az0x-setup-hostname.service |
Hostname setup (shell script) |
R /data/system/etc/overlay/ssh
r /data/system/etc/overlay/group
r /data/system/etc/overlay/gshadow
r /data/system/etc/overlay/passwd
r /data/system/etc/overlay/shadow
The R rule recursively deletes the ssh directory from the overlay. The r rules delete specific files.
-
/etc/ssh/sshd_config.d/10-az0x.conf:HostKey /etc/ssh/ssh_host_ed25519_key HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-ed25519 PermitRootLogin prohibit-password PasswordAuthentication no KbdInteractiveAuthentication no - Host keys exist:
/etc/ssh/ssh_host_ed25519_key,/etc/ssh/ssh_host_rsa_key - InMusic CA cert in
/root/.ssh/authorized_keys(767 bytes)
Device is running 5.0.3 with modified rootfs containing:
- sshd.service hardlink at correct location
- User's ed25519 key + InMusic CA in authorized_keys
- All dependencies met (sshd binary, config, host keys)
But SSH still not working (port 22 closed, connection refused).
Possible causes:
- sshd service failing to start for unknown reason
- Some security feature preventing sshd from running
- The hardlink not being recognized by systemd for some reason
- Missing dependency or configuration issue
- Get console access (serial USB adapter needed)
- Check systemd journal for sshd startup errors
- Verify sshd is actually attempting to start
- Check if there's a firewall or security policy blocking port 22