Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Kernel command line

/init reads /proc/cmdline and copies it to the KERNEL_CMDLINE environment variable for the application. Values may be quoted with double quotes if they contain spaces; a value cannot itself contain a double quote.

KeyDefaultMeaning
uniapp.mode=iex|app|erliexIEx shell, application only (-noshell), or plain Erlang shell
uniapp.code=embedded|interactiveinteractiveERTS code loading mode. embedded loads every module of the boot script at start (the Mix release default) and roughly doubles RSS; interactive loads on demand
uniapp.ip=A.B.C.D/NDHCPstatic address of the first NIC (disables DHCP)
uniapp.gw=A.B.C.Dfrom DHCPdefault route
uniapp.dns=A.B.C.Dfrom DHCPnameserver, written to /etc/resolv.conf
uniapp.tls_host=HOSTunsetsample app only: enables the DNS and TLS 1.3 client probes against HOST:443
uniapp.emu="FLAGS"unsetextra beam.smp emulator flags, space separated. Note that erl +X is spelled -X here (erlexec does the translation normally), e.g. uniapp.emu="-S 1 -sbwt none"
uniapp.eval="EXPR."unsetan Erlang expression passed as -eval, run during boot. Debugging aid
uniapp.on_exit=reboot|poweroff|haltrebootwhat /init does when beam.smp exits on its own. reboot re-runs the image (what an auto-scaling group wants from a crashed node); under QEMU with -no-reboot it ends the VM. A power button press always powers off
uniapp.halt_after_first_boot=MSunsetsample app, test hook: exit the VM MS ms into the first boot of a data volume (boot_count 1) so a test can watch the restart path
uniapp.imds=1unsetEC2: query IMDSv2 for identity (EC2_INSTANCE_ID, AWS_REGION, … in the environment) and user data. User-data lines key=value override command-line keys; the raw user data is in /run/user-data
uniapp.ntp=A.B.C.D|offAmazon Time Sync when imds=1, else offSNTP server; the clock is set at boot and resynced hourly
uniapp.data=auto|/dev/X|LABEL=name|offunsetmount an ext2 data volume read-write at /data (auto: the first block device that mounts); exports UNIAPP_DATA=/data, crash dumps go to /data/erl_crash.dump
uniapp.mounts=DEV:DIR[,...]unsetmore ext2 volumes, DEV a device node or LABEL=name; UNIAPP_MOUNTS lists the directories
uniapp.sync_s=N30/init calls sync(2) every N seconds while volumes are mounted (0 disables)
uniapp.write_test=NAMEunsetsample app, test hook: write NAME on the data volume without fsync 2 s after boot
uniapp.probe_ipv6=1unsetsample app: IPv6 loopback and address probes (PROBE ipv6_*)
uniapp.cloudwatch=1unsetsample app: ship the log to CloudWatch Logs and publish EMF metrics using the instance role (needs imds=1)
uniapp.log_group=NAME/elixir_unikernelCloudWatch log group; the stream is the instance id
uniapp.health_port=N8080sample app: port of /healthz and /livez
uniapp.bench_peer=A.B.C.Dunsetsample app: after boot, push 8 MB through that host’s TCP echo and print BENCH tcp_echo_peer (uniapp.bench_delay_ms, default 30000)
uniapp.metric_namespace=NAMEelixir_unikernelCloudWatch namespace for BootCount, Uptime, MemoryTotal, ProcessCount

Keys from EC2 user data are read before the kernel’s own line, so uniapp.mode=iex in user data turns an app image into an IEx one without rebuilding the AMI.

Kernel-side keys that matter:

KeyLinuxAsterinas
console=ttyS0required for serial outputrequired
earlyconoptionalrequired to see output before the console driver is up
loglevel=Nkernel verbosityerror, info, debug (a word, not a number)
rdinit=/inittells Linux to run our initdefault is /init already
ip=dhcpignored (/init does DHCP itself)in-kernel DHCP client on eth0, lease in /proc/net/dhcp
ena.queues=N|auton/aENA queue pairs (default auto = one per vCPU, max 8). Kernel parameter: must be on the kernel command line (ENA_ARGS), not in user data
ena.offload=0n/aENA: software checksums instead of offload
ena.test_reset=SECONDSn/aENA: force one device reset after boot (tests the recovery path)
ena.aenq_irq=1n/aENA: unmask the admin interrupt (default polled)
quietsuppresses boot messagesignored

Sample app environment (set in the release stage or by /init):

VariableMeaning
UNIAPP_LOG_LEVELLogger level, read by config/runtime.exs
UNIAPP_ECHO_PORTTCP echo port (UDP uses port + 1); default 4000
UNIAPP_CACERTSCA bundle path for the TLS client probe; default /etc/ssl/cacert.pem