Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Finding the kernel image...
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
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1423
Location: /uk/sheffield

PostPosted: Mon Aug 17, 2009 1:23 pm    Post subject: Finding the kernel image... Reply with quote

Hi All,

I'm trying to compile a custom kernel for my PS3 install and have used antonlacon's 2.6.29-gentoo-r5 kernel configuration as a basis.

Built the kernel and modules have been installed fine, but I can't seem to find where a few things are, primarily the kernel image itself (although it looks like I do have two options under /usr/src/linux/vmlinux and /usr/src/linux/vmlinux.bin).

I'm used to x86 and I'd normally do...

Code:

make && make modules_install
cp arch/x86/boot/bzImage /boot/2.6.30-[whatever]


...and modify my /etc/lilo.conf and update as necessary.

But there is no bzImage under arch/powerpc/boot ??

There is the following which I've tried, but the resulting items are empty...

Code:

# cat /usr/src/linux/arch/powerpc/boot/README

To extract the kernel vmlinux, System.map, .config or initrd from the zImage binary:

objcopy -j .kernel:vmlinux -O binary zImage vmlinux.gz
objcopy -j .kernel:System.map -O binary zImage System.map.gz
objcopy -j .kernel:.config -O binary zImage config.gz
objcopy -j .kernel:initrd -O binary zImage.initrd initrd.gz

# cd /usr/src/linux/arch/powerpc/boot/
# objcopy -j .kernel:vmlinux -O binary zImage vmlinux.gz
# objcopy -j .kernel:System.map -O binary zImage System.map.gz
# objcopy -j .kernel:.config -O binary zImage config.gz
# objcopy -j .kernel:initrd -O binary zImage.initrd initrd.gz
objcopy: 'zImage.initrd': No such file

# ls -l *.gz
-rwxr-xr-x 1 root root 0 Aug 17 14:16 System.map.gz
-rwxr-xr-x 1 root root 0 Aug 17 14:16 config.gz
-rwxr-xr-x 1 root root 0 Aug 17 14:16 vmlinux.gz


As I mention there are two files in /usr/src/linux that may be the kernel image...

Code:

# ls -l /usr/src/linux/vm*
-rwxr-xr-x 1 root root  8474051 Aug 17 14:04 /usr/src/linux/vmlinux
-rwxr-xr-x 1 root root  6731432 Aug 17 14:04 /usr/src/linux/vmlinux.bin
-rw-r--r-- 1 root root 11465396 Aug 17 14:04 /usr/src/linux/vmlinux.o


Which of vmlinux and vmlinux.bin should I use?

Also currently I'm using the kernel modules and initrd image that came with the install CD. Given that it appears that I've not made an initrd image (and there's no hint as to how to do this in /usr/src/linux/README) should I be looking to emerge and use sys-apps/kninitrd ?

I thought I had a fairly good grasp on this having been compiling my own kernels under x86 for a good few years but this has thrown me.

Cheers

slack
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1423
Location: /uk/sheffield

PostPosted: Mon Aug 17, 2009 3:09 pm    Post subject: Reply with quote

I forgot to add that I'd clocked that under this set-up I add the new kernel to /etc/kboot.conf and NOT /etc/lilo.conf to be able to install and run it :wink:
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7167

PostPosted: Mon Aug 17, 2009 3:21 pm    Post subject: Reply with quote

file vmlinuz
file vmlinuz.bin

will answer it
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1423
Location: /uk/sheffield

PostPosted: Mon Aug 17, 2009 3:32 pm    Post subject: Reply with quote

krinn wrote:
file vmlinuz
file vmlinuz.bin

will answer it


Which gives...

Code:

# file vmlinux
vmlinux: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, not stripped
# file vmlinux.bin
vmlinux.bin: data


But then the arch/powerpc/boot/zImage has the following...

Code:

# file arch/powerpc/boot/zImage
arch/powerpc/boot/zImage: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), statically linked, not stripped


Note overly concerned about the differences in 32/64-bit as I'm using a 64-bit kernel with 32 user-land.

I guess I go with /usr/src/linux/vmlinux for the kernel?

And why doesn't the instructions given in /usr/src/linux/arch/powerpc/boot/README result in extracting the necessary components (note the filesizes are all 0bytes in the above)?

Any ideas about the initrd image? I know they're not essential, but the current kernel I pulled off the LiveCD uses one and it gets things up and running nice and quick and I'd like to get that under this new kernel too.

Is sys-apps/mkinitrd the way to do or is there an option to the kernel source 'Make[file]' that I can use to compile an init image?


slack
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7167

PostPosted: Mon Aug 17, 2009 3:38 pm    Post subject: Reply with quote

