TS-72XX 2.4 Kernel Compile Guide: Difference between revisions

From embeddedTS Manuals
(Created page with "{{Warning|BACKUP YOUR DATA FIRST}} ''' Prerequisites ''' RHEL/Fedora/CentOS: <source lang=bash> yum install ncurses-devel ncurses yum groupinstall "Development Tools" "Developm...")
 
m (Non-link text auto-updated for 2022 re-branding ( ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7200-linux/sources/tskernel-2.4.26-ts11-feb232011.tar.gz →‎ ftp://ftp.embeddedTS.com/ts-arm-sbc/ts-7200-linux/sources/tskernel-2.4.26-ts11-feb232011.tar.gz ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7200-linux/cross-toolchains/crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2 →‎ ftp://ftp.embeddedTS.com/ts-arm-sbc/ts-7200-linux/cross-toolchains/crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2))
 
(4 intermediate revisions by 2 users not shown)
Line 17: Line 17:
''' Set up the Sources and Toolchain '''
''' Set up the Sources and Toolchain '''
<source lang=bash>
<source lang=bash>
wget ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7200-linux/cross-toolchains/crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2
wget ftp://ftp.embeddedTS.com/ts-arm-sbc/ts-7200-linux/cross-toolchains/crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2


bunzip2 crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2
bunzip2 crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2
Line 23: Line 23:
tar -xvf crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar
tar -xvf crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar


wget ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7200-linux/sources/tskernel-2.4.26-ts11-feb232011.tar.gz
wget ftp://ftp.embeddedTS.com/ts-arm-sbc/ts-7200-linux/sources/tskernel-2.4.26-ts11-feb232011.tar.gz


tar -xvzf tskernel-2.4.26-ts11-feb232011.tar.gz
tar -xvzf tskernel-2.4.26-ts11-feb232011.tar.gz
Line 34: Line 34:
   CROSS_COMPILE = insert/your/directory/structure/here/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin/arm-linux-
   CROSS_COMPILE = insert/your/directory/structure/here/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin/arm-linux-


Then issue the following commands.
Next the config file needs to be set up. Run "make menuconfig"
*Load the TS-7200 config file by typing "L" three times, "ENTER", and specify "arch/arm/def-configs/ts7200".  When finished, save and exit back to the menuconfig
*Exit menuconfig and be sure to say "Yes" to save any changes


<source lang=bash>
<source lang=bash>
make ts7200_config
make dep
make oldconfig
make Image
make menuconfig
make zImage
</source>
</source>


When the menu comes up you can add any features available to customize your kernel. Whenever possible it is suggested to build drivers as modules
The kernel will be present at "arch/arm/boot/Image" or "arch/arm/boot/zImage" for the compressed version.


{{Note|Large kernels may not fit on the kernel partition of the SD card. Check the size of the newly created kernel.}}
{{Note|Large kernels may not fit in the kernel partition of the boot device. Check the size of the newly created kernel and ensure it will fit before writing to disk.}}


The modules can then be installed to a local directory and packed in to an archive to unpack on the SBC:
<source lang=bash>
<source lang=bash>
make && make modules
make modules
make modules_install
INSTALL_MOD_PATH="`pwd`/newmodules" make modules_install
mkdir newmodules
tar czvf modules_2.4.26-ts11.tar.gz -C newmodules/ .
INSTALL_MOD_PATH=./newmodules make modules_install
</source>
</source>


Copy the newmodules directory to a thumb drive or other accessible media (ftp or NFS will work also), then copy newmodules/lib/modules/2.4.26-ts11/* to your board. See the redboot instructions for loading a kernel permanently. See the [[#Backup / Restore]] section for details on writing this to disk.
Copy the modules tarball archive to a USB drive or other accessible media (FTP, NFS, etc.), then unpack the archive to the root folder of the device. See the [[Linux for ARM on TS-72XX User's Guide#eCos.2FRedBoot|redboot instructions]] for loading a kernel permanently on devices that use RedBoot.
 
{{Note|Once installed to the target filesystem, "depmod" should be invoked manually to update the module loading and dependency list.}}

Latest revision as of 14:28, 18 January 2022

WARNING: BACKUP YOUR DATA FIRST

Prerequisites

RHEL/Fedora/CentOS:

yum install ncurses-devel ncurses
yum groupinstall "Development Tools" "Development Libraries"
Ubuntu/Debian:
apt-get install build-essential libncurses5-dev libncursesw5-dev

For other distributions, please refer to their documentation to find equivalent tools.

Set up the Sources and Toolchain

wget ftp://ftp.embeddedTS.com/ts-arm-sbc/ts-7200-linux/cross-toolchains/crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2

bunzip2 crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2

tar -xvf crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar

wget ftp://ftp.embeddedTS.com/ts-arm-sbc/ts-7200-linux/sources/tskernel-2.4.26-ts11-feb232011.tar.gz

tar -xvzf tskernel-2.4.26-ts11-feb232011.tar.gz

cd linux24

Open the Makefile and edit CROSS_COMPILE to say:

 CROSS_COMPILE = insert/your/directory/structure/here/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin/arm-linux-

Next the config file needs to be set up. Run "make menuconfig"

  • Load the TS-7200 config file by typing "L" three times, "ENTER", and specify "arch/arm/def-configs/ts7200". When finished, save and exit back to the menuconfig
  • Exit menuconfig and be sure to say "Yes" to save any changes
make dep
make Image
make zImage

The kernel will be present at "arch/arm/boot/Image" or "arch/arm/boot/zImage" for the compressed version.

Note: Large kernels may not fit in the kernel partition of the boot device. Check the size of the newly created kernel and ensure it will fit before writing to disk.

The modules can then be installed to a local directory and packed in to an archive to unpack on the SBC:

make modules
INSTALL_MOD_PATH="`pwd`/newmodules" make modules_install
tar czvf modules_2.4.26-ts11.tar.gz -C newmodules/ .

Copy the modules tarball archive to a USB drive or other accessible media (FTP, NFS, etc.), then unpack the archive to the root folder of the device. See the redboot instructions for loading a kernel permanently on devices that use RedBoot.

Note: Once installed to the target filesystem, "depmod" should be invoked manually to update the module loading and dependency list.