From eb08c9a2b690ca52c1ce5cc32eb5e62cc3344553 Mon Sep 17 00:00:00 2001 From: Hideki Yamane Date: Mon, 7 May 2018 04:39:12 +0900 Subject: Suggests to use deboostrap to create Jessie env (#17) * Suggest to use deboostrap to create Jessie env Not prepare Jessie host but create Jessie environment with debootstrap, since it runs on many, many distros and versions. --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b1f5a12..3e7c713a 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,16 @@ There are several directories with their own purpose: ## Prerequisites -To build a VyOS image, you need a machine that runs Debian Jessie. Other build hosts are not supported. +To build a VyOS image, you need Debian8 "Jessie" environment (with jessie-backports repository). You can create it with [debootstrap](https://wiki.debian.org/Debootstrap) on Debian, Ubuntu and many distributions. To create Debian8 "Jessie" environment under vyos-chroot directory, run below commands. + +``` +$ sudo apt install debootstrap (Note: This is on Debian/Ubuntu, adjust it with your favorite distro package manager) +$ sudo debootstrap jessie vyos-chroot +$ sudo chroot vyos-chroot + +# echo "deb http://deb.debian.org/debian jessie-backports main" >> /etc/apt/sources.list +# apt update +``` Several packages are required for building the ISO and all packages, namely python3, live-build, pbuilder, python3-pystache and devscripts. Individual packages may have other build dependencies. If some packages are missing, build scripts will tell you. -- cgit v1.2.3 From 135fb07d959741dbe9a3a4e5e1919de0e7c5bc44 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 15 May 2018 10:34:14 +0900 Subject: Add tools/get_latest_iso.py --- tools/get_latest_iso.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 tools/get_latest_iso.py diff --git a/tools/get_latest_iso.py b/tools/get_latest_iso.py new file mode 100755 index 00000000..4a2ea9a8 --- /dev/null +++ b/tools/get_latest_iso.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +import os +import sys +from lxml import html +from urllib.parse import unquote +import requests + +BASE_URL = 'https://downloads.vyos.io/' +PAGE_URL = BASE_URL+'?dir=rolling/current/amd64' + + +def download(): + page = requests.get(PAGE_URL) + tree = html.fromstring(page.content) + path = '//*[@id="directory-listing"]/li/a[1]/@href' + isos = [x for x in tree.xpath(path) if os.path.splitext(x)[1] == '.iso'] + latest_iso_url = os.path.join(BASE_URL, isos[-1]) + filename = unquote(os.path.basename(latest_iso_url)) + print(filename) + if os.path.exists(filename): + print("{} already exists".format(filename)) + sys.exit(0) + r = requests.get(latest_iso_url) + with open(filename, 'wb') as fd: + for chunk in r.iter_content(chunk_size=128): + fd.write(chunk) + + +if __name__ == '__main__': + download() -- cgit v1.2.3