Yaacov-Yoseph Weiss wrote:
> Hi,
> 
> There are two issues I found regarding the creation of the
> lfs user (chapter 4.3). All cases are from opensuse hosts.
> 
> First, the command used to create the user:
> 
> useradd -s /bin/bash -g lfs -m -k /dev/null lfs
> 
> does not return 0, since it fails to copy from /dev/null.
> I noticed this when running the book manually, and
> found it causes jhalfs to fail on the first run. A simple
> solution would be to replace that line with something
> similar to one of the following sequences:
> 
> 'mkdir -v empty && useradd -s /bin/bash -g lfs -m -k empty lfs &&
> rmdir -v empty'
> 
> which copies a real directory, or:
> 
> useradd -s /bin/bash -g lfs lfs && mkdir -v ~lfs && chown -v lfs:lfs ~lfs
> 
> which manually creates the home directory.

Does  'SKEL_DIR=/dev/null useradd -s /bin/bash -g lfs -m lfs' work?

> The second issue, is that I wasn't able to su or sudo into the new lfs user
> without setting the lfs user's password. This issue may be self inflicted,
> since it happened after I played around with the sudoers file, though I
> think I left it in its original state, and I edited it with visudo. A google
> search says the issue is somewhat common.

That is a sudo setup problem.  You want something like

User_Alias  ADMIN = <your logname>
ADMIN       ALL = NOPASSWD: ALL
lfs         ALL = NOPASSWD: ALL

> It might be worth mentioning that some authentication configurations
> may require that password be set for the lfs user, even if you su from
> root.

If needed, you can 'sudo su - lfs', but that shouldn't be necessary.

> A third suggestion I have, which has nothing to do with creating users,
> would be to add the source directory as an environment parameter,
> instead of assuming the sources are one directory above the build.
> 
> The changes to the book would be adding the variable, and changing
> the patch commands from 'patch <options> ../patch-name.patch' to
>  'patch <options> $SRC_DIR/patch-name.patch'. (and the tar
> commands in some of the gcc passes.)
> 
> This would allow the sources to be in a read only directory (or device).

That's something to consider.  My scripts have:

DIR=`pwd`
PROGRAM=<program>
LOG=$DIR/$PROGRAM.log
BUILDDIR=/tmp/<program-base>
...
cd $BUILDDIR
tar -xf $DIR/$PROGRAM.tar.?z* || exit 1
cd $PROGRAM
patch -Np1 -i $DIR/...
...

But that's a little more advanced.  We want to keep the build as simple 
as possible.  It's up to the user to add customizations.  Preferably 
after the first successful build.

   -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to