Offline archlinux ipxe generation
I made small modifications to the archlinux.ipxe template and added a script that generates it offline.
To recreate the model I followed the logic there
I also made the relevant changes in the build script. I marked it as draft because I am not sure if I got everything right with the folder structure etc.
TODO:
-
Add the relevant changes to gitlab-ci.yml -
The ipxe package itself should be modified to include this artifact instead of the one that is currently served by archweb. Verification code should be added to the package as the example I have put in bug 70767
Merge request reports
Activity
- ipxe/generate_archlinux_ipxe.py 0 → 100755
14 templateLoader = jinja2.FileSystemLoader(dir_path) 15 templateEnv = jinja2.Environment(loader=templateLoader) 16 template = templateEnv.get_template(archlinux_ipxe_template) 17 18 releases = [] 19 with urllib.request.urlopen(releases_url) as url: 20 data = json.loads(url.read()) 21 releases = sorted(data["releases"], key=itemgetter('release_date'), reverse=True) 22 releases = [ release["version"] for release in releases if release["available"]] 23 24 25 mirrors_by_country = [] 26 with urllib.request.urlopen(mirrors_url) as url: 27 data = json.loads(url.read()) 28 29 mirrorurls = [] An interesting metric to collect could be:
- How many overall mirrors do we add?
- How many mirrors per country do we add?
- Resolved by Spyros Seimenis
- Resolved by Spyros Seimenis
- ipxe/generate_archlinux_ipxe.py 0 → 100755
1 #!/usr/bin/env python 2 import os 3 import urllib.request, json 4 import jinja2 5 from collections import namedtuple 6 from operator import itemgetter 7 8 mirrors_url = "https://archlinux.org/mirrors/status/json" 9 releases_url = "https://archlinux.org/releng/releases/json/" Thinking further about this: You can just make use of the
version
in the build script and e.g. use a parameter to this script to set it. If this is the only information you need from the "release", you will not have to make the call against archweb at all.
- ipxe/generate_archlinux_ipxe.py 0 → 100755
4 import jinja2 5 from collections import namedtuple 6 from operator import itemgetter 7 8 mirrors_url = "https://archlinux.org/mirrors/status/json" 9 releases_url = "https://archlinux.org/releng/releases/json/" 10 11 dir_path = os.path.dirname(os.path.realpath(__file__)) 12 archlinux_ipxe_template = "archlinux.ipxe.jinja" 13 14 templateLoader = jinja2.FileSystemLoader(dir_path) 15 templateEnv = jinja2.Environment(loader=templateLoader) 16 template = templateEnv.get_template(archlinux_ipxe_template) 17 18 releases = [] 19 with urllib.request.urlopen(releases_url) as url: Please guard urllib.request.urlopen() with a try/except against e.g.
URLError
.changed this line in version 2 of the diff
- Resolved by Spyros Seimenis
- Resolved by Spyros Seimenis
mentioned in issue #11
added 8 commits
-
2abeb7e4...f3b03c7d - 5 commits from branch
archlinux:master
- 7658dd31 - Add script for offline generation of the ipxe intermediate artifact
- 7cd6857f - Add ipxe generation and signing to the build script
- f3f8687d - Address comments
Toggle commit list-
2abeb7e4...f3b03c7d - 5 commits from branch
316 create_checksums "${_ipxe_output}/archlinux.ipxe" 317 318 print_section_end "generate_archlinux_ipxe" 319 } 320 321 sign_archlinux_ipxe() { 322 # sign the archlinux.ipxe intermediate artifact 323 print_section_start "sign_archlinux_ipxe" "Signing archlinux.ipxe image" 324 325 local _ipxe_dir="${orig_pwd}/ipxe" 326 local _ipxe_output="${output}/ipxe/ipxe-${version}" 327 328 openssl cms \ 329 -sign \ 330 -binary \ 331 -noattr \ Not sure if it is a requirement. I copied it from archiso/mkarchiso#L678
This looks very good. Thank you @sespiros!
added 12 commits
-
7c64994c...8fe393ee - 8 commits from branch
archlinux:master
- 0c334e3f - Add script for offline generation of the ipxe intermediate artifact
- 59f9bd77 - Add ipxe generation and signing to the build script
- 3ea41361 - Address comments
- 52048084 - Fix build script for gitlab CI
Toggle commit list-
7c64994c...8fe393ee - 8 commits from branch