Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Kernel (http://www.linux-archive.org/debian-kernel/)
-   -   How to add new platform flavours to linux-2.6 source code package? (http://www.linux-archive.org/debian-kernel/404920-how-add-new-platform-flavours-linux-2-6-source-code-package.html)

"Gerhard Pircher" 07-27-2010 09:01 PM

How to add new platform flavours to linux-2.6 source code package?
 
Hello,

I'm currently trying to adapt the debian-installer for some desktop
PowerPC machines (namely AmigaOne and Sam440ep), which are supported
in the Linux kernel tree, but not by Debian.
I thought it's best to add support for these platforms to the linux-2.6
Debian kernel package first (so that I don't need a lot of workarounds
to satisfy kernel-wedge). For this I modified the debian/config/
powerpc/defines file to look like this:

> [base]
> featuresets:
> vserver
> flavours:
> powerpc
> powerpc-smp
> powerpc64
> book3s-amigaone
> 44x-sam440ep
> kernel-arch: powerpc
>
> [image]
> suggests: mkvmlinuz
>
> [powerpc_description]
> hardware: uniprocessor 32-bit PowerPC
>
> [powerpc-smp_description]
> hardware: multiprocessor 32-bit PowerPC
>
> [powerpc-smp_image]
> configs: powerpc/config.powerpc powerpc/config.powerpc-smp
>
> [powerpc64_description]
> hardware: 64-bit PowerPC
>
> [book3s-amigaone_description]
> hardware: uniprocessor Book3s (7xx/74xx) 32-bit PowerPC AmigaOne
>
> [book3s-amigaone_image]
> depends: uboot-mkimage
> configs: powerpc/config.book3s-amigaone
>
> [book3s-amigaone_build]
> image-file: arch/powerpc/boot/zImage
>
> [44x-sam440ep_description]
> hardware: uniprocessor 44x 32-bit PowerPC Sam440ep
>
> [44x-sam440ep_image]
> depends: uboot-mkimage
> configs: powerpc/config.44x-sam440ep
>
> [44x-sam440ep_build]
> image-file: arch/powerpc/boot/zImage

As you can see, I added two new flavors named book3s-amigaone and
44x-sam440ep. I thought it could be a good idea to prefix the flavour
name with the supported processor family, as AFAIK it is already done
for the MIPS architecture (4kc/5kc-malta?). Book3s are the 6xx/7xx/74xx
CPUs also supported by the powerpc flavour (their family name was
changed from PPC_6xx to PPC_BOOK3S in the kernel). Naturally 44x refers
to AMCC's 44x CPU family.

BTW: The AmigaOne needs its own flavour, because its platform code
uses a different DMA memory allocator, which is selected at compile
time. Just in case you wonder why...

Anyway, this seems to work fine, but still leaves some questions open
for me:

1. Documentation:
I looked at all the 'defines' files to understand their syntax and
to get an overview about all available keywords.
Nevertheless I would like to know, if there is a documentation
available that lists and explains all available keywords (if so, then
then some of the next questions are best answered with "RTFM"). I read
through the Debian kernel handbook, but that remains silent on this
topic.

2. 'image-file' keyword:
Does this keyword also affect the kernel image makefile target? I
specified arch/powerpc/boot/zImage for 'image-file', as I would
like to generate a platform specific cuImage.* file afterwards
(these U-boot images include a device-tree blob and a small boot-
wrapper so that newer kernels can be booted on old U-boot versions)
For this the kernel image needs to be generated with "make zImage".

3. 'configs' keyword:
Contrary to my expectations I had add 'configs' entries for my
flavours, whereas the normal powerpc and powerpc64 flavours don't need
it. Why can't the build system find my config.book3s-amigaone and
config.44x-sam440ep files automatically?


The biggest stumbling block at the moment is the kernel config itself.
The build process always stops with an error (about an invalid kernel
config), if I just copy the config.powerpc file and modify it for the
AmigaOne. I read something about a splitconfig script that should
create all the config fragments, but I can't find it anywhere. So how
do you create all the config fragments?

One last thing: the device tree source would need to be included in
the kernel package to create the cuImage file with the bootwrapper,
the device tree blob and the zImage (and the initrd), when the kernel
is installed or the initrd image is (re)generated. The device tree
sources are included in the Lenny powerpc kernel packages, but
disappeared from the Squeeze and Sid ones (the bootwrapper object
files are still there however).
Does anybody know why this happened and if it is possbile to include
the DT sources again? Should I file a bug report?

I hope you can give me some tips for my problems with the Debian
kernel package.

Thanks a lot!

best regards,

Gerhard

PS: Please put me on CC:, as I'm not (yet) subscribed to this mailing
list.
--
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100727210120.274620@gmx.net">http://lists.debian.org/20100727210120.274620@gmx.net

Ben Hutchings 07-27-2010 11:02 PM

How to add new platform flavours to linux-2.6 source code package?
 
On Tue, 2010-07-27 at 23:01 +0200, Gerhard Pircher wrote:
[...]
> 1. Documentation:
> I looked at all the 'defines' files to understand their syntax and
> to get an overview about all available keywords.
> Nevertheless I would like to know, if there is a documentation
> available that lists and explains all available keywords (if so, then
> then some of the next questions are best answered with "RTFM"). I read
> through the Debian kernel handbook, but that remains silent on this
> topic.

Sorry, there is no documentation. The code for this is in
debian/bin/*.py and debian/lib/python.

> 2. 'image-file' keyword:
> Does this keyword also affect the kernel image makefile target?

No, it specifies the file to look at when checking that the kernel image
size is not too large.

> I specified arch/powerpc/boot/zImage for 'image-file', as I would
> like to generate a platform specific cuImage.* file afterwards
> (these U-boot images include a device-tree blob and a small boot-
> wrapper so that newer kernels can be booted on old U-boot versions)
> For this the kernel image needs to be generated with "make zImage".

I think you need to define a new image type, as we already do for Xen
and for s390 tape images. Suppose we call this 'plain-powerpc-cuimage';
then you need to add this to debian/rules.real:

$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-powerpc-cuimage: BUILD_TARGET = zImage

install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-powerpc-cuimage:
# rules to install everything in this package

Set ${flavour}_image/type to 'plain-powerpc-cuimage' for every flavour
that should use this image type.

> 3. 'configs' keyword:
> Contrary to my expectations I had add 'configs' entries for my
> flavours, whereas the normal powerpc and powerpc64 flavours don't need
> it. Why can't the build system find my config.book3s-amigaone and
> config.44x-sam440ep files automatically?

No idea.

> The biggest stumbling block at the moment is the kernel config itself.
> The build process always stops with an error (about an invalid kernel
> config), if I just copy the config.powerpc file and modify it for the
> AmigaOne. I read something about a splitconfig script that should
> create all the config fragments, but I can't find it anywhere. So how
> do you create all the config fragments?

Some people use this:
<svn://svn.debian.org/svn/kernel/people/waldi/utils/kconfigeditor2/>.

> One last thing: the device tree source would need to be included in
> the kernel package to create the cuImage file with the bootwrapper,
> the device tree blob and the zImage (and the initrd), when the kernel
> is installed or the initrd image is (re)generated. The device tree
> sources are included in the Lenny powerpc kernel packages, but
> disappeared from the Squeeze and Sid ones (the bootwrapper object
> files are still there however).
> Does anybody know why this happened and if it is possbile to include
> the DT sources again?
[...]

If these are not part of the upstream Linux source then I think they
should be packaged separately.

Ben.

--
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.

"Gerhard Pircher" 07-28-2010 07:41 PM

How to add new platform flavours to linux-2.6 source code package?
 
-------- Original-Nachricht --------
> Datum: Wed, 28 Jul 2010 00:02:01 +0100
> Von: Ben Hutchings <ben@decadent.org.uk>
> An: Gerhard Pircher <gerhard_pircher@gmx.net>, debian-kernel@lists.debian.org
> Betreff: Re: How to add new platform flavours to linux-2.6 source code package?

Thanks for the fast reply! I'll take a look at your suggestions.

> > One last thing: the device tree source would need to be included in
> > the kernel package to create the cuImage file with the bootwrapper,
> > the device tree blob and the zImage (and the initrd), when the kernel
> > is installed or the initrd image is (re)generated. The device tree
> > sources are included in the Lenny powerpc kernel packages, but
> > disappeared from the Squeeze and Sid ones (the bootwrapper object
> > files are still there however).
> > Does anybody know why this happened and if it is possbile to include
> > the DT sources again?
> [...]
>
> If these are not part of the upstream Linux source then I think they
> should be packaged separately.
The device tree sources are part of the upstream Linux source and IMHO
without them some of the bootwrapper object files (cuboot.*) are pretty
much useless.

Gerhard

--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100728194106.23950@gmx.net">http://lists.debian.org/20100728194106.23950@gmx.net

"Gerhard Pircher" 07-28-2010 07:43 PM

How to add new platform flavours to linux-2.6 source code package?
 
-------- Original-Nachricht --------
> Datum: Wed, 28 Jul 2010 09:32:04 +0200
> Von: Bastian Blank <waldi@debian.org>
> An: Gerhard Pircher <gerhard_pircher@gmx.net>
> CC: debian-kernel@lists.debian.org
> Betreff: Re: How to add new platform flavours to linux-2.6 source code
package?

> On Tue, Jul 27, 2010 at 11:01:20PM +0200, Gerhard Pircher wrote:
> > > book3s-amigaone
> > > 44x-sam440ep
> >
> > 3. 'configs' keyword:
> > Contrary to my expectations I had add 'configs' entries for my
> > flavours, whereas the normal powerpc and powerpc64 flavours don't need
> > it. Why can't the build system find my config.book3s-amigaone and
> > config.44x-sam440ep files automatically?
>
> Well, it should and will error out if it does not. What is the exact
> error? Are you sure you did not write weird characters into the names?
Previously the build script didn't list the config.book3s-amigaone file
in this line:

> python debian/bin/kconfig.py 'debian/build/config.powerpc_none_book3s-
> amigaone' debian/config/config debian/config/powerpc/config debian/
> config/powerpc/config.book3s-amigaone

Anyway, it seems to work now. Not sure what went wrong before. Maybe it
was really a typo.

> > One last thing: the device tree source would need to be included in
> > the kernel package to create the cuImage file with the bootwrapper,
> > the device tree blob and the zImage (and the initrd), when the kernel
> > is installed or the initrd image is (re)generated. The device tree
> > sources are included in the Lenny powerpc kernel packages, but
> > disappeared from the Squeeze and Sid ones (the bootwrapper object
> > files are still there however).
> > Does anybody know why this happened and if it is possbile to include
> > the DT sources again? Should I file a bug report?
>
> arch/powerpc/boot/dts?
Exactly!

> > PS: Please put me on CC:, as I'm not (yet) subscribed to this mailing
> > list.
>
> Please use a MUA that supports Mail-Followup-To.
Sorry, but I have to use GMX's web frontend here. :-(

Thanks a lot!

Gerhard
--
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100728194353.82460@gmx.net">http://lists.debian.org/20100728194353.82460@gmx.net


All times are GMT. The time now is 04:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.