Skip to content
Snippets Groups Projects
Commit c54cc88c authored by Zygmunt Krynicki's avatar Zygmunt Krynicki
Browse files

ota: add Raspberry Pi override fields


The override fields can be placed in the [Raspberry Pi] section inside
the systoad.conf file. They are designed to enable testing of the piboot
package with spread-like integration tests on hardware other than the
Raspberry Pi.

The documentation is updated but there is no code using the new fields
yet.

Signed-off-by: default avatarZygmunt Krynicki <zygmunt.krynicki@huawei.com>
parent 632366f0
No related branches found
No related tags found
No related merge requests found
.\" SPDX-License-Identifier: Apache-2.0 .\" SPDX-License-Identifier: Apache-2.0
.\" SPDX-FileCopyrightText: Huawei Inc. .\" SPDX-FileCopyrightText: Huawei Inc.
.Dd Jun 18, 2021 .Dd Aug 20, 2021
.Os @PROJECT_NAME@ @PROJECT_VERSION@ .Os @PROJECT_NAME@ @PROJECT_VERSION@
.Dt sysotad.conf 5 PRM .Dt sysotad.conf 5 PRM
.Sh NAME .Sh NAME
...@@ -40,7 +40,7 @@ As files are loaded, settings are stored into the configuration object are ...@@ -40,7 +40,7 @@ As files are loaded, settings are stored into the configuration object are
overwritten by newer definitions. Care must be taken to define a consistent overwritten by newer definitions. Care must be taken to define a consistent
set. set.
.Sh OPTIONS .Sh OPTIONS
All options are configured in the [OTA] section: The following options are configured in the [OTA] section:
.Ss BootLoaderType= .Ss BootLoaderType=
.Rs .Rs
Identifies the type of the boot loader the OTA service will configure and Identifies the type of the boot loader the OTA service will configure and
...@@ -56,3 +56,25 @@ the ...@@ -56,3 +56,25 @@ the
.Em config.txt .Em config.txt
file. file.
.Re .Re
.Pp
The following options are configured in the [Raspberry Pi] section:
.Ss OverrideRevisionCode=
.Rs
Overrides the Raspberry Pi revision code that is otherwise probed from
.Em /proc/cpuinfo .
This property is only designed for tests and may be limited to debug builds in
the future. The value is only used when
.Em OverrideSerialNumber=
is not zero. When the override mechanism is enabled then /proc/cpuinfo is not
scanned at all.
.Re
.Ss OverrideSerialNumber=
.Rs
Overrides the Raspberry Pi serial number that is otherwise probed from
.Em /proc/cpuinfo .
This property is only designed for tests and may be limited to debug builds in
the future. The value is only used when
.Em OverrideRevisionCode=
is not zero. When the override mechanism is enabled then /proc/cpuinfo is not
scanned at all.
.Re
...@@ -10,6 +10,7 @@ import ( ...@@ -10,6 +10,7 @@ import (
"os" "os"
"git.ostc-eu.org/OSTC/OHOS/components/sysota/encoding/ini" "git.ostc-eu.org/OSTC/OHOS/components/sysota/encoding/ini"
"git.ostc-eu.org/OSTC/OHOS/components/sysota/picfg/pimodel"
) )
// TODO: add marshalable server response types here. // TODO: add marshalable server response types here.
...@@ -84,6 +85,18 @@ type Config struct { ...@@ -84,6 +85,18 @@ type Config struct {
// "/boot" or a sub-directory, such as "/boot/firmware", depending on the // "/boot" or a sub-directory, such as "/boot/firmware", depending on the
// platform. // platform.
BootPartitionMountDir string `ini:"BootPartitionMountDir,omitempty"` BootPartitionMountDir string `ini:"BootPartitionMountDir,omitempty"`
// Specific to the Raspberry Pi boot loader.
// OverrideRevisionCode overrides automatically probed Raspberry Pi revision
// code. This feature is meant for testing. It is only effective when
// coupled with OverrideSerialNumber.
OverrideRevisionCode pimodel.RevisionCode `ini:"OverrideRevisionCode,[Raspberry Pi],omitempty"`
// OverrideSerialNumber overrides automatically probed Raspberry Pi serial
// number. This feature is meant for testing. It is only effective when
// coupled with OverrideRevisionCode.
OverrideSerialNumber pimodel.SerialNumber `ini:"OverrideSerialNumber,omitempty"`
} }
// DefaultConfigFiles returns sysotad configuration files loaded on startup. // DefaultConfigFiles returns sysotad configuration files loaded on startup.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment