问题
I'm building a LFS system following the steps from the book (version 7.6, though I think the problem is not related to a specific version). After building the toolchain (chapter 5) now I'm into building the system proper (chapter 6).
But here's the thing: when I try to build any package from a graphical shell (in my case LXTerminal from the Lubuntu desktop environment) I can unpack the sources and configure the build with ./configure, but on issuing the 'make' command I get a Segmentation fault
. If I issue the same command from a text terminal (e.g. hitting Crtl+F2) it works flawlessly.
In both cases:
- As root, I mount the virtual kernel filesystems as per chapters 6.2.2 and 6.2.3
- As root, I switch to the chroot environment as per the book instructions
This puzzles me, because of course it also fails when connected by SSH, which is what I really want to do.
Can anybody give me a hint of why these two terminals behave differently?
(As a final note, I've tried switching to root user from my non-root user ("login shell") with su - and also login in altogether into the GUI as root)
回答1:
After some serious googling I could figure it out.
The thing that graphical terminals (the ones that are windows on a graphical shell) and SSH sessions have in common is that they use pseudo-terminals (PTYs) instead of traditional terminals (TTYs). So I focused on the mounting of the virtual filesystem devpts that implements those pseudoterminals. Then I found this answer and tried to bind mount /dev/pts instead of doing a standard mount like the books says:
mount --bind /dev/pts "$CHROOT/dev/pts"
And it worked! Make no longer segfaults.
来源:https://stackoverflow.com/questions/42775415/building-lfs-segmentation-fault-with-make-on-a-graphical-shell