07 - 12 - 2024

XenServer 6.0 with WIFI support - how to re-compile kernel

In this article I would like to present how it is possible to re-compile kernel for Xenserver 6.0 to enable WIFI support. It is also required to have some additional components installed and re-compile.

Exlude Xenserver packages, to prevent overriding them.

# vi /etc/yum.conf

exclude=xen* xenapi* open-iscsi* PyPAM* SDL* biosdevname* device-mapper-multipath* dhclient* dhcp* directfb* fbi* gdisk* hwdata* iproute* kernel-firmware* kernel-xen* kpartx* likewise-open* lvm2* md3000-rdac* mkinitrd* nash* net-snmp* net-snmp-libs* pam* python-simplejson* sm* splashy* syslinux* upgrade-plugin* vhostmd* vncsnapshot* xcp-python-libs* xenserver-lsb* xsconsole* SysVinit* initscripts*

Add the default CentOs repository, instead the one provided by Citrix.

# rm -f /etc/yum.repos.d/CentOS-Base.repo  

# mv /etc/yum.repos.d/CentOS-Base.repo.orig  /etc/yum.repos.d/CentOS-Base.repo

The URL of repository defined under CentOS-Base.repo.orig could be expired.
In that case just refer to the to the CentOS Vault or other mirrors

# yum update

# yum install gcc make m4 ncurses-devel rpm-build redhat-rpm-config wireless-tools nano screen mc openssl-devel

Install the source package of the kernel found under XenServer-6.0.0-source-1.iso\kernel-dom0\ of XenServer source ISO.

# rpm -i kernel-2.6.32.12-0.7.1.xs6.0.0.529.170661.src.rpm

The source ISO can be found here: http://xenserver.org/overview-xenserver-open-source-virtualization/download.html

Compile the kernel sources

# cd /usr/src/redhat/SOURCES/SPEC

# screen -dm "rpmbuild -bb kernel-xen.spec --target=i686  --without kabichk"

# rpm -i /usr/src/redhat/RPMS/i686/kernel-xen-2.6.32.12-0.7.1.xs6.0.0.529.170661.i686.rpm --force

# ln -s ./redhat/BUILD/kernel-2.6.32.12/linux-2.6.32.12-0.7.1.xs6.0.0.529.170661xen/ ./linux

# ln -s ./redhat/BUILD/kernel-2.6.32.12/linux-2.6.32.12-0.7.1.xs6.0.0.529.170661xen/ /lib/modules/2.6.32.12-0.7.1.xs6.0.0.529.170661xen/build

Re-compile libnl with applied patch for it

# mkdir -p /usr/src/apps/libnl
# wget http://www.infradead.org/~tgr/libnl/files/libnl-1.1.tar.gz
# tar -C /usr/src/apps/libnl -xzvf libnl-1.1.tar.gz

 

--- libnl-1.0/lib/route/link/vlan.c.orig        2008-01-16 22:59:21.000000000 -0800
+++ libnl-1.0/lib/route/link/vlan.c     2008-01-16 22:59:36.000000000 -0800

@@ -27,6 +27,9 @@

 #include <netlink/route/link/vlan.h>
 #include <linux/if_vlan.h>

+#ifndef VLAN_FLAG_REORDER_HDR
+#define VLAN_FLAG_REORDER_HDR 0x01
+#endif

 /** @cond SKIP */

 #define VLAN_HAS_ID            (1<<0)" > /usr/src/apps/libnl/01-missing_declaration.patch

 

# patch -p1 /usr/src/apps/libnl < /usr/src/apps/libnl/01-missing_declaration.patch

# ./configure; make; make prefix=/usr install

Compat-wireless kernel module for wifi

# wget http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.6.32/compat-wireless-2.6.32.16.tar.bz2

# tar -C /usr/src/apps/compat-wireless -xjvf compat-wireless-2.6.32.16.tar.bz2

# cd /usr/src/apps/compat-wireless

# ./scripts/driver-select ath5k

# make; make install; modporbe ath5k

Compile hostapd

# wget http://hostap.epitest.fi/releases/hostapd-0.7.3.tar.gz

# tar -C /usr/src/apps/hostapd -xzvf hostapd-0.7.3.tar.gz

# cd /usr/src/apps/hostapd/hostapd
# make; make install

# chmod +x /etc/init.d/hostapd

# chkconfig --add hostapd

Add new interface to the XenServer

# xe host-list params=uuid

# xe pif-scan host-uuid=<UUID>

At this point we should have wifi working and seen under XenServer from Management Console. Ofcourse if we want to have fully working wifi in the Access Point mode, we need to configure and run hostapd service.

Attachments:
Download this file (01-missing_declaration.patch)01-missing_declaration.patch[ ]0.3 kB
Download this file (CentOS-Base.repo)CentOS-Base.repo[ ]1 kB
Download this file (CentOS-Vault.repo)CentOS-Vault.repo[ ]5 kB
Download this file (Citrix.repo)Citrix.repo[ ]0.2 kB
Download this file (hostapd.conf)hostapd.conf[ ]3 kB
Download this file (yum.conf)yum.conf[ ]0.7 kB