TS-7400-V2 4.9 kernel compile guide: Difference between revisions

From embeddedTS Manuals
(Minor fixes)
m (Non-link text auto-updated for 2022 re-branding ( https://github.com/embeddedarm/linux-4.9.y →‎ https://github.com/embeddedTS/linux-4.9.y))
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
Compiling the kernel requires an armel toolchain.  We recommend development under Debian Stretch which includes an armel compiler in the repositories.
Compiling the kernel requires an armel toolchain.  We recommend development using Debian Stretch workstation which includes an armel compiler in the repositories. See the [[#Debian Stretch Cross Compilation|Debian Stretch cross compile section]] for instructions on installing the proper cross compiler.


On a Debian host PC:
<source lang=bash>
<source lang=bash>
su root
git clone https://github.com/embeddedTS/linux-4.9.y
 
apt-get install curl git build-essential lzop u-boot-tools libncursesw5-dev
dpkg --add-architecture armel
apt-get update
apt-get install gcc-arm-linux-gnueabi
</source>
 
 
Once those are installed:
 
<source lang=bash>
git clone https://github.com/embeddedarm/linux-4.9.y
cd linux-4.9.y
cd linux-4.9.y


Line 39: Line 26:
sudo cp arch/arm/boot/dts/imx28*ts*.dtb /mnt/sd/boot/
sudo cp arch/arm/boot/dts/imx28*ts*.dtb /mnt/sd/boot/
INSTALL_MOD_PATH="/mnt/sd" sudo -E make modules_install  
INSTALL_MOD_PATH="/mnt/sd" sudo -E make modules_install  
INSTALL_HDR_PATH="/mnt/sd" sudo -E make headers_install
sudo -E make headers_install INSTALL_HDR_PATH="/mnt/sd/usr"
sudo umount /mnt/sd/
sudo umount /mnt/sd/
sync
sync
</source>
</source>

Revision as of 14:29, 18 January 2022

Compiling the kernel requires an armel toolchain. We recommend development using Debian Stretch workstation which includes an armel compiler in the repositories. See the Debian Stretch cross compile section for instructions on installing the proper cross compiler.

git clone https://github.com/embeddedTS/linux-4.9.y
cd linux-4.9.y

# These next commands set up some necessary environment variables
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-
export LOADADDR=0x40008000

# This sets up the default configuration that we ship with
make ts_imx28_defconfig

## Make any changes in "make menuconfig" or driver modifications, then compile
make && make uImage


To install the kernel and modules to an SD card, attach it to the PC and assuming the the SD card shows up as /dev/sdc, run the following:

export DEV=/dev/sdc2
sudo mount "$DEV" /mnt/sd
sudo rm /mnt/sd/boot/uImage
sudo cp arch/arm/boot/uImage  /mnt/sd/boot/uImage
sudo cp arch/arm/boot/dts/imx28*ts*.dtb /mnt/sd/boot/
INSTALL_MOD_PATH="/mnt/sd" sudo -E make modules_install 
sudo -E make headers_install INSTALL_HDR_PATH="/mnt/sd/usr"
sudo umount /mnt/sd/
sync