WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: chroot /tmp/extract/ depmod -a (FATAL: Could not open)  (Read 4916 times)

Offline xpto09

  • Newbie
  • *
  • Posts: 30
chroot /tmp/extract/ depmod -a (FATAL: Could not open)
« on: July 30, 2009, 04:16:35 PM »
I got to make my first remaster.
I installed beaver (glib1, gtk1) and mc (glib1).
The boot was fine.

However, I didn't understand the following error:

root@kurumin:/# chroot /tmp/extract/ depmod -a

WARNING: Couldn't open directory /lib/modules/2.6.18.1-slh-up-2: No such file or directory
FATAL: Could not open /lib/modules/2.6.18.1-slh-up-2/modules.dep.temp for writing: No such file or directory

Is It happening because I didn't add a module?


root@kurumin:/# ls /lib/modules/2.6.18.1-slh-up-2/

build                misc/                modules.ieee1394map  modules.pcimap       net/
extra/               modules.alias        modules.inputmap     modules.seriomap
kernel/              modules.ccwmap       modules.isapnpmap    modules.symbols
linux-wlan-ng/       modules.dep          modules.ofmap        modules.usbmap
But this is in my host.

The command "ldconfig -r /tmp/extract" was fine.

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: chroot /tmp/extract/ depmod -a (FATAL: Could not open)
« Reply #1 on: July 30, 2009, 11:39:10 PM »
That would be my fault. I added some instructions to the wiki and left out some important details. Check it again. :)

@developers
I edited (and tested) the changes. I added these changes because I struggled for quite some time trying to get my remastered tinycore.gz to work with new modules and libraries when I realized that ldconfig and depmod on the new root filesystem were what was missing. I added this info to the wiki to help others avoid that struggle.

Offline xpto09

  • Newbie
  • *
  • Posts: 30
Re: chroot /tmp/extract/ depmod -a (FATAL: Could not open)
« Reply #2 on: July 31, 2009, 06:32:31 PM »
 ???
Probably I am doing a "newbie error".
Following the wiki:

You must use chroot because "depmod -b /tmp/extract" will not follow the kernel.tclocal symbolic link to find
modules under /usr/local.

I tried this:

root@siduxbox:/tmp/extract# depmod -b /tmp/extract 2.6.29.1-tinycore
serveral warning like this:
WARNING: Can't read module /tmp/extract/lib/modules/2.6.29.1-tinycore/kernel/drivers/serial/serial_cs.ko.gz:
Exec format error

root@siduxbox:/# chroot /tmp/extract/
chroot: cannot run command `/bin/bash': No such file or directory

root@siduxbox:/# depmod -b /tmp/extract/lib/modules/2.6.29.1-tinycore/
WARNING: Couldn't open directory /tmp/extract/lib/modules/2.6.29.1-tinycore//lib/modules/2.6.30-1.slh.3-sidux-686: No such file or directory
FATAL: Could not open /tmp/extract/lib/modules/2.6.29.1-tinycore//lib/modules/2.6.30-1.slh.3-sidux-686/modules.dep.temp for writing: No such file or directory

However, the others options worked:
1) root@siduxbox:/tmp/extract#chroot /tmp/extract/ depmod -a 2.6.29.1-tinycore;
2) root@siduxbox:/# rm lib/modules/2.6.29.1-tinycore/kernel.tclocal
   root@siduxbox:/tmp/extract#ln -s -f ../../../usr/local/lib/modules/2.6.29.1-tinycore/kernel /lib/modules/2.6.29.1-tinycore/kernel.tclocal


Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: chroot /tmp/extract/ depmod -a (FATAL: Could not open)
« Reply #3 on: August 03, 2009, 04:01:28 PM »
Quote
However, the others options worked:
You only need to do one of the two options. The second option still requires you to execute "depmod -b /tmp/extract 2.6.29.1-tinycore" afterwards. Creating the link just means you don't have to chroot. The softlink is fixed in the newly released 2.2.

Keep in mind this is only if you add kernel modules. If you do not add or remove kernel modules, you can omit this step.