Buildroot编译报错:无法本地验证证书颁发机构权限及Linux头文件下载404问题求助
Hi there! Let's break down and solve the core 404 issue you're hitting while building your ZedBoard image with Python3 and its modules. Here's what's going on and how to fix it:
Root Cause of the 404 Error
The linux-4.16.tar.xz file is no longer available at http://sources.buildroot.net/linux/ because older kernel versions get removed from the primary Buildroot sources mirror over time. Additionally, the main kernel CDN (cdn.kernel.org) doesn't host very old non-LTS kernel versions anymore—they're moved to the official kernel archive server instead.
Step-by-Step Solutions
1. Switch to the Kernel Archive Server for linux-headers 4.16
You can manually update the download source for linux-headers to point to the kernel archive, which retains all old kernel versions:
- Navigate to your Buildroot directory, then open the file
package/linux-headers/linux-headers.mkin a text editor. - Find the line defining
LINUX_HEADERS_SITE—it likely looks like this:LINUX_HEADERS_SITE = http://sources.buildroot.net/linux/ - Replace it with the archive URL for the 4.x kernel series:
LINUX_HEADERS_SITE = https://archive.kernel.org/pub/linux/kernel/v4.x/ - Save the file, then clean up any existing failed download artifacts:
rm -rf build/linux-headers-4.16/ dl/linux-headers-4.16.tar.xz - Re-run
maketo restart the build.
2. Upgrade to a Newer LTS Kernel Version (Recommended)
Using an older non-LTS kernel like 4.16 isn't ideal for long-term support and compatibility. ZedBoard works well with newer LTS kernel versions (like 4.19, 5.4, or 5.10) which are still hosted and maintained. Here's how to switch:
- Run
make menuconfigin your Buildroot directory. - Navigate to Kernel > Linux Headers Version.
- Select a newer LTS version from the list (e.g.,
4.19.xor5.4.x). - Save your configuration and exit menuconfig.
- Clean up old build files to avoid conflicts:
make clean - Recompile with
make—this will pull available kernel headers from active sources, eliminating the 404 error entirely.
3. Verify ZedBoard Configuration Compatibility
Double-check that your Buildroot config is optimized for ZedBoard:
- Ensure you're using the
zynq_defconfigas a base (runmake zynq_defconfigif you haven't already) before adding your Python3 and module customizations. This ensures kernel and hardware settings are aligned with ZedBoard's requirements.
Quick Note on the Certificate Issue
You already fixed this with --no-check-certificate in the WGET config, which is a valid workaround for internal proxy setups. If you want a more permanent solution later, you can add your company proxy's CA certificate to Buildroot's trusted certificates by copying it to board/your-board-name/rootfs-overlay/etc/ssl/certs/ (create the directory if needed) before compiling.
内容的提问来源于stack exchange,提问作者Lalastro

