Changeset cbfa0a3
- Timestamp:
- Feb 21, 2006, 1:56:25 AM (19 years ago)
- Children:
- 07b5f51
- Parents:
- 54e0992
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/common/changingowner.xml
r54e0992 rcbfa0a3 11 11 <title>Changing Ownership</title> 12 12 13 <para os="a">Currently, the <filename class="directory">/tools</filename> 14 directory is owned by the user <systemitem class="username">lfs</systemitem>, 15 a user that exists only on the host system. Although the <filename 16 class="directory">/tools</filename> directory can be deleted once the 17 LFS system has been finished, it can be retained to build additional 18 LFS systems. If the <filename class="directory">/tools</filename> 19 directory is kept as is, the files are owned by a user ID without a 13 <note os="a"> 14 <para>From now on, all commands in the rest of the book will be run as the <systemitem class="username">root</systemitem> user.</para> 15 </note> 16 17 <para os="b">Currently, the <filename class="directory">/tools</filename> 18 directory, <filename class="directory">/cross-tools</filename> directory, and 19 <filename class="directory">$LFS</filename> directory are owned 20 by the user <systemitem class="username">lfs</systemitem>, 21 a user that exists only on the host system. For security reasons, the $LFS root directory and all of it subdirectories should be owned by <systemitem class="username">root</systemitem>. Change the ownership for $LFS and its subdirectories by running these commands:</para> 22 23 <screen><userinput>chown 0:0 ${LFS} 24 chown -R 0:0 $LFS/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}</userinput></screen> 25 26 <para os="c">Optionally, you can do the same with <filename class="directory">/tools</filename> and <filename class="directory">/cross-tools</filename>. Although these directories can be deleted once the 27 LFS system has been finished, they can be retained to build additional 28 LFS systems. If the <filename class="directory">/tools</filename> and <filename class="directory">/cross-tools</filename> 29 directories are kept as is, the files are owned by a user ID without a 20 30 corresponding account. This is dangerous because a user account created 21 31 later could get this same user ID and would own the <filename 22 class="directory">/tools</filename> directoryand all the files therein,32 class="directory">/tools</filename> and <filename class="directory">/cross-tools</filename> directories and all the files therein, 23 33 thus exposing these files to possible malicious manipulation.</para> 24 34 25 <para os=" b">To avoid this issue, add the <systemitem35 <para os="d">To avoid this issue, add the <systemitem 26 36 class="username">lfs</systemitem> user to the new LFS system later when 27 37 creating the <filename>/etc/passwd</filename> file, taking care to assign 28 38 it the same user and group IDs as on the host system. Alternatively, 29 39 assign the contents of the <filename class="directory">/tools</filename> 30 directoryto user <systemitem class="username">root</systemitem> by running40 and <filename class="directory">/cross-tools</filename> directories to user <systemitem class="username">root</systemitem> by running 31 41 the following command:</para> 32 42 33 43 <screen><userinput>chown -R 0:0 /tools 34 chown -R 0:0 ${LFS}</userinput></screen>44 chown -R 0:0 /cross-tools</userinput></screen> 35 45 36 <para os="c">The command uses <parameter>0:0</parameter> instead of 46 <para os="e">This book assumes you ran these <command>chown</command> commands.</para> 47 48 <!-- <para os="c">The command uses <parameter>0:0</parameter> instead of 37 49 <parameter>root:root</parameter>, because <command>chown</command> 38 50 is unable to resolve the name <quote>root</quote> until the password 39 51 file has been created. This book assumes you ran this 40 <command>chown</command> command.</para> 52 <command>chown</command> command.</para> --> 41 53 42 54 </sect1> -
boot/common/settingenviron.xml
r54e0992 rcbfa0a3 11 11 <title>Setting Up the Environment</title> 12 12 13 <para>The new instance of the shell is a <emphasis>non-login</emphasis>14 shell, w ill read <filename>.bash_profile</filename> file. Create the13 <para>The new instance of the shell that will start when the system is booted is a <emphasis>login</emphasis> 14 shell, which will read <filename>.bash_profile</filename> file. Create the 15 15 <filename>.bash_profile</filename> file now:</para> 16 16 -
boot/x86/kernel.xml
r54e0992 rcbfa0a3 25 25 <warning os="aa"> 26 26 <para>Here a temporary cross-compiled kernel will be built. When 27 configuring it, select the minimal amount of options required to can28 boot the target machine and build the final system. I.e., no tsupport27 configuring it, select the minimal amount of options required to 28 boot the target machine and build the final system. I.e., no support 29 29 for sound, printers, etc. will be needed.</para> 30 30 -
cross-tools/common/binutils.xml
r54e0992 rcbfa0a3 130 130 <screen os="bi"><userinput>make install</userinput></screen> 131 131 132 <para os="bj">Copy <filename class="headerfile">libiberty.h</filename> file to132 <para os="bj">Copy the <filename class="headerfile">libiberty.h</filename> file to 133 133 <filename class="directory">/tools/include</filename> directory:</para> 134 134 -
cross-tools/common/cflags.xml
r54e0992 rcbfa0a3 19 19 unset CXXFLAGS</userinput></screen> 20 20 21 <para>Now we willadd these to <filename>~/.bashrc</filename>, just in21 <para>Now add these to <filename>~/.bashrc</filename>, just in 22 22 case you have to exit and restart building later:</para> 23 23 -
cross-tools/common/glibc.xml
r54e0992 rcbfa0a3 27 27 risk.</para> 28 28 29 <para os="db">We will disable the linking to 30 <filename>libgcc_eh</filename>:</para> 29 <para os="db">Disable linking to <filename>libgcc_eh</filename>:</para> 31 30 32 31 <screen os="dc"><userinput>patch -Np1 -i ../&glibc-libgcc_eh-patch;</userinput></screen> … … 48 47 xpointer="xpointer(//*[@os='f'])"/> 49 48 50 <para os="dd">For NPTL enabled systems we will need to add the following lines to51 <filename>config.cache</filename>:</para>49 <para os="dd">For NPTL enabled systems the following lines need 50 to be added to <filename>config.cache</filename>:</para> 52 51 53 52 <screen os="de"><userinput>echo "libc_cv_forced_unwind=yes" > config.cache … … 73 72 <term><parameter>BUILD_CC="gcc"</parameter></term> 74 73 <listitem> 75 <para>This sets G LIBCto use the current compiler on our system. This is76 used to create the tools G LIBCuses durings it's build.</para>74 <para>This sets Glibc to use the current compiler on our system. This is 75 used to create the tools Glibc uses durings it's build.</para> 77 76 </listitem> 78 77 </varlistentry> … … 81 80 <term><parameter>CC="${LFS_TARGET}-gcc"</parameter></term> 82 81 <listitem> 83 <para>This forces G LIBCto use the GCC complier that we made for our target82 <para>This forces Glibc to use the GCC complier that we made for our target 84 83 architecture.</para> 85 84 </listitem> … … 89 88 <term><parameter>AR="${LFS_TARGET}-ar"</parameter></term> 90 89 <listitem> 91 <para>This forces G LIBCto use the AR utility we made for our target90 <para>This forces Glibc to use the AR utility we made for our target 92 91 architecture.</para> 93 92 </listitem> … … 97 96 <term><parameter>RANLIB="${LFS_TARGET}-ranlib"</parameter></term> 98 97 <listitem> 99 <para>This forces G LIBCto use the RANLIB utility we made for our target98 <para>This forces Glibc to use the RANLIB utility we made for our target 100 99 architecture.</para> 101 100 </listitem> … … 113 112 <term><parameter>--enable-add-ons</parameter></term> 114 113 <listitem> 115 <para>This tells G LIBC to utilize all add-on's that are avaialble.</para>114 <para>This tells Glibc to utilize all add-ons that are avaialble.</para> 116 115 </listitem> 117 116 </varlistentry> … … 120 119 <term><parameter>--with-tls</parameter></term> 121 120 <listitem> 122 <para>This tells G LIBCto use Thread Local Storage.</para>121 <para>This tells Glibc to use Thread Local Storage.</para> 123 122 </listitem> 124 123 </varlistentry> … … 127 126 <term><parameter>--with-__thread</parameter></term> 128 127 <listitem> 129 <para>This tells G LIBCto use use the __thread for libc and128 <para>This tells Glibc to use use the __thread for libc and 130 129 libpthread builds.</para> 131 130 </listitem> … … 135 134 <term><parameter>--with-binutils=/cross-tools/bin</parameter></term> 136 135 <listitem> 137 <para>This tells G LIBCto use the Binutils that are specific to136 <para>This tells Glibc to use the Binutils that are specific to 138 137 our target architecture.</para> 139 138 </listitem> … … 143 142 <term><parameter>--cache-file=config.cache</parameter></term> 144 143 <listitem> 145 <para>This tells G LIBCto utilize a premade cache file.</para>144 <para>This tells Glibc to utilize a premade cache file.</para> 146 145 </listitem> 147 146 </varlistentry> -
cross-tools/x86/gcc-static.xml
r54e0992 rcbfa0a3 24 24 and no Threads</title> 25 25 26 <para os="aa"> We willmake a couple of essential adjustments to the specs file26 <para os="aa">First make a couple of essential adjustments to the specs file 27 27 to point to use our build environment:</para> 28 28 29 29 <screen os="ab"><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen> 30 30 31 <para os="ac">To make sure that we use the proper syntax for a couple of tools,32 weapply the following patch:</para>31 <para os="ac">To make sure that a couple of tools use the proper syntax, 32 apply the following patch:</para> 33 33 34 34 <screen os="ad"><userinput>patch -Np1 -i ../&gcc-posix-patch;</userinput></screen> … … 41 41 <screen os="af"><userinput>patch -Np1 -i ../&gcc-cross_search-patch;</userinput></screen> 42 42 43 <para os="ag">Now we will need to setup ourStartFile Spec to the correct library43 <para os="ag">Now setup the StartFile Spec to the correct library 44 44 location:</para> 45 45 … … 48 48 #define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >> gcc/config/linux.h</userinput></screen> 49 49 50 <para os="ai">Now we willalter <command>gcc</command>'s c preprocessors default50 <para os="ai">Now alter <command>gcc</command>'s c preprocessors default 51 51 include search path to use <filename class="directory">/tools</filename> only:</para> 52 52 … … 102 102 <listitem> 103 103 <para>This will prevent GCC from finding the multi-thread 104 include files, since we haven't created themfor this architecture105 yet. Wewill be able to find the multi-thread information after106 we create the Glibc headers.</para>104 include files, since they haven't been created for this architecture 105 yet. GCC will be able to find the multi-thread information after 106 the Glibc headers are created.</para> 107 107 </listitem> 108 108 </varlistentry> -
cross-tools/x86/glibc-headers.xml
r54e0992 rcbfa0a3 24 24 25 25 <para os="s1">The following sed removes a dependency of gcc 3.4.x from 26 the glibc we are using in cross-lfs. The reason we are changing itis27 because this only installs the headers, no compiling takes place. In the28 next glibc chapter, we use the gcc that's built right after this chapter.</para>26 the glibc used in cross-lfs. The reason it is changed is 27 because only the headers are being installed now; no compiling takes place. 28 In the next glibc build, the gcc that's built right after this section will be used.</para> 29 29 30 30 <screen os="s2"><userinput>cp configure{,.orig} … … 75 75 <term><parameter>CC=gcc</parameter></term> 76 76 <listitem> 77 <para>Tells G LIBC to use the hosts GCC compiler.</para>77 <para>Tells Glibc to use the host's GCC compiler.</para> 78 78 </listitem> 79 79 </varlistentry> … … 123 123 <term><parameter>--with-binutils=/cross-tools/${LFS_TARGET}/bin</parameter></term> 124 124 <listitem> 125 <para>This tells G LIBC to use the binutils for ourspecific target architecture.</para>125 <para>This tells Glibc to use the binutils for the specific target architecture.</para> 126 126 </listitem> 127 127 </varlistentry> … … 133 133 <screen os="cd"><userinput>make install-headers</userinput></screen> 134 134 135 <para os="ce">Some files aren't installed by the above command, so we will copy the additional header files we need:</para>135 <para os="ce">Some files aren't installed by the above command, so copy the additional header files that are needed:</para> 136 136 137 <para os="cf">First we willcopy a common file over to <filename137 <para os="cf">First copy a common file over to <filename 138 138 class="directory">/tools/include</filename>:</para> 139 139 … … 141 141 cp bits/stdio_lim.h /tools/include/bits</userinput></screen> 142 142 143 <para os="ch">Now we willcreate a blank stub file:</para>143 <para os="ch">Now create a blank stub file:</para> 144 144 145 145 <screen os="ci"><userinput>touch /tools/include/gnu/stubs.h</userinput></screen> 146 146 147 <para os="cj">For NPTL weuse the following command:</para>147 <para os="cj">For NPTL use the following command:</para> 148 148 149 149 <screen os="ck"><userinput>cp ../glibc-&glibc-version;/nptl/sysdeps/pthread/pthread.h /tools/include/</userinput></screen> 150 150 151 <para os="cl">Now wecopy the architecture specific header over:</para>151 <para os="cl">Now copy the architecture specific header over:</para> 152 152 153 153 <screen os="cm"><userinput>cp ../glibc-&glibc-version;/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h /tools/include/bits/</userinput></screen> -
final-system/common/introduction.xml
r54e0992 rcbfa0a3 65 65 recommend <ulink url="&hints-root;more_control_and_pkg_man.txt"/>.</para> 66 66 67 <note os="f">67 <!-- <note os="f"> 68 68 <para>The remainder of this book is to be performed while logged 69 69 in as user <systemitem class="username">root</systemitem> and no longer 70 70 as user <systemitem class="username">lfs</systemitem>.</para> 71 </note> 71 </note> --> 72 72 73 73 </sect1> -
temp-system/common/bzip2.xml
r54e0992 rcbfa0a3 23 23 <title>Installation of Bzip2</title> 24 24 25 <para os="ca"> We need to remove the tests to since they won't work on25 <para os="ca">Remove the tests to since they won't work on 26 26 a multi-architecture build:</para> 27 27 -
temp-system/common/findutils.xml
r54e0992 rcbfa0a3 24 24 25 25 <para os="aa">Findutils has an issue with cross-compiling where it 26 can't find getline. So we fix it here:</para>26 can't find getline. Fix it here:</para> 27 27 28 28 <screen os="ab"><userinput>echo "am_cv_func_working_getline=yes" >> config.cache</userinput></screen> -
temp-system/common/gettext.xml
r54e0992 rcbfa0a3 24 24 25 25 <para os="a">Gettext has an issue with cross-compiling where it 26 can't find getline. So we fix it here:</para>26 can't find getline. Fix it here:</para> 27 27 28 28 <screen os="b"><userinput>cd gettext-tools -
temp-system/common/introduction.xml
r54e0992 rcbfa0a3 39 39 40 40 <para>During this section of the build you will see several WARNING 41 message like the one below. It is safe to ignore this message.</para>41 messages like the one below. It is safe to ignore these messages.</para> 42 42 43 43 <blockquote><screen><computeroutput>configure: WARNING: If you wanted to set the --build type, don't use --host. -
temp-system/common/perl.xml
r54e0992 rcbfa0a3 28 28 <screen os="b"><userinput>patch -Np1 -i ../&perl-libc-patch;</userinput></screen> 29 29 30 <para os="c">We will now make a change so we can make a cross-compiled version of 31 perl. We will change the permissions on the files we need to update, so we 32 can make a change. This change will rename miniperl to miniperl-cross:</para> 30 <para os="c">Now make a change to allow the creation of a cross-compiled version of 31 perl. This change will rename miniperl to miniperl-cross. The files that need to be modified also need their permissions changed:</para> 33 32 34 33 <screen os="d"><userinput>chmod 755 ext/util/make_ext -
temp-system/common/tar.xml
r54e0992 rcbfa0a3 24 24 25 25 <para os="aa">Tar has an issue with cross-compiling where it 26 can't find <function>getline</function>. So we fix it here:</para>26 can't find <function>getline</function>. Fix it here:</para> 27 27 28 28 <screen os="ab"><userinput>echo "am_cv_func_working_getline=yes" >> config.cache</userinput></screen> -
temp-system/common/variables.xml
r54e0992 rcbfa0a3 11 11 <title>Build Variables</title> 12 12 13 <para> We will need to setup target specific variables for the compiler13 <para>Setup target specific variables for the compiler 14 14 and linkers:</para> 15 15 … … 22 22 export STRIP="${LFS_TARGET}-strip"</userinput></screen> 23 23 24 <para> Letsadd the build variables to <filename>~/.bashrc</filename> to25 prevent issues if westop and come back later:</para>24 <para>Then add the build variables to <filename>~/.bashrc</filename> to 25 prevent issues if you stop and come back later:</para> 26 26 27 27 <screen><userinput>echo export CC=\""${CC}\"" >> ~/.bashrc
Note:
See TracChangeset
for help on using the changeset viewer.