diff --git a/pkg/eve/runme.sh b/pkg/eve/runme.sh index 2c96cf6d63..28a2b06228 100755 --- a/pkg/eve/runme.sh +++ b/pkg/eve/runme.sh @@ -117,7 +117,7 @@ do_installer_net() { cat > /ipxe.efi.cfg <<__EOT__ #!ipxe # dhcp -# chain --autofree https://x.y.z/ipxe.efi.cfg +# chain --autofree https://github.com/lf-edge/eve/releases/download/1.2.3/ipxe.efi.cfg kernel kernel eve_installer=\${mac:hexhyp} fastboot console=ttyS0 console=ttyS1 console=ttyS2 console=ttyAMA0 console=ttyAMA1 console=tty0 initrd=initrd.img initrd=initrd.bits initrd initrd.img initrd initrd.bits diff --git a/pkg/ipxe/enable-https.patch b/pkg/ipxe/0000-enable-https.patch similarity index 100% rename from pkg/ipxe/enable-https.patch rename to pkg/ipxe/0000-enable-https.patch diff --git a/pkg/ipxe/0001-Accounting-for-HTTP-redirects-in-cwuri.patch b/pkg/ipxe/0001-Accounting-for-HTTP-redirects-in-cwuri.patch new file mode 100644 index 0000000000..aee395f1c4 --- /dev/null +++ b/pkg/ipxe/0001-Accounting-for-HTTP-redirects-in-cwuri.patch @@ -0,0 +1,72 @@ +From 32763ea775ff1aef5e8363e16b318c0c41fb9504 Mon Sep 17 00:00:00 2001 +From: Roman Shaposhnik +Date: Wed, 13 Jan 2021 19:23:46 +0000 +Subject: [PATCH] Accounting for HTTP redirects in cwuri + +Most modern CDNs would make you go through a few redirects before +you end up downloading content. Now, imagine an iPXE script like +http://boot.ipxe.org/demo/boot.php + +#!ipxe +kernel vmlinuz ... + +that gets loaded via "chain --autofree http://boot.ipxe.org/demo/boot.php" +AND suppose that http://boot.ipxe.org/demo/boot.php actually does a few +redirects so the actual boot.php ends up http://foo.bar/boot.php + +All of that will have a net result of making iPXE try to download +http://foo.bar/vmlinuz instead of http://boot.ipxe.org/demo/vmlinuz + +This patch makes symbolic redirect always take precedence, but in order +to upstream it we may need to have a knob that selects the behavior. + + +Signed-off-by: Roman Shaposhnik +--- + src/core/image.c | 2 +- + src/include/ipxe/image.h | 2 ++ + src/usr/imgmgmt.c | 2 ++ + 3 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/core/image.c b/src/core/image.c +index 078ce1b..ba52653 100644 +--- a/src/core/image.c ++++ b/src/core/image.c +@@ -299,7 +299,7 @@ int image_exec ( struct image *image ) { + + /* Switch current working directory to be that of the image itself */ + old_cwuri = uri_get ( cwuri ); +- churi ( image->uri ); ++ churi ( image->ouri ); + + /* Preserve record of any currently-running image */ + saved_current_image = current_image; +diff --git a/src/include/ipxe/image.h b/src/include/ipxe/image.h +index 2e7eb4c..0c11e2f 100644 +--- a/src/include/ipxe/image.h ++++ b/src/include/ipxe/image.h +@@ -30,6 +30,8 @@ struct image { + + /** URI of image */ + struct uri *uri; ++ /** original URI of image */ ++ struct uri *ouri; + /** Name */ + char *name; + /** Flags */ +diff --git a/src/usr/imgmgmt.c b/src/usr/imgmgmt.c +index a01d6e2..6d63e65 100644 +--- a/src/usr/imgmgmt.c ++++ b/src/usr/imgmgmt.c +@@ -78,6 +78,8 @@ int imgdownload ( struct uri *uri, unsigned long timeout, + if ( ! *image ) { + rc = -ENOMEM; + goto err_alloc_image; ++ } else { ++ (*image)->ouri = uri_dup( uri ); + } + + /* Create downloader */ +-- +2.20.2 +