Skip to content
Snippets Groups Projects

Offline archlinux ipxe generation

Merged Spyros Seimenis requested to merge sespiros/releng:issues/9 into master
4 unresolved threads

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
Edited by Spyros Seimenis

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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 = []
  • David Runge
  • David Runge
  • David Runge
    David Runge @dvzrv started a thread on the diff
  • 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/"
    • This will become problematic in the future, as we will want to feed this data to archweb (we can't retrieve the data for a release that has not yet been made), so this data will eventually need to be generated as a build artifact (I guess).

    • 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.

    • Ah, the "available" releases will still have to be gotten from the endpoint. However, the "current" should be defined by the build artifacts.

    • Author Contributor

      I don't think there is any change I can make to make it work with the state of things as they are right now. It would require the python script to retrieve mirrors/releases information in some other way which is not implemented yet.

    • Please register or sign in to reply
  • 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:
  • David Runge
  • David Runge
  • David Runge mentioned in issue #11

    mentioned in issue #11

  • Author Contributor

    Thanks for the review David! I will get some time the coming days to address all of your comments.

  • Spyros Seimenis added 8 commits

    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

    Compare with previous version

  • 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 \
  • This looks very good. Thank you @sespiros!

  • added 1 commit

    • c59546d2 - Fix build script for gitlab CI

    Compare with previous version

  • added 1 commit

    • 7c64994c - Fix build script for gitlab CI

    Compare with previous version

  • Spyros Seimenis marked the checklist item Add the relevant changes to gitlab-ci.yml as completed

    marked the checklist item Add the relevant changes to gitlab-ci.yml as completed

  • Spyros Seimenis marked this merge request as ready

    marked this merge request as ready

  • Spyros Seimenis added 12 commits

    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

    Compare with previous version

  • merged

  • Please register or sign in to reply
    Loading