Alan McKinnon <alan.mckinnon <at> gmail.com> writes:

> Let's thin about this logically. A kernel does not get told it's
> version, it already knows that, and modules are versioned too. A kernel
> finds it's modules by looking in /path/to/modules/`uname -r`

uname -r returns:      3.13.1-gentoo

> So, either the version string is wrong in the kernel (possible I suppose
> if you copy and old .config and male oldconfig goes wrong somehow) or
> you have the wrong modules in the wrongly named directory.

Checked all of that:
ls /boot
  kernel-3.13.0-gentoo-r1   kernel-3.13.1-gentoo
   grub  lost+found     kernel-3.10.25-gentoo

pluss all permission in /lib/modules/* have been recursively fixed.

the first to kernels and related dirs had a different set of
permissions than the third kernel (3.13.1-gentoo, but that
is all manually fixed now.

> If the version string correct if you runs trings against any of those
> not-loading modules and grep for "vermagic"?

# strings  /lib/modules/3.10.25-gentoo/kernel/net/ipv4/netfilter/nf_nat_ipv4.ko 
vermagic=3.10.25-gentoo SMP mod_unload 

# strings /lib/modules/3.13.1-gentoo/kernel/net/ipv4/netfilter/nf_nat_ipv4.ko
vermagic=3.13.1-gentoo SMP mod_unload 



> Does the correct kernel version show up when looking in strings of the
> image in /boot?

probable not. Here is what I discoved:

strings /boot/kernel-3.13.1-gentoo | grep ver
<empty>

strings kernel-3.10.25-gentoo  | grep ver
<empty>

strings /boot/kernel-3.13.1-gentoo | less

<after much manual parsing>
<snip>
This kernel requires an %s CPU, 
but only detected an %s CPU.
This kernel requires the following features not present on the CPU:
%d:%d 
earlyprintk
serial
ttyS
console
uart8250,io,
uart,io,
early console in setup code
debug
WARNING: Ancient bootloader, some functionality may be limited!
Unable to boot - please use a kernel appropriate for your CPU.
A20 gate not responding, unable to boot...
0123456789ABCDEFPress <ENTER> to see video modes available, <SPACE> to
continue, or wait 30 sec
Mode: Resolution:  Type: 
%dx%d
%c %03X %4dx%-7s %-6s
Enter a video mode or "scan" to scan for additional modes: 
Undefined video mode number: %x
3.13.1-gentoo (root@skipper) #1 SMP Sun Feb 2 04:37:07 EST 2014

<snip>
invalid distance too far back
invalid distance code
invalid literal/length code
 -- System halted
incorrect header check
unknown compression method
invalid window size
invalid block type
invalid stored block lengths
invalid code lengths set
invalid bit length repeat
invalid literal/lengths set
invalid distances set
incorrect data check
Destination address too large
Decompressing Linux... 
Not a gzip file
header error
read error
uncompression error
Parsing ELF... 
done.
Booting the kernel.
too many length or distance symbols
early console in decompress_kernel
Destination address inappropriately aligned
Out of memory while allocating output buffer
Out of memory while allocating input buffer
Out of memory while allocating z_stream
Out of memory while allocating workspace
Kernel is not a valid ELF file
Failed to allocate space for phdrs
earlyprintk
serial
ttyS
console
uart8250,io,
uart,io,
initrd=
Failed to handle fs_protoFailed to open file: 
Failed to get file info size
Failed to get file info
Failed to read file
Failed to alloc mem for gdt
EL64
Failed to alloc mem for file handle list
Failed to alloc mem for file info
Failed to alloc highmem for files
We've run out of free low memory
Failed to get handle for LOADED_IMAGE_PROTOCOL
Failed to alloc lowmem for boot params
Failed to alloc mem for gdt structure
ERROR: Failed to allocate usable memory for kernel.
<end/snip>
Failed to open volume

They are pretty much identical (string wise) except this line:
strings /boot/kernel-3.10.25-gentoo | less

3.10.25-gentoo (root@skipper) #3 SMP Tue Jan 14 23:18:53 EST 2014

And these lines (located at the bottom of the string parsing):

initrd=
Failed to handle fs_proto
Failed to open volume
Failed to open initrd file: 
Failed to get initrd info
Failed to read initrd
Failed to alloc mem for gdt
EL64
Failed to alloc mem for initrds
Failed to get initrd info size
Failed to alloc mem for initrd info
Failed to alloc highmem for initrds
We've run out of free low memory
Failed to get handle for LOADED_IMAGE_PROTOCOL
Failed to alloc lowmem for boot params
Failed to alloc mem for cmdline
Failed to alloc mem for gdt structure
Failed to alloc mem for idt structure
Failed to alloc mem for kernel


 
> [working theory: the kernel throws permission denied errors when it's
> asked in weird ways to load wrong versioned modules. Pure speculation,
> I've never done this at all and don't know what the error is]

The permission are all consistent now (/lib/modules/*). I'm not sure how
they got wacked, as I have not done anything with modules yet. Nore
anything messing with those perms......

Obviously, from the strings command, the kernel(s) need fixing up a bit.
I only got them to a point, to get the openbox stuff setup. The audio
and usb automounting are all that is left to fix.... The points is the
kernels should be good enough to work with? I suspect grub2, as this
is my first forray into a bootable system with grub2........


What is stumping me is why  all three kernels boot, but the modules
only point to 3.10.25, even when boot either the second 
(kernel-3.13.0-gentoo-r1) kernel or the third (config-3.13.1-gentoo)
kernel.

I'm going to work on this and scratch a bit..... So any other suggestions
are welcome, although it'll be a few days until I post back. Got 
any strings options/scripts to only filter out the english readable
parts of mostly binary files?   Manual parsing is a drag......

What/where could the system be corrupted to only attempt to use those
modules from 3.10.25?


TIA,
James




Reply via email to