GithubHelp home page GithubHelp logo

foundriesio / aktualizr-lite Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 18.0 1.8 MB

The Foundries.io update agent based on libaktualizr

Home Page: https://docs.foundries.io/latest/reference-manual/ota/aktualizr-lite.html

License: Mozilla Public License 2.0

CMake 2.58% Shell 1.07% C++ 92.76% Python 2.87% Dockerfile 0.37% Makefile 0.36%

aktualizr-lite's People

Contributors

detsch avatar doanac avatar hadatko avatar igoropaniuk avatar kprosise avatar ldts avatar mike-scott avatar mike-sul avatar mwasilew avatar pattivacek avatar quaresmajose avatar ricardosalveti avatar tim-anderson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aktualizr-lite's Issues

Weirdness in reading docker-compose.yml

As per:

bool ComposeApp::isRunning() {
bool cmd_res{false};
std::string cmd_output;
std::tie(cmd_res, cmd_output) = cmd("cat " + (root_ / ComposeFile).string());
if (!cmd_res) {
LOG_WARNING << "Failed to parse App config: " << name_;
return false;
}
// calculate a number of container images that a given App consists of
std::string::size_type find_pos{0};
std::string::size_type line_pos{0};
int expected_container_number{0};
while ((find_pos = cmd_output.find("image:", line_pos)) != std::string::npos) {

It seems odd we are fork/exec cat to read the content of a file.

Additionally, I've been playing some recently with yaml-cpp. Its actually pretty easy to integrate as submodule and hook up with CMake. I think this is probably worth the effort so that we can be more precise.

fw_printenv can't read variables after running aklite-offline

Here is an example:

root@imx93-11x11-lpddr4x-evk-d086e3d86c494489b2a546aacb74c21f:/var/rootdirs/home/fio# fw_printenv bootcount
bootcount=0
root@imx93-11x11-lpddr4x-evk-d086e3d86c494489b2a546aacb74c21f:/var/rootdirs/home/fio# fw_printenv bootfirmware_version
bootfirmware_version=84f1cd6cc7f5be0ab2456c260890ef5a
root@imx93-11x11-lpddr4x-evk-d086e3d86c494489b2a546aacb74c21f:/var/rootdirs/home/fio# lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda            8:0    1  14.9G  0 disk 
`-sda1         8:1    1  14.9G  0 part 
mmcblk0      179:0    0  14.7G  0 disk 
|-mmcblk0p1  179:1    0 166.4M  0 part /var/rootdirs/mnt/boot
`-mmcblk0p2  179:2    0  14.5G  0 part /var
                                       /usr
                                       /boot
                                       /
                                       /sysroot
mmcblk0boot0 179:32   0     4M  1 disk 
mmcblk0boot1 179:64   0     4M  1 disk 
zram0        252:0    0   1.9G  0 disk [SWAP]
root@imx93-11x11-lpddr4x-evk-d086e3d86c494489b2a546aacb74c21f:/var/rootdirs/home/fio# mount /dev/sda1 /mnt
[   88.346855] EXT4-fs (sda1): mounting ext2 file system using the ext4 subsystem
[   88.365247] EXT4-fs (sda1): mounted filesystem without journal. Quota mode: disabled.
root@imx93-11x11-lpddr4x-evk-d086e3d86c494489b2a546aacb74c21f:/var/rootdirs/home/fio# ls /mnt
lost+found  ostree_repo  tuf
	root@imx93-11x11-lpddr4x-evk-d086e3d86c494489b2a546aacb74c21f:/var/rootdirs/home/fio# 
root@imx93-11x11-lpddr4x-evk-d086e3d86c494489b2a546aacb74c21f:/var/rootdirs/home/fio# 
root@imx93-11x11-lpddr4x-evk-d086e3d86c494489b2a546aacb74c21f:/var/rootdirs/home/fio# aklite-offline install --log-level 1 --src-dir /mnt
   info: Reading config: "/usr/lib/sota/conf.d/30-rollback.toml"
   info: Reading config: "/usr/lib/sota/conf.d/40-hardware-id.toml"
   info: Reading config: "/usr/lib/sota/conf.d/46-pkcs11-label.toml"
   info: Reading config: "/etc/sota/conf.d/z-99-aklite-callback.toml"
   info: Use existing SQL storage: "/var/sota/sql.db"
Configuration file wrong or corrupted
warning: Failed resetting bootcount
Configuration file wrong or corrupted
warning: Failed resetting upgrade_available for u-boot
   info: Importing root metadata from a local file system...
   info: Successfully imported root role metadata from "/usr/lib/sota/tuf/ci"
  error: Signature verification for Root metadata failed: The root metadata had an unmet threshold.
  error: Failed to update Image repo metadata: The root metadata had an unmet threshold.
Failed to install the offline update; src-dir: "/var/rootdirs/mnt"; err: Failed to pull TUF metadata: The root metadata had an unmet threshold.root@imx93-11x11-lpddr4x-evk-d086e3d86c494489b2a546aacb74c21f:/var/rootdirs/home/fio# 
root@imx93-11x11-lpddr4x-evk-d086e3d86c494489b2a546aacb74c21f:/var/rootdirs/home/fio# 
root@imx93-11x11-lpddr4x-evk-d086e3d86c494489b2a546aacb74c21f:/var/rootdirs/home/fio# fw_printenv bootcount
Configuration file wrong or corrupted
root@imx93-11x11-lpddr4x-evk-d086e3d86c494489b2a546aacb74c21f:/var/rootdirs/home/fio# 

Even though aklite-offline didn't do anything the u-boot env got "corrupted". Reboot fixes the issue. I'll try to debug a bit more.

config log dump has some things backwards

Saw this on a device I'm testing (with the server redacted):

[pacman]
type = "ostree+compose_apps"
os = ""
sysroot = ""
ostree_server = "[xxx]"
packages_file = "/usr/package.manifest"
fake_need_reboot = false
/var/sota/compose-apps = "compose_apps_root"
master = "tags"

This is from the log dump that happens when you run with loglevel 0. Notice anything funny? :) It's only the extra bits that aktualizr-lite adds that are backwards, so it looks like a bug here, but it could still somehow be in libaktualizr, I don't know.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.