Tuesday, January 19, 2010

My home OpenBSD interVLAN routing and Cisco 2900 vlan trunking

On OPenBSD

# cat /etc/hostname.sis1 /etc/hostname.vlan3 /etc/hostname.vlan4
inet 192.168.2.1 255.255.255.0 192.168.2.255

vlan 3 vlandev sis1
description "DMZ"
inet 192.168.3.1 255.255.255.0
up

vlan 4 vlandev sis1
description "VOIP"
inet 192.168.4.1 255.255.255.0
up
#

On Cisco 2900

Switch#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/5, Fa0/6, Fa0/7, Fa0/9,
Fa0/10, Fa0/11, Fa0/12, Fa0/13,
Fa0/14, Fa0/15, Fa0/16, Fa0/17,
Fa0/18, Fa0/19, Fa0/20, Fa0/21,
Fa0/22, Fa0/23, Fa0/24
2 VLAN0002 active Fa0/2
3 DMZ active Fa0/3, Fa0/4
4 VOIP active Fa0/8
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Switch#

Friday, January 15, 2010

Kernel UTS Release version mismatch problem

I could always build custom mainline git kernel from ubuntu following the https://wiki.ubuntu.com/KernelTeam/GitKernelBuild wiki link, but since kernel 2.6.33 release, it always complains with error like:


exec debian/rules DEBIAN_REVISION=2.6.33-rc3-test-10.00.Custom APPEND_TO_VERSION=-test kernel_image
/usr/bin/make -f ./debian/rules debian/stamp/binary/pre-linux-image-2.6.33-rc3-test
make[1]: Entering directory `/home/vincent/linux-2.6.git'
====== making target debian/stamp/install/linux-image-2.6.33-rc3-test [new prereqs: ]======
This is kernel package version 11.015.
echo "The UTS Release version in include/linux/version.h"; echo " \"\" "; echo "does not match current version:"; echo " \"2.6.33-rc3-test\" "; echo "Please correct this."; exit 2
The UTS Release version in include/linux/version.h
""
does not match current version:
"2.6.33-rc3-test"
Please correct this.
make[1]: *** [debian/stamp/install/linux-image-2.6.33-rc3-test] Error 2
make[1]: Leaving directory `/home/vincent/linux-2.6.git'
make: *** [kernel_image] Error 2



I asked this packaging error on ubuntu-kernel irc channel, someone pointed out that it is a bug of kernel-package and paste a sample working versions_var.mk file which should be located in /usr/share/kernel-package/ruleset/misc/, I tried that modified versions_var.mk file, it worked, so what is the problem, let's what is patched with versions_var.mk:

root@kernalhack:/home/vincent# diff -u version_vars.mk /usr/share/kernel-package/ruleset/misc/version_vars.mk
--- version_vars.mk 2010-01-12 11:08:24.000000000 -0800
+++ /usr/share/kernel-package/ruleset/misc/version_vars.mk 2010-01-15 21:37:44.000000000 -0800
@@ -138,11 +138,13 @@
EXTRAV_ARG :=
endif

-UTS_RELEASE_HEADER=$(call doit,if [ -f include/linux/utsrelease.h ]; then \
- echo include/linux/utsrelease.h; \
- else \
- echo include/linux/version.h ; \
- fi)
+UTS_RELEASE_HEADER=$(call doit, if [ -f include/generated/utsrelease.h ]; then \
+ echo include/generate/utsrelease.h; \
+ elif [ -f include/linux/utsrelease.h ]; then \
+ echo include/linux/utsrelease.h; \
+ else \
+ echo include/linux/version.h ; \
+ fi)
UTS_RELEASE_VERSION=$(call doit,if [ -f $(UTS_RELEASE_HEADER) ]; then \
grep 'define UTS_RELEASE' $(UTS_RELEASE_HEADER) | \
perl -nle 'm/^\s*\#define\s+UTS_RELEASE\s+("?)(\S+)\1/g && print $$2;';\


Simply adding the include/generated/utsrelease.h file test solved the problem, where this include/generated directory come from then? here I found the kernel Kbuild patch series which added include/generated:

http://patchwork.kernel.org/patch/54595/

I am still not sure how kernel kbuild works, need to dig more.

Followers