raspberry-pi - 使用修改后的 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
我不确定如何编辑这个现有的包或强制进行替换。
解决方案
如果要编辑 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。您可以按照以下步骤操作:
- 获取构建 RASPBERRYPI.RPi2.BootFirmware.cab 所需的所有文件并将它们复制到一个文件夹中,例如
D:\NewCab
. 您可以在 EFIESP 驱动器中找到它们(您可以在闪存的 SD 卡中找到 EFIESP 驱动器):
- 编辑 config.txt。
- 使用此文件生成新的 CAB
RPi_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>
从iot-adk-addonkit 开始
IoTCoreShell-arm.cmd
并导航到路径并运行以下命令:D:\NewCab
pkggen RPi_UEFI.pkg.xml
您将
RASPBERRYPI.RPi2.BootFirmware.cab
在工作文件夹中获得一个。使用新生成
RASPBERRYPI.RPi2.BootFirmware.cab
替换此路径中的默认C:\Program Files (x86)\Windows Kits\10\MSPackages\retail\arm\fre
之后,当您构建图像时,将添加编辑后的 config.txt。
推荐阅读
- sql - 从 SQL 数据库中选择除重复项之外的所有内容
- javascript - JS通过字符串访问孙子属性
- python - 如何在 OpenCV 中的图像上临时显示文本?
- r - 将最大值添加到R中的模拟
- bash - bash 的别名不起作用(使用 bash 并在重新启动时编辑了 bash_profile)
- ruby-on-rails - Rails - 注入方法名称和会话
- flutter - Flutter:如何将值传递给有状态的小部件?
- javascript - 无法从外部模块获取新值
- python - 重启后Pyserial的串行连接问题
- snakemake - Snakemake:防止重新运行子工作流程