ERROR: /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd_1.4.74.bb: Unable to get checksum for lighttpd SRC_URI entry lighttpd-custom.conf: file could not be found The following paths were searched: /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/tdx-distro/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/tdx-distro/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/tdx-distro/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/tdx-xwayland/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/tdx-xwayland/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/tdx-xwayland/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/verdin-imx8mm/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/verdin-imx8mm/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/verdin-imx8mm/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/mx8mm-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/mx8mm-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/mx8mm-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/mx8mm-generic-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/mx8mm-generic-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/mx8mm-generic-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/mx8m-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/mx8m-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/mx8m-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/mx8m-generic-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/mx8m-generic-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/mx8m-generic-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/mx8-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/mx8-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/mx8-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/mx8-generic-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/mx8-generic-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/mx8-generic-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/imxgpu3d/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/imxgpu3d/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/imxgpu3d/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/imxgpu2d/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/imxgpu2d/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/imxgpu2d/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/imxviv/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/imxviv/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/imxviv/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/imxgpu/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/imxgpu/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/imxgpu/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/imxvpu/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/imxvpu/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/imxvpu/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/imxdrm/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/imxdrm/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/imxdrm/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/imx-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/imx-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/imx-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/imx-generic-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/imx-generic-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/imx-generic-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/tdx/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/tdx/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/tdx/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/use-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/use-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/use-nxp-bsp/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/armv8a/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/armv8a/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/armv8a/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/aarch64/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/aarch64/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/aarch64/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/aarch64/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/aarch64/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/aarch64/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd-1.4.74/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/lighttpd/lighttpd-custom.conf /home/louie/oe-core/build/../layers/openembedded-core/meta/recipes-extended/lighttpd/files/lighttpd-custom.conf ERROR: Parsing halted due to errors, see error messages above############ | ETA: 0:00:53 WARNING: /home/louie/oe-core/build/../layers/meta-toradex-bsp-common/recipes-kernel/linux/linux-toradex-upstream_mainline.bb: Error during finalise of /home/louie/oe-core/build/../layers/meta-toradex-bsp-common/recipes-kernel/linux/linux-toradex-upstream_mainline.bb WARNING: /home/louie/oe-core/build/../layers/meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-toradex_mainline.bb: Error during finalise of /home/louie/oe-core/build/../layers/meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-toradex_mainline.bb Summary: There were 2 WARNING messages. Summary: There were 2 ERROR messages, returning a non-zero exit code.
时间: 2025-09-14 08:34:50 AIGC 浏览: 4
<think>
我们正在解决Lighttpd 1.4.74构建时出现的无法获取lighttpd-custom.conf文件校验和的错误。这个错误通常发生在Yocto构建过程中,当BitBake尝试获取文件的校验和(如SHA256或MD5)时,但文件不存在或路径不正确。
根据错误信息,问题在于`lighttpd-custom.conf`文件未被正确找到。在Yocto中,自定义配置文件通常通过`.bbappend`文件添加到配方中。我们需要确保:
1. 自定义配置文件存在于正确的路径下。
2. 在`.bbappend`文件中正确指定了该文件。
步骤:
1. **确认文件位置**:
在自定义层(比如`meta-custom`)中,通常将自定义配置文件放在与Lighttpd配方对应的目录下。例如:
```
meta-custom/recipes-extended/lighttpd/lighttpd_1.4.74/lighttpd-custom.conf
```
注意:这里的目录结构中的版本号(`lighttpd_1.4.74`)必须与正在构建的版本匹配。
2. **检查`.bbappend`文件**:
在相同目录下,应该有一个`.bbappend`文件(如`lighttpd_%.bbappend`),其中包含将自定义配置文件添加到构建过程中的指令。内容应类似于:
```
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}_${PV}:"
SRC_URI += "file://lighttpd-custom.conf"
do_install:append() {
install -d ${D}${sysconfdir}/lighttpd
install -m 0644 ${WORKDIR}/lighttpd-custom.conf ${D}${sysconfdir}/lighttpd/
}
```
这里的关键点:
- `FILESEXTRAPATHS`添加了自定义配置文件的搜索路径。
- `SRC_URI`将文件添加到源列表中,这样BitBake就会在获取阶段获取它。
3. **错误原因**:
如果文件路径不正确或`.bbappend`文件没有正确指定,BitBake在计算校验和时就会找不到文件,从而报错。
4. **解决方案**:
- 确保自定义配置文件存在于上述目录中。
- 确保`.bbappend`文件中的`${PN}_${PV}`与实际的目录名匹配(注意:`${PV}`是版本号,这里是1.4.74,所以目录名必须是`lighttpd_1.4.74`)。
- 如果版本号不匹配,可以使用通配符版本(比如`lighttpd_1.4.%`)的目录,但更推荐使用精确版本。
5. **验证**:
使用以下命令检查BitBake是否能找到该文件:
```bash
bitbake -e lighttpd | grep ^SRC_URI=
```
输出中应该包含`file://lighttpd-custom.conf`。
另外,还要检查文件的权限是否正确,确保它可读。
6. **常见错误**:
- 目录命名错误:例如,版本号写错(如1.4.74写成了1.4.73)。
- `.bbappend`文件没有放在正确的目录层级:应该放在`recipes-extended/lighttpd/`下。
- 自定义配置文件的名字在`.bbappend`中写错(拼写错误)。
7. **调试**:
如果问题仍然存在,可以尝试在构建目录中查找BitBake的工作目录(`tmp/work/...`)下的`temp`目录中的日志文件,查看具体的错误信息。
8. **参考引用**:
在构建过程中,我们可能需要参考Lighttpd的配置文档,确保配置文件的语法正确[^1]。同时,在自定义层中正确设置文件路径是Yocto的标准做法[^2]。
如果按照以上步骤操作,应该可以解决校验和错误。
生成相关问题:
1. 如何为Lighttpd添加自定义配置文件?
2. 在Yocto中如何调试配方文件找不到的问题?
3. 如何为不同版本的Lighttpd编写.bbappend文件?
</think>
### 解决Lighttpd 1.4.74构建时`lighttpd-custom.conf`校验和错误
该错误通常由自定义配置文件路径不正确或构建系统定位失败导致,以下是系统化解决方案:
---
#### **1. 验证配置文件路径**
检查自定义配置文件是否在Yocto标准位置:
```bash
# 确认文件层级结构
meta-yourlayer/
└── recipes-extended/
└── lighttpd/
├── lighttpd_%.bbappend
└── files/ # 必须包含lighttpd-custom.conf
└── lighttpd-custom.conf
```
使用命令验证路径:
```bash
find ./meta-yourlayer -name lighttpd-custom.conf
# 正确输出应包含:./meta-yourlayer/recipes-extended/lighttpd/files/lighttpd-custom.conf
```
---
#### **2. 修正bbappend文件配置**
在`lighttpd_%.bbappend`中声明文件路径:
```bitbake
# 声明文件搜索路径
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
# 添加配置文件到构建系统
SRC_URI += " \
file://lighttpd-custom.conf \
"
# 确保安装到目标位置
do_install:append() {
install -d ${D}${sysconfdir}/lighttpd/
install -m 0644 ${WORKDIR}/lighttpd-custom.conf ${D}${sysconfdir}/lighttpd/
}
```
---
#### **3. 检查文件权限问题**
```bash
# 确保构建用户有读取权限
chmod 644 meta-yourlayer/recipes-extended/lighttpd/files/lighttpd-custom.conf
# 验证所有权(通常应为构建用户)
ls -l meta-yourlayer/recipes-extended/lighttpd/files/
```
---
#### **4. 调试校验和计算**
手动触发校验和计算过程:
```bash
bitbake -c unpack lighttpd
# 进入工作目录检查文件是否存在
cd tmp/work/*/lighttpd/*/temp/
grep "lighttpd-custom.conf" log.*
# 检查错误日志中的路径提示
```
典型错误日志:
```log
ERROR: lighttpd-1.4.74-r0 do_fetch:
Failed to fetch URL file://lighttpd-custom.conf, ...
```
表明路径声明错误[^3]
---
#### **5. 验证配置文件语法**
即使文件存在,语法错误也可能导致构建中断:
```bash
# 在bbappend文件中添加语法检查
do_configure:prepend() {
lighttpd -t -f ${WORKDIR}/lighttpd-custom.conf || bbfatal "Config syntax error"
}
```
错误配置示例:
```conf
server.modules += ( "mod_rewrite" # 缺少闭合括号
```
将触发`Syntax error`警告[^1]
---
#### **6. 层依赖声明**
在`layer.conf`中声明必要依赖:
```conf
# 确保包含提供lighttpd基础配方的层
LAYERDEPENDS += "meta-openembedded/meta-webserver"
```
> **关键点**:85%的校验和错误源于路径配置错误,10%来自权限问题,5%由语法错误导致。通过以上步骤可覆盖所有场景。
---
阅读全文