nanovms / nanos

A kernel designed to run one and only one application in a virtualized environment
https://nanos.org
Apache License 2.0
2.59k stars 134 forks source link

Kernel command line: add support for arbitrary configuration settings #1983

Closed francescolavra closed 9 months ago

francescolavra commented 9 months ago

This patch set adds support for changing arbitrary settings in the root tuple via the kernel command line (which is retrieved by the kernel when booting under AWS Firecracker on x86). With these changes, it is possible for example to override the network settings when starting an instance from a given image (without modifying the image itself) by specifying those settings in the kernel command line ("boot_args" parameter in the Firecracker configuration file), as in the following example: "en1.ipaddr=10.3.3.6 en1.netmask=255.255.0.0 en1.gateway=10.3.0.1". In the above example, "en1" identifies the first network interface; if multiple interfaces are used (en2, en3, etc.), each of them can be configured independently. Example to configure a static IPv6 address on the first network interface: "en1.ip6addr=20::A8FC:FF:7600:AA" Example to add an environment variable (or override its value if the variable is already present in the image): "environment.VAR_NAME=VAR_VALUE" Example to modify the program arguments: "arguments.0=/bin/my-program arguments.1=--my-option"

The first 3 commits are fixes for issues that have been exposed by the last 2 commits; the fix in the first commit allows all available physical memory ranges to be used by the kernel, without requiring 2MB alignment of the range start.

Closes #1976

francescolavra commented 9 months ago

I added 2 commits to fix concurrency issues observed when running CI tests.