On Mon, Jun 01, 2026 at 01:07:52PM +0530, Anshu Kumari wrote:
Introduce the --dhcp-boot flag that sets the boot file URL for network boot specially for ipxe. This patch adds the option storage and CLI parsing.
Link: https://bugs.passt.top/show_bug.cgi?id=192 Signed-off-by: Anshu Kumari
Reviewed-by: David Gibson
--- v3: - case 32 now calls dhcp_add_option(c, 67, optarg). - Handles duplicate codes: --dhcp-boot and --dhcp-opt 67 coexist correctly, last value wins.
v2: - Removed separate dhcp_boot[PATH_MAX] field — --dhcp-boot foo now stores into custom_opts[] as code 67 (same as --dhcp-opt 67,foo)
--- conf.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/conf.c b/conf.c index ce78af1..f7281e2 100644 --- a/conf.c +++ b/conf.c @@ -618,6 +618,7 @@ static void usage(const char *name, FILE *f, int status) " a single, empty option disables the DNS search list\n" " -H, --hostname NAME Hostname to configure client with\n" " --fqdn NAME FQDN to configure client with\n" + " --dhcp-boot URL Boot file URL for network boot\n" " --dhcp-opt CODE,VAL Set DHCP option by code\n"); if (strstr(name, "pasta")) FPRINTF(f, " default: don't use any search list\n"); @@ -1239,6 +1240,7 @@ void conf(struct ctx *c, int argc, char **argv) {"migrate-no-linger", no_argument, NULL, 30 }, {"stats", required_argument, NULL, 31 }, {"conf-path", required_argument, NULL, 'c' }, + {"dhcp-boot", required_argument, NULL, 32 }, {"dhcp-opt", required_argument, NULL, 33 }, { 0 }, }; @@ -1475,6 +1477,9 @@ void conf(struct ctx *c, int argc, char **argv) die("Can't display statistics if not running in foreground"); c->stats = strtol(optarg, NULL, 0); break; + case 32: + dhcp_add_option(c, 67, optarg); + break; case 33: comma = strchr(optarg, ','); if (!comma) -- 2.54.0
-- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson