LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-07-2005, 02:46 PM   #1
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
chroot - bin/sh not found


Im building my own distro, but am running into problems. Id want to test how its going via chroot, and that shouldnt be complicated, right? (:

Well, check this out:
Code:
# /usr/sbin/chroot /share/silmu/myboot/rootfs/                                     
/usr/sbin/chroot: cannot run command `/bin/sh': No such file or directory
# ls -la /share/silmu/rootfs/bin/sh 
lrwxrwxrwx  1 root root 7 2005-05-07 22:32 rootfs/bin/sh -> busybox*
Whats the case here? /bin/sh surely is there, why does chroot claim not to have found it?
I also tried with ash (also bultin in my busybox), no luck.
 
Old 05-07-2005, 02:53 PM   #2
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
do you also have a ../../lib dir. there with the basic libs & symlinks.?
( the ones from slack-cd/../a/glibc-solibs ).

egag
 
Old 05-07-2005, 02:54 PM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
could you post the output of 'pwd'
right after this output :
lrwxrwxrwx 1 root root 7 2005-05-07 22:32 rootfs/bin/sh -> busybox*
 
Old 05-07-2005, 03:07 PM   #4
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
Re: chroot - bin/sh not found

Quote:
Originally posted by Artanicus

Well, check this out:
Code:
# /usr/sbin/chroot /share/silmu/myboot/rootfs/                                     
/usr/sbin/chroot: cannot run command `/bin/sh': No such file or directory
# ls -la /share/silmu/rootfs/bin/sh 
lrwxrwxrwx  1 root root 7 2005-05-07 22:32 rootfs/bin/sh -> busybox*
/share/silmu/myboot/rootfs/

/share/silmu/rootfs/bin/sh

also i'm missing the ../myboot/.. in the 2.nd line of code? ( typo ? )

egag
 
Old 05-07-2005, 03:10 PM   #5
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Original Poster
Rep: Reputation: 31
Code:
# tree rootfs/
rootfs/
|-- bin
|   |-- ash -> busybox
|   |-- busybox
|   |-- cat -> busybox
|   |-- chmod -> busybox
|   |-- chown -> busybox
|   |-- cp -> busybox
|   |-- date -> busybox
|   |-- echo -> busybox
|   |-- false -> busybox
|   |-- fgrep -> busybox
|   |-- grep -> busybox
|   |-- gunzip -> busybox
|   |-- hostname -> busybox
|   |-- kill -> busybox
|   |-- ln -> busybox
|   |-- ls -> busybox
|   |-- mkdir -> busybox
|   |-- mount -> busybox
|   |-- mv -> busybox
|   |-- ps -> busybox
|   |-- pwd -> busybox
|   |-- rm -> busybox
|   |-- rmdir -> busybox
|   |-- sh -> busybox
|   |-- sleep -> busybox
|   |-- tar -> busybox
|   |-- true -> busybox
|   |-- umount -> busybox
|   `-- zcat -> busybox
|-- linuxrc -> bin/busybox
|-- sbin
|   |-- ifconfig -> ../bin/busybox
|   |-- init -> ../bin/busybox
|   |-- loadkmap -> ../bin/busybox
|   |-- poweroff -> ../bin/busybox
|   |-- reboot -> ../bin/busybox
|   |-- swapoff -> ../bin/busybox
|   `-- swapon -> ../bin/busybox
`-- usr
    |-- bin
    |   |-- [ -> ../../bin/busybox
    |   |-- bunzip2 -> ../../bin/busybox
    |   |-- bzcat -> ../../bin/busybox
    |   |-- clear -> ../../bin/busybox
    |   |-- crontab -> ../../bin/busybox
    |   |-- deallocvt -> ../../bin/busybox
    |   |-- du -> ../../bin/busybox
    |   |-- env -> ../../bin/busybox
    |   |-- expr -> ../../bin/busybox
    |   |-- free -> ../../bin/busybox
    |   |-- head -> ../../bin/busybox
    |   |-- id -> ../../bin/busybox
    |   |-- install -> ../../bin/busybox
    |   |-- killall -> ../../bin/busybox
    |   |-- openvt -> ../../bin/busybox
    |   |-- readlink -> ../../bin/busybox
    |   |-- reset -> ../../bin/busybox
    |   |-- tail -> ../../bin/busybox
    |   |-- tee -> ../../bin/busybox
    |   |-- test -> ../../bin/busybox
    |   |-- time -> ../../bin/busybox
    |   |-- tr -> ../../bin/busybox
    |   |-- tty -> ../../bin/busybox
    |   |-- wc -> ../../bin/busybox
    |   |-- which -> ../../bin/busybox
    |   `-- yes -> ../../bin/busybox
    `-- sbin
        `-- crond -> ../../bin/busybox

5 directories, 64 files
egag, thats was a typo, yeah.

I guess its the libs Im missing.. theyre still at /share/silmu/myboot/uclibc-dev.. But then the error should be something different, right?
 
Old 05-07-2005, 03:22 PM   #6
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
don't know.
all i know is that the basic libs should be there to even run a simple script.
the error ( file not found ) could also mean
" cannot do anything , not even give the correct error-description ".

you'll need the lib.'s anyway.
just install them and try again.

egag
 
Old 05-07-2005, 03:27 PM   #7
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Original Poster
Rep: Reputation: 31
well, I threw in the uclibc-dev libs and includes, but it odesnt help.. No wonder, its missing vitals libs (compared to ldd /bin/sh) .. *sigh* I need a more up to date howto on making a floppydistro.. any suggestions? Sofar been following: http://www.xs4all.nl/~lennartb/insta...stalldisk.html

Ofcourse I could copy the libs from my own system. but that wouldnt be such a nice trick, considering the target systems will be very varied..
 
Old 05-07-2005, 03:37 PM   #8
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
i think you need to make some symlinks.
these 3 are the most basic:

--------
root@slack21:/home/egag# ls -al /lib/libc.so.6
lrwxrwxrwx 1 root root 13 2005-02-11 15:03 /lib/libc.so.6 -> libc-2.3.4.so
root@slack21:/home/egag# ls -al /lib/libdl.so.2
lrwxrwxrwx 1 root root 14 2005-02-11 15:03 /lib/libdl.so.2 -> libdl-2.3.4.so
root@slack21:/home/egag# ls -al /lib/ld-linux.so.2
lrwxrwxrwx 1 root root 11 2005-02-11 15:03 /lib/ld-linux.so.2 -> ld-2.3.4.so
-----------

egag
 
Old 05-16-2005, 04:26 AM   #9
jackandking
Member
 
Registered: Dec 2004
Posts: 92

Rep: Reputation: 15
try this "sudo chroot yourdir su -"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chroot: cannot run command `/tools/bin/env': No such file or directory Basel Linux From Scratch 10 06-09-2018 02:15 PM
bash: chroot: command not found satimis Linux From Scratch 9 03-15-2010 08:38 AM
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 10:30 AM
Error when starting up snort: bash:!/bin/sh/usr/local/bin/snort :Eent not found cynthia_thomas Linux - Software 1 11-11-2005 02:59 PM
Cannot Enter chroot /usr/bin/env directory not found Zero-0-Effect Linux From Scratch 2 03-13-2004 12:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration