- You understand that this guide is only provided to Technologic Systems customers in the hopes that it will be useful. Kernel compiling is beyond the scope of free technical support offered by Technologic Systems. Custom engineering is available should you require additional paid support.
- Also understand that this guide is specific to a TS-7260, but should also be applicable to the TS-72XX, TS-7300, and TS-7400 with minor modifications which are left to the customers discretion.
- You have already permanently modified the TS-7260 to boot to the SD card by using the tsbootrom-update utility as described here: http://www.embeddedarm.com/software/arm-linux-fastboot-ts7300.php
- You have these needed packages installed for kernel compiling:
RHEL/Fedora/CentOS: su -c 'yum -y install ncurses-devel ncurses' Debian/Ubuntu: sudo apt-get install libncurses5-dev libncursesw5-dev
- You're logged into a separate Linux PC other than the SBC.
- You have an SD card image that already works with the TS-7260. This guide uses the image called "sdimage-new.dd.bz2" available on the FTP site.
- TS-7260 SBC
- USB SD Card Reader
- Development PC with Linux installed
- The cross compile toolchain (crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2)
- The kernel source(tskernel-2.4.26-ts11-src.tar.gz)
- The ts7260 defconfig file for kernel options (Included in the kernel Source)
- The original SD card image (sdimage-new.dd.bz2)
Create SD Image
1.) Download the SD Card image from the FTP site: * wget ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7260-linux/binaries/ts-images/sdimage-new.dd.bz2 2.) Use 'bzcat' and 'dd' to copy image to entire SD Card (assuming SD Card device node is located at /dev/sdb): * bzcat sdimage-new.dd.bz2 | dd of=/dev/sdb
1.) Change to your home directory * cd ~ 2.) Make a working directory to compile a kernel within * mkdir ts7200_kernel_howto 3.) Get the kernel source and crosstools from the FTP site * wget ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7260-linux/\ cross-toolchains/crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2 * wget ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7260-linux/\ sources/tskernel-2.4.26-ts11-src.tar.gz 4.) Extract the kernel source and crosstools and clean up afterwards * tar xjvf crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2 * tar xzvf tskernel-2.4.26-ts11-src.tar.gz * rm -f *.tar.bz2 5.) Change directory to the kernel source * cd linux24/ 6.) Prepare the Makefile for cross-compiling by using 'vi' and editing the 'CROSS_COMPILE" line to reflect what's been written below... save and exit * vi Makefile CROSS_COMPILE = $(shell cd $(TOPDIR)/../usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin/ && pwd)/arm-linux- 7.) Prepare the .config file * make menuconfig - Load the TS-7260 config file by typing "L" three times, "ENTER", and specify: arch/arm/def-configs/ts7260 When finished, save and exit back to the menuconfig root (home page) - Change the default kernel command line by typing "G", "Enter", "D", "ENTER", and specify: root=/dev/ram0 init=/linuxrc console=ttyAM0,115200 printk=4 loops=499712 When finished, save and exit back to the menuconfig root (home page) - Exit menuconfig and be sure to say "Yes" to save your changes 8.) Compile the kernel * make dep * make Image 9.) [OPTIONAL] Compile, install, and archive the modules * make modules * make modules_install * tar czvf modules_2.4.26-ts11.tar.gz /lib/modules/2.4.26-ts11/
Updating SD Card
1.) Use 'dd' to copy the raw kernel image "Image" to the SD card * dd if=arch/arm/boot/Image of=/dev/sdb1 2.) [OPTIONAL] Mount the third partition of the SD card to extract modules * mkdir /mnt/debian_fs * mount /dev/sdb3 /mnt/debian_fs * tar xzvf modules_2.4.26-ts11.tar.gz -C /mnt/debian_fs/ 3.) Unmount the SD Card * umount /dev/sdb[1,2,3]
1.) Take the newly created and updated SD card from the SD Card Reader and insert it in the TS-7260 2.) Connect console cable, start minicom with proper settings for TS-7260, and finally apply power 3.) Verify that your kernel was loaded properly by viewing the compiled date * uname -a 4.) Once verified, you can now 'exit' to full Debian * exit
Example Startup Log
>> TS-SDBOOT - built Jan 26 2007 >> Copyright (c) 2007, Technologic Systems . . . Finished booting in 1.89 seconds Type 'tshelp' for help $ exit >> Booting Linux... INIT: version 2.86 booting Creating extra device nodes...done. Started device management daemon v1.3.25 for /dev Checking root file system... fsck 1.37 (21-Mar-2005) e2fsck 1.37 (21-Mar-2005) /dev/sdcard0/disc0/part3: clean, 15067/60000 files, 218689/239104 blocks Cleaning up ifupdown...done. Loading modules: usbcore zd pcipool usb-ohci usb-ohci-ep93xx af_packet Checking all file systems... fsck 1.37 (21-Mar-2005) ... done. Setting up networking...done. Starting hotplug subsystem: usb isapnp ide scsi. Setting up IP spoofing protection: rp_filter. Enabling packet forwarding...done. Configuring network interfaces...done. Starting portmap daemon: portmap. Recovering nvi editor sessions... done. INIT: Entering runlevel: 2 Starting internet superserver: inetd. Starting OpenBSD Secure Shell server: sshdCould not load host key: /etc/ssh/ssh_host_rsa_key Could not load host key: /etc/ssh/ssh_host_dsa_key Disabling protocol version 2. Could not load host key sshd: no hostkeys available -- exiting. Starting NFS common utilities: statd. Starting periodic command scheduler: cron. Starting web server: apache-ssl failed Debian GNU/Linux 3.1 ts7000 ttyAM0 ts7000 login: root Last login: Thu Jan 1 00:01:43 1970 on ttyAM0 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. root@ts7000:root# uname -a Linux ts7000 2.4.26-ts11 #4 Wed Apr 21 13:37:07 MST 2010 armv4l GNU/Linux root@ts7000:root#
If, for any reason, you're presented with an error after completing one of the steps outlined above, check your permissions (you may need to be logged in as root), and your directory paths.
Although it hasn't been tested, this guide should also be applicable to the TS-72XX, TS-7300, and TS-7400 with minor modifications which are left to the customers discretion.
If you're having difficulties inserting your module (ie. "insmod: error inserting module.ko: -1 Invalid module format"), it could be because either 1.) the kernel which it was compiled against has not been loaded to the microSD and/or 2.) there are module dependencies that are not being satisfied. The 'dmesg' utility is invaluable when trying to troubleshoot these issues.
When compiling additional modules into the kernel, you must use "make modules_install" as the final step in kernel compiling to install the modules to your development Linux PC. From there, you can create a tarball to copy and then extract to the fourth partition of the microSD card. ie. (assuming your microSD card's device node was enumerated to /dev/sdb; use 'fdisk -l' to verify)
tar czvf linuxmodules-2.6.24.tar.gz /lib/modules/126.96.36.199/ mkdir /mnt/sd_part4 mount /dev/sdb4 /mnt/sd_part4 tar xzvf linuxmodules-2.6.24.tar.gz -C /mnt/sd_part4/
After doing this, boot the TS-7500 with the updated microSD card to full Debian and then can use "depmod -a" to build the module dependency lists that 'modprobe' will use. Once this has been complete, you should then be able to use 'modprobe' to successfully insert the module along with all of its dependencies. ie.
If you would like your module to be inserted automatically on system startup, then simply include the module name in /etc/modules. ie.
echo "usbnet" >> /etc/modules
Keep in mind that if anything in the 'make menuconfig' step was required to be compiled as part of the kernel as indicated by [*], then you will need to copy the entire kernel image to the microSD card. ie.
dd if=arch/arm/boot/Image of=/dev/sdb2
REV DATE AUTHOR NOTES 1.0 04/10 DRH Initial write-up, steps verified