Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Any guides for rebuilding the kernel on a PS3?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
Philippe23
Tux's lil' helper
Tux's lil' helper


Joined: 20 Dec 2006
Posts: 118
Location: Rome, NY

PostPosted: Thu Dec 06, 2007 8:01 pm    Post subject: Any guides for rebuilding the kernel on a PS3? Reply with quote

Any guides for rebuilding a kernel on a PS3?

I'm stage 4 installed and up and running, but need kernel sources for gnome and some other things to install so I figured building a kernel is the next step.
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Thu Dec 06, 2007 9:07 pm    Post subject: Reply with quote

Moved from Gentoo on Alternative Architectures to Gentoo on PPC.
Moved here since it's a powerpc powered machine and you'll have a better chance of an answer here.
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
tanee
n00b
n00b


Joined: 30 May 2002
Posts: 19
Location: Germany

PostPosted: Fri Dec 07, 2007 10:23 pm    Post subject: Reply with quote

Most of the ps3 related stuff actually is located in the Alternate Architectures section, even though it contains a ppc64 processor.

To build a kernel for the ps3 you may want to check out the ps3-sources in the cell-overlay.
Some more answers can be found in this thread.
There don't seem to be any complete guides though :(.
Back to top
View user's profile Send private message
rangerpb
Retired Dev
Retired Dev


Joined: 19 Jan 2005
Posts: 147

PostPosted: Sat Dec 08, 2007 4:48 pm    Post subject: rebuilding kernel Reply with quote

Your best bet is to talk with someone on IRC, especially if you are not familiar with building kernels. That said, here's an outline for rebuilding the ps3 kernel assuming 2.6.23 to 2.6.23 and not a migration from 2.6.16 to 2.6.23:

- emerge layman subversion
- use layman to checkout the cell overlay
- emerge ps3-sources
- use the .config in /etc/kernel*
- If you are using the 32UL, make sure you use the powerpc64-unknown-linux-gcc compiler or you will fail to compile the kernel.
_________________
-->
rangerpb
<--
Back to top
View user's profile Send private message
Philippe23
Tux's lil' helper
Tux's lil' helper


Joined: 20 Dec 2006
Posts: 118
Location: Rome, NY

PostPosted: Mon Dec 10, 2007 3:51 pm    Post subject: Reply with quote

When building the ps3-sources kernel, I got the following error:
Quote:
HOSTCC arch/powerpc/boot/mktree
strip -s -R .comment vmlinux -o vmlinux.strip
WRAP arch/powerpc/boot/zImage.ps3
/usr/src/linux-2.6.23/arch/powerpc/boot/wrapper: line 113: dtc: command not found
make[1]: *** [arch/powerpc/boot/zImage.ps3] Error 1
make: *** [zImage] Error 2

After talking to rangerpb on IRC, he pointed out that I probably needed dtc, so I did the following:
  1. Added sys-apps/dtc to package.keywords.
  2. emerged sys-apps/dtc
Kernel build succeeded, now to try to boot it. :D
Back to top
View user's profile Send private message
corsair
Retired Dev
Retired Dev


Joined: 06 Oct 2003
Posts: 451
Location: Aachen, Germany

PostPosted: Mon Dec 10, 2007 10:05 pm    Post subject: Reply with quote

this is now being tracked in bug #201907
Back to top
View user's profile Send private message
Valkyr
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jan 2004
Posts: 123
Location: Belgium

PostPosted: Sun Dec 16, 2007 7:04 pm    Post subject: PS3 build kernel problems Reply with quote

Hi,

I have a perfectly working gentoo system on my own ps3, now I'm trying to do the same thing on a friends ps3 but I have some problems building the kernel.

When I compile the ps3-sources kernel from the cell overlay everything seems to go fine i get no error messages, but nothing is created in /lib/modules/2.6.23. the directory doesn't exist.

So when I boot the kernel no modules cqn be loaded.
What could be the cause of this? I'm clueless, when I compile the the kernel on my machine the modules dir is nicely created.

I use 32 but userspace and compile the kernel in 64 bit using cross compilation.
I made config with make ps3_defconfig
then do powerpc64make
then do powerpc64make modules_install