not really, but you could try "file" your initrd too to see what it have to say

ps: yeah, i love "file", that's a wonderful little tool, and i'm still amaze how cool that tool is :D
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1423
Location: /uk/sheffield

PostPosted: Mon Aug 17, 2009 3:42 pm    Post subject: Reply with quote

krinn wrote:
not really, but you could try "file" your initrd too to see what it have to say


:lol: If I could find it! That's the problem, I can't work out if its even been built and if it has where it is! There's nothing in /usr/src/linux/init/ thats been recently built and left as executable nor in /usr/src/linux/arch/powerpc/boot/ or /usr/src/linux/arch/powerpc/kernel/ that seems obvious.


krinn wrote:

ps: yeah, i love "file", that's a wonderful little tool, and i'm still amaze how cool that tool is :D


Note one I'd really come across before, thanks for the pointer (off to read the man page now!)
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1423
Location: /uk/sheffield

PostPosted: Mon Aug 17, 2009 4:14 pm    Post subject: Reply with quote

Just checked the wiki entry and /usr/src/linux/vmlinux is the way to go, but no mention of an initrd still :?
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Back to top
View user's profile Send private message
gringo
Advocate
Advocate


Joined: 27 Apr 2003
Posts: 3793

PostPosted: Mon Aug 17, 2009 4:30 pm    Post subject: Reply with quote

Quote:
/usr/src/linux/vmlinux is the way to go


just to confirm : yes, or at least in ppc32 it is.

no idea about initrds though, dont use that stuff.

cheers
_________________
Error: Failing not supported by current locale
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1423
Location: /uk/sheffield

PostPosted: Mon Aug 17, 2009 6:49 pm    Post subject: Reply with quote

Cheers, copied it over, rebooted.....and nothing, blank screen, not activity on the PS3. :(


Making an initrd image seems fairly straight forward as one can...

Code:

cd /boot/
emerge -av mkinitrd
mkinitrd -o initrd.2.6.30-gentoo-r5 2.6.30-gentoo-r5


But it seems strange that /usr/src/linux/arch/powerpc/boot/README suggests that its is already built and can be extracted as per above. Perhaps there's an option to the kernel's Make[file] that I'm unaware of. Thought I'd try this out with the obvious make target (NB powerpc64make is an == alias powerpc64make='make ARCH=powerpc CROSS_COMPILE=powerpc64-unknown-linux-gnu-')


Code:

# powerpc64make init
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-powerpc
  CC      kernel/bounds.s
  GEN     include/linux/bounds.h
  CC      arch/powerpc/kernel/asm-offsets.s
  GEN     include/asm/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CC      init/main.o
  CHK     include/linux/compile.h
  CC      init/version.o
  CC      init/do_mounts.o
  CC      init/do_mounts_rd.o
  LD      init/mounts.o
  LD      init/built-in.o


So something has been built, but its not the arch/powerpc/boot/zImage.initrd that the arch/powerpc/boot/README purports should be used, and I can't for the life of me work out where its created the damn thing. Tried using tree and grep'ing the results for the current date/time but no joy...

Code:

# cd /usr/src/linux
# tree -fDh | grep 'Aug 17 19'
|   |   |-- [ 12K Aug 17 19:44]  ./arch/powerpc/kernel
|   |   |   |-- [ 12K Aug 17 19:44]  ./arch/powerpc/kernel/asm-offsets.s
|-- [4.0K Aug 17 19:44]  ./include
|   |-- [  11 Aug 17 19:44]  ./include/asm -> asm-powerpc
|   |   `-- [ 11K Aug 17 19:44]  ./include/asm-powerpc/asm-offsets.h
|   |-- [4.0K Aug 17 19:46]  ./include/config
|   |   |-- [  17 Aug 17 19:46]  ./include/config/kernel.release
|   |-- [ 36K Aug 17 19:46]  ./include/linux
|   |   |-- [ 226 Aug 17 19:44]  ./include/linux/bounds.h
|-- [4.0K Aug 17 19:44]  ./init
|   |-- [ 49K Aug 17 19:44]  ./init/built-in.o
|   |-- [ 14K Aug 17 19:44]  ./init/do_mounts.o
|   |-- [ 10K Aug 17 19:44]  ./init/do_mounts_rd.o
|   |-- [ 25K Aug 17 19:44]  ./init/main.o
|   |-- [ 22K Aug 17 19:44]  ./init/mounts.o
|   `-- [2.4K Aug 17 19:44]  ./init/version.o
|-- [ 12K Aug 17 19:44]  ./kernel
|   |-- [3.1K Aug 17 19:44]  ./kernel/bounds.s


This is rather strange as most things are usually well documented in the kernel 8O
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
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