summaryrefslogtreecommitdiff
path: root/releng
diff options
context:
space:
mode:
Diffstat (limited to 'releng')
-rw-r--r--releng/urls.py5
-rw-r--r--releng/views.py21
2 files changed, 25 insertions, 1 deletions
diff --git a/releng/urls.py b/releng/urls.py
index ca76eb25..0e87de48 100644
--- a/releng/urls.py
+++ b/releng/urls.py
@@ -22,9 +22,14 @@ releases_patterns = patterns('releng.views',
'release_torrent', {}, 'releng-release-torrent'),
)
+netboot_patterns = patterns('releng.views',
+ (r'^archlinux\.ipxe$', 'netboot_config', {}, 'releng-netboot-config')
+)
+
urlpatterns = patterns('',
(r'^feedback/', include(feedback_patterns)),
(r'^releases/', include(releases_patterns)),
+ (r'^netboot/', include(netboot_patterns)),
)
# vim: set ts=4 sw=4 et:
diff --git a/releng/views.py b/releng/views.py
index dbb65c2e..7db469cd 100644
--- a/releng/views.py
+++ b/releng/views.py
@@ -13,7 +13,7 @@ from django.views.generic import DetailView, ListView
from .models import (Architecture, BootType, Bootloader, ClockChoice,
Filesystem, HardwareType, InstallType, Iso, IsoType, Module, Source,
Test, Release)
-
+from mirrors.models import (Mirror, MirrorUrl, MirrorProtocol)
def standard_field(model, empty_label=None, help_text=None, required=True):
return forms.ModelChoiceField(queryset=model.objects.all(),
@@ -280,4 +280,23 @@ def releases_json(request):
response = HttpResponse(to_json, content_type='application/json')
return response
+def netboot_config(request):
+ release_qs = Release.objects.filter(available=True).order_by('-release_date')
+ releases = [ release.version for release in release_qs ]
+ mirrorurls = MirrorUrl.objects.filter(protocol__protocol='http',
+ active=True,
+ mirror__public=True,
+ mirror__active=True,
+ mirror__isos=True)
+ mirrorurls = sorted( mirrorurls,
+ key=lambda x: x.mirror.name)
+ mirrorurls = sorted( mirrorurls,
+ key=lambda x: x.country.name)
+ context = {
+ 'archs': [ 'i686', 'x86_64' ],
+ 'releases': releases,
+ 'mirrorurls': mirrorurls,
+ }
+ return render(request, "releng/archlinux.ipxe", context, content_type='text/plain')
+
# vim: set ts=4 sw=4 et: