WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Creating initrd issues  (Read 6930 times)

Offline Demolishun

  • Newbie
  • *
  • Posts: 14
Creating initrd issues
« on: March 30, 2012, 07:38:02 AM »
I downloaded the kernel for the latest TC and configured it with the .config for TC.  Then I tweaked the kernel to use USBIP kernel module.  I went ahead and compiled the kernel and followed the wiki guides for creating the core.gz file.  I installed the new kernel and called it myvmlinuz and the core file mycore.gz.  I updated the extlinux.conf. 

When I boot this kernel it gets this far:
...
Waiting as requested ... 5
modprobe: can't load module zram (source/drivers/staging/zram/zram.ko): No such file or directory
modprobe: can't load module zcache (source/drivers/staging/zcache/zcache.ko): No such file or directory

I found some posts that said I needed to do a depmod.  I went back and did the depmod, but I am getting the exact same results.  I put every kernel module in the myconfig.gz so it would have them on boot.  I suspect this is not getting the "staging" modules like usbip because those are not in the normal kernel build.

If I use the original core.gz with new kernel it boots fine.  It is something wrong with the mycore.gz.

So, if anyone has some ideas on what might be causing this thanks in advance.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Creating initrd issues
« Reply #1 on: March 30, 2012, 05:34:55 PM »
I trust you understand that the 'modules.*' files (in "/lib/modules/$( uname -r )") need to properly reflect the set of kernel modules available. This is why you'll need to run sudo depmod -a -b $BASEDIR $VERSION for your remaster, where $BASEDIR is the staging directory representing the root of your new initrd, and $VERSION the kernel version. This means that the 'modules.*' files should be created in "${BASEDIR}/lib/modules/${VERSION}" (BTW, if $VERSION is the same as 'uname -r' you could omit it).

A simple test to check that the set of files matches the 'module.*' files (assuming one runs this from the "${BASEDIR}/lib/modules/${VERSION}" directory) would be:
  sed 's#:.*##' modules.dep | sort > /tmp/mods ; find kernel* -follow -type f | sort | diff - /tmp/mods

Offline Demolishun

  • Newbie
  • *
  • Posts: 14
Re: Creating initrd issues
« Reply #2 on: March 30, 2012, 05:55:13 PM »
Yes, I believe I did that part right.  I am currently building a "clean" version where I made no changes to the config at all.  That way I can isolate as to whether this is a "staging" driver issue, or I have a fundamental flaw in my building process. 

Just to be clear, after I run depmod there should be a file or files name modules.* in /lib/modules/ or in /lib/modules/3.0.21-tinycore ? 

I am doing development in this directory:
/mnt/sda1/devel
My BASEDIR is: /mnt/sda1/devel/extract
The new kernel name is 3.0.21-tinycore so uname -r returns the same thing.
So the directory for modules in the BASEDIR is /mnt/sda1/devel/extract/lib/modules/3.0.21-tinycore
I have been running this command to do the depmod as su in the devel directory:
depmod -a -b extract 3.0.21-tinycore

It does not have have any errors when it runs.

I just checked and I must be doing something wrong.  The modules.dep files points to the wrong directories for the modules.  It points to source/, kernel/, etc.  So it seems it is building the modules. dep, but is doing it wrong?

Offline Demolishun

  • Newbie
  • *
  • Posts: 14
Re: Creating initrd issues
« Reply #3 on: March 30, 2012, 05:59:37 PM »
Ahhh, no wonder it is not working.  It has got simlinks to the kernel build directory for the source/ and kernel/ paths under BASEDIR/lib/modules/3.0.21-tinycore!  How do I get the modules moved over and not just simlinked? 

I did the make INSTALL_MOD_PATH=  command.

Offline Demolishun

  • Newbie
  • *
  • Posts: 14
Re: Creating initrd issues
« Reply #4 on: March 30, 2012, 06:11:36 PM »
Okay, this is how I fixed it:
I found 2 simlinks in the BASEDIR/lib/modules/3.0.21-tinycore/ directory.
I deleted the simlinks and left the directory kernel in tact.  That is where the modules are.  Once I deleted the simlinks I did a depmod as below and then created the mycore.gz file.  Now I am booting properly.  I am not sure when those simlinks are created but I suspect they are created duing the make INSTALL_MOD_PATH command.  I have built a second kernel for testing and I will test that theory out.