<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>edk2 &#8211; richliu&#039;s blog</title>
	<atom:link href="https://blog.richliu.com/tag/edk2/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Fri, 17 Oct 2025 02:46:40 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>Build Master EDK2 for Altrad8ud</title>
		<link>https://blog.richliu.com/2025/10/17/6433/build-master-edk2-for-altrad8ud/</link>
					<comments>https://blog.richliu.com/2025/10/17/6433/build-master-edk2-for-altrad8ud/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 17 Oct 2025 02:30:02 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[ALTRAD8UD]]></category>
		<category><![CDATA[edk2]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=6433</guid>

					<description><![CDATA[<p>The previous article is the Ampere Altra Mt. Jade OpenB [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/10/17/6433/build-master-edk2-for-altrad8ud/">Build Master EDK2 for Altrad8ud</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>The previous article is the <a href="https://blog.richliu.com/2022/06/23/4601/ampere-altra-mt-jade-openbmc-build-guide-on-arm64-platform/">Ampere Altra Mt. Jade OpenBMC and EDKII build guide on ARM64 platform</a>. It&#8217;s a kind of old article and is for Mt. Jade, not for Altrad8ud. <br />Rebecca committed the Altrad8ud support for EDK2 several months ago. I&#8217;ll just update some procedures and the git tree addresses.</p>



<p>OS: ubuntu 24.04</p>



<span id="more-6433"></span>



<p>Install necessary packages</p>



<pre class="wp-block-code"><code>sudo apt update
sudo apt-get install -y build-essential chrpath cpio debianutils diffstat gawk git iputils-ping libdata-dumper-simple-perl liblz4-tool libsdl1.2-dev libthread-queue-any-perl locales python3 socat subversion texinfo wget zstd
sudo apt-get install -y uuid-dev acpica-tools</code></pre>



<p>If want to compile it on x86 platform, it needs to install cross compiler gcc</p>



<pre class="wp-block-code"><code>sudo apt install gcc-aarch64-linux-gnu
export GCC_AARCH64_PREFIX=aarch64-linux-gnu-</code></pre>



<p>Download git source code </p>



<pre class="wp-block-code"><code>export WORKSPACE=/nvme/tianocore
mkdir -p $WORKSPACE
cd $WORKSPACE
git clone https://github.com/tianocore/edk2.git
cd edk2
git submodule update --init
cd ..

git clone https://github.com/tianocore/edk2-platforms.git
cd edk2-platforms
git submodule update --init
cd ..
git clone https://github.com/tianocore/edk2-non-osi.git

git clone https://github.com/AmpereComputing/edk2-ampere-tools.git

git clone --depth 1 https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git</code></pre>



<p>Setup the environment, first time, it needs to run the script in the edk2 directory</p>



<pre class="wp-block-code"><code>make -C edk2/BaseTools
cd edk2
. edksetup.sh</code></pre>



<p>then it should run it again on &lt;WORKSPACE></p>



<pre class="wp-block-code"><code>cd $WORKSPACE
. edk2/edksetup.sh</code></pre>



<p>Build ARM ATF</p>



<pre class="wp-block-code"><code>cd $WORKSPACE
cd trusted-firmware-a                                                                        
make fiptool  
make certtool  </code></pre>



<p>add those parameters to your environment file and source it.</p>



<pre class="wp-block-preformatted">export WORKSPACE=/nvme/tianocore<br />export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms:$PWD/edk2-non-osi:$PWD/edk2-platforms/Features<br />ATFPATH=$WORKSPACE<br />export MANUFACTURER=ASRockRack<br />export BOARD_NAME=Altra1L2T<br />export PATH=$PATH:$ATFPATH/AtfTools/tools/cert_create:$ATFPATH/AtfTools/tools/fiptool</pre>



<p>Build the edk2 </p>



<pre class="wp-block-code"><code># build release version
./edk2-platforms/Platform/Ampere/buildfw.sh -m ASRockRack -p Altra1L2T -b RELEASE
# build debug version 
./edk2-platforms/Platform/Ampere/buildfw.sh -m ASRockRack -p Altra1L2T -b DEBUG
# Change default parameters
EDK2_X86_EMULATOR_ENABLE=FALSE EDK2_SHELL_ENABLE=TRUE ./edk2-platforms/Platform/Ampere/buildfw.sh -m ASRockRack -p Altra1L2T -b RELEASE</code></pre>



<p>Detail parameres can be seen in the build_fw.sh file</p>



<pre class="wp-block-code"><code>./edk2-platforms/Platform/Ampere/buildfw.sh  --help
Usage:
  ./edk2-platforms/Platform/Ampere/buildfw.sh &#91;options]

Options:
  -b &lt;bldtype&gt;, --build &lt;bldtype&gt;  Specify the build type: DEBUG or RELEASE
  -t &lt;tc&gt;, --toolchain &lt;tc&gt;        Specify the toolchain to use: GCC or CLANG
  -m &lt;mfg&gt;, --manufacturer &lt;mfg&gt;   Specify platform manufacturer (e.g. Ampere)
  -p &lt;plat&gt;, --platform &lt;plat&gt;     Specify platform to build (e.g. Jade)
  -l &lt;kern&gt;, --linuxboot &lt;kern&gt;    Build LinuxBoot firmware instead of full EDK2 with UEFI Shell, specifying path to flashkernel
  -f, --flash                      Copy firmware to BMC and flash firmware (keeping EFI variables and NVPARAMs) after building
  -F, --full-flash                 Copy firmware to BMC and flash full EEPROM (resetting EFI variables and NVPARAMs) after building

  Note: flash options require bmc.sh file with env vars BMC_HOST, BMC_USER and BMC_PASS defined

  Available manufacturers:
    ADLINK
    Ampere
    ASRockRack

  Available platforms:
    ADLINK     -&gt; ComHpcAlt
    Ampere     -&gt; Jade
    ASRockRack -&gt; Altra1L2Q
    ASRockRack -&gt; Altra1L2T

Environment Variables:
  SECUREBOOT_DIR       - directory to store SecureBoot keys, certs etc.
  USE_EXISTING_SB_KEYS - use existing Secure Boot Platform and Update keys
  DOWNLOAD_MS_SB_KEYS  - force re-download of Microsoft Secure Boot KEK and DB certificates
  CERT_PASSWORD        - password to use when generating Platform and Update Keys and certificates
                         defaults to "password" if not specified.

  EDK2_SECURE_BOOT_ENABLE             (TRUE)
  EDK2_NETWORK_ENABLE                 (TRUE)
  EDK2_INCLUDE_TFTP_COMMAND           (TRUE)
  EDK2_NETWORK_IP6_ENABLE             (TRUE)
  EDK2_NETWORK_ALLOW_HTTP_CONNECTIONS (FALSE)
  EDK2_NETWORK_TLS_ENABLE             (TRUE)
  EDK2_REDFISH_ENABLE                 (TRUE)
  EDK2_PERFORMANCE_MEASUREMENT_ENABLE (FALSE)
  EDK2_TPM2_ENABLE                    (TRUE)
  EDK2_HEAP_GUARD_ENABLE              (FALSE)
  EDK2_X86_EMULATOR_ENABLE            (TRUE)
  EDK2_SHELL_ENABLE                   (TRUE)</code></pre>



<p>If build_fw.sh run&#8217;s without any problem, it will generate a 10MB size BIOS image, but the stock ASRR image size is 32MB. Therefore, you needs to copy the EDK2 image into the stock image at offset 0x600000. You can download the Altrad8ud stock firmware from the Altrad8ud firmware download site.</p>



<pre class="wp-block-code"><code>dd if=edk2-uefi.bin of=stock-bios.bin bs=1MB seek=6 conv=notrunc</code></pre>



<p>Here is a sample script to package it again. It will generate fw-altrad8ud.tar, which can be upgraded via the WebGUI.</p>



<pre class="wp-block-code"><code>cp ampere/bios.bin .
cp ampere/MANIFEST .

dd if=Build/Altra1L2T/altra1l2t_uefi.bin of=bios.bin bs=1M seek=6 conv=notrunc

tar cf fw-altrad8ud.tar bios.bin MANIFEST</code></pre>



<p>Or you also can  copy bios.bin(modified) to the BMC and update it directly from the BMC. <br />because scp or sftp didn&#8217;t work for me, I used the http to download the image.</p>



<pre class="wp-block-code"><code># cd /tmp
# curl &lt;your web&gt;/bios.bin
# ampere_flash_bios.sh bios.bin</code></pre>



<p>ref. <a href="https://community.amperecomputing.com/t/edk2-new-support-for-asrock-rack-altrad8ud-1l2t-altrad8ud2-1l2q-and-build-improvements-for-mt-jade-and-com-hpc-alt/2969" target="_blank" rel="noopener">EDK2: new support for ASRock Rack ALTRAD8UD-1L2T / ALTRAD8UD2-1L2Q and build improvements for Mt Jade and COM-HPC-ALT</a></p>



<p></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/10/17/6433/build-master-edk2-for-altrad8ud/">Build Master EDK2 for Altrad8ud</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2025/10/17/6433/build-master-edk2-for-altrad8ud/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
