From 21acfddce20df24a7afc5432a1638b11a9c40729 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 20 Dec 2015 05:15:23 -0500 Subject: Some history and branch information in the README. --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 406e9ac0..ea88d028 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,9 @@ If you want to use it in your network, check out download and installation instr If you want to modify VyOS and/or join its development, read on. +VyOS is not new. It is a fork of Vyatta Core that was created when the open source version of it was +discontinued. If you are a Vyatta Core user, you can upgrade your installation to VyOS. + # What is this repository? VyOS is a GNU/Linux distribution based on Debian. Just like any other distribution, it consists of multiple @@ -53,3 +56,19 @@ To build an image, use the following commands: make iso The ./configure script has a number of options that you can see by calling it with --help + +# Development process + +## git branches + +The default branch that contains the most recent VyOS code is called 'current' rather than 'master'. +We know if'ts confusing, but it's not easy to fix. +In a nutshell, the code we inherited from Vyatta Core had its master branch so out of sync with everything +it was beyong any repair. Vyatta developers used to create a new branch not when a release is ready for +code freeze, but rather before starting to work on a new release. +This is hard to change in existing code, so this is just the way it is, for now. + +All new code goes to the 'current' branch. When it's time for a code freeze, a new branch is created +for the release, and new code from 'current' is backported to the release branch as needed. + +For branch naming we use chemical elements (hydrogen, helium, ...). -- cgit v1.2.3 From 8114cd0efe700dcca555b33012a180ed48f8730f Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 21 Dec 2015 15:14:57 -0500 Subject: Add packages written specifically for VyOS as submodules. Excluded: Quagga (ideally, we should merge the vyatta changes into upstream). Kernel and openvmtools (better built separately). Firmware (better switch to upstream perhaps). Everything that we used to build just because squeeze had it very outdated. --- .gitmodules | 120 ++++++++++++++++++++++++++++++++++++++++ packages/vyatta-bash | 1 + packages/vyatta-cfg | 1 + packages/vyatta-cfg-dhcp-relay | 1 + packages/vyatta-cfg-dhcp-server | 1 + packages/vyatta-cfg-firewall | 1 + packages/vyatta-cfg-op-pppoe | 1 + packages/vyatta-cfg-qos | 1 + packages/vyatta-cfg-quagga | 1 + packages/vyatta-cfg-system | 1 + packages/vyatta-cfg-vpn | 1 + packages/vyatta-cluster | 1 + packages/vyatta-config-mgmt | 1 + packages/vyatta-config-migrate | 1 + packages/vyatta-conntrack | 1 + packages/vyatta-conntrack-sync | 1 + packages/vyatta-cron | 1 + packages/vyatta-eventwatch | 1 + packages/vyatta-ipv6-rtradv | 1 + packages/vyatta-lldp | 1 + packages/vyatta-nat | 1 + packages/vyatta-netflow | 1 + packages/vyatta-op | 1 + packages/vyatta-op-dhcp-server | 1 + packages/vyatta-op-firewall | 1 + packages/vyatta-op-qos | 1 + packages/vyatta-op-quagga | 1 + packages/vyatta-op-vpn | 1 + packages/vyatta-openvpn | 1 + packages/vyatta-ravpn | 1 + packages/vyatta-util | 1 + packages/vyatta-vrrp | 1 + packages/vyatta-wanloadbalance | 1 + packages/vyatta-webgui | 1 + packages/vyatta-webproxy | 1 + packages/vyatta-wireless | 1 + packages/vyatta-wirelessmodem | 1 + packages/vyatta-zone | 1 + packages/vyos-igmpproxy | 1 + packages/vyos-nhrp | 1 + packages/vyos-pppoe-server | 1 + 41 files changed, 160 insertions(+) create mode 100644 .gitmodules create mode 160000 packages/vyatta-bash create mode 160000 packages/vyatta-cfg create mode 160000 packages/vyatta-cfg-dhcp-relay create mode 160000 packages/vyatta-cfg-dhcp-server create mode 160000 packages/vyatta-cfg-firewall create mode 160000 packages/vyatta-cfg-op-pppoe create mode 160000 packages/vyatta-cfg-qos create mode 160000 packages/vyatta-cfg-quagga create mode 160000 packages/vyatta-cfg-system create mode 160000 packages/vyatta-cfg-vpn create mode 160000 packages/vyatta-cluster create mode 160000 packages/vyatta-config-mgmt create mode 160000 packages/vyatta-config-migrate create mode 160000 packages/vyatta-conntrack create mode 160000 packages/vyatta-conntrack-sync create mode 160000 packages/vyatta-cron create mode 160000 packages/vyatta-eventwatch create mode 160000 packages/vyatta-ipv6-rtradv create mode 160000 packages/vyatta-lldp create mode 160000 packages/vyatta-nat create mode 160000 packages/vyatta-netflow create mode 160000 packages/vyatta-op create mode 160000 packages/vyatta-op-dhcp-server create mode 160000 packages/vyatta-op-firewall create mode 160000 packages/vyatta-op-qos create mode 160000 packages/vyatta-op-quagga create mode 160000 packages/vyatta-op-vpn create mode 160000 packages/vyatta-openvpn create mode 160000 packages/vyatta-ravpn create mode 160000 packages/vyatta-util create mode 160000 packages/vyatta-vrrp create mode 160000 packages/vyatta-wanloadbalance create mode 160000 packages/vyatta-webgui create mode 160000 packages/vyatta-webproxy create mode 160000 packages/vyatta-wireless create mode 160000 packages/vyatta-wirelessmodem create mode 160000 packages/vyatta-zone create mode 160000 packages/vyos-igmpproxy create mode 160000 packages/vyos-nhrp create mode 160000 packages/vyos-pppoe-server diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..9919f31c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,120 @@ +[submodule "packages/vyatta-bash"] + path = packages/vyatta-bash + url = https://github.com/vyos/vyatta-bash.git +[submodule "packages/vyatta-cfg"] + path = packages/vyatta-cfg + url = https://github.com/vyos/vyatta-cfg.git +[submodule "packages/vyatta-op"] + path = packages/vyatta-op + url = https://github.com/vyos/vyatta-op.git +[submodule "packages/vyatta-cfg-system"] + path = packages/vyatta-cfg-system + url = https://github.com/vyos/vyatta-cfg-system.git +[submodule "packages/vyatta-cfg-firewall"] + path = packages/vyatta-cfg-firewall + url = https://github.com/vyos/vyatta-cfg-firewall.git +[submodule "packages/vyatta-op-firewall"] + path = packages/vyatta-op-firewall + url = https://github.com/vyos/vyatta-op-firewall.git +[submodule "packages/vyatta-cfg-vpn"] + path = packages/vyatta-cfg-vpn + url = https://github.com/vyos/vyatta-cfg-vpn.git +[submodule "packages/vyatta-op-vpn"] + path = packages/vyatta-op-vpn + url = https://github.com/vyos/vyatta-op-vpn.git +[submodule "packages/vyatta-cfg-qos"] + path = packages/vyatta-cfg-qos + url = https://github.com/vyos/vyatta-cfg-qos.git +[submodule "packages/vyatta-op-qos"] + path = packages/vyatta-op-qos + url = https://github.com/vyos/vyatta-op-qos.git +[submodule "packages/vyatta-cfg-op-pppoe"] + path = packages/vyatta-cfg-op-pppoe + url = https://github.com/vyos/vyatta-cfg-op-pppoe.git +[submodule "packages/vyatta-openvpn"] + path = packages/vyatta-openvpn + url = https://github.com/vyos/vyatta-openvpn.git +[submodule "packages/vyatta-conntrack"] + path = packages/vyatta-conntrack + url = https://github.com/vyos/vyatta-conntrack.git +[submodule "packages/vyatta-conntrack-sync"] + path = packages/vyatta-conntrack-sync + url = https://github.com/vyos/vyatta-conntrack-sync.git +[submodule "packages/vyatta-nat"] + path = packages/vyatta-nat + url = https://github.com/vyos/vyatta-nat.git +[submodule "packages/vyatta-config-mgmt"] + path = packages/vyatta-config-mgmt + url = https://github.com/vyos/vyatta-config-mgmt.git +[submodule "packages/vyatta-config-migrate"] + path = packages/vyatta-config-migrate + url = https://github.com/vyos/vyatta-config-migrate.git +[submodule "packages/vyatta-zone"] + path = packages/vyatta-zone + url = https://github.com/vyos/vyatta-zone.git +[submodule "packages/vyatta-cluster"] + path = packages/vyatta-cluster + url = https://github.com/vyos/vyatta-cluster.git +[submodule "packages/vyatta-vrrp"] + path = packages/vyatta-vrrp + url = https://github.com/vyos/vyatta-vrrp.git +[submodule "packages/vyatta-eventwatch"] + path = packages/vyatta-eventwatch + url = https://github.com/vyos/vyatta-eventwatch.git +[submodule "packages/vyatta-cron"] + path = packages/vyatta-cron + url = https://github.com/vyos/vyatta-cron.git +[submodule "packages/vyatta-webproxy"] + path = packages/vyatta-webproxy + url = https://github.com/vyos/vyatta-webproxy.git +[submodule "packages/vyatta-webgui"] + path = packages/vyatta-webgui + url = https://github.com/vyos/vyatta-webgui.git +[submodule "packages/vyatta-cfg-quagga"] + path = packages/vyatta-cfg-quagga + url = https://github.com/vyos/vyatta-cfg-quagga.git +[submodule "packages/vyatta-op-quagga"] + path = packages/vyatta-op-quagga + url = https://github.com/vyos/vyatta-op-quagga.git +[submodule "packages/vyatta-cfg-dhcp-server"] + path = packages/vyatta-cfg-dhcp-server + url = https://github.com/vyos/vyatta-cfg-dhcp-server.git +[submodule "packages/vyatta-cfg-dhcp-relay"] + path = packages/vyatta-cfg-dhcp-relay + url = https://github.com/vyos/vyatta-cfg-dhcp-relay.git +[submodule "packages/vyatta-op-dhcp-server"] + path = packages/vyatta-op-dhcp-server + url = https://github.com/vyos/vyatta-op-dhcp-server.git +[submodule "packages/vyatta-wireless"] + path = packages/vyatta-wireless + url = https://github.com/vyos/vyatta-wireless.git +[submodule "packages/vyatta-wirelessmodem"] + path = packages/vyatta-wirelessmodem + url = https://github.com/vyos/vyatta-wirelessmodem.git +[submodule "packages/vyatta-wanloadbalance"] + path = packages/vyatta-wanloadbalance + url = https://github.com/vyos/vyatta-wanloadbalance.git +[submodule "packages/vyatta-netflow"] + path = packages/vyatta-netflow + url = https://github.com/vyos/vyatta-netflow.git +[submodule "packages/vyatta-lldp"] + path = packages/vyatta-lldp + url = https://github.com/vyos/vyatta-lldp.git +[submodule "packages/vyatta-ipv6-rtradv"] + path = packages/vyatta-ipv6-rtradv + url = https://github.com/vyos/vyatta-ipv6-rtradv.git +[submodule "packages/vyatta-ravpn"] + path = packages/vyatta-ravpn + url = https://github.com/vyos/vyatta-ravpn.git +[submodule "packages/vyos-pppoe-server"] + path = packages/vyos-pppoe-server + url = https://github.com/vyos/vyos-pppoe-server.git +[submodule "packages/vyos-nhrp"] + path = packages/vyos-nhrp + url = https://github.com/vyos/vyos-nhrp.git +[submodule "packages/vyos-igmpproxy"] + path = packages/vyos-igmpproxy + url = https://github.com/vyos/vyos-igmpproxy.git +[submodule "packages/vyatta-util"] + path = packages/vyatta-util + url = https://github.com/vyos/vyatta-util.git diff --git a/packages/vyatta-bash b/packages/vyatta-bash new file mode 160000 index 00000000..001f9b1a --- /dev/null +++ b/packages/vyatta-bash @@ -0,0 +1 @@ +Subproject commit 001f9b1a9bd2b307bca94510ce05bc067e34f84d diff --git a/packages/vyatta-cfg b/packages/vyatta-cfg new file mode 160000 index 00000000..c56e20b9 --- /dev/null +++ b/packages/vyatta-cfg @@ -0,0 +1 @@ +Subproject commit c56e20b98438e33822244315249e3edf0e356593 diff --git a/packages/vyatta-cfg-dhcp-relay b/packages/vyatta-cfg-dhcp-relay new file mode 160000 index 00000000..85c7b8b9 --- /dev/null +++ b/packages/vyatta-cfg-dhcp-relay @@ -0,0 +1 @@ +Subproject commit 85c7b8b985685e859067ff75afebdb6fa64ed8e7 diff --git a/packages/vyatta-cfg-dhcp-server b/packages/vyatta-cfg-dhcp-server new file mode 160000 index 00000000..7440cf0c --- /dev/null +++ b/packages/vyatta-cfg-dhcp-server @@ -0,0 +1 @@ +Subproject commit 7440cf0c153d3f6484c96c32d4e02157fb938e2c diff --git a/packages/vyatta-cfg-firewall b/packages/vyatta-cfg-firewall new file mode 160000 index 00000000..5248dbcc --- /dev/null +++ b/packages/vyatta-cfg-firewall @@ -0,0 +1 @@ +Subproject commit 5248dbcc34eb6b041af928a0451ea866fc77488d diff --git a/packages/vyatta-cfg-op-pppoe b/packages/vyatta-cfg-op-pppoe new file mode 160000 index 00000000..2de6ecd6 --- /dev/null +++ b/packages/vyatta-cfg-op-pppoe @@ -0,0 +1 @@ +Subproject commit 2de6ecd6068e6a9debb032a074395398f2dc4df1 diff --git a/packages/vyatta-cfg-qos b/packages/vyatta-cfg-qos new file mode 160000 index 00000000..0a5049b3 --- /dev/null +++ b/packages/vyatta-cfg-qos @@ -0,0 +1 @@ +Subproject commit 0a5049b38b0830b289d0052a1fa2ce64785bc6ba diff --git a/packages/vyatta-cfg-quagga b/packages/vyatta-cfg-quagga new file mode 160000 index 00000000..82dd077c --- /dev/null +++ b/packages/vyatta-cfg-quagga @@ -0,0 +1 @@ +Subproject commit 82dd077c98131a8a4b3383139e782f534bc310a1 diff --git a/packages/vyatta-cfg-system b/packages/vyatta-cfg-system new file mode 160000 index 00000000..2f9b0eca --- /dev/null +++ b/packages/vyatta-cfg-system @@ -0,0 +1 @@ +Subproject commit 2f9b0ecaf33c8598dc1a74ac0fb4f34abaad97cd diff --git a/packages/vyatta-cfg-vpn b/packages/vyatta-cfg-vpn new file mode 160000 index 00000000..5c167234 --- /dev/null +++ b/packages/vyatta-cfg-vpn @@ -0,0 +1 @@ +Subproject commit 5c1672341b33dc726da5d7845725bd74e3cc7cb6 diff --git a/packages/vyatta-cluster b/packages/vyatta-cluster new file mode 160000 index 00000000..1881e2ef --- /dev/null +++ b/packages/vyatta-cluster @@ -0,0 +1 @@ +Subproject commit 1881e2ef2fb041e7836db90b12450d63c1628473 diff --git a/packages/vyatta-config-mgmt b/packages/vyatta-config-mgmt new file mode 160000 index 00000000..a47cd02b --- /dev/null +++ b/packages/vyatta-config-mgmt @@ -0,0 +1 @@ +Subproject commit a47cd02bca9cb25125e14fe1b731029fb985d89c diff --git a/packages/vyatta-config-migrate b/packages/vyatta-config-migrate new file mode 160000 index 00000000..28f7ce91 --- /dev/null +++ b/packages/vyatta-config-migrate @@ -0,0 +1 @@ +Subproject commit 28f7ce91358975ba9b36ac2874f6b47482815aab diff --git a/packages/vyatta-conntrack b/packages/vyatta-conntrack new file mode 160000 index 00000000..36213527 --- /dev/null +++ b/packages/vyatta-conntrack @@ -0,0 +1 @@ +Subproject commit 362135271f8bd647d8fa772f775d26c1edcac7c6 diff --git a/packages/vyatta-conntrack-sync b/packages/vyatta-conntrack-sync new file mode 160000 index 00000000..4f6ae976 --- /dev/null +++ b/packages/vyatta-conntrack-sync @@ -0,0 +1 @@ +Subproject commit 4f6ae97660e512d90f1d4ac9822cdc1172f0fdf3 diff --git a/packages/vyatta-cron b/packages/vyatta-cron new file mode 160000 index 00000000..eac0fafc --- /dev/null +++ b/packages/vyatta-cron @@ -0,0 +1 @@ +Subproject commit eac0fafcd19184c1679c31584b80f43095cf5690 diff --git a/packages/vyatta-eventwatch b/packages/vyatta-eventwatch new file mode 160000 index 00000000..ab07c835 --- /dev/null +++ b/packages/vyatta-eventwatch @@ -0,0 +1 @@ +Subproject commit ab07c835d1b09ab5424190dd240dfa65e77b81f2 diff --git a/packages/vyatta-ipv6-rtradv b/packages/vyatta-ipv6-rtradv new file mode 160000 index 00000000..809508f4 --- /dev/null +++ b/packages/vyatta-ipv6-rtradv @@ -0,0 +1 @@ +Subproject commit 809508f4b3248e8dc4bfbcb527084d3bac4c78f8 diff --git a/packages/vyatta-lldp b/packages/vyatta-lldp new file mode 160000 index 00000000..b7c70732 --- /dev/null +++ b/packages/vyatta-lldp @@ -0,0 +1 @@ +Subproject commit b7c70732793bfd88c23ffb424bf44fd65b0bf8bc diff --git a/packages/vyatta-nat b/packages/vyatta-nat new file mode 160000 index 00000000..52fb9ab3 --- /dev/null +++ b/packages/vyatta-nat @@ -0,0 +1 @@ +Subproject commit 52fb9ab3f8a1d1aeda0149946b1e1b77617bc6cd diff --git a/packages/vyatta-netflow b/packages/vyatta-netflow new file mode 160000 index 00000000..22b60a0e --- /dev/null +++ b/packages/vyatta-netflow @@ -0,0 +1 @@ +Subproject commit 22b60a0e4dc9ff7d4001b55bf1f17e55e5267389 diff --git a/packages/vyatta-op b/packages/vyatta-op new file mode 160000 index 00000000..6152bc3a --- /dev/null +++ b/packages/vyatta-op @@ -0,0 +1 @@ +Subproject commit 6152bc3abd0cb1dc6c7717a653558a1c3393fe31 diff --git a/packages/vyatta-op-dhcp-server b/packages/vyatta-op-dhcp-server new file mode 160000 index 00000000..2c8c4ae2 --- /dev/null +++ b/packages/vyatta-op-dhcp-server @@ -0,0 +1 @@ +Subproject commit 2c8c4ae26ea671cd48c80335b127bbac7ad0783a diff --git a/packages/vyatta-op-firewall b/packages/vyatta-op-firewall new file mode 160000 index 00000000..7ad3f22b --- /dev/null +++ b/packages/vyatta-op-firewall @@ -0,0 +1 @@ +Subproject commit 7ad3f22bedd1ce169b076fd3fabb32761082b66e diff --git a/packages/vyatta-op-qos b/packages/vyatta-op-qos new file mode 160000 index 00000000..ec1c87ec --- /dev/null +++ b/packages/vyatta-op-qos @@ -0,0 +1 @@ +Subproject commit ec1c87ec516d0814d1f4b6115dd93b4287f3055d diff --git a/packages/vyatta-op-quagga b/packages/vyatta-op-quagga new file mode 160000 index 00000000..24189c45 --- /dev/null +++ b/packages/vyatta-op-quagga @@ -0,0 +1 @@ +Subproject commit 24189c4533bc9147ac3c780ce80bf49194beb67c diff --git a/packages/vyatta-op-vpn b/packages/vyatta-op-vpn new file mode 160000 index 00000000..0ec07e89 --- /dev/null +++ b/packages/vyatta-op-vpn @@ -0,0 +1 @@ +Subproject commit 0ec07e891b0191b24185ea09c6f33f6502597df6 diff --git a/packages/vyatta-openvpn b/packages/vyatta-openvpn new file mode 160000 index 00000000..5f754cd2 --- /dev/null +++ b/packages/vyatta-openvpn @@ -0,0 +1 @@ +Subproject commit 5f754cd2c2660f3fd58210c92d5847225fc2b6b5 diff --git a/packages/vyatta-ravpn b/packages/vyatta-ravpn new file mode 160000 index 00000000..6fb662b7 --- /dev/null +++ b/packages/vyatta-ravpn @@ -0,0 +1 @@ +Subproject commit 6fb662b78e2b688d2a00d0221821904ef841b391 diff --git a/packages/vyatta-util b/packages/vyatta-util new file mode 160000 index 00000000..22ee60e3 --- /dev/null +++ b/packages/vyatta-util @@ -0,0 +1 @@ +Subproject commit 22ee60e33a9e5fc4dc372ae8798b4f05d1b520c3 diff --git a/packages/vyatta-vrrp b/packages/vyatta-vrrp new file mode 160000 index 00000000..c6411d8c --- /dev/null +++ b/packages/vyatta-vrrp @@ -0,0 +1 @@ +Subproject commit c6411d8c4c1a11f0305ddee2824d7081cd2654a3 diff --git a/packages/vyatta-wanloadbalance b/packages/vyatta-wanloadbalance new file mode 160000 index 00000000..c4ad578e --- /dev/null +++ b/packages/vyatta-wanloadbalance @@ -0,0 +1 @@ +Subproject commit c4ad578e0d82b688d5ed60b649604982eae8350a diff --git a/packages/vyatta-webgui b/packages/vyatta-webgui new file mode 160000 index 00000000..30133ba0 --- /dev/null +++ b/packages/vyatta-webgui @@ -0,0 +1 @@ +Subproject commit 30133ba0fd68b0c3726127f195e1058c427fe58f diff --git a/packages/vyatta-webproxy b/packages/vyatta-webproxy new file mode 160000 index 00000000..4a86d4a3 --- /dev/null +++ b/packages/vyatta-webproxy @@ -0,0 +1 @@ +Subproject commit 4a86d4a3f886b8b42311dabd0ddceabdf8cdd519 diff --git a/packages/vyatta-wireless b/packages/vyatta-wireless new file mode 160000 index 00000000..5b92a6e5 --- /dev/null +++ b/packages/vyatta-wireless @@ -0,0 +1 @@ +Subproject commit 5b92a6e5a446b3b74ad78832ea82f977d6bba325 diff --git a/packages/vyatta-wirelessmodem b/packages/vyatta-wirelessmodem new file mode 160000 index 00000000..8022e5ca --- /dev/null +++ b/packages/vyatta-wirelessmodem @@ -0,0 +1 @@ +Subproject commit 8022e5ca50591afa2db948fd9454ce4f4cfb406f diff --git a/packages/vyatta-zone b/packages/vyatta-zone new file mode 160000 index 00000000..f8f40ba6 --- /dev/null +++ b/packages/vyatta-zone @@ -0,0 +1 @@ +Subproject commit f8f40ba6bf5a95a5b147f9cd0e7e425cdb9c015a diff --git a/packages/vyos-igmpproxy b/packages/vyos-igmpproxy new file mode 160000 index 00000000..97db9721 --- /dev/null +++ b/packages/vyos-igmpproxy @@ -0,0 +1 @@ +Subproject commit 97db97216f05756b6428449412e35f8b06dc73f3 diff --git a/packages/vyos-nhrp b/packages/vyos-nhrp new file mode 160000 index 00000000..aae14502 --- /dev/null +++ b/packages/vyos-nhrp @@ -0,0 +1 @@ +Subproject commit aae14502e55b41e822d890ba08e3460609454cd0 diff --git a/packages/vyos-pppoe-server b/packages/vyos-pppoe-server new file mode 160000 index 00000000..56670914 --- /dev/null +++ b/packages/vyos-pppoe-server @@ -0,0 +1 @@ +Subproject commit 566709144fb119d32cc029615cff2e688a8a7557 -- cgit v1.2.3 From 6e66715c45a77be01855f269e03a9e6be1e50bf4 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 24 Dec 2015 12:04:24 -0500 Subject: Add sudo to required packages, since we use it in scripts. Using sudo from scripts may be objectionable, but I don't see any alternatives for things that do chroot. --- scripts/check-build-env | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/check-build-env b/scripts/check-build-env index 11e1c66b..168c7199 100755 --- a/scripts/check-build-env +++ b/scripts/check-build-env @@ -4,6 +4,7 @@ import os import sys required_packages = [ + 'sudo', 'make', 'live-build', 'pbuilder', -- cgit v1.2.3 From daf94a4bab985b33f17d6b8474c49213bead4f84 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 24 Dec 2015 12:06:08 -0500 Subject: Make the configure script create the build/ dir if it doesn't exist. --- scripts/build-config | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/build-config b/scripts/build-config index 7d1aa66b..542c4665 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -7,6 +7,7 @@ import os import getpass import platform import json +import distutils.dir_util import defaults @@ -42,5 +43,8 @@ for k, v in args.items(): sys.exit(1) # Save to file + +distutils.dir_util.mkpath(defaults.BUILD_DIR) + with open(defaults.BUILD_CONFIG, 'w') as f: json.dump(args, f) -- cgit v1.2.3 From c0cae8b7fec0d5e8a7c8ff9418397587e967fd15 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 24 Dec 2015 16:06:34 -0500 Subject: Add configure script support for Debian mirror options. --- scripts/build-config | 12 ++++++++++-- scripts/defaults.py | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/build-config b/scripts/build-config index 542c4665..f04dcb3f 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -23,7 +23,9 @@ def get_default_build_by(): options = { 'architecture': ('Image target architecture (amd64 or i586)', lambda: 'amd64', lambda x: x in ['amd64', 'i586']), - 'build-by': ('Builder identifier (e.g. jrandomhacker@example.net)', get_default_build_by, None) + 'build-by': ('Builder identifier (e.g. jrandomhacker@example.net)', get_default_build_by, None), + 'debian-mirror': ('Debian repository mirror for ISO build', lambda: defaults.DEBIAN_MIRROR, None), + 'pbuilder-debian-mirror': ('Debian repository mirror for pbuilder env bootstrap', lambda: defaults.DEBIAN_MIRROR, None) } # Create the option parser @@ -42,8 +44,14 @@ for k, v in args.items(): print("{v} is not a valid value for --{o} option".format(o=key, v=v)) sys.exit(1) -# Save to file +# Some fixup for mirror settings. +# The idea is: if --debian-mirror is specified but --pbuilder-debian-mirror is not, +# use the --debian-mirror value for both lb and pbuilder bootstrap +if (args['debian_mirror'] != defaults.DEBIAN_MIRROR) and \ + (args['pbuilder_debian_mirror'] == defaults.DEBIAN_MIRROR): + args['pbuilder_debian_mirror'] = args['debian-mirror'] +# Save to file distutils.dir_util.mkpath(defaults.BUILD_DIR) with open(defaults.BUILD_CONFIG, 'w') as f: diff --git a/scripts/defaults.py b/scripts/defaults.py index 96dfcc98..05f05973 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -2,3 +2,6 @@ import os BUILD_DIR = 'build' BUILD_CONFIG = os.path.join(BUILD_DIR, 'build-config.json') + +# The default mirror was chosen entirely at random +DEBIAN_MIRROR = 'http://ftp.nl.debian.org/debian/' -- cgit v1.2.3 From 595d17abea232345cf4475206363de7c379c3211 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 25 Dec 2015 18:28:27 -0500 Subject: Initial support for pbuilder. Note: pbuilder --create does not work well with relative build path, base.tgz creation fails. This led to the build_dir path being absolute. Perhaps we should make it more granular and only use absolute paths for pbuilder options. --- Makefile | 6 ++++++ scripts/build-config | 7 +++++++ scripts/defaults.py | 5 +++++ scripts/pbuilder-config | 35 +++++++++++++++++++++++++++++++++++ scripts/pbuilder-setup | 34 ++++++++++++++++++++++++++++++++++ scripts/pbuilder/hooks/C10shell | 6 ++++++ 6 files changed, 93 insertions(+) create mode 100755 scripts/pbuilder-config create mode 100755 scripts/pbuilder-setup create mode 100755 scripts/pbuilder/hooks/C10shell diff --git a/Makefile b/Makefile index ec9ea473..244229d2 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,12 @@ iso: prepare lb build 2>&1 | tee build.log @echo "VyOS ISO build successful" +.PHONY: prepare-package-env +.ONESHELL: +prepare-package-env: + @scripts/pbuilder-config + @scripts/pbuilder-setup + .PHONY: clean .ONESHELL: clean: diff --git a/scripts/build-config b/scripts/build-config index f04dcb3f..e001ef3d 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -51,6 +51,13 @@ if (args['debian_mirror'] != defaults.DEBIAN_MIRROR) and \ (args['pbuilder_debian_mirror'] == defaults.DEBIAN_MIRROR): args['pbuilder_debian_mirror'] = args['debian-mirror'] +# Populate some defaults that are not configurable, +# but that are handy to have in the options hash +args['distribution'] = defaults.DEBIAN_DISTRIBUTION +args['build_dir'] = os.path.join(os.getcwd(), defaults.BUILD_DIR) +args['pbuilder_config'] = defaults.PBUILDER_CONFIG + + # Save to file distutils.dir_util.mkpath(defaults.BUILD_DIR) diff --git a/scripts/defaults.py b/scripts/defaults.py index 05f05973..2dbaeb0c 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -5,3 +5,8 @@ BUILD_CONFIG = os.path.join(BUILD_DIR, 'build-config.json') # The default mirror was chosen entirely at random DEBIAN_MIRROR = 'http://ftp.nl.debian.org/debian/' + +DEBIAN_DISTRIBUTION = 'jessie' + +PBUILDER_CONFIG = os.path.join(BUILD_DIR, 'pbuilderrc') +PBUILDER_DIR = os.path.join(BUILD_DIR, 'pbuilder') diff --git a/scripts/pbuilder-config b/scripts/pbuilder-config new file mode 100755 index 00000000..5cda7b13 --- /dev/null +++ b/scripts/pbuilder-config @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +import sys +import os +import json + +import pystache + +import defaults +import util + +util.check_build_config() + +pbuilder_config_tmpl = """ + +BASETGZ={{build_dir}}/base.tgz +BUILDPLACE={{build_dir}}/pbuilder/ +MIRRORSITE={{pbuilder_debian_mirror}} +BUILDRESULT={{build_dir}}/pbuilder/result/ + +DISTRIBUTION={{distribution}} + +ARCHITECTURE={{architecture}} + +""" + +with open(defaults.BUILD_CONFIG, 'r') as f: + build_config = json.load(f) + +pbuilder_config = pystache.render(pbuilder_config_tmpl, build_config) + +print("Configuring pbuilder") + +with open(defaults.PBUILDER_CONFIG, 'w+') as f: + f.write(pbuilder_config) diff --git a/scripts/pbuilder-setup b/scripts/pbuilder-setup new file mode 100755 index 00000000..264db0b2 --- /dev/null +++ b/scripts/pbuilder-setup @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +import sys +import os +import json +import distutils.dir_util + +import pystache + +import defaults +import util + +util.check_build_config() + +pbuilder_create_cmd_tmpl= """ + sudo pbuilder --create \ + --configfile {{pbuilder_config}} +""" + +with open(defaults.BUILD_CONFIG, 'r') as f: + build_config = json.load(f) + +pbuilder_create_command = pystache.render(pbuilder_create_cmd_tmpl, build_config) + +print("Creating a pbuilder environment") +#os.chdir(defaults.BUILD_DIR) + +distutils.dir_util.mkpath(defaults.PBUILDER_DIR) + +result = os.system(pbuilder_create_command) +if result > 0: + print("pbuilder environment bootstrap failed") + sys.exit(1) + diff --git a/scripts/pbuilder/hooks/C10shell b/scripts/pbuilder/hooks/C10shell new file mode 100755 index 00000000..f56f9f7f --- /dev/null +++ b/scripts/pbuilder/hooks/C10shell @@ -0,0 +1,6 @@ +#!/bin/sh +# invoke shell if build fails. + +apt-get install -y --force-yes vim nano less bash +cd /tmp/buildd/*/debian/.. +/bin/bash < /dev/tty > /dev/tty 2> /dev/tty -- cgit v1.2.3 From 90ca7062c19e7237d9e4f3fe9f442db2a99a7048 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 26 Dec 2015 20:14:08 -0500 Subject: Add license headers to scripts. Some people rightfully complained about their absense already. --- scripts/build-config | 24 ++++++++++++++++++++++++ scripts/check-build-env | 20 ++++++++++++++++++++ scripts/check-config | 21 +++++++++++++++++++++ scripts/defaults.py | 18 ++++++++++++++++++ scripts/live-build-config | 20 ++++++++++++++++++++ scripts/pbuilder-config | 19 +++++++++++++++++++ scripts/pbuilder-setup | 19 +++++++++++++++++++ scripts/util.py | 19 +++++++++++++++++++ tools/gpl-header-template | 17 +++++++++++++++++ 9 files changed, 177 insertions(+) create mode 100644 tools/gpl-header-template diff --git a/scripts/build-config b/scripts/build-config index e001ef3d..d0d2fdac 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -1,4 +1,26 @@ #!/usr/bin/env python +# Copyright (C) 2015 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: build-config +# Purpose: +# This script serves the same purpose as ./configure in traditional +# autoconf setups. +# It takes build configuration options from command line, checks them, +# builds a config dictionary, augments it with some default and/or +# computed values and saves it to build/build-config.json +# for other build scripts to read. import argparse import re @@ -21,6 +43,8 @@ def get_default_build_by(): return "{user}@{host}".format(user= getpass.getuser(), host=platform.node()) +# Options dict format: +# '$option_name_without_leading_dashes': { ('$help_string', $default_value_generator_thunk, $value_checker_thunk) } options = { 'architecture': ('Image target architecture (amd64 or i586)', lambda: 'amd64', lambda x: x in ['amd64', 'i586']), 'build-by': ('Builder identifier (e.g. jrandomhacker@example.net)', get_default_build_by, None), diff --git a/scripts/check-build-env b/scripts/check-build-env index 168c7199..6f08847f 100755 --- a/scripts/check-build-env +++ b/scripts/check-build-env @@ -1,4 +1,24 @@ #!/usr/bin/env python +# +# Copyright (C) 2015 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: check-build-env +# Purpose: +# Checks if packages required for package and ISO image build +# are installed. + import os import sys diff --git a/scripts/check-config b/scripts/check-config index 3949869b..58a1a3f1 100755 --- a/scripts/check-config +++ b/scripts/check-config @@ -1,4 +1,25 @@ #!/usr/bin/env python +# +# Copyright (C) 2015 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: check-config +# Purpose: +# Checks if the build config file (build/build-config.json) exists. +# This is to prevent accidental execution of plumbing make targets +# from going too far and failing with confusing errors. + import sys import os diff --git a/scripts/defaults.py b/scripts/defaults.py index 2dbaeb0c..beef4a7a 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -1,3 +1,21 @@ +# Copyright (C) 2015 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: defaults.py +# Purpose: Various default values for use in build scripts. + + import os BUILD_DIR = 'build' diff --git a/scripts/live-build-config b/scripts/live-build-config index 59f0bbb2..bd9a7767 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -1,4 +1,24 @@ #!/usr/bin/env python +# +# Copyright (C) 2015 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: live-build-config +# Purpose: +# Creates a live-build config command from template using the build config +# and executes it, to prepare the system for building the installation ISO. + import sys import os diff --git a/scripts/pbuilder-config b/scripts/pbuilder-config index 5cda7b13..06e14cbf 100755 --- a/scripts/pbuilder-config +++ b/scripts/pbuilder-config @@ -1,4 +1,23 @@ #!/usr/bin/env python +# +# Copyright (C) 2015 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: pbuilder-config +# Purpose: +# Generates a pbuilderrc file for use by package build scripts. + import sys import os diff --git a/scripts/pbuilder-setup b/scripts/pbuilder-setup index 264db0b2..fbd49a4f 100755 --- a/scripts/pbuilder-setup +++ b/scripts/pbuilder-setup @@ -1,4 +1,23 @@ #!/usr/bin/env python +# +# Copyright (C) 2015 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: pbuilder-setup +# Purpose: +# Bootstraps a Debian environment for use by pbuilder. + import sys import os diff --git a/scripts/util.py b/scripts/util.py index 740d4ccc..00377672 100644 --- a/scripts/util.py +++ b/scripts/util.py @@ -1,3 +1,22 @@ +# Copyright (C) 2015 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: util.py +# Purpose: +# Various common functions for use in build scripts. + + import sys import os diff --git a/tools/gpl-header-template b/tools/gpl-header-template new file mode 100644 index 00000000..f3f82192 --- /dev/null +++ b/tools/gpl-header-template @@ -0,0 +1,17 @@ +# Copyright (C) 2015 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: +# Purpose: + -- cgit v1.2.3 From 2f10d39a98eb4815e4b2d677e210febeed45b7ca Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 26 Dec 2015 20:19:09 -0500 Subject: Make the config existence check scripts try to actually load the JSON. --- scripts/check-config | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/check-config b/scripts/check-config index 58a1a3f1..55d5467a 100755 --- a/scripts/check-config +++ b/scripts/check-config @@ -22,14 +22,17 @@ import sys -import os +import json import defaults print("Checking build configuration") -if not os.path.exists(defaults.BUILD_CONFIG): - print("Build config does not exist") +try: + with open(defaults.BUILD_CONFIG, 'r') as f: + build_config = json.load(f) +except: + print("Build config does not exist or is not a valid JSON file") print("Please run the ./configure script and try again") sys.exit(1) -- cgit v1.2.3 From 24a8a430779539d0be840b7ad8a3958ec02612a0 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 24 Jan 2016 13:34:15 -0500 Subject: Keep all common live-build config data in data/live-build-config If more granular data modification is needed, it can be stored in other data/ subdirs. --- Makefile | 3 +- data/includes.chroot/etc/fuse.conf | 1 - .../opt/vyatta/etc/config.boot.default | 39 ---------------------- .../includes.chroot/etc/fuse.conf | 1 + .../opt/vyatta/etc/config.boot.default | 39 ++++++++++++++++++++++ .../package-lists/vyos-base.list.chroot | 3 ++ .../package-lists/vyos-utils.list.chroot | 10 ++++++ data/package-lists/common/vyos-base.list.chroot | 3 -- data/package-lists/common/vyos-utils.list.chroot | 10 ------ 9 files changed, 54 insertions(+), 55 deletions(-) delete mode 100644 data/includes.chroot/etc/fuse.conf delete mode 100644 data/includes.chroot/opt/vyatta/etc/config.boot.default create mode 100644 data/live-build-config/includes.chroot/etc/fuse.conf create mode 100644 data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default create mode 100644 data/live-build-config/package-lists/vyos-base.list.chroot create mode 100644 data/live-build-config/package-lists/vyos-utils.list.chroot delete mode 100644 data/package-lists/common/vyos-base.list.chroot delete mode 100644 data/package-lists/common/vyos-utils.list.chroot diff --git a/Makefile b/Makefile index 244229d2..0c6d7b5a 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,7 @@ prepare: @scripts/check-config @scripts/live-build-config - cp -r data/includes.chroot/* build/config/includes.chroot/ - cp -r data/package-lists/common/* build/config/package-lists/ + cp -r data/live-build-config/* build/config/ .PHONY: iso .ONESHELL: diff --git a/data/includes.chroot/etc/fuse.conf b/data/includes.chroot/etc/fuse.conf deleted file mode 100644 index a439ab82..00000000 --- a/data/includes.chroot/etc/fuse.conf +++ /dev/null @@ -1 +0,0 @@ -user_allow_other diff --git a/data/includes.chroot/opt/vyatta/etc/config.boot.default b/data/includes.chroot/opt/vyatta/etc/config.boot.default deleted file mode 100644 index f5ec2b5d..00000000 --- a/data/includes.chroot/opt/vyatta/etc/config.boot.default +++ /dev/null @@ -1,39 +0,0 @@ -system { - login { - user vyos { - authentication { - encrypted-password $6$QxPS.uk6mfo$9QBSo8u1FkH16gMyAVhus6fU3LOzvLR9Z9.82m3tiHFAxTtIkhaZSWssSgzt4v4dGAL8rhVQxTg0oAG9/q11h/ - plaintext-password "" - } - level admin - } - } - syslog { - global { - facility all { - level notice - } - facility protocols { - level debug - } - } - } - ntp { - server "0.pool.ntp.org" - server "1.pool.ntp.org" - server "2.pool.ntp.org" - } - console { - device ttyS0 { - speed 9600 - } - } - config-management { - commit-revisions 100 - } -} - -interfaces { - loopback lo { - } -} diff --git a/data/live-build-config/includes.chroot/etc/fuse.conf b/data/live-build-config/includes.chroot/etc/fuse.conf new file mode 100644 index 00000000..a439ab82 --- /dev/null +++ b/data/live-build-config/includes.chroot/etc/fuse.conf @@ -0,0 +1 @@ +user_allow_other diff --git a/data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default b/data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default new file mode 100644 index 00000000..f5ec2b5d --- /dev/null +++ b/data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default @@ -0,0 +1,39 @@ +system { + login { + user vyos { + authentication { + encrypted-password $6$QxPS.uk6mfo$9QBSo8u1FkH16gMyAVhus6fU3LOzvLR9Z9.82m3tiHFAxTtIkhaZSWssSgzt4v4dGAL8rhVQxTg0oAG9/q11h/ + plaintext-password "" + } + level admin + } + } + syslog { + global { + facility all { + level notice + } + facility protocols { + level debug + } + } + } + ntp { + server "0.pool.ntp.org" + server "1.pool.ntp.org" + server "2.pool.ntp.org" + } + console { + device ttyS0 { + speed 9600 + } + } + config-management { + commit-revisions 100 + } +} + +interfaces { + loopback lo { + } +} diff --git a/data/live-build-config/package-lists/vyos-base.list.chroot b/data/live-build-config/package-lists/vyos-base.list.chroot new file mode 100644 index 00000000..6e5c1122 --- /dev/null +++ b/data/live-build-config/package-lists/vyos-base.list.chroot @@ -0,0 +1,3 @@ +debconf +gpgv +gnupg diff --git a/data/live-build-config/package-lists/vyos-utils.list.chroot b/data/live-build-config/package-lists/vyos-utils.list.chroot new file mode 100644 index 00000000..3d1a3b2a --- /dev/null +++ b/data/live-build-config/package-lists/vyos-utils.list.chroot @@ -0,0 +1,10 @@ +nmap +dnsutils +sipcalc +mtr-tiny +whois +netcat +netcat6 +socat +telnet +tcpdump diff --git a/data/package-lists/common/vyos-base.list.chroot b/data/package-lists/common/vyos-base.list.chroot deleted file mode 100644 index 6e5c1122..00000000 --- a/data/package-lists/common/vyos-base.list.chroot +++ /dev/null @@ -1,3 +0,0 @@ -debconf -gpgv -gnupg diff --git a/data/package-lists/common/vyos-utils.list.chroot b/data/package-lists/common/vyos-utils.list.chroot deleted file mode 100644 index 3d1a3b2a..00000000 --- a/data/package-lists/common/vyos-utils.list.chroot +++ /dev/null @@ -1,10 +0,0 @@ -nmap -dnsutils -sipcalc -mtr-tiny -whois -netcat -netcat6 -socat -telnet -tcpdump -- cgit v1.2.3 From 4add13956fa340e39b6b53ce1d7cd68946bcc8fc Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 24 Jan 2016 13:59:51 -0500 Subject: Add VyOS package repo, hardcoded for now. This will be a configure option eventually. --- data/live-build-config/archives/vyos.key.chroot | 32 ++++++++++++++++++++++++ data/live-build-config/archives/vyos.list.chroot | 1 + 2 files changed, 33 insertions(+) create mode 100644 data/live-build-config/archives/vyos.key.chroot create mode 100644 data/live-build-config/archives/vyos.list.chroot diff --git a/data/live-build-config/archives/vyos.key.chroot b/data/live-build-config/archives/vyos.key.chroot new file mode 100644 index 00000000..a6522e36 --- /dev/null +++ b/data/live-build-config/archives/vyos.key.chroot @@ -0,0 +1,32 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.12 (GNU/Linux) + +mQENBFOQPGwBCADjm8Oq3kaJQh0rI33XVfd9mNq5ffay884SlDCbG1hkLVf8tnGV +cjH7/nFfJdW/6Gr4dj4LQuHHnin5QeWnlHfuOySlOEsJCNP5dm14oEjy7epSXOv2 +A3m2tPDDqwMgfrOyw1gN+Clit9QIujiRzbcakqearyNxcVNvinIVunNiWbAyIhvc +uI6yfMjno4q/O83c7e1zBqJj9t9guQjBuqaJrmZVf985/6ue9yWzSI4JtzxVmhKI +dfCxHWE7BiEt2hnZPSVGcb4q6cBrkpcra7Ny55eoyN51wQGokPv3a9/8b3r5speR +gene2MTvD/3eZOtTvMN000f/gJX4E6o8xx+fABEBAAG0R1Z5T1MgTWFpbnRhaW5l +cnMgKERldmVsb3BtZW50IGFuZCB0ZXN0aW5nIHJlcG9zKSA8bWFpbnRhaW5lcnNA +dnlvcy5uZXQ+iQE4BBMBAgAiBQJTkDxsAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIe +AQIXgAAKCRAywkm9DfBLXJbHB/4xlwn+6cZGEWWNZgXwUTMeHubZItl1o3Tbrzaa +E3EqYyHJMYb3gBLOomlw7JLw5qT/247tlPC8ricl+BpeE5vYA3a08mIpcymROFh6 +pKJLNvdZHjrVN9yH2xYifI5sIDyuPga8Bgq/BMRiB1ragS/on2aUs75+tsEI32NI +JO8+jIav0Nd6n/Wmw55ioTXS3fx6VDb64D80luOf1ve5LFDs8Oz2I+ZjSf7mPMY/ +b9qQHNb/300k/tIeK2F4G7LFu6o/1YMlrv0Ry7j9BsLzIkmTh0pX4mSVvF6IrxsZ +WJRKu3uQDH2qccjptZDq4jHo/ow+aWT8rakjOgL9nJgKD5u/uQENBFOQPGwBCAC0 +zHpsmcfUIDyflGL+vwHV/3L02/vItHXfIkugL+wFB9C9i6nWA1KqNJwqNflJLGQF +y+vHXs0oa3oMKj7S3p2zTbuU8s9Vz2Cg5c15sy7yGjh/LTwVOR5ZJrgbRJxTTp9K +j5bkrx/DbDjIQ5szyjZ5N1ZAUyUx5Z/xMB3mTnLxDASvaoq+/F6WNcYY7NzjI7M0 +SFtnZLj6MFUVTmSbyYdGQc/Cxu5Utl7WKJUqHW5z10vJruZsdKV2+vf98yqhAJ+v +wPhKUoVD+KtCH/CrHFrVq0hCKIMtyPLtaTeR/QnCNDEsV4p82HB9KQOYEADEL3/A +a7Dntf3Xi+5eO/3MlnshABEBAAGJAR8EGAECAAkFAlOQPGwCGwwACgkQMsJJvQ3w +S1z+wwf9GnVn9GhbB1FhKQdavljp9rUzz8FvH3tRpftdhhJ8B0PVAMl4QRcIXrgD +nyd1K9ggzyWa4Z/9PygvH0Njv4YWlZh900wei9uVD8am1ncgQ/Jqlb36WvXyr8W/ +VPzQDtKAOkUz6RhKQ4V6I0PBK9nGeqeFkeH1bF1uGXkKpa0hGWffyOT1VasaZVXT +UN4VAYNzBwkoU0mIYK73CPi7e4YJrtOp/i8MGDL3pxKaZEEZJdc4/dZassqBuwSG +MRr2kecj9f53KWI0jLQdLgTMJQxscotfzhsWoF/842sUCbezwV3/4FtBhlNeqUHA +c9HOeh3wbjjt4uONvxeleE+jM9v63Q== +=gflA +-----END PGP PUBLIC KEY BLOCK----- + diff --git a/data/live-build-config/archives/vyos.list.chroot b/data/live-build-config/archives/vyos.list.chroot new file mode 100644 index 00000000..2b117386 --- /dev/null +++ b/data/live-build-config/archives/vyos.list.chroot @@ -0,0 +1 @@ +deb http://dev.packages.vyos.net/vyos current main -- cgit v1.2.3 From ed565077cb9bfed6780ff186f20bc9a80915ecca Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Tue, 26 Jan 2016 04:52:32 -0500 Subject: add extra linux cmdline options --- scripts/live-build-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/live-build-config b/scripts/live-build-config index bd9a7767..afcfcdb7 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -34,7 +34,7 @@ util.check_build_config() lb_config_tmpl = """ lb config noauto \ --architectures {{architecture}} \ - --bootappend-live "boot=live components hostname=vyos username=live" \ + --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay" \ --bootloader syslinux \ --binary-images iso-hybrid \ --debian-installer false \ -- cgit v1.2.3 From 38a250d62763a85e41cfe57b120ab380ad42fa55 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 26 Jan 2016 10:17:14 -0500 Subject: Add a configure option for selecting build type (release vs dev). --- scripts/build-config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build-config b/scripts/build-config index d0d2fdac..b350f692 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -49,7 +49,8 @@ options = { 'architecture': ('Image target architecture (amd64 or i586)', lambda: 'amd64', lambda x: x in ['amd64', 'i586']), 'build-by': ('Builder identifier (e.g. jrandomhacker@example.net)', get_default_build_by, None), 'debian-mirror': ('Debian repository mirror for ISO build', lambda: defaults.DEBIAN_MIRROR, None), - 'pbuilder-debian-mirror': ('Debian repository mirror for pbuilder env bootstrap', lambda: defaults.DEBIAN_MIRROR, None) + 'pbuilder-debian-mirror': ('Debian repository mirror for pbuilder env bootstrap', lambda: defaults.DEBIAN_MIRROR, None), + 'build-type': ('Build type, release or development', lambda: 'development', lambda x: x in ['release', 'development']) } # Create the option parser -- cgit v1.2.3 From b0c41b26b9435a3a834bee7cc16a1ae1cb03a5fa Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 26 Jan 2016 15:41:47 -0500 Subject: Add support for --build-type and --version options to configure script. Image version will now be passed in configure option. As a collateral damage, add support for options without default values. --- scripts/build-config | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/build-config b/scripts/build-config index b350f692..685d79f2 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -50,13 +50,18 @@ options = { 'build-by': ('Builder identifier (e.g. jrandomhacker@example.net)', get_default_build_by, None), 'debian-mirror': ('Debian repository mirror for ISO build', lambda: defaults.DEBIAN_MIRROR, None), 'pbuilder-debian-mirror': ('Debian repository mirror for pbuilder env bootstrap', lambda: defaults.DEBIAN_MIRROR, None), - 'build-type': ('Build type, release or development', lambda: 'development', lambda x: x in ['release', 'development']) + 'build-type': ('Build type, release or development', lambda: 'development', lambda x: x in ['release', 'development']), + 'version': ('Version number (release builds only)', None, None) } # Create the option parser parser = argparse.ArgumentParser() for k, v in options.items(): - parser.add_argument('--' + k, type=str, help=v[0], default=v[1]()) + help_string, default_value_thunk = v[0], v[1] + if default_value_thunk is None: + parser.add_argument('--' + k, type=str, help=help_string) + else: + parser.add_argument('--' + k, type=str, help=help_string, default=default_value_thunk()) args = vars(parser.parse_args()) @@ -76,6 +81,14 @@ if (args['debian_mirror'] != defaults.DEBIAN_MIRROR) and \ (args['pbuilder_debian_mirror'] == defaults.DEBIAN_MIRROR): args['pbuilder_debian_mirror'] = args['debian-mirror'] +# Version can only be set for release builds, +# for dev builds it hardly makes any sense +if args['build_type'] == 'development': + if args['version'] is not None: + print("Version can only be set for release builds") + print("Use --build-type=release option if you want to set version number") + sys.exit(1) + # Populate some defaults that are not configurable, # but that are handy to have in the options hash args['distribution'] = defaults.DEBIAN_DISTRIBUTION -- cgit v1.2.3 From cddc611ae3a6da15aaa2bded568209bb3eca27de Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 26 Jan 2016 16:10:52 -0500 Subject: Add a build step for generating version files. --- Makefile | 2 ++ scripts/defaults.py | 3 +++ scripts/make-version-file | 66 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100755 scripts/make-version-file diff --git a/Makefile b/Makefile index 0c6d7b5a..56e61d9b 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,8 @@ prepare: @scripts/live-build-config cp -r data/live-build-config/* build/config/ + @scripts/make-version-file + .PHONY: iso .ONESHELL: iso: prepare diff --git a/scripts/defaults.py b/scripts/defaults.py index beef4a7a..b9a3f255 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -28,3 +28,6 @@ DEBIAN_DISTRIBUTION = 'jessie' PBUILDER_CONFIG = os.path.join(BUILD_DIR, 'pbuilderrc') PBUILDER_DIR = os.path.join(BUILD_DIR, 'pbuilder') + +LB_CONFIG_DIR = os.path.join(BUILD_DIR, 'config') +CHROOT_INCLUDES_DIR = os.path.join(LB_CONFIG_DIR, 'includes.chroot') diff --git a/scripts/make-version-file b/scripts/make-version-file new file mode 100755 index 00000000..fcc399f8 --- /dev/null +++ b/scripts/make-version-file @@ -0,0 +1,66 @@ +#!/usr/bin/python +# Copyright (C) 2016 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: make-version-file +# Purpose: +# Creates version file in live-build chroot includes dir +# that is included in the image and used by 'show version' command +# and install/upgrade scripts. + +from __future__ import print_function +import os +import datetime +import json +import uuid + +import defaults +import util + +util.check_build_config() +with open(defaults.BUILD_CONFIG, 'r') as f: + build_config = json.load(f) + + +now = datetime.datetime.today() + +build_timestamp = now.strftime("%Y%m%d%H%M") + +# FIXME: use aware rather than naive object +build_date = now.strftime("%a %d %b %Y %H:%M UTC") + +# Assign a (hopefully) unique identifier to the build (UUID) +build_id = str(uuid.uuid4()) + +if build_config['build_type'] == 'development': + version = "999.{0}".format(build_timestamp) +else: + version = build_config['version'] + +version_data = { + 'version': version, + 'built_by': build_config['build_by'], + 'built_on': build_date, + 'build_id': build_id +} + + +with open(os.path.join(defaults.CHROOT_INCLUDES_DIR, 'opt/vyatta/etc/version.json'), 'w') as f: + json.dump(version_data, f) + +# For backwards compatibility with 'add system image' script from older versions +# we need a file in old format so that script can find out the version of the image +# for upgrade +with open(os.path.join(defaults.CHROOT_INCLUDES_DIR, 'opt/vyatta/etc/version'), 'w') as f: + print("Version: {0}".format(version), file=f) -- cgit v1.2.3 From dd54dd008d50a301505b8afd1a24326e1a75733b Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 29 Jan 2016 17:23:57 -0500 Subject: Remove the "build successful" message for now. Apparently live-build doesn't return $?>0 correctly for certain failures, which may lead to misleading success message when the build in fact had failed. --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 56e61d9b..28c6b96f 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,6 @@ iso: prepare @echo "It's not like I'm building this specially for you or anything!" cd $(build_dir) lb build 2>&1 | tee build.log - @echo "VyOS ISO build successful" .PHONY: prepare-package-env .ONESHELL: -- cgit v1.2.3 From bd0f60a5987d4b9a4823af83e3898cf9d99dd8b4 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 1 Feb 2016 03:57:44 -0500 Subject: Add grub2 to base package list, is needed for installs. --- data/live-build-config/package-lists/vyos-base.list.chroot | 1 + 1 file changed, 1 insertion(+) diff --git a/data/live-build-config/package-lists/vyos-base.list.chroot b/data/live-build-config/package-lists/vyos-base.list.chroot index 6e5c1122..cb3865d9 100644 --- a/data/live-build-config/package-lists/vyos-base.list.chroot +++ b/data/live-build-config/package-lists/vyos-base.list.chroot @@ -1,3 +1,4 @@ debconf gpgv gnupg +grub2 -- cgit v1.2.3 From 5934bf867b97c1a1eb56c088ddcd706577bef156 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 1 Feb 2016 06:55:07 -0500 Subject: Add vyos-world as a submodule. --- .gitmodules | 3 +++ packages/vyos-world | 1 + 2 files changed, 4 insertions(+) create mode 160000 packages/vyos-world diff --git a/.gitmodules b/.gitmodules index 9919f31c..b6cff22b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -118,3 +118,6 @@ [submodule "packages/vyatta-util"] path = packages/vyatta-util url = https://github.com/vyos/vyatta-util.git +[submodule "packages/vyos-world"] + path = packages/vyos-world + url = https://github.com/vyos/vyos-world.git diff --git a/packages/vyos-world b/packages/vyos-world new file mode 160000 index 00000000..28fa0907 --- /dev/null +++ b/packages/vyos-world @@ -0,0 +1 @@ +Subproject commit 28fa09078dfce814da1e6203d6dc1e6665b4e861 -- cgit v1.2.3 From 111875d03b9c5d5b9277eb8f905bb186aced2b98 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 1 Feb 2016 07:20:24 -0500 Subject: Add vyos-world to the base packagelist. --- data/live-build-config/package-lists/vyos-base.list.chroot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/live-build-config/package-lists/vyos-base.list.chroot b/data/live-build-config/package-lists/vyos-base.list.chroot index cb3865d9..225af33a 100644 --- a/data/live-build-config/package-lists/vyos-base.list.chroot +++ b/data/live-build-config/package-lists/vyos-base.list.chroot @@ -1,4 +1,4 @@ debconf gpgv gnupg -grub2 +vyos-world -- cgit v1.2.3 From e14ef3ea141b564e8fe26013a0a9b2f291668715 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 2 Feb 2016 10:03:53 -0500 Subject: Add some more useful stuff to the utils package list. --- data/live-build-config/package-lists/vyos-utils.list.chroot | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/live-build-config/package-lists/vyos-utils.list.chroot b/data/live-build-config/package-lists/vyos-utils.list.chroot index 3d1a3b2a..98d6a753 100644 --- a/data/live-build-config/package-lists/vyos-utils.list.chroot +++ b/data/live-build-config/package-lists/vyos-utils.list.chroot @@ -1,5 +1,6 @@ nmap dnsutils +ipcalc sipcalc mtr-tiny whois @@ -8,3 +9,7 @@ netcat6 socat telnet tcpdump +nano +vim-tiny +screen +minicom -- cgit v1.2.3 From 8c29337415ae9f39b291fd8e4f85d35916fc4705 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Wed, 3 Feb 2016 02:15:43 -0500 Subject: Add kernel version to lb config. --- scripts/live-build-config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/live-build-config b/scripts/live-build-config index afcfcdb7..c42887a4 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -35,6 +35,8 @@ lb_config_tmpl = """ lb config noauto \ --architectures {{architecture}} \ --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay" \ + --linux-flavours {{architecture}}-vyos \ + --linux-packages linux-image-4.4.1 \ --bootloader syslinux \ --binary-images iso-hybrid \ --debian-installer false \ -- cgit v1.2.3 From dbf2854bb2ab4006792d1dfefc6021657f99b034 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Wed, 3 Feb 2016 03:22:23 -0500 Subject: Add hooks or live-build. --- data/live-build-config/hooks/00-mk_buildid.chroot | 22 +++ data/live-build-config/hooks/01-interfaces.chroot | 12 ++ data/live-build-config/hooks/02-issue.chroot | 10 ++ .../hooks/03-root_bash_completion.chroot | 10 ++ data/live-build-config/hooks/04-locale.chroot | 8 + data/live-build-config/hooks/05-event_tty.chroot | 34 ++++ data/live-build-config/hooks/07-apt.chroot | 8 + data/live-build-config/hooks/08-sysconf.chroot | 47 ++++++ data/live-build-config/hooks/09-live.chroot | 6 + data/live-build-config/hooks/10-unmountfs.chroot | 12 ++ data/live-build-config/hooks/11-busybox.chroot | 183 +++++++++++++++++++++ .../hooks/12-udev-initramfs.chroot | 9 + .../live-build-config/hooks/13-sources_list.chroot | 4 + data/live-build-config/hooks/14-fuse.chroot | 4 + .../hooks/15-gen_initramfs.chroot | 4 + 15 files changed, 373 insertions(+) create mode 100755 data/live-build-config/hooks/00-mk_buildid.chroot create mode 100755 data/live-build-config/hooks/01-interfaces.chroot create mode 100755 data/live-build-config/hooks/02-issue.chroot create mode 100755 data/live-build-config/hooks/03-root_bash_completion.chroot create mode 100755 data/live-build-config/hooks/04-locale.chroot create mode 100755 data/live-build-config/hooks/05-event_tty.chroot create mode 100755 data/live-build-config/hooks/07-apt.chroot create mode 100755 data/live-build-config/hooks/08-sysconf.chroot create mode 100755 data/live-build-config/hooks/09-live.chroot create mode 100755 data/live-build-config/hooks/10-unmountfs.chroot create mode 100755 data/live-build-config/hooks/11-busybox.chroot create mode 100755 data/live-build-config/hooks/12-udev-initramfs.chroot create mode 100755 data/live-build-config/hooks/13-sources_list.chroot create mode 100755 data/live-build-config/hooks/14-fuse.chroot create mode 100755 data/live-build-config/hooks/15-gen_initramfs.chroot diff --git a/data/live-build-config/hooks/00-mk_buildid.chroot b/data/live-build-config/hooks/00-mk_buildid.chroot new file mode 100755 index 00000000..087addad --- /dev/null +++ b/data/live-build-config/hooks/00-mk_buildid.chroot @@ -0,0 +1,22 @@ +#!/bin/sh +# create the buildid file + +etcdir=/opt/vyatta/etc + +[ -d $etcdir ] || mkdir -p -m 0755 $etcdir +rm -f $etcdir/build.txt $etcdir/iso-build.txt $etc/iso-submodules.txt + +## NOTE: on live image build, these files are in the chroot/root +## however, during install, these are in /cdrom +for f in iso-build.txt iso-submodules.txt ; do + if [ -f /cdrom/$f ] ; then + cp /cdrom/$f $etcdir + elif [ -f /$f ] ; then + cp /$f $etcdir + else + >$etcdir/$f + fi +done + +# backwards compatible symlink +ln -s iso-build.txt $etcdir/build.txt diff --git a/data/live-build-config/hooks/01-interfaces.chroot b/data/live-build-config/hooks/01-interfaces.chroot new file mode 100755 index 00000000..8d218ea4 --- /dev/null +++ b/data/live-build-config/hooks/01-interfaces.chroot @@ -0,0 +1,12 @@ +#!/bin/sh + +if ! grep '^auto lo' /etc/network/interfaces &> /dev/null ; then + mkdir -p -m 0755 /etc/network + cat >> /etc/network/interfaces <<-EOF + + # The loopback network interface + auto lo + iface lo inet loopback + + EOF +fi diff --git a/data/live-build-config/hooks/02-issue.chroot b/data/live-build-config/hooks/02-issue.chroot new file mode 100755 index 00000000..732ebeb0 --- /dev/null +++ b/data/live-build-config/hooks/02-issue.chroot @@ -0,0 +1,10 @@ +#!/bin/sh + +echo I: Rewriting /etc/issue and /etc/issue.net +cat < etc/issue +Welcome to VyOS - \n \l + +EOF +cat < etc/issue.net +Welcome to VyOS +EOF diff --git a/data/live-build-config/hooks/03-root_bash_completion.chroot b/data/live-build-config/hooks/03-root_bash_completion.chroot new file mode 100755 index 00000000..b7ea8f52 --- /dev/null +++ b/data/live-build-config/hooks/03-root_bash_completion.chroot @@ -0,0 +1,10 @@ +#!/bin/sh + +grep -q '\(^[^#]*\)\(\.\|source\) /etc/bash_completion' root/.bashrc || \ + cat <<-EOF >> root/.bashrc + + source /etc/bash_completion + EOF + +sed -i 's/set $BASH_COMPLETION_ORIGINAL_V_VALUE/builtin set $BASH_COMPLETION_ORIGINAL_V_VALUE/g' /usr/share/bash-completion/bash_completion + diff --git a/data/live-build-config/hooks/04-locale.chroot b/data/live-build-config/hooks/04-locale.chroot new file mode 100755 index 00000000..1c02db02 --- /dev/null +++ b/data/live-build-config/hooks/04-locale.chroot @@ -0,0 +1,8 @@ +#!/bin/sh + +echo I: Set default locale +cat <etc/default/locale +LANG=en_US.UTF-8 +LC_ALL=C +EOF + diff --git a/data/live-build-config/hooks/05-event_tty.chroot b/data/live-build-config/hooks/05-event_tty.chroot new file mode 100755 index 00000000..a00167f7 --- /dev/null +++ b/data/live-build-config/hooks/05-event_tty.chroot @@ -0,0 +1,34 @@ +#!/bin/sh + +if [ -r etc/event.d/tty1 ] ; then + echo I: Delay getty until rcX completes + sed -i 's/start on runlevel /start on stopped rc/' \ + etc/event.d/tty[1-6] + if [ ! -r etc/event.d/ttyS0 ] && [ -c dev/ttyS0 ] ; then + echo I: Enable serial console login + cat <<-EOF > etc/event.d/ttyS0 + # ttyS0 - getty + # + # This service maintains a getty on ttyS0 from the point the system is + # started until it is shut down again. + + start on stopped rc2 + start on stopped rc3 + start on stopped rc4 + start on stopped rc5 + + stop on runlevel 0 + stop on runlevel 1 + stop on runlevel 6 + + respawn + exec /sbin/getty 9600 ttyS0 vt100 + + EOF + fi +fi + +if [ -r etc/inittab ] && [ -c dev/ttyS0 ] && grep -q '^#T0:.*getty.*ttyS0' etc/inittab ; then + echo I: Enable serial console login + sed -i '/^#T0:/s|^#.*$|T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100|' etc/inittab +fi diff --git a/data/live-build-config/hooks/07-apt.chroot b/data/live-build-config/hooks/07-apt.chroot new file mode 100755 index 00000000..8db33a78 --- /dev/null +++ b/data/live-build-config/hooks/07-apt.chroot @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ -e /cdrom/vyatta-pubkey.gpg ] ; then + apt-key add /cdrom/vyatta-pubkey.gpg +elif [ -e /vyatta-pubkey.gpg ] ; then + apt-key add /vyatta-pubkey.gpg + rm -f /vyatta-pubkey.gpg +fi diff --git a/data/live-build-config/hooks/08-sysconf.chroot b/data/live-build-config/hooks/08-sysconf.chroot new file mode 100755 index 00000000..b0399027 --- /dev/null +++ b/data/live-build-config/hooks/08-sysconf.chroot @@ -0,0 +1,47 @@ +#!/bin/sh + +for conf in motd.tail syslog.conf; do + cp -f /opt/vyatta/etc/$conf /etc/$conf +done + +cp -f /opt/vyatta/etc/default_ssh /etc/default/ssh +>/etc/pam_radius_auth.conf + +update_sysctl_conf () +{ + var=$1 + val=$2 + comment=$3 + sysctl_conf=/etc/sysctl.conf + + if grep -q "^${var}[[:space:]]*=" $sysctl_conf ; then + sed -i "/^${var}[[:space:]]*=/ s,=.*,= ${val}," $sysctl_conf + elif grep -q "^#[[:space:]]*${var}[[:space:]]*=" $sysctl_conf ; then + sed -i "/^#[[:space:]]*${var}[[:space:]]*=/ { s,^#[[:space:]]*,, ; s,[[:space:]]*=.*, = ${val},} " $sysctl_conf + else + cat <<-EOF >> $sysctl_conf + + # $comment + $var = $val + EOF + fi +} + +update_sysctl_conf kernel.printk "4 4 1 7" \ + "the following stops low-level messages on console" +update_sysctl_conf net.ipv4.conf.default.arp_filter 1 \ + "reset promiscous arp response" +update_sysctl_conf net.ipv4.conf.all.promote_secondaries 1 \ + "promote secondaries with removal of primary address" +update_sysctl_conf net.ipv4.ip_forward 1 \ + "enable ipv4 forwarding" +# FIXME! need to load or staticly link ipv6 module before adding this. +# update_sysctl_conf net.ipv6.conf.all.forwarding 1 \ +# "enable ipv6 forwarding" +update_sysctl_conf net.core.rmem_max 223232 \ + "maximize netlink buffers" + +# Local Variables: +# mode: shell-script +# sh-indentation: 4 +# End: diff --git a/data/live-build-config/hooks/09-live.chroot b/data/live-build-config/hooks/09-live.chroot new file mode 100755 index 00000000..e2f95ff3 --- /dev/null +++ b/data/live-build-config/hooks/09-live.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +# hack live script that tries to mount ext[23] floppies as root + +sed -e '/ln -s "${devname}"/,/return 0/ s/^/: FIXME/' \ + -i /usr/share/initramfs-tools/scripts/live diff --git a/data/live-build-config/hooks/10-unmountfs.chroot b/data/live-build-config/hooks/10-unmountfs.chroot new file mode 100755 index 00000000..7992a4d2 --- /dev/null +++ b/data/live-build-config/hooks/10-unmountfs.chroot @@ -0,0 +1,12 @@ +#!/bin/sh + +# hack umountfs script to cleanly unmount live systems + +sed \ + -e '/proc|procfs|linprocfs/ s/)/|squashfs|iso9660)/' \ + -e '/tmpfs)/ a\ + [ "$MTPT" != "/media" ] && \ + [ "$MTPT" != "/live" ] && \ + [ "$MTPT" != "/live/cow" ] && +' \ + -i /etc/init.d/umountfs diff --git a/data/live-build-config/hooks/11-busybox.chroot b/data/live-build-config/hooks/11-busybox.chroot new file mode 100755 index 00000000..fecce616 --- /dev/null +++ b/data/live-build-config/hooks/11-busybox.chroot @@ -0,0 +1,183 @@ +#!/bin/sh + +# create busybox alternatives + +bb=`which busybox` +applets=$(busybox | sed '1,/^Currently defined functions:/d; s/[\[,]//g; s/ / /g; s/$/ /g') + +bb_alternative () +{ + full=$1 + full_bb=${full}.bb + app=${full##*/} + if [ ! -x $full ] && (echo -n "$applets" | grep -q " $app "); then + ln -s $bb $full_bb + update-alternatives --install $full $app $full_bb 10 + fi +} + +bb_alternative /bin/bunzip2 +bb_alternative /bin/bzcat +bb_alternative /bin/cat +bb_alternative /bin/chgrp +bb_alternative /bin/chmod +bb_alternative /bin/chown +bb_alternative /bin/cp +bb_alternative /bin/cpio +bb_alternative /bin/date +bb_alternative /bin/dd +bb_alternative /bin/df +bb_alternative /bin/dmesg +bb_alternative /bin/echo +bb_alternative /bin/egrep +bb_alternative /bin/false +bb_alternative /bin/fgrep +bb_alternative /bin/grep +bb_alternative /bin/gunzip +bb_alternative /bin/gzip +bb_alternative /bin/hostname +bb_alternative /bin/ip +bb_alternative /bin/kill +bb_alternative /bin/ln +bb_alternative /bin/login +bb_alternative /bin/ls +bb_alternative /bin/mkdir +bb_alternative /bin/mknod +bb_alternative /bin/mktemp +bb_alternative /bin/more +bb_alternative /bin/mount +bb_alternative /bin/mt +bb_alternative /bin/mv +bb_alternative /bin/nc +bb_alternative /bin/netstat +bb_alternative /bin/pidof +bb_alternative /bin/ping +bb_alternative /bin/ping6 +bb_alternative /bin/ps +bb_alternative /bin/pwd +bb_alternative /bin/readlink +bb_alternative /bin/rm +bb_alternative /bin/rmdir +bb_alternative /bin/run-parts +bb_alternative /bin/sed +bb_alternative /bin/sh +bb_alternative /bin/sleep +bb_alternative /bin/stty +bb_alternative /bin/sync +bb_alternative /bin/tar +bb_alternative /bin/touch +bb_alternative /bin/true +bb_alternative /bin/umount +bb_alternative /bin/uname +bb_alternative /bin/uncompress +bb_alternative /bin/which +bb_alternative /bin/zcat + +bb_alternative /sbin/ifconfig +bb_alternative /sbin/ip +bb_alternative /sbin/iptunnel +bb_alternative /sbin/klogd +bb_alternative /sbin/losetup +bb_alternative /sbin/nameif +bb_alternative /sbin/route +bb_alternative /sbin/start-stop-daemon +bb_alternative /sbin/swapoff +bb_alternative /sbin/swapon +bb_alternative /sbin/syslogd + +bb_alternative /usr/bin/adjtimex +bb_alternative /usr/bin/ar +bb_alternative /usr/bin/arping +bb_alternative /usr/bin/awk +bb_alternative /usr/bin/basename +bb_alternative /usr/bin/cal +bb_alternative /usr/bin/chvt +bb_alternative /usr/bin/clear +bb_alternative /usr/bin/cmp +bb_alternative /usr/bin/cut +bb_alternative /usr/bin/dc +bb_alternative /usr/bin/deallocvt +bb_alternative /usr/bin/dirname +bb_alternative /usr/bin/dos2unix +bb_alternative /usr/bin/dumpkmap +bb_alternative /usr/bin/du +bb_alternative /usr/bin/env +bb_alternative /usr/bin/expr +bb_alternative /usr/bin/find +bb_alternative /usr/bin/fold +bb_alternative /usr/bin/free +bb_alternative /usr/bin/ftpget +bb_alternative /usr/bin/ftpput +bb_alternative /usr/bin/getopt +bb_alternative /usr/bin/head +bb_alternative /usr/bin/hexdump +bb_alternative /usr/bin/hostid +bb_alternative /usr/bin/id +bb_alternative /usr/bin/ipaddr +bb_alternative /usr/bin/ipcalc +bb_alternative /usr/bin/iplink +bb_alternative /usr/bin/iproute +bb_alternative /usr/bin/killall +bb_alternative /usr/bin/last +bb_alternative /usr/bin/loadfont +bb_alternative /usr/bin/loadkmap +bb_alternative /usr/bin/logger +bb_alternative /usr/bin/logname +bb_alternative /usr/bin/logread +bb_alternative /usr/bin/md5sum +bb_alternative /usr/bin/mkfifo +bb_alternative /usr/bin/nslookup +bb_alternative /usr/bin/od +bb_alternative /usr/bin/openvt +bb_alternative /usr/bin/patch +bb_alternative /usr/bin/printf +bb_alternative /usr/bin/rdate +bb_alternative /usr/bin/realpath +bb_alternative /usr/bin/rpm +bb_alternative /usr/bin/rpm2cpio +bb_alternative /usr/bin/renice +bb_alternative /usr/bin/reset +bb_alternative /usr/bin/setkeycodes +bb_alternative /usr/bin/sha1sum +bb_alternative /usr/bin/sort +bb_alternative /usr/bin/strings +bb_alternative /usr/bin/tail +bb_alternative /usr/bin/tee +bb_alternative /usr/bin/test +bb_alternative /usr/bin/tftp +bb_alternative /usr/bin/time +bb_alternative /usr/bin/top +bb_alternative /usr/bin/touch +bb_alternative /usr/bin/tr +bb_alternative /usr/bin/traceroute +bb_alternative /usr/bin/tty +bb_alternative /usr/bin/uniq +bb_alternative /usr/bin/unix2dos +bb_alternative /usr/bin/unzip +bb_alternative /usr/bin/uptime +bb_alternative /usr/bin/usleep +bb_alternative /usr/bin/uudecode +bb_alternative /usr/bin/uuencode +bb_alternative /usr/bin/vi +bb_alternative /usr/bin/watch +bb_alternative /usr/bin/wc +bb_alternative /usr/bin/wget +bb_alternative /usr/bin/which +bb_alternative /usr/bin/who +bb_alternative /usr/bin/whoami +bb_alternative /usr/bin/xargs +bb_alternative /usr/bin/yes + +bb_alternative /usr/sbin/chroot +bb_alternative /usr/sbin/dumpleases +bb_alternative /usr/sbin/httpd +bb_alternative /usr/sbin/telnetd +bb_alternative /usr/sbin/traceroute +bb_alternative /usr/sbin/udhcpc +bb_alternative /usr/sbin/udhcpd +bb_alternative /usr/sbin/watchdog + +# Local Variables: +# mode: shell-script +# sh-indentation: 4 +# End: diff --git a/data/live-build-config/hooks/12-udev-initramfs.chroot b/data/live-build-config/hooks/12-udev-initramfs.chroot new file mode 100755 index 00000000..13bdfb89 --- /dev/null +++ b/data/live-build-config/hooks/12-udev-initramfs.chroot @@ -0,0 +1,9 @@ +#!/bin/sh + +# this was a "local patch" but patch generates a .orig file if it doesn't +# apply cleanly, which is not good when all files in the hook directory are +# executed. just use sed to hack the udev hook here. + +sed -i 's/^\(mount -n -o move \/dev .*\/dev\)$/\1 2>\/dev\/null/' \ + /usr/share/initramfs-tools/scripts/init-bottom/udev + diff --git a/data/live-build-config/hooks/13-sources_list.chroot b/data/live-build-config/hooks/13-sources_list.chroot new file mode 100755 index 00000000..956f9bba --- /dev/null +++ b/data/live-build-config/hooks/13-sources_list.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +rm -f /etc/apt/sources.list.d/*.list >/dev/null 2>&1 || true + diff --git a/data/live-build-config/hooks/14-fuse.chroot b/data/live-build-config/hooks/14-fuse.chroot new file mode 100755 index 00000000..126dc626 --- /dev/null +++ b/data/live-build-config/hooks/14-fuse.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf +chmod a+r /etc/fuse.conf diff --git a/data/live-build-config/hooks/15-gen_initramfs.chroot b/data/live-build-config/hooks/15-gen_initramfs.chroot new file mode 100755 index 00000000..aced728a --- /dev/null +++ b/data/live-build-config/hooks/15-gen_initramfs.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +echo I: Create initramfs if it does not exist. +update-initramfs -c -k `ls /boot | grep vmlinuz- | sed 's/vmlinuz-//g'` -- cgit v1.2.3 From 03705b9f859c01a610e399cc3523c61a484a36cb Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Wed, 3 Feb 2016 03:24:47 -0500 Subject: Removed fuse.conf file, will be generated in hooks --- data/live-build-config/includes.chroot/etc/fuse.conf | 1 - 1 file changed, 1 deletion(-) delete mode 100644 data/live-build-config/includes.chroot/etc/fuse.conf diff --git a/data/live-build-config/includes.chroot/etc/fuse.conf b/data/live-build-config/includes.chroot/etc/fuse.conf deleted file mode 100644 index a439ab82..00000000 --- a/data/live-build-config/includes.chroot/etc/fuse.conf +++ /dev/null @@ -1 +0,0 @@ -user_allow_other -- cgit v1.2.3 From ab3d92de1b23654730c8d317a376bfc6301e92c7 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Wed, 3 Feb 2016 06:41:13 -0500 Subject: Add hook that prevent services from starting at boot. --- .../hooks/16-disable_services.chroot | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 data/live-build-config/hooks/16-disable_services.chroot diff --git a/data/live-build-config/hooks/16-disable_services.chroot b/data/live-build-config/hooks/16-disable_services.chroot new file mode 100755 index 00000000..c68a6b3d --- /dev/null +++ b/data/live-build-config/hooks/16-disable_services.chroot @@ -0,0 +1,27 @@ +#!/bin/sh + +echo I: Disabling services. +systemctl disable exim4 +/usr/sbin/update-rc.d -f exim4 remove +systemctl disable isc-dhcp-server +/usr/sbin/update-rc.d -f isc-dhcp-server remove +systemctl disable isc-dhcp-relay +/usr/sbin/update-rc.d -f isc-dhcp-relay remove +systemctl disable nfacctd +/usr/sbin/update-rc.d -f nfacctd remove +systemctl disable pmacctd +/usr/sbin/update-rc.d -f pmacctd remove +systemctl disable sfacctd +/usr/sbin/update-rc.d -f sfacctd remove +systemctl disable uacctd +/usr/sbin/update-rc.d -f uacctd remove +systemctl disable lighttpd +/usr/sbin/update-rc.d -f lighttpd remove +systemctl disable ssh +/usr/sbin/update-rc.d -f ssh remove +systemctl disable openvpn +/usr/sbin/update-rc.d -f openvpn remove +systemctl disable dnsmasq +/usr/sbin/update-rc.d -f dnsmasq remove +systemctl disable lldpd +/usr/sbin/update-rc.d -f lldpd remove -- cgit v1.2.3 From 9d960e54985fc250a655f53a0f461f9741bb9f2e Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 3 Feb 2016 10:21:00 -0500 Subject: Add a script for extracting field values from the build config, for use in shell scripts and the like. --- scripts/query-config | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 scripts/query-config diff --git a/scripts/query-config b/scripts/query-config new file mode 100755 index 00000000..7d7146e0 --- /dev/null +++ b/scripts/query-config @@ -0,0 +1,36 @@ +#!/usr/bin/python +# Copyright (C) 2015 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: query-config +# Purpose: Extracts field values from the build config, +# for use in languages that can't handle JSON easily, +# (I'm looking at you, Bourne shell!) + + +import sys +import json + +import defaults +import util + +if len(sys.argv) < 2: + print("Usage: {0} ".format(sys.argv[0])) + sys.exit(1) + +util.check_build_config() +with open(defaults.BUILD_CONFIG, 'r') as f: + build_config = json.load(f) + +print(build_config[sys.argv[1]]) -- cgit v1.2.3 From 2b7a2bff886626e9a34966dec07b7010a97a76ba Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 3 Feb 2016 10:21:48 -0500 Subject: Add a script for copying various files to the build config dir depending on build flavour. --- Makefile | 3 +++ data/package-lists/vyos-dev.list.chroot | 2 ++ scripts/build-flavour | 26 ++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 data/package-lists/vyos-dev.list.chroot create mode 100755 scripts/build-flavour diff --git a/Makefile b/Makefile index 28c6b96f..84839ce3 100644 --- a/Makefile +++ b/Makefile @@ -12,11 +12,14 @@ prepare: @scripts/check-build-env @scripts/check-config + rm -rf build/config/* @scripts/live-build-config cp -r data/live-build-config/* build/config/ @scripts/make-version-file + @scripts/build-flavour + .PHONY: iso .ONESHELL: iso: prepare diff --git a/data/package-lists/vyos-dev.list.chroot b/data/package-lists/vyos-dev.list.chroot new file mode 100644 index 00000000..d057008f --- /dev/null +++ b/data/package-lists/vyos-dev.list.chroot @@ -0,0 +1,2 @@ +gdb +strace diff --git a/scripts/build-flavour b/scripts/build-flavour new file mode 100755 index 00000000..8cbdc10e --- /dev/null +++ b/scripts/build-flavour @@ -0,0 +1,26 @@ +#!/bin/sh +# Copyright (C) 2016 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: build-flavour +# Purpose: Adds various data files to the build config +# depending on the build flavour. + + +BUILD_TYPE=$(scripts/query-config build_type) + +# Add debug tools if it's a development image +if [ $BUILD_TYPE = "development" ]; then + cp data/package-lists/vyos-dev.list.chroot build/config/package-lists/ +fi -- cgit v1.2.3 From cac38de1cb46ac6001f2a5a8c09865685e13cfa5 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 3 Feb 2016 10:28:33 -0500 Subject: Fix some dates. --- scripts/query-config | 2 +- tools/gpl-header-template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/query-config b/scripts/query-config index 7d7146e0..cfd26cc3 100755 --- a/scripts/query-config +++ b/scripts/query-config @@ -1,5 +1,5 @@ #!/usr/bin/python -# Copyright (C) 2015 VyOS maintainers and contributors +# Copyright (C) 2016 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/tools/gpl-header-template b/tools/gpl-header-template index f3f82192..63be9d9a 100644 --- a/tools/gpl-header-template +++ b/tools/gpl-header-template @@ -1,4 +1,4 @@ -# Copyright (C) 2015 VyOS maintainers and contributors +# Copyright (C) 2016 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as -- cgit v1.2.3 From 89b0d6e89a06a0e56f32f4ee5f875b62fe885ee0 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 5 Feb 2016 11:14:54 -0500 Subject: Add post install script that will be used by squeeze versions of vyatta/vyos. --- .../opt/vyatta/etc/grub/default-union-grub-entry | 20 ++++++++++++++++++++ .../opt/vyatta/etc/install-image/postinst | 17 +++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry create mode 100755 data/live-build-config/includes.chroot/opt/vyatta/etc/install-image/postinst diff --git a/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry b/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry new file mode 100644 index 00000000..4107e459 --- /dev/null +++ b/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry @@ -0,0 +1,20 @@ +menuentry "VyOS (KVM console)" { + linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=ttyS0,9600 console=tty0 + initrd /boot//initrd.img +} + +menuentry "VyOS (Serial console)" { + linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=tty0 console=ttyS0,9600 + initrd /boot//initrd.img +} + +menuentry "Lost password change (KVM console)" { + linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=ttyS0,9600 console=tty0 init=/opt/vyatta/sbin/standalone_root_pw_reset + initrd /boot//initrd.img +} + +menuentry "Lost password change (Serial console)" { + linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=tty0 console=ttyS0,9600 init=/opt/vyatta/sbin/standalone_root_pw_reset + initrd /boot//initrd.img +} + diff --git a/data/live-build-config/includes.chroot/opt/vyatta/etc/install-image/postinst b/data/live-build-config/includes.chroot/opt/vyatta/etc/install-image/postinst new file mode 100755 index 00000000..d807fa9b --- /dev/null +++ b/data/live-build-config/includes.chroot/opt/vyatta/etc/install-image/postinst @@ -0,0 +1,17 @@ +#!/bin/bash + +source /opt/vyatta/sbin/install-functions + +NEWVER=`mount | grep /mnt/inst_root` +NEWVER=${NEWVER#*upperdir=/live/image/boot/} +NEWVER=${NEWVER%/live-rw*} +DISK_LABEL=`mount | grep /live/image | awk '{print $1}' | grep dev` + +if [ -d "/live/image" ]; then + e2label "${DISK_LABEL}" persistence + if [ ! -f /live/image/persistence.conf ]; then + echo "/ union" > /live/image/persistence.conf + fi + rm -f /live/image/boot/"${NEWVER}"/live-rw/etc/fstab + mv /live/image/boot/"${NEWVER}"/live-rw /live/image/boot/"${NEWVER}"/rw +fi -- cgit v1.2.3 From 9d55d9c93d232441509232b3613354f9d409c961 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 5 Feb 2016 11:26:15 -0500 Subject: Add binary hook for backwards compatibility and a hook that creates symlinks for vmlinuz and initrd.img. --- data/live-build-config/hooks/00-manifest.binary | 4 ++++ data/live-build-config/hooks/17-kernel_symlinks.chroot | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100755 data/live-build-config/hooks/00-manifest.binary create mode 100755 data/live-build-config/hooks/17-kernel_symlinks.chroot diff --git a/data/live-build-config/hooks/00-manifest.binary b/data/live-build-config/hooks/00-manifest.binary new file mode 100755 index 00000000..6db8b6f3 --- /dev/null +++ b/data/live-build-config/hooks/00-manifest.binary @@ -0,0 +1,4 @@ +#!/bin/sh + +echo I: Backwards compat packages.txt +echo "ii vyatta-version " > binary/live/packages.txt diff --git a/data/live-build-config/hooks/17-kernel_symlinks.chroot b/data/live-build-config/hooks/17-kernel_symlinks.chroot new file mode 100755 index 00000000..e63ca263 --- /dev/null +++ b/data/live-build-config/hooks/17-kernel_symlinks.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +echo I: Creating kernel symlinks. +cd /boot +ln -s initrd.img-* initrd.img +ln -s vmlinuz-* vmlinuz -- cgit v1.2.3 From a010662aaaf20896ed8bbe8797b577810ddd607e Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 6 Feb 2016 16:55:10 -0500 Subject: Add the kernel package as a submodule. --- .gitmodules | 3 +++ packages/vyos-kernel | 1 + 2 files changed, 4 insertions(+) create mode 160000 packages/vyos-kernel diff --git a/.gitmodules b/.gitmodules index b6cff22b..45e43991 100644 --- a/.gitmodules +++ b/.gitmodules @@ -121,3 +121,6 @@ [submodule "packages/vyos-world"] path = packages/vyos-world url = https://github.com/vyos/vyos-world.git +[submodule "packages/vyos-kernel"] + path = packages/vyos-kernel + url = https://github.com/vyos/vyos-kernel.git diff --git a/packages/vyos-kernel b/packages/vyos-kernel new file mode 160000 index 00000000..efe65045 --- /dev/null +++ b/packages/vyos-kernel @@ -0,0 +1 @@ +Subproject commit efe65045bf8daec40d63835d446938a4b1a2cb14 -- cgit v1.2.3 From d414a3742ae9c257710b612419435791a31dc162 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 8 Feb 2016 15:57:41 -0500 Subject: Add libpam-systemd package to cleanly close ssh sessions. --- data/live-build-config/package-lists/vyos-base.list.chroot | 1 + 1 file changed, 1 insertion(+) diff --git a/data/live-build-config/package-lists/vyos-base.list.chroot b/data/live-build-config/package-lists/vyos-base.list.chroot index 225af33a..1319a776 100644 --- a/data/live-build-config/package-lists/vyos-base.list.chroot +++ b/data/live-build-config/package-lists/vyos-base.list.chroot @@ -1,4 +1,5 @@ debconf gpgv gnupg +libpam-systemd vyos-world -- cgit v1.2.3 From a70d19d2fd470584df6ee347b3382438228c0465 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 8 Feb 2016 16:02:53 -0500 Subject: Revert "Add libpam-systemd package to cleanly close ssh sessions." This reverts commit d414a3742ae9c257710b612419435791a31dc162. --- data/live-build-config/package-lists/vyos-base.list.chroot | 1 - 1 file changed, 1 deletion(-) diff --git a/data/live-build-config/package-lists/vyos-base.list.chroot b/data/live-build-config/package-lists/vyos-base.list.chroot index 1319a776..225af33a 100644 --- a/data/live-build-config/package-lists/vyos-base.list.chroot +++ b/data/live-build-config/package-lists/vyos-base.list.chroot @@ -1,5 +1,4 @@ debconf gpgv gnupg -libpam-systemd vyos-world -- cgit v1.2.3 From a83d97ef4e4140ba774876909aa4b499e65c746d Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Tue, 9 Feb 2016 02:59:28 -0500 Subject: Add sshd.service file to cleanly close ssh sessions. --- .../includes.chroot/etc/systemd/system/sshd.service | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 data/live-build-config/includes.chroot/etc/systemd/system/sshd.service diff --git a/data/live-build-config/includes.chroot/etc/systemd/system/sshd.service b/data/live-build-config/includes.chroot/etc/systemd/system/sshd.service new file mode 100644 index 00000000..e84142bb --- /dev/null +++ b/data/live-build-config/includes.chroot/etc/systemd/system/sshd.service @@ -0,0 +1,16 @@ +[Unit] +Description=OpenBSD Secure Shell server +After=network.target auditd.service +ConditionPathExists=!/etc/ssh/sshd_not_to_be_run + +[Service] +EnvironmentFile=-/etc/default/ssh +ExecStart=/usr/sbin/sshd -D $SSHD_OPTS +ExecReload=/bin/kill -HUP $MAINPID +ExecStop=/usr/bin/killall sshd +KillMode=process +Restart=on-failure + +[Install] +WantedBy=multi-user.target +Alias=sshd.service -- cgit v1.2.3 From 481b5f0057e4e8ad57e994acc754a907342c2642 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 10 Feb 2016 18:42:32 -0500 Subject: Force all lb-config mirror options to debian_mirror from the build config. --- scripts/live-build-config | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/live-build-config b/scripts/live-build-config index c42887a4..dac8c27c 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -45,6 +45,11 @@ lb config noauto \ --iso-publisher "{{build_by}}" \ --iso-volume "VyOS" \ --debootstrap-options "--variant=minbase --exclude=isc-dhcp-client,isc-dhcp-common,ifupdown" \ + --mirror-bootstrap {{debian_mirror}} \ + --mirror-chroot {{debian_mirror}} \ + --mirror-chroot-security {{debian_mirror}} \ + --mirror-binary {{debian_mirror}} \ + --mirror-binary-security {{debian_mirror}} "${@}" """ -- cgit v1.2.3 From 775c50d622863b791f8c7dacc3e9020532291fe8 Mon Sep 17 00:00:00 2001 From: Patrick van Staveren Date: Mon, 1 Feb 2016 07:32:26 +0900 Subject: Handle errors from subscripts. Makefile .ONESHELL mode means that individual line exit codes aren't evaluated, only the final return code from the shell, which will always be zero. This makes it break earlier when a subscript returns non-zero. Maybe we shouldn't be using make? ;) --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 84839ce3..478830b0 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ all: .PHONY: prepare prepare: + set -e @echo "Starting VyOS ISO image build" @scripts/check-build-env @@ -23,6 +24,7 @@ prepare: .PHONY: iso .ONESHELL: iso: prepare + set -e @echo "It's not like I'm building this specially for you or anything!" cd $(build_dir) lb build 2>&1 | tee build.log @@ -30,12 +32,14 @@ iso: prepare .PHONY: prepare-package-env .ONESHELL: prepare-package-env: + set -e @scripts/pbuilder-config @scripts/pbuilder-setup .PHONY: clean .ONESHELL: clean: + set -e cd $(build_dir) lb clean -- cgit v1.2.3 From 285f9672490ca3462ebf6e40555e2b7f80bd226b Mon Sep 17 00:00:00 2001 From: Patrick van Staveren Date: Mon, 1 Feb 2016 07:38:45 +0900 Subject: silently enable error mode in shell --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 478830b0..38448f39 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ all: .PHONY: prepare prepare: - set -e + @set -e @echo "Starting VyOS ISO image build" @scripts/check-build-env @@ -24,7 +24,7 @@ prepare: .PHONY: iso .ONESHELL: iso: prepare - set -e + @set -e @echo "It's not like I'm building this specially for you or anything!" cd $(build_dir) lb build 2>&1 | tee build.log @@ -32,14 +32,14 @@ iso: prepare .PHONY: prepare-package-env .ONESHELL: prepare-package-env: - set -e + @set -e @scripts/pbuilder-config @scripts/pbuilder-setup .PHONY: clean .ONESHELL: clean: - set -e + @set -e cd $(build_dir) lb clean -- cgit v1.2.3 From 4b78ab4f94f74291f449a622625825c8f51a0ea7 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 3 Mar 2016 17:49:54 -0500 Subject: Make the query-config scripts more generic, it requires JSON file name now. --- scripts/query-config | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/query-config b/scripts/query-config index cfd26cc3..23e64ef7 100755 --- a/scripts/query-config +++ b/scripts/query-config @@ -14,7 +14,7 @@ # along with this program. If not, see . # # File: query-config -# Purpose: Extracts field values from the build config, +# Purpose: Extracts field values a flat JSON file, # for use in languages that can't handle JSON easily, # (I'm looking at you, Bourne shell!) @@ -25,12 +25,17 @@ import json import defaults import util -if len(sys.argv) < 2: - print("Usage: {0} ".format(sys.argv[0])) +if len(sys.argv) < 3: + print("Usage: {0} ".format(sys.argv[0])) sys.exit(1) -util.check_build_config() -with open(defaults.BUILD_CONFIG, 'r') as f: - build_config = json.load(f) +# Note: lack of error handling is deliberate, if some field is expected to be there +# but isn't, it's better if the failure will be obvious and spectacular -print(build_config[sys.argv[1]]) +file = sys.argv[1] +key = sys.argv[2] + +with open(file, 'r') as f: + json_data = json.load(f) + +print(json_data[key]) -- cgit v1.2.3 From 2416feb6993885d6b0adabc67f3731d1fbc5349f Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 3 Mar 2016 17:50:40 -0500 Subject: Rename query-config to query-json to reflect its new role. --- scripts/query-config | 41 ----------------------------------------- scripts/query-json | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 41 deletions(-) delete mode 100755 scripts/query-config create mode 100755 scripts/query-json diff --git a/scripts/query-config b/scripts/query-config deleted file mode 100755 index 23e64ef7..00000000 --- a/scripts/query-config +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/python -# Copyright (C) 2016 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 or later as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# File: query-config -# Purpose: Extracts field values a flat JSON file, -# for use in languages that can't handle JSON easily, -# (I'm looking at you, Bourne shell!) - - -import sys -import json - -import defaults -import util - -if len(sys.argv) < 3: - print("Usage: {0} ".format(sys.argv[0])) - sys.exit(1) - -# Note: lack of error handling is deliberate, if some field is expected to be there -# but isn't, it's better if the failure will be obvious and spectacular - -file = sys.argv[1] -key = sys.argv[2] - -with open(file, 'r') as f: - json_data = json.load(f) - -print(json_data[key]) diff --git a/scripts/query-json b/scripts/query-json new file mode 100755 index 00000000..23e64ef7 --- /dev/null +++ b/scripts/query-json @@ -0,0 +1,41 @@ +#!/usr/bin/python +# Copyright (C) 2016 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: query-config +# Purpose: Extracts field values a flat JSON file, +# for use in languages that can't handle JSON easily, +# (I'm looking at you, Bourne shell!) + + +import sys +import json + +import defaults +import util + +if len(sys.argv) < 3: + print("Usage: {0} ".format(sys.argv[0])) + sys.exit(1) + +# Note: lack of error handling is deliberate, if some field is expected to be there +# but isn't, it's better if the failure will be obvious and spectacular + +file = sys.argv[1] +key = sys.argv[2] + +with open(file, 'r') as f: + json_data = json.load(f) + +print(json_data[key]) -- cgit v1.2.3 From 4499a0b196857b03bcf83caf2c902ab3f86f69bc Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 3 Mar 2016 18:27:09 -0500 Subject: Adjust build-flavour script to use new json-query script. --- scripts/build-flavour | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-flavour b/scripts/build-flavour index 8cbdc10e..c97903f5 100755 --- a/scripts/build-flavour +++ b/scripts/build-flavour @@ -18,7 +18,7 @@ # depending on the build flavour. -BUILD_TYPE=$(scripts/query-config build_type) +BUILD_TYPE=$(scripts/query-json build/build-config.json build_type) # Add debug tools if it's a development image if [ $BUILD_TYPE = "development" ]; then -- cgit v1.2.3 From 6a7696a1122560073c3121fdecb5e3bd0c6549cf Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 3 Mar 2016 18:28:31 -0500 Subject: After build, create a properly named symlink to the ISO (ref T8). This is important for nightly builds, and handy for release builds. --- Makefile | 4 +++- scripts/make-version-file | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 38448f39..0a0cb2dd 100644 --- a/Makefile +++ b/Makefile @@ -23,11 +23,12 @@ prepare: .PHONY: iso .ONESHELL: -iso: prepare +iso: clean prepare @set -e @echo "It's not like I'm building this specially for you or anything!" cd $(build_dir) lb build 2>&1 | tee build.log + ln -nsf live-image-amd64.hybrid.iso vyos-`cat version`-`dpkg --print-architecture`.iso .PHONY: prepare-package-env .ONESHELL: @@ -45,6 +46,7 @@ clean: rm -f config/binary config/bootstrap config/chroot config/common config/source rm -f build.log + rm -f vyos-*.iso .PHONY: purge purge: diff --git a/scripts/make-version-file b/scripts/make-version-file index fcc399f8..6c597090 100755 --- a/scripts/make-version-file +++ b/scripts/make-version-file @@ -64,3 +64,9 @@ with open(os.path.join(defaults.CHROOT_INCLUDES_DIR, 'opt/vyatta/etc/version.jso # for upgrade with open(os.path.join(defaults.CHROOT_INCLUDES_DIR, 'opt/vyatta/etc/version'), 'w') as f: print("Version: {0}".format(version), file=f) + +# Leaky abstraction: we want ISO file name include version number, +# but we probably don't want to have a separate build step just for this, +# neither we want to use lengthy paths in makefiles +with open(os.path.join(defaults.BUILD_DIR, 'version'), 'w') as f: + print(version, file=f) -- cgit v1.2.3 From a05a3660eaf913689d89dd2187415d8b211aabb2 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 3 Mar 2016 18:35:18 -0500 Subject: Fix typo in the configure script. --- scripts/build-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-config b/scripts/build-config index 685d79f2..3b39befe 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -79,7 +79,7 @@ for k, v in args.items(): # use the --debian-mirror value for both lb and pbuilder bootstrap if (args['debian_mirror'] != defaults.DEBIAN_MIRROR) and \ (args['pbuilder_debian_mirror'] == defaults.DEBIAN_MIRROR): - args['pbuilder_debian_mirror'] = args['debian-mirror'] + args['pbuilder_debian_mirror'] = args['debian_mirror'] # Version can only be set for release builds, # for dev builds it hardly makes any sense -- cgit v1.2.3 From 3e56d7456e55b46ceb1dbca6a8f5cbc5150e18f5 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Fri, 4 Mar 2016 14:33:32 +0900 Subject: Add qemu image build scripts --- .gitignore | 2 ++ Makefile | 7 ++++++ scripts/build-qemu-image | 30 ++++++++++++++++++++++ scripts/check-vm-build-env | 61 +++++++++++++++++++++++++++++++++++++++++++++ scripts/packer.json | 62 ++++++++++++++++++++++++++++++++++++++++++++++ tools/run-qemu-image.sh | 16 ++++++++++++ 6 files changed, 178 insertions(+) create mode 100755 scripts/build-qemu-image create mode 100755 scripts/check-vm-build-env create mode 100644 scripts/packer.json create mode 100755 tools/run-qemu-image.sh diff --git a/.gitignore b/.gitignore index a0114d35..889ab43d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ build/* *.pyc +packer_build/* +packer_cache/* diff --git a/Makefile b/Makefile index 0a0cb2dd..86f0c27d 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,13 @@ prepare-package-env: @scripts/pbuilder-config @scripts/pbuilder-setup +.PHONY: qemu +.ONESHELL: +qemu: + @set -e + @scripts/check-vm-build-env + @scripts/build-qemu-image + .PHONY: clean .ONESHELL: clean: diff --git a/scripts/build-qemu-image b/scripts/build-qemu-image new file mode 100755 index 00000000..8643508a --- /dev/null +++ b/scripts/build-qemu-image @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Copyright (C) 2016 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: build-qemu-image +# Purpose: +# Build VyOS raw image for qemu. + + +export ISO_IMAGE=./build/live-image-amd64.hybrid.iso +export ISO_MD5_SUM=$(md5sum ${ISO_IMAGE} | awk '{print $1}') +export PACKER_BUILD_DIR=packer_build +export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build.log +export PACKER_LOG=1 + +mkdir -p ${PACKER_BUILD_DIR} + +packer build -only=qemu scripts/packer.json diff --git a/scripts/check-vm-build-env b/scripts/check-vm-build-env new file mode 100755 index 00000000..290b28c8 --- /dev/null +++ b/scripts/check-vm-build-env @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# +# Copyright (C) 2016 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: check-vm-build-env +# Purpose: +# Checks if packages required for VM image build are installed. + + +import os +import sys +from distutils.spawn import find_executable + +required_packages = [ + 'make', + 'qemu-system-x86', + 'qemu-utils' +] + + +def is_installed(name): + result = os.system("dpkg-query -W --showformat='${{Status}}\n' {name} 2>&1 | grep 'install ok installed' >/dev/null".format(name=name)) + return True if result == 0 else False + + +missing_packages = [] + +print("Checking if packages required for VyOS VM image build are installed") + +for p in required_packages: + if not is_installed(p): + missing_packages.append(p) + +if missing_packages: + print("Your system does not have some of the required packages installed.") + print("Please install the following packages:") + print(" ".join(missing_packages)) + sys.exit(1) +else: + print("All required packages are installed") + +if find_executable("packer"): + print("Your system has Packer.") +else: + print("Your system does not have Packer.") + print("Please install Packer from https://www.packer.io/downloads.html.") + sys.exit(1) + +sys.exit(0) diff --git a/scripts/packer.json b/scripts/packer.json new file mode 100644 index 00000000..5d5f201e --- /dev/null +++ b/scripts/packer.json @@ -0,0 +1,62 @@ +{ + "variables": { + "iso_url": "{{env `ISO_IMAGE`}}", + "iso_checksum": "{{env `ISO_MD5_SUM`}}", + "output_directory": "{{env `PACKER_BUILD_DIR`}}" + }, + "builders": + [ + { + "type": "qemu", + "iso_url": "{{user `iso_url`}}", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_checksum_type": "md5", + "output_directory": "{{user `output_directory`}}/qemu", + "shutdown_command": "sudo halt -p", + "disk_size": 4096, + "format": "raw", + "headless": true, + "accelerator": "kvm", + "ssh_host_port_min": 2222, + "ssh_host_port_max": 2229, + "ssh_username": "vyos", + "ssh_password": "vyos", + "ssh_port": 22, + "ssh_wait_timeout": "30s", + "vm_name": "vyos_qemu_image.img", + "net_device": "virtio-net", + "disk_interface": "virtio", + "boot_wait": "5s", + "boot_command": + [ + "", + "vyos", + "vyos", + "install image", + "", + "", + "", + "Yes", + "", + "", + "", + "vyos", + "vyos", + "", + "reboot", + "Yes", + "vyos", + "vyos", + "configure", + "delete system console", + "set interface ethernet eth0 address dhcp", + "set service ssh", + "commit", + "save", + "exit", + "reboot", + "Yes" + ] + } + ] +} diff --git a/tools/run-qemu-image.sh b/tools/run-qemu-image.sh new file mode 100755 index 00000000..b021ebd6 --- /dev/null +++ b/tools/run-qemu-image.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +VM_NAME='vyos_qemu' +VM_IMAGE='./packer_build/qemu/vyos_qemu_image.img' +MEMORY_SIZE='1024' +NCPUS=1 +SSH_PORT=2222 + +qemu-system-x86_64 \ + -name "${VM_NAME}" \ + -m ${MEMORY_SIZE} \ + -net nic,vlan=0,model=virtio \ + -net user,vlan=0,hostfwd=tcp::"${SSH_PORT}"-:22,hostname="${VM_NAME}" \ + -drive if=virtio,file=${VM_IMAGE} \ + -machine accel=kvm \ + -cpu host -smp ${NCPUS} -- cgit v1.2.3 From 08a6856b3c8f3146343647f996fca9c48fb4e960 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 4 Mar 2016 15:05:03 -0500 Subject: Factor out dependency checking functions to its own class (ref T9). --- scripts/check-build-env | 49 ++++++++++++++++++++++------------------------ scripts/check-vm-build-env | 48 ++++++++++++++++++--------------------------- scripts/util.py | 36 ++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 55 deletions(-) diff --git a/scripts/check-build-env b/scripts/check-build-env index 6f08847f..6dcf885b 100755 --- a/scripts/check-build-env +++ b/scripts/check-build-env @@ -23,34 +23,31 @@ import os import sys -required_packages = [ - 'sudo', - 'make', - 'live-build', - 'pbuilder', - 'devscripts', - 'python-pystache' -] - - -def is_installed(name): - result = os.system("dpkg-query -W --showformat='${{Status}}\n' {name} 2>&1 | grep 'install ok installed' >/dev/null".format(name=name)) - return True if result == 0 else False - - -missing_packages = [] +import util + +deps = { + 'packages': [ + 'sudo', + 'make', + 'live-build', + 'pbuilder', + 'devscripts', + 'python-pystache' + ], + 'binaries': [] +} print("Checking if packages required for VyOS image build are installed") -for p in required_packages: - if not is_installed(p): - missing_packages.append(p) +checker = util.DependencyChecker(deps) -if missing_packages: - print("Your system does not have some of the required packages installed.") - print("Please install the following packages:") - print(" ".join(missing_packages)) - sys.exit(1) -else: - print("All required packages are installed") +missing = checker.get_missing_dependencies() +if not missing: + print("All dependencies are installed") sys.exit(0) +else: + checker.print_missing_deps() + sys.exit(1) + +sys.exit(0) + diff --git a/scripts/check-vm-build-env b/scripts/check-vm-build-env index 290b28c8..47ec5922 100755 --- a/scripts/check-vm-build-env +++ b/scripts/check-vm-build-env @@ -21,41 +21,31 @@ import os import sys -from distutils.spawn import find_executable -required_packages = [ - 'make', - 'qemu-system-x86', - 'qemu-utils' -] +import util +deps = { + 'packages': [ + 'make', + 'qemu-system-x86', + 'qemu-utils' + ], + 'binaries': ['packer'] +} -def is_installed(name): - result = os.system("dpkg-query -W --showformat='${{Status}}\n' {name} 2>&1 | grep 'install ok installed' >/dev/null".format(name=name)) - return True if result == 0 else False +print("Checking if packages required for VyOS image build are installed") +checker = util.DependencyChecker(deps) -missing_packages = [] - -print("Checking if packages required for VyOS VM image build are installed") - -for p in required_packages: - if not is_installed(p): - missing_packages.append(p) - -if missing_packages: - print("Your system does not have some of the required packages installed.") - print("Please install the following packages:") - print(" ".join(missing_packages)) - sys.exit(1) -else: - print("All required packages are installed") - -if find_executable("packer"): - print("Your system has Packer.") +missing = checker.get_missing_dependencies() +if not missing: + print("All dependencies are installed") + sys.exit(0) else: - print("Your system does not have Packer.") - print("Please install Packer from https://www.packer.io/downloads.html.") + checker.print_missing_deps() + if 'packer' in missing['binaries']: + print("Your system does not have Packer.") + print("Please install Packer from https://www.packer.io/downloads.html.") sys.exit(1) sys.exit(0) diff --git a/scripts/util.py b/scripts/util.py index 00377672..7cc33364 100644 --- a/scripts/util.py +++ b/scripts/util.py @@ -19,6 +19,7 @@ import sys import os +from distutils.spawn import find_executable import defaults @@ -27,3 +28,38 @@ def check_build_config(): print("Build config file ({file}) does not exist".format(file=defaults.BUILD_CONFIG)) print("If you are running this script by hand, you should better not. Run 'make iso' instead.") sys.exit(1) + + +class DependencyChecker(object): + def __init__(self, spec): + missing_packages = self._get_missing_packages(spec['packages']) + missing_binaries = self._get_missing_binaries(spec['binaries']) + self.__missing = {'packages': missing_packages, 'binaries': missing_binaries} + + + def _package_installed(self, name): + result = os.system("dpkg-query -W --showformat='${{Status}}\n' {name} 2>&1 | grep 'install ok installed' >/dev/null".format(name=name)) + return True if result == 0 else False + + def _get_missing_packages(self, packages): + missing_packages = [] + for p in packages: + if not self._package_installed(p): + missing_packages.append(p) + return missing_packages + + def _get_missing_binaries(self, binaries): + missing_binaries = [] + for b in binaries: + if not find_executable(b): + missing_binaries.append(b) + return missing_binaries + + def get_missing_dependencies(self): + if self.__missing['packages'] or self.__missing['binaries']: + return self.__missing + return None + + def print_missing_deps(self): + print("Missing packages: " + " ".join(self.__missing['packages'])) + print("Missing binaries: " + " ".join(self.__missing['binaries'])) -- cgit v1.2.3 From b0fbefc7b96ee0d939cf82aef4e51bfb67bd39c7 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Sat, 5 Mar 2016 22:43:57 +0900 Subject: Change accelerator to tcg from kvm and ajust boot command in packer.json (ref T12) --- scripts/packer.json | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/scripts/packer.json b/scripts/packer.json index 5d5f201e..a390968a 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -16,46 +16,52 @@ "disk_size": 4096, "format": "raw", "headless": true, - "accelerator": "kvm", + "accelerator": "tcg", "ssh_host_port_min": 2222, "ssh_host_port_max": 2229, "ssh_username": "vyos", "ssh_password": "vyos", "ssh_port": 22, - "ssh_wait_timeout": "30s", + "ssh_wait_timeout": "300s", "vm_name": "vyos_qemu_image.img", "net_device": "virtio-net", "disk_interface": "virtio", "boot_wait": "5s", "boot_command": [ - "", - "vyos", + "", + "", + "", + "", + "", "vyos", - "install image", - "", - "", - "", - "Yes", + "vyos", + "install image", + "", + "", + "", + "Yes", "", - "", - "", - "vyos", + "", + "", "vyos", - "", - "reboot", + "vyos", + "", + "reboot", "Yes", + "", + "", + "", + "", + "", "vyos", - "vyos", - "configure", - "delete system console", + "vyos", + "configure", "set interface ethernet eth0 address dhcp", "set service ssh", - "commit", - "save", - "exit", - "reboot", - "Yes" + "commit", + "save", + "exit" ] } ] -- cgit v1.2.3 From c3a238ff2000ba4c27c791e66a9a4aaba9576a8f Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Sun, 6 Mar 2016 17:23:23 +0900 Subject: Fix qemu image cannot get IP address. (ref T12) --- scripts/packer.json | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/scripts/packer.json b/scripts/packer.json index a390968a..6d487353 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -15,7 +15,7 @@ "shutdown_command": "sudo halt -p", "disk_size": 4096, "format": "raw", - "headless": true, + "headless": false, "accelerator": "tcg", "ssh_host_port_min": 2222, "ssh_host_port_max": 2229, @@ -29,13 +29,9 @@ "boot_wait": "5s", "boot_command": [ - "", - "", - "", - "", - "", - "vyos", - "vyos", + "", + "vyos", + "vyos", "install image", "", "", @@ -44,21 +40,19 @@ "", "", "", - "vyos", "vyos", + "vyos", "", "reboot", - "Yes", - "", - "", - "", - "", - "", + "Yes", "vyos", "vyos", "configure", - "set interface ethernet eth0 address dhcp", - "set service ssh", + "set interface ethernet eth0 address dhcp", + "set service ssh", + "commit", + "save", + "delete interface ethernet eth0 hw-id", "commit", "save", "exit" -- cgit v1.2.3 From 7ba48ff801e98f25053b048e834b8b073fe21ad3 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 00:00:33 +0900 Subject: Add build scripts for VMware OVF (ref T14) --- Makefile | 7 +++ scripts/build-qemu-image | 2 +- scripts/build-vmware-ovf | 45 ++++++++++++++ scripts/packer-scripts/vmware.sh | 29 +++++++++ scripts/packer.json | 33 ++++++++++ scripts/template.ovf | 131 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 246 insertions(+), 1 deletion(-) create mode 100755 scripts/build-vmware-ovf create mode 100644 scripts/packer-scripts/vmware.sh create mode 100644 scripts/template.ovf diff --git a/Makefile b/Makefile index 86f0c27d..adce002c 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,13 @@ qemu: @scripts/check-vm-build-env @scripts/build-qemu-image +.PHONY: vmware-ovf +.ONESHELL: +vmware-ovf: + @set -e + @scripts/check-vm-build-env + @scripts/build-vmware-ovf + .PHONY: clean .ONESHELL: clean: diff --git a/scripts/build-qemu-image b/scripts/build-qemu-image index 8643508a..4a67f0f3 100755 --- a/scripts/build-qemu-image +++ b/scripts/build-qemu-image @@ -27,4 +27,4 @@ export PACKER_LOG=1 mkdir -p ${PACKER_BUILD_DIR} -packer build -only=qemu scripts/packer.json +packer build -only=qemu-image scripts/packer.json diff --git a/scripts/build-vmware-ovf b/scripts/build-vmware-ovf new file mode 100755 index 00000000..ff2a5464 --- /dev/null +++ b/scripts/build-vmware-ovf @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Copyright (C) 2016 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: build-vmware-ovf +# Purpose: +# Build VyOS OVF for VMware. + +if [ ! $(which vmdk-convert) ]; then + echo "Your system doesn't have vmdk-convert. Please install it from https://github.com/vmware/open-vmdk." + exit 1 +else + echo "Your system has vmdk-convert." +fi + +export PACKER_BUILD_DIR=packer_build +export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log +export PACKER_LOG=1 + +mkdir -p ${PACKER_BUILD_DIR} + +packer build -only=vmware-image scripts/packer.json + +# Convert raw image to VMDK +source_image=${PACKER_BUILD_DIR}/vmware/vyos_vmware_image.img +tmp_vmdk=${PACKER_BUILD_DIR}/vmware/tmp.vmdk +vmdk=${PACKER_BUILD_DIR}/vmware/vyos_vmware_image.vmdk +qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} +vmdk-convert ${tmp_vmdk} ${vmdk} + +# Generate OVF +vmdk_file_size=$(du --bytes ${vmdk} | awk '{print $1}') +cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > packer_build/vmware/vyos_vmware_image.ovf diff --git a/scripts/packer-scripts/vmware.sh b/scripts/packer-scripts/vmware.sh new file mode 100644 index 00000000..60c4db7e --- /dev/null +++ b/scripts/packer-scripts/vmware.sh @@ -0,0 +1,29 @@ +#!/bin/vbash +source /opt/vyatta/etc/functions/script-template + +# Add Debian Jessie repository +set system package repository jessie url 'http://ftp.nl.debian.org/debian/' +set system package repository jessie distribution 'jessie' +set system package repository jessie components 'main contrib non-free' +commit +save + +# Install open-vm-tools +sudo apt-get update +sudo apt-get -y install open-vm-tools + +# Delete Debian Jessie repository +delete system package repository jessie +commit +save + +# Removing leftover leases and persistent rules +sudo rm -f /var/lib/dhcp3/* + +# Removing apt caches +sudo rm -rf /var/cache/apt/* + +# Removing hw-id +delete interfaces ethernet eth0 hw-id +commit +save diff --git a/scripts/packer.json b/scripts/packer.json index 6d487353..e54dc74e 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -7,6 +7,7 @@ "builders": [ { + "name": "qemu-image", "type": "qemu", "iso_url": "{{user `iso_url`}}", "iso_checksum": "{{user `iso_checksum`}}", @@ -57,6 +58,38 @@ "save", "exit" ] + }, + { + "name": "vmware-image", + "type": "qemu", + "iso_url": "{{user `output_directory`}}/qemu/vyos_qemu_image.img", + "iso_checksum_type": "none", + "output_directory": "{{user `output_directory`}}/vmware", + "shutdown_command": "sudo halt -p", + "disk_image": true, + "disk_size": 4096, + "format": "raw", + "headless": false, + "accelerator": "tcg", + "ssh_host_port_min": 2222, + "ssh_host_port_max": 2229, + "ssh_username": "vyos", + "ssh_password": "vyos", + "ssh_port": 22, + "ssh_wait_timeout": "300s", + "vm_name": "vyos_vmware_image.img", + "net_device": "virtio-net", + "disk_interface": "virtio", + "boot_wait": "5s" + } + ], + "provisioners": [ + { + "type": "shell", + "only": ["vmware-image"], + "scripts": [ + "scripts/packer-scripts/vmware.sh" + ] } ] } diff --git a/scripts/template.ovf b/scripts/template.ovf new file mode 100644 index 00000000..2250eb55 --- /dev/null +++ b/scripts/template.ovf @@ -0,0 +1,131 @@ + + + + + + + Virtual disk information + + + + The list of logical networks + + The VM Network network + + + + A virtual machine + vyos + + The kind of installed guest operating system + + + Virtual hardware requirements + + Virtual Hardware Family + 0 + vyos + vmx-08 + + + hertz * 10^6 + Number of Virtual CPUs + 1 virtual CPU(s) + 1 + 3 + 1 + + + byte * 2^20 + Memory Size + 512MB of memory + 2 + 4 + 512 + + + 0 + USB Controller (EHCI) + usb + 3 + vmware.usb.ehci + 23 + + + + 0 + SCSI Controller + scsiController0 + 4 + lsilogic + 6 + + + 1 + IDE Controller + ideController1 + 5 + 5 + + + true + serial0 + 6 + 21 + + + + 0 + false + cdrom0 + 7 + 5 + 15 + + + 0 + disk0 + ovf:/disk/vmdisk1 + 8 + 4 + 17 + + + 2 + true + VM Network + VMXNET3 ethernet adapter on "nat" + ethernet0 + 9 + VMXNET3 + 10 + + + + false + sound + 10 + vmware.soundcard.ensoniq1371 + 1 + + + false + video + 11 + 24 + + + false + vmci + 12 + vmware.vmci + 1 + + + + + + + + + -- cgit v1.2.3 From 9c6086925e0f191dfe54b1081c6e904ace4d236d Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 00:44:27 +0900 Subject: Disable GUI in packer build (ref T14). --- scripts/packer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/packer.json b/scripts/packer.json index e54dc74e..52b0b284 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -16,7 +16,7 @@ "shutdown_command": "sudo halt -p", "disk_size": 4096, "format": "raw", - "headless": false, + "headless": true, "accelerator": "tcg", "ssh_host_port_min": 2222, "ssh_host_port_max": 2229, @@ -69,7 +69,7 @@ "disk_image": true, "disk_size": 4096, "format": "raw", - "headless": false, + "headless": true, "accelerator": "tcg", "ssh_host_port_min": 2222, "ssh_host_port_max": 2229, -- cgit v1.2.3 From 0a89aa830aaf151df6d68192a1699dfcb9c8fe05 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 10:31:23 +0900 Subject: Small fixes for scripts/template.ovf (ref T14). --- scripts/template.ovf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/template.ovf b/scripts/template.ovf index 2250eb55..7a67b82c 100644 --- a/scripts/template.ovf +++ b/scripts/template.ovf @@ -16,7 +16,7 @@ A virtual machine vyos - + The kind of installed guest operating system @@ -94,10 +94,10 @@ 2 true VM Network - VMXNET3 ethernet adapter on "nat" + VmxNet3 ethernet adapter on "VM Network" ethernet0 9 - VMXNET3 + VmxNet3 10 -- cgit v1.2.3 From 2a41a6b34f78fc7e81c5959cbefc88f1c9719040 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 15:38:41 +0900 Subject: vmware-ovf: Increase memory size and remove unnecessary devices (ref T14). --- scripts/template.ovf | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/scripts/template.ovf b/scripts/template.ovf index 7a67b82c..7e341c3e 100644 --- a/scripts/template.ovf +++ b/scripts/template.ovf @@ -25,7 +25,7 @@ Virtual Hardware Family 0 vyos - vmx-08 + vmx-09 hertz * 10^6 @@ -36,27 +36,18 @@ 1 - byte * 2^20 + byte * 2^30 Memory Size - 512MB of memory + 1GB of memory 2 4 - 512 - - - 0 - USB Controller (EHCI) - usb - 3 - vmware.usb.ehci - 23 - + 1 0 SCSI Controller scsiController0 - 4 + 3 lsilogic 6 @@ -64,13 +55,13 @@ 1 IDE Controller ideController1 - 5 + 4 5 true serial0 - 6 + 5 21 @@ -78,7 +69,7 @@ 0 false cdrom0 - 7 + 6 5 15 @@ -86,7 +77,7 @@ 0 disk0 ovf:/disk/vmdisk1 - 8 + 7 4 17 @@ -96,28 +87,21 @@ VM Network VmxNet3 ethernet adapter on "VM Network" ethernet0 - 9 + 8 VmxNet3 10 - - false - sound - 10 - vmware.soundcard.ensoniq1371 - 1 - false video - 11 + 9 24 false vmci - 12 + 10 vmware.vmci 1 -- cgit v1.2.3 From df70d5d1779d6a5c5cc027a80d2e9440d517eff2 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 15:39:31 +0900 Subject: vmware-ovf: Generate manifest file (T14). --- scripts/build-vmware-ovf | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/build-vmware-ovf b/scripts/build-vmware-ovf index ff2a5464..f3424a03 100755 --- a/scripts/build-vmware-ovf +++ b/scripts/build-vmware-ovf @@ -30,16 +30,22 @@ export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log export PACKER_LOG=1 mkdir -p ${PACKER_BUILD_DIR} +DST_DIR=${PACKER_BUILD_DIR}/vmware packer build -only=vmware-image scripts/packer.json # Convert raw image to VMDK -source_image=${PACKER_BUILD_DIR}/vmware/vyos_vmware_image.img -tmp_vmdk=${PACKER_BUILD_DIR}/vmware/tmp.vmdk -vmdk=${PACKER_BUILD_DIR}/vmware/vyos_vmware_image.vmdk +source_image=${DST_DIR}/vyos_vmware_image.img +tmp_vmdk=${DST_DIR}/tmp.vmdk +vmdk=${DST_DIR}/vyos_vmware_image.vmdk +ovf=${DST_DIR}/vyos_vmware_image.ovf qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} vmdk-convert ${tmp_vmdk} ${vmdk} # Generate OVF vmdk_file_size=$(du --bytes ${vmdk} | awk '{print $1}') -cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > packer_build/vmware/vyos_vmware_image.ovf +cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > ${ovf} + +# Generate manifest file +cd ${DST_DIR} +openssl sha1 *.vmdk *.ovf > vyos_vmware_image.mf -- cgit v1.2.3 From 01083886e1e861378ce16195c9ad76c1d5ce3e4a Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 23:47:39 +0900 Subject: Add product section to VMware OVF (ref T14). --- scripts/build-vmware-ovf | 8 ++++++-- scripts/check-vm-build-env | 2 +- scripts/template.ovf | 8 +++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/build-vmware-ovf b/scripts/build-vmware-ovf index f3424a03..8890ba69 100755 --- a/scripts/build-vmware-ovf +++ b/scripts/build-vmware-ovf @@ -43,8 +43,12 @@ qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_v vmdk-convert ${tmp_vmdk} ${vmdk} # Generate OVF -vmdk_file_size=$(du --bytes ${vmdk} | awk '{print $1}') -cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > ${ovf} +vmdk_file_size=$(vmdk-convert -i ${vmdk} | jq .capacity) +vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) +version=$(cat build/version) +cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > ${ovf} +sed -i "s/{{vmdk_populated_size}}/${vmdk_populated_size}/" ${ovf} +sed -i "s/{{version}}/${version}/" ${ovf} # Generate manifest file cd ${DST_DIR} diff --git a/scripts/check-vm-build-env b/scripts/check-vm-build-env index 47ec5922..c32f2b13 100755 --- a/scripts/check-vm-build-env +++ b/scripts/check-vm-build-env @@ -26,7 +26,7 @@ import util deps = { 'packages': [ - 'make', + 'jq', 'qemu-system-x86', 'qemu-utils' ], diff --git a/scripts/template.ovf b/scripts/template.ovf index 7e341c3e..b7c9aa32 100644 --- a/scripts/template.ovf +++ b/scripts/template.ovf @@ -5,7 +5,7 @@ Virtual disk information - + The list of logical networks @@ -111,5 +111,11 @@ + + VyOS is a Linux-based network operating system that provides software-based network routing, firewall, and VPN functionality. + VyOS + VyOS maintainers and contributors + {{version}} + -- cgit v1.2.3 From c5df2dd17dffda133a0c0bb68d6a9a16c10f1c2e Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 8 Mar 2016 09:08:36 +0900 Subject: Add support for signed VMware OVA (ref T14). --- Makefile | 6 ++-- scripts/build-vmware-ova | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ scripts/build-vmware-ovf | 55 ----------------------------------- 3 files changed, 77 insertions(+), 58 deletions(-) create mode 100755 scripts/build-vmware-ova delete mode 100755 scripts/build-vmware-ovf diff --git a/Makefile b/Makefile index adce002c..6c401e2c 100644 --- a/Makefile +++ b/Makefile @@ -44,12 +44,12 @@ qemu: @scripts/check-vm-build-env @scripts/build-qemu-image -.PHONY: vmware-ovf +.PHONY: vmware-ova .ONESHELL: -vmware-ovf: +vmware-ova: @set -e @scripts/check-vm-build-env - @scripts/build-vmware-ovf + @scripts/build-vmware-ova .PHONY: clean .ONESHELL: diff --git a/scripts/build-vmware-ova b/scripts/build-vmware-ova new file mode 100755 index 00000000..c0e85cdc --- /dev/null +++ b/scripts/build-vmware-ova @@ -0,0 +1,74 @@ +#!/bin/sh +# +# Copyright (C) 2016 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: build-vmware-ovf +# Purpose: +# Build VyOS OVF for VMware. + +if [ ! $(which vmdk-convert) ]; then + echo "Your system doesn't have vmdk-convert. Please install it from https://github.com/vmware/open-vmdk." + exit 1 +else + echo "Your system has vmdk-convert." +fi + +if [ ! $(which ovftool) ]; then + echo "Your system doesn't have ovftool. Please install it from https://www.vmware.com/support/developer/ovf/." + exit 1 +else + echo "Your system has ovftool." +fi + +export PACKER_BUILD_DIR=packer_build +export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log +export PACKER_LOG=1 + +mkdir -p ${PACKER_BUILD_DIR} +DST_DIR=${PACKER_BUILD_DIR}/vmware + +packer build -only=vmware-image scripts/packer.json + +# Convert raw image to VMDK +source_image=${DST_DIR}/vyos_vmware_image.img +tmp_vmdk=${DST_DIR}/tmp.vmdk +vmdk=${DST_DIR}/vyos_vmware_image.vmdk +ovf=${DST_DIR}/vyos_vmware_image.ovf +qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} +vmdk-convert ${tmp_vmdk} ${vmdk} + +# Generate OVF +echo 'Generating OVF file...' +vmdk_file_size=$(du --bytes ${vmdk} | cut -f1) +vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) +version=$(cat build/version) +sed scripts/template.ovf \ + -e "s/{{vmdk_file_size}}/${vmdk_file_size}/" \ + -e "s/{{vmdk_populated_size}}/${vmdk_populated_size}/" \ + -e "s/{{version}}/${version}/" \ + > ${ovf} + +# Generate manifest file +cd ${DST_DIR} +openssl sha1 *.vmdk *.ovf > vyos_vmware_image.mf + +# Convert the OVF to signed OVA... +echo 'Converting the OVF to signed OVA...' +private_key=${PRIVATE_KEY_PATH:-"../../key/privatekey.pem"} +if [ ! -f ${private_key} ]; then + echo 'Please put your key to "key" directory in repository root, or set PRIVATE_KEY_PATH to environment variables.' + exit 1 +fi +ovftool --privateKey=${PRIVATE_KEY_PATH} vyos_vmware_image.ovf vyos_vmware_image.ova diff --git a/scripts/build-vmware-ovf b/scripts/build-vmware-ovf deleted file mode 100755 index 8890ba69..00000000 --- a/scripts/build-vmware-ovf +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2016 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 or later as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# File: build-vmware-ovf -# Purpose: -# Build VyOS OVF for VMware. - -if [ ! $(which vmdk-convert) ]; then - echo "Your system doesn't have vmdk-convert. Please install it from https://github.com/vmware/open-vmdk." - exit 1 -else - echo "Your system has vmdk-convert." -fi - -export PACKER_BUILD_DIR=packer_build -export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log -export PACKER_LOG=1 - -mkdir -p ${PACKER_BUILD_DIR} -DST_DIR=${PACKER_BUILD_DIR}/vmware - -packer build -only=vmware-image scripts/packer.json - -# Convert raw image to VMDK -source_image=${DST_DIR}/vyos_vmware_image.img -tmp_vmdk=${DST_DIR}/tmp.vmdk -vmdk=${DST_DIR}/vyos_vmware_image.vmdk -ovf=${DST_DIR}/vyos_vmware_image.ovf -qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} -vmdk-convert ${tmp_vmdk} ${vmdk} - -# Generate OVF -vmdk_file_size=$(vmdk-convert -i ${vmdk} | jq .capacity) -vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) -version=$(cat build/version) -cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > ${ovf} -sed -i "s/{{vmdk_populated_size}}/${vmdk_populated_size}/" ${ovf} -sed -i "s/{{version}}/${version}/" ${ovf} - -# Generate manifest file -cd ${DST_DIR} -openssl sha1 *.vmdk *.ovf > vyos_vmware_image.mf -- cgit v1.2.3 From a0a10a1057ceafe7abf6a8da30894c97e5a90a1a Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 8 Mar 2016 11:17:56 +0900 Subject: Add support for signed VMware OVF (ref T14). --- Makefile | 6 ++-- scripts/build-vmware-image | 78 ++++++++++++++++++++++++++++++++++++++++++++++ scripts/build-vmware-ova | 74 ------------------------------------------- 3 files changed, 81 insertions(+), 77 deletions(-) create mode 100755 scripts/build-vmware-image delete mode 100755 scripts/build-vmware-ova diff --git a/Makefile b/Makefile index 6c401e2c..2e6dd9ad 100644 --- a/Makefile +++ b/Makefile @@ -44,12 +44,12 @@ qemu: @scripts/check-vm-build-env @scripts/build-qemu-image -.PHONY: vmware-ova +.PHONY: vmware .ONESHELL: -vmware-ova: +vmware: @set -e @scripts/check-vm-build-env - @scripts/build-vmware-ova + @scripts/build-vmware-image .PHONY: clean .ONESHELL: diff --git a/scripts/build-vmware-image b/scripts/build-vmware-image new file mode 100755 index 00000000..189461eb --- /dev/null +++ b/scripts/build-vmware-image @@ -0,0 +1,78 @@ +#!/bin/sh +# +# Copyright (C) 2016 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: build-vmware-ovf +# Purpose: +# Build VyOS OVF for VMware. + +if [ ! $(which vmdk-convert) ]; then + echo "Your system doesn't have vmdk-convert. Please install it from https://github.com/vmware/open-vmdk." + exit 1 +else + echo "Your system has vmdk-convert." +fi + +if [ ! $(which ovftool) ]; then + echo "Your system doesn't have ovftool. Please install it from https://www.vmware.com/support/developer/ovf/." + exit 1 +else + echo "Your system has ovftool." +fi + +export PACKER_BUILD_DIR=packer_build +export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log +export PACKER_LOG=1 + +mkdir -p ${PACKER_BUILD_DIR} +DST_DIR=${PACKER_BUILD_DIR}/vmware + +packer build -only=vmware-image scripts/packer.json + +# Convert raw image to VMDK +source_image=${DST_DIR}/vyos_vmware_image.img +tmp_vmdk=${DST_DIR}/tmp.vmdk +vmdk=${DST_DIR}/vyos_vmware_image.vmdk +ovf=${DST_DIR}/vyos_vmware_image.ovf +qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} +vmdk-convert ${tmp_vmdk} ${vmdk} + +# Generate OVF +echo 'Generating OVF file...' +vmdk_file_size=$(du --bytes ${vmdk} | cut -f1) +vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) +version=$(cat build/version) +sed scripts/template.ovf \ + -e "s/{{vmdk_file_size}}/${vmdk_file_size}/" \ + -e "s/{{vmdk_populated_size}}/${vmdk_populated_size}/" \ + -e "s/{{version}}/${version}/" \ + > ${ovf} + +# Generate manifest file +cd ${DST_DIR} +openssl sha1 *.vmdk *.ovf > vyos_vmware_image.mf + +# Convert the OVF to signed OVA... +echo 'Converting the OVF to signed OVA...' +private_key=${PRIVATE_KEY_PATH:-"../../key/privatekey.pem"} +if [ ! -f ${private_key} ]; then + echo 'Please put your key to "key/privatekey.pem" in repository root, or set PRIVATE_KEY_PATH to environment variables.' + exit 1 +fi +ovftool --privateKey=${PRIVATE_KEY_PATH} vyos_vmware_image.ovf vyos_vmware_image-signed.ova + +# Convert the OVF to signed OVF... +echo 'Converting the OVF to signed OVF...' +ovftool --privateKey=${PRIVATE_KEY_PATH} vyos_vmware_image.ovf vyos_vmware_image-signed.ovf diff --git a/scripts/build-vmware-ova b/scripts/build-vmware-ova deleted file mode 100755 index c0e85cdc..00000000 --- a/scripts/build-vmware-ova +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2016 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 or later as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# File: build-vmware-ovf -# Purpose: -# Build VyOS OVF for VMware. - -if [ ! $(which vmdk-convert) ]; then - echo "Your system doesn't have vmdk-convert. Please install it from https://github.com/vmware/open-vmdk." - exit 1 -else - echo "Your system has vmdk-convert." -fi - -if [ ! $(which ovftool) ]; then - echo "Your system doesn't have ovftool. Please install it from https://www.vmware.com/support/developer/ovf/." - exit 1 -else - echo "Your system has ovftool." -fi - -export PACKER_BUILD_DIR=packer_build -export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log -export PACKER_LOG=1 - -mkdir -p ${PACKER_BUILD_DIR} -DST_DIR=${PACKER_BUILD_DIR}/vmware - -packer build -only=vmware-image scripts/packer.json - -# Convert raw image to VMDK -source_image=${DST_DIR}/vyos_vmware_image.img -tmp_vmdk=${DST_DIR}/tmp.vmdk -vmdk=${DST_DIR}/vyos_vmware_image.vmdk -ovf=${DST_DIR}/vyos_vmware_image.ovf -qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} -vmdk-convert ${tmp_vmdk} ${vmdk} - -# Generate OVF -echo 'Generating OVF file...' -vmdk_file_size=$(du --bytes ${vmdk} | cut -f1) -vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) -version=$(cat build/version) -sed scripts/template.ovf \ - -e "s/{{vmdk_file_size}}/${vmdk_file_size}/" \ - -e "s/{{vmdk_populated_size}}/${vmdk_populated_size}/" \ - -e "s/{{version}}/${version}/" \ - > ${ovf} - -# Generate manifest file -cd ${DST_DIR} -openssl sha1 *.vmdk *.ovf > vyos_vmware_image.mf - -# Convert the OVF to signed OVA... -echo 'Converting the OVF to signed OVA...' -private_key=${PRIVATE_KEY_PATH:-"../../key/privatekey.pem"} -if [ ! -f ${private_key} ]; then - echo 'Please put your key to "key" directory in repository root, or set PRIVATE_KEY_PATH to environment variables.' - exit 1 -fi -ovftool --privateKey=${PRIVATE_KEY_PATH} vyos_vmware_image.ovf vyos_vmware_image.ova -- cgit v1.2.3 From 6b9627e678f587a556a578b6f7b838e3f193ffdb Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 8 Mar 2016 13:46:08 +0900 Subject: Add how to build VM images to README.md (ref T14). --- README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ea88d028..32b44a98 100644 --- a/README.md +++ b/README.md @@ -52,11 +52,32 @@ Individual packages may have other build dependencies. If some packages are miss Before you can build an image, you need to configure your build. To build an image, use the following commands: - ./configure - make iso + +``` +./configure +make iso +``` The ./configure script has a number of options that you can see by calling it with --help +## Building the images for virtualization platforms + +* QEMU + +Run following command after building the ISO image. + +``` +make qemu +``` + +* VMware + +Run following command after building the QEMU image. + +``` +make vmware +``` + # Development process ## git branches -- cgit v1.2.3 From dfd4089b97cdd767b4fb0ccc53aac95cb61fa087 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 11 Mar 2016 06:02:56 -0500 Subject: Include non-free firmware in the image (ref T15). --- .../hooks/13-firmware-linux-nonfree.chroot | 6 +++++ .../live-build-config/hooks/13-sources_list.chroot | 4 ---- data/live-build-config/hooks/14-fuse.chroot | 4 ---- .../live-build-config/hooks/14-sources_list.chroot | 4 ++++ data/live-build-config/hooks/15-fuse.chroot | 4 ++++ .../hooks/15-gen_initramfs.chroot | 4 ---- .../hooks/16-disable_services.chroot | 27 ---------------------- .../hooks/16-gen_initramfs.chroot | 4 ++++ .../hooks/17-disable_services.chroot | 27 ++++++++++++++++++++++ .../hooks/17-kernel_symlinks.chroot | 6 ----- .../hooks/18-kernel_symlinks.chroot | 6 +++++ 11 files changed, 51 insertions(+), 45 deletions(-) create mode 100755 data/live-build-config/hooks/13-firmware-linux-nonfree.chroot delete mode 100755 data/live-build-config/hooks/13-sources_list.chroot delete mode 100755 data/live-build-config/hooks/14-fuse.chroot create mode 100755 data/live-build-config/hooks/14-sources_list.chroot create mode 100755 data/live-build-config/hooks/15-fuse.chroot delete mode 100755 data/live-build-config/hooks/15-gen_initramfs.chroot delete mode 100755 data/live-build-config/hooks/16-disable_services.chroot create mode 100755 data/live-build-config/hooks/16-gen_initramfs.chroot create mode 100755 data/live-build-config/hooks/17-disable_services.chroot delete mode 100755 data/live-build-config/hooks/17-kernel_symlinks.chroot create mode 100755 data/live-build-config/hooks/18-kernel_symlinks.chroot diff --git a/data/live-build-config/hooks/13-firmware-linux-nonfree.chroot b/data/live-build-config/hooks/13-firmware-linux-nonfree.chroot new file mode 100755 index 00000000..3cb7dc6b --- /dev/null +++ b/data/live-build-config/hooks/13-firmware-linux-nonfree.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +cp /etc/apt/sources.list /etc/apt/sources.list.d/non-free.list +sed -i 's/main/non-free/g' /etc/apt/sources.list.d/non-free.list +apt-get update +apt-get -y install firmware-linux-nonfree diff --git a/data/live-build-config/hooks/13-sources_list.chroot b/data/live-build-config/hooks/13-sources_list.chroot deleted file mode 100755 index 956f9bba..00000000 --- a/data/live-build-config/hooks/13-sources_list.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -rm -f /etc/apt/sources.list.d/*.list >/dev/null 2>&1 || true - diff --git a/data/live-build-config/hooks/14-fuse.chroot b/data/live-build-config/hooks/14-fuse.chroot deleted file mode 100755 index 126dc626..00000000 --- a/data/live-build-config/hooks/14-fuse.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf -chmod a+r /etc/fuse.conf diff --git a/data/live-build-config/hooks/14-sources_list.chroot b/data/live-build-config/hooks/14-sources_list.chroot new file mode 100755 index 00000000..956f9bba --- /dev/null +++ b/data/live-build-config/hooks/14-sources_list.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +rm -f /etc/apt/sources.list.d/*.list >/dev/null 2>&1 || true + diff --git a/data/live-build-config/hooks/15-fuse.chroot b/data/live-build-config/hooks/15-fuse.chroot new file mode 100755 index 00000000..126dc626 --- /dev/null +++ b/data/live-build-config/hooks/15-fuse.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf +chmod a+r /etc/fuse.conf diff --git a/data/live-build-config/hooks/15-gen_initramfs.chroot b/data/live-build-config/hooks/15-gen_initramfs.chroot deleted file mode 100755 index aced728a..00000000 --- a/data/live-build-config/hooks/15-gen_initramfs.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -echo I: Create initramfs if it does not exist. -update-initramfs -c -k `ls /boot | grep vmlinuz- | sed 's/vmlinuz-//g'` diff --git a/data/live-build-config/hooks/16-disable_services.chroot b/data/live-build-config/hooks/16-disable_services.chroot deleted file mode 100755 index c68a6b3d..00000000 --- a/data/live-build-config/hooks/16-disable_services.chroot +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -echo I: Disabling services. -systemctl disable exim4 -/usr/sbin/update-rc.d -f exim4 remove -systemctl disable isc-dhcp-server -/usr/sbin/update-rc.d -f isc-dhcp-server remove -systemctl disable isc-dhcp-relay -/usr/sbin/update-rc.d -f isc-dhcp-relay remove -systemctl disable nfacctd -/usr/sbin/update-rc.d -f nfacctd remove -systemctl disable pmacctd -/usr/sbin/update-rc.d -f pmacctd remove -systemctl disable sfacctd -/usr/sbin/update-rc.d -f sfacctd remove -systemctl disable uacctd -/usr/sbin/update-rc.d -f uacctd remove -systemctl disable lighttpd -/usr/sbin/update-rc.d -f lighttpd remove -systemctl disable ssh -/usr/sbin/update-rc.d -f ssh remove -systemctl disable openvpn -/usr/sbin/update-rc.d -f openvpn remove -systemctl disable dnsmasq -/usr/sbin/update-rc.d -f dnsmasq remove -systemctl disable lldpd -/usr/sbin/update-rc.d -f lldpd remove diff --git a/data/live-build-config/hooks/16-gen_initramfs.chroot b/data/live-build-config/hooks/16-gen_initramfs.chroot new file mode 100755 index 00000000..aced728a --- /dev/null +++ b/data/live-build-config/hooks/16-gen_initramfs.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +echo I: Create initramfs if it does not exist. +update-initramfs -c -k `ls /boot | grep vmlinuz- | sed 's/vmlinuz-//g'` diff --git a/data/live-build-config/hooks/17-disable_services.chroot b/data/live-build-config/hooks/17-disable_services.chroot new file mode 100755 index 00000000..c68a6b3d --- /dev/null +++ b/data/live-build-config/hooks/17-disable_services.chroot @@ -0,0 +1,27 @@ +#!/bin/sh + +echo I: Disabling services. +systemctl disable exim4 +/usr/sbin/update-rc.d -f exim4 remove +systemctl disable isc-dhcp-server +/usr/sbin/update-rc.d -f isc-dhcp-server remove +systemctl disable isc-dhcp-relay +/usr/sbin/update-rc.d -f isc-dhcp-relay remove +systemctl disable nfacctd +/usr/sbin/update-rc.d -f nfacctd remove +systemctl disable pmacctd +/usr/sbin/update-rc.d -f pmacctd remove +systemctl disable sfacctd +/usr/sbin/update-rc.d -f sfacctd remove +systemctl disable uacctd +/usr/sbin/update-rc.d -f uacctd remove +systemctl disable lighttpd +/usr/sbin/update-rc.d -f lighttpd remove +systemctl disable ssh +/usr/sbin/update-rc.d -f ssh remove +systemctl disable openvpn +/usr/sbin/update-rc.d -f openvpn remove +systemctl disable dnsmasq +/usr/sbin/update-rc.d -f dnsmasq remove +systemctl disable lldpd +/usr/sbin/update-rc.d -f lldpd remove diff --git a/data/live-build-config/hooks/17-kernel_symlinks.chroot b/data/live-build-config/hooks/17-kernel_symlinks.chroot deleted file mode 100755 index e63ca263..00000000 --- a/data/live-build-config/hooks/17-kernel_symlinks.chroot +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -echo I: Creating kernel symlinks. -cd /boot -ln -s initrd.img-* initrd.img -ln -s vmlinuz-* vmlinuz diff --git a/data/live-build-config/hooks/18-kernel_symlinks.chroot b/data/live-build-config/hooks/18-kernel_symlinks.chroot new file mode 100755 index 00000000..e63ca263 --- /dev/null +++ b/data/live-build-config/hooks/18-kernel_symlinks.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +echo I: Creating kernel symlinks. +cd /boot +ln -s initrd.img-* initrd.img +ln -s vmlinuz-* vmlinuz -- cgit v1.2.3 From 95a28fe8b63ea97409ff6336f1b3ca419bac9961 Mon Sep 17 00:00:00 2001 From: Kim Date: Mon, 21 Mar 2016 11:54:39 +0100 Subject: update kernel package version --- scripts/live-build-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/live-build-config b/scripts/live-build-config index dac8c27c..52660571 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -36,7 +36,7 @@ lb config noauto \ --architectures {{architecture}} \ --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay" \ --linux-flavours {{architecture}}-vyos \ - --linux-packages linux-image-4.4.1 \ + --linux-packages linux-image-4.4.5 \ --bootloader syslinux \ --binary-images iso-hybrid \ --debian-installer false \ -- cgit v1.2.3 From b1e716208f9fb92966bda9b7425d6f67911105e4 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Sat, 26 Mar 2016 23:23:36 +0900 Subject: remove installing open-vm-tools process from build-vmware-image --- scripts/build-vmware-image | 12 ++++-------- scripts/packer.json | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/scripts/build-vmware-image b/scripts/build-vmware-image index 189461eb..e665e0b5 100755 --- a/scripts/build-vmware-image +++ b/scripts/build-vmware-image @@ -14,9 +14,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# File: build-vmware-ovf +# File: build-vmware-image # Purpose: -# Build VyOS OVF for VMware. +# Build VyOS OVA and OVF for VMware. if [ ! $(which vmdk-convert) ]; then echo "Your system doesn't have vmdk-convert. Please install it from https://github.com/vmware/open-vmdk." @@ -33,16 +33,12 @@ else fi export PACKER_BUILD_DIR=packer_build -export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log -export PACKER_LOG=1 -mkdir -p ${PACKER_BUILD_DIR} DST_DIR=${PACKER_BUILD_DIR}/vmware - -packer build -only=vmware-image scripts/packer.json +mkdir -p ${DST_DIR} # Convert raw image to VMDK -source_image=${DST_DIR}/vyos_vmware_image.img +source_image=${PACKER_BUILD_DIR}/qemu/vyos_qemu_image.img tmp_vmdk=${DST_DIR}/tmp.vmdk vmdk=${DST_DIR}/vyos_vmware_image.vmdk ovf=${DST_DIR}/vyos_vmware_image.ovf diff --git a/scripts/packer.json b/scripts/packer.json index 52b0b284..b09b9834 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -46,7 +46,7 @@ "", "reboot", "Yes", - "vyos", + "vyos", "vyos", "configure", "set interface ethernet eth0 address dhcp", -- cgit v1.2.3 From f349c98d9a5d66fd9f39d59af159e994fc48c8f4 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Sun, 27 Mar 2016 16:16:11 -0400 Subject: add vyos-remove package and remove ddclient dhclient hook --- .../hooks/13-firmware-linux-nonfree.chroot | 6 ----- .../live-build-config/hooks/13-vyos_replace.chroot | 3 +++ .../hooks/14-firmware-linux-nonfree.chroot | 6 +++++ .../live-build-config/hooks/14-sources_list.chroot | 4 ---- data/live-build-config/hooks/15-fuse.chroot | 4 ---- .../live-build-config/hooks/15-sources_list.chroot | 4 ++++ data/live-build-config/hooks/16-fuse.chroot | 4 ++++ .../hooks/16-gen_initramfs.chroot | 4 ---- .../hooks/17-disable_services.chroot | 27 ---------------------- .../hooks/17-gen_initramfs.chroot | 4 ++++ .../hooks/18-disable_services.chroot | 27 ++++++++++++++++++++++ .../hooks/18-kernel_symlinks.chroot | 6 ----- .../hooks/19-kernel_symlinks.chroot | 6 +++++ .../hooks/20-rm_ddclient_hook.chroot | 3 +++ 14 files changed, 57 insertions(+), 51 deletions(-) delete mode 100755 data/live-build-config/hooks/13-firmware-linux-nonfree.chroot create mode 100755 data/live-build-config/hooks/13-vyos_replace.chroot create mode 100755 data/live-build-config/hooks/14-firmware-linux-nonfree.chroot delete mode 100755 data/live-build-config/hooks/14-sources_list.chroot delete mode 100755 data/live-build-config/hooks/15-fuse.chroot create mode 100755 data/live-build-config/hooks/15-sources_list.chroot create mode 100755 data/live-build-config/hooks/16-fuse.chroot delete mode 100755 data/live-build-config/hooks/16-gen_initramfs.chroot delete mode 100755 data/live-build-config/hooks/17-disable_services.chroot create mode 100755 data/live-build-config/hooks/17-gen_initramfs.chroot create mode 100755 data/live-build-config/hooks/18-disable_services.chroot delete mode 100755 data/live-build-config/hooks/18-kernel_symlinks.chroot create mode 100755 data/live-build-config/hooks/19-kernel_symlinks.chroot create mode 100755 data/live-build-config/hooks/20-rm_ddclient_hook.chroot diff --git a/data/live-build-config/hooks/13-firmware-linux-nonfree.chroot b/data/live-build-config/hooks/13-firmware-linux-nonfree.chroot deleted file mode 100755 index 3cb7dc6b..00000000 --- a/data/live-build-config/hooks/13-firmware-linux-nonfree.chroot +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -cp /etc/apt/sources.list /etc/apt/sources.list.d/non-free.list -sed -i 's/main/non-free/g' /etc/apt/sources.list.d/non-free.list -apt-get update -apt-get -y install firmware-linux-nonfree diff --git a/data/live-build-config/hooks/13-vyos_replace.chroot b/data/live-build-config/hooks/13-vyos_replace.chroot new file mode 100755 index 00000000..dcb00ff6 --- /dev/null +++ b/data/live-build-config/hooks/13-vyos_replace.chroot @@ -0,0 +1,3 @@ +#!/bin/sh + +apt-get -y install vyos-replace diff --git a/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot b/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot new file mode 100755 index 00000000..3cb7dc6b --- /dev/null +++ b/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +cp /etc/apt/sources.list /etc/apt/sources.list.d/non-free.list +sed -i 's/main/non-free/g' /etc/apt/sources.list.d/non-free.list +apt-get update +apt-get -y install firmware-linux-nonfree diff --git a/data/live-build-config/hooks/14-sources_list.chroot b/data/live-build-config/hooks/14-sources_list.chroot deleted file mode 100755 index 956f9bba..00000000 --- a/data/live-build-config/hooks/14-sources_list.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -rm -f /etc/apt/sources.list.d/*.list >/dev/null 2>&1 || true - diff --git a/data/live-build-config/hooks/15-fuse.chroot b/data/live-build-config/hooks/15-fuse.chroot deleted file mode 100755 index 126dc626..00000000 --- a/data/live-build-config/hooks/15-fuse.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf -chmod a+r /etc/fuse.conf diff --git a/data/live-build-config/hooks/15-sources_list.chroot b/data/live-build-config/hooks/15-sources_list.chroot new file mode 100755 index 00000000..956f9bba --- /dev/null +++ b/data/live-build-config/hooks/15-sources_list.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +rm -f /etc/apt/sources.list.d/*.list >/dev/null 2>&1 || true + diff --git a/data/live-build-config/hooks/16-fuse.chroot b/data/live-build-config/hooks/16-fuse.chroot new file mode 100755 index 00000000..126dc626 --- /dev/null +++ b/data/live-build-config/hooks/16-fuse.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf +chmod a+r /etc/fuse.conf diff --git a/data/live-build-config/hooks/16-gen_initramfs.chroot b/data/live-build-config/hooks/16-gen_initramfs.chroot deleted file mode 100755 index aced728a..00000000 --- a/data/live-build-config/hooks/16-gen_initramfs.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -echo I: Create initramfs if it does not exist. -update-initramfs -c -k `ls /boot | grep vmlinuz- | sed 's/vmlinuz-//g'` diff --git a/data/live-build-config/hooks/17-disable_services.chroot b/data/live-build-config/hooks/17-disable_services.chroot deleted file mode 100755 index c68a6b3d..00000000 --- a/data/live-build-config/hooks/17-disable_services.chroot +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -echo I: Disabling services. -systemctl disable exim4 -/usr/sbin/update-rc.d -f exim4 remove -systemctl disable isc-dhcp-server -/usr/sbin/update-rc.d -f isc-dhcp-server remove -systemctl disable isc-dhcp-relay -/usr/sbin/update-rc.d -f isc-dhcp-relay remove -systemctl disable nfacctd -/usr/sbin/update-rc.d -f nfacctd remove -systemctl disable pmacctd -/usr/sbin/update-rc.d -f pmacctd remove -systemctl disable sfacctd -/usr/sbin/update-rc.d -f sfacctd remove -systemctl disable uacctd -/usr/sbin/update-rc.d -f uacctd remove -systemctl disable lighttpd -/usr/sbin/update-rc.d -f lighttpd remove -systemctl disable ssh -/usr/sbin/update-rc.d -f ssh remove -systemctl disable openvpn -/usr/sbin/update-rc.d -f openvpn remove -systemctl disable dnsmasq -/usr/sbin/update-rc.d -f dnsmasq remove -systemctl disable lldpd -/usr/sbin/update-rc.d -f lldpd remove diff --git a/data/live-build-config/hooks/17-gen_initramfs.chroot b/data/live-build-config/hooks/17-gen_initramfs.chroot new file mode 100755 index 00000000..aced728a --- /dev/null +++ b/data/live-build-config/hooks/17-gen_initramfs.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +echo I: Create initramfs if it does not exist. +update-initramfs -c -k `ls /boot | grep vmlinuz- | sed 's/vmlinuz-//g'` diff --git a/data/live-build-config/hooks/18-disable_services.chroot b/data/live-build-config/hooks/18-disable_services.chroot new file mode 100755 index 00000000..c68a6b3d --- /dev/null +++ b/data/live-build-config/hooks/18-disable_services.chroot @@ -0,0 +1,27 @@ +#!/bin/sh + +echo I: Disabling services. +systemctl disable exim4 +/usr/sbin/update-rc.d -f exim4 remove +systemctl disable isc-dhcp-server +/usr/sbin/update-rc.d -f isc-dhcp-server remove +systemctl disable isc-dhcp-relay +/usr/sbin/update-rc.d -f isc-dhcp-relay remove +systemctl disable nfacctd +/usr/sbin/update-rc.d -f nfacctd remove +systemctl disable pmacctd +/usr/sbin/update-rc.d -f pmacctd remove +systemctl disable sfacctd +/usr/sbin/update-rc.d -f sfacctd remove +systemctl disable uacctd +/usr/sbin/update-rc.d -f uacctd remove +systemctl disable lighttpd +/usr/sbin/update-rc.d -f lighttpd remove +systemctl disable ssh +/usr/sbin/update-rc.d -f ssh remove +systemctl disable openvpn +/usr/sbin/update-rc.d -f openvpn remove +systemctl disable dnsmasq +/usr/sbin/update-rc.d -f dnsmasq remove +systemctl disable lldpd +/usr/sbin/update-rc.d -f lldpd remove diff --git a/data/live-build-config/hooks/18-kernel_symlinks.chroot b/data/live-build-config/hooks/18-kernel_symlinks.chroot deleted file mode 100755 index e63ca263..00000000 --- a/data/live-build-config/hooks/18-kernel_symlinks.chroot +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -echo I: Creating kernel symlinks. -cd /boot -ln -s initrd.img-* initrd.img -ln -s vmlinuz-* vmlinuz diff --git a/data/live-build-config/hooks/19-kernel_symlinks.chroot b/data/live-build-config/hooks/19-kernel_symlinks.chroot new file mode 100755 index 00000000..e63ca263 --- /dev/null +++ b/data/live-build-config/hooks/19-kernel_symlinks.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +echo I: Creating kernel symlinks. +cd /boot +ln -s initrd.img-* initrd.img +ln -s vmlinuz-* vmlinuz diff --git a/data/live-build-config/hooks/20-rm_ddclient_hook.chroot b/data/live-build-config/hooks/20-rm_ddclient_hook.chroot new file mode 100755 index 00000000..173b4e5c --- /dev/null +++ b/data/live-build-config/hooks/20-rm_ddclient_hook.chroot @@ -0,0 +1,3 @@ +#!/bin/sh + +rm -f /etc/dhcp/dhclient-exit-hooks.d/ddclient -- cgit v1.2.3 From 6686f05a1cda18c70525837a2dc95431ad5306cd Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Thu, 31 Mar 2016 14:12:00 +0900 Subject: Change vm disk type from IDE to SCSI (ref T14). --- scripts/template.ovf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/template.ovf b/scripts/template.ovf index b7c9aa32..f3624339 100644 --- a/scripts/template.ovf +++ b/scripts/template.ovf @@ -78,7 +78,7 @@ disk0 ovf:/disk/vmdisk1 7 - 4 + 3 17 -- cgit v1.2.3 From 6bf7fdff0f7e64bbd2b231a4041bbfaffa36223b Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 13 Apr 2016 03:17:45 -0400 Subject: For the ARM porting story: add copying a package list with arch-specific packages to the build-flavour script. Right now it only includes grub-pc. --- data/package-lists/vyos-x86.list.chroot | 1 + scripts/build-flavour | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 data/package-lists/vyos-x86.list.chroot diff --git a/data/package-lists/vyos-x86.list.chroot b/data/package-lists/vyos-x86.list.chroot new file mode 100644 index 00000000..c20456df --- /dev/null +++ b/data/package-lists/vyos-x86.list.chroot @@ -0,0 +1 @@ +grub-pc diff --git a/scripts/build-flavour b/scripts/build-flavour index c97903f5..389be980 100755 --- a/scripts/build-flavour +++ b/scripts/build-flavour @@ -19,8 +19,14 @@ BUILD_TYPE=$(scripts/query-json build/build-config.json build_type) +BUILD_ARCH=$(scripts/query-json build/build-config.json architecture) # Add debug tools if it's a development image if [ $BUILD_TYPE = "development" ]; then cp data/package-lists/vyos-dev.list.chroot build/config/package-lists/ fi + +# Install grub-pc if it's an x86 build +if [ $BUILD_ARCH = 'amd64' -o $BUILD_ARCH = 'i686' ]; then + cp data/package-lists/vyos-x86.list.chroot build/config/package-lists/ +fi -- cgit v1.2.3 From 826fa1a973ffdfee54691bae7a3cb6a51ecaf230 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Tue, 24 May 2016 10:00:20 +0000 Subject: add build options for clearfog --- Makefile | 10 ++ data/live-build-config/archives/vyos.list.chroot | 1 + .../hooks/14-firmware-linux-nonfree.chroot | 6 + data/package-lists/vyos-arm.list.chroot | 1 + scripts/build-clearfog-image | 158 +++++++++++++++++++++ scripts/build-config | 2 +- scripts/build-flavour | 5 + tools/armada-388-clearfog.dtb | Bin 0 -> 18814 bytes tools/u-boot-spl.kwb | Bin 0 -> 550316 bytes 9 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 data/package-lists/vyos-arm.list.chroot create mode 100755 scripts/build-clearfog-image create mode 100755 tools/armada-388-clearfog.dtb create mode 100644 tools/u-boot-spl.kwb diff --git a/Makefile b/Makefile index 2e6dd9ad..44e3c139 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,14 @@ vmware: @scripts/check-vm-build-env @scripts/build-vmware-image +.PHONY: clearfog +.ONESHELL: +clearfog: clean prepare + @set -e + @echo "It's not like I'm building this specially for you or anything!" + cd $(build_dir) + @../scripts/build-clearfog-legacy + .PHONY: clean .ONESHELL: clean: @@ -61,6 +69,8 @@ clean: rm -f config/binary config/bootstrap config/chroot config/common config/source rm -f build.log rm -f vyos-*.iso + rm -f *.img + rm -f *.xz .PHONY: purge purge: diff --git a/data/live-build-config/archives/vyos.list.chroot b/data/live-build-config/archives/vyos.list.chroot index 2b117386..664b408c 100644 --- a/data/live-build-config/archives/vyos.list.chroot +++ b/data/live-build-config/archives/vyos.list.chroot @@ -1 +1,2 @@ deb http://dev.packages.vyos.net/vyos current main +deb http://security.debian.org/ jessie/updates main diff --git a/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot b/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot index 3cb7dc6b..887831cc 100755 --- a/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot +++ b/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot @@ -2,5 +2,11 @@ cp /etc/apt/sources.list /etc/apt/sources.list.d/non-free.list sed -i 's/main/non-free/g' /etc/apt/sources.list.d/non-free.list + +if [ -e /etc/apt/sources.list.d/zz-sources.list ] ; then + cp /etc/apt/sources.list /etc/apt/sources.list.d/zz-non-free.list + sed -i 's/main/non-free/g' /etc/apt/sources.list.d/zz-non-free.list +fi + apt-get update apt-get -y install firmware-linux-nonfree diff --git a/data/package-lists/vyos-arm.list.chroot b/data/package-lists/vyos-arm.list.chroot new file mode 100644 index 00000000..41fcddf8 --- /dev/null +++ b/data/package-lists/vyos-arm.list.chroot @@ -0,0 +1 @@ +grub-efi-arm diff --git a/scripts/build-clearfog-image b/scripts/build-clearfog-image new file mode 100755 index 00000000..30bc1cb4 --- /dev/null +++ b/scripts/build-clearfog-image @@ -0,0 +1,158 @@ +#!/bin/sh +# +# Copyright (C) 2016 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 or later as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: build-clearfog-image +# Purpose: +# Build VyOS image for for Solidrun clearfog. + +lb bootstrap +lb chroot +lb installer +lb binary_chroot +lb chroot_devpts install +lb chroot_proc install +lb chroot_selinuxfs install +lb chroot_sysfs install +lb chroot_hosts install +lb chroot_resolv install +lb chroot_hostname install +lb chroot_sysv-rc install +lb chroot_upstart install +lb chroot_apt install-binary +lb chroot_archives chroot install +lb binary_rootfs +lb binary_manifest +lb binary_package-lists +lb binary_linux-image +lb binary_memtest +lb binary_grub +lb binary_grub2 +lb binary_syslinux +lb binary_disk +lb binary_loadlin +lb binary_win32-loader +lb binary_includes +lb binary_hooks +lb binary_checksums + +# get vyos build version +version=$(cat version) +dateymd=$(date +%Y%m%d) + +# create sd-card image and partition it +qemu-img create -f raw sr-a38x-cf-vyos-"$dateymd"-testing.img 1.8G +parted --script sr-a38x-cf-vyos-"$dateymd"-testing.img mklabel msdos +parted --script sr-a38x-cf-vyos-"$dateymd"-testing.img mkpart primary fat16 8192s 60 +parted --script sr-a38x-cf-vyos-"$dateymd"-testing.img mkpart primary ext2 60 1900 +parted --script sr-a38x-cf-vyos-"$dateymd"-testing.img set 1 boot on + +# mount image and create filesystems +losetup /dev/loop0 sr-a38x-cf-vyos-"$dateymd"-testing.img +partprobe /dev/loop0 +mkfs.vfat -n EFI -F 16 -I /dev/loop0p1 +mkfs.ext2 -L persistence /dev/loop0p2 + +# mount image partitions +mkdir -p /boot/efi +mount /dev/loop0p1 /boot/efi +mkdir -p /mnt +mount /dev/loop0p2 /mnt + +# setup files on image +mkdir -p /mnt/boot/grub +mkdir -p /mnt/boot/"$version"/rw +echo "/ union" > /mnt/persistence.conf +cp binary/live/filesystem.squashfs /mnt/boot/"$version"/"$version.squashfs" +cp binary/live/initrd.img-* /mnt/boot/"$version"/initrd.img +cp binary/live/vmlinuz-* /mnt/boot/"$version"/vmlinuz +cp ../tools/armada-388-clearfog.dtb /boot/efi/armada-388-clearfog.dtb + +# create boot script +cat > /boot/efi/boot.script << EOF +# load DTB +echo "Loading armada-388-clearfog.dtb" +load mmc 0:1 \$fdt_addr_r armada-388-clearfog.dtb +fdt addr \$fdt_addr_r 20000 + +# load efi +echo "Loading EFI image ..." +load mmc 0:1 \$loadaddr EFI/debian/grubarm.efi + +# Sleep a while so the MMC driver can settle down +echo "Sleeping 5 seconds ..." +sleep 5 + +# boot +echo "Booting ..." +bootefi \$loadaddr +EOF + +# compile boot script for u-boot +mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d /boot/efi/boot.script /boot/efi/boot.scr + +# create grub config file to include +cat > load.cfg << EOF +set root=(hd0,msdos2) +set prefix=(hd0,msdos2)/boot/grub +devicetree (hd0,msdos1)/armada-388-clearfog.dtb +insmod normal +normal +EOF + +# create grub menu +cat > /mnt/boot/grub/grub.cfg << EOF +set default=0 +set timeout=5 + +echo -n Press ESC to enter the Grub menu... +if sleep --verbose --interruptible 5 ; then + terminal_input console serial +fi + + +menuentry "VyOS $version (Serial console)" { + linux /boot/"$version"/vmlinuz boot=live quiet vyatta-union=/boot/"$version" console=ttyS0,115200n8 + initrd /boot/"$version"/initrd.img +} + +menuentry "Lost password change $version (Serial console)" { + linux /boot/"$version"/vmlinuz boot=live quiet vyatta-union=/boot/"$version" console=ttyS0,115200n8 init=/opt/vyatta/sbin/standalone_root_pw_reset + initrd /boot/"$version"/initrd.img +} +EOF + +# install efi grub to image +grub-install --efi-directory /boot/efi --boot-directory /mnt/boot -d /usr/lib/grub/arm-efi /dev/loop0 + +# create grub efi executable +grub-mkimage -O arm-efi -p /boot/grub -d /usr/lib/grub/arm-efi -c load.cfg \ +ext2 iso9660 linux echo configfile \ +search_label search_fs_file search \ +search_fs_uuid ls normal gzio \ +png fat gettext font minicmd \ +gfxterm gfxmenu video video_fb \ +part_msdos part_gpt > /boot/efi/EFI/debian/grubarm.efi + +# unmount image partitions +umount /mnt +umount /boot/efi + +# write u-boot to image +dd if=../tools/u-boot-spl.kwb of=/dev/loop0 bs=512 seek=1 + +# unmount image +sudo losetup -D + +# compress image +xz -v sr-a38x-cf-vyos-"$dateymd"-testing.img diff --git a/scripts/build-config b/scripts/build-config index 3b39befe..c5d1ab5f 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -46,7 +46,7 @@ def get_default_build_by(): # Options dict format: # '$option_name_without_leading_dashes': { ('$help_string', $default_value_generator_thunk, $value_checker_thunk) } options = { - 'architecture': ('Image target architecture (amd64 or i586)', lambda: 'amd64', lambda x: x in ['amd64', 'i586']), + 'architecture': ('Image target architecture (amd64 or i586 or armhf)', lambda: 'amd64', lambda x: x in ['amd64', 'i586', 'armhf']), 'build-by': ('Builder identifier (e.g. jrandomhacker@example.net)', get_default_build_by, None), 'debian-mirror': ('Debian repository mirror for ISO build', lambda: defaults.DEBIAN_MIRROR, None), 'pbuilder-debian-mirror': ('Debian repository mirror for pbuilder env bootstrap', lambda: defaults.DEBIAN_MIRROR, None), diff --git a/scripts/build-flavour b/scripts/build-flavour index 389be980..c14f5735 100755 --- a/scripts/build-flavour +++ b/scripts/build-flavour @@ -30,3 +30,8 @@ fi if [ $BUILD_ARCH = 'amd64' -o $BUILD_ARCH = 'i686' ]; then cp data/package-lists/vyos-x86.list.chroot build/config/package-lists/ fi + +# Install grub-efi-arm if it's an arm build +if [ $BUILD_ARCH = 'armhf' -o $BUILD_ARCH = 'armel' -o $BUILD_ARCH = 'arm' ]; then + cp data/package-lists/vyos-arm.list.chroot build/config/package-lists/ +fi diff --git a/tools/armada-388-clearfog.dtb b/tools/armada-388-clearfog.dtb new file mode 100755 index 00000000..71d28b83 Binary files /dev/null and b/tools/armada-388-clearfog.dtb differ diff --git a/tools/u-boot-spl.kwb b/tools/u-boot-spl.kwb new file mode 100644 index 00000000..b7dd4c8d Binary files /dev/null and b/tools/u-boot-spl.kwb differ -- cgit v1.2.3 From 02a1ef1574a47861b57da8620bfd10d647050e23 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Tue, 24 May 2016 11:14:46 +0000 Subject: update clearfog script name add x86 specific packages to vyos-x86.list.chroot --- Makefile | 2 +- data/package-lists/vyos-x86.list.chroot | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 44e3c139..8889604d 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ clearfog: clean prepare @set -e @echo "It's not like I'm building this specially for you or anything!" cd $(build_dir) - @../scripts/build-clearfog-legacy + @../scripts/build-clearfog-image .PHONY: clean .ONESHELL: diff --git a/data/package-lists/vyos-x86.list.chroot b/data/package-lists/vyos-x86.list.chroot index c20456df..cfd318ca 100644 --- a/data/package-lists/vyos-x86.list.chroot +++ b/data/package-lists/vyos-x86.list.chroot @@ -1 +1,3 @@ +grub2 grub-pc +open-vm-tools -- cgit v1.2.3 From c0f9ea3210ed22b23ed784f8263bdb49bf36a765 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 5 Aug 2016 08:43:08 +0200 Subject: set systemd tasks verbose on boot --- .../includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry | 8 ++++---- scripts/build-clearfog-image | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry b/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry index 4107e459..fa02be5b 100644 --- a/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry +++ b/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry @@ -1,20 +1,20 @@ menuentry "VyOS (KVM console)" { - linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=ttyS0,9600 console=tty0 + linux /boot//vmlinuz boot=live quiet systemd.show_status=1 vyos-union=/boot/ console=ttyS0,9600 console=tty0 initrd /boot//initrd.img } menuentry "VyOS (Serial console)" { - linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=tty0 console=ttyS0,9600 + linux /boot//vmlinuz boot=live quiet systemd.show_status=1 vyos-union=/boot/ console=tty0 console=ttyS0,9600 initrd /boot//initrd.img } menuentry "Lost password change (KVM console)" { - linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=ttyS0,9600 console=tty0 init=/opt/vyatta/sbin/standalone_root_pw_reset + linux /boot//vmlinuz boot=live quiet systemd.show_status=1 vyos-union=/boot/ console=ttyS0,9600 console=tty0 init=/opt/vyatta/sbin/standalone_root_pw_reset initrd /boot//initrd.img } menuentry "Lost password change (Serial console)" { - linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=tty0 console=ttyS0,9600 init=/opt/vyatta/sbin/standalone_root_pw_reset + linux /boot//vmlinuz boot=live quiet systemd.show_status=1 vyos-union=/boot/ console=tty0 console=ttyS0,9600 init=/opt/vyatta/sbin/standalone_root_pw_reset initrd /boot//initrd.img } diff --git a/scripts/build-clearfog-image b/scripts/build-clearfog-image index 30bc1cb4..df703d8c 100755 --- a/scripts/build-clearfog-image +++ b/scripts/build-clearfog-image @@ -122,12 +122,12 @@ fi menuentry "VyOS $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live quiet vyatta-union=/boot/"$version" console=ttyS0,115200n8 + linux /boot/"$version"/vmlinuz boot=live systemd.show_status=1 quiet vyatta-union=/boot/"$version" console=ttyS0,115200n8 initrd /boot/"$version"/initrd.img } menuentry "Lost password change $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live quiet vyatta-union=/boot/"$version" console=ttyS0,115200n8 init=/opt/vyatta/sbin/standalone_root_pw_reset + linux /boot/"$version"/vmlinuz boot=live quiet systemd.show_status=1 vyatta-union=/boot/"$version" console=ttyS0,115200n8 init=/opt/vyatta/sbin/standalone_root_pw_reset initrd /boot/"$version"/initrd.img } EOF -- cgit v1.2.3 From 1d115aa6e45112c976f70231a48d5fc76be7b7fa Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 5 Aug 2016 13:49:50 +0200 Subject: prevent systemd from doing a clear screen before login prompt --- .../etc/systemd/system/getty@tty1.service.d/noclear.conf | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/live-build-config/includes.chroot/etc/systemd/system/getty@tty1.service.d/noclear.conf diff --git a/data/live-build-config/includes.chroot/etc/systemd/system/getty@tty1.service.d/noclear.conf b/data/live-build-config/includes.chroot/etc/systemd/system/getty@tty1.service.d/noclear.conf new file mode 100644 index 00000000..52671c75 --- /dev/null +++ b/data/live-build-config/includes.chroot/etc/systemd/system/getty@tty1.service.d/noclear.conf @@ -0,0 +1,2 @@ +[Service] +TTYVTDisallocate=no -- cgit v1.2.3 From 235d5b22a8368aee4696b1b2c84d702bf326a084 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Thu, 1 Sep 2016 09:56:42 +0200 Subject: T18: Regression: jessie-based VyOS doesn't disconnect the SSH session before reboot --- .../hooks/18-disable_services.chroot | 27 --------------------- .../hooks/18-enable-disable_services.chroot | 28 ++++++++++++++++++++++ .../etc/systemd/system/sshd.service | 16 ------------- .../lib/systemd/system/ssh-session-cleanup.service | 13 ++++++++++ .../usr/lib/openssh/ssh-session-cleanup | 11 +++++++++ 5 files changed, 52 insertions(+), 43 deletions(-) delete mode 100755 data/live-build-config/hooks/18-disable_services.chroot create mode 100755 data/live-build-config/hooks/18-enable-disable_services.chroot delete mode 100644 data/live-build-config/includes.chroot/etc/systemd/system/sshd.service create mode 100755 data/live-build-config/includes.chroot/lib/systemd/system/ssh-session-cleanup.service create mode 100755 data/live-build-config/includes.chroot/usr/lib/openssh/ssh-session-cleanup diff --git a/data/live-build-config/hooks/18-disable_services.chroot b/data/live-build-config/hooks/18-disable_services.chroot deleted file mode 100755 index c68a6b3d..00000000 --- a/data/live-build-config/hooks/18-disable_services.chroot +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -echo I: Disabling services. -systemctl disable exim4 -/usr/sbin/update-rc.d -f exim4 remove -systemctl disable isc-dhcp-server -/usr/sbin/update-rc.d -f isc-dhcp-server remove -systemctl disable isc-dhcp-relay -/usr/sbin/update-rc.d -f isc-dhcp-relay remove -systemctl disable nfacctd -/usr/sbin/update-rc.d -f nfacctd remove -systemctl disable pmacctd -/usr/sbin/update-rc.d -f pmacctd remove -systemctl disable sfacctd -/usr/sbin/update-rc.d -f sfacctd remove -systemctl disable uacctd -/usr/sbin/update-rc.d -f uacctd remove -systemctl disable lighttpd -/usr/sbin/update-rc.d -f lighttpd remove -systemctl disable ssh -/usr/sbin/update-rc.d -f ssh remove -systemctl disable openvpn -/usr/sbin/update-rc.d -f openvpn remove -systemctl disable dnsmasq -/usr/sbin/update-rc.d -f dnsmasq remove -systemctl disable lldpd -/usr/sbin/update-rc.d -f lldpd remove diff --git a/data/live-build-config/hooks/18-enable-disable_services.chroot b/data/live-build-config/hooks/18-enable-disable_services.chroot new file mode 100755 index 00000000..68971405 --- /dev/null +++ b/data/live-build-config/hooks/18-enable-disable_services.chroot @@ -0,0 +1,28 @@ +#!/bin/sh + +echo I: Enabling/Disabling services. +systemctl disable exim4 +/usr/sbin/update-rc.d -f exim4 remove +systemctl disable isc-dhcp-server +/usr/sbin/update-rc.d -f isc-dhcp-server remove +systemctl disable isc-dhcp-relay +/usr/sbin/update-rc.d -f isc-dhcp-relay remove +systemctl disable nfacctd +/usr/sbin/update-rc.d -f nfacctd remove +systemctl disable pmacctd +/usr/sbin/update-rc.d -f pmacctd remove +systemctl disable sfacctd +/usr/sbin/update-rc.d -f sfacctd remove +systemctl disable uacctd +/usr/sbin/update-rc.d -f uacctd remove +systemctl disable lighttpd +/usr/sbin/update-rc.d -f lighttpd remove +systemctl disable ssh +/usr/sbin/update-rc.d -f ssh remove +systemctl disable openvpn +/usr/sbin/update-rc.d -f openvpn remove +systemctl disable dnsmasq +/usr/sbin/update-rc.d -f dnsmasq remove +systemctl disable lldpd +/usr/sbin/update-rc.d -f lldpd remove +systemctl enable ssh-session-cleanup diff --git a/data/live-build-config/includes.chroot/etc/systemd/system/sshd.service b/data/live-build-config/includes.chroot/etc/systemd/system/sshd.service deleted file mode 100644 index e84142bb..00000000 --- a/data/live-build-config/includes.chroot/etc/systemd/system/sshd.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=OpenBSD Secure Shell server -After=network.target auditd.service -ConditionPathExists=!/etc/ssh/sshd_not_to_be_run - -[Service] -EnvironmentFile=-/etc/default/ssh -ExecStart=/usr/sbin/sshd -D $SSHD_OPTS -ExecReload=/bin/kill -HUP $MAINPID -ExecStop=/usr/bin/killall sshd -KillMode=process -Restart=on-failure - -[Install] -WantedBy=multi-user.target -Alias=sshd.service diff --git a/data/live-build-config/includes.chroot/lib/systemd/system/ssh-session-cleanup.service b/data/live-build-config/includes.chroot/lib/systemd/system/ssh-session-cleanup.service new file mode 100755 index 00000000..b8672722 --- /dev/null +++ b/data/live-build-config/includes.chroot/lib/systemd/system/ssh-session-cleanup.service @@ -0,0 +1,13 @@ +[Unit] +Description=OpenBSD Secure Shell session cleanup +Wants=network.target +After=network.target + +[Service] +ExecStart=/bin/true +ExecStop=/usr/lib/openssh/ssh-session-cleanup +RemainAfterExit=yes +Type=oneshot + +[Install] +WantedBy=multi-user.target diff --git a/data/live-build-config/includes.chroot/usr/lib/openssh/ssh-session-cleanup b/data/live-build-config/includes.chroot/usr/lib/openssh/ssh-session-cleanup new file mode 100755 index 00000000..f283cc96 --- /dev/null +++ b/data/live-build-config/includes.chroot/usr/lib/openssh/ssh-session-cleanup @@ -0,0 +1,11 @@ +#! /bin/sh + +ssh_session_pattern='sshd: \S.*@pts/[0-9]+' + +IFS="$IFS@" +pgrep -a -f "$ssh_session_pattern" | while read pid daemon user pty; do + echo "Found ${daemon%:} session $pid on $pty; sending SIGTERM" + kill "$pid" || true +done + +exit 0 -- cgit v1.2.3 From ae3572f2a55278f24fc47f17bd687eb8109585db Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Thu, 1 Sep 2016 10:29:31 +0200 Subject: ssh-session-cleanup.service should not executable --- .../includes.chroot/lib/systemd/system/ssh-session-cleanup.service | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 data/live-build-config/includes.chroot/lib/systemd/system/ssh-session-cleanup.service diff --git a/data/live-build-config/includes.chroot/lib/systemd/system/ssh-session-cleanup.service b/data/live-build-config/includes.chroot/lib/systemd/system/ssh-session-cleanup.service old mode 100755 new mode 100644 -- cgit v1.2.3 From a5d297e1ba627b726ee7dd9237d7141561eefdab Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Thu, 1 Sep 2016 13:53:08 +0200 Subject: stop accepting locale on the server --- data/live-build-config/hooks/04-locale.chroot | 1 + 1 file changed, 1 insertion(+) diff --git a/data/live-build-config/hooks/04-locale.chroot b/data/live-build-config/hooks/04-locale.chroot index 1c02db02..89a5f954 100755 --- a/data/live-build-config/hooks/04-locale.chroot +++ b/data/live-build-config/hooks/04-locale.chroot @@ -6,3 +6,4 @@ LANG=en_US.UTF-8 LC_ALL=C EOF +sed -i 's/AcceptEnv LANG LC_\*/# AcceptEnv LANG LC_\*/g' /etc/ssh/sshd_config -- cgit v1.2.3 From 5f83afa7815e866c9539feb1a58269d4555e33fc Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 2 Sep 2016 08:08:32 +0000 Subject: update kernel version to 4.4.15 update files needed for clearfog build --- scripts/live-build-config | 2 +- tools/armada-388-clearfog.dtb | Bin 18814 -> 19429 bytes tools/u-boot-spl.kwb | Bin 550316 -> 557788 bytes 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/live-build-config b/scripts/live-build-config index 52660571..7c51744c 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -36,7 +36,7 @@ lb config noauto \ --architectures {{architecture}} \ --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay" \ --linux-flavours {{architecture}}-vyos \ - --linux-packages linux-image-4.4.5 \ + --linux-packages linux-image-4.4.15 \ --bootloader syslinux \ --binary-images iso-hybrid \ --debian-installer false \ diff --git a/tools/armada-388-clearfog.dtb b/tools/armada-388-clearfog.dtb index 71d28b83..cc25d96f 100755 Binary files a/tools/armada-388-clearfog.dtb and b/tools/armada-388-clearfog.dtb differ diff --git a/tools/u-boot-spl.kwb b/tools/u-boot-spl.kwb index b7dd4c8d..1ea4d759 100644 Binary files a/tools/u-boot-spl.kwb and b/tools/u-boot-spl.kwb differ -- cgit v1.2.3 From 146a2390cf6dad358f861c656e76b145c8ea373b Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Thu, 15 Sep 2016 10:14:43 +0200 Subject: T152: VyOS developer builds ship with an easy-to-guess user and password --- data/live-build-config/hooks/09-live.chroot | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/live-build-config/hooks/09-live.chroot b/data/live-build-config/hooks/09-live.chroot index e2f95ff3..f19f0ae6 100755 --- a/data/live-build-config/hooks/09-live.chroot +++ b/data/live-build-config/hooks/09-live.chroot @@ -1,6 +1,11 @@ #!/bin/sh # hack live script that tries to mount ext[23] floppies as root +# remove user settings live config scripts sed -e '/ln -s "${devname}"/,/return 0/ s/^/: FIXME/' \ -i /usr/share/initramfs-tools/scripts/live + +rm -rf /lib/live/config/0030-live-debconfig_passwd +rm -rf /lib/live/config/0030-user-setup +rm -rf /lib/live/config/0040-sudo -- cgit v1.2.3 From ae66df2b8b764df7bf2b3b6d3895358012791feb Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Wed, 26 Oct 2016 14:41:26 +0900 Subject: Initial Hyper-V image --- Makefile | 7 +++++++ scripts/build-hyperv-image | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 scripts/build-hyperv-image diff --git a/Makefile b/Makefile index 8889604d..8dbb7a92 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,13 @@ vmware: @scripts/check-vm-build-env @scripts/build-vmware-image +.PHONY: hyperv +.ONESHELL: +hyperv: + @set -e + @scripts/check-vm-build-env + @scripts/build-hyperv-image + .PHONY: clearfog .ONESHELL: clearfog: clean prepare diff --git a/scripts/build-hyperv-image b/scripts/build-hyperv-image new file mode 100755 index 00000000..40c0c828 --- /dev/null +++ b/scripts/build-hyperv-image @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Copyright (C) 2016 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: build-hyperv-image +# Purpose: +# Build VyOS image for Hyper-V. + +export PACKER_BUILD_DIR=packer_build + +DST_DIR=${PACKER_BUILD_DIR}/hyperv +mkdir -p ${DST_DIR} + +# Convert raw image to VHD +source_image=${PACKER_BUILD_DIR}/qemu/vyos_qemu_image.img +vhd=${DST_DIR}/vyos_hyperv_image.vhd +qemu-img convert -f raw ${source_image} -O vpc ${vhd} +if [ "$?" = "0" ]; then + echo "Hyper-V image successfully created to ./${vhd}" +fi -- cgit v1.2.3 From e119d44d2bc5b0fc8daa7a208199ad9448427af7 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 21 Dec 2016 22:24:54 +0100 Subject: T229: automatically import locally build .deb's from packages/ at build time. Made it a separate script, if we ever need anything fancier than cp *.deb If not, we can move it to the makefile. --- Makefile | 1 + scripts/import-local-packages | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100755 scripts/import-local-packages diff --git a/Makefile b/Makefile index 8889604d..9d9576de 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ prepare: rm -rf build/config/* @scripts/live-build-config cp -r data/live-build-config/* build/config/ + @scripts/import-local-packages @scripts/make-version-file diff --git a/scripts/import-local-packages b/scripts/import-local-packages new file mode 100755 index 00000000..be8e1688 --- /dev/null +++ b/scripts/import-local-packages @@ -0,0 +1,6 @@ +#!/bin/sh + +LOCAL_PKG_DIR=build/config/packages.chroot + +mkdir -p $LOCAL_PKG_DIR +cp packages/*.deb $LOCAL_PKG_DIR -- cgit v1.2.3 From 53a878bb2d18a450f4096403d80461dd566ef29e Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 21 Dec 2016 22:28:17 +0100 Subject: lb-config improvements: force firmware packages to be added to the image, and make security mirror configurable. XXX: need to find out how to make --security work too. --- data/live-build-config/archives/vyos.list.chroot | 1 - scripts/defaults.py | 1 + scripts/live-build-config | 4 +++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data/live-build-config/archives/vyos.list.chroot b/data/live-build-config/archives/vyos.list.chroot index 664b408c..2b117386 100644 --- a/data/live-build-config/archives/vyos.list.chroot +++ b/data/live-build-config/archives/vyos.list.chroot @@ -1,2 +1 @@ deb http://dev.packages.vyos.net/vyos current main -deb http://security.debian.org/ jessie/updates main diff --git a/scripts/defaults.py b/scripts/defaults.py index b9a3f255..0792d6b2 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -23,6 +23,7 @@ BUILD_CONFIG = os.path.join(BUILD_DIR, 'build-config.json') # The default mirror was chosen entirely at random DEBIAN_MIRROR = 'http://ftp.nl.debian.org/debian/' +DEBIAN_SECURITY_MIRROR = 'http://security.debian.org/' DEBIAN_DISTRIBUTION = 'jessie' diff --git a/scripts/live-build-config b/scripts/live-build-config index 52660571..6ac49bd7 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -49,7 +49,9 @@ lb config noauto \ --mirror-chroot {{debian_mirror}} \ --mirror-chroot-security {{debian_mirror}} \ --mirror-binary {{debian_mirror}} \ - --mirror-binary-security {{debian_mirror}} + --mirror-binary-security {{debian_security_mirror}} \ + --archive-areas "main contrib non-free" \ + --firmware-chroot true "${@}" """ -- cgit v1.2.3 From 4669994866d4e6ce0af2b71ba7eb0c5aba42ab4d Mon Sep 17 00:00:00 2001 From: Kim Date: Sat, 24 Dec 2016 15:48:19 +0100 Subject: fix mount issue vyatta-router init script greps on vyos-union instead of vyatta-union --- scripts/build-clearfog-image | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build-clearfog-image b/scripts/build-clearfog-image index df703d8c..143ef9cb 100755 --- a/scripts/build-clearfog-image +++ b/scripts/build-clearfog-image @@ -122,12 +122,12 @@ fi menuentry "VyOS $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live systemd.show_status=1 quiet vyatta-union=/boot/"$version" console=ttyS0,115200n8 + linux /boot/"$version"/vmlinuz boot=live systemd.show_status=1 quiet vyos-union=/boot/"$version" console=ttyS0,115200n8 initrd /boot/"$version"/initrd.img } menuentry "Lost password change $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live quiet systemd.show_status=1 vyatta-union=/boot/"$version" console=ttyS0,115200n8 init=/opt/vyatta/sbin/standalone_root_pw_reset + linux /boot/"$version"/vmlinuz boot=live quiet systemd.show_status=1 vyos-union=/boot/"$version" console=ttyS0,115200n8 init=/opt/vyatta/sbin/standalone_root_pw_reset initrd /boot/"$version"/initrd.img } EOF -- cgit v1.2.3 From 3898def2f7d734098c62d0e2ad204a1b9acf50e0 Mon Sep 17 00:00:00 2001 From: Kim Date: Mon, 26 Dec 2016 14:01:40 +0100 Subject: make loop so it does not error if no files exist --- scripts/import-local-packages | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/import-local-packages b/scripts/import-local-packages index be8e1688..ae9a9f5c 100755 --- a/scripts/import-local-packages +++ b/scripts/import-local-packages @@ -3,4 +3,9 @@ LOCAL_PKG_DIR=build/config/packages.chroot mkdir -p $LOCAL_PKG_DIR -cp packages/*.deb $LOCAL_PKG_DIR + +FILES=packages/*.deb +for f in $FILES +do + cp $f $LOCAL_PKG_DIR +done -- cgit v1.2.3 From 390b668f2b80bb17fa93a5eb998305bbdd1b5b04 Mon Sep 17 00:00:00 2001 From: Kim Date: Mon, 26 Dec 2016 14:20:26 +0100 Subject: include check if file exists --- scripts/import-local-packages | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/import-local-packages b/scripts/import-local-packages index ae9a9f5c..70b4c365 100755 --- a/scripts/import-local-packages +++ b/scripts/import-local-packages @@ -7,5 +7,7 @@ mkdir -p $LOCAL_PKG_DIR FILES=packages/*.deb for f in $FILES do - cp $f $LOCAL_PKG_DIR + if [ -e "$f" ]; then + cp $f $LOCAL_PKG_DIR + fi done -- cgit v1.2.3 From 96c32fbb6a5ffe9835100c38629bb068e224790f Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 26 Dec 2016 15:14:38 +0000 Subject: boot systemd verbose through systemd config file --- data/live-build-config/hooks/21-systemd_conf.chroot | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 data/live-build-config/hooks/21-systemd_conf.chroot diff --git a/data/live-build-config/hooks/21-systemd_conf.chroot b/data/live-build-config/hooks/21-systemd_conf.chroot new file mode 100755 index 00000000..af618a81 --- /dev/null +++ b/data/live-build-config/hooks/21-systemd_conf.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +echo I: Show systemd statuson boot. + +echo "ShowStatus=yes" >> /etc/systemd/system.conf +echo "SysVConsole=yes" >> /etc/systemd/system.conf -- cgit v1.2.3 From 5126eb75d326d3fc2f1c769e1815fbd244222ba4 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 26 Dec 2016 15:20:45 +0000 Subject: remove verbose systemd status setting from grub --- .../includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry | 8 ++++---- scripts/build-clearfog-image | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry b/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry index fa02be5b..4107e459 100644 --- a/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry +++ b/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry @@ -1,20 +1,20 @@ menuentry "VyOS (KVM console)" { - linux /boot//vmlinuz boot=live quiet systemd.show_status=1 vyos-union=/boot/ console=ttyS0,9600 console=tty0 + linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=ttyS0,9600 console=tty0 initrd /boot//initrd.img } menuentry "VyOS (Serial console)" { - linux /boot//vmlinuz boot=live quiet systemd.show_status=1 vyos-union=/boot/ console=tty0 console=ttyS0,9600 + linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=tty0 console=ttyS0,9600 initrd /boot//initrd.img } menuentry "Lost password change (KVM console)" { - linux /boot//vmlinuz boot=live quiet systemd.show_status=1 vyos-union=/boot/ console=ttyS0,9600 console=tty0 init=/opt/vyatta/sbin/standalone_root_pw_reset + linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=ttyS0,9600 console=tty0 init=/opt/vyatta/sbin/standalone_root_pw_reset initrd /boot//initrd.img } menuentry "Lost password change (Serial console)" { - linux /boot//vmlinuz boot=live quiet systemd.show_status=1 vyos-union=/boot/ console=tty0 console=ttyS0,9600 init=/opt/vyatta/sbin/standalone_root_pw_reset + linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=tty0 console=ttyS0,9600 init=/opt/vyatta/sbin/standalone_root_pw_reset initrd /boot//initrd.img } diff --git a/scripts/build-clearfog-image b/scripts/build-clearfog-image index 143ef9cb..0ef6d323 100755 --- a/scripts/build-clearfog-image +++ b/scripts/build-clearfog-image @@ -122,12 +122,12 @@ fi menuentry "VyOS $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live systemd.show_status=1 quiet vyos-union=/boot/"$version" console=ttyS0,115200n8 + linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=ttyS0,115200n8 initrd /boot/"$version"/initrd.img } menuentry "Lost password change $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live quiet systemd.show_status=1 vyos-union=/boot/"$version" console=ttyS0,115200n8 init=/opt/vyatta/sbin/standalone_root_pw_reset + linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=ttyS0,115200n8 init=/opt/vyatta/sbin/standalone_root_pw_reset initrd /boot/"$version"/initrd.img } EOF -- cgit v1.2.3 From 52a3899311e92d74dd8bc5caabb095b695223f2c Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 26 Dec 2016 15:58:30 +0000 Subject: run vyatta-router service before getty service --- .../includes.chroot/etc/systemd/system/getty@.service.d/aftervyos.conf | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/live-build-config/includes.chroot/etc/systemd/system/getty@.service.d/aftervyos.conf diff --git a/data/live-build-config/includes.chroot/etc/systemd/system/getty@.service.d/aftervyos.conf b/data/live-build-config/includes.chroot/etc/systemd/system/getty@.service.d/aftervyos.conf new file mode 100644 index 00000000..7eee7bd3 --- /dev/null +++ b/data/live-build-config/includes.chroot/etc/systemd/system/getty@.service.d/aftervyos.conf @@ -0,0 +1,2 @@ +[Unit] +After=vyatta-router.service -- cgit v1.2.3 From edded1d73f8c5a9cf905d35ac22d6cbe74926c18 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 28 Dec 2016 00:28:07 +0100 Subject: Add an optin for debian security mirror. --- scripts/build-config | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build-config b/scripts/build-config index c5d1ab5f..d273717f 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -49,6 +49,7 @@ options = { 'architecture': ('Image target architecture (amd64 or i586 or armhf)', lambda: 'amd64', lambda x: x in ['amd64', 'i586', 'armhf']), 'build-by': ('Builder identifier (e.g. jrandomhacker@example.net)', get_default_build_by, None), 'debian-mirror': ('Debian repository mirror for ISO build', lambda: defaults.DEBIAN_MIRROR, None), + 'debian-security-mirror': ('Debian security updated mirror', lambda: defaults.DEBIAN_SECURITY_MIRROR, None), 'pbuilder-debian-mirror': ('Debian repository mirror for pbuilder env bootstrap', lambda: defaults.DEBIAN_MIRROR, None), 'build-type': ('Build type, release or development', lambda: 'development', lambda x: x in ['release', 'development']), 'version': ('Version number (release builds only)', None, None) -- cgit v1.2.3 From 30028aa5718f2160c7f218ffd39db214cf864adb Mon Sep 17 00:00:00 2001 From: Jason Hendry Date: Fri, 6 Jan 2017 11:54:00 +0000 Subject: Fixing required package list --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 32b44a98..11edb5fb 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ There are several directories with their own purpose: To build a VyOS image, you need a machine that runs Debian Jessie. Other build hosts are not supported. -Several packages are required for building the ISO and all packages, namely live-build, pbuilder, and dev-scripts. +Several packages are required for building the ISO and all packages, namely live-build, pbuilder, python-pystache and devscripts. Individual packages may have other build dependencies. If some packages are missing, build scripts will tell you. ## Building the ISO image -- cgit v1.2.3 From ea48b7bd747df4ae5c8ee64c72cdc67e31ddcd5a Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 25 Jan 2017 17:01:16 -0500 Subject: Switch all build scripts to python3. Since we only support jessie as build host, and jessie knowingly does have python3 (although not by default), we don't really need to worry about being both 2 and 3 compatible. --- README.md | 2 +- scripts/build-config | 3 ++- scripts/check-build-env | 4 ++-- scripts/check-config | 2 +- scripts/check-vm-build-env | 2 +- scripts/live-build-config | 2 +- scripts/make-version-file | 4 ++-- scripts/pbuilder-setup | 3 +-- scripts/query-json | 5 +++-- 9 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 11edb5fb..0d6e53c2 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ There are several directories with their own purpose: To build a VyOS image, you need a machine that runs Debian Jessie. Other build hosts are not supported. -Several packages are required for building the ISO and all packages, namely live-build, pbuilder, python-pystache and devscripts. +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. ## Building the ISO image diff --git a/scripts/build-config b/scripts/build-config index d273717f..9ea92e1f 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright (C) 2015 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify diff --git a/scripts/check-build-env b/scripts/check-build-env index 6dcf885b..7f02c02a 100755 --- a/scripts/check-build-env +++ b/scripts/check-build-env @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2015 VyOS maintainers and contributors # @@ -32,7 +32,7 @@ deps = { 'live-build', 'pbuilder', 'devscripts', - 'python-pystache' + 'python3-pystache' ], 'binaries': [] } diff --git a/scripts/check-config b/scripts/check-config index 55d5467a..d2236619 100755 --- a/scripts/check-config +++ b/scripts/check-config @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2015 VyOS maintainers and contributors # diff --git a/scripts/check-vm-build-env b/scripts/check-vm-build-env index c32f2b13..8efab848 100755 --- a/scripts/check-vm-build-env +++ b/scripts/check-vm-build-env @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2016 VyOS maintainers and contributors # diff --git a/scripts/live-build-config b/scripts/live-build-config index cb9e84dc..2e2d4704 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2015 VyOS maintainers and contributors # diff --git a/scripts/make-version-file b/scripts/make-version-file index 6c597090..3bb33319 100755 --- a/scripts/make-version-file +++ b/scripts/make-version-file @@ -1,4 +1,5 @@ -#!/usr/bin/python +#!/usr/bin/python3 +# # Copyright (C) 2016 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify @@ -19,7 +20,6 @@ # that is included in the image and used by 'show version' command # and install/upgrade scripts. -from __future__ import print_function import os import datetime import json diff --git a/scripts/pbuilder-setup b/scripts/pbuilder-setup index fbd49a4f..a89348b8 100755 --- a/scripts/pbuilder-setup +++ b/scripts/pbuilder-setup @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2015 VyOS maintainers and contributors # @@ -50,4 +50,3 @@ result = os.system(pbuilder_create_command) if result > 0: print("pbuilder environment bootstrap failed") sys.exit(1) - diff --git a/scripts/query-json b/scripts/query-json index 23e64ef7..2f1ea32f 100755 --- a/scripts/query-json +++ b/scripts/query-json @@ -1,4 +1,5 @@ -#!/usr/bin/python +#!/usr/bin/python3 +# # Copyright (C) 2016 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify @@ -14,7 +15,7 @@ # along with this program. If not, see . # # File: query-config -# Purpose: Extracts field values a flat JSON file, +# Purpose: Extracts field values from a flat JSON file, # for use in languages that can't handle JSON easily, # (I'm looking at you, Bourne shell!) -- cgit v1.2.3 From 607dcde9bce70b17fbd24df7d441e6a1924983e9 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 26 Jan 2017 21:27:12 -0500 Subject: Account for different architectures in ISO naming. --- Makefile | 3 ++- scripts/build-qemu-image | 5 ++++- scripts/copy-image | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100755 scripts/copy-image diff --git a/Makefile b/Makefile index 501ab041..088a3474 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,8 @@ iso: clean prepare @echo "It's not like I'm building this specially for you or anything!" cd $(build_dir) lb build 2>&1 | tee build.log - ln -nsf live-image-amd64.hybrid.iso vyos-`cat version`-`dpkg --print-architecture`.iso + cd .. + @scripts/copy-image .PHONY: prepare-package-env .ONESHELL: diff --git a/scripts/build-qemu-image b/scripts/build-qemu-image index 4a67f0f3..59a42f07 100755 --- a/scripts/build-qemu-image +++ b/scripts/build-qemu-image @@ -18,8 +18,11 @@ # Purpose: # Build VyOS raw image for qemu. +BUILD_DIR=$(scripts/query-json build/build-config.json build_dir) +BUILD_ARCH=$(scripts/query-json build/build-config.json architecture) +VERSION=$(cat $BUILD_DIR/version) -export ISO_IMAGE=./build/live-image-amd64.hybrid.iso +export ISO_IMAGE=./build/live-image-$BUILD_ARCH.hybrid.iso export ISO_MD5_SUM=$(md5sum ${ISO_IMAGE} | awk '{print $1}') export PACKER_BUILD_DIR=packer_build export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build.log diff --git a/scripts/copy-image b/scripts/copy-image new file mode 100755 index 00000000..01af511d --- /dev/null +++ b/scripts/copy-image @@ -0,0 +1,7 @@ +#!/bin/sh + +BUILD_DIR=$(scripts/query-json build/build-config.json build_dir) +BUILD_ARCH=$(scripts/query-json build/build-config.json architecture) +VERSION=$(cat $BUILD_DIR/version) + +ln -nsf $BUILD_DIR/live-image-$BUILD_ARCH.hybrid.iso $BUILD_DIR/vyos-$VERSION-$BUILD_ARCH.iso -- cgit v1.2.3 From 15264679e2464f215193a49e66fab812680ce33c Mon Sep 17 00:00:00 2001 From: Kim Date: Mon, 6 Feb 2017 17:31:43 +0100 Subject: update kernel version in live-build-config script --- scripts/live-build-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/live-build-config b/scripts/live-build-config index 2e2d4704..e0acb59b 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -36,7 +36,7 @@ lb config noauto \ --architectures {{architecture}} \ --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay" \ --linux-flavours {{architecture}}-vyos \ - --linux-packages linux-image-4.4.15 \ + --linux-packages linux-image-4.4.47 \ --bootloader syslinux \ --binary-images iso-hybrid \ --debian-installer false \ -- cgit v1.2.3 From 37740050b734853efcbcef1b0ab24e2565029f49 Mon Sep 17 00:00:00 2001 From: Hannes Kindstrƶmmer Date: Fri, 5 May 2017 14:33:06 +0200 Subject: Change website URL to .io Change ````http://vyos.net``` to ```https://vyos.io``` since the .net domain is redirecting to .io domain. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d6e53c2..a0d9ff73 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ For building stable release images, refer to the vyos/build-iso repository. # What is VyOS VyOS is an open source operating system for network devices (routers, firewalls and so on). -If you want to use it in your network, check out download and installation instructions at http://vyos.net +If you want to use it in your network, check out download and installation instructions at https://vyos.io If you want to modify VyOS and/or join its development, read on. -- cgit v1.2.3 From 658cb7c310f06316649ca82624366d45afe26207 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 6 May 2017 09:39:40 -0400 Subject: Update the README. 1.2.0 isn't so experimental anymore. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a0d9ff73..2b1f5a12 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,9 @@ VyOS toplevel build # WARNING -This is repository is for the ongoing work on porting VyOS to Debian Jessie. It is not yet ready to use. -For building stable release images, refer to the vyos/build-iso repository. +This repository is for building the VyOS version that is to become 1.2.0 and that is currently in beta testing. +For 1.1.x, use the build-iso repository. + # What is VyOS -- cgit v1.2.3 From 988f4c6e3c1c367d8adc8b2f14b59e89cb5ec2ce Mon Sep 17 00:00:00 2001 From: Kim Date: Fri, 12 May 2017 18:06:09 +0200 Subject: Unknown lvalue 'SysVConsole' --- data/live-build-config/hooks/21-systemd_conf.chroot | 1 - 1 file changed, 1 deletion(-) diff --git a/data/live-build-config/hooks/21-systemd_conf.chroot b/data/live-build-config/hooks/21-systemd_conf.chroot index af618a81..541fdf11 100755 --- a/data/live-build-config/hooks/21-systemd_conf.chroot +++ b/data/live-build-config/hooks/21-systemd_conf.chroot @@ -3,4 +3,3 @@ echo I: Show systemd statuson boot. echo "ShowStatus=yes" >> /etc/systemd/system.conf -echo "SysVConsole=yes" >> /etc/systemd/system.conf -- cgit v1.2.3 From ec208d8eb6a3a746d1a1a5c361f6cdb5474fdd35 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Sun, 23 Jul 2017 13:46:49 +0900 Subject: Remove accelerator from packer template When no accelerator is specified, Packer will try to use kvm if it is available but will default to tcg otherwise. See https://www.packer.io/docs/builders/qemu.html#accelerator --- scripts/packer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/packer.json b/scripts/packer.json index b09b9834..83df10c5 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -17,7 +17,6 @@ "disk_size": 4096, "format": "raw", "headless": true, - "accelerator": "tcg", "ssh_host_port_min": 2222, "ssh_host_port_max": 2229, "ssh_username": "vyos", -- cgit v1.2.3 From bff1f61f47f228fbd8eae18586667779ccb27a31 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Fri, 28 Jul 2017 23:17:42 +0900 Subject: Add script for building Vagrant libvirt box --- scripts/Vagrantfile | 12 ++++++++++++ scripts/build-qemu-image | 2 +- scripts/build-vmware-image | 4 ++-- scripts/packer.json | 27 +++++++++++++++++++++++++-- 4 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 scripts/Vagrantfile diff --git a/scripts/Vagrantfile b/scripts/Vagrantfile new file mode 100644 index 00000000..7c89422d --- /dev/null +++ b/scripts/Vagrantfile @@ -0,0 +1,12 @@ +Vagrant.configure("2") do |config| + config.vm.synced_folder './', '/vagrant', + type: "rsync", + owner: 'vyos', + group: 'users', + mount_options: ['dmode=775,fmode=775'] + config.ssh.username = "vyos" + config.ssh.password = "vyos" + config.vm.provider :libvirt do |libvirt| + libvirt.driver = "kvm" + end +end diff --git a/scripts/build-qemu-image b/scripts/build-qemu-image index 59a42f07..29cb6cf1 100755 --- a/scripts/build-qemu-image +++ b/scripts/build-qemu-image @@ -20,7 +20,7 @@ BUILD_DIR=$(scripts/query-json build/build-config.json build_dir) BUILD_ARCH=$(scripts/query-json build/build-config.json architecture) -VERSION=$(cat $BUILD_DIR/version) +export VERSION=$(cat $BUILD_DIR/version) export ISO_IMAGE=./build/live-image-$BUILD_ARCH.hybrid.iso export ISO_MD5_SUM=$(md5sum ${ISO_IMAGE} | awk '{print $1}') diff --git a/scripts/build-vmware-image b/scripts/build-vmware-image index e665e0b5..1730d7a3 100755 --- a/scripts/build-vmware-image +++ b/scripts/build-vmware-image @@ -37,12 +37,12 @@ export PACKER_BUILD_DIR=packer_build DST_DIR=${PACKER_BUILD_DIR}/vmware mkdir -p ${DST_DIR} -# Convert raw image to VMDK +# Convert qcow2 image to VMDK source_image=${PACKER_BUILD_DIR}/qemu/vyos_qemu_image.img tmp_vmdk=${DST_DIR}/tmp.vmdk vmdk=${DST_DIR}/vyos_vmware_image.vmdk ovf=${DST_DIR}/vyos_vmware_image.ovf -qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} +qemu-img convert -f qcow2 ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} vmdk-convert ${tmp_vmdk} ${vmdk} # Generate OVF diff --git a/scripts/packer.json b/scripts/packer.json index 83df10c5..39ab423b 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -2,7 +2,11 @@ "variables": { "iso_url": "{{env `ISO_IMAGE`}}", "iso_checksum": "{{env `ISO_MD5_SUM`}}", - "output_directory": "{{env `PACKER_BUILD_DIR`}}" + "output_directory": "{{env `PACKER_BUILD_DIR`}}", + "box_tag": "{{env `VAGRANT_BOX_NAME`}}", + "cloud_token": "{{env `VAGRANT_CLOUD_ACCESS_TOKEN`}}", + "version": "{{env `VERSION`}}", + "box_base_url": "{{env `BOX_BASE_URL`}}" }, "builders": [ @@ -15,7 +19,7 @@ "output_directory": "{{user `output_directory`}}/qemu", "shutdown_command": "sudo halt -p", "disk_size": 4096, - "format": "raw", + "format": "qcow2", "headless": true, "ssh_host_port_min": 2222, "ssh_host_port_max": 2229, @@ -90,5 +94,24 @@ "scripts/packer-scripts/vmware.sh" ] } + ], + "post-processors": [ + [ + { + "type": "vagrant", + "only": ["qemu-image"], + "vagrantfile_template": "scripts/Vagrantfile", + "output": "{{user `output_directory`}}/vagrant-libvirt/vyos_vagrant_libvirt.box", + "keep_input_artifact": "true" + }, + { + "type": "vagrant-cloud", + "only": ["qemu-image"], + "box_tag": "{{user `box_tag`}}", + "access_token": "{{user `cloud_token`}}", + "version": "{{user `version`}}", + "box_download_url": "{{user `box_base_url`}}/vyos-{{user `version`}}-vagrant-libvirt.box" + } + ] ] } -- cgit v1.2.3 From 795546f923b900cb8dd6594972ab183e7447917b Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Sat, 29 Jul 2017 01:48:20 +0900 Subject: Fix packer.json --- scripts/packer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/packer.json b/scripts/packer.json index 39ab423b..30bd2fb7 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -102,7 +102,7 @@ "only": ["qemu-image"], "vagrantfile_template": "scripts/Vagrantfile", "output": "{{user `output_directory`}}/vagrant-libvirt/vyos_vagrant_libvirt.box", - "keep_input_artifact": "true" + "keep_input_artifact": true }, { "type": "vagrant-cloud", -- cgit v1.2.3 From 822747f4de0274e366452c594c1a65562740a4f1 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Sat, 29 Jul 2017 15:30:57 +0900 Subject: Add vagrant-libvirt make target --- Makefile | 7 ++++ scripts/build-vagrant-libvirt-box | 69 +++++++++++++++++++++++++++++++++++++++ scripts/packer.json | 57 +------------------------------- 3 files changed, 77 insertions(+), 56 deletions(-) create mode 100755 scripts/build-vagrant-libvirt-box diff --git a/Makefile b/Makefile index 088a3474..d3c1beec 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,13 @@ qemu: @scripts/check-vm-build-env @scripts/build-qemu-image +.PHONY: vagrant-libvirt +.ONESHELL: +vagrant-libvirt: + @set -e + @scripts/check-vm-build-env + @scripts/build-vagrant-libvirt-box + .PHONY: vmware .ONESHELL: vmware: diff --git a/scripts/build-vagrant-libvirt-box b/scripts/build-vagrant-libvirt-box new file mode 100755 index 00000000..5cb0b041 --- /dev/null +++ b/scripts/build-vagrant-libvirt-box @@ -0,0 +1,69 @@ +#!/bin/sh +# +# Copyright (C) 2016 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: build-vagrant-libvirt-box +# Purpose: +# Build VyOS Vagrant libvirt box. + +export PACKER_BUILD_DIR=packer_build + +DST_DIR=${PACKER_BUILD_DIR}/vagrant-libvirt +BOX_DIR=${DST_DIR}/box +mkdir -p ${BOX_DIR} + +# Copy qcow2 image +cp -p packer_build/qemu/vyos_qemu_image.img ${BOX_DIR}/box.img + +# Put metadata.json and Vagrantfile +echo '{"format":"qcow2","provider":"libvirt","virtual_size":4}' > ${BOX_DIR}/metadata.json +cat < ${BOX_DIR}/Vagrantfile +Vagrant.configure("2") do |config| + config.vm.synced_folder './', '/vagrant', + type: "rsync", + owner: 'vyos', + group: 'users', + mount_options: ['dmode=775,fmode=775'] + config.ssh.username = "vyos" + config.ssh.password = "vyos" + config.vm.provider :libvirt do |libvirt| + libvirt.driver = "kvm" + end +end +EOF + +# Create box +box=${DST_DIR}/vyos_vagrant_libvirt.box +tar -C ${BOX_DIR} -czvf ${box} metadata.json Vagrantfile box.img +if [ "$?" = "0" ]; then + echo "Vagrant libvirt box successfully created to ./${box}" +fi + +PROVIDER=libvirt + +# Create version +curl -XPOST -d "version[version]=${VERSION}" \ + https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/versions?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} +echo + +# Create provider +curl -XPOST -d "provider[name]=${PROVIDER}" -d "provider[url]=${VAGRANT_BOX_BASE_URL}" \ + https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${VERSION}/providers?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} +echo + +# Release version +curl -XPUT \ + https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${VERSION}/release?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} +echo diff --git a/scripts/packer.json b/scripts/packer.json index 30bd2fb7..218b2a85 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -2,11 +2,7 @@ "variables": { "iso_url": "{{env `ISO_IMAGE`}}", "iso_checksum": "{{env `ISO_MD5_SUM`}}", - "output_directory": "{{env `PACKER_BUILD_DIR`}}", - "box_tag": "{{env `VAGRANT_BOX_NAME`}}", - "cloud_token": "{{env `VAGRANT_CLOUD_ACCESS_TOKEN`}}", - "version": "{{env `VERSION`}}", - "box_base_url": "{{env `BOX_BASE_URL`}}" + "output_directory": "{{env `PACKER_BUILD_DIR`}}" }, "builders": [ @@ -61,57 +57,6 @@ "save", "exit" ] - }, - { - "name": "vmware-image", - "type": "qemu", - "iso_url": "{{user `output_directory`}}/qemu/vyos_qemu_image.img", - "iso_checksum_type": "none", - "output_directory": "{{user `output_directory`}}/vmware", - "shutdown_command": "sudo halt -p", - "disk_image": true, - "disk_size": 4096, - "format": "raw", - "headless": true, - "accelerator": "tcg", - "ssh_host_port_min": 2222, - "ssh_host_port_max": 2229, - "ssh_username": "vyos", - "ssh_password": "vyos", - "ssh_port": 22, - "ssh_wait_timeout": "300s", - "vm_name": "vyos_vmware_image.img", - "net_device": "virtio-net", - "disk_interface": "virtio", - "boot_wait": "5s" - } - ], - "provisioners": [ - { - "type": "shell", - "only": ["vmware-image"], - "scripts": [ - "scripts/packer-scripts/vmware.sh" - ] } - ], - "post-processors": [ - [ - { - "type": "vagrant", - "only": ["qemu-image"], - "vagrantfile_template": "scripts/Vagrantfile", - "output": "{{user `output_directory`}}/vagrant-libvirt/vyos_vagrant_libvirt.box", - "keep_input_artifact": true - }, - { - "type": "vagrant-cloud", - "only": ["qemu-image"], - "box_tag": "{{user `box_tag`}}", - "access_token": "{{user `cloud_token`}}", - "version": "{{user `version`}}", - "box_download_url": "{{user `box_base_url`}}/vyos-{{user `version`}}-vagrant-libvirt.box" - } - ] ] } -- cgit v1.2.3 From 9d1d4719cf31794fedf1c9eb18e4cff741ccd22f Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Sat, 29 Jul 2017 23:34:14 +0900 Subject: Fix script for Vagrant libvirt box --- scripts/build-vagrant-libvirt-box | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-vagrant-libvirt-box b/scripts/build-vagrant-libvirt-box index 5cb0b041..7aff4eda 100755 --- a/scripts/build-vagrant-libvirt-box +++ b/scripts/build-vagrant-libvirt-box @@ -59,7 +59,7 @@ curl -XPOST -d "version[version]=${VERSION}" \ echo # Create provider -curl -XPOST -d "provider[name]=${PROVIDER}" -d "provider[url]=${VAGRANT_BOX_BASE_URL}" \ +curl -XPOST -d "provider[name]=${PROVIDER}" -d "provider[url]=${VAGRANT_BOX_BASE_URL}/vyos-${VERSION}-vagrant-${PROVIDER}.box" \ https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${VERSION}/providers?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} echo -- cgit v1.2.3 From f4518abe2e61fb8bdeeb38bd15a2bee8e603eaa1 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 17 Aug 2017 20:09:38 -0400 Subject: Add vyos-1x submodule where the rewritten code will go. --- .gitmodules | 3 +++ packages/vyos-1x | 1 + 2 files changed, 4 insertions(+) create mode 160000 packages/vyos-1x diff --git a/.gitmodules b/.gitmodules index 45e43991..d687ba52 100644 --- a/.gitmodules +++ b/.gitmodules @@ -124,3 +124,6 @@ [submodule "packages/vyos-kernel"] path = packages/vyos-kernel url = https://github.com/vyos/vyos-kernel.git +[submodule "packages/vyos-1x"] + path = packages/vyos-1x + url = https://github.com/vyos/vyos-1x.git diff --git a/packages/vyos-1x b/packages/vyos-1x new file mode 160000 index 00000000..ac6071ae --- /dev/null +++ b/packages/vyos-1x @@ -0,0 +1 @@ +Subproject commit ac6071ae85bee52793f6dc34c2b60e333149291b -- cgit v1.2.3 From ac391c82d1f0c8d380e31386472c5aec563d9e56 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 21 Aug 2017 18:49:34 -0400 Subject: T361: check the build environment setup in ./configure before it can even get to make. --- Makefile | 9 +++++---- scripts/build-config | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d3c1beec..8aa082ce 100644 --- a/Makefile +++ b/Makefile @@ -5,14 +5,15 @@ all: @echo "Make what specifically?" @echo "The most common target is 'iso'" +.PHONY: check_build_config +check_build_config: + @scripts/check-config + .PHONY: prepare prepare: @set -e @echo "Starting VyOS ISO image build" - @scripts/check-build-env - @scripts/check-config - rm -rf build/config/* @scripts/live-build-config cp -r data/live-build-config/* build/config/ @@ -24,7 +25,7 @@ prepare: .PHONY: iso .ONESHELL: -iso: clean prepare +iso: check_build_config clean prepare @set -e @echo "It's not like I'm building this specially for you or anything!" cd $(build_dir) diff --git a/scripts/build-config b/scripts/build-config index 9ea92e1f..ae8501e8 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -97,6 +97,11 @@ args['distribution'] = defaults.DEBIAN_DISTRIBUTION args['build_dir'] = os.path.join(os.getcwd(), defaults.BUILD_DIR) args['pbuilder_config'] = defaults.PBUILDER_CONFIG +# Check the build environment and dependencies +env_check_retval = os.system("scripts/check-build-env") +if env_check_retval > 0: + print("Build environment check failed, fix the issues and retry") + # Save to file distutils.dir_util.mkpath(defaults.BUILD_DIR) -- cgit v1.2.3 From 17230a2212d570bbc8620cd9cb8342034408b2df Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 27 Aug 2017 19:17:34 +0200 Subject: Add signing keys to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 889ab43d..3eff9f21 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ build/* *.pyc packer_build/* packer_cache/* +key/* -- cgit v1.2.3 From 85099b846b5746c81205a5c7befcf85d06db5930 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 27 Aug 2017 19:18:11 +0200 Subject: Add .gitignore for packages build output --- packages/.gitignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 packages/.gitignore diff --git a/packages/.gitignore b/packages/.gitignore new file mode 100644 index 00000000..ed11cabe --- /dev/null +++ b/packages/.gitignore @@ -0,0 +1,5 @@ +*.dsc +*.tar.gz +*.deb +*.build +*.changes -- cgit v1.2.3 From af449651736ce6674912ee31291265c8082b0d85 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 28 Aug 2017 23:17:41 +0200 Subject: Cleanup isolinux boot menu Remove the following nodes in isolinux boot menu: * Install (nothing happens) * Graphical Install (nothing happens) * Advanced option * HDT (file not found error) * memtest86+ (nothing happens) Users simply just want to install VyOS. If memtest is required, someone can simply just spin up a Debian/Ubuntu ISO. --- data/live-build-config/includes.binary/isolinux/menu.cfg | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 data/live-build-config/includes.binary/isolinux/menu.cfg diff --git a/data/live-build-config/includes.binary/isolinux/menu.cfg b/data/live-build-config/includes.binary/isolinux/menu.cfg new file mode 100644 index 00000000..3080bfe0 --- /dev/null +++ b/data/live-build-config/includes.binary/isolinux/menu.cfg @@ -0,0 +1,8 @@ +menu hshift 0 +menu width 82 + +menu title Boot menu +include stdmenu.cfg +include live.cfg + +menu clear -- cgit v1.2.3 From bca7d1133e7e0f55521d5bb78414ec7430a4c2a0 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 28 Aug 2017 23:54:46 +0200 Subject: Use new ISO splash screen Integrate splash.png which was designed for VyOS 1.2.x. --- .../includes.binary/isolinux/splash.png | Bin 0 -> 234763 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 data/live-build-config/includes.binary/isolinux/splash.png diff --git a/data/live-build-config/includes.binary/isolinux/splash.png b/data/live-build-config/includes.binary/isolinux/splash.png new file mode 100644 index 00000000..e2c9bfa4 Binary files /dev/null and b/data/live-build-config/includes.binary/isolinux/splash.png differ -- cgit v1.2.3 From 51e4718ed2d77fcad6448fd09814e8e3272f10b4 Mon Sep 17 00:00:00 2001 From: UnicronNL Date: Sat, 2 Sep 2017 14:06:16 +0200 Subject: Create home directory on login --- data/live-build-config/hooks/22-pam_mkhomedir.chroot | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 data/live-build-config/hooks/22-pam_mkhomedir.chroot diff --git a/data/live-build-config/hooks/22-pam_mkhomedir.chroot b/data/live-build-config/hooks/22-pam_mkhomedir.chroot new file mode 100755 index 00000000..af155ba4 --- /dev/null +++ b/data/live-build-config/hooks/22-pam_mkhomedir.chroot @@ -0,0 +1,16 @@ +#!/bin/sh + +echo I: Create home directory on login. + +cat > /usr/share/pam-configs/mkhomedir < Date: Sat, 2 Sep 2017 15:10:34 +0200 Subject: do not start conntrackd on boot --- data/live-build-config/hooks/18-enable-disable_services.chroot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/live-build-config/hooks/18-enable-disable_services.chroot b/data/live-build-config/hooks/18-enable-disable_services.chroot index 68971405..abb60241 100755 --- a/data/live-build-config/hooks/18-enable-disable_services.chroot +++ b/data/live-build-config/hooks/18-enable-disable_services.chroot @@ -26,3 +26,5 @@ systemctl disable dnsmasq systemctl disable lldpd /usr/sbin/update-rc.d -f lldpd remove systemctl enable ssh-session-cleanup +/usr/sbin/update-rc.d -f conntrackd remove +systemctl disable conntrackd -- cgit v1.2.3 From 1fa15445af2a7de8a7ff9940dc5e55f3200d2e14 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 2 Sep 2017 22:10:30 +0200 Subject: Added submodule packages/vyos-cfg-avahi --- .gitmodules | 3 +++ packages/vyos-cfg-avahi | 1 + 2 files changed, 4 insertions(+) create mode 160000 packages/vyos-cfg-avahi diff --git a/.gitmodules b/.gitmodules index d687ba52..54cc889d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -127,3 +127,6 @@ [submodule "packages/vyos-1x"] path = packages/vyos-1x url = https://github.com/vyos/vyos-1x.git +[submodule "packages/vyos-cfg-avahi"] + path = packages/vyos-cfg-avahi + url = https://github.com/c-po/vyos-cfg-avahi.git diff --git a/packages/vyos-cfg-avahi b/packages/vyos-cfg-avahi new file mode 160000 index 00000000..894e268a --- /dev/null +++ b/packages/vyos-cfg-avahi @@ -0,0 +1 @@ +Subproject commit 894e268a6d4c0cfee107ec447a09dfe0970224d1 -- cgit v1.2.3 From 0b91d4de575a02ee5952cd3c5924aa592122ef3e Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 2 Sep 2017 21:54:43 +0200 Subject: Do not start avahi-daemon on boot --- data/live-build-config/hooks/18-enable-disable_services.chroot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/live-build-config/hooks/18-enable-disable_services.chroot b/data/live-build-config/hooks/18-enable-disable_services.chroot index abb60241..b6609fa7 100755 --- a/data/live-build-config/hooks/18-enable-disable_services.chroot +++ b/data/live-build-config/hooks/18-enable-disable_services.chroot @@ -28,3 +28,5 @@ systemctl disable lldpd systemctl enable ssh-session-cleanup /usr/sbin/update-rc.d -f conntrackd remove systemctl disable conntrackd +/usr/sbin/update-rc.d -f avahi-daemon remove +systemctl disable avahi-daemon -- cgit v1.2.3 From f3ccfa85e21116192531b3d90a62c3c7f840a469 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 2 Sep 2017 23:37:43 +0200 Subject: Updated submodule packages/vyos-world Submodule packages/vyos-world 28fa090..ca1dbba: > Added vyos-cfg-avahi package > Update the changelog. > Add vyos-1x package to vyos-world. > remove grub2 and open-vm-tools packages, give trouble with building arm build > include open-vm-tools in the image (T16) > Update the changelog. > Add dependency on grub2, since it's required but we have no idea what would be a better place. --- packages/vyos-world | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vyos-world b/packages/vyos-world index 28fa0907..e590f743 160000 --- a/packages/vyos-world +++ b/packages/vyos-world @@ -1 +1 @@ -Subproject commit 28fa09078dfce814da1e6203d6dc1e6665b4e861 +Subproject commit e590f7431b3aeb56b4b8d61a490d42646b95014c -- cgit v1.2.3 From 9b2c69ada85c87ff01457ada04cd9c33ddb8be59 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 2 Sep 2017 23:41:42 +0200 Subject: Updated submodule packages/vyos-cfg-avahi packages/vyos-cfg-avahi 894e268...31448bd (2): > Adjust mdns-repeater for VyOS > Added mdns-repeater source --- packages/vyos-cfg-avahi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vyos-cfg-avahi b/packages/vyos-cfg-avahi index 894e268a..31448bde 160000 --- a/packages/vyos-cfg-avahi +++ b/packages/vyos-cfg-avahi @@ -1 +1 @@ -Subproject commit 894e268a6d4c0cfee107ec447a09dfe0970224d1 +Subproject commit 31448bde1bc3484bf62114f168749d418bf70b0d -- cgit v1.2.3 From 9341590e35036523269c67d4bf8cf51fdcb75fc7 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 3 Sep 2017 00:13:20 +0200 Subject: Added submodule packages/vyos-bcast-relay --- .gitmodules | 3 +++ packages/vyos-bcast-relay | 1 + 2 files changed, 4 insertions(+) create mode 160000 packages/vyos-bcast-relay diff --git a/.gitmodules b/.gitmodules index 54cc889d..26527065 100644 --- a/.gitmodules +++ b/.gitmodules @@ -130,3 +130,6 @@ [submodule "packages/vyos-cfg-avahi"] path = packages/vyos-cfg-avahi url = https://github.com/c-po/vyos-cfg-avahi.git +[submodule "packages/vyos-bcast-relay"] + path = packages/vyos-bcast-relay + url = https://github.com/c-po/vyos-bcast-relay.git diff --git a/packages/vyos-bcast-relay b/packages/vyos-bcast-relay new file mode 160000 index 00000000..9d8f7b4e --- /dev/null +++ b/packages/vyos-bcast-relay @@ -0,0 +1 @@ +Subproject commit 9d8f7b4e6e7e9206673c2e37d09e930958487c63 -- cgit v1.2.3 From 46a84cfc50e7350ffb608d685f5f7daa0973089e Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 3 Sep 2017 00:14:11 +0200 Subject: Updated submodule packages/vyos-world packages/vyos-world e590f74...416bee9 (1): > Added vyos-bcast-relay package --- packages/vyos-world | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vyos-world b/packages/vyos-world index e590f743..416bee9c 160000 --- a/packages/vyos-world +++ b/packages/vyos-world @@ -1 +1 @@ -Subproject commit e590f7431b3aeb56b4b8d61a490d42646b95014c +Subproject commit 416bee9c0a634f8513904f18556bb6d40e9fd2a8 -- cgit v1.2.3 From f87579bffb171fc95182b1eeebcc0c89e6fc2dbe Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Fri, 22 Sep 2017 21:48:47 +0900 Subject: Fix mirror-chroot-security option --- scripts/live-build-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/live-build-config b/scripts/live-build-config index e0acb59b..eb065cff 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -47,7 +47,7 @@ lb config noauto \ --debootstrap-options "--variant=minbase --exclude=isc-dhcp-client,isc-dhcp-common,ifupdown" \ --mirror-bootstrap {{debian_mirror}} \ --mirror-chroot {{debian_mirror}} \ - --mirror-chroot-security {{debian_mirror}} \ + --mirror-chroot-security {{debian_security_mirror}} \ --mirror-binary {{debian_mirror}} \ --mirror-binary-security {{debian_security_mirror}} \ --archive-areas "main contrib non-free" \ -- cgit v1.2.3 From 44e24298adc03073882a7517c7564fd24a01573b Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 29 Oct 2017 18:54:18 +0100 Subject: VyOS Kernel Update v4.4.95 * packages/vyos-kernel efe6504...0a84c7e (18): > Merge tag 'v4.4.95' into current > add virtio scsi to kernel as loadable module > remove Automatically generated lines > Enable intel QuickAssist Technology modules > dccp: fix freeing skb too early for IPV6_RECVPKTINFO > virtio_net: validate ethtool port setting and explain the user validation > ethtool: make validate_speed accept all speeds between 0 and INT_MAX > virtio_net: add ethtool support for set and get of settings > ethtool: add speed/duplex validation functions > add vyos x86_64 defconfig > Merge tag 'v4.4.47' into current --- packages/vyos-kernel | 2 +- scripts/live-build-config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vyos-kernel b/packages/vyos-kernel index efe65045..0a84c7e7 160000 --- a/packages/vyos-kernel +++ b/packages/vyos-kernel @@ -1 +1 @@ -Subproject commit efe65045bf8daec40d63835d446938a4b1a2cb14 +Subproject commit 0a84c7e7a55698ea2ca6fe6029aebfde8074e28e diff --git a/scripts/live-build-config b/scripts/live-build-config index eb065cff..c1c766f8 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -36,7 +36,7 @@ lb config noauto \ --architectures {{architecture}} \ --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay" \ --linux-flavours {{architecture}}-vyos \ - --linux-packages linux-image-4.4.47 \ + --linux-packages linux-image-4.4.95 \ --bootloader syslinux \ --binary-images iso-hybrid \ --debian-installer false \ -- cgit v1.2.3 From e5259ccb17e93e110d1dcdeb98f4dc1b9d1df192 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Tue, 7 Nov 2017 09:10:50 +0100 Subject: use security mirror and updates --- scripts/live-build-config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/live-build-config b/scripts/live-build-config index c1c766f8..e0924f93 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -51,7 +51,9 @@ lb config noauto \ --mirror-binary {{debian_mirror}} \ --mirror-binary-security {{debian_security_mirror}} \ --archive-areas "main contrib non-free" \ - --firmware-chroot true + --firmware-chroot true \ + --updates true \ + --security true "${@}" """ -- cgit v1.2.3 From 3e5cb3fb284a87d060fe5520c3fb5fcfad276ed6 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 1 Dec 2017 19:18:28 +0100 Subject: isolinux: replace title Instead of displaying "Boot menu", use "VyOS - Boot Menu". --- data/live-build-config/includes.binary/isolinux/menu.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/live-build-config/includes.binary/isolinux/menu.cfg b/data/live-build-config/includes.binary/isolinux/menu.cfg index 3080bfe0..135b2e96 100644 --- a/data/live-build-config/includes.binary/isolinux/menu.cfg +++ b/data/live-build-config/includes.binary/isolinux/menu.cfg @@ -1,7 +1,7 @@ menu hshift 0 menu width 82 -menu title Boot menu +menu title VyOS - Boot Menu include stdmenu.cfg include live.cfg -- cgit v1.2.3 From f3ae336ba870ce9097967aa136a6c3f3c597aae0 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 1 Dec 2017 19:19:43 +0100 Subject: T386: add 'isolinux.cfg' to support boot timeout --- data/live-build-config/includes.binary/isolinux/isolinux.cfg | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 data/live-build-config/includes.binary/isolinux/isolinux.cfg diff --git a/data/live-build-config/includes.binary/isolinux/isolinux.cfg b/data/live-build-config/includes.binary/isolinux/isolinux.cfg new file mode 100644 index 00000000..ede2b6e1 --- /dev/null +++ b/data/live-build-config/includes.binary/isolinux/isolinux.cfg @@ -0,0 +1,11 @@ +include menu.cfg +default vesamenu.c32 +prompt 0 + +# Ignore the Shift/Alt/Caps Lock/Scroll Lock escape +noescape 1 + +# Wait 10 seconds unless the user types something, but +# always boot after 5 minutes. +timeout 100 +totaltimeout 3000 -- cgit v1.2.3 From 2dbff76543c2bec6de5c54cb9cc9e6297a91f419 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 8 Dec 2017 20:23:22 +0100 Subject: Remove 'vyos-cfg-avahi' submodule (superseeded) (T378) Using AVAHI as mDNS reflector has the big disadvantage that the reflection interface can not be specified. It will reflect the mDNS messages on ALL interfaces. A new technique called mDNS repeater based upon https://github.com/vyos/mdns-repeater will be used in the future. --- .gitmodules | 3 --- data/live-build-config/hooks/18-enable-disable_services.chroot | 2 -- packages/vyos-cfg-avahi | 1 - 3 files changed, 6 deletions(-) delete mode 160000 packages/vyos-cfg-avahi diff --git a/.gitmodules b/.gitmodules index 26527065..606d23ad 100644 --- a/.gitmodules +++ b/.gitmodules @@ -127,9 +127,6 @@ [submodule "packages/vyos-1x"] path = packages/vyos-1x url = https://github.com/vyos/vyos-1x.git -[submodule "packages/vyos-cfg-avahi"] - path = packages/vyos-cfg-avahi - url = https://github.com/c-po/vyos-cfg-avahi.git [submodule "packages/vyos-bcast-relay"] path = packages/vyos-bcast-relay url = https://github.com/c-po/vyos-bcast-relay.git diff --git a/data/live-build-config/hooks/18-enable-disable_services.chroot b/data/live-build-config/hooks/18-enable-disable_services.chroot index b6609fa7..abb60241 100755 --- a/data/live-build-config/hooks/18-enable-disable_services.chroot +++ b/data/live-build-config/hooks/18-enable-disable_services.chroot @@ -28,5 +28,3 @@ systemctl disable lldpd systemctl enable ssh-session-cleanup /usr/sbin/update-rc.d -f conntrackd remove systemctl disable conntrackd -/usr/sbin/update-rc.d -f avahi-daemon remove -systemctl disable avahi-daemon diff --git a/packages/vyos-cfg-avahi b/packages/vyos-cfg-avahi deleted file mode 160000 index 31448bde..00000000 --- a/packages/vyos-cfg-avahi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 31448bde1bc3484bf62114f168749d418bf70b0d -- cgit v1.2.3 From b527902a31ee2fc2ad01c9a1f950dbc867fa14ca Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 8 Dec 2017 20:17:19 +0100 Subject: Added 'mdns-repeater' submodule Submodule is a fork of https://github.com/lucasec/mdns-repeater w/ extensions to add Debian packaging and systemd support. --- .gitmodules | 3 +++ data/live-build-config/hooks/18-enable-disable_services.chroot | 2 ++ packages/mdns-repeater | 1 + 3 files changed, 6 insertions(+) create mode 160000 packages/mdns-repeater diff --git a/.gitmodules b/.gitmodules index 606d23ad..2b39b086 100644 --- a/.gitmodules +++ b/.gitmodules @@ -130,3 +130,6 @@ [submodule "packages/vyos-bcast-relay"] path = packages/vyos-bcast-relay url = https://github.com/c-po/vyos-bcast-relay.git +[submodule "packages/mdns-repeater"] + path = packages/mdns-repeater + url = https://github.com/vyos/mdns-repeater.git diff --git a/data/live-build-config/hooks/18-enable-disable_services.chroot b/data/live-build-config/hooks/18-enable-disable_services.chroot index abb60241..6ba7950f 100755 --- a/data/live-build-config/hooks/18-enable-disable_services.chroot +++ b/data/live-build-config/hooks/18-enable-disable_services.chroot @@ -28,3 +28,5 @@ systemctl disable lldpd systemctl enable ssh-session-cleanup /usr/sbin/update-rc.d -f conntrackd remove systemctl disable conntrackd +/usr/sbin/update-rc.d -f mdns-repeater remove +systemctl disable mdns-repeater diff --git a/packages/mdns-repeater b/packages/mdns-repeater new file mode 160000 index 00000000..05197745 --- /dev/null +++ b/packages/mdns-repeater @@ -0,0 +1 @@ +Subproject commit 051977458f4078a06008bb6c6fd338cd994cf56c -- cgit v1.2.3 From 608b67677a715f6c34b7fc8b2ba231c54c5d36d2 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 9 Dec 2017 13:33:24 +0100 Subject: Updated 'vyos-world' and 'vyos-1x' submodule --- packages/vyos-1x | 2 +- packages/vyos-world | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vyos-1x b/packages/vyos-1x index ac6071ae..ae1e4c70 160000 --- a/packages/vyos-1x +++ b/packages/vyos-1x @@ -1 +1 @@ -Subproject commit ac6071ae85bee52793f6dc34c2b60e333149291b +Subproject commit ae1e4c704bb324831fb15b6e243710f94700d3f2 diff --git a/packages/vyos-world b/packages/vyos-world index 416bee9c..bd86d016 160000 --- a/packages/vyos-world +++ b/packages/vyos-world @@ -1 +1 @@ -Subproject commit 416bee9c0a634f8513904f18556bb6d40e9fd2a8 +Subproject commit bd86d016c2e0d5342f9610c28855f13d0316acfd -- cgit v1.2.3 From 1c1f372d352e1047013c85d0ccc60f2178472fa0 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 9 Dec 2017 13:45:12 +0100 Subject: Remove 'vyatta-cron' submodule 'vyatta-cron' is superseeded by 'vyos-1x' thus the submodule is removed to reduce confusion. --- .gitmodules | 3 --- packages/vyatta-cron | 1 - 2 files changed, 4 deletions(-) delete mode 160000 packages/vyatta-cron diff --git a/.gitmodules b/.gitmodules index 2b39b086..f0c14936 100644 --- a/.gitmodules +++ b/.gitmodules @@ -61,9 +61,6 @@ [submodule "packages/vyatta-eventwatch"] path = packages/vyatta-eventwatch url = https://github.com/vyos/vyatta-eventwatch.git -[submodule "packages/vyatta-cron"] - path = packages/vyatta-cron - url = https://github.com/vyos/vyatta-cron.git [submodule "packages/vyatta-webproxy"] path = packages/vyatta-webproxy url = https://github.com/vyos/vyatta-webproxy.git diff --git a/packages/vyatta-cron b/packages/vyatta-cron deleted file mode 160000 index eac0fafc..00000000 --- a/packages/vyatta-cron +++ /dev/null @@ -1 +0,0 @@ -Subproject commit eac0fafcd19184c1679c31584b80f43095cf5690 -- cgit v1.2.3 From 7a79d4c621aaa17ea89863afa1e83308641d7ffa Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 26 Dec 2017 17:47:20 +0100 Subject: Replace vim-tiny with vim --- data/live-build-config/package-lists/vyos-utils.list.chroot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/live-build-config/package-lists/vyos-utils.list.chroot b/data/live-build-config/package-lists/vyos-utils.list.chroot index 98d6a753..27065aaf 100644 --- a/data/live-build-config/package-lists/vyos-utils.list.chroot +++ b/data/live-build-config/package-lists/vyos-utils.list.chroot @@ -10,6 +10,6 @@ socat telnet tcpdump nano -vim-tiny +vim screen minicom -- cgit v1.2.3 From f687ea7e96c6d313549b505b53f72961bce46dad Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 2 Jan 2018 19:40:23 +0100 Subject: Replaced submodule 'vyos-bcast-relay' with proper fork of 'udp-broadcast-relay' --- .gitmodules | 6 +++--- packages/udp-broadcast-relay | 1 + packages/vyos-bcast-relay | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) create mode 160000 packages/udp-broadcast-relay delete mode 160000 packages/vyos-bcast-relay diff --git a/.gitmodules b/.gitmodules index f0c14936..5e095b4d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -124,9 +124,9 @@ [submodule "packages/vyos-1x"] path = packages/vyos-1x url = https://github.com/vyos/vyos-1x.git -[submodule "packages/vyos-bcast-relay"] - path = packages/vyos-bcast-relay - url = https://github.com/c-po/vyos-bcast-relay.git [submodule "packages/mdns-repeater"] path = packages/mdns-repeater url = https://github.com/vyos/mdns-repeater.git +[submodule "packages/udp-broadcast-relay"] + path = packages/udp-broadcast-relay + url = https://github.com/vyos/udp-broadcast-relay.git diff --git a/packages/udp-broadcast-relay b/packages/udp-broadcast-relay new file mode 160000 index 00000000..5286c027 --- /dev/null +++ b/packages/udp-broadcast-relay @@ -0,0 +1 @@ +Subproject commit 5286c027794cec6759495ba15dcab999c5921ec6 diff --git a/packages/vyos-bcast-relay b/packages/vyos-bcast-relay deleted file mode 160000 index 9d8f7b4e..00000000 --- a/packages/vyos-bcast-relay +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9d8f7b4e6e7e9206673c2e37d09e930958487c63 -- cgit v1.2.3 From ad8950f3f121b0342997e7d4db1b9f337a7c07e6 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 6 Jan 2018 11:59:35 +0100 Subject: T379: Add support for UDP broadcast relay --- data/live-build-config/hooks/18-enable-disable_services.chroot | 2 ++ packages/udp-broadcast-relay | 2 +- packages/vyos-1x | 2 +- packages/vyos-world | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/data/live-build-config/hooks/18-enable-disable_services.chroot b/data/live-build-config/hooks/18-enable-disable_services.chroot index 6ba7950f..ea31eb1e 100755 --- a/data/live-build-config/hooks/18-enable-disable_services.chroot +++ b/data/live-build-config/hooks/18-enable-disable_services.chroot @@ -30,3 +30,5 @@ systemctl enable ssh-session-cleanup systemctl disable conntrackd /usr/sbin/update-rc.d -f mdns-repeater remove systemctl disable mdns-repeater +/usr/sbin/update-rc.d -f udp-broadcast-relay remove +systemctl disable udp-broadcast-relay{1.99} diff --git a/packages/udp-broadcast-relay b/packages/udp-broadcast-relay index 5286c027..13127cbd 160000 --- a/packages/udp-broadcast-relay +++ b/packages/udp-broadcast-relay @@ -1 +1 @@ -Subproject commit 5286c027794cec6759495ba15dcab999c5921ec6 +Subproject commit 13127cbd62e69be2d186c9d76d112729ea95a1ef diff --git a/packages/vyos-1x b/packages/vyos-1x index ae1e4c70..4022a882 160000 --- a/packages/vyos-1x +++ b/packages/vyos-1x @@ -1 +1 @@ -Subproject commit ae1e4c704bb324831fb15b6e243710f94700d3f2 +Subproject commit 4022a8820ccf0539f2eb5c19d9abd777810a48b4 diff --git a/packages/vyos-world b/packages/vyos-world index bd86d016..5055f0b8 160000 --- a/packages/vyos-world +++ b/packages/vyos-world @@ -1 +1 @@ -Subproject commit bd86d016c2e0d5342f9610c28855f13d0316acfd +Subproject commit 5055f0b8215df93c2973d8b35ac40fa8b526d0a1 -- cgit v1.2.3 From 81cacb0a31a45e1eb501dd7a004ad1074fc59b1d Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 7 Jan 2018 09:18:09 +0100 Subject: T341: Add 'wakeonlan' tools to base image --- data/live-build-config/package-lists/vyos-utils.list.chroot | 1 + 1 file changed, 1 insertion(+) diff --git a/data/live-build-config/package-lists/vyos-utils.list.chroot b/data/live-build-config/package-lists/vyos-utils.list.chroot index 27065aaf..de0f6d00 100644 --- a/data/live-build-config/package-lists/vyos-utils.list.chroot +++ b/data/live-build-config/package-lists/vyos-utils.list.chroot @@ -13,3 +13,4 @@ nano vim screen minicom +wakeonlan -- cgit v1.2.3 From 522ebc6250d5fd007c199396cbd046dd7134de8d Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 11 Jan 2018 05:57:57 +0100 Subject: T519: make VyOS package mirror configurable. --- data/live-build-config/archives/vyos.list.chroot | 1 - scripts/build-config | 4 +++- scripts/defaults.py | 8 +++++++- scripts/live-build-config | 11 ++++++++++- 4 files changed, 20 insertions(+), 4 deletions(-) delete mode 100644 data/live-build-config/archives/vyos.list.chroot diff --git a/data/live-build-config/archives/vyos.list.chroot b/data/live-build-config/archives/vyos.list.chroot deleted file mode 100644 index 2b117386..00000000 --- a/data/live-build-config/archives/vyos.list.chroot +++ /dev/null @@ -1 +0,0 @@ -deb http://dev.packages.vyos.net/vyos current main diff --git a/scripts/build-config b/scripts/build-config index ae8501e8..56fc7a88 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2015 VyOS maintainers and contributors +# Copyright (C) 2018, VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -52,6 +52,7 @@ options = { 'debian-mirror': ('Debian repository mirror for ISO build', lambda: defaults.DEBIAN_MIRROR, None), 'debian-security-mirror': ('Debian security updated mirror', lambda: defaults.DEBIAN_SECURITY_MIRROR, None), 'pbuilder-debian-mirror': ('Debian repository mirror for pbuilder env bootstrap', lambda: defaults.DEBIAN_MIRROR, None), + 'vyos-mirror': ('VyOS package mirror', lambda: defaults.VYOS_MIRROR, None), 'build-type': ('Build type, release or development', lambda: 'development', lambda x: x in ['release', 'development']), 'version': ('Version number (release builds only)', None, None) } @@ -96,6 +97,7 @@ if args['build_type'] == 'development': args['distribution'] = defaults.DEBIAN_DISTRIBUTION args['build_dir'] = os.path.join(os.getcwd(), defaults.BUILD_DIR) args['pbuilder_config'] = defaults.PBUILDER_CONFIG +args['vyos_branch'] = defaults.VYOS_BRANCH # Check the build environment and dependencies env_check_retval = os.system("scripts/check-build-env") diff --git a/scripts/defaults.py b/scripts/defaults.py index 0792d6b2..e18e3f7c 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015 VyOS maintainers and contributors +# Copyright (C) 2018 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -32,3 +32,9 @@ PBUILDER_DIR = os.path.join(BUILD_DIR, 'pbuilder') LB_CONFIG_DIR = os.path.join(BUILD_DIR, 'config') CHROOT_INCLUDES_DIR = os.path.join(LB_CONFIG_DIR, 'includes.chroot') + +VYOS_MIRROR = 'http://dev.packages.vyos.net/repositories/current/vyos' + +VYOS_BRANCH = 'current' + +VYOS_REPO_FILE = 'config/archives/vyos.list.chroot' diff --git a/scripts/live-build-config b/scripts/live-build-config index e0924f93..1880be39 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2015 VyOS maintainers and contributors +# Copyright (C) 2018 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -60,6 +60,15 @@ lb config noauto \ with open(defaults.BUILD_CONFIG, 'r') as f: build_config = json.load(f) +# Add the additional repositories to package lists +print("Setting up additional APT entries") +vyos_repo_entry = "deb {0} {1} main\n".format(build_config['vyos_mirror'], build_config['vyos_branch']) + +with open(os.path.join(defaults.BUILD_DIR, defaults.VYOS_REPO_FILE), 'w') as f: + f.write(vyos_repo_entry) + +# Configure live-build + lb_config_command = pystache.render(lb_config_tmpl, build_config) print("Configuring live-build") -- cgit v1.2.3 From 920344fe59ae3c2ec27c3c21d6588c4f05bbae88 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 11 Jan 2018 06:31:44 +0100 Subject: Add some debugging capabilities to the build scripts. --- scripts/build-config | 11 ++++++++++- scripts/live-build-config | 12 ++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/scripts/build-config b/scripts/build-config index 56fc7a88..a18e95ee 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -43,6 +43,12 @@ def field_to_option(s): def get_default_build_by(): return "{user}@{host}".format(user= getpass.getuser(), host=platform.node()) +def get_validator(optdict, name): + try: + return optdict[name][2] + except KeyError: + return None + # Options dict format: # '$option_name_without_leading_dashes': { ('$help_string', $default_value_generator_thunk, $value_checker_thunk) } @@ -66,12 +72,15 @@ for k, v in options.items(): else: parser.add_argument('--' + k, type=str, help=help_string, default=default_value_thunk()) +# The debug option is a bit special since it's different type +parser.add_argument('--debug', help="Enable debug output", action='store_true') + args = vars(parser.parse_args()) # Validate options for k, v in args.items(): key = field_to_option(k) - func = options[key][2] + func = get_validator(options, k) if func is not None: if not func(v): print("{v} is not a valid value for --{o} option".format(o=key, v=v)) diff --git a/scripts/live-build-config b/scripts/live-build-config index 1880be39..544c67e8 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -60,11 +60,19 @@ lb config noauto \ with open(defaults.BUILD_CONFIG, 'r') as f: build_config = json.load(f) +debug = build_config['debug'] + # Add the additional repositories to package lists print("Setting up additional APT entries") vyos_repo_entry = "deb {0} {1} main\n".format(build_config['vyos_mirror'], build_config['vyos_branch']) -with open(os.path.join(defaults.BUILD_DIR, defaults.VYOS_REPO_FILE), 'w') as f: +apt_file = os.path.join(defaults.BUILD_DIR, defaults.VYOS_REPO_FILE) + +if debug: + print("Adding these entries to {0}:".format(apt_file)) + print("\t", vyos_repo_entry) + +with open(apt_file, 'w') as f: f.write(vyos_repo_entry) # Configure live-build @@ -72,8 +80,8 @@ with open(os.path.join(defaults.BUILD_DIR, defaults.VYOS_REPO_FILE), 'w') as f: lb_config_command = pystache.render(lb_config_tmpl, build_config) print("Configuring live-build") -os.chdir(defaults.BUILD_DIR) +os.chdir(defaults.BUILD_DIR) result = os.system(lb_config_command) if result > 0: print("live-build config failed") -- cgit v1.2.3 From 679747704af6b13081341163e7e32ddb9746b7b1 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 11 Jan 2018 06:51:58 +0100 Subject: T519: fix paths and operation order in the makefile for correct repo setup. --- Makefile | 3 ++- scripts/live-build-config | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8aa082ce..2eaed429 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,9 @@ prepare: @echo "Starting VyOS ISO image build" rm -rf build/config/* - @scripts/live-build-config + mkdir -p build/config cp -r data/live-build-config/* build/config/ + @scripts/live-build-config @scripts/import-local-packages @scripts/make-version-file diff --git a/scripts/live-build-config b/scripts/live-build-config index 544c67e8..4b491aeb 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -66,7 +66,7 @@ debug = build_config['debug'] print("Setting up additional APT entries") vyos_repo_entry = "deb {0} {1} main\n".format(build_config['vyos_mirror'], build_config['vyos_branch']) -apt_file = os.path.join(defaults.BUILD_DIR, defaults.VYOS_REPO_FILE) +apt_file = os.path.join(build_config['build_dir'], defaults.VYOS_REPO_FILE) if debug: print("Adding these entries to {0}:".format(apt_file)) -- cgit v1.2.3 From c1f412a32fd41ea060cd61adf2304d242ae29272 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 11 Jan 2018 06:57:19 +0100 Subject: T422: include apt-transport-https in the bootstrap stage. --- scripts/live-build-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/live-build-config b/scripts/live-build-config index 4b491aeb..70cb5ec2 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -44,7 +44,7 @@ lb config noauto \ --iso-application "VyOS" \ --iso-publisher "{{build_by}}" \ --iso-volume "VyOS" \ - --debootstrap-options "--variant=minbase --exclude=isc-dhcp-client,isc-dhcp-common,ifupdown" \ + --debootstrap-options "--variant=minbase --exclude=isc-dhcp-client,isc-dhcp-common,ifupdown --include=apt-transport-https" \ --mirror-bootstrap {{debian_mirror}} \ --mirror-chroot {{debian_mirror}} \ --mirror-chroot-security {{debian_security_mirror}} \ -- cgit v1.2.3 From ab00043201c1c95ad4345e655c2299a39dc2fec5 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 12 Jan 2018 05:03:59 +0100 Subject: T520: use the load balanced Debian mirror by default. --- scripts/defaults.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/defaults.py b/scripts/defaults.py index e18e3f7c..bb6f0910 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -22,8 +22,8 @@ BUILD_DIR = 'build' BUILD_CONFIG = os.path.join(BUILD_DIR, 'build-config.json') # The default mirror was chosen entirely at random -DEBIAN_MIRROR = 'http://ftp.nl.debian.org/debian/' -DEBIAN_SECURITY_MIRROR = 'http://security.debian.org/' +DEBIAN_MIRROR = 'http://deb.debian.org/debian' +DEBIAN_SECURITY_MIRROR = 'http://deb.debian.org/debian-security' DEBIAN_DISTRIBUTION = 'jessie' -- cgit v1.2.3 From 79de686b77818fb4352dc5bff083e139abe2c5e8 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 26 Jan 2018 06:02:19 +0100 Subject: T531: VyOS Kernel Update v4.4.113 --- packages/vyos-kernel | 2 +- scripts/live-build-config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vyos-kernel b/packages/vyos-kernel index 0a84c7e7..94c9ef1d 160000 --- a/packages/vyos-kernel +++ b/packages/vyos-kernel @@ -1 +1 @@ -Subproject commit 0a84c7e7a55698ea2ca6fe6029aebfde8074e28e +Subproject commit 94c9ef1d0d549d46187f2abb3c1d6979654dc289 diff --git a/scripts/live-build-config b/scripts/live-build-config index 70cb5ec2..4c4a38ac 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -36,7 +36,7 @@ lb config noauto \ --architectures {{architecture}} \ --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay" \ --linux-flavours {{architecture}}-vyos \ - --linux-packages linux-image-4.4.95 \ + --linux-packages linux-image-4.4.113 \ --bootloader syslinux \ --binary-images iso-hybrid \ --debian-installer false \ -- cgit v1.2.3 From bc0406ce3376a28d0fb8a064395351168a93e9de Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 19 Feb 2018 14:54:14 +0100 Subject: Enable journald log forwarding to syslog (fixes T552). --- .../includes.chroot/etc/rsyslog.conf | 67 ++++++++++++++++++++++ .../includes.chroot/etc/systemd/journald.conf | 41 +++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 data/live-build-config/includes.chroot/etc/rsyslog.conf create mode 100644 data/live-build-config/includes.chroot/etc/systemd/journald.conf diff --git a/data/live-build-config/includes.chroot/etc/rsyslog.conf b/data/live-build-config/includes.chroot/etc/rsyslog.conf new file mode 100644 index 00000000..9e468ed0 --- /dev/null +++ b/data/live-build-config/includes.chroot/etc/rsyslog.conf @@ -0,0 +1,67 @@ +# /etc/rsyslog.conf Configuration file for rsyslog. +# +# For more information see +# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html + + +################# +#### MODULES #### +################# + +$ModLoad imuxsock # provides support for local system logging +$ModLoad imklog # provides kernel logging support (previously done by rklogd) +#$ModLoad immark # provides --MARK-- message capability + +$OmitLocalLogging no +$SystemLogSocketName /run/systemd/journal/syslog + +$KLogPath /proc/kmsg + +# provides UDP syslog reception +#$ModLoad imudp +#$UDPServerRun 514 + +# provides TCP syslog reception +#$ModLoad imtcp +#$InputTCPServerRun 514 + + +########################### +#### GLOBAL DIRECTIVES #### +########################### + +# +# Use traditional timestamp format. +# To enable high precision timestamps, comment out the following line. +# +$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat + +# Filter duplicated messages +$RepeatedMsgReduction on + +# +# Set the default permissions for all log files. +# +$FileOwner root +$FileGroup adm +$FileCreateMode 0640 +$DirCreateMode 0755 +$Umask 0022 + +# +# Include all config files in /etc/rsyslog.d/ +# +$IncludeConfig /etc/rsyslog.d/*.conf + +############### +#### RULES #### +############### + +daemon.* /var/log/messages + +# Log authorization failure messages +#auth,authpriv.* /var/log/auth.log + +# Emergencies are sent to everybody logged in. +*.emerg :omusrmsg:* + diff --git a/data/live-build-config/includes.chroot/etc/systemd/journald.conf b/data/live-build-config/includes.chroot/etc/systemd/journald.conf new file mode 100644 index 00000000..07612424 --- /dev/null +++ b/data/live-build-config/includes.chroot/etc/systemd/journald.conf @@ -0,0 +1,41 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# Entries in this file show the compile time defaults. +# You can change settings by editing this file. +# Defaults can be restored by simply deleting this file. +# +# See journald.conf(5) for details. + +[Journal] +#Storage=persistent +#Compress=yes +#Seal=yes +#SplitMode=uid +#SyncIntervalSec=5m +#RateLimitIntervalSec=30s +#RateLimitBurst=1000 +#SystemMaxUse= +#SystemKeepFree= +#SystemMaxFileSize= +#SystemMaxFiles=100 +#RuntimeMaxUse= +#RuntimeKeepFree= +#RuntimeMaxFileSize= +#RuntimeMaxFiles=100 +#MaxRetentionSec= +#MaxFileSec=1month +ForwardToSyslog=yes +#ForwardToKMsg=no +#ForwardToConsole=no +#ForwardToWall=yes +#TTYPath=/dev/console +#MaxLevelStore=debug +MaxLevelSyslog=debug +#MaxLevelKMsg=notice +#MaxLevelConsole=info +#MaxLevelWall=emerg -- cgit v1.2.3 From e95956a3ad834cf442678ec90be638aefcd8a2d1 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 19 Feb 2018 14:59:05 +0100 Subject: Better modify the rsyslog.conf we already have in vyatta-cfg-systemm (T552). --- .../includes.chroot/etc/rsyslog.conf | 67 ---------------------- 1 file changed, 67 deletions(-) delete mode 100644 data/live-build-config/includes.chroot/etc/rsyslog.conf diff --git a/data/live-build-config/includes.chroot/etc/rsyslog.conf b/data/live-build-config/includes.chroot/etc/rsyslog.conf deleted file mode 100644 index 9e468ed0..00000000 --- a/data/live-build-config/includes.chroot/etc/rsyslog.conf +++ /dev/null @@ -1,67 +0,0 @@ -# /etc/rsyslog.conf Configuration file for rsyslog. -# -# For more information see -# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html - - -################# -#### MODULES #### -################# - -$ModLoad imuxsock # provides support for local system logging -$ModLoad imklog # provides kernel logging support (previously done by rklogd) -#$ModLoad immark # provides --MARK-- message capability - -$OmitLocalLogging no -$SystemLogSocketName /run/systemd/journal/syslog - -$KLogPath /proc/kmsg - -# provides UDP syslog reception -#$ModLoad imudp -#$UDPServerRun 514 - -# provides TCP syslog reception -#$ModLoad imtcp -#$InputTCPServerRun 514 - - -########################### -#### GLOBAL DIRECTIVES #### -########################### - -# -# Use traditional timestamp format. -# To enable high precision timestamps, comment out the following line. -# -$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat - -# Filter duplicated messages -$RepeatedMsgReduction on - -# -# Set the default permissions for all log files. -# -$FileOwner root -$FileGroup adm -$FileCreateMode 0640 -$DirCreateMode 0755 -$Umask 0022 - -# -# Include all config files in /etc/rsyslog.d/ -# -$IncludeConfig /etc/rsyslog.d/*.conf - -############### -#### RULES #### -############### - -daemon.* /var/log/messages - -# Log authorization failure messages -#auth,authpriv.* /var/log/auth.log - -# Emergencies are sent to everybody logged in. -*.emerg :omusrmsg:* - -- cgit v1.2.3 From 9d5ab697ada2d156631be4c802ebe8a640f4a723 Mon Sep 17 00:00:00 2001 From: mtudosoiu Date: Tue, 20 Feb 2018 22:33:19 +0200 Subject: task #T555 add tools/submod-mk to vyos-build repository https://phabricator.vyos.net/T555 --- tools/submod-mk | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 tools/submod-mk diff --git a/tools/submod-mk b/tools/submod-mk new file mode 100644 index 00000000..eb61da18 --- /dev/null +++ b/tools/submod-mk @@ -0,0 +1,84 @@ +#!/bin/bash +# +# **** License **** +# +# Copyright (C) 2013 Vyatta, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# **** End License **** + +progname=${0##*/} +shopt -s nullglob +shopt -s extglob +cd packages + +info=echo +trace= +noclean="-nc" +build="debuild -i -b -uc -us" + +declare -a submodule +declare -a debs +for debian in !(installer|linux-kernel-di-i386-2.6)/debian ; do + smod=${debian%/*} + debs=( ${smod}_*.deb ) + if [ ${#debs[@]} -eq 0 ] ; then + submodule+=( $smod ) + fi +done + +while [ $# -gt 0 ] ; do + case "$1" in + -h | --help ) + cat <<-EOF +Usage: $progname [Options] [ SUBMODULE... ] +Options: + -n | --do-nothing DonĀ“t actually remove or build anything, + just show what would be done + -q | --quiet Quiet, don't print progress info + -c | --clean Clean build + -b | --binary Skip source package build (default) + -s | --source Build binary and source packages + -S | --signed-source Build and sign packages + +If no SUBMODULE(s) given, build all checked-out submodules w/o debs. +EOF + exit 0;; + -n | --do-nothing ) + trace=echo + shift;; + -q | --quiet ) + info='#' + shift;; + -c | --clean ) + noclean= + shift;; + -b | --binary ) + shift ;; # default + -s | --source ) + build="git buildpackage -uc -us" + shift;; + -S | --signed-source ) + build="git buildpackage" + shift;; + * ) + submodule=( $@ ) + break;; + esac +done + +for (( i=0; i<${#submodule[@]}; i++)) ; do + eval $info P: ${submodule[i]} + ( cd ${submodule[i]} && eval $trace $build $noclean ) || exit $? +done -- cgit v1.2.3 From da9bb735ce1f6985057e13494d9f8db832dd3855 Mon Sep 17 00:00:00 2001 From: Kim Date: Wed, 21 Feb 2018 10:23:14 +0100 Subject: Manage config files with included files instead of echo, sed etc. (#16) Manage system.conf from file instead of hook. Add comment to the files where they are managed --- .../hooks/21-pam_mkhomedir.chroot | 16 +++++++ .../live-build-config/hooks/21-systemd_conf.chroot | 5 -- .../hooks/22-pam_mkhomedir.chroot | 16 ------- .../includes.chroot/etc/systemd/journald.conf | 2 + .../includes.chroot/etc/systemd/system.conf | 55 ++++++++++++++++++++++ 5 files changed, 73 insertions(+), 21 deletions(-) create mode 100755 data/live-build-config/hooks/21-pam_mkhomedir.chroot delete mode 100755 data/live-build-config/hooks/21-systemd_conf.chroot delete mode 100755 data/live-build-config/hooks/22-pam_mkhomedir.chroot create mode 100644 data/live-build-config/includes.chroot/etc/systemd/system.conf diff --git a/data/live-build-config/hooks/21-pam_mkhomedir.chroot b/data/live-build-config/hooks/21-pam_mkhomedir.chroot new file mode 100755 index 00000000..af155ba4 --- /dev/null +++ b/data/live-build-config/hooks/21-pam_mkhomedir.chroot @@ -0,0 +1,16 @@ +#!/bin/sh + +echo I: Create home directory on login. + +cat > /usr/share/pam-configs/mkhomedir <> /etc/systemd/system.conf diff --git a/data/live-build-config/hooks/22-pam_mkhomedir.chroot b/data/live-build-config/hooks/22-pam_mkhomedir.chroot deleted file mode 100755 index af155ba4..00000000 --- a/data/live-build-config/hooks/22-pam_mkhomedir.chroot +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -echo I: Create home directory on login. - -cat > /usr/share/pam-configs/mkhomedir < Date: Wed, 21 Feb 2018 12:53:31 +0200 Subject: Task #T556 add dockerfile for vyos-build-node use debian:jessie docker container as build node for vyos1.2.x --- Dockerfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..924ddb12 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +# Must be run with --privileged flag +# Recommended to run the container with a volume mapped +# in order to easy exprort images built to "external" world +FROM debian:jessie + +RUN apt-get update &&\ + apt-get install -y \ + vim \ + git \ + make \ + live-build \ + pbuilder \ + devscripts \ + python3-pystache \ + squashfs-tools \ + autoconf \ + dpkg-dev \ + syslinux \ + genisoimage \ + lsb-release \ + fakechroot \ + kernel-package \ + libtool \ + libglib2.0-dev \ + libboost-filesystem-dev \ + libapt-pkg-dev \ + flex \ + bison \ + libperl-dev \ + libnfnetlink-dev \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR ~ -- cgit v1.2.3 From 91d04073643f249d10ba8ac7249bbce9306b59c7 Mon Sep 17 00:00:00 2001 From: mtudosoiu Date: Wed, 21 Feb 2018 15:26:44 +0200 Subject: update R --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 2b1f5a12..fb68595a 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,30 @@ To build a VyOS image, you need a machine that runs Debian Jessie. Other build h 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. +## Building the ISO image inside a docker container + +Using Dockerfile you can create your own docker container that can be used to build a VyOS ISO image. +The Dockerfile contains some of the most used packages needed for a VyOs build ISO process. + +To build the docker image + +``` +docker build -t vyos-builder $PATH_TO_Dockerfile +``` + +To run and the docker image once is created: + +``` +docker run --privileged -v /HOST_PATH/images:/vyos --name=vyos_node_builder -d vyos-builder bash +``` + +To connect to the docker image once is running: +``` +docker exec -it vyos_node_builder bash +``` + +After the docker container is running you can git clone the vyos-build repository inside the container +and follow up the bellow instructions in order to build the VyOs ISO image ## Building the ISO image -- cgit v1.2.3 From f3af362c0b2403375f07bb864cd1ddadc6576060 Mon Sep 17 00:00:00 2001 From: mtudosoiu Date: Wed, 21 Feb 2018 15:39:59 +0200 Subject: Task #556 Update README.md for Dockerfile --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb68595a..4955ce56 100644 --- a/README.md +++ b/README.md @@ -58,11 +58,14 @@ To build the docker image docker build -t vyos-builder $PATH_TO_Dockerfile ``` -To run and the docker image once is created: +To run the docker image: ``` docker run --privileged -v /HOST_PATH/images:/vyos --name=vyos_node_builder -d vyos-builder bash ``` +* docker container must be run with --privileged flag +* is recommended to run the container with a volume mapped in order to easy exprort images built +to the "external" world To connect to the docker image once is running: ``` -- cgit v1.2.3 From 20536aa5212baaa8b61944d5b3934222cfa9e2fb Mon Sep 17 00:00:00 2001 From: mtudosoiu Date: Wed, 21 Feb 2018 15:45:58 +0200 Subject: Task #556 Update README.md --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4955ce56..0e0da22b 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,30 @@ Individual packages may have other build dependencies. If some packages are miss Using Dockerfile you can create your own docker container that can be used to build a VyOS ISO image. The Dockerfile contains some of the most used packages needed for a VyOs build ISO process. +``` +squashfs-tools # Required for squashfs file system +git # Required, for cloning the source +autoconf # Required, for generating build scripts +dpkg-dev # Required, used in build scripts +live-helper # Required, for ISO build +syslinux # Required, for ISO build +genisoimage # Required, for ISO build +make # Required, for ISO build +lsb-release # Required, used by configure script +fakechroot # Required, for ISO build +devscripts # Optional, for building submodules (kernel etc) +kernel-package # Optional, for building the kernel +libtool # Optional, for building certain packages (eg vyatta-op-vpn) +libglib2.0-dev # Optional, for building vyatta-cfg +libboost-filesystem-dev # Optional, for building vyatta-cfg +libapt-pkg-dev # Optional, for building vyatta-cfg +flex # Optional, for building vyatta-cfg +bison # Optional, for building vyatta-cfg +libperl-dev # Optional, for building vyatta-cfg +libnfnetlink-dev # Optional, for building vyatta-cfg-vpn +vim # Optional, vim, vi, nano or other text editor +``` + To build the docker image ``` @@ -64,7 +88,7 @@ To run the docker image: docker run --privileged -v /HOST_PATH/images:/vyos --name=vyos_node_builder -d vyos-builder bash ``` * docker container must be run with --privileged flag -* is recommended to run the container with a volume mapped in order to easy exprort images built +* is recommended to run the container with a volume mapped in order to easy export built VyOs ISO images to the "external" world To connect to the docker image once is running: -- cgit v1.2.3 From 31047fb47f89dd3b8788a8da7df9064e81924679 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 14 Mar 2018 15:57:41 +0100 Subject: Added 'vyos-keepalived' submodule --- .gitmodules | 3 +++ packages/vyos-keepalived | 1 + 2 files changed, 4 insertions(+) create mode 160000 packages/vyos-keepalived diff --git a/.gitmodules b/.gitmodules index 5e095b4d..930e7ab3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -130,3 +130,6 @@ [submodule "packages/udp-broadcast-relay"] path = packages/udp-broadcast-relay url = https://github.com/vyos/udp-broadcast-relay.git +[submodule "packages/vyos-keepalived"] + path = packages/vyos-keepalived + url = https://github.com/vyos/vyos-keepalived.git diff --git a/packages/vyos-keepalived b/packages/vyos-keepalived new file mode 160000 index 00000000..dc8ade02 --- /dev/null +++ b/packages/vyos-keepalived @@ -0,0 +1 @@ +Subproject commit dc8ade02407f836873e78887f4b3c94b6540a578 -- cgit v1.2.3 From 3ba5eec40abb30207300f5928ae7c734075d2cdb Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 15 Mar 2018 07:28:44 +0100 Subject: T565: VyOS Kernel Update v4.14.26 --- packages/vyos-kernel | 2 +- scripts/live-build-config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vyos-kernel b/packages/vyos-kernel index 94c9ef1d..847dcd0e 160000 --- a/packages/vyos-kernel +++ b/packages/vyos-kernel @@ -1 +1 @@ -Subproject commit 94c9ef1d0d549d46187f2abb3c1d6979654dc289 +Subproject commit 847dcd0eb180f509e3d39c5d2cd978bc3bd13733 diff --git a/scripts/live-build-config b/scripts/live-build-config index 4c4a38ac..15df7aa8 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -36,7 +36,7 @@ lb config noauto \ --architectures {{architecture}} \ --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay" \ --linux-flavours {{architecture}}-vyos \ - --linux-packages linux-image-4.4.113 \ + --linux-packages linux-image-4.14.26 \ --bootloader syslinux \ --binary-images iso-hybrid \ --debian-installer false \ -- cgit v1.2.3 From e9b6d0942d73c8863bba2c402c2337d27e4e1dc4 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 20 Mar 2018 10:17:04 +0900 Subject: T578: Update vyos-kernel --- packages/vyos-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vyos-kernel b/packages/vyos-kernel index 847dcd0e..12308767 160000 --- a/packages/vyos-kernel +++ b/packages/vyos-kernel @@ -1 +1 @@ -Subproject commit 847dcd0eb180f509e3d39c5d2cd978bc3bd13733 +Subproject commit 123087671203ad50989a2ff0c91d0df2dc4d32e1 -- cgit v1.2.3 From 65b82136a19549fcaf7ae1a81daa46695a6c08e1 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 21 Mar 2018 20:18:08 +0100 Subject: Added vyatta-iproute submodule --- .gitmodules | 3 +++ packages/vyatta-iproute | 1 + 2 files changed, 4 insertions(+) create mode 160000 packages/vyatta-iproute diff --git a/.gitmodules b/.gitmodules index 930e7ab3..7ec3cb00 100644 --- a/.gitmodules +++ b/.gitmodules @@ -133,3 +133,6 @@ [submodule "packages/vyos-keepalived"] path = packages/vyos-keepalived url = https://github.com/vyos/vyos-keepalived.git +[submodule "packages/vyatta-iproute"] + path = packages/vyatta-iproute + url = https://github.com/vyos/vyatta-iproute.git diff --git a/packages/vyatta-iproute b/packages/vyatta-iproute new file mode 160000 index 00000000..0b78fea6 --- /dev/null +++ b/packages/vyatta-iproute @@ -0,0 +1 @@ +Subproject commit 0b78fea66ab7d8ae84da7345650965e1752e1c28 -- cgit v1.2.3 From d2e4f63f03ef5628ab94be34bf368e8c8458a2d0 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 5 Apr 2018 14:59:44 +0200 Subject: T596: use a more descriptive dev build version format. --- data/versions | 3 +++ scripts/check-build-env | 3 ++- scripts/make-version-file | 24 ++++++++++++++++++++---- 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 data/versions diff --git a/data/versions b/data/versions new file mode 100644 index 00000000..3d0c2871 --- /dev/null +++ b/data/versions @@ -0,0 +1,3 @@ +{ + "current": "1.2.0" +} diff --git a/scripts/check-build-env b/scripts/check-build-env index 7f02c02a..7377be64 100755 --- a/scripts/check-build-env +++ b/scripts/check-build-env @@ -32,7 +32,8 @@ deps = { 'live-build', 'pbuilder', 'devscripts', - 'python3-pystache' + 'python3-pystache', + 'python3-git' ], 'binaries': [] } diff --git a/scripts/make-version-file b/scripts/make-version-file index 3bb33319..0459b8bf 100755 --- a/scripts/make-version-file +++ b/scripts/make-version-file @@ -1,6 +1,6 @@ #!/usr/bin/python3 # -# Copyright (C) 2016 VyOS maintainers and contributors +# Copyright (C) 2018 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -25,16 +25,18 @@ import datetime import json import uuid +import git + import defaults import util +# Load the build config util.check_build_config() with open(defaults.BUILD_CONFIG, 'r') as f: build_config = json.load(f) - +# Create a build timestamp now = datetime.datetime.today() - build_timestamp = now.strftime("%Y%m%d%H%M") # FIXME: use aware rather than naive object @@ -43,9 +45,23 @@ build_date = now.strftime("%a %d %b %Y %H:%M UTC") # Assign a (hopefully) unique identifier to the build (UUID) build_id = str(uuid.uuid4()) +# Create a build version if build_config['build_type'] == 'development': - version = "999.{0}".format(build_timestamp) + try: + # Load the branch to version mapping file + with open('data/versions') as f: + version_mapping = json.load(f) + + repo = git.Repo('.') + git_branch = repo.active_branch.name + branch_version = version_mapping[git_branch] + + version = "{0}-rolling+{1}".format(branch_version, build_timestamp) + except Exception as e: + print("Could not build a version string specific to git branch, falling back to default: {0}".format(str(e))) + version = "999.{0}".format(build_timestamp) else: + # Release build, use the version from ./configure arguments version = build_config['version'] version_data = { -- cgit v1.2.3 From 91351362c91775f6e5a351cfa3b619e7f3dcce5e Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 20 Apr 2018 17:10:16 +0200 Subject: hooks: migrate from dnsmasq to pdns-recursor --- data/live-build-config/hooks/18-enable-disable_services.chroot | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/data/live-build-config/hooks/18-enable-disable_services.chroot b/data/live-build-config/hooks/18-enable-disable_services.chroot index ea31eb1e..fe30c95f 100755 --- a/data/live-build-config/hooks/18-enable-disable_services.chroot +++ b/data/live-build-config/hooks/18-enable-disable_services.chroot @@ -21,14 +21,14 @@ systemctl disable ssh /usr/sbin/update-rc.d -f ssh remove systemctl disable openvpn /usr/sbin/update-rc.d -f openvpn remove -systemctl disable dnsmasq -/usr/sbin/update-rc.d -f dnsmasq remove systemctl disable lldpd /usr/sbin/update-rc.d -f lldpd remove systemctl enable ssh-session-cleanup -/usr/sbin/update-rc.d -f conntrackd remove systemctl disable conntrackd -/usr/sbin/update-rc.d -f mdns-repeater remove +/usr/sbin/update-rc.d -f conntrackd remove systemctl disable mdns-repeater -/usr/sbin/update-rc.d -f udp-broadcast-relay remove +/usr/sbin/update-rc.d -f mdns-repeater remove systemctl disable udp-broadcast-relay{1.99} +/usr/sbin/update-rc.d -f udp-broadcast-relay remove +systemctl disable pdns-recursor +/usr/sbin/update-rc.d -f pdns-recursor remove -- cgit v1.2.3 From 4c3031a6bed9d590c27ee71d99c8a8386b266f51 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 26 Apr 2018 23:12:16 +0200 Subject: T610: Add qemu-guest-agent into VyOS ISO --- data/package-lists/vyos-x86.list.chroot | 1 + 1 file changed, 1 insertion(+) diff --git a/data/package-lists/vyos-x86.list.chroot b/data/package-lists/vyos-x86.list.chroot index cfd318ca..8c97f5da 100644 --- a/data/package-lists/vyos-x86.list.chroot +++ b/data/package-lists/vyos-x86.list.chroot @@ -1,3 +1,4 @@ grub2 grub-pc open-vm-tools +qemu-guest-agent -- cgit v1.2.3 From 4ef9a8fc1a3edb7feb9049b2d53eb3fd07c82dfa Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 30 Apr 2018 06:04:06 +0200 Subject: T584: include Mellanox OFED drivers in the image. --- data/package-lists/vyos-x86.list.chroot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/package-lists/vyos-x86.list.chroot b/data/package-lists/vyos-x86.list.chroot index 8c97f5da..300f97dd 100644 --- a/data/package-lists/vyos-x86.list.chroot +++ b/data/package-lists/vyos-x86.list.chroot @@ -2,3 +2,7 @@ grub2 grub-pc open-vm-tools qemu-guest-agent + +mlnx-ofed-kernel-modules +iser-modules +ofed-scripts -- cgit v1.2.3 From 40ff4c4fcfdf2d7961eb73bc0414bceef7f17ded Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 1 May 2018 15:56:51 +0900 Subject: Fix build script for vagrant libvirt box See Vagrant Version Constraints: https://www.vagrantup.com/docs/boxes/versioning.html#version-constraints --- scripts/build-vagrant-libvirt-box | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/build-vagrant-libvirt-box b/scripts/build-vagrant-libvirt-box index 7aff4eda..95ea9d4b 100755 --- a/scripts/build-vagrant-libvirt-box +++ b/scripts/build-vagrant-libvirt-box @@ -54,16 +54,18 @@ fi PROVIDER=libvirt # Create version -curl -XPOST -d "version[version]=${VERSION}" \ +date=$(date -u +%Y%m%d) +version=$(echo "$date.0.0") +curl -XPOST -d "version[version]=${version}" \ https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/versions?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} echo # Create provider curl -XPOST -d "provider[name]=${PROVIDER}" -d "provider[url]=${VAGRANT_BOX_BASE_URL}/vyos-${VERSION}-vagrant-${PROVIDER}.box" \ - https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${VERSION}/providers?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} + https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${version}/providers?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} echo # Release version curl -XPUT \ - https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${VERSION}/release?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} + https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${version}/release?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} echo -- cgit v1.2.3 From bc454be832aef40c58180b2175e2cd573a98daf1 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 1 May 2018 16:24:03 +0900 Subject: Fix bad URI of vagrant box URL --- scripts/build-vagrant-libvirt-box | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build-vagrant-libvirt-box b/scripts/build-vagrant-libvirt-box index 95ea9d4b..070b3ef7 100755 --- a/scripts/build-vagrant-libvirt-box +++ b/scripts/build-vagrant-libvirt-box @@ -61,7 +61,8 @@ curl -XPOST -d "version[version]=${version}" \ echo # Create provider -curl -XPOST -d "provider[name]=${PROVIDER}" -d "provider[url]=${VAGRANT_BOX_BASE_URL}/vyos-${VERSION}-vagrant-${PROVIDER}.box" \ +urlencoded_version=$(cat build/version | sed 's/+/%2B/') +curl -XPOST -d "provider[name]=${PROVIDER}" -d "provider[url]=${VAGRANT_BOX_BASE_URL}/vyos-${urlencoded_version}-vagrant-${PROVIDER}.box" \ https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${version}/providers?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} echo -- cgit v1.2.3 From fb1dc1fa29e7a0b028584ba02dbfaf7555ee40d9 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 5 May 2018 20:28:39 +0200 Subject: T620: include iperf in the image. --- data/live-build-config/package-lists/vyos-utils.list.chroot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/live-build-config/package-lists/vyos-utils.list.chroot b/data/live-build-config/package-lists/vyos-utils.list.chroot index de0f6d00..dbf7827c 100644 --- a/data/live-build-config/package-lists/vyos-utils.list.chroot +++ b/data/live-build-config/package-lists/vyos-utils.list.chroot @@ -14,3 +14,5 @@ vim screen minicom wakeonlan +iperf +iperf3 -- cgit v1.2.3 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 From 10fc439940f5f2e8ab5053d1587b8bd256944492 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 15 May 2018 03:51:28 +0200 Subject: Reduce image bloat. 1. Do not install "recommended" packages 2. Do not keep apt indices in the binary image 3. Clean up firmware packages that are installed by metapackages but are not required for for network or storage hardware. 4. Revert vim to vim-tiny --- data/live-build-config/hooks/22-cleanup-packages.chroot | 14 ++++++++++++++ .../live-build-config/package-lists/vyos-utils.list.chroot | 2 +- scripts/live-build-config | 4 +++- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100755 data/live-build-config/hooks/22-cleanup-packages.chroot diff --git a/data/live-build-config/hooks/22-cleanup-packages.chroot b/data/live-build-config/hooks/22-cleanup-packages.chroot new file mode 100755 index 00000000..db1a6bfb --- /dev/null +++ b/data/live-build-config/hooks/22-cleanup-packages.chroot @@ -0,0 +1,14 @@ +#!/bin/sh + +# Clean up packages that were installed for dependencies but are no longer needed +# and packages installed by metapackages that we'll never need + +UNWANTED_PKGS="dahdi-firmware-nonfree \ + firmware-crystalhd firmware-ivtv \ + firmware-samsung" + +for p in $UNWANTED_PKGS; do + apt-get -y remove $p +done + +apt-get -y autoremove diff --git a/data/live-build-config/package-lists/vyos-utils.list.chroot b/data/live-build-config/package-lists/vyos-utils.list.chroot index dbf7827c..7579f874 100644 --- a/data/live-build-config/package-lists/vyos-utils.list.chroot +++ b/data/live-build-config/package-lists/vyos-utils.list.chroot @@ -10,7 +10,7 @@ socat telnet tcpdump nano -vim +vim-tiny screen minicom wakeonlan diff --git a/scripts/live-build-config b/scripts/live-build-config index 15df7aa8..b8ad3daa 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -53,7 +53,9 @@ lb config noauto \ --archive-areas "main contrib non-free" \ --firmware-chroot true \ --updates true \ - --security true + --security true \ + --apt-recommends false \ + --apt-indices false "${@}" """ -- cgit v1.2.3 From dec67cc9a39eee9f220411fd61ba20df6b6466e8 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 15 May 2018 11:07:55 +0900 Subject: Fix version number for vagrant libvirt box --- scripts/build-vagrant-libvirt-box | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/build-vagrant-libvirt-box b/scripts/build-vagrant-libvirt-box index 070b3ef7..4d3482df 100755 --- a/scripts/build-vagrant-libvirt-box +++ b/scripts/build-vagrant-libvirt-box @@ -54,8 +54,9 @@ fi PROVIDER=libvirt # Create version -date=$(date -u +%Y%m%d) -version=$(echo "$date.0.0") +major=$(cat build/version | cut -d'+' -f2 | rev | cut -c 5- | rev) +sub=$(cat build/version | cut -d'+' -f2 | rev | cut -c 1-4 | rev) +version=$(echo "$major.$sub.0") curl -XPOST -d "version[version]=${version}" \ https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/versions?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} echo -- cgit v1.2.3 From d26c149dc0476401fb01f5a7a826629a665f6834 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 15 May 2018 04:42:28 +0200 Subject: T637: remove tcpdump from the "extras" to move it to the vyos-1x dependencies. --- data/live-build-config/package-lists/vyos-utils.list.chroot | 1 - 1 file changed, 1 deletion(-) diff --git a/data/live-build-config/package-lists/vyos-utils.list.chroot b/data/live-build-config/package-lists/vyos-utils.list.chroot index 7579f874..44372082 100644 --- a/data/live-build-config/package-lists/vyos-utils.list.chroot +++ b/data/live-build-config/package-lists/vyos-utils.list.chroot @@ -8,7 +8,6 @@ netcat netcat6 socat telnet -tcpdump nano vim-tiny screen -- cgit v1.2.3 From 0b1c3737dd1425ee8e9d7af7385110ec2551e437 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 15 May 2018 07:34:44 +0200 Subject: Re-enable installing recommended packages, disabling them breaks the image. --- data/live-build-config/hooks/22-cleanup-packages.chroot | 2 +- scripts/live-build-config | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/data/live-build-config/hooks/22-cleanup-packages.chroot b/data/live-build-config/hooks/22-cleanup-packages.chroot index db1a6bfb..63be7df6 100755 --- a/data/live-build-config/hooks/22-cleanup-packages.chroot +++ b/data/live-build-config/hooks/22-cleanup-packages.chroot @@ -11,4 +11,4 @@ for p in $UNWANTED_PKGS; do apt-get -y remove $p done -apt-get -y autoremove +#apt-get -y autoremove diff --git a/scripts/live-build-config b/scripts/live-build-config index b8ad3daa..5814bf89 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -54,7 +54,6 @@ lb config noauto \ --firmware-chroot true \ --updates true \ --security true \ - --apt-recommends false \ --apt-indices false "${@}" """ -- cgit v1.2.3 From 31e9d449932078565e4b2f071f9036dc800ad9ec Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 15 May 2018 15:58:45 +0900 Subject: Fix Version is too large error when creating version to vagrant cloud --- scripts/build-vagrant-libvirt-box | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/build-vagrant-libvirt-box b/scripts/build-vagrant-libvirt-box index 4d3482df..88aa9088 100755 --- a/scripts/build-vagrant-libvirt-box +++ b/scripts/build-vagrant-libvirt-box @@ -55,8 +55,9 @@ PROVIDER=libvirt # Create version major=$(cat build/version | cut -d'+' -f2 | rev | cut -c 5- | rev) -sub=$(cat build/version | cut -d'+' -f2 | rev | cut -c 1-4 | rev) -version=$(echo "$major.$sub.0") +sub=$(cat build/version | cut -d'+' -f2 | rev | cut -c 3-4 | rev) +minor=$(cat build/version | cut -d'+' -f2 | rev | cut -c 1-2 | rev) +version=$(echo "$major.$sub.$minor") curl -XPOST -d "version[version]=${version}" \ https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/versions?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} echo -- cgit v1.2.3 From d9e596d0c6c4c78cb664ab527e7fbd58a68b2d96 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 15 May 2018 16:52:17 +0900 Subject: More fix for version number for vagrant libvirt box --- scripts/build-vagrant-libvirt-box | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build-vagrant-libvirt-box b/scripts/build-vagrant-libvirt-box index 88aa9088..6db77c2a 100755 --- a/scripts/build-vagrant-libvirt-box +++ b/scripts/build-vagrant-libvirt-box @@ -54,9 +54,9 @@ fi PROVIDER=libvirt # Create version -major=$(cat build/version | cut -d'+' -f2 | rev | cut -c 5- | rev) -sub=$(cat build/version | cut -d'+' -f2 | rev | cut -c 3-4 | rev) -minor=$(cat build/version | cut -d'+' -f2 | rev | cut -c 1-2 | rev) +major=$(cat build/version | cut -d'+' -f2 | cut -d'-' -f1 | rev | cut -c 5- | rev) +sub=$(cat build/version | cut -d'+' -f2 | cut -d'-' -f1 | rev | cut -c 3-4 | rev) +minor=$(cat build/version | cut -d'+' -f2 | cut -d'-' -f1 | rev | cut -c 1-2 | rev) version=$(echo "$major.$sub.$minor") curl -XPOST -d "version[version]=${version}" \ https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/versions?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} -- cgit v1.2.3 From 94cfaf7c9223b4e6a5fab63d28160f6c68bdc2dc Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 17 May 2018 07:37:13 +0200 Subject: T574: set the hostname in the default config to make sure it's set correctly on boot. --- .../live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default | 1 + 1 file changed, 1 insertion(+) diff --git a/data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default b/data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default index f5ec2b5d..0a75716b 100644 --- a/data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default +++ b/data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default @@ -1,4 +1,5 @@ system { + host-name vyos login { user vyos { authentication { -- cgit v1.2.3 From ad61428195b6c9a976132940ea375c212e78e8ab Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 20 May 2018 06:22:38 +0200 Subject: Rename the hook for package cleanup to make room for other hooks, it should be executed last, or at least after all other steps that do package installation are complete. --- data/live-build-config/hooks/22-cleanup-packages.chroot | 14 -------------- data/live-build-config/hooks/99-cleanup-packages.chroot | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) delete mode 100755 data/live-build-config/hooks/22-cleanup-packages.chroot create mode 100755 data/live-build-config/hooks/99-cleanup-packages.chroot diff --git a/data/live-build-config/hooks/22-cleanup-packages.chroot b/data/live-build-config/hooks/22-cleanup-packages.chroot deleted file mode 100755 index 63be7df6..00000000 --- a/data/live-build-config/hooks/22-cleanup-packages.chroot +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# Clean up packages that were installed for dependencies but are no longer needed -# and packages installed by metapackages that we'll never need - -UNWANTED_PKGS="dahdi-firmware-nonfree \ - firmware-crystalhd firmware-ivtv \ - firmware-samsung" - -for p in $UNWANTED_PKGS; do - apt-get -y remove $p -done - -#apt-get -y autoremove diff --git a/data/live-build-config/hooks/99-cleanup-packages.chroot b/data/live-build-config/hooks/99-cleanup-packages.chroot new file mode 100755 index 00000000..63be7df6 --- /dev/null +++ b/data/live-build-config/hooks/99-cleanup-packages.chroot @@ -0,0 +1,14 @@ +#!/bin/sh + +# Clean up packages that were installed for dependencies but are no longer needed +# and packages installed by metapackages that we'll never need + +UNWANTED_PKGS="dahdi-firmware-nonfree \ + firmware-crystalhd firmware-ivtv \ + firmware-samsung" + +for p in $UNWANTED_PKGS; do + apt-get -y remove $p +done + +#apt-get -y autoremove -- cgit v1.2.3 From 17de291859b87bfb7d477adbe1a40d19f3f61ae0 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 20 May 2018 10:04:31 +0200 Subject: T561: split vyos and debian repos. --- scripts/defaults.py | 2 +- scripts/live-build-config | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/defaults.py b/scripts/defaults.py index bb6f0910..93eadc30 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -33,7 +33,7 @@ PBUILDER_DIR = os.path.join(BUILD_DIR, 'pbuilder') LB_CONFIG_DIR = os.path.join(BUILD_DIR, 'config') CHROOT_INCLUDES_DIR = os.path.join(LB_CONFIG_DIR, 'includes.chroot') -VYOS_MIRROR = 'http://dev.packages.vyos.net/repositories/current/vyos' +VYOS_MIRROR = 'http://dev.packages.vyos.net/repositories/current' VYOS_BRANCH = 'current' diff --git a/scripts/live-build-config b/scripts/live-build-config index 5814bf89..b1a77b4c 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -65,16 +65,19 @@ debug = build_config['debug'] # Add the additional repositories to package lists print("Setting up additional APT entries") -vyos_repo_entry = "deb {0} {1} main\n".format(build_config['vyos_mirror'], build_config['vyos_branch']) +vyos_repo_entry = "deb {0}/vyos {1} main\n".format(build_config['vyos_mirror'], build_config['vyos_branch']) +vyos_debian_repo_entry = "deb {0}/debian {1} main\n".format(build_config['vyos_mirror'], build_config['vyos_branch']) apt_file = os.path.join(build_config['build_dir'], defaults.VYOS_REPO_FILE) if debug: print("Adding these entries to {0}:".format(apt_file)) print("\t", vyos_repo_entry) + print("\t", vyos_debian_repo_entry) with open(apt_file, 'w') as f: f.write(vyos_repo_entry) + f.write(vyos_debian_repo_entry) # Configure live-build -- cgit v1.2.3 From 7ede5bb6995b64bd0afbadd94e2cef56de168725 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 4 Jun 2018 21:01:01 +0200 Subject: Added vyatta-quagga submodule --- .gitmodules | 3 +++ packages/vyatta-quagga | 1 + 2 files changed, 4 insertions(+) create mode 160000 packages/vyatta-quagga diff --git a/.gitmodules b/.gitmodules index 7ec3cb00..773dd113 100644 --- a/.gitmodules +++ b/.gitmodules @@ -136,3 +136,6 @@ [submodule "packages/vyatta-iproute"] path = packages/vyatta-iproute url = https://github.com/vyos/vyatta-iproute.git +[submodule "packages/vyatta-quagga"] + path = packages/vyatta-quagga + url = https://github.com/vyos/vyatta-quagga.git diff --git a/packages/vyatta-quagga b/packages/vyatta-quagga new file mode 160000 index 00000000..b721e84e --- /dev/null +++ b/packages/vyatta-quagga @@ -0,0 +1 @@ +Subproject commit b721e84e0915406cb5458fea7f444b45b5d1196a -- cgit v1.2.3 From 3af1486d488be0ce450b0f92fed3d45221bdac9f Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 6 Jun 2018 21:52:28 +0200 Subject: T596: replace + in new version format by - The new version scheme was introduced in commit d2e4f63f03 ("T596: use a more descriptive dev build version format.". It superseeded the old 999.something version numbers. New version numbers for rolling releases are in the form of vyos-1.2.0-rolling+201806062125-amd64.iso but the '+' sign will be replaced by '%2B' when e.g. downloading the file via http(s), this may be confusing. --- scripts/make-version-file | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/make-version-file b/scripts/make-version-file index 0459b8bf..bdf489d7 100755 --- a/scripts/make-version-file +++ b/scripts/make-version-file @@ -56,7 +56,7 @@ if build_config['build_type'] == 'development': git_branch = repo.active_branch.name branch_version = version_mapping[git_branch] - version = "{0}-rolling+{1}".format(branch_version, build_timestamp) + version = "{0}-rolling-{1}".format(branch_version, build_timestamp) except Exception as e: print("Could not build a version string specific to git branch, falling back to default: {0}".format(str(e))) version = "999.{0}".format(build_timestamp) @@ -71,7 +71,6 @@ version_data = { 'build_id': build_id } - with open(os.path.join(defaults.CHROOT_INCLUDES_DIR, 'opt/vyatta/etc/version.json'), 'w') as f: json.dump(version_data, f) -- cgit v1.2.3 From 82d7ddb1b34e36fa399fd333efc716add8bf341a Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 8 Jun 2018 21:17:38 +0200 Subject: Move the version.json file used by newer code to /usr/share/vyos --- scripts/make-version-file | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/make-version-file b/scripts/make-version-file index bdf489d7..95574722 100755 --- a/scripts/make-version-file +++ b/scripts/make-version-file @@ -56,7 +56,7 @@ if build_config['build_type'] == 'development': git_branch = repo.active_branch.name branch_version = version_mapping[git_branch] - version = "{0}-rolling-{1}".format(branch_version, build_timestamp) + version = "{0}-rolling+{1}".format(branch_version, build_timestamp) except Exception as e: print("Could not build a version string specific to git branch, falling back to default: {0}".format(str(e))) version = "999.{0}".format(build_timestamp) @@ -71,7 +71,9 @@ version_data = { 'build_id': build_id } -with open(os.path.join(defaults.CHROOT_INCLUDES_DIR, 'opt/vyatta/etc/version.json'), 'w') as f: + +os.makedirs(os.path.join(defaults.CHROOT_INCLUDES_DIR, 'usr/share/vyos'), exist_ok=True) +with open(os.path.join(defaults.CHROOT_INCLUDES_DIR, 'usr/share/vyos/version.json'), 'w') as f: json.dump(version_data, f) # For backwards compatibility with 'add system image' script from older versions -- cgit v1.2.3 From 8bc62d4d7d6caa55a2f764082665e64e9bd46001 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 8 Jun 2018 21:19:16 +0200 Subject: Use os.makedirs instead of distutils stuff, make the configure script more verbose, pretty print build-config.json --- scripts/build-config | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/build-config b/scripts/build-config index a18e95ee..27a6c7ba 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -30,7 +30,6 @@ import os import getpass import platform import json -import distutils.dir_util import defaults @@ -115,7 +114,8 @@ if env_check_retval > 0: # Save to file -distutils.dir_util.mkpath(defaults.BUILD_DIR) - +os.makedirs(defaults.BUILD_DIR, exist_ok=True) +print("Saving the build config to {0}".format(defaults.BUILD_CONFIG)) with open(defaults.BUILD_CONFIG, 'w') as f: - json.dump(args, f) + json.dump(args, f, indent=4, sort_keys=True) + print("\n", file=f) -- cgit v1.2.3 From 716e12f7fe4394ecd66cb67400fe8473a06382ae Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 9 Jun 2018 23:40:52 +0700 Subject: Typo fixes and improvements for the readme --- README.md | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 484484e3..6c6c0f1e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ VyOS toplevel build =================== -# WARNING +# Important! -This repository is for building the VyOS version that is to become 1.2.0 and that is currently in beta testing. -For 1.1.x, use the build-iso repository. +This repository is for building the VyOS version 1.2.0 and above. +For VyOS 1.1.x, use the build-iso repository. # What is VyOS @@ -43,23 +43,25 @@ There are several directories with their own purpose: ## Prerequisites -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. +To build a VyOS image, you need Debian 8 "Jessie" environment (with jessie-backports repository). You can create it with [debootstrap](https://wiki.debian.org/Debootstrap) on Debian, Ubuntu and many other distributions. To create a Debian 8 "Jessie" environment under vyos-chroot directory, run these commands: ``` -$ sudo apt install debootstrap (Note: This is on Debian/Ubuntu, adjust it with your favorite distro package manager) +$ sudo apt-get install debootstrap # (Note: This is on Debian/Ubuntu, adjust it for 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 +# apt-get 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. +Several packages are required for building the ISO: python3, live-build, pbuilder, python3-pystache. The ./configure script +will warn you if any dependencies are missing. +Individual packages may have other build dependencies. If some dependencies are missing, package build scripts will tell you. + ## Building the ISO image inside a docker container Using Dockerfile you can create your own docker container that can be used to build a VyOS ISO image. -The Dockerfile contains some of the most used packages needed for a VyOs build ISO process. +The Dockerfile contains some of the most used packages needed for a VyOS build ISO process. ``` squashfs-tools # Required for squashfs file system @@ -85,7 +87,7 @@ libnfnetlink-dev # Optional, for building vyatta-cfg-vpn vim # Optional, vim, vi, nano or other text editor ``` -To build the docker image +To build the docker image: ``` docker build -t vyos-builder $PATH_TO_Dockerfile @@ -97,7 +99,7 @@ To run the docker image: docker run --privileged -v /HOST_PATH/images:/vyos --name=vyos_node_builder -d vyos-builder bash ``` * docker container must be run with --privileged flag -* is recommended to run the container with a volume mapped in order to easy export built VyOs ISO images +* is recommended to run the container with a volume mapped in order to easy export built VyOS ISO images to the "external" world To connect to the docker image once is running: @@ -106,7 +108,7 @@ docker exec -it vyos_node_builder bash ``` After the docker container is running you can git clone the vyos-build repository inside the container -and follow up the bellow instructions in order to build the VyOs ISO image +and follow up the bellow instructions in order to build the VyOS ISO image ## Building the ISO image @@ -153,4 +155,8 @@ This is hard to change in existing code, so this is just the way it is, for now. All new code goes to the 'current' branch. When it's time for a code freeze, a new branch is created for the release, and new code from 'current' is backported to the release branch as needed. +In packages that originate from VyOS the master branch is kept in sync with "current", but we still use +"current" as default branch for uniformity. When the last legacy package is gone, we will switch to using +the master branch and retire "current". + For branch naming we use chemical elements (hydrogen, helium, ...). -- cgit v1.2.3 From b800294d7ad202061360affc774f8a1205765de2 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 14 Jun 2018 21:45:34 +0200 Subject: T697: move lsof and iftop to the utils package list. --- data/live-build-config/package-lists/vyos-utils.list.chroot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/live-build-config/package-lists/vyos-utils.list.chroot b/data/live-build-config/package-lists/vyos-utils.list.chroot index 44372082..21939d85 100644 --- a/data/live-build-config/package-lists/vyos-utils.list.chroot +++ b/data/live-build-config/package-lists/vyos-utils.list.chroot @@ -15,3 +15,5 @@ minicom wakeonlan iperf iperf3 +iftop +lsof -- cgit v1.2.3 From 7cffba7a60f89b9a18e627f48dfb37a551397295 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 15 Jun 2018 14:48:30 +0200 Subject: T697: add openssh-client to the utils package list. VyOS scripts do not use it, but people certainlt do. --- data/live-build-config/package-lists/vyos-utils.list.chroot | 1 + 1 file changed, 1 insertion(+) diff --git a/data/live-build-config/package-lists/vyos-utils.list.chroot b/data/live-build-config/package-lists/vyos-utils.list.chroot index 21939d85..bc5d8e7e 100644 --- a/data/live-build-config/package-lists/vyos-utils.list.chroot +++ b/data/live-build-config/package-lists/vyos-utils.list.chroot @@ -17,3 +17,4 @@ iperf iperf3 iftop lsof +openssh-client -- cgit v1.2.3 From 85bc557f4c458c08b096abfd5100cc324a2a2ee0 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 21 Jun 2018 21:46:00 +0200 Subject: T703: add 'nmap' to utils package list VyOS scripts do not use it, people certainly do. --- data/live-build-config/package-lists/vyos-utils.list.chroot | 1 + 1 file changed, 1 insertion(+) diff --git a/data/live-build-config/package-lists/vyos-utils.list.chroot b/data/live-build-config/package-lists/vyos-utils.list.chroot index bc5d8e7e..94a90cf6 100644 --- a/data/live-build-config/package-lists/vyos-utils.list.chroot +++ b/data/live-build-config/package-lists/vyos-utils.list.chroot @@ -18,3 +18,4 @@ iperf3 iftop lsof openssh-client +nmap -- cgit v1.2.3