2007-01-04 19:46:43

by Sunil Naidu

[permalink] [raw]
Subject: Multi kernel tree support on the same distro?

Hello All,

I am looking to use multiple kernel trees on the same distro. Example:-

2.6.19.1 for - software/tools development
2.4.34 for - embedded systems development.

I do know that 2.6 supports embedded in a big way....but still
requirement demands to work with such boards as an example:-

http://www.embeddedarm.com/linux/ARM.htm

My question is HOW-TO enable a distro with multi kernel trees?
Presently am using Fedora Core 5/6 for much of the development
activities (Cell BE SDK related at Labs).

Any hints/suggestions would be a great leap for me to do this on my own.

~Akula2


2007-01-04 20:23:57

by Kristof Provost

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

> Hello All,
>
> I am looking to use multiple kernel trees on the same distro. Example:-
>
> 2.6.19.1 for - software/tools development
> 2.4.34 for - embedded systems development.
>
> I do know that 2.6 supports embedded in a big way....but still
> requirement demands to work with such boards as an example:-
>
> http://www.embeddedarm.com/linux/ARM.htm
>
> My question is HOW-TO enable a distro with multi kernel trees?
> Presently am using Fedora Core 5/6 for much of the development
> activities (Cell BE SDK related at Labs).
>
> Any hints/suggestions would be a great leap for me to do this on my own.
>
> ~Akula2

I'm not sure I understood your problem correctly.
I see no reason to have two kernel versions on your host system. You can
keep 2.6.x on the host, and compile a 2.4.x for the target. You don't
need to run 2.4.x on your host.

The TS-Kernel the website talks about is meant to run on the embedded
target.

Kristof
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFnWI5UEZ9DhGwDugRA/SCAKCgBfrAIreTa4k6IsmAi4Dr2jGa6wCfbTF7
CexlUWurRHI20hHsp+TsN5k=
=0kdG
-----END PGP SIGNATURE-----

2007-01-05 00:14:44

by Kok, Auke

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

Akula2 wrote:
> Hello All,
>
> I am looking to use multiple kernel trees on the same distro. Example:-
>
> 2.6.19.1 for - software/tools development
> 2.4.34 for - embedded systems development.
>
> I do know that 2.6 supports embedded in a big way....but still
> requirement demands to work with such boards as an example:-
>
> http://www.embeddedarm.com/linux/ARM.htm
>
> My question is HOW-TO enable a distro with multi kernel trees?
> Presently am using Fedora Core 5/6 for much of the development
> activities (Cell BE SDK related at Labs).
>
> Any hints/suggestions would be a great leap for me to do this on my own.

this is really no big problem (as in: works OOTB), except that if you want to boot & run
both kernels on the same (rootfs) installation, you will need to create wrappers around
modutils and module-init-tools, as well as udev/devfs, or whichever device file system
you prefer to use for each kernel. There are a few minor other details but none really
shocking.

We've done this for "our" source distro, and it works just fine.

Cheers,

Auke

2007-01-05 04:33:15

by Steve Brueggeman

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

There are some difficulties with gcc versions between linux-2.4 and linux-2.6,
but I do not recall all of the details off of the top of my head. If I recall
correctly, one of the issues is, linux-2.4 ?prefers? gcc-2.96, while newer
linux-2.6 support/prefer gcc-3.? or greater.

At any rate, what I've done is create a chroot environment. I created this
chroot directory by installing an older distribution that was created with
linux-2.4 in mind (example, RedHat v8.2) into that at chroot directory. The
easiest way to do this that I'm aware of is to install the older distribution
(minimal development, no server junk, no X junk) on another computer, then copy
from that computer to a directory on your development computer.

Then chroot to that directory with something like

chroot /home/linux-2.4-devel /bin/bash
mount /proc

Note that I have had some issues with having a linux-2.6 kernel on /proc with a
linux-2.4 distribution, but nothing that greatly affects code development.

Of course, I'm assuming that you are the only person that has access to this
development computer, because chroot is a security risk (example: cd /; cd ..)

Sorry for being short on details, but I hope this helps.

Steve Brueggeman


On Thu, 04 Jan 2007 16:14:42 -0800, you wrote:

>Akula2 wrote:
>> Hello All,
>>
>> I am looking to use multiple kernel trees on the same distro. Example:-
>>
>> 2.6.19.1 for - software/tools development
>> 2.4.34 for - embedded systems development.
>>
>> I do know that 2.6 supports embedded in a big way....but still
>> requirement demands to work with such boards as an example:-
>>
>> http://www.embeddedarm.com/linux/ARM.htm
>>
>> My question is HOW-TO enable a distro with multi kernel trees?
>> Presently am using Fedora Core 5/6 for much of the development
>> activities (Cell BE SDK related at Labs).
>>
>> Any hints/suggestions would be a great leap for me to do this on my own.
>
>this is really no big problem (as in: works OOTB), except that if you want to boot & run
>both kernels on the same (rootfs) installation, you will need to create wrappers around
>modutils and module-init-tools, as well as udev/devfs, or whichever device file system
>you prefer to use for each kernel. There are a few minor other details but none really
>shocking.
>
>We've done this for "our" source distro, and it works just fine.
>
>Cheers,
>
>Auke
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to [email protected]
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/

2007-01-05 07:30:46

by Kok, Auke

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

Steve Brueggeman wrote:
> There are some difficulties with gcc versions between linux-2.4 and linux-2.6,
> but I do not recall all of the details off of the top of my head. If I recall
> correctly, one of the issues is, linux-2.4 ?prefers? gcc-2.96, while newer
> linux-2.6 support/prefer gcc-3.? or greater.

gcc 3.4.x works great on both 2.6 and 2.4, no issues whatsoever.

> At any rate, what I've done is create a chroot environment. I created this
> chroot directory by installing an older distribution that was created with
> linux-2.4 in mind (example, RedHat v8.2) into that at chroot directory. The
> easiest way to do this that I'm aware of is to install the older distribution
> (minimal development, no server junk, no X junk) on another computer, then copy
> from that computer to a directory on your development computer.

it's even easier to not do that and install and compile everything in one rootfs, which
is perfectly possible and I have done so many times. You can leave away the chroot and
any possible security issues that you fear, allthough those are pretty much nonexistant.

The only real bottom line issue is that module-init-tools cannot load modules on a 2.4
kernel, and modutils doesn't do that on 2.6, so you will have to switch or wrap them to
detect the running kernel. The same goes for udev vs. devfs.

of course, setting up a qemu image or separate partition is easier, but that was not the
question I think.

Most binary distro's won't support this, but I think all of the source distro's and more
specific ones support it and a few handle it out of the box.


Cheers,

Auke

2007-01-05 11:50:42

by Sunil Naidu

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

> I'm not sure I understood your problem correctly.
> I see no reason to have two kernel versions on your host system. You can
> keep 2.6.x on the host, and compile a 2.4.x for the target. You don't
> need to run 2.4.x on your host.

I would like to have 2.4.x & 2.6.x on my host FC6 machine.
But am not sure whether FC6 would permit this or not?

> The TS-Kernel the website talks about is meant to run on the embedded
> target.
>
> Kristof

Yep, that's true. Here (TS-7300) am trying to port 2.6.18 kernel
(another story :))

~Akula2

2007-01-05 12:04:51

by Sunil Naidu

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

On 1/5/07, Auke Kok <[email protected]> wrote:
> Steve Brueggeman wrote:
Thanks Steve for your inputs.

> gcc 3.4.x works great on both 2.6 and 2.4, no issues whatsoever.

Do you mean I need to discard gcc 4.1.x on the distro? Or keep both?


> Most binary distro's won't support this, but I think all of the source distro's and more
> specific ones support it and a few handle it out of the box.

Hmm. How to solve this? Build a distro from scratch? Which distro you suggest?
I do have Fedora based custom distro experience (right from the
ripping of Anaconda to X building, etc).

> Cheers,
>
> Auke
>
~Akula2

2007-01-05 12:33:43

by Renato S. Yamane

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Em 05-01-2007 10:04, Akula2 escreveu:
> On 1/5/07, Auke Kok <[email protected]> wrote:
>> Steve Brueggeman wrote:
>> gcc 3.4.x works great on both 2.6 and 2.4, no issues whatsoever.
>
> Do you mean I need to discard gcc 4.1.x on the distro? Or keep both?

I use GCC 4.1.2 with vendor Kernel (OpenSuSE) 2.6.18.2 with no problem.
In next weekend I will compile a new Kernel. 2.6.19.1

- --
Renato S. Yamane
Fingerprint: 68AE A381 938A F4B9 8A23 D11A E351 5030 D420 515A
PGP Server: http://pgp.mit.edu/ --> KeyID: 0xD420515A
<http://www.renatoyamane.com>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFFnkRV41FQMNQgUVoRAgPVAJ958dCTNmKUDaxIj/uFkc4esHC30wCdFHs4
Vk6doj/x9lnT3jwgaGkcfCA=
=2ELR
-----END PGP SIGNATURE-----

2007-01-05 16:10:15

by Kok, Auke

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

Renato S. Yamane wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Em 05-01-2007 10:04, Akula2 escreveu:
>> On 1/5/07, Auke Kok <[email protected]> wrote:
>>> Steve Brueggeman wrote:
>>> gcc 3.4.x works great on both 2.6 and 2.4, no issues whatsoever.
>> Do you mean I need to discard gcc 4.1.x on the distro? Or keep both?
>
> I use GCC 4.1.2 with vendor Kernel (OpenSuSE) 2.6.18.2 with no problem.
> In next weekend I will compile a new Kernel. 2.6.19.1

I was not saying that *other* compilers don't work, but merely stating that a certain
version of gcc does really well with BOTH (and most) 2.4 and 2.6 kernel sources. I doubt
that gcc-4.1.x works all that great with some of the not-so-recent 2.4 kernels.

Auke

2007-01-07 09:13:51

by Sunil Naidu

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

On 1/5/07, Auke Kok <[email protected]> wrote:
> keeping 2 gcc's around usually is just a pain, but might also work.
>
> gcc-4.1.1 might give some problems with some packages and just work fine otherwise too,
> but 3.4.6 has just been known to work all around more.

I am planning in this fashion:-

gcc-3.4.x (latest in that tree) to build 2.4.34 kernel
gcc-4.1.x (latest in that tree) to build 2.6.20 kernel (once released)

And, all the required utils for these kernels.

There is no other option for me (this is fairly I can call as an
Experimental work, but this effort would add a lots for my work in the
Labs).

> well, my own of course ;)
> http://lunar-linux.org/

This am not so sure (totally new for me), but I shall really try
Lunar...thanks :-)

This time am looking to work with the OpenSuSE10.2 to create my kind
of environment. But, am not sure if there are any big issues. Else, I
may stick to FC6.

Only bottleneck would be the wrapping the utils as you have mentioned earlier.

> but perhaps that's too much work for you, lunar definately is rather spartan for most
> people, and maybe not what you prefer. OTOH it does give you almost all the freedom that
> LFS gives you, and often very stable.

Very true, but I shall have a look at that, thanks again.

> that's all you'd need to get started. I suggest shopping distros a bit. Even debian
> might already work a lot better. but the major distros like RH, SuSE are just not
> focussed on multi-booting 2.4/2.6 side-by-side anymore.

I have good exposure with Debain, especially with my Embedded domain
(ARM Linux). But, somehow I felt like am more comfortable with Fedora
or SuSE to do many other things (hmm, here I lack much of the Embedded
support compared to Debian).

This is my actual initiative; have to crack this problem.

Lastly, one question I didn't understand:-

Someone said in the reply to this thread that we shouldn't have 2
kernels on the same distro? I didn't understand here clearly *Why
Not*?

> Cheers,
>
> Auke

~Akula2

2007-01-07 09:31:11

by Willy Tarreau

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

On Thu, Jan 04, 2007 at 10:28:12PM -0600, Steve Brueggeman wrote:
> There are some difficulties with gcc versions between linux-2.4 and linux-2.6,
> but I do not recall all of the details off of the top of my head. If I recall
> correctly, one of the issues is, linux-2.4 ?prefers? gcc-2.96, while newer
> linux-2.6 support/prefer gcc-3.? or greater.

2.4 was designed for gcc 2.95.3 and supports gcc up to 3.4 on all platforms,
and up to 4.1 on x86, x86_64, ppc and sparc64. Recent gcc 3.4 produces good
code on 2.4, and is able to efficiently optimize for size (-Os) without too
much speed compromise.

> At any rate, what I've done is create a chroot environment. I created this
> chroot directory by installing an older distribution that was created with
> linux-2.4 in mind (example, RedHat v8.2) into that at chroot directory. The
> easiest way to do this that I'm aware of is to install the older distribution
> (minimal development, no server junk, no X junk) on another computer, then copy
> from that computer to a directory on your development computer.

Hmm, I think you did it the *hard* way. Gcc has been supporting
multi-version for years. You just have to compile it with --suffix=-3.4
or --suffix=4.1 to have a whole collection of gcc versions on your host.
If you don't want to recompile gcc, simply rename the binaries and you're
OK. When you build, you only have to do :

$ make bzImage modules CC=gcc-3.4

I've been using it like this for years without problem. It's really
convenient, and it also allows you to easily compare output codes and
sizes between compilers.

Regards,
Willy

2007-01-07 13:11:04

by Sunil Naidu

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

On 1/7/07, Willy Tarreau <[email protected]> wrote:
> > There are some difficulties with gcc versions between linux-2.4 and linux-2.6,
> > but I do not recall all of the details off of the top of my head. If I recall
> > correctly, one of the issues is, linux-2.4 ?prefers? gcc-2.96, while newer
> > linux-2.6 support/prefer gcc-3.? or greater.

That's correct about gcc-3.4.x & gcc-4.1.x about 2.6 tree support.
This means 2.6 supports both gcc versions. Here are the binaries I do
use:-

http://download.fedora.redhat.com/pub/fedora/linux/core/3/i386/os/Fedora/RPMS/gcc-3.4.2-6.fc3.i386.rpm
http://download.fedora.redhat.com/pub/fedora/linux/core/3/i386/os/Fedora/RPMS/kernel-2.6.9-1.667.i686.rpm

Now issue remains with 2.4 tree. Is it possible to build/install
gcc-4.1.x along with gcc-3.4.x? This is what am trying to figure by
few tests on the FC3 base machine.
Can we call this as backward compatibility?

Any inputs here is helpful :-)

> Hmm, I think you did it the *hard* way. Gcc has been supporting
> multi-version for years. You just have to compile it with --suffix=-3.4
> or --suffix=4.1 to have a whole collection of gcc versions on your host.
> If you don't want to recompile gcc, simply rename the binaries and you're
> OK. When you build, you only have to do :
>
> $ make bzImage modules CC=gcc-3.4
>
> I've been using it like this for years without problem. It's really
> convenient, and it also allows you to easily compare output codes and
> sizes between compilers.

I did understand this, thanks. I have one doubt: Imagine I have
built/installed these:-

2.4.34 & 2.6.20 kernels has these gcc-3.4.x & gcc-4.1.x compilers
built on say FC6 box. Now issue comes when I run an application. How
does it understand which library use?

example:
myArmWireless app. needs gcc-3.4.x, NOT gcc-2.6.x libs on say 2.4.34 kernel.

Will it take automatically? Or we need to pass args to target the
gcc-3.4.x libs?


Hope you guys consider these (my) questions as Novice, because am
trying to figure a design @ How-To build such multi kernel/gcc
systems.

> Regards,
> Willy

~Akula2

2007-01-07 13:21:06

by Willy Tarreau

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

On Sun, Jan 07, 2007 at 06:41:00PM +0530, Akula2 wrote:
> On 1/7/07, Willy Tarreau <[email protected]> wrote:
> >> There are some difficulties with gcc versions between linux-2.4 and
> >linux-2.6,
> >> but I do not recall all of the details off of the top of my head. If I
> >recall
> >> correctly, one of the issues is, linux-2.4 ?prefers? gcc-2.96, while
> >newer
> >> linux-2.6 support/prefer gcc-3.? or greater.
>
> That's correct about gcc-3.4.x & gcc-4.1.x about 2.6 tree support.
> This means 2.6 supports both gcc versions. Here are the binaries I do
> use:-
>
> http://download.fedora.redhat.com/pub/fedora/linux/core/3/i386/os/Fedora/RPMS/gcc-3.4.2-6.fc3.i386.rpm
> http://download.fedora.redhat.com/pub/fedora/linux/core/3/i386/os/Fedora/RPMS/kernel-2.6.9-1.667.i686.rpm
>
> Now issue remains with 2.4 tree. Is it possible to build/install
> gcc-4.1.x along with gcc-3.4.x? This is what am trying to figure by
> few tests on the FC3 base machine.
> Can we call this as backward compatibility?
>
> Any inputs here is helpful :-)
>
> >Hmm, I think you did it the *hard* way. Gcc has been supporting
> >multi-version for years. You just have to compile it with --suffix=-3.4
> >or --suffix=4.1 to have a whole collection of gcc versions on your host.
> >If you don't want to recompile gcc, simply rename the binaries and you're
> >OK. When you build, you only have to do :
> >
> > $ make bzImage modules CC=gcc-3.4
> >
> >I've been using it like this for years without problem. It's really
> >convenient, and it also allows you to easily compare output codes and
> >sizes between compilers.
>
> I did understand this, thanks. I have one doubt: Imagine I have
> built/installed these:-
>
> 2.4.34 & 2.6.20 kernels has these gcc-3.4.x & gcc-4.1.x compilers
> built on say FC6 box. Now issue comes when I run an application. How
> does it understand which library use?
>
> example:
> myArmWireless app. needs gcc-3.4.x, NOT gcc-2.6.x libs on say 2.4.34 kernel.
>
> Will it take automatically? Or we need to pass args to target the
> gcc-3.4.x libs?

I don't see which libs you are talking about. The compiler you build your
kernel with is totally independant on the compiler you build your apps with.
A few years ago, some distros even shipped a compiler just for the kernel
(they called the binary "kgcc").

So you just have to build 2 different GCC, one for 2.4, one for 2.6 and
you use them to build your kernels. If you want yet another compiler for
your apps, simply do it, it's not a problem. For instance, look on my
system when I type gcc- <Tab> :

$ gcc-
gcc-2.95 gcc-3.3 gcc-3.4 gcc-4.0 gcc-4.1
gcc-2.95.3 gcc-3.3.6 gcc-3.4.4 gcc-4.0.2 gcc-4.1.1

My gcc is a symlink to gcc-2.95, and I use any of those to build kernels
and applications, depending on what I need (optimizations, etc...).

> Hope you guys consider these (my) questions as Novice, because am
> trying to figure a design @ How-To build such multi kernel/gcc
> systems.

Well, I hope it will help you
Willy

2007-01-07 14:19:08

by Sunil Naidu

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

> > On 1/7/07, Willy Tarreau <[email protected]> wrote:
> I don't see which libs you are talking about. The compiler you build your
> kernel with is totally independant on the compiler you build your apps with.
> A few years ago, some distros even shipped a compiler just for the kernel
> (they called the binary "kgcc").
>
> So you just have to build 2 different GCC, one for 2.4, one for 2.6 and
> you use them to build your kernels. If you want yet another compiler for
> your apps, simply do it, it's not a problem. For instance, look on my
> system when I type gcc- <Tab> :

Sorry for the typo & confusion caused. I meant in that example as:-

myArmWireless app. compiled with gcc-3.4.x, NOT gcc-4.1.x compiler on
say 2.4.34 kernel (assuming I can build 4.1.x on 2.4.34 kernel).

Now, I've got it about this app funda. Ok! Am coming closer now. I
have these 2 tasks:-

a) Since 2.6 kernel has no issues with gcc-3.4.x, gcc-4.1.x. So I will
build them. No probs here.

b) 2.4 kernel has no issues with gcc-3.4.x to my understanding, but am
not sure about compiling it with gcc-4.1.x? If this is true, how to
build this?

Whole idea is to have 2 compilers (gcc-3.4.x, gcc-4.1.x) on the both
the kernels.


> > Hope you guys consider these (my) questions as Novice, because am
> > trying to figure a design @ How-To build such multi kernel/gcc
> > systems.
>
> Well, I hope it will help you
> Willy

Thanks,
~Akula2

2007-01-07 14:32:11

by Willy Tarreau

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

[ CC list trimmed since I'm repeating myself ]

On Sun, Jan 07, 2007 at 07:49:05PM +0530, Akula2 wrote:
> >> On 1/7/07, Willy Tarreau <[email protected]> wrote:
> >I don't see which libs you are talking about. The compiler you build your
> >kernel with is totally independant on the compiler you build your apps
> >with.
> >A few years ago, some distros even shipped a compiler just for the kernel
> >(they called the binary "kgcc").
> >
> >So you just have to build 2 different GCC, one for 2.4, one for 2.6 and
> >you use them to build your kernels. If you want yet another compiler for
> >your apps, simply do it, it's not a problem. For instance, look on my
> >system when I type gcc- <Tab> :
>
> Sorry for the typo & confusion caused. I meant in that example as:-
>
> myArmWireless app. compiled with gcc-3.4.x, NOT gcc-4.1.x compiler on
> say 2.4.34 kernel (assuming I can build 4.1.x on 2.4.34 kernel).
>
> Now, I've got it about this app funda. Ok! Am coming closer now. I
> have these 2 tasks:-
>
> a) Since 2.6 kernel has no issues with gcc-3.4.x, gcc-4.1.x. So I will
> build them. No probs here.
>
> b) 2.4 kernel has no issues with gcc-3.4.x to my understanding, but am
> not sure about compiling it with gcc-4.1.x? If this is true, how to
> build this?

As I already explained in another mail, 2.4.34 builds with gcc-4.1 on x86
and a few other archs. I also explained how to do this :

$ make CC=gcc-4.1

I don't know how I can explain it to you an easier way, but what I'm sure
about is that if you are having such big trouble understanding simple
commands like this, you will certainly encounter many more when building
your own distro.

> Whole idea is to have 2 compilers (gcc-3.4.x, gcc-4.1.x) on the both
> the kernels.

That's what I understood and the need I replied too the first time.

Willy

2007-01-07 17:52:45

by Sunil Naidu

[permalink] [raw]
Subject: Re: Multi kernel tree support on the same distro?

On 1/7/07, Willy Tarreau <[email protected]> wrote:
> As I already explained in another mail, 2.4.34 builds with gcc-4.1 on x86
> and a few other archs. I also explained how to do this :
>
> $ make CC=gcc-4.1
>
> I don't know how I can explain it to you an easier way, but what I'm sure
> about is that if you are having such big trouble understanding simple
> commands like this, you will certainly encounter many more when building
> your own distro.

I have understood that, it seems I have confused (and myself too) with
my doubts on gcc/kernel versions (getting into details).

> > Whole idea is to have 2 compilers (gcc-3.4.x, gcc-4.1.x) on the both
> > the kernels.
>
> That's what I understood and the need I replied too the first time.

Thanks a lots for your inputs. I shall post more questions once I
progress with this experimental work :-)

> Willy

~Akula2