On Tue, 2020-04-14 at 21:01 +0800, dev o wrote: > Good morning, > > Thank you for each of the responses, I'll respond to each in order: > > ------------- > > Which version of LFS book are you using? And what is the output of > "version- > check.sh" in sect. 2.2.? > > Version: LFS-9.1 > > version_check.sh => > > bash, version 5.0.3(1)-release > /bin/sh -> /usr/bin/bash > Binutils: (GNU Binutils for Debian) 2.31.1 > bison (GNU Bison) 3.3.2 > /usr/bin/yacc -> /usr/bin/bison.yacc > bzip2, Version 1.0.6, 6-Sept-2010. > Coreutils: 8.30 > diff (GNU diffutils) 3.7 > find (GNU findutils) 4.6.0.225-235f > GNU Awk 4.2.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.1.2) > /usr/bin/awk -> /usr/bin/gawk > gcc (Debian 8.3.0-6) 8.3.0 > g++ (Debian 8.3.0-6) 8.3.0 > (Debian GLIBC 2.28-10) 2.28 > grep (GNU grep) 3.3 > gzip 1.9 > Linux version 4.19.0-8-amd64 (debian-ker...@lists.debian.org) (gcc > version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.98-1 (2020-01-26) > m4 (GNU M4) 1.4.18 > GNU Make 4.2.1 > GNU patch 2.7.6 > Perl version='5.28.1'; > Python 3.7.3 > sed (GNU sed) 4.7 > tar (GNU tar) 1.30 > texi2any (GNU texinfo) 6.5 > xz (XZ Utils) 5.2.4 > g++ compilation OK > > ------------------------- > > dump question, but are the virtual filesystems mounted as described > in > section 6.2 ? > > I have played close attention to the instructions about the mounting > and chroot and noticed that it is often identified as the culprit in > earlier conversations. The partition is mounted on boot via fstab > then I run the following commands as root: > mount -v --bind /dev $LFS/dev && mount -vt devpts devpts $LFS/dev/pts > -o gid=5,mode=620 && mount -vt proc proc $LFS/proc && mount -vt sysfs > sysfs $LFS/sys && mount -vt tmpfs tmpfs $LFS/run > > if [ -h $LFS/dev/shm ]; then mkdir -pv $LFS/$(readlink > $LFS/dev/shm); fi > > 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 > > I don't know how to try and verify beyond that :/ > > ------------------------- > > (I discarded /, /sys, /run, /proc & /boot) > TARGET SOURCE FSTYPE OPTIONS > ├─/dev udev devtmpf > rw,nosuid,relatime,size=401 > │ ├─/dev/shm tmpfs tmpfs > rw,nosuid,nodev > │ ├─/dev/hugepages hugetlbfs hugetlb > rw,relatime,pagesize=2M > │ ├─/dev/mqueue mqueue mqueue rw,relatime > │ └─/dev/pts devpts devpts > rw,relatime,gid=5,mode=620, > │ └─/dev/pts devpts devpts
Hmmm, this is dubious. /dev/pts mounted on /dev/pts... what does "ls /dev/pts" say (as root, from host) If it returns /dev/pts/dev, then try "umount /dev/pts/dev/pts" then rm -r /dev/pts/dev Or reboot, login as root, set LFS (important!), mount the virtual filesystems again. Try findmnt at this point, chroot again, and try again to su in gcc. > rw,nosuid,noexec,relatime,g > ├─/mnt/lfs /dev/sdb10 ext4 rw,relatime > │ ├─/mnt/lfs/dev udev devtmpf > rw,nosuid,relatime,size=401 > │ │ └─/mnt/lfs/dev/pts devpts devpts > rw,relatime,gid=5,mode=620, > │ ├─/mnt/lfs/proc proc proc rw,relatime > │ ├─/mnt/lfs/sys sysfs sysfs rw,relatime > │ └─/mnt/lfs/run tmpfs tmpfs rw,relatime > > The following are run from within the chroot environment: > ls -l $LFS/var/run > lrwxrwxrwx 1 root root 4 Apr 11 13:47 /var/run -> /run > > ls -l $LFS/dev/shm > * nothing returned * This is as it should on debian: it does not tell you is does not exist. It is just a normal directory. Well, you could mount a tmpfs on it, but I do not think it has anything to do with the error you have > ls -l $LFS/dev > drwxr-xr-x 2 root root 40 Apr 14 12:08 shm (it is > listed despite not returning for the command above) Hmm, is it the only line of output? > > based on your expected response, It appears to me that /dev/shm is > not mounted correctly. > > If believe that is supposed to be achieved by this command: > if [ -h $LFS/dev/shm ]; then mkdir -pv $LFS/$(readlink > $LFS/dev/shm); fi > > Each of these commands return nil if run in isolation: > [ -h $LFS/dev/shm ] ** i have no idea what is performed by this > syntax ** > readlink $LFS/dev/shm ** maybe i missed a command to make this > link? i don't see it in the end of chapter 5 ** > > -------------------------- > > I also received a response on the linuxquestions thread: > https://www.linuxquestions.org/questions/showthread.php?p=6110835#post6110835 > > The fellow mentioned that debian doesn't allow users to an su to > unpermissioned user without password. Once you are in chroot, the debian configuration files are not accessible anymore, so I do not think debian can control that. -- http://lists.linuxfromscratch.org/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page Do not top post on this list. A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? http://en.wikipedia.org/wiki/Posting_style