WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Problems with custom 64-bit kernel  (Read 6776 times)

Offline am

  • Newbie
  • *
  • Posts: 5
Problems with custom 64-bit kernel
« on: September 02, 2014, 02:28:00 PM »
Hi there,

I have a runtime problem just after booting into a custom built 64bit kernel. So far as I can see, busybox/modprobe repeatedly seg faults during boot.

My install is based on a dual (32-/64-bit) kernel, selected via grub. I have a single 32-bit rootfs and separate 32-bit and 64-bit modules. This part all works fine.

I need to make a very minor modification to the kernel configuration. I've successfully built both x86 and x86_64 kernels on x86 and x86_64 variants of Ubuntu using the patched kernel sources and kernel configs from here:

http://www.tinycorelinux.net/5.x/x86/release/src/kernel/

Both x86 and x86_64 kernels both build fine on my two separate Ubuntu hosts using:

$ cd linux-3.8.13-patched
$ cp $PATH_TO/config-3.8.13-tinycore(64) .config
$ make oldconfig
$ make bzImage
$ cp arch/x86/boot/bzImage /media/usb_stick/boot/vmlinuz(64)

Booting the 32-bit kernel is fine. My system runs as expected. However, the 64-bit kernel boots up and hits the busybox/modprobe seg faults shortly and repeatedly, just after udev starts.

I suspect I have something fundamentally wrong with the config and/or build. However, I've tried using the vanilla config-3.8.13-tinycore64 and that also has the exact same behaviour. In a fit of paranoia, I even tried building from the patched 3.8.13 kernel sources, using the vanilla config-3.8.13-tinycore64 using a tinycore64-hosted system to perform the build. It also displays the same busybox/modprobe seg fault behaviour.

Is there some step that I am missing? I realise that major changes to the kernel config require the modules to be recompiled, but since I haven't yet actually changed the kernel config, I expect to avoid this stage :-).
 
Thanks in advance,
Andy

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Problems with custom 64-bit kernel
« Reply #1 on: September 02, 2014, 02:56:27 PM »
You cannot mix 32 bit and 64 bit kernels in the same initrd.
Core does not support dual mode userspace.
Either run corepure64 in a pure 64 bit kernel and userspace
or run the 64bit kernel and initrd with the 32 bit userspace.

Offline am

  • Newbie
  • *
  • Posts: 5
Re: Problems with custom 64-bit kernel
« Reply #2 on: September 02, 2014, 04:12:58 PM »
Are you sure I can't mix kernels? I am using a similar method as coreplayer2 outlines in this thread:

Code: (html5) [Select]
http://forum.tinycorelinux.net/index.php?topic=15889.0
Essentially, I have separate two separate initrds:

32 bit: rootfs + modules

64 bit: rootfs + modules64

The dual kernel boot seems to all work fine. It only stops working after I've rebuilt and installed the 64-bit kernel.


Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Problems with custom 64-bit kernel
« Reply #3 on: September 02, 2014, 04:22:05 PM »
It sounds like you're rebuilding the kernel, but using the repo modules. That will not work due to different compilers - you will also need to build the modules, and then use only those you built.

The two kernels can coexist, as the modules are in a different path.
The only barriers that can stop you are the ones you create yourself.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Problems with custom 64-bit kernel
« Reply #4 on: September 02, 2014, 04:44:15 PM »
Yes yo can have the two kernels in the same boot device, but they can't share an initrd unless the binaries are 32 bit.  That is how the original 64 bit Core works.
Corepure64  binaries won't run with a 32 bit kernel, so a seperate initrd is needed along with a separate tce directory.

Dual mode systems  ( like CentOS ) use a 64 bit kernel and modules,  32 bit and 64 bit binaries and libraries  are stored in separate directories.
« Last Edit: September 02, 2014, 04:46:11 PM by gerald_clark »

Offline am

  • Newbie
  • *
  • Posts: 5
Re: Problems with custom 64-bit kernel
« Reply #5 on: September 02, 2014, 04:46:39 PM »
It sounds like you're rebuilding the kernel, but using the repo modules. That will not work due to different compilers - you will also need to build the modules, and then use only those you built.

Thanks. I am using the vanilla modules64.gz initrd image, downloaded from the 5.x release folder. I thought I could get away with this since I hadn't actually changed the kernel config. I am, as you say, using a different compiler though. I guess that's enough to upset things.

Are there any kernel modules that could possibly get populated via tinycore repo packages? I have quite a few repo tcz's in two lists - one for 32-bit and one for 64-bit.

After I run:

$ make modules,
$ make modules_install INSTALL_MOD_PATH=....

I get lib/modules and lib/firmware in the directory set by INSTALL_MOD_PATH. I guess I can ignore lib/firmware contents since these weren't present in the vanilla install. I've packed these freshly built modules up into a new modules64.gz initrd image and installed them but... I still get the seg fault. 

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Problems with custom 64-bit kernel
« Reply #6 on: September 02, 2014, 04:55:35 PM »
There are many kernel modules in the extensions in the repo. These include sound, wireless, parallel ports.
About the only ones included in the modules.gz are the ones need to boot and establish a wired internet connection with the varied hardware available.
Look at all the extensions that contain 3.8.13 in their name.  These contain modules.

Offline am

  • Newbie
  • *
  • Posts: 5
Re: Problems with custom 64-bit kernel
« Reply #7 on: September 03, 2014, 04:33:45 PM »
Many thanks gerald_clark & curaga for your helpful comments. I spent some time today getting the modules built and packaged in my various initrd images. All is now working fine when booting from 32-bit and 64-bit kernels.

I made some good use of the sorter script to build containers for the bootable modules(64).gz and extension modules found in *tinycore(64).tcz's, which helped me enormously to figure out how to package and deploy the various artefacts of the kernel/module build in tinycore.

Thanks again,
Andy