Automatics LFS builds using jhalfs.

Dan Nicholson dbn.lists at gmail.com
Tue Oct 4 09:20:27 PDT 2005


On 10/3/05, M.Canales.es <manuel at linuxfromscratch.org> wrote:
> El Lunes, 3 de Octubre de 2005 23:44, Dan Nicholson escribió:
>
> > Don't know if this works with make, but I saw a nice solution to this
> > problem in Greg Shafer's build system that uses Bash scripts.  In
> > order to continue to run as root user in the chroot, he uses:
> > exec su -c "${CHROOT_CMD}"
> > where CHROOT_CMD is something like
> > chroot ${DIR} ${ENV_VARS} ${the_same_script} --chroot
>
> That is very similar to what Jeremy has added, except for the "exec su -c" and
> that instead of invoking "make" we execute the relevant shell script for each
> package build.

Right.  I guess I just wanted to point out the opportunity that by
invoking exec su -c, you can switch to root and replace the existing
process.  However, I didn't mean to imply that you must run a script
as the argument for the env statement.  I was thinking that part of an
existing make target would be the chroot env command as shown in this
statement:

exec su -c "chroot /mnt/lfs /tools/bin/env -i \
 ${VARIABLES} make -C /tools/src chroot"

Here, you would be invoking the same Makefile in directory /tools/src
(if that's where it existed), but with the target chroot.  That would
allow the tools part of the build to be done as the unprivelaged user,
then supply the root password once and continue in the chroot.



More information about the lfs-dev mailing list