powerpc64make looks like this:
Code:
#!/bin/sh
make ARCH=powerpc CROSS_COMPILE=powerpc64-unknown-linux-gnu-


Any help is appreciated.


Last edited by Valkyr on Mon Dec 17, 2007 12:08 am; edited 1 time in total
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Sun Dec 16, 2007 7:28 pm    Post subject: Reply with quote

merged above post here.
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
firehawk256
n00b
n00b


Joined: 14 Sep 2005
Posts: 57

PostPosted: Wed Jan 30, 2008 3:46 am    Post subject: Re: rebuilding kernel Reply with quote

Ok, I don't quite understand. I'm trying to recompile a 2.6.23 kernel in 32 bit userland. Umm... Could someone hold my hand on how to do this part? :oops:

rangerpb wrote:

- If you are using the 32UL, make sure you use the powerpc64-unknown-linux-gcc compiler or you will fail to compile the kernel.


I can't quite figure out what I'm supposed to do here. I'm trying to use genkernel too if that makes any difference.

Thanks!
Back to top
View user's profile Send private message
rangerpb
Retired Dev
Retired Dev


Joined: 19 Jan 2005
Posts: 147

PostPosted: Wed Jan 30, 2008 4:22 pm    Post subject: gk and ppc64 32UL Reply with quote

For the 32bit userland, you should add the following args:

--kernel-cross-compile=powerpc64-unknown-linux-gnu- --utils-arch=ppc --arch-override=ppc

You might also need to 'make mrproper' in your kernel tree because running the 32bit gcc on them will make it miscompile with the 64bit compiler. Be careful as this will delete your .config too.

I suggest you do the following:

In the top level Makefile in usr/src/linux, change the line from:

CROSS_COMPILE ?=

to

CROSS_COMPILE ?=powerpc64-unknown-linux-gnu-

cp .config /tmp/ps3.config
make mrproper
cp /tmp/ps3.config .config
make menuconfig

tweak as you see fit


then run gk (with args I gave above) or simply issue a make -j2 vmlinux && make -j2 modules && make modules_install
_________________
-->
rangerpb
<--
Back to top
View user's profile Send private message
firehawk256
n00b
n00b


Joined: 14 Sep 2005
Posts: 57

PostPosted: Wed Jan 30, 2008 6:42 pm    Post subject: Reply with quote

Boo. It didn't work. I had to add in the /tmp/ps3.config because genkernel was complaining about a missing config file. It did that even before I tried this. But I don't think that's the problem here. Any ideas?

Code:

tkstudios linux # genkernel --kernel-cross-compile=powerpc64-unknown-linux-gnu- --utils-arch=ppc --arch-override=ppc --kernel-config=/tmp/ps3.config all
* Gentoo Linux Genkernel; Version 3.4.9
* Running with options: --kernel-cross-compile=powerpc64-unknown-linux-gnu- --utils-arch=ppc --arch-override=ppc --kernel-config=/tmp/ps3.config all

* Linux Kernel 2.6.23-ps3-r1 for ppc...
* config: Using config from /tmp/ps3.config
*         Previous config backed up to .config.bak
*         >> Running oldconfig...
* kernel: >> Cleaning...
* config: >> Invoking menuconfig...
#
# configuration written to .config
#


*** End of Linux kernel configuration.
*** Execute 'make' to build the kernel or try 'make help'.

* ERROR: Failed to compile the "prepare" target...

* -- Grepping log... --

