问题描述
有没有办法在不清理整个项目的情况下重建 boot.scr 脚本?
我删除了旧的 boot.scr 脚本,但不知道如何生成新脚本(只有 make clean
有帮助)
设置了变量 BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE。
make uboot-dirclean uboot-tools-dirclean
没有帮助。
我发现创建 boot.scr 的 mkimage 脚本是从 uboot-tools 安装规则调用的,但是即使我清除了 uboot-tools boot.scr 也不再生成
解决方法
U-Boot 提供了 mkimage 工具。在基于 Debian 的发行版中,它位于 u-boot-tools 包中。鉴于您有一个包含脚本命令的文件 boot.txt,您可以使用
创建 boot.scrmkimage -T script -n 'My fancy title' -d boot.txt boot.scr
,
如果你 dirclean host-uboot-tools 它会重建你的脚本。原因是在 uboot-tools.mk 文件中的 HOST_UBOOT_TOOLS_INSTALL_CMDS 函数中调用了 mkimage(生成脚本)。
由于您的个人脚本位于外部 buildroot 目录中,您可能希望快速迭代编写和测试它,因此您每次都希望制作它。每次运行 make 时都有一种方法可以做到这一点。不需要清洁任何东西。帖子图片脚本是关键。
例如,创建您的 post-image.sh 脚本并在您的 defconfig 文件中指定它。
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL)/board/RK3308/post-image.sh"
在那个 post-iamge.sh 脚本中,运行命令来生成你的启动脚本,这是一个例子:
# Generate the uboot script
$ubootName/tools/mkimage -C none -A arm -T script -d $BR2_EXTERNAL_RK3308_PATH/board/RK3308/boot.cmd $BINARIES_DIR/boot.scr
每次运行 make 时,都会重新生成 boot.scr。
如果您想在上下文中查看所有这些,here is an external buildroot repo for the rk3308 chipset。
这是the definition of that file in the defonconfig file。
,接受的答案是正确的,但有更简单的方法。 boot.scr 是由 host-uboot-tools
编译的,而不是 uboot-tools
,因此你只需要执行这个:
make host-uboot-tools-reinstall