Index: LFS/config
===================================================================
--- LFS/config	(revision 3b63c8c196c5e8988cd6306bc7bd8b09f0e80b36)
+++ LFS/config	(revision 9485eba95ee5deed4f77b06f4e7b8f6cbfa26767)
@@ -6,4 +6,8 @@
 #
 #####
+
+#--- Unprivileged user and group name
+LUSER=lfs
+LGROUP=lfs
 
 #--- Location of fstab file (if empty, a template is created)
Index: LFS/master.sh
===================================================================
--- LFS/master.sh	(revision 3b63c8c196c5e8988cd6306bc7bd8b09f0e80b36)
+++ LFS/master.sh	(revision 9485eba95ee5deed4f77b06f4e7b8f6cbfa26767)
@@ -30,11 +30,11 @@
 021-addinguser:  020-creatingtoolsdir
 	@\$(call echo_message, Building)
-	@if [ ! -d /home/lfs ]; then \\
-		groupadd lfs; \\
-		useradd -s /bin/bash -g lfs -m -k /dev/null lfs; \\
+	@if [ ! -d /home/\$(LUSER) ]; then \\
+		groupadd \$(LGROUP); \\
+		useradd -s /bin/bash -g \$(LGROUP) -m -k /dev/null \$(LUSER); \\
 	else \\
 		touch user-lfs-exist; \\
 	fi;
-	@chown lfs \$(MOUNT_PT)/tools && \\
+	@chown \$(LUSER) \$(MOUNT_PT)/tools && \\
 	chmod a+wt \$(MOUNT_PT)/sources && \\
 	touch \$@ && \\
@@ -44,18 +44,18 @@
 022-settingenvironment:  021-addinguser
 	@\$(call echo_message, Building)
-	@if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
-		mv /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
-	fi;
-	@if [ -f /home/lfs/.bash_profile  -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
-		mv /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
-	fi;
-	@echo "set +h" > /home/lfs/.bashrc && \\
-	echo "umask 022" >> /home/lfs/.bashrc && \\
-	echo "LFS=\$(MOUNT_PT)" >> /home/lfs/.bashrc && \\
-	echo "LC_ALL=POSIX" >> /home/lfs/.bashrc && \\
-	echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/lfs/.bashrc && \\
-	echo "export LFS LC_ALL PATH" >> /home/lfs/.bashrc && \\
-	echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\
-	chown lfs:lfs /home/lfs/.bashrc && \\
+	@if [ -f /home/\$(LUSER)/.bashrc -a ! -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
+		mv /home/\$(LUSER)/.bashrc /home/\$(LUSER)/.bashrc.XXX; \\
+	fi;
+	@if [ -f /home/\$(LUSER)/.bash_profile  -a ! -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
+		mv /home/\$(LUSER)/.bash_profile /home/\$(LUSER)/.bash_profile.XXX; \\
+	fi;
+	@echo "set +h" > /home/\$(LUSER)/.bashrc && \\
+	echo "umask 022" >> /home/\$(LUSER)/.bashrc && \\
+	echo "LFS=\$(MOUNT_PT)" >> /home/\$(LUSER)/.bashrc && \\
+	echo "LC_ALL=POSIX" >> /home/\$(LUSER)/.bashrc && \\
+	echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/\$(LUSER)/.bashrc && \\
+	echo "export LFS LC_ALL PATH" >> /home/\$(LUSER)/.bashrc && \\
+	echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc && \\
+	chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
 	touch envars && \\
 	touch \$@ && \\
@@ -123,6 +123,6 @@
     # The changingowner script must be run as root.
     case "${this_script}" in
-      *changingowner)  wrt_run_as_root    "${this_script}" "$file" ;;
-      *)               wrt_run_as_su      "${this_script}" "$file" ;;
+      *changingowner)  wrt_RunAsRoot "${this_script}" "$file" ;;
+      *)               wrt_RunAsUser "${this_script}" "$file" ;;
     esac
 
@@ -235,5 +235,5 @@
     # and not to use chroot.
     case "${this_script}" in
-      *kernfs)  wrt_run_as_root    "${this_script}" "$file" ;;
+      *kernfs)  wrt_RunAsRoot    "${this_script}" "$file" ;;
       *)        wrt_run_as_chroot1 "${this_script}" "$file" ;;
     esac
@@ -369,4 +369,6 @@
 MOUNT_PT= $BUILDDIR
 PKG_LST= $PKG_LST
+LUSER= $LUSER
+LGROUP= $LGROUP
 
 include makefile-functions
@@ -410,6 +412,6 @@
 clean-chapter4:
 	-if [ ! -f user-lfs-exist ]; then \\
-		userdel lfs; \\
-		rm -rf /home/lfs; \\
+		userdel \$(LUSER); \\
+		rm -rf /home/\$(LUSER); \\
 	fi;
 	rm -rf \$(MOUNT_PT)/tools
@@ -439,11 +441,11 @@
 restore-lfs-env:
 	@\$(call echo_message, Building)
-	@if [ -f /home/lfs/.bashrc.XXX ]; then \\
-		mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
-	fi;
-	@if [ -f /home/lfs/.bash_profile.XXX ]; then \\
-		mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
-	fi;
-	@chown lfs:lfs /home/lfs/.bash* && \\
+	@if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
+		mv -f /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
+	fi;
+	@if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
+		mv /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
+	fi;
+	@chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
@@ -457,6 +459,6 @@
 	@-umount \$(MOUNT_PT)/dev
 	@-if [ ! -f user-lfs-exist ]; then \\
-		userdel lfs; \\
-		rm -rf /home/lfs; \\
+		userdel \$(LUSER); \\
+		rm -rf /home/\$(LUSER); \\
 	fi;
 
