【问题标题】:File collision error building IoT Core image with modified config.txt file使用修改后的 config.txt 文件构建 IoT Core 映像的文件冲突错误
【发布时间】:2018-07-31 01:15:00
【问题描述】:

我是 Raspberry Pi 3B 的 building a Windows 10 IoT Core image,它需要在 EFIESP 分区的根目录包含一个自定义的 config.txt 文件。

我有edited the MyApp.FilesAndRegKeys.wm.xml file 来包含编辑后的config.txt 文件,如下所示:

<onecorePackageInfo
    targetPartition="EFIESP"
    releaseType="Production"
    ownerType="OEM" />
<files>
    <file
        destinationDir="$(runtime.bootDrive)"
        source="config.txt"
        name="config.txt" />
</files>

但是buildimage MyApp test 命令给出了文件冲突错误:

错误:[00:00:01] onecore\base\cbs\mobile\iuvalidator\packagevalidationrules.cpp, PackageValidationRules::Rule_DetectFileCollisions,第 716 行,错误, 错误 - 检测到文件冲突,在包中找到文件“\config.txt” 'MyOEMName.MyApp.FilesAndRegKeys' 和 'RASPBERRYPI.RPi2.BootFirmware'。

如果我将name="config.txt" 更改为name="config2.txt" 则没有错误并且文件创建成功。但我希望它替换现有文件,而不是创建一个新文件。我在C:\IoT-ADK-AddonKitC:\BSP 的任何地方都看不到原始的config.txt 文件,所以我不确定如何编辑这个现有的包或强制进行替换。

【问题讨论】:

    标签: raspberry-pi windows-10-iot-core windowsiot bsp


    【解决方案1】:

    如果你想编辑 config.txt 文件,你可以在镜像构建之后编辑它。插入已闪过图像的 SD 卡。您将在 EFIESP 驱动器中找到 config.txt 文件,如下所示:

    参考:“R-Pi configuration file”和“CONFIG.TXT

    更新: 使用修改后的 config.txt 文件构建 IoT Core 映像

    config.txt 在一个包 (RASPBERRYPI.RPi2.BootFirmware.cab) 中提供。所以我们需要用修改后的 config.txt 文件重新生成 RASPBERRYPI.RPi2.BootFirmware.cab。您可以按照以下步骤操作:

    1. 获取构建 RASPBERRYPI.RPi2.BootFirmware.cab 所需的所有文件并将它们复制到文件夹,例如 D:\NewCab。您可以在 EFIESP 驱动器中找到它们(您可以在闪存的 SD 卡中找到 EFIESP 驱动器):

    1. 编辑 config.txt。
    2. 使用此RPi_UEFI.pkg.xml 文件生成新的 CAB 文件:

    <?xml version="1.0" encoding="utf-8"?>
    
    <!--
    Copyright (c) Microsoft Corporation.  All rights reserved.
    -->
    <Package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      Owner="RASPBERRYPI"
      Component="RPi2"
      SubComponent="BootFirmware"
      OwnerType="OEM"
      ReleaseType="Production"
      Platform="RPi2"
      Partition="EFIESP"
      BinaryPartition="false"
      xmlns="urn:Microsoft.WindowsPhone/PackageSchema.v8.00">
      <Components>
        <OSComponent>
          <Files>
    
            <File
              Source="bootcode.bin"
              Name="bootcode.bin"
              DestinationDir="$(runtime.root)"/>
    
            <File
              Source="config.txt"
              Name="config.txt"
              DestinationDir="$(runtime.root)"/>
    
            <File
              Source="fixup.dat"
              Name="fixup.dat"
              DestinationDir="$(runtime.root)"/>
    
            <File
              Source="fixup_cd.dat"
              Name="fixup_cd.dat"
              DestinationDir="$(runtime.root)"/>
    
            <File
              Source="fixup_x.dat"
              Name="fixup_x.dat"
              DestinationDir="$(runtime.root)"/>
    
            <File
              Source="kernel.img"
              Name="kernel.img"
              DestinationDir="$(runtime.root)"/>
    
            <File
              Source="LICENCE.broadcom"
              Name="LICENCE.broadcom"
              DestinationDir="$(runtime.root)"/>
    
            <File
              Source="start.elf"
              Name="start.elf"
              DestinationDir="$(runtime.root)"/>
    
            <File
              Source="start_cd.elf"
              Name="start_cd.elf"
              DestinationDir="$(runtime.root)"/>
    
            <File
              Source="start_x.elf"
              Name="start_x.elf"
              DestinationDir="$(runtime.root)"/>
    
          </Files>
        </OSComponent>
      </Components>
    </Package>
    
    1. iot-adk-addonkit 中启动IoTCoreShell-arm.cmd 并导航到路径D:\NewCab 并运行以下命令:

      pkggen RPi_UEFI.pkg.xml

      您将在工作文件夹中获得RASPBERRYPI.RPi2.BootFirmware.cab

    2. 使用新生成的RASPBERRYPI.RPi2.BootFirmware.cab替换此路径中的默认C:\Program Files (x86)\Windows Kits\10\MSPackages\retail\arm\fre

    之后,当您构建图像时,编辑后的 ​​config.txt 将被添加。

    【讨论】:

    • 像这样手动编辑文件是可行的,但我希望将此作为自动化过程的一部分进行,因此我不需要在每次完成刷新图像时都执行手动步骤。
    • @Coder6841 好的。我得到了它。我会与内部相关工程师联系并尽快通知您。
    • @Coder6841 我找到了解决您问题的方法。请检查我的更新答案。
    猜你喜欢
    • 2011-09-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-21
    • 2012-12-28
    • 1970-01-01
    • 2017-10-18
    • 2021-11-22
    • 1970-01-01
    相关资源
    最近更新 更多