LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 08-17-2023, 01:18 PM   #1
Azureian
LQ Newbie
 
Registered: Aug 2023
Posts: 1

Rep: Reputation: 0
Talking Unable to enter Chroot environment at 7.4 in the booklet.


Hello, I am experiencing an issue where when I run the commands:
Code:
chroot "$LFS" /usr/bin/env -i \
 HOME=/root                   \
 TERM="$TERM"                 \
 PS1='(lfs chroot) \u:\w\$ '  \
 PATH=/usr/bin:/usr/sbin      \
 MAKEFLAGS='-j4'              \
 /bin/bash --login
It displays
Code:
chroot: failed to run command ‘/usr/bin/env’: No such file or directory
I have read many forums and still can't figure out how to fix this.
I tried fixing the symlinks, but it did not work.

My $LFS variable is set to '/mnt/lfs'

Running 'ls -l /usr/bin/env' returns:
Code:
-rwxr-xr-x 1 root root 48536 Sep 20  2022 /usr/bin/env
Here are my permissions:
Code:
total 48
drwxr-xr-x  13 root root  4096 Aug 17 13:48 .
drwxr-xr-x   3 root root  4096 Aug 16 21:17 ..
lrwxrwxrwx   1 root root     7 Aug 17 13:48 bin -> usr/bin
drwxr-xr-x  18 root root  3520 Aug 16 22:41 dev
drwxr-xr-x   2 root root  4096 Aug 16 22:58 etc
lrwxrwxrwx   1 root root     7 Aug 17 13:48 lib -> usr/lib
drwxr-xr-x   2 root root  4096 Aug 17 13:46 lib64
drwx------   2 root root 16384 Aug 16 21:11 lost+found
dr-xr-xr-x 293 root root     0 Aug 17 13:36 proc
drwxrwxrwt   2 root root    40 Aug 17 13:36 run
lrwxrwxrwx   1 root root     8 Aug 17 13:48 sbin -> usr/sbin
drwxrwxrwt   2 lfs  root  4096 Aug 17 00:10 sources
dr-xr-xr-x  13 root root     0 Aug 16 20:47 sys
drwxr-xr-x   8 root root  4096 Aug 16 22:42 tools
drwxr-xr-x   9 root root  4096 Aug 16 23:50 usr
drwxr-xr-x   3 root root  4096 Aug 16 22:58 var
LDD for '/usr/bin/env'
Code:
        linux-vdso.so.1 (0x00007fffd9283000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8c5b459000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f8c5b667000)
ls output:
Code:
bin  etc  lib64       proc  sbin     sys    usr
dev  lib  lost+found  run   sources  tools  var
I would appreciate it if someone could inform me of what needs to be changed.

If it matters, I am running Kali 2023.2a 64bit on VMware Workstation 17.
 
Old 08-18-2023, 10:30 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Quote:
My $LFS variable is set to '/mnt/lfs'
Then you must have /mnt/lfs/usr/bin/env for this command to work.
 
Old 08-19-2023, 03:37 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,576
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
It should work if LFS is correctly set at the time the chroot command is given. Have you been doing this build in stages? If so, you need to visually check that LFS is set at the start of each stage.

@emerson: here is the version from the book
Code:
chroot "$LFS" /usr/bin/env -i   \
    HOME=/root                  \
    TERM="$TERM"                \
    PS1='(lfs chroot) \u:\w\$ ' \
    PATH=/usr/bin:/usr/sbin     \
    /bin/bash --login

Last edited by hazel; 08-19-2023 at 03:44 AM.
 
Old 08-21-2023, 02:52 AM   #4
derguteweka
Member
 
Registered: Sep 2018
Distribution: BLFS
Posts: 74

Rep: Reputation: 21
Moin,

Quote:
Originally Posted by Azureian View Post
Code:
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8c5b459000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f8c5b667000)
Do both files exist (in /mnt/lfs) with sensible sizes/content?


cheers,
WK
 
  


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
Script to enter Chroot Environment kz_chopper Linux From Scratch 6 02-17-2013 03:23 PM
Unable to enter password in terminal to enter as root.. ANISHKUMAR.R Linux - Newbie 5 08-07-2010 07:46 AM
which email client prints calendar/contact in booklet form & does multiple pop accts? hey_tonite! Linux - Software 0 04-22-2009 04:12 AM
Printing A5 booklet on A4 duplex printer rjlee Linux - General 2 04-11-2005 02:27 PM
CD booklet creating software Mistreated Linux - Software 0 02-21-2005 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 12:28 AM.

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