NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
LogicX
Feb 14, 2014Aspirant
HOW-TO: Compile Custom Kernel Modules
This example is using my setup, which happens to be a RNDU6000 which I upgraded from 4.x to be able to run 6.x OS (http://www.readynas.com/forum/viewtopic.php?f=35&t=70323) I'm creating this becaus...
siigna
Mar 07, 2014NETGEAR Expert
Great tutorial. I've been working on cross-compiling for ARM platforms, because who wants to compile an entire kernel on an ARM?
Basic steps are the same, I used the ReadyNAS App Development VM available from:
http://apps.readynas.com/pages/?page_id=127
Your modules will be available in /tmp/build/modules. For simple modules such as USB serial and such you should be OK with just copying the modules over, however more advanced things (iptables NAT for instance) require replacing the kernel as well.
Basic steps are the same, I used the ReadyNAS App Development VM available from:
http://apps.readynas.com/pages/?page_id=127
######## Setup our temporary build environment ##########
# cd
# pwd
/home/readynas
# sudo apt-get update; sudo apt-get install build-essential ia32-libs ncurses-dev
(You may run into some issues with libsane and its config files; do it live and just delete everything in /etc/sane.d/)
# wget http://www.readynas.com/download/GPL/readynasos/armv7-marvell-linux-gnueabi-hard_i686_201201.tar.xz
(This is our cross compilation toolchain for ARM)
# wget http://readynas.com/download/GPL/readynasos/ReadyNASOS_V6.1.6_WW_src.zip
# mkdir /tmp/GPL; mkdir -p /tmp/build/modules
# unzip -q ReadyNASOS_V6.1.6_WW_src.zip -d /tmp/GPL
# tar -C /tmp/build/ -xJf armv7-marvell-linux-gnueabi-hard_i686_201201.tar.xz
# cp -R /tmp/GPL/linux-3.0.101 /tmp/build/linux-3.0.101.arm
# cp /tmp/build/linux-3.0.101.arm/defconfig.arm /tmp/build/linux-3.0.101.arm/.config
######## Drop to a root shell and compile ##########
# sudo -i
# export ARCH=arm
# export PATH=$PATH:/tmp/build/Marvell_toolchain_201201/armv7-marvell-linux-gnueabi-hard_i686/bin
# export CROSS_COMPILE=arm-marvell-linux-gnueabi-
# export CORES=`nproc`
(This gets the available number of cores on the system.)
# export INSTALL_MOD_DIR=/tmp/build/modules
# cd /tmp/build/linux-3.0.101.arm
# make menuconfig
# make -j$CORES
# make -j$CORES modules_install
Your modules will be available in /tmp/build/modules. For simple modules such as USB serial and such you should be OK with just copying the modules over, however more advanced things (iptables NAT for instance) require replacing the kernel as well.
VincentNguyenQu
Oct 27, 2015Star
Good morning,
I'm looking at how to compile kernel modules following your instructions, however I run into a bunch of issues:
- if using local compilation on the NAS itself, the make command exits as it cannot find the cross compile toolchain (which is odd, since I'm using local compile...)
- when trying to use the ReadyNAS VM you reference:
- basic apt-get commands fail, trying to resolve a link which apparently does not exist anymore (even a simple apt-get install man-db fails). Likewise, apt-get update fails on several IP (which however do resolve)
- the link to the cross compiler you indicate below does not exist anymore...
Any help would be welcome
Thanks
Vincent
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!