On 12/31/2019 5:01 PM, Bruce Dubbs wrote:
On 12/31/19 4:47 PM, Alan Feuerbacher wrote:
Another question on building LFS Version 20191222-systemd:
In Section "5.37. Changing Ownership" there's a Note:

"The commands in the remainder of this book must be performed while
logged in as user root and no longer as user lfs. Also, double check
that $LFS is set in root's environment."

At this point in the build process I'm logged in as user lfs, having
done so with "su - lfs" back in Section "4.3. Adding the LFS User".
I could "exit" and get back to whatever user I was, and then do
"su - root" or "su root" or perhaps something else.

How do you recommend logging in now as user root?

Sorry, I'm not fully confident that I know how a shell versus a
login shell plays in the LFS environment.

Use 'exit' to return to the previous user.  You will need to change to the root user if you are not already there in order to do some preliminary work.  Then in Section 6.4 you will enter chroot (only root can run that) and will be the root user there. Being in chroot should be apparent from the '(lfs chroot)' part of the prompt.

Alright, now I've gone through the LFS book looking for where the user changes. Here's what I've found:

Up to Section 2.3 you're probably going to be your regular user name, in my case "alan". Later you switch to "root" and "lfs".

Section 2.3.1 mentions procedures done as the root user after Section 2.4 . All of the commands after that require you to be root, not an unprivileged user. So presumably you would become root with "su root" not "su - root". Right?

Section "2.3.2. Chapter 5" says that "all instructions in chapter 5 must be done by user lfs. A su - lfs needs to be done before any task in Chapter 5."

When we get to my Section 5.37 of interest in this email, the Note says:

"The commands in the remainder of this book must be performed while
logged in as user root and no longer as user lfs. Also, double check
that $LFS is set in root's environment."

So using 'exit' will return you from user lfs to user root. This is the answer I was looking for.

And if you somehow foul up the various "su" invocations -- which I've done several times in past builds -- you have to do "su root" and make sure that all the environmental variables are set properly. Right?

Thanks,

Alan

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