Building the Linux Microcore Kernel for 802.1Q Support

UPDATE This tutorial is valid for Microcore Linux up to version 3.8.x, kernel 2.6.33.3. The newest Microcore 4.0 with the kernel  3.0.3 loads 8021q module without any difficulties.

Recently I have decided to add support for 802.1Q to Microcore Linux. First I  tried to install  8021q-2.6.33.3-tinycore.tcz extension which is available for download  in the Tinycore Linux 3.x repository. This extension is 8021q module that we can simply load with command modprobe 8021q to the kernel. Unfortunately, after I tried to load the module I always kept this error message:

modprobe: can't load module 8021q (kernel/net/8021q/8021q.ko.gz): unknown symbol in module, or unknown parameter

The output from dmesg  said:

8021q: Unknown symbol vlan_dev_vlan_id

This was the same error which  was originally presented in this topic but there was not solution mentioned there except of simply saying - it is working now. Unfortunately, I deal with the error even when I had compiled 8021q module by my own. For this reason I decided to compile my own linux kernel with direct support for 8021q Vlan tagging.

The kernel version 2.6.33.3 is the kernel which is used by Linux Microcore 3.x. These are the steps you need to follow to compile and install the kernel:

1. Install Microcore Linux

I assume you have your Microcore already installed. I mainly use  Linux Microcore installed on Qemu image in GNS3 environment to simulate PC hosts on LAN. In order to start your Microcore Qemu image invoke this command:

qemu -no-acpi -boot c linux-microcore-3.6.img -m 1500M

I have noticed we need to have enough RAM assigned for the image thus to use of  tmpfs in which are files stored. Also the content saved in this filesystem will be lost after reboot. To avoid lost of new kernel we need later to do some steps to have kernel  kept in /usr/src/ after reboot.

2. Download and untar Linux kernel 2.6.33.3 which is patched for Microcore Linux

sudo su
mkdir /usr/src/
cd /home/tc/

wget http://distro.ibiblio.org/tinycorelinux/3.x/release/src/kernel/linux-2.6.33.3-patched.tbz2

tar jxvf linux-2.6.33.3.tar.bz2 -C /usr/src

Note: if you want to keep kernel persistent in /usr/src/ you have to edit /opt/.filetool.lst and add /usr/src/ to the list of after-restart kept directories.

After that you have to call /usr/bin/filetool -b

3. Install tools for compiling, download an original .config kernel file

tce-load -wi compiletc.tcz ncurses-dev perl5

Note: perl is needed by make command.

cd /usr/src/

Download kernel config file.

wget http://distro.ibiblio.org/tinycorelinux/3.x/release/src/kernel/config-2.6.33.3-tinycore

Create symbolic link /usr/src/linux pointed to /usr/src/linux-2.6.33.3 and copy config file to /usr/src/linux.

ln -sf linux-2.6.33.3 linux
cp ./config-2.6.33.3-tinycore ./linux/.config

4. Enable 8021q support in kernel config file,  build the kernel with 8021q support

a) Enable 8021q support - change kernel config file

make oldconfig
make menuconfig

Navigate to:

Network support-> Networking Options-> 8021q Support

Enter Y to include 8021q VLAN support. Exit and Save configuration to .config file.

b/ Build the  kernel

make bzImage

After finishing, your new kernel bzImage is saved to /usr/src/linux/arch/x86/boot/. Replace old kernel with the new one and reboot. After the boot,  check the version of the built kernel with uname -ra command.

mv /usr/src/linux/arch/x86/boot/bzImage /mnt/hda1/boot/

Note:  In case you don't want to bother yourself with building your kernel, you can download my bzImage. It is  the kernel 2.6.33.3, dedicated for Microcore 3.x. Just replace /mnt/hda1/boot/bzImage with this file.

http://www.4shared.com/file/VWMmD6BC/bzImage.html

Links:

http://wiki.tinycorelinux.net/wiki:custom_kernel
http://www.fogonacaixadagua.com.br/2009/09/how-to-compile-a-new-kernel-in-linux-centos-red-hat/
http://www.cyberciti.biz/tips/compiling-linux-kernel-26.html

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.