I was able to build this on LTIB 6, in a way that shuld be compatible with other LTIB versions.
1.- Install LTIB, but don't --configure it!
2.- Copy the "megapatch" in /opt/freescale/pkgs/, then make a signature for it:
gato@/opt/freescale/pkgs$ md5sum linux-2.6.19.2-imx31lite-v1.0.0.patch > linux-2.6.19.2-imx31lite-v1.0.0.patch.md5
3.- Add a RPM spec file like this one:
ltib-imx31ads-20080722/dist/lfs-5.1/kernel/kernel-2.6.19.2-imx31lite.spec.in:
# Template = kernel-common.tmpl
%define pfx /opt/freescale/rootfs/%{_target_cpu}
%define dversion 2.6.19.2
%define bld_dir_name linux-2.6.19
%define kernel arch/arm/boot/zImage
%define pkg_name linux
Summary : Linux kernel for i.MX31 Lite dev kit
Name : kernel
Version : 2.6.19
Release : 2
License : GPL
Vendor : kernel.org
Packager : gatopeich
Group : System Environment/Kernel
Source : %{pkg_name}-%{dversion}.tar.bz2
Patch0 : linux-2.6.19.2-imx31lite-v1.0.0.patch
BuildRoot : %{_tmppath}/%{name}
Prefix : %{pfx}
%Description
%{summary}
From kernel.org
Megapatch: linux-2.6.19.2-imx31lite-v1.0.0
%Prep
%setup -n %{pkg_name}-%{dversion}
%patch0 -p5
# keep ltib's kernel config and kernel source tree consistent
if [ -f "$PLATFORM_PATH/$PKG_KERNEL_PRECONFIG" ]; then
cp $PLATFORM_PATH/$PKG_KERNEL_PRECONFIG arch/$LINTARCH/configs/${PLATFORM}_defconfig
fi
Now LTIB knows how to build our imx31lite kernel, and it will download the tarball for us...
4.- Then make a copy of "config/platform/imx31ads", into "config/platform/imx31lite", and edit main.lkc like this...
ltib-imx31ads-20080722/config/platform/imx31lite/main.likc:
# constants (forced values)
config CONFIG_TITLE
string
default "LTIB: LogicPD IMX31 Lite development kit"
config CPU
string
default "MX31"
config PLATFORM_COMMENT
string
default "LogicPD IMX31 Lite development kit"
config VENDOR
string
default "LogicPD"
config PLATFORM
string
default "imx31lite"
config GNUTARCH
string
default arm
config LINTARCH
string
default arm
config CFGHOST
string
default arm-linux
# capabilities if different from defaults.lkc
source ../../userspace/endian.lkc
source ../../userspace/libc_type.lkc
comment "Choose your toolchain"
choice
prompt "Toolchain"
default TOOLCHAIN1
help
Choose the cross toolchain for building your packages. If you
choose none, you can enter the path to your toolchain by hand.
config TOOLCHAIN1
bool "ARMv5te gcc-4.1.2,Multi-lib,gnueabi/glibc-2.5-nptl-3" if GLIBC || LIBC_NONE || LIBC_HACKING
config TOOLCHAIN_CUSTOM
bool "custom"
endchoice
config TOOLCHAIN
string
default tc-fsl-x86lnx-armeabi-nptl-4.1.2-3.i386.rpm if TOOLCHAIN1
config TOOLCHAIN_PATH
string
default "/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi" if TOOLCHAIN1
string "Supply your toolchain path" if TOOLCHAIN_CUSTOM
config CUSTOM_TOOLCHAIN_PREFIX
depends TOOLCHAIN_CUSTOM
string "Enter your cross tools prefix"
config TOOLCHAIN_PREFIX
string
default "arm-none-linux-gnueabi-" if TOOLCHAIN1
default CUSTOM_TOOLCHAIN_PREFIX if TOOLCHAIN_CUSTOM
config TOOLCHAIN_CFLAGS
string
default "-O2 -fsigned-char -mfloat-abi=softfp -mfpu=vfp" if TOOLCHAIN1
string "Enter any CFLAGS for gcc/g++"
help
This option lets you set flags that will be passed to gcc/g++
These will be injected by the spoofing mechanism, so they
only work if you reference the compiler as gcc/g++ in your
rpm spec files (you cannot say for instance powerpc-linux-gcc)
comment "Choose your Kernel"
choice
prompt "kernel"
default KERNEL2
help
This menu will let you choose the kernel to use with your board.
If you don't want to build a kernel, unselect this option.
config KERNEL1
bool "Linux 2.6.24-mx"
help
This is the kernel for the imx31ads platform
config KERNEL2
bool "Linux 2.6.19.2 + imx31lite megapatch v1.0.0"
help
This is the kernel for the imx31lite dev kit
Megapatch v1.0.0 applied to vanilla Linux 2.6.19.2
config KERNEL_DIR_BUILD
bool "Local Linux directory build"
help
Build using a local copy of the kernel sources
config KERNEL_NONE
bool "Do not build the Linux kernel"
help
Select this if you dont want to build the kernel
endchoice
config PKG_KERNEL
string
default "kernel-2.6.24-mx" if KERNEL1
default "kernel-2.6.19.2-imx31lite" if KERNEL2
default "kernel26-dir-build" if KERNEL_DIR_BUILD
source ../../userspace/kernel_dir_build.lkc
config PKG_KERNEL_PRECONFIG
string "kernel preconfig"
default "linux-2.6.24-imx31lite.config" if KERNEL1
default "linux-2.6.19-imx31lite.config" if KERNEL2
config PKG_KERNEL_WANT_HEADERS
depends ! KERNEL_NONE
bool "Include kernel headers"
help
Selecting this will copy kernel headers to rootfs/usr/src/linux/include
config PKG_KERNEL_WANT_CF
depends ! KERNEL_NONE
bool "Configure the kernel"
default y
config PKG_KERNEL_LEAVESRC
depends ! KERNEL_NONE
bool "Leave the sources after building"
default y
help
This is a one shot option that can be used to build the kernel and
leave the build source tree in rpm/BUILD in place
config DEPLOYMENT_ERASE_BLOCK_SIZE
string
default 16
source ../../userspace/distro.lkc
source ../../userspace/packages.lkc
source ../../userspace/sysconfig.lkc
source ../../userspace/deployment.lkc
source ../../userspace/defaults.lkc
Note that we added a new platform named "imx31lite". You should copy your kernel config file here too, named "linux-2.6.19-imx31lite.config" to match PKG_KERNEL_PRECONFIG.
5.- Change [ltib]/config/main.lkc:
config CONFIG_TITLE
string
default "GNU/Linux Target Image Builder : Platform Selection"
mainmenu "GNU/Linux Target Image Builder main menu"
choice
prompt "Platform choice"
help
This menu will let you choose from a list of boards
config PLATFORM_imx31ads
bool "Freescale IMX31 ADS reference board"
config PLATFORM_imx31lite
bool "LogicPD IMX31 Lite development kit"
endchoice
config PLATFORM_DIR
string
default "config/platform/imx31lite" if PLATFORM_imx31lite
default "config/platform/imx31ads" if PLATFORM_imx31ads
6.- Now you can run ./ltib --configure and select "imx31lite" as your platform, then choose your kernel etc.
I haven't had time to test the resulting binaries though...