Table of Contents

Compiling Voyage Kernel

Modifying Kernel on Existing System

Update system and install packages:

  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.

This is required to enable some options not included by default.

Install the requiered packages to build the kernel.

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

Download and install voyage kernel source code package.

Finding the current kernel version by uname:

  uname -a
  Linux imavoyage 3.10.11-586-voyage-20140228 #3 SMP Fri Feb 28 13:40:24 CET 2014 i686 GNU/Linux

Download new kernel or current kernel if we only change some installation option.

wget http://www.voyage.hk/dists/0.9/linux/linux-source-3.14.12-voyage_15.0-1_all.deb
Get:1 http://www.voyage.hk/dists/0.9/ ./ linux-source-3.10.11-voyage 13.0-1 [86.9 MB]     
dpkg -i linux-source-3.0.0-voyage_10.0-1_all.deb

Alternative using apt-get:

apt-cache search linux-source
linux-source-3.2 - Linux kernel source for version 3.2 with Debian patches
linux-source - Linux kernel source (meta-package)
linux-source-2.6 - Linux kernel source (dummy package)
linux-source-3.4.4-voyage - Linux kernel source for version 3.4.4-voyage
linux-source-3.10.11-voyage - Linux kernel source for version 3.10.11-voyage
linux-source-3.14.12-voyage - Linux kernel source for version 3.14.12-voyage
linux-source-3.12.9-voyage - Linux kernel source for version 3.12.9-voyage
linux-source-3.8.11-voyage - Linux kernel source for version 3.8.11-voyage
linux-source-3.8.13-voyage - Linux kernel source for version 3.8.13-voyage
linux-source-3.6.9-voyage - Linux kernel source for version 3.6.9-voyage
root@imavoyage:~/kernel_ws# uname -a
Linux imavoyage 3.10.11-586-voyage-20140228 #3 SMP Fri Feb 28 13:40:24 CET 2014 i686 GNU/Linux

The source is now available in /usr/src/*.tar.gz

  tar xvjf linux-source-3.10.11-voyage.tar.bz2
  

Prepare .config file

Use current kernel-config

  cd /usr/src
  cp /boot/config-3.10.11-586-voyage-20140228 ./
  

Use other .config

  # 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

Make config

  cd /usr/src/linux-source-3.10.11-voyage
  cp ../config-3.0.0-voyage_10.0-1 .config

Select module and packages

Make sure following are set.

Posix_mqueue

  grep CONFIG_POSIX_MQUEUE .config
  CONFIG_POSIX_MQUEUE=y
  CONFIG_POSIX_MQUEUE_SYSCTL=y

Atheros AR9300 wifi

grep -i ath .config

# CONFIG_MATH_EMULATION is not set
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_BT_HCIUART_ATH3K=y
CONFIG_BT_ATH3K=m
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_MD_MULTIPATH=m
CONFIG_DM_MULTIPATH=m
CONFIG_DM_MULTIPATH_QL=m
CONFIG_DM_MULTIPATH_ST=m
CONFIG_NET_VENDOR_ATHEROS=y
CONFIG_ATH_COMMON=m
CONFIG_ATH_CARDS=m
CONFIG_ATH_DEBUG=y
CONFIG_ATH5K=m
CONFIG_ATH5K_DEBUG=y
CONFIG_ATH5K_TRACER=y
CONFIG_ATH5K_PCI=y
CONFIG_ATH9K_HW=m
CONFIG_ATH9K_COMMON=m
CONFIG_ATH9K_BTCOEX_SUPPORT=y
CONFIG_ATH9K=m
CONFIG_ATH9K_PCI=y
CONFIG_ATH9K_AHB=y
CONFIG_ATH9K_DEBUGFS=y
CONFIG_ATH9K_MAC_DEBUG=y
CONFIG_ATH9K_LEGACY_RATE_CONTROL=y
CONFIG_ATH9K_HTC=m
CONFIG_ATH9K_HTC_DEBUGFS=y
CONFIG_ATH6KL=m
CONFIG_ATH6KL_SDIO=m
CONFIG_ATH6KL_USB=m
CONFIG_ATH6KL_DEBUG=y
CONFIG_ATH6KL_TRACING=y
CONFIG_SECURITY_PATH=y

iptable_nat

grep -i nat linux-image-3.10.11-voyage-4-ima_20150308_i386.config
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y
CONFIG_NF_NAT=m
CONFIG_NF_NAT_NEEDED=y
CONFIG_NF_NAT_PROTO_DCCP=m
CONFIG_NF_NAT_PROTO_UDPLITE=m
CONFIG_NF_NAT_PROTO_SCTP=m
CONFIG_NF_NAT_AMANDA=m
CONFIG_NF_NAT_FTP=m
CONFIG_NF_NAT_IRC=m
CONFIG_NF_NAT_SIP=m
CONFIG_NF_NAT_TFTP=m
CONFIG_NF_NAT_IPV4=m
CONFIG_NF_NAT_SNMP_BASIC=m
CONFIG_NF_NAT_PROTO_GRE=m
CONFIG_NF_NAT_PPTP=m
CONFIG_NF_NAT_H323=m
CONFIG_NF_NAT_IPV6=m
CONFIG_BRIDGE_EBT_T_NAT=m
CONFIG_BRIDGE_EBT_DNAT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_NET_ACT_NAT=m
# Controllers with non-SFF native interface
CONFIG_NET_VENDOR_NATSEMI=y
CONFIG_NATSEMI=m
CONFIG_NATIONAL_PHY=m
# Native drivers
CONFIG_CHECK_SIGNATURE=y

Compile Kernel

  
  uname -a
  Linux imavoyage 3.10.11-586-voyage-20140228 #3 SMP Fri Feb 28 13:40:24 CET 2014 i686 GNU/Linux
  fakeroot make-kpkg --append_to_version -486-voyage --revision=3.0-2Cust kernel_image --initrd

Kernel version look like this [linux-source-][3.10.11][-voyage]

New kernel version look like this [linux-source-3.10.11][-my_voyage]_[20150306]
Appendtoversion: the part after kernel version [-my_voyage]

Revision: [20150306]

make-kpkg also accepts several parameters: –append-to-version suffix appends suffix to the name of the kernel; the suffix is also included in the package name. –revision revision defines the version number of the package generated. Debian uses certain suffixes to identify standard kernels, compiled specifically for a given processor, or with certain options (-486, -686, -686-bigmem, -amd64, -vserver-686, -vserver-686-bigmem, -openvz-686, -xen-686). These suffixes are best avoided for local packages, so that they can be easily recognized from official packages issued by the Debian project. The make-kpkg program performs actions normally restricted to the root user when creating the Debian package; however, it can be tricked into working under a normal user's identity, with fakeroot (see sidebar TOOL fakeroot).

fakeroot make-kpkg --append-to-version -falcot --revision 1 --initrd kernel-image 
[...]
$ ls ../*.deb
../linux-image-2.6.32-falcot_1_i386.deb

Final command

   CONCURRENCY_LEVEL=3 fakeroot make-kpkg --append_to_version "-586-voyage" --revision="-ima-20150403" kernel_image --initrd
   

The compilation will takes forever!!!

Copy to host machine

   sudo scp -rp /usr/src/linux-image-3.10.11-voyage-i386-ima-20150305_3.10.11-voyage-i386-ima-20150305-10.00.Custom_i386.deb \
   root@192.168.101.1:/home/dang/data/src/01_ima_ws/ima_carpc_ws/carpc_hw_openwrt/voyage_linux/voyage_kernel/
   

Compile Kernel on a Compatible Machine

For voyage 9.2 we use Debian 7.2.0.

/mnt/vm00/deb702...-ext1.sh

Do the same like above. Compile as root otherwise ncurses-dev path will not be found.

Installing Kernel

  cp kernel.deb root@voyage.local:~/kernel.deb
  dpkg -i kernel.deb
  

Change GRUB boot order

  grub-update
  vim /boot/grub/menu.lst

Change defautl to the index of the default kernel to load (count from 1!)

Remove Custom Compiled Kernel