blob: 020e453fbfc605d42d1f97cebe73af0941b2e4f1 [file] [log] [blame]
#!/bin/bash
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
if [[ ! -f ${ROOT_FS_DIR}/etc/fwupd/daemon.conf ]]; then
exit 0
fi
echo "Enabling dummy fwupd remote for tests."
sed -e '/^DisabledPlugins=/s/^/#/' -i "${ROOT_FS_DIR}/etc/fwupd/daemon.conf"
cat > "${ROOT_FS_DIR}/usr/share/fwupd/remotes.d/vendor/fwupd-tests.xml" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Extracted from https://github.com/fwupd/fwupd/blob/HEAD/data/installed-tests/fwupd-tests.xml -->
<components version="0.9" origin="lvfs">
<component type="firmware">
<id>fakedevice.firmware</id>
<name>FakeDevice Firmware</name>
<summary>Firmware for the ACME Corp Integrated Webcam</summary>
<developer_name>ACME Corp</developer_name>
<project_license>GPL-2.0+</project_license>
<description><p>Updating the firmware on your webcam device improves performance and adds new features.</p></description>
<url type="homepage">http://www.acme.com/</url>
<releases>
<release version="1.2.4" timestamp="1497499200" urgency="medium">
<size type="installed">17</size>
<size type="download">1163</size>
<location>https://fwupd.org/downloads/fakedevice124.cab</location>
<checksum filename="fakedevice124.cab" target="container" type="sha1">fc0aabcf98bf3546c91270f2941f0acd0395dd79</checksum>
<checksum filename="fakedevice124.bin" target="content" type="sha1">2b8546ba805ad10bf8a2e5ad539d53f303812ba5</checksum>
<description><p>Fixes another bug with the flux capacitor to prevent time going backwards.</p></description>
</release>
</releases>
<provides>
<firmware type="flashed">b585990a-003e-5270-89d5-3705a17f9a43</firmware>
</provides>
</component>
</components>
EOF
cat > "${ROOT_FS_DIR}/etc/fwupd/remotes.d/fwupd-tests.conf" <<EOF
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
[fwupd Remote]
Enabled=true
Title=fwupd test
Type=local
Keyring=none
MetadataURI=file:///usr/share/fwupd/remotes.d/vendor/fwupd-tests.xml
FirmwareBaseURI=https://storage.googleapis.com/chromeos-localmirror/lvfs/test/
ApprovalRequired=false
EOF