Home > Linux > Customize Voyage Linux image

Customize Voyage Linux image

As of my later post, you get the Voyage SDK or default distribution installed on a hard disk, compact flash, etc. However, many times is it required to perform some customizations. These can be done once the system is installed and then creating an image of the whole system using dd for instance. But you might want to customize it and have an iso image created from scratch and without having to deal with a real system.

This tutorial is a mixture of both approaches, as at the beginning it is explained who to compile and install new applications or kernel, to end with the building of a Live CD, a tar.bz2 distro, etc. using Debian Live.

Installing new applications from repositories

Voyage Linux distro is Debian based so apt-get command is your friend.

# remountrw
# apt-get update
# apt-get install whatever

You can also compile your programs on your main system or in the Voyage one. If you do on your main system, be aware that the target architecture fits the one of your Voyage.

Compile and install a new kernel

This is required, as in my case, you have to enable some options not included by default.

Install the requiered packages to build the kernel. Probably some of them are already installed.

# apt-get update
# apt-get install dialog ncurses-dev build-essential zlib1g-dev kernel-package fakeroot

Download and install voyage kernel source code package.

# wget http://mirror.voyage.hk/dists/0.8/linux/linux-source-3.0.0-voyage_10.0-1_all.deb
# dpkg -i linux-source-3.0.0-voyage_10.0-1_all.deb

Install some packages that might be required

# apt-get install dialog

The source tar.bz file is located in /usr/src/

You can also use a Vanilla kernel and apply the available patches. I have not tested that, but if you do, please leave a comment.

Download the .config for the Voyage kernel

# wget http://mirror.voyage.hk/download/kernel_config/config-3.0.0-voyage_10.0-1
# cp config-3.0.0-voyage_10.0-1 /usr/src

Uncompress the kernel source code and apply the config file

# cd /usr/src
# tar xfj linux-source-3.0.0-voyage_10.0-1_all.tar.bz2
# cd linux-source-3.0.0-voyage
# cp ../config-3.0.0-voyage_10.0-1 .config

Configure your kernel (your new configuration is in .config) and compile it.

# make menuconfig
# CONCURRENCY_LEVEL=3 make-kpkg --revision="3.0newconf" --append-to-version "-jlanza-voyage" --initrd kernel-image

You can change the revision and version strings to what ever you want. If you are cross-compiling from a 64 bits machine to generate a 32 bits image, you should be aware of setting the proper options to gcc to work (-m32).

# CONCURRENCY_LEVEL=3 DEB_HOST_ARCH=i386 ARCH=i386 make-kpkg --arch i386 --cross-compile - --revision="3.0usb" --append-to-version "-486-voyage" --initrd kernel-image

Compilation takes a while, so it is time to go for a break, lunch or start doing other stuff in parallel.

Once the compilation is finished, a new kernel package should be place in /usr/src/.

# ls /usr/src/*deb

Just installed it.

# dpkg -i linux-image-3.0.0-jlanza-voyage_3.0newconf_i386.deb

Check /boot/grub/menu.lst to see that everything was configured properly.

On next reboot your grub menu will display new options including your brand new kernel.

Create a custom image

It is first advisable to check that you can build a default image prior to create your own. This way you also set some mirrors and options that will speed up the process.

# apt-get update
# apt-get upgrade
# apt-get install dialog locales

To pick your timezone

# dpkg-reconfigure tzdata

Although they should be installed in the SDK, just to check. The live-helper has to be installed to create an image or Live CD. You can use it on any Debian distro, and this way you don’t need to download the Voyage SDK image, although the procedure if you do so, it is easier.

# apt-get install subversion live-helper

Download the Debian live config from the subversion repository.

  • Specific branch (latest 0.8.0)
  • # svn co http://svn.voyage.hk/repos/voyage/branches/voyage-live/0.8.0/voyage-live
  • Trunk (Nightly build)
  • # svn co http://svn.voyage.hk/repos/voyage/trunk/voyage-live

Enter the voyage-live directory.

cd voyage-live

Edit the config/bootstrap file to fit your closer mirrors. Those are an example of links to update.

# $LB_MIRROR_BOOTSTRAP: set mirror to bootstrap from
# (Default: http://ftp.jp.debian.org/debian/)

# $LB_MIRROR_CHROOT: set mirror to fetch packages from
# (Default: http://ftp.jp.debian.org/debian/)

# $LB_MIRROR_BINARY: set mirror which ends up in the image
# (Default: http://ftp.jp.debian.org/debian/)

# $LB_MIRROR_DEBIAN_INSTALLER: set debian-installer mirror
# (Default: http://ftp.jp.debian.org/debian/)

Build your image.

# ./build.sh img 

Once done you should have a file voyage-(release).img on your directory. Just burn it on the target device with dd or whatever other application and done.

To clean up your environment for another build

# lb clean
# rm -rf auto cache
# rm voyage-(release).img

Use a customize kernel

Move the custom kernel Debian package to the voyage-live chroot local packages directory.

# cp /usr/src/linux-image-3.0.0-jlanza-voyage_3.0newconf_i386.deb voyage-live/config/chroot_local-packages

As we are using grub we can remove the lilo packages in the chroot_local-packages directory.

Depending on your kernel flavour you need to update some files.

  • Modify the config/chroot_local-packages/098-kernel. Need to change the dpkg-reconfigure line to your kernel flavour (from *-voyage.postinst to whatever your flavor is, ie *-jlanza-voyage.postinst).
  • Modify the config/bootstap
  • LB_LINUX_FLAVOURS="your_flavour"
    LB_LINUX_FLAVOURS="your_main_flavour" | "alternative_flavours"
  • Modify build.sh
  • VOYAGE_LINUX_PACKAGES="linux-image-3.0.0-jlanza-voyage" 

In order to include more packages in the image, modify the file according to your distribution (i.e. voyage for default, voyage-one, etc.) and include the name of the new packages. Any package not available in the repositories should be included in chroot_local-packages directory.

If you want to include already compiled programs that you only have the binary, I guess you have to put them in binary_local-* directory, but haven’t tested it so far.

For more information on Debian Live download or install the manual (live-manual package).

Using Debian Live on your own system

The procedure is the same as the one explained in the previous section. The only requirement is to install the Debian Live packages, as the SDK already have them.

# apt-get install subversion live-helper

Download the Voyage Debian live config from the subversion repository as explained above.


Thanks to Lee Woldanski whose hints on the mail post generated by me on the Voyage Linux mailing list helped in improving this tutorial .

Categories: Linux Tags: , , , ,
  1. john
    February 17, 2014 at 13:01

    really nice tutorial. is there a way to make it work for the latest version of 0.9.2 ? i cannot see any kernel configs for version 3.10.x

    • jlanza
      February 18, 2014 at 10:18

      The configs should be pretty similar. Every kernel is more or less the same. I’m sorry I cannoth further help you on that but currently I’m not working on Voyage anymore, at least for a while.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: