[PS3] Kernel building from source.

All kernel questions! 2.4 or new 2.6 kernel, compiling, modules, panics, etc.

[PS3] Kernel building from source.

Postby spykez » 04 Dec 2009, 11:32

I have had a reasonable amount of success rebuilding the kernel by just getting new sources and doing a

make oldconfig

and then going thru' .config with

make menuconfig.

And them make && make menu_install && make install

You could back up /lib/modules/<linux>, the boot dir and yaboot.conf / kboot.conf first of course.

I'm basically trying to throw out a lot of rubbish (bear in mind this is a PS3 I'm on). For instance, I threw out all the ATA stuff, the wireless (I used an ethernet cable)... I could probably lose DHCP next.

Does anyone here have a really lean .config to share?

BTW, 2.6.32 is out, I just discovered so I might go download that and give it a bash.
spykez
ydl beginner
ydl beginner
 
Posts: 27
Joined: 04 Dec 2009, 04:20

Re: [PS3] Kernel building from source.

Postby juanito » 04 Dec 2009, 15:27

You could start with "make ps3_defconfig"
ps3 60gb, cechc04, fw-3.15, ydl-6.2/cblfs multi-lib dual boot
dell 2009w monitor, logitech mediaboard (usb)
juanito
ydl guru
ydl guru
 
Posts: 300
Joined: 30 Jul 2008, 05:30
Location: Dubai, U.A.E.

Re: [PS3] Kernel building from source.

Postby spykez » 05 Dec 2009, 01:24

juanito wrote:You could start with "make ps3_defconfig"


Hm... I might try that with the new 2.6.32. Did that work for you?

For some reason which I have yet to figure out, I've not gotten 'make ps3_defconfig' to work just off the bat on plain vanilla source for 2.6.31-6... which makes me a bit suspicious about its chances for 2.6.32.

Just kept crashing I believe just after the ramdisk starts up and before the real init runs... Exact point I did not bother to track down because I just ripped off the old config, made it and it ran.

Of course, I may have made a typo which went unnoticed, disabling something critical while I was scanning thru' 'make menuconfig', but naturally, I can't recall that ;)

Also,

Do you think we really need the ram disk start on a PS3? I have been trying to think of some reason to keep it but I can't, so I'll probably try and get rid of it. Can anyone think of a very good reason why we should keep the boot ram disk?

Cheers,
spykez
ydl beginner
ydl beginner
 
Posts: 27
Joined: 04 Dec 2009, 04:20

Re: [PS3] Kernel building from source.

Postby spykez » 06 Dec 2009, 01:40

juanito wrote:You could start with "make ps3_defconfig"


btw, did you have a lot of hassle getting your cblfs up and running?

I ask because I am not sure if you meant in your .sig you have a multilib cblfs up and running.

If you do can I ask how you got your gcc to be made as bi-arch? Or did you just make 2 separate gccs for each arch ?
Still trying to figure out how the YDL guys did it for the 4.1 that came with stock 6.2.

Basically I want to get gcc 4.4 up and running in biarch. Dunno if the code generation for the in-order cell will be any better on 4.4 than 4.1, so ... I am kind of curious.

If it is, maybe recompiling the kernel will, haha, at best, get a couple of percentage points performance improvement :P

Cheers,
spykez
ydl beginner
ydl beginner
 
Posts: 27
Joined: 04 Dec 2009, 04:20

Re: [PS3] Kernel building from source.

Postby juanito » 06 Dec 2009, 06:08

spykez wrote:For some reason which I have yet to figure out, I've not gotten 'make ps3_defconfig' to work just off the bat on plain vanilla source for 2.6.31-6... which makes me a bit suspicious about its chances for 2.6.32

I tried with earlier kernels (see forum posts), but it worked without problems.

btw, did you have a lot of hassle getting your cblfs up and running?

I followed the clfs instructions and it worked more or less OK - the main difficultly was that I compiled to the same partition as ydl, so I had to figure out how to make it boot using an old init script from lfs. The cblfs build boots and seems to run faster than ydl.
ps3 60gb, cechc04, fw-3.15, ydl-6.2/cblfs multi-lib dual boot
dell 2009w monitor, logitech mediaboard (usb)
juanito
ydl guru
ydl guru
 
Posts: 300
Joined: 30 Jul 2008, 05:30
Location: Dubai, U.A.E.

Re: [PS3] Kernel building from source.

Postby spykez » 06 Dec 2009, 11:39

juanito wrote:
spykez wrote:For some reason which I have yet to figure out, I've not gotten 'make ps3_defconfig' to work just off the bat on plain vanilla source for 2.6.31-6... which makes me a bit suspicious about its chances for 2.6.32

I tried with earlier kernels (see forum posts), but it worked without problems.
...


Hmm... I tried building 2.6.32 as is (make ps3_defconfig).. again I think it crashed around the ramdisk/init stage. I've established it doesn't get to sysinit, but further back, exactly where I have yet to pinpoint with any degree of accuracy. I think I might try and take a look at why when I get a chance. One of the first differences that struck my eye : the legacy sysfs option is enabled in the older YDL configs.

Did you build a bi-arch gcc for your cblfs? (Or for any other linux x86/sparc etc for that matter) That's what I'd like to focus my free time on though first. I'm still kind of looking for how the YDL guys had it done...

Cheers,
spykez
ydl beginner
ydl beginner
 
Posts: 27
Joined: 04 Dec 2009, 04:20

Re: [PS3] Kernel building from source.

Postby juanito » 06 Dec 2009, 11:49

spykez wrote:Did you build a bi-arch gcc for your cblfs? (Or for any other linux x86/sparc etc for that matter) That's what I'd like to focus my free time on though first. I'm still kind of looking for how the YDL guys had it done...


