【问题标题】:boot.scr rebuild in buildrootboot.scr 在 buildroot 中重建
【发布时间】:2021-05-12 22:33:48
【问题描述】:

有没有办法在不清理整个项目的情况下重建 boot.scr 脚本? 我删除了旧的 bo​​ot.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 也不再生成

【问题讨论】:

    标签: linux u-boot buildroot


    【解决方案1】:

    接受的答案是正确的,但有更简单的方法。 boot.scr 是由host-uboot-tools 编译的,而不是uboot-tools,所以你只需要执行这个:

    make host-uboot-tools-rebuild
    

    【讨论】:

      【解决方案2】:

      如果你 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

      这是post-image.sh file

      这是the definition of that file in the defonconfig file

      【讨论】:

      • 是的,我有自己的 post-image.sh 脚本,我可以从那里运行 mkimage。这是一个很好的解决方法,但我想如果有一种“官方”的方式来生成启动脚本,为什么不使用它呢?我想知道为什么 uboot-tools-dirclean 不强制再次生成脚本?
      • 是的,是的,您需要 rm 主机-uboot-tools 目录。它可能在 host-uboot-tools 目录中,因为它发生在主机上而不是嵌入式系统上。我已更新我的答案以包含此信息。
      【解决方案3】:

      U-Boot 提供工具 mkimage。在基于 Debian 的发行版中,它位于 u-boot-tools 包中。鉴于您有一个包含脚本命令的 boot.txt 文件,您可以使用

      创建 boot.scr
      mkimage -T script -n 'My fancy title' -d boot.txt boot.scr
      

      【讨论】:

        猜你喜欢
        • 2013-07-26
        • 2015-06-03
        • 1970-01-01
        • 2012-02-13
        • 1970-01-01
        • 2019-06-05
        • 1970-01-01
        • 1970-01-01
        • 2015-11-07
        相关资源
        最近更新 更多