diff options
author | Cyril Bur <cyrilbur@gmail.com> | 2017-11-16 14:49:14 +1100 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2017-11-21 14:23:05 +1100 |
commit | 3a76e4214d5ca666e1d2d6c74e84309064c8a3ab (patch) | |
tree | b3a22aa445ffd7eb1dcf2963a96d29abfd3b6e8d /discover/boot.c | |
parent | 117a75f95ec31c2f9ea5e560c0355a2125b09b71 (diff) | |
download | talos-petitboot-3a76e4214d5ca666e1d2d6c74e84309064c8a3ab.tar.gz talos-petitboot-3a76e4214d5ca666e1d2d6c74e84309064c8a3ab.zip |
discover/pxe-parser: Fine grained proxy control
Petitboot provides a method for a user to manually specify a
configuration file that should be retrieved. Petitboot also has a
global proxy configuration.
This patch aims to marry the two so that a custom configuration file
can specify that a specific proxy should be used to access one (or all)
of the options within it.
This makes custom configuration files more powerful as they can point
to files behind proxies without the user needing to also specify the
global proxy for that specific custom configuration file to work.
This adds parsing for a `proxy` option which will apply to all boot
items found after.
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover/boot.c')
-rw-r--r-- | discover/boot.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/discover/boot.c b/discover/boot.c index fab4b61..ba4e720 100644 --- a/discover/boot.c +++ b/discover/boot.c @@ -579,6 +579,11 @@ struct boot_task *boot(void *ctx, struct discover_boot_option *opt, dtb = opt->dtb->url; } + if (opt && opt->proxy) { + setenv("http_proxy", opt->proxy, 1); + setenv("https_proxy", opt->proxy, 1); + } + boot_task = talloc_zero(ctx, struct boot_task); boot_task->dry_run = dry_run; boot_task->status_fn = status_fn; |