Ignore:
Timestamp:
02/26/2022 08:31:27 AM (5 months ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
11.1, lazarus, trunk, xry111/intltool, xry111/test-20220226
Children:
43397b0e
Parents:
552bf36
git-author:
Xi Ruoyao <xry111@…> (02/26/2022 08:26:38 AM)
git-committer:
Xi Ruoyao <xry111@…> (02/26/2022 08:31:27 AM)
Message:

grub-efi: allows building on 32-bit LFS for x86_64 EFI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postlfs/filesystems/uefi-bootloaders/grub-efi.xml

    r552bf36 r672f2a5  
    1010  <!ENTITY grub-efi-size          "6.3 MB">
    1111  <!ENTITY grub-efi-buildsize     "137 MB">
    12   <!ENTITY grub-efi-time          "1.0 SBU">
     12  <!ENTITY grub-efi-time          "1.0 SBU (on 64-bit LFS)">
    1313
    1414  <!ENTITY unifont-download-http  "https://unifoundry.com/pub/unifont/unifont-&unifont-version;/font-builds/unifont-&unifont-version;.pcf.gz">
    1515  <!ENTITY unifont-md5sum         "8191ca4fce0eb6073d47c7573e6babc1">
    1616  <!ENTITY unifont-size           "1.3 MB">
     17
     18  <!ENTITY gcc-download-http      "&gnu-http;/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.xz">
     19  <!ENTITY gcc-md5sum             "31c86f2ced76acac66992eeedce2fce2">
     20  <!ENTITY gcc-size               "77 MB">
    1721]>
    1822
     
    96100    </itemizedlist>
    97101
     102    <itemizedlist spacing="compact">
     103      <title>GCC (only needed if building on 32-bit LFS)</title>
     104      <listitem>
     105        <para>
     106          Download (HTTP): <ulink url="&gcc-download-http;"/>
     107        </para>
     108      </listitem>
     109      <listitem>
     110        <para>
     111          Download MD5 sum: &gcc-md5sum;
     112        </para>
     113      </listitem>
     114      <listitem>
     115        <para>
     116          Download size: &gcc-size;
     117        </para>
     118      </listitem>
     119    </itemizedlist>
     120
    98121    <bridgehead renderas="sect3">GRUB Dependencies</bridgehead>
    99122
     
    120143  <sect2 role="installation">
    121144    <title>Installation of GRUB</title>
    122 
    123     <warning>
    124       <para>
    125         The instruction does not work correctly on 32-bit LFS system
    126         at now.
    127       </para>
    128     </warning>
    129145
    130146    <para>
     
    147163    </warning>
    148164
     165    <para>If you are running a 32-bit LFS, prepare a 64-bit compiler:</para>
     166
     167<!-- 'literal' is used deliberately to show this is only for 32-bit LFS -->
     168<screen><userinput>case $(uname -m) in i?86 )
     169    <literal>tar xf ../gcc-11.2.0.tar.xz
     170    mkdir gcc-11.2.0/build
     171    pushd gcc-11.2.0/build
     172        ../configure --prefix=$PWD/../../x86_64-gcc \
     173                     --target=x86_64-linux-gnu      \
     174                     --with-system-zlib             \
     175                     --enable-languages=c,c++       \
     176                     --with-ld=/usr/bin/ld
     177        make all-gcc
     178        make install-gcc
     179    popd
     180    export TARGET_CC=$PWD/x86_64-gcc/bin/x86_64-linux-gnu-gcc</literal>
     181esac</userinput></screen>
     182
    149183    <para>
    150184      Build <application>GRUB</application> with the following commands:
     
    156190            --enable-grub-mkfont \
    157191            --with-platform=efi  \
     192            --target=x86_64      \
    158193            --disable-werror     &amp;&amp;
     194unset TARGET_CC &amp;&amp;
    159195make</userinput></screen>
    160196
     
    200236
    201237    <para>
    202       <option>--target=i386</option>: Some x86_64 systems have 32-bit UEFI
    203       implementation, but they are very old and rare.
    204       Do <emphasis role='bold'>not</emphasis> use this option unless you are
    205       absolutely sure that LFS is running on such a system.
     238      <parameter>--target=x86_64</parameter>: Ensures building GRUB for
     239      x86_64 even if building on a 32-bit LFS system.  Most EFI firmwares
     240      on x86_64 does not support 32-bit bootloaders.
     241    </para>
     242
     243    <para>
     244      <option>--target=i386</option>: A few 32-bit x86 platforms have EFI
     245      support.  And, some x86_64 platforms have a 32-bit EFI implementation,
     246      but they are very old and rare. Use this instead of
     247      <parameter>--target=x86_64</parameter> if you are
     248      <emphasis role='bold'>absolutely sure</emphasis> that LFS is running
     249      on such a system.
    206250    </para>
    207251
Note: See TracChangeset for help on using the changeset viewer.