Skip to content

Conversation

@antonym
Copy link
Member

@antonym antonym commented Nov 17, 2025

Fixes issue where setting archlinux_mirror to an HTTPS URL would result in malformed URLs like http://https://mirror.example.com/...

Changes:

  • Remove hardcoded http:// prefix from archiso_http_srv parameter
  • Remove hardcoded http:// prefix from kernel URL
  • Remove hardcoded http:// prefix from initrd URL
  • Add http:// prefix to default archlinux mirror for backward compatibility

Now respects the protocol specified in the archlinux_mirror configuration, allowing both HTTP and HTTPS mirrors to work correctly.

Fixes #1703

Fixes issue where setting archlinux_mirror to an HTTPS URL would result
in malformed URLs like http://https://mirror.example.com/...

Changes:
- Remove hardcoded http:// prefix from archiso_http_srv parameter
- Remove hardcoded http:// prefix from kernel URL
- Remove hardcoded http:// prefix from initrd URL
- Add http:// prefix to default archlinux mirror for backward compatibility

Now respects the protocol specified in the archlinux_mirror configuration,
allowing both HTTP and HTTPS mirrors to work correctly.

Fixes #1703

Co-authored-by: Antony Messerli <[email protected]>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where setting archlinux_mirror to an HTTPS URL would result in malformed URLs due to hardcoded http:// prefixes. The fix removes the hardcoded protocol prefixes from the template and adds the protocol to the default mirror value for backward compatibility.

  • Removes hardcoded http:// prefixes from the Arch Linux iPXE template
  • Adds http:// protocol prefix to the default Arch Linux mirror configuration
  • Aligns Arch Linux mirror handling with other distributions in the codebase

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
roles/netbootxyz/templates/menu/archlinux.ipxe.j2 Removes hardcoded http:// prefixes from archiso_http_srv parameter, kernel URL, and initrd URL to respect the protocol specified in archlinux_mirror
roles/netbootxyz/defaults/main.yml Adds http:// prefix to the default archlinux mirror value to maintain backward compatibility with existing configurations that don't specify a protocol

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

set params archiso_http_srv=http://${real_archlinux_mirror}/${archlinux_base_dir}/iso/${arch_version}/ archisobasedir=arch cms_verify=y ${ipparam} net.ifnames=0 {{ kernel_params }}
kernel http://${archlinux_mirror}/${dir}/${os_arch}/vmlinuz-linux ${params}
initrd http://${archlinux_mirror}/${dir}/${os_arch}/initramfs-linux.img
set params archiso_http_srv=${real_archlinux_mirror}/${archlinux_base_dir}/iso/${arch_version}/ archisobasedir=arch cms_verify=y ${ipparam} net.ifnames=0 {{ kernel_params }}
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent variable usage: this line uses real_archlinux_mirror while lines 40-41 use archlinux_mirror. In static IP configurations, real_archlinux_mirror contains the resolved IP address from the nslookup command (line 18), but with the protocol prefix now included in archlinux_mirror, the nslookup will fail. This could cause the archiso_http_srv parameter to receive an unresolved hostname with protocol prefix in static IP scenarios, potentially breaking the boot process.

Suggested change
set params archiso_http_srv=${real_archlinux_mirror}/${archlinux_base_dir}/iso/${arch_version}/ archisobasedir=arch cms_verify=y ${ipparam} net.ifnames=0 {{ kernel_params }}
set params archiso_http_srv=${archlinux_mirror}/${archlinux_base_dir}/iso/${arch_version}/ archisobasedir=arch cms_verify=y ${ipparam} net.ifnames=0 {{ kernel_params }}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can not set archlinux_mirror to a https repo

2 participants