SCSI media changer support (CHR_DEV_SCH) [N/m/y/?] n
*
* Some SCSI devices (e.g. CD jukebox) support multiple LUNs
*
Probe all LUNs on each SCSI device (SCSI_MULTI_LUN) [Y/n/?] y
Verbose SCSI error reporting (kernel size +=12K) (SCSI_CONSTANTS) [N/y/?] n
--
*
* LED Support
*
LED Support (NEW_LEDS) [N/y/?] n
*
* EDAC - error detection and reporting (EXPERIMENTAL)
*
EDAC - error detection and reporting (EXPERIMENTAL) (EDAC) [N/y/?] n
--
#
# configuration written to .config
#
* kernel: >> Cleaning...
COMMAND: make -j2  CROSS_COMPILE="powerpc64-unknown-linux-gnu-"
gcc-config error: Could not run/locate "powerpc64-unknown-linux-gnu-gcc"
* config: >> Invoking menuconfig...
COMMAND: make j1  menuconfig
COMMAND: make -j2  CROSS_COMPILE="powerpc64-unknown-linux-gnu-"
gcc-config error: Could not run/locate "powerpc64-unknown-linux-gnu-gcc"
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf -s arch/powerpc/Kconfig
gcc-config error: Could not run/locate "powerpc64-unknown-linux-gnu-gcc"
gcc-config error: Could not run/locate "powerpc64-unknown-linux-gnu-gcc"
gcc-config error: Could not run/locate "powerpc64-unknown-linux-gnu-gcc"
gcc-config error: Could not run/locate "powerpc64-unknown-linux-gnu-gcc"
gcc-config error: Could not run/locate "powerpc64-unknown-linux-gnu-gcc"
gcc-config error: Could not run/locate "powerpc64-unknown-linux-gnu-gcc"
gcc-config error: Could not run/locate "powerpc64-unknown-linux-gnu-gcc"
gcc-config error: Could not run/locate "powerpc64-unknown-linux-gnu-gcc"
--
  UPD     include/linux/version.h
  CHK     include/linux/utsrelease.h
  UPD     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-powerpc
  CC      arch/powerpc/kernel/asm-offsets.s
gcc-config error: Could not run/locate "powerpc64-unknown-linux-gnu-gcc"
make[1]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
* Gentoo Linux Genkernel; Version 3.4.9
* Running with options: --kernel-cross-compile=powerpc64-unknown-linux-gnu- --utils-arch=ppc --arch-override=ppc --kernel-config=/tmp/ps3.config all

* ERROR: Failed to compile the "prepare" target...

* -- End log... --

* Please consult /var/log/genkernel.log for more information and any
* errors that were reported above.

* Report any genkernel bugs to bugs.gentoo.org and
* assign your bug to genkernel@gentoo.org. Please include
* as much information as you can in your bug report; attaching
* /var/log/genkernel.log so that your issue can be dealt with effectively.
*
* Please do *not* report compilation failures as genkernel bugs!
*


Will try the manual method here in a bit.
Back to top
View user's profile Send private message
rangerpb
Retired Dev
Retired Dev


Joined: 19 Jan 2005
Posts: 147

PostPosted: Thu Jan 31, 2008 4:12 pm    Post subject: Reply with quote

Yes, if I remember correctly, the cross compiler has not been set ini gcc-config. Use gcc-config to set it. First look at what gcc-config knows for your compilers:

baude@baudequad ~/gentoo-x86 $ gcc-config -l
[1] powerpc-unknown-linux-gnu-4.1.2 *
[2] powerpc64-unknown-linux-gnu-4.1.2 *
baude@baudequad ~/gentoo-x86 $


Then run gcc-config -f on the target you are having problems with.


Like gcc-config -f powerpc64-unknown-linux-gnu-4.1.2
_________________
-->
rangerpb
<--
Back to top
View user's profile Send private message
firehawk256
n00b
n00b


Joined: 14 Sep 2005
Posts: 57

PostPosted: Sun Feb 10, 2008 5:43 am    Post subject: Reply with quote

It took me a while before I could get back to this, but I got it to work. I did what you suggested with the gcc-config, but then I got an error about needing a newer version of binutils. I already had a newer version than the error said I needed but I decided to try re-emerging binutils anyway. I re-ran the gcc-config anyway just to be sure and then the kernel finally compiled! Hooray!

So, my next question is, is there a way to put all of those command line options into genkernel.conf so I don't have to enter them evey time? I already found the "arch_override" option, but how do I enter the rest of them?

Thanks for all the help! 8)
Back to top
View user's profile Send private message
rangerpb
Retired Dev
Retired Dev


Joined: 19 Jan 2005
Posts: 147

PostPosted: Sun Feb 10, 2008 3:10 pm    Post subject: Reply with quote

I put the genkernel arguements in two posts up. That works for me and it's what I use for the releng process when building stages and media.

As an aside, I did release a package called ps3-kernel-bin in the cell overlay. It emerges a stripped, binary kernel, System.map, and modules. The current one is based on a heavily patched 2.6.24 from the Sony distro kit.
_________________
-->
rangerpb
<--
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum