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 428c73d96ff745ba61ba834d9d2a42d5dc8ed5cd Mon Sep 17 00:00:00 2001 From: mtudosoiu 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