Changeset 538aa7a for chapter05/chapter05.xml
- Timestamp:
- 11/20/2003 12:15:47 AM (20 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.0, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, v5_1, v5_1_1, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- bcd0ce7
- Parents:
- 5bf7f02
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter05/chapter05.xml
r5bf7f02 r538aa7a 347 347 <?dbhtml filename="settingenvironment.html" dir="chapter05"?> 348 348 349 <para>While logged in as user <emphasis>lfs</emphasis>, issue the 350 following commands to set up a good work environment:</para> 349 <para>We're going to set up a good working environment by creating two new 350 startup files for the Bash shell. While logged in as user 351 <emphasis>lfs</emphasis>, issue the following commands to create a new 352 <filename>.bash_profile</filename>:</para> 351 353 352 354 <screen><userinput>cat > ~/.bash_profile << "EOF"</userinput> 355 exec env -i TERM=$TERM /bin/bash 356 <userinput>EOF</userinput></screen> 357 358 <para>The <userinput>exec env -i TERM=$TERM /bin/bash</userinput> command 359 creates a new instance of Bash with a completely empty environment, except for 360 the TERM variable. This is needed to ensure that no unwanted and potentially 361 hazardous environment variables from the host system leak into our build 362 environment. The technique used here is a little non-standard but it achieves 363 the goal of enforcing a clean environment. By way of explanation, the initial 364 shell is a <emphasis>login</emphasis> shell which reads the 365 <filename>.bash_profile</filename>. The new shell instance is a 366 <emphasis>non-login</emphasis> shell which reads the 367 <filename>.bashrc</filename> (created next).</para> 368 369 <para>Now create a new <filename>.bashrc</filename>:</para> 370 371 <screen><userinput>cat > ~/.bashrc << "EOF"</userinput> 353 372 set +h 354 373 umask 022 355 374 LFS=/mnt/lfs 356 375 LC_ALL=POSIX 357 PATH=/tools/bin: $PATH376 PATH=/tools/bin:/bin:/usr/bin 358 377 export LFS LC_ALL PATH 359 unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD 360 <userinput>EOF 361 362 source ~/.bash_profile</userinput></screen> 378 <userinput>EOF</userinput></screen> 363 379 364 380 <para>The <userinput>set +h</userinput> command turns off … … 392 408 during the rest of the building process.</para> 393 409 394 <para>The CC, CXX, CPP, LD_LIBRARY_PATH and LD_PRELOAD environment variables all 395 have the potential to cause havoc with our Chapter 5 toolchain. We therefore 396 unset them to prevent any chance of this happening.</para> 397 398 <para>Now, after sourcing the just-created profile, we're all set to begin 410 <para>Finally, source the just-created profile so that we're all set to begin 399 411 building the temporary tools that will support us in later chapters.</para> 412 413 <screen><userinput>source ~/.bash_profile</userinput></screen> 400 414 401 415 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.