aboutsummaryrefslogtreecommitdiffstats
path: root/chapter05/installasuser.xml
diff options
context:
space:
mode:
authorMarc Heerdink <gimli@linuxfromscratch.org>2002-01-23 18:24:44 +0000
committerMarc Heerdink <gimli@linuxfromscratch.org>2002-01-23 18:24:44 +0000
commit062461b217f60eb64b5f43a2ffcad1af634d6682 (patch)
tree93fc35056bba94e2d7c00b50878a17e08047a9d4 /chapter05/installasuser.xml
parent93dba6aba6b5b53738a436ea6bbecfd8e4c9c46e (diff)
[Bug 149] Addition and Removal of files to resolve bug 149 (Install all software as an unprivileged user)
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@1470 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter05/installasuser.xml')
-rw-r--r--chapter05/installasuser.xml55
1 files changed, 55 insertions, 0 deletions
diff --git a/chapter05/installasuser.xml b/chapter05/installasuser.xml
new file mode 100644
index 000000000..4fff1a36e
--- /dev/null
+++ b/chapter05/installasuser.xml
@@ -0,0 +1,55 @@
+<sect1 id="ch05-installasuser">
+<title>Install all software as an unprivileged user</title>
+<?dbhtml filename="installasuser.html" dir="chapter05"?>
+
+<para>When you are logged in as root during chapter 5, it is possible
+that some files of your host system will be overwritten by the ones
+you'll build in chapter 5. There can be all kinds of reasons for this
+to happen, for example because the $LFS environment variable is not
+set. Overwriting some files from your host system will most likely
+cause all kinds of problems, so it's a good idea to be logged in as
+an unprivileged user during chapter 5. To make sure the environment
+is as clean as possible, we'll create a new user lfs that can be
+used while building the static installation. Issuing the following
+commands as root will create a new user "lfs":</para>
+
+<para><screen><userinput>useradd -s /bin/bash -m lfs
+passwd lfs</userinput></screen></para>
+
+<para>Now it's time to change the permissions on your LFS partitions
+so user "lfs" will have write access to it. Run the following command
+as root to change the ownership of the LFS partition to user "lfs":</para>
+
+<para><screen><userinput>chown lfs $LFS</userinput></screen></para>
+
+<para>Now you can login as user "lfs". You can do this two ways: either
+the normal way through the console or the display manager, or with
+<userinput>su - lfs</userinput>. When you're working as user "lfs", type
+the following commands to setup a good environment to work in:</para>
+
+<para><screen><userinput>cat >~/.bash_profile <<"EOF"
+#!/bin/sh
+umask 022
+
+LFS=/mnt/lfs
+LC_ALL=POSIX
+export LFS LC_ALL
+EOF
+source ~/.bash_profile</userinput></screen></para>
+
+<para>This profile makes sure the umask is set to 022 so newly created
+files and directories will have the correct permission. It is advisable
+to keep this setting throughout your LFS installation. Also, the $LFS
+and $LC_ALL environment variables are set. $LFS has been explained in
+previous chapters already. $LC_ALL is a variable that is used for
+internationalization.</para>
+
+<para>When your host distribution uses a glibc version older than 2.2.4,
+having $LC_ALL set to something else than "C" or "POSIX" while working
+through chapter 5 may cause trouble when you've exited the chrooted
+environment of chapter 6 and try to return to it. By setting this to
+"POSIX" ("C" is an alias for "POSIX") we ensure that everything will
+work as expected in the chrooted environment.</para>
+
+</sect1>
+