On 10/14/19 12:33 AM, Jared Stevens wrote:
So I have little doubt that I have somehow managed to completely ruin my LFS build and will likely have to start all over again (for what will be the fourth time). I figured I would throw one last Hail Mary and ask in here for any suggestions, however, before giving up on two/three weeks of hard work.

So just a little backstory, I initially built my LFS system using the *System V *version of the book. I was able to boot and had made progress all the way up to Xorg.

However, I was having issues with getting certain modules/services to load and run properly on my system, and having no experience whatsoever with System V (only systemd in my past experiences with Linux), I decided to see if I could*switch my system over to systemd.*

Initially, there weren't any problems. I was able to install Systemd-241 no problem, and I moved the rc.d and init.d directories elsewhere to hopefully prevent any old scripts from being called.

Of course this now meant that I had to reinstall certain programs and their systemd symlinks as opposed to the System V bootscripts. I had been doing this for most of the day today with little issue.

While I was looking back over previously installed programs for changes from System V to systemd, I noticed the section in LFS's Glibc-230 install where it calls for _systemd support files for _*_nscd_, *which were not installed when I initially built Glibc-230.

Here is where I made my first mistake: to install the support files for *nscd*, I assumed I would have to re-make the *GLibc* package and install them. So to follow the LFS book's commands properly (where it uses "CC="gcc -ffile-prefix-map=/tools=/usr" before the configure) I extracted my saved "tools" directory I had saved from the build back into my LFS build in chroot and reran the configure, make, and make check commands for GLibc.

To avoid potential problems and because my existing GLibc install was working fine, however, I did NOT run "make install." Instead, I ran just the install commands for nscd as follows:

install -v -Dm644 ../nscd/nscd.tmpfiles
/usr/lib/tmpfiles.d/nscd.conf
install -v -Dm644 ../nscd/nscd.service
/lib/systemd/system/nscd.service

Afterwards, I removed the GLibc directory and attempted to continue with my transfer to systemd. However, this is when all hell broke loose.

Now, whenever I enter the chroot environment (haven't even tried booting the thing because I doubt I could), although I can login as root and mount all of the disk partitions properly, Bash cannot find absolutely anything in the /usr, /sbin, or /bin directories any longer.

For example, I will receive the following error for simple commands such as 'ls':

bash: /bin/ls: No such file or directory

This is despite the fact that such file DOES in fact exist. Assuming I had messed up my $PATH variable, I tried restoring it by executing:

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

However, this did not fix my issue. I tried retracing my steps in LFS to see if a symlink was broken or something, but even though I can run 'ls' and other commands when running off of the /tools bash symlink, attempts at running the normal bash is completely broken.

I haven't the slightest clue what I did wrong to affect Bash during the GLibc systemd attempted fix as I never touched bash until after the problem manifested (I may have made it worse while trying to fix it, however). Furthermore, I never overwrote my existing GLibc install.

I appreciate any suggestions that may help with my problem. I also accept if I have managed to royally destroy my build and would be better off starting over again as well.

Hi Jared,

Firstly, I don't recommend moving from SysV to systemd on the same build, however it is possible and I used to do it. We need to address the "no such file or directory" problem first. Can you run:

ldd /bin/ls

Please and get back to us with the results? What you should get (used on an SVN system):

renodr [ /sources ]$ ldd /bin/ls
        linux-vdso.so.1 (0x00007ffe3b1e8000)
        libcap.so.2 => /lib/libcap.so.2 (0x00007fcfff8c0000)
        libc.so.6 => /lib/libc.so.6 (0x00007fcfff6fc000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fcfff8e2000)

I believe that your glibc installation might be corrupt. If your glibc install is corrupt, try using this:

sln libc-2.30.so /lib/libc.so.6

And then running 'ldconfig'.


The reason why this might fix it is that 'sln' is linked statically so that you can use it in the event that the dynamic linker is not available or functioning properly. It was written to fix broken glibc installations so that you're not stuck completely rebuilding your system.

-- 
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

Reply via email to