updater merge requestshttps://gitlab.nic.cz/turris/updater/updater/-/merge_requests2021-06-16T17:21:02+02:00https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/289Draft: lib/uri_lua: append download error message on download fail2021-06-16T17:21:02+02:00Karel KociDraft: lib/uri_lua: append download error message on download failThe download error reported on URI finish was handled by else branch
that only printed the error that download failed. This reaches to the downloader
for an error message in case of download fail. This should expand info
available to use...The download error reported on URI finish was handled by else branch
that only printed the error that download failed. This reaches to the downloader
for an error message in case of download fail. This should expand info
available to users on download fail.
This should give us a little bit more info for turris/os/updater-lists#1.https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/287Change how requests are resolved to have strict order2021-04-15T15:26:56+02:00Karel KociChange how requests are resolved to have strict orderThe original implementation tries to satisfy maximum number of requests
in given priority level. This has been seen as ideal solution because
this way most of the user's requests are satisfied.
This changes this behavior to rather be str...The original implementation tries to satisfy maximum number of requests
in given priority level. This has been seen as ideal solution because
this way most of the user's requests are satisfied.
This changes this behavior to rather be strictly defined. This means
that we do not care about number of requests satisfied. We care only
about priority of request and satisfy them in order.
This also removes error raised when there was Install and Uninstall
request for same package with same priority. Now Install request is
simply preferred.
This was required because of conditions. The demonstration of this issue
can be done on two packages. Let's have package 'a' and 'b'. There are
three requests of same priority:
* To install 'a'
* To unistall 'b'
* To install 'b' with condition 'a'
The intuitive resolution is that user clearly wants to install 'a' and
not to have 'b'. The third request need not apply as there is more
accurate request to not have 'b'.
The original implementation tries to solve this by maximizing number of
satisfied requests. This has three solution, which is on its own pretty
problematic. The first solution is the intuitive one. Second solution is
to install 'a' as well as 'b'. But the third solution is to not install
any package. This is because third request can be satisfied either by
installing 'b' or by not installing 'a'. All of these solutions are
equivalent in solvers conditions as they all result in only one of the
requests to not be satisfied, thus we have no direct way to hint solver
what to do. What is even worst we even don't know what should be the
correct solution without defining additional resolution rules.
Using the new algorithm the solution for problematic request combination
is simply that we order them using our new defined rules, that is also
the order they are ordered in example. Now we take and resolve one
request at the time. We can clearly satisfy installation of 'a' and thus
first request. We can also satisfy not-installation of 'b' and thus
second request. The third request now can't be satisfied and thus
resulting in just 'a' installed.
Full order rules are described in documentation. Reasoning for them is
also hinted but to be complete there are also alternative orders we
could choose. The reasoning is as follows:
* We need to resolve critical packages first to make sure that all of
them can be satisfied (so we would not close some combination by
regular requests).
* The user specified priority has to be abided.
* The requests without condition are preferred as they clearly state
what should happen. Conditions can have side effect such as forcing
some specific combination to satisfy given request. This is of course
highly undesirable as condition should control only if request is
satisfied not to influence packages specified in condition. Given the
nature of satisfiability solver this backward injection is just going
to happen so we instead simply prioritize requests that have no such
effect.
* Another major change buried in these changes is that Install and
Uninstall requests for same package no longer raise error. We prefer
Install requests as a choice. The removal of error is because it was
arbitrary anyway. There are simple ways Install and Unistall requests
can be in direct collision without specifying same package name, such
example being if package 'a' depends on 'b' and there is request to
install 'a' and to unistall 'b'.
* The last resort order is order of definition is scripts. In the effect
this is not that important. This affects only requests that have same
priority, same type (install or uninstall) and both have or not have
condition. Such requests effectively want the same thing so they
hopefully should not collide that much in their requests.https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/286Draft: Hotfix/pkg upgrade configure2021-08-20T11:06:35+02:00Karel KociDraft: Hotfix/pkg upgrade configureFixes: turris/updater/updater#316Fixes: turris/updater/updater#316https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/285pkgupdate: fix missing ROOT_DIR in postupdate hook on replan2020-12-08T20:02:43+01:00Karel Kocipkgupdate: fix missing ROOT_DIR in postupdate hook on replanThe previous expectation that ROOT_DIR is already set is true only if
current execution is not reexecution (subsequent execution after replan). In
case of reexecution the ROOT_DIR set is skipped so we have to add it for
postinst as well....The previous expectation that ROOT_DIR is already set is true only if
current execution is not reexecution (subsequent execution after replan). In
case of reexecution the ROOT_DIR set is skipped so we have to add it for
postinst as well.
That applies for both postupdate as well as reboot required hook.
Fixes turris/updater/updater#309 and turris/turris-os-packages#678 (well all those hooks check if `ROOT_DIR` is `/` so if that variable is empty the postupdate is just skipped).Turris OS 5.2.0https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/282src/lib/lua/planner: reinstall package if more than version not match2020-06-24T23:24:03+02:00Karel Kocisrc/lib/lua/planner: reinstall package if more than version not matchThis extends list of fields checked for reinstall to not only Version
but also to Architecture, LinkSignature, Depends, Conflicts, Provides.
There are two reasons why we want to have these:
First reason applies on Architecture, Depends...This extends list of fields checked for reinstall to not only Version
but also to Architecture, LinkSignature, Depends, Conflicts, Provides.
There are two reasons why we want to have these:
First reason applies on Architecture, Depends, Conflicts and Provides.
Those trigger update to get package information in sync with repository.
Updater runs planning against repository so this has no effect but in
the end if someone forgets to bump package but modifies dependencies for
example then we reinstall package anyway.
Second reason to reinstall package applies on LinkSignature and that is
field inserted with hash generated from dynamic linker information
collected for package. When this hash changes then link dependencies
changed and even if version is same we have to reinstall such package as
it most probably won't work with updated dependencies.
As a tinny bonus logs now contain info about version or any other field
if the differ and that way info about the reason to reinstall given
package.
This is tied to https://gitlab.labs.nic.cz/turris/turris-build/-/merge_requests/189
Fixes https://gitlab.labs.nic.cz/turris/turris-build/issues/146
Indirectly potentially fixes https://gitlab.labs.nic.cz/turris/turris-build/issues/154 and https://gitlab.labs.nic.cz/turris/turris-os-packages/issues/417.Turris OS 5.1https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/279lib/updater: fix invalid hash check for SHA2562020-04-21T14:27:29+02:00Karel Kocilib/updater: fix invalid hash check for SHA256This is major problem as packages were not verified thanks to this
error.
This also adds warning for packages not correctly verified.This is major problem as packages were not verified thanks to this
error.
This also adds warning for packages not correctly verified.https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/278Fix invalid hash2020-04-20T15:20:10+02:00Karel KociFix invalid hashThis fixes problem with sha256sum verification not being done because of field with it being ignored because of typo.This fixes problem with sha256sum verification not being done because of field with it being ignored because of typo.https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/271WIP: Conditional requests2020-02-17T16:25:57+01:00Karel KociWIP: Conditional requestsWe need this to support languages and also to install for example fix packages if some package is requested.We need this to support languages and also to install for example fix packages if some package is requested.Turris OS 5.0https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/267lib/autoload/postprocess: replace invalid tab with space2020-01-20T14:51:17+01:00Karel Kocilib/autoload/postprocess: replace invalid tab with spaceThe Provides argument had tab instead of space in regexp and that caused
space to be considered as part of package name. This effectively created
new package with space prepended to name.
Fix https://gitlab.labs.nic.cz/turris/updater/up...The Provides argument had tab instead of space in regexp and that caused
space to be considered as part of package name. This effectively created
new package with space prepended to name.
Fix https://gitlab.labs.nic.cz/turris/updater/updater/issues/290Turris OS 4.0.5https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/265src/lib/interpreter: fix invalid size of args array for lua_subprocess2019-11-06T11:02:16+01:00Karel Kocisrc/lib/interpreter: fix invalid size of args array for lua_subprocessThis also implements one TODO to validate type.This also implements one TODO to validate type.Turris OS 4.0.2https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/263Pkgupdate hooks fix2019-08-26T13:31:45+02:00Karel KociPkgupdate hooks fixThis fixes various problems with updater hooks.
Primarily it should fix: https://gitlab.labs.nic.cz/turris/turris-os-packages/issues/466This fixes various problems with updater hooks.
Primarily it should fix: https://gitlab.labs.nic.cz/turris/turris-os-packages/issues/466https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/260lib: move prerm to be run before postinst in transaction2019-06-13T15:02:03+02:00Karel Kocilib: move prerm to be run before postinst in transactionFixes: #273
This moves execution of prerm script from pkg_scripts step to pkg_move
step. This effectivelly means that prerm and preinst scripts are run in
plan order at the same time. This solves problems where prerm disables
service or...Fixes: #273
This moves execution of prerm script from pkg_scripts step to pkg_move
step. This effectivelly means that prerm and preinst scripts are run in
plan order at the same time. This solves problems where prerm disables
service or in general does operation which revers one done previous
preinst.
There are two consideration required. This code defines content of
journal. The difference is that instead of editing all_configs table in
pkg_scripts we generate it in its fullest in pkg_move. That is all right
and fully compatible. The more problematic case is when we update from
previous version of updater and there is journal stuck with completed
pkg_move step but not yet completed pkg_scripts step. The result is that
in such case prerm scripts are not run and packages are not in reality
removed (removed from state). The real removal happens with next updater
execution. So this is self healing problem that happens only with small
probability.
This also does one degradation in behavior. Previously we were ignoring
removal operation for packages that were intended to be installed. In
that case we just skipped remove section. The problem is that pkg_move
does not have to_install argument and that makes it impossible to check
if operation tries to remove package that is installed by some other
one. The effect of such operation in this new implementation is that we
would run in such case prerm script and removed given package info from
status while preserved its files in system. That is worst case scenario.
Other case where install request comes after remove request returns
given info to state and runs preinst. That effectively just causes us to
run both prerm and preinst where it should have been reinstall. That
effectively should not cause anything bad.
The real reason why we do not care too much is that only case when
something like that happens is when pkgtransaction is used. pkgupdate
never generates two operations for same package. Because pkgtransaction
is dangerous tool in general I don't see it as huge problem.
Other option is to pass to_install table to pkg_move as well but we
would have to take care of situation where this field is not part of
journal.Turris OS 5.1Karel KociKarel Kocihttps://gitlab.nic.cz/turris/updater/updater/-/merge_requests/253Uri2019-05-06T17:47:54+02:00Karel KociUriFixes: #160 #227 #252 #212 #211
Obsoletes: #150Fixes: #160 #227 #252 #212 #211
Obsoletes: #150Turris OS 4.0Boleslav BrezovskyBoleslav Brezovskyhttps://gitlab.nic.cz/turris/updater/updater/-/merge_requests/250Memory ups2019-05-06T17:47:56+02:00Karel KociMemory upsThis patch should make memory usage of updater little bit less.This patch should make memory usage of updater little bit less.Turris OS 4.0Karel KociKarel Kocihttps://gitlab.nic.cz/turris/updater/updater/-/merge_requests/249Expand agent and parse os-release while dropping target board and model and s...2019-05-06T17:47:54+02:00Karel KociExpand agent and parse os-release while dropping target board and model and serialThis drops a lot of variables that should be provided by distribution script and replaces some of them with generalized approach (generic `os-release` file).
This also expands reported curl agent to also contain os version.
Closes...This drops a lot of variables that should be provided by distribution script and replaces some of them with generalized approach (generic `os-release` file).
This also expands reported curl agent to also contain os version.
Closes #256Turris OS 4.0Karel KociKarel Kocihttps://gitlab.nic.cz/turris/updater/updater/-/merge_requests/246svupdater: fix - pyuci expects str, not int2019-05-06T17:47:56+02:00Štěpán Heneksvupdater: fix - pyuci expects str, not intKarel KociKarel Kocihttps://gitlab.nic.cz/turris/updater/updater/-/merge_requests/245Download2019-05-06T17:47:54+02:00Karel KociDownloadNew implementation of downloader. It is now not used but it is going to be used in new URI implementation.New implementation of downloader. It is now not used but it is going to be used in new URI implementation.Turris OS 4.0Karel KociKarel Kocihttps://gitlab.nic.cz/turris/updater/updater/-/merge_requests/226WIP: Supervisor2019-05-06T17:47:58+02:00Karel KociWIP: SupervisorUpdater's supervisor library/program. Intended as a replacement of `updater.sh`.
Solves #244 and #245.Updater's supervisor library/program. Intended as a replacement of `updater.sh`.
Solves #244 and #245.Turris OS 3.10https://gitlab.nic.cz/turris/updater/updater/-/merge_requests/94Fix info files cleanup2019-05-06T17:48:26+02:00Karel KociFix info files cleanupWhen package has name with dot, updater would clean up its info files
every execution, because it expected that package can't have any dot in
name. This is now changed to instead cut everything from first dot to
end to only cut from l...When package has name with dot, updater would clean up its info files
every execution, because it expected that package can't have any dot in
name. This is now changed to instead cut everything from first dot to
end to only cut from last dot to end.Karel KociKarel Kocihttps://gitlab.nic.cz/turris/updater/updater/-/merge_requests/87backend: Install dead symbolic links2020-11-12T02:24:20+01:00Ghost Userbackend: Install dead symbolic linksIf there's a dead symbolic link in between the files to be installed
(because the target has already been installed), then we want to use
lstat to determine the existence of the link, instead of stat (which
would say it doesn't exist). T...If there's a dead symbolic link in between the files to be installed
(because the target has already been installed), then we want to use
lstat to determine the existence of the link, instead of stat (which
would say it doesn't exist). That way the symbolic link is installed as
well.