14
16

More than 5 years have passed since last update.

VyOS 1.2.x のisoイメージをビルドしてみる

Last updated at Posted at 2019-07-28

サクッと使いたい人は

めんどくせーな人はこちらから Rolling Release がダウンロードできます。いわゆる開発版。
https://downloads.vyos.io/?dir=rolling/current/amd64

VyOS 1.2.x

VyOS1.2.x は、vyos-buildリポジトリから構築することができますが、
iso イメージは誰でもダウンロードできるといった状況ではない模様。
※Rolling Release 除く

今回はRolling Releaseではなく、バージョンを決めてビルドを行います。
VyOS、1.2.2 がリリースされていました。
https://blog.vyos.io/vyos-1.2.2-maintenance-release?__hstc=29142691.437895315dbbf04166ea2a98a8ffece3.1564280140735.1564280140735.1564280140735.1&__hssc=29142691.1.1564280140736&__hsfp=377273393

ビルド

ビルド方法はこちらに記載されているので参考に。
https://github.com/vyos/vyos-build/

手順を簡単にするためDockerを使います。
ビルド環境にCentOS7 + Dockerを使いました。

準備
# git clone https://github.com/vyos/vyos-build.git

構築環境コンテナを作成
# cd vyos-build
# docker build -t vyos-builder docker

コンテナを起動させ、ログイン
# docker run --rm -it --privileged -v $(pwd):/vyos -w /vyos vyos-builder bash

ここからは docker コンテナ内で行う作業です。
iso イメージは vyos-build/build 内に作成されます。

build-type をリリース版に、バージョンを 1.2.2 に指定
$ ./configure --build-type release --version 1.2.2 

iso イメージをビルド開始
$ sudo make iso

完了したらコンテナから抜けます
$ exit

vyos-1.2.2-amd64.iso が作成されていることを確認
# ls -l build/
合計 419900
drwxr-xr-x  2 root root         6  7月 24 20:32 auto
drwxr-xr-x  7 root root       103  7月 24 21:34 binary
-rw-r--r--  1 root root       906  7月 24 20:29 build-config.json
-rw-r--r--  1 root root    384551  7月 24 21:37 build.log
drwxr-xr-x  6 root root        95  7月 24 20:32 cache
drwxr-xr-x 21 root root       224  7月 24 21:36 chroot
-rw-r--r--  1 root root   4307491  7月 24 21:06 chroot.files
-rw-r--r--  1 root root     21745  7月 24 20:51 chroot.packages.install
-rw-r--r--  1 root root     21821  7月 24 21:05 chroot.packages.live
drwxr-xr-x 19 root root      4096  7月 24 20:32 config
-rw-r--r--  1 root root     16967  7月 24 21:34 live-image-amd64.contents
-rw-r--r--  1 root root   4307491  7月 24 21:31 live-image-amd64.files
-rw-r--r--  1 root root 419430400  7月 24 21:35 live-image-amd64.hybrid.iso ★
-rw-r--r--  1 root root   1433826  7月 24 21:36 live-image-amd64.hybrid.iso.zsync
-rw-r--r--  1 root root     21821  7月 24 21:31 live-image-amd64.packages
drwxr-xr-x  3 root root        17  7月 24 20:32 local
-rw-r--r--  1 root root         6  7月 24 20:32 version
lrwxrwxrwx  1 root root        27  7月 24 21:37 vyos-1.2.2-amd64.iso -> live-image-amd64.hybrid.iso ★
# 

これでビルド完了です。なおうちの環境だと3時間30分ほどかかりました。
NUC(DN2820FYK) / Mem 8GB

# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
#
# docker -v
Docker version 18.09.7, build 2d0083d
#
# cat /proc/cpuinfo  | grep proc | wc -l
2

おまけ

QEMU版イメージ。ISOを作成した後に実行します。
$ make qemu

VMware版イメージ。QEMU版作成後に実行します。
$ make vmware

14
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
16