1

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)

3
  • it should work exactly the same, no matter how you connect to your host. what is the first package you get this error? is it Linux-3.16.2 API Headers? did you enter chroot environment as per 6.4 chapter? every time you come back to continue on chapter 6, you have to enter chroot environment after you log in. also it's worth mentioning - lfs ver. 7.6 is 2.5 years old now, why do you install it now? why not 8.0 ie?
    – rsm
    Mar 14, 2017 at 18:38
  • oh, and lfs has maybe not huge, but very friendly and helpful community. you can try asking this question also on lfs-support mailing list lists.linuxfromscratch.org/listinfo/lfs-support
    – rsm
    Mar 14, 2017 at 19:00
  • Yes, it happened first with Linux-3.16.2 API Headers. But subsequently I've been trying with the next packages and it's always the same. Yes, I enter chroot after every reboot/login. I'm with 7.6 because I started it so long ago and didn't want to start over. I also have the gut feeling that this has to do more with how Linux works rather than a version-specific bug.
    – alexrc
    Mar 14, 2017 at 20:28

1 Answer 1

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.