[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ltib] Re: Is there a doc? docu
From: |
Stuart Hughes |
Subject: |
[Ltib] Re: Is there a doc? docu |
Date: |
Thu, 28 Dec 2006 09:29:02 +0000 |
Hi Mark,
There are hints in:
http://www.bitshrine.org/autodocs/LtibFaq.html#ref_89 but nothing
specific (or straight forward for the kernel). I need to add a section
to the FAQ, but until then, here's how to do it:
---+ Testing a new kernel source without adding a spec file
LTIB will let kernel developers build and test any kernel directory tree
on their host machine. The benefit of this is that you can try out
kernels, make source code changes (possibly using an SCM such as git)
without LTIB getting in your way. To do this:
Unpack your kernel sources somewhere on your host. Then:
$ ./ltib --configure
--- Choose your Kernel
kernel (linux 2.6.13.4) --->
Type enter and select:
(X) Local Linux directory build
Under the kernel selection, type enter and type the
directory that contains your kernel source tree.
Under KBUILD_OUTPUT path, leave the default. This tells
ltib to place the build output in a peer directory to
your source tree, named after our platform (e.g. mpc8349itx)
You can leave the config file name. This will act as your
starting point for the kernel configuration. If you do
have a different config file you want to use, place it in
config/platform/<target> and enter the name in the selection.
Having done all this you should see something like:
--- Choose your Kernel
kernel (Local Linux directory build) --->
(/home/seh/git_trees/linux-2.6.git) Enter your Linux source directory
($PKG_KERNEL_PATH_PRECONFIG/../kbuild/$PLATFORM) KBUILD_OUTPUT path (
config file (2.6.13) --->
(nas_linux-2.6.13.4-mpc8349itx.config) kernel config file
When you have this setup, exit and save and LTIB will build your kernel.
The output will go into the directory selected by KBUILD_OUTPUT
If you want to configure the kernel you can click the
'[ ] Configure the kernel' option. All sources will be left unpacked
(e.g. not removed). On subsequent re-builds of the kernel tree you can
do:
$ ./ltib -p kernel -m scbuild -c # build and configure
$ ./ltib -p kernel -m scdeploy # copy the output to rootfs/boot
---+ Adding a new kernel permanently into LTIB
Once you've got everything working correctly, you probably want to
permanently add the new kernel. To do this you'll need a spec file
fragment that list the sources for your kernel. The best practice to
follow is to make your kernel source base an external pristine reference
(from kernel.org) plus a stack of patches. Lets assume the following
scenario:
* Source base : linux-2.6.18.tar.bz2
* Patches : linux-2.6.18-aaabbb.patch, linux-2.6.18-xxxyyy.patch
* config file : linux-2.6.18-mpc8349.config
Here's what I'd do:
* Copy a similar kernel spec.in file to work on:
$ cp dist/lfs-5.1/kernel/kernel-2.6.18-mpc8641.spec.in
dist/lfs-5.1/kernel/kernel-2.6.18-mpc8349.spec.in
* Edit the spec file and change it to look as follows. I've left in the
dtc stuff (flat device tree bootloader). If your kernel does not use
this, then simply remove all the 'dtc_xxx' entries. If you do use the
dtc, then you'll need to set the values correctly (dtc_path is probably
okay).
# Template = kernel-common.tmpl
%define pfx /opt/freescale/rootfs/%{_target_cpu}
%define dversion 2.6.18
%define pkg_name linux
%define dtc_path arch/$LINTARCH/boot/dts
%define dtc_source mpc8349.dts
%define dtc_output mpc8349.dtb
Summary : Linux kernel (core of the Linux operating system)
Name : kernel
Version : 2.6.18
Release : 0
License : GPL
Vendor : Kernel.org + freescale patches
Packager : <your_name>
Group : System Environment/Kernel
Source : %{pkg_name}-%{dversion}.tar.bz2
Patch1 : linux-2.6.18-aaabbb.patch
Patch2 : linux-2.6.18-xxxyyy.patch
BuildRoot : %{_tmppath}/%{name}
Prefix : %{pfx}
%Description
%{summary}
>From kernel.org plus Freescale patches
%Prep
%setup -n %{pkg_name}-%{dversion}
%patch1 -p1
%patch2 -p1
Now that you have made the spec.in file, the next thing to do is to add
it into the config system for you platform. To do this, edit:
config/platform/<target>/main.lkc. In this example:
config/platform/mpc8349itx/main.lkc. (Note: in the 8349 example the
kernel config section has an extra intermediate step that is not in all
platforms).
The changes you make should be something like this:
@@ -141,6 +141,8 @@
bool "linux 2.6.13.4"
config KERNEL2
bool "linux 2.6.16.x"
+ config KERNEL3
+ bool "linux 2.6.18 (testing)"
config KERNEL_DIR_BUILD
bool "Local Linux directory build"
help
@@ -153,6 +155,7 @@
string
default "kernel-2.6.13.4-mpc8349itx" if KERNEL1
default "kernel-2.6.16-mpc8349itx" if KERNEL2
+ detault "kernel-2.6.18-mpc8349" if KERNEL3
source ../../userspace/kernel_dir_build.lkc
@@ -166,6 +169,8 @@
bool "2.6.13"
config KERNEL_CONFIG2
bool "2.6.16"
+ config KERNEL_CONFIG3
+ bool "2.6.18"
config KERNEL_CONFIG_CUSTOM
bool "custom"
endchoice
@@ -174,6 +179,7 @@
string "kernel config file"
default "nas_linux-2.6.13.4-mpc8349itx.config" if KERNEL_CONFIG1
default "linux-2.6.16-mpc8349itx.config" if KERNEL_CONFIG2
+ default "linux-2.6.18-mpc8349.config" if KERNEL_CONFIG3
default "enter config filename" if KERNEL_CONFIG_CUSTOM
Finally, copy your linux configuration file to:
config/platform/mpc8349itx/linux-2.6.18-mpc8349.config
Once you have done all this, you need to run './ltib --configure' select
the new kernel and test build it.
Regards, Stuart
On Wed, 2006-12-27 at 23:45 -0800, mark.lacas wrote:
> Stuart,
> Is there a doc that tells how to install and set up an new kernel in
> litb?
>
>
> I'd like to try 2.6.19.1 that I just downloaded from kernel.org.
>
>
> Not quite sure where to start.
>
>
> I tried hacking some of the config files but it keeps going into the
> weeds.
>
>
> Is this something I should bother with or is it too time consuming?
>
>
> Thanks,
> ml
>
>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ltib] Re: Is there a doc? docu,
Stuart Hughes <=