On 2/2/2020 2:41 PM, Bruce Dubbs via blfs-support wrote:
On 2/2/20 2:18 PM, Alan Feuerbacher via blfs-support wrote:
On 2/2/2020 9:15 AM, Bruce Dubbs via blfs-support wrote:
On 2/2/20 12:10 AM, Alan Feuerbacher via blfs-support wrote:

Any clues what's going south?

The lfs alias is not meant to be run from lfs user.  The only time you need to be user lfs is when building LFS Chapter 5.

Ok. But I thought that, once you're done building LFS, user lfs is just another random user name.

Not quite.  If you change .bash_profile and .bashrc to more "normal" contents, then it would be OK. Notably, you do not want /tools/bin in the PATH and you do want the standard environment that .bash_profile removes.

Ooohhhh! Yes, user lfs still has the LFS .bash files. So I won't use it at all.

I created a new user to see what Fedora set as the defaults for the .bash files. Those for user alan are the same, aside from .bash_profile having your "lfs=..." alias.

I think I'm catching on to all this.


Can you run

sudo chroot /mnt/lfs /usr/bin/env -i   \
    HOME=/root TERM="$TERM"            \
    PS1='(lfs chroot) \u:\w\$ '        \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    /bin/bash --login

as user alan?

Done. Same result.

Then your build has a problem.

From your host,
ls /mnt/lfs/usr/bin/e*

It doesn't find anything.

But earlier today I more or less figured out why: After a reboot, the Fedora terminal environment does not contain the directories created by LFS such as user, bin, lib. But when I mount /mnt/lfs with this:

sudo mount -v -t ext4 /dev/mapper/lfslvm2-root $LFS

All those missing directories appear, and everything seems to work right -- including your "lfs=..." alias.

LOL.  Really.  I did LOL.


did it find env?  If not you didn't install coreutils properly.
I see below that you did that and it did not find env.
In view of the above information, would you still say that coreutils isn't installed properly?

I did some extra checking just for grins. The Fedora31 system has /usr/bin/env and /bin/env. They are identical.

Because on Fedora /bin and /usr/bin are symlinks.  Check
ls -ld /bin /usr/bin

Ah!

[alan@localhost ~]$ sudo chroot /mnt/lfs env -i   \
   HOME=/root TERM="$TERM"            \
   PS1='(lfs chroot) \u:\w\$ '        \
   PATH=/bin:/usr/bin:/sbin:/usr/sbin \
   /bin/bash --login

chroot: failed to run command ‘env’: No such file or directory


Based on Ken's response, here are some more results. Of course, this is in the Fedora 31 system:


[alan@localhost ~]$ ll /usr/bin/env
-rwxr-xr-x. 1 root root 54096 Oct 17 01:37 /usr/bin/env

[alan@localhost ~]$ ll /bin/env
-rwxr-xr-x. 1 root root 54096 Oct 17 01:37 /bin/env

The above are looking at your host, not your LFS build.
Right. Since I'm not in chroot or in the new running system, that's all there is.

[alan@localhost ~]$ echo $LFS
/mnt/lfs

[alan@localhost ~]$ ls -l $LFS/usr/bin/env
ls: cannot access '/mnt/lfs/usr/bin/env': No such file or directory

Run

chroot "$LFS" /tools/bin/env -i \
    HOME=/root                  \
    TERM="$TERM"                \
    PS1='(lfs chroot) \u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
    /tools/bin/bash --login +h

and reinstall coreutils.  Watch for possible errors.

I ran it, but had to precede it by the above mount:

sudo mount -v -t ext4 /dev/mapper/lfslvm2-root $LFS

Also I did "sudo chroot ..."

So, I don't see why reinstalling coreutils will have done any good.

That's right.  You do have to have $LFS mounted.  After that, it appears that the original problem is solved.

[alan@localhost ~]$ lfs
(lfs chroot) root:/$ export LFS=/mnt/lfs

Inside chroot, you do not need LFS to be defined.

(lfs chroot) root:/$ alias ll='ls -l'
(lfs chroot) root:/$ cd /sources
(lfs chroot) root:/sources$

(lfs chroot) root:/sources$ printenv
PWD=/sources
HOME=/root
TERM=xterm-256color
SHLVL=1
PS1=(lfs chroot) \u:\w$
LFS=/mnt/lfs
PATH=/bin:/usr/bin:/sbin:/usr/sbin
OLDPWD=/
_=/usr/bin/printenv
(lfs chroot) root:/sources$

What do you think?

Seems like you are cleared to continue.

That I am doing. And I've learned a few things from this exercise.

Anyway, thanks for your help!

Alan

--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to