首页 > 解决方案 > 使用修改后的 config.txt 文件构建 IoT Core 映像的文件冲突错误

问题描述

我正在为 Raspberry Pi 3B构建 Windows 10 IoT Core 映像,它需要config.txt在 EFIESP 分区的根目录中包含一个自定义文件。

我已经编辑了 MyApp.FilesAndRegKeys.wm.xml 文件以包含编辑后的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"则没有错误并且文件已成功创建。但我希望它替换现有文件,而不是创建一个新文件。我在任何地方都看不到原始config.txt文件,C:\IoT-ADK-AddonKit所以C:\BSP我不确定如何编辑这个现有的包或强制进行替换。

标签: raspberry-piwindows-10-iot-corewindowsiotbsp

解决方案


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

在此处输入图像描述

在此处输入图像描述

参考:“ R-Pi 配置文件”和“ 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. 使用此文件生成新的 CABRPi_UEFI.pkg.xml文件:

<?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。


推荐阅读