Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow passing in network settings via kernel boot args for firecracker #1976

Closed
eyberg opened this issue Nov 29, 2023 · 0 comments · Fixed by #1983
Closed

allow passing in network settings via kernel boot args for firecracker #1976

eyberg opened this issue Nov 29, 2023 · 0 comments · Fixed by #1983
Assignees

Comments

@eyberg
Copy link
Contributor

eyberg commented Nov 29, 2023

currently images produced for firecracker either need dhcp or if using static need to be re-built - this option would allow the user to supply static w/out having to re-build the image

nanovms/ops#1554

this should override what might already be in the manifest

@francescolavra francescolavra self-assigned this Dec 7, 2023
francescolavra added a commit that referenced this issue Dec 13, 2023
This patch 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).
The PC platform code has been amended by adding a new
REGION_CMDLINE region type holding the location and size of the
command line, which can be accessed later in the boot process. The
existing parsing of the virtio_mmio command line options has been
moved to kernel/init.c, so that it can be called by
virtio_mmio_enum_devs() instead of platform-specific code. The only
platform-specific code is the code that retrieves (and potentially
updates) the command line, while the parsing implementation is in
kernel/init.c.
With these changes, it is possible for example to override the
network settings when starting an instance from a given image
(without modifiying the image itself) by specifiying those settings
in the kernel command line ("boot_args" paramenter 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"

Closes #1976
francescolavra added a commit that referenced this issue Dec 13, 2023
This patch 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).
The PC platform code has been amended by adding a new
REGION_CMDLINE region type holding the location and size of the
command line, which can be accessed later in the boot process. The
existing parsing of the virtio_mmio command line options has been
moved to kernel/init.c, so that it can be called by
virtio_mmio_enum_devs() instead of platform-specific code. The only
platform-specific code is the code that retrieves (and potentially
updates) the command line, while the parsing implementation is in
kernel/init.c.
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"

Closes #1976
francescolavra added a commit that referenced this issue Dec 14, 2023
This patch 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).
The PC platform code has been amended by adding a new
REGION_CMDLINE region type holding the location and size of the
command line, which can be accessed later in the boot process. The
existing parsing of the virtio_mmio command line options has been
moved to kernel/init.c, so that it can be called by
virtio_mmio_enum_devs() instead of platform-specific code. The only
platform-specific code is the code that retrieves (and potentially
updates) the command line, while the parsing implementation is in
kernel/init.c.
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"

Closes #1976
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants