Add env to chroot

Claudio Nieder private at
Sat Aug 5 14:33:11 PDT 2000


I currently making an LFS installation based on 2.3.7. After entering
the chroot'ed environment I notived, that it is polluted by all the
environment variables which exist in my normal environment. Most like
SUSE_DOC_HOST=localhost are just there for nothing, but it might be that
some like LANG or LD_LIBRARY_PATH might cause some harm or at least some

One way to avoid this, would be to use env to set up a fresh
environment, i.e. enter the chroot'ed environment with this command:

   root:~# chroot /mnt env -i CFLAGS="-O3 --mcpu=xxx -march=yyy" \
   > CXXFLAGS="-O3 -mcpu=xxx -march=yyy" bash --login

Then you end up with an environment which contains just CFLAGS, CXXFLAGS
plus the few variables set up by bash.

Claudio Nieder, Kanalweg 1, CH-8610 Uster, Tel +41 79 357 6743
mailto:private at  icq:42315212
Mail archive:
IRC access: server: port: 6667 channel: #LFS
Unsubscribe: email lfs-discuss-request at and put
"unsubscribe" (without the quotation marks) in the body of the message
(no subject is required)

More information about the lfs-dev mailing list