Howto build an ISO image

From VyOS Wiki
Jump to: navigation, search

Building a VyOS image is fairly easy and straightforward.

Preparing build machine

You need to setup Debian Squeeze.

Build architecture is selected based on host architecture, so to build 32-bit image, use 32-bit debian squeeze host; for 64-bit use 64-bit squeeze host.

Currently (VyOS Helium) does NOT compile on anything else than debian squeeze (Debian 6)

Installing Debian & VyOS archive keys

In case it's not already installed:

apt-get install debian-archive-keyring

And then follow the steps in Public_key to install the VyOS archive key.

If you skip this step, you might get warnings about untrusted packages during build.

Installing SquashFS tools

First, you will need a more recent squashfs package than squeeze has. VyOS uses extended file attributes, and older (pre 4.2) versions do not handle attributes.

It is available from squeeze-backports repository.

  1. Add this "deb http://backports.debian.org/debian-backports squeeze-backports main" to your sources.list (or add a new file with the ".list" extension to /etc/apt/sources.list.d/)
  2. Run apt-get update
  3. Run "sudo apt-get -t squeeze-backports install squashfs-tools"

Installing build dependencies

Building the ISO requires some packages not installed by default. To install them, run:

sudo apt-get install git autoconf automake dpkg-dev live-helper syslinux genisoimage

Getting the build-iso source

git clone https://github.com/vyos/build-iso.git
cd build-iso

You may want to switch the branch from the default, which is set to the current stable branch.

If you want a different branch:

git branch $branch --track origin/$branch
git checkout $branch

Building the image

After this continue with:

export PATH=/sbin:/usr/sbin:$PATH
autoreconf -i
./configure
sudo make iso

It should end with something like:

Warning: creating filesystem that does not conform to ISO-9660.
Size of boot image is 4 sectors -> No emulation
  4.61% done, estimate finish Tue Oct 22 09:28:18 2013
  9.20% done, estimate finish Tue Oct 22 09:28:18 2013
 13.80% done, estimate finish Tue Oct 22 09:28:18 2013
 18.39% done, estimate finish Tue Oct 22 09:28:18 2013
 22.99% done, estimate finish Tue Oct 22 09:28:18 2013
 27.58% done, estimate finish Tue Oct 22 09:28:18 2013
 32.19% done, estimate finish Tue Oct 22 09:28:18 2013
 36.78% done, estimate finish Tue Oct 22 09:28:18 2013
 41.38% done, estimate finish Tue Oct 22 09:28:18 2013
 45.97% done, estimate finish Tue Oct 22 09:28:18 2013
 50.57% done, estimate finish Tue Oct 22 09:28:19 2013
 55.16% done, estimate finish Tue Oct 22 09:28:19 2013
 59.76% done, estimate finish Tue Oct 22 09:28:19 2013
 64.35% done, estimate finish Tue Oct 22 09:28:19 2013
 68.96% done, estimate finish Tue Oct 22 09:28:19 2013
 73.55% done, estimate finish Tue Oct 22 09:28:19 2013
 78.15% done, estimate finish Tue Oct 22 09:28:19 2013
 82.74% done, estimate finish Tue Oct 22 09:28:19 2013
 87.34% done, estimate finish Tue Oct 22 09:28:19 2013
 91.92% done, estimate finish Tue Oct 22 09:28:20 2013
 96.53% done, estimate finish Tue Oct 22 09:28:20 2013
Total translation table size: 2048
Total rockridge attributes bytes: 9140
Total directory bytes: 22528
Path table size(bytes): 100
Max brk space used 12000
108786 extents written (212 MB)
Reading package lists... Done
Building dependency tree
Reading state information... Done
P: Deconfiguring file /etc/apt/apt.conf
P: Deconfiguring file /usr/sbin/policy-rc.d
P: Begin unmounting /sys...
P: Deconfiguring file /usr/sbin/initctl
P: Begin unmounting /selinux...
P: Begin unmounting /proc...
P: Begin unmounting /dev/pts...
P: Begin unmounting filesystems...
I: Done

If everything went fine

You will find the ISO in the livecd subdirectory:

#ls -l livecd/
total 218180
-rw-r--r--  1 root root 223346688 Oct 22 09:28 binary.iso