I think (I'm not at the ps3 for the moment) that gcc was built 32/64-bit, but it was all compiled on ps3 so only for one architecture - note that the compilation method assumes you are building it for one architecture on another architecture, but in fact both architectures are the same.
ps3 60gb, cechc04, fw-3.15, ydl-6.2/cblfs multi-lib dual boot
dell 2009w monitor, logitech mediaboard (usb)
juanito
ydl guru
ydl guru
 
Posts: 300
Joined: 30 Jul 2008, 05:30
Location: Dubai, U.A.E.

Re: [PS3] Kernel building from source.

Postby spykez » 08 Dec 2009, 07:00

juanito wrote:
spykez wrote:Did you build a bi-arch gcc for your cblfs? (Or for any other linux x86/sparc etc for that matter) That's what I'd like to focus my free time on though first. I'm still kind of looking for how the YDL guys had it done...


I think (I'm not at the ps3 for the moment) that gcc was built 32/64-bit, but it was all compiled on ps3 so only for one architecture - note that the compilation method assumes you are building it for one architecture on another architecture, but in fact both architectures are the same.


Ok... I think I've got a reliable gcc-4.4.2 up and running bi-arch on YDL 6.2. and am typing this from a boot of a 2.6.32 kernel built from it, the .config of which I derived partially from 2.6.29-3.ydl61.4, chucking out an assortment of stuff I didn't think I needed. I tuned it to cell, hoping that the code generation would be a little better given the in-order CPU (of course, we're only probably looking at eeentsy gains here, and likely the more significant gains are more free memory from chucking stuff out).

It took a long time to build the gcc so I only built the c, c++ compiler. But it was quite straightforward once I knew which flags to use to get the bi-arch to build. I had to rebuild at least a few of the binutils ie autogen amongst others... I think packaging gcc-4.4.2 into an rpm for YDL 6.2 might be a bit of a headache, so I'll probably not do it :) The kernel, however, might be a potential rpm-able candidate.

So far I have had no major problems so far. 2.6.32 boots grand, I did have some concerns as the userland is obviously not built from 4.4.2, but so far it seems to be ok. I was a bit apprehensive as I booted up X .. but it all seems to work xfce, firefox..., In otherwords, "so far"... userland appears to be "working as intended".

So the brand new kernel seems to be ok, and so is the brand new bi-arch gcc. I wouldn't, of course, suggest doing this on a production-use box, without thoroughly weighing the potential hazards thru' and thru'.

What I might do is try an do an LFS when I get the time, for more freedom, I suppose. Gentoo is very nice but at the moment, bi-arch there is only somewhat experimental.

At the moment, I'm very happy with the optimisations I've done to my YDL - although like I said previously, I feel it is more likely due to chucking stuff out, resulting in less swappage... than a brand new kernel or gcc.

cheers,
spykez
ydl beginner
ydl beginner
 
Posts: 27
Joined: 04 Dec 2009, 04:20

Re: [PS3] Kernel building from source.

Postby billb » 28 Jan 2010, 22:01

spykez wrote:At the moment, I'm very happy with the optimisations I've done to my YDL - although like I said previously, I feel it is more likely due to chucking stuff out, resulting in less swappage... than a brand new kernel or gcc.


Would you please share your config file? I'm new to kernel building but am able to create an updated kernel rpm to share with the community (I did so a while back to deal with the bluetooth issue), so I'd like to see what sort of things you end up throwing out.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: [PS3] Kernel building from source.

Postby spykez » 01 Feb 2010, 11:55

billb wrote:
spykez wrote:At the moment, I'm very happy with the optimisations I've done to my YDL - although like I said previously, I feel it is more likely due to chucking stuff out, resulting in less swappage... than a brand new kernel or gcc.


Would you please share your config file? I'm new to kernel building but am able to create an updated kernel rpm to share with the community (I did so a while back to deal with the bluetooth issue), so I'd like to see what sort of things you end up throwing out.


Not a problem, sorry I took a while to get back to your post, truth be told, I have been a bit busy with a tiny windows (haha) project for work.

I'll attach one of my current configs here, one that I believe will be most useful to the widest audience. This one works for building 2.6.32 on YDL 6.2.

You may recall I had some trouble getting the make ps3defconfig to work in my initial posts.

I eventually got it to work. From memory (I should have taken notes!), I believe I had to check one of the legacy bus options to get it to play nice with YDL (make ps3defconfig works on a gentoo, no problems, pretty much if I recall correctly). I think I also may have had to build the clock driver into the kernel. I'll go thru it over the next week or so when I've got time, it should come back to me and I'll see if I can tell you which option(s) it was that made ps3defconfig go exactly.

So this file is actually NOT a make oldconfig derivative, it's a make ps3defconfig derivative. Configured to boot as closely to YDL as possible, without getting the init scripts on boot to grumble.

In this version have I included most of the default drivers that are needed so that the default init scripts do not complain. I remember meticulously checking the diffs between the two config files (the YDL official config from... what was it 2.6.29?) and trying to reconcile them, mainly with regards to BT and iptables, so I hope bluetooth and iptables will work fine (you can chuck BT RAID and iptables all out by the way to have a leaner config - it will boot but the initscripts will grumble).

I believe I threw out RAID in this config, as I thought really it was completely pointless on a ps3, so you will see a tiny grumble about that on boot. I also cleaned out a lot of device drivers that didn't apply. Or rather I believed did not apply :)

I believe I left the ps3defconfig time slice alone (it appeared to ask for a finer resolution, than possibly needed, if I recall correctly) but I can't remember for sure. It'll be visible in the make menuconfig for alteration anyways, I think the ps3 default was 250 hz or something in that order, I may have dropped it back to 100hz.

So this is my current 'stable' kernel config. One of two actually, the other has no BT, no iptables, no raid, but I can't seem to find that frickin' config file at the moment. I'll go thru' my ps3 over the weekend and try and dig that out. Didn't have time for more than a quick look around. In the meanwhile, take a look at this one. I hope the BT works as I've never tried it.

Cheers :)

Rob
Attachments
config-2.6.32-spykez-default.gz
2.6.32 ps3 kernel config. Based on make ps3defconfig but with the iptables stuff in.
(10.45 KiB) Downloaded 730 times
spykez
ydl beginner
ydl beginner
 
Posts: 27
Joined: 04 Dec 2009, 04:20

Re: [PS3] Kernel building from source.

Postby billb » 02 Feb 2010, 17:06

Thanks -- hopefully I can spend some time on this over the weekend.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA


Return to Kernel

Who is online

Users browsing this forum: No registered users and 3 guests