genode/repos/gems/src/app/depot_download_manager/gen_verify.cc
Norman Feske ac68073ffc depot_download: support downloading index files
With this commit, the 'installation' input of the depot-download
subsystem accepts <index> nodes in addition to <archive> nodes. Each
index node refers to one index file specified via the 'path' attribute.

This commit also improves the tracking of failure states. Once an
installation job failed (due to a download of verification error),
it won't get re-scheduled. In the past, such failure states were not kept
across subsequent import iterations, which could result in infinite
re-attempts when an installation contained archives from multiple users.
The the progress of the download process is now reflected by the
"progress" attribute on the download manager's state report, which
allows the final report to contain the list of installed/failed archives
along with the overall progress/completed state. The detection of the
latter is important for the sculpt manager for reattempting the
deployment of the completed packages.

The patch enhances the depot_download.run script to stress the new
abilities. In particular, the scenario downloads a mix of index files
(one present, one missing) and archives, from two different depot users
(genodelabs and nfeske).

Issue #3172
2019-02-28 11:34:06 +01:00

86 lines
2.5 KiB
C++

/*
* \brief XML configuration for the verify tool
* \author Norman Feske
* \date 2017-12-08
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#include "xml.h"
void Depot_download_manager::gen_verify_start_content(Xml_generator &xml,
Import const &import,
Path const &user_path)
{
gen_common_start_content(xml, "verify",
Cap_quota{200}, Ram_quota{12*1024*1024});
xml.node("config", [&] () {
xml.attribute("verbose", "yes");
xml.node("libc", [&] () {
xml.attribute("stdout", "/dev/null");
xml.attribute("stderr", "/dev/null");
xml.attribute("rtc", "/dev/null");
});
xml.node("vfs", [&] () {
xml.node("dir", [&] () {
xml.attribute("name", "public");
xml.node("fs", [&] () { xml.attribute("label", "public"); });
});
xml.node("dir", [&] () {
xml.attribute("name", "depot");
xml.node("fs", [&] () { xml.attribute("label", "depot"); });
});
xml.node("dir", [&] () {
xml.attribute("name", "dev");
xml.node("log", [&] () { });
xml.node("null", [&] () { });
});
});
import.for_each_unverified_archive([&] (Archive::Path const &path) {
typedef String<160> Path;
Path const file_path ("/public/", Archive::download_file_path(path));
Path const pubkey_path (user_path, "/pubkey");
xml.node("verify", [&] () {
xml.attribute("path", file_path);
xml.attribute("pubkey", pubkey_path);
});
});
});
xml.node("route", [&] () {
xml.node("service", [&] () {
xml.attribute("name", File_system::Session::service_name());
xml.attribute("label", "public");
xml.node("parent", [&] () {
xml.attribute("label", "public"); });
});
xml.node("service", [&] () {
xml.attribute("name", File_system::Session::service_name());
xml.attribute("label", "depot");
xml.node("parent", [&] () {
xml.attribute("label", "depot"); });
});
gen_parent_unscoped_rom_route(xml, "verify");
gen_parent_unscoped_rom_route(xml, "ld.lib.so");
gen_parent_rom_route(xml, "libc.lib.so");
gen_parent_rom_route(xml, "libm.lib.so");
gen_parent_rom_route(xml, "vfs.lib.so");
gen_parent_route<Cpu_session> (xml);
gen_parent_route<Pd_session> (xml);
gen_parent_route<Log_session> (xml);
gen_parent_route<Report::Session>(xml);
});
}