<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[OpenWrt中文件夹staging_dir和build_dir的含义]]></title><description><![CDATA[<p dir="auto"><em><strong>build_dir</strong></em>：用来解压所有的源代码和编译它们的位置</p>
<p dir="auto"><em><strong>staging_dir</strong></em>：用来安装所有已编译软件的位置，或者用来存放用来打包、组装固件的文件。</p>
<p dir="auto"><em><strong>build_dir</strong></em>文件夹中有三个区域：<br />
<em><strong>build_dir/host</strong></em>：用来编译所有跑在主机上的程序（OpenWRT从源中编译他自己版本的sed和其它许多工具）。这个区域将用来编译仅跑在你主机上的程序。</p>
<p dir="auto"><em><strong>build_dir/toolchain</strong></em>：用来编译打包中使用到的C交叉编译器和C标准库组件。这个区域将用来编译仅跑在你住几上的程序（例如：C交叉编译器）以及设计的跑在目标机器上的链接库，例如uClibc, libm, pthreads等等。</p>
<p dir="auto"><em><strong>build_dir/target</strong></em>：用于编译目标系统的实际的包，和Linux内核。</p>
<p dir="auto">staging_dir下也有三个区域：<br />
staging_dir/host：该文件夹是一个微型的Linux 根目录，有自己的目录bin/, lib/等等。这是主机工具安装的位置，构建系统的其余部分会将该区域的目录前缀到环境变量PATH中。</p>
<p dir="auto"><em><strong>staging_dir/toolchain</strong></em>：该文件夹是一个微型的Linux 根目录，有自己的目录bin/, lib/等等。它包含用来构建固件的C交叉编译器。你可以用该编译器在OpenWRT之外编译一个可以加载到固件中的简单的C程序。这个C编译器一般是这样：staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-gcc。你可以看到CPU、C库和编码到其中的gcc的版本号；并且允许多目标同时在一起构建。</p>
<p dir="auto"><em><strong>staging_dir/target</strong></em>：包含每个目标包已安装的版本；根目录形式，包含bin/, lib/等等，并且将会变成实际的根目录，仅作出一些调整就会打包进固件镜像中，像root-ar71xx之类的。这里也有一些其它的文件在其中，主要生成软件包和开发软件包。</p>
<p dir="auto">参考链接： <a href="https://stackoverflow.com/questions/26030670/openwrt-buildroot-build-dir-and-staging-dir" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/26030670/openwrt-buildroot-build-dir-and-staging-dir</a></p>
]]></description><link>https://bbs.aw-ol.com/topic/1193/openwrt中文件夹staging_dir和build_dir的含义</link><generator>RSS for Node</generator><lastBuildDate>Thu, 15 Oct 2026 08:10:10 GMT</lastBuildDate><atom:link href="https://bbs.aw-ol.com/topic/1193.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 21 Mar 2022 15:18:17 GMT</pubDate><ttl>60</ttl></channel></rss>