]> git.e2factory.org Git - e2factory.git/log
e2factory.git
2 years agolicence: allow hashupdate for licence config files
Tobias Ulmer [Tue, 5 Jul 2022 10:46:11 +0000 (12:46 +0200)]
licence: allow hashupdate for licence config files

Signed-off-by: Tobias Ulmer <tu@emlix.com>
2 years agochroot: allow hashupdate for chroot config files
Tobias Ulmer [Tue, 5 Jul 2022 10:39:21 +0000 (12:39 +0200)]
chroot: allow hashupdate for chroot config files

Signed-off-by: Tobias Ulmer <tu@emlix.com>
2 years agoe2tool: file_class: add hashupdate functionality
Tobias Ulmer [Tue, 5 Jul 2022 10:26:39 +0000 (12:26 +0200)]
e2tool: file_class: add hashupdate functionality

This change provides the groundwork for files on servers other than "."
to change and have their sha1/sha256 checksums re-computed on the fly.

It will also invalidate the cached version of the file. If the server
transport has ssh support, it will first attempt to calculate the
checksum remotely, otherwise it will have to re-fetch the file every
time.

If hashupdate is used in conjunction with sha1/sha256, it will work much
like --check-remote option and complain if there is a checksum mismatch.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
2 years agocache: add invalidate() method
Tobias Ulmer [Tue, 28 Jun 2022 08:05:11 +0000 (10:05 +0200)]
cache: add invalidate() method

Signed-off-by: Tobias Ulmer <tu@emlix.com>
2 years agocache: replace assertFlags() with verify_optional_flags() and save a little work
Tobias Ulmer [Mon, 27 Jun 2022 19:07:41 +0000 (21:07 +0200)]
cache: replace assertFlags() with verify_optional_flags() and save a little work

Signed-off-by: Tobias Ulmer <tu@emlix.com>
2 years agoe2.conf.5: fix path in /etc
Rolf Eike Beer [Tue, 24 Mar 2020 10:25:48 +0000 (11:25 +0100)]
e2.conf.5: fix path in /etc

Spotted by Friedrich.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
3 years agocreate next changelog entry
Tobias Ulmer [Mon, 10 Jan 2022 13:00:25 +0000 (14:00 +0100)]
create next changelog entry

Signed-off-by: Tobias Ulmer <tu@emlix.com>
3 years agorelease e2factory-2.3.18p0 e2factory-2.3.18p0
Tobias Ulmer [Mon, 10 Jan 2022 13:00:25 +0000 (14:00 +0100)]
release e2factory-2.3.18p0

Signed-off-by: Tobias Ulmer <tu@emlix.com>
3 years agoe2lib: glibc-2.34 added closefrom() creating a collision
Tobias Ulmer [Fri, 7 Jan 2022 12:12:04 +0000 (13:12 +0100)]
e2lib: glibc-2.34 added closefrom() creating a collision

Rename our closefrom to do_closefrom.

We should switch to glibc closefrom once it's well established.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agocreate next changelog entry
Tobias Ulmer [Fri, 5 Jul 2019 17:13:21 +0000 (19:13 +0200)]
create next changelog entry

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agorelease e2factory-2.3.18 e2factory-2.3.18
Tobias Ulmer [Fri, 5 Jul 2019 17:13:21 +0000 (19:13 +0200)]
release e2factory-2.3.18

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agochangelog
Tobias Ulmer [Fri, 5 Jul 2019 17:12:56 +0000 (19:12 +0200)]
changelog

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agocreate next changelog entry
Tobias Ulmer [Wed, 3 Jul 2019 12:39:36 +0000 (14:39 +0200)]
create next changelog entry

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agorelease e2factory-2.3.18rc4 e2factory-2.3.18rc4
Tobias Ulmer [Wed, 3 Jul 2019 12:39:36 +0000 (14:39 +0200)]
release e2factory-2.3.18rc4

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoe2build: pty use breaks fg session signal handling, revert
Tobias Ulmer [Wed, 3 Jul 2019 12:30:11 +0000 (14:30 +0200)]
e2build: pty use breaks fg session signal handling, revert

Signal handling involving a pty and a foreground process inside the
chroot turns out to be very tricky. Having the ability to terminate suid
e2-su and also send eg. ^C to a vim inside doesn't appear to be
documented much. There are a few hints in sudo and related MLs.

Since it's more important to interact with applications in playground
than being able to reliably terminate e2-su, opt for a non-pty
controlled playground environment for the time being.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoenvironment: bugfix for set() and iter()
Tobias Ulmer [Wed, 26 Jun 2019 15:51:44 +0000 (17:51 +0200)]
environment: bugfix for set() and iter()

Both problems behaved in a deterministic way and didn't produce
problematic EnvID changes

set() failed on duplicate vars, inserting the same var more than once
into the sorted table

iter() was using next(), which is not guaranteed to follow the table
in numerical order

Unit tests have been added for this issue.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoplugin: deinitialize plugins in reverse order
Tobias Ulmer [Wed, 26 Jun 2019 15:50:14 +0000 (17:50 +0200)]
plugin: deinitialize plugins in reverse order

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoe2tool: provide antagonist for init_project()
Tobias Ulmer [Wed, 26 Jun 2019 15:08:19 +0000 (17:08 +0200)]
e2tool: provide antagonist for init_project()

Used in unittest.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoplugins: unload resources on plugin exit
Tobias Ulmer [Wed, 26 Jun 2019 15:03:30 +0000 (17:03 +0200)]
plugins: unload resources on plugin exit

Currently this is only exercised by some unittests. It is one tiny step
towards reloading a project without exiting e2factory.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agocollect_project: remove_source_to_result_fn() to undo registration
Tobias Ulmer [Wed, 26 Jun 2019 15:02:19 +0000 (17:02 +0200)]
collect_project: remove_source_to_result_fn() to undo registration

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoresult: provide deregister_result_class() to unload plugins
Tobias Ulmer [Wed, 26 Jun 2019 14:58:39 +0000 (16:58 +0200)]
result: provide deregister_result_class() to unload plugins

also deregister_type_detection()

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agosource: provide deregister_source_class() for unloading plugins
Tobias Ulmer [Wed, 26 Jun 2019 14:56:25 +0000 (16:56 +0200)]
source: provide deregister_source_class() for unloading plugins

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoerr: add tostring() support and allocate metatable only once
Tobias Ulmer [Wed, 26 Jun 2019 14:55:16 +0000 (16:55 +0200)]
err: add tostring() support and allocate metatable only once

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoattempt to shut down children
Tobias Ulmer [Mon, 3 Jun 2019 17:34:15 +0000 (19:34 +0200)]
attempt to shut down children

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agobe more responsive and frequently check for signals
Tobias Ulmer [Mon, 3 Jun 2019 17:30:32 +0000 (19:30 +0200)]
be more responsive and frequently check for signals

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agogit: correct test for rawsrc.checkout
Tobias Ulmer [Fri, 24 May 2019 12:15:08 +0000 (14:15 +0200)]
git: correct test for rawsrc.checkout

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agocreate next changelog entry
Tobias Ulmer [Mon, 20 May 2019 17:27:00 +0000 (19:27 +0200)]
create next changelog entry

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agorelease e2factory-2.3.18rc3 e2factory-2.3.18rc3
Tobias Ulmer [Mon, 20 May 2019 17:27:00 +0000 (19:27 +0200)]
release e2factory-2.3.18rc3

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoe2-new-source: fix and improve upload new file check
Tobias Ulmer [Mon, 20 May 2019 17:26:32 +0000 (19:26 +0200)]
e2-new-source: fix and improve upload new file check

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoe2lib: typo
Tobias Ulmer [Fri, 17 May 2019 14:03:56 +0000 (16:03 +0200)]
e2lib: typo

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agogit: work around git archive picking up information from CWD
Tobias Ulmer [Fri, 17 May 2019 14:01:48 +0000 (16:01 +0200)]
git: work around git archive picking up information from CWD

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoe2lib: fix debug log format
Tobias Ulmer [Thu, 9 May 2019 17:14:48 +0000 (19:14 +0200)]
e2lib: fix debug log format

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agocreate next changelog entry
Tobias Ulmer [Thu, 9 May 2019 15:11:50 +0000 (17:11 +0200)]
create next changelog entry

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agorelease e2factory-2.3.18rc2 e2factory-2.3.18rc2
Tobias Ulmer [Thu, 9 May 2019 15:11:50 +0000 (17:11 +0200)]
release e2factory-2.3.18rc2

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoe2lib: disable the very noisy poll loop for release
Tobias Ulmer [Thu, 9 May 2019 15:11:09 +0000 (17:11 +0200)]
e2lib: disable the very noisy poll loop for release

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agogit: fix git archive | tar pipe calling sequence
Tobias Ulmer [Thu, 9 May 2019 14:35:37 +0000 (16:35 +0200)]
git: fix git archive | tar pipe calling sequence

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoe2lib: split callcmd() further to allow for external poll loop
Tobias Ulmer [Thu, 9 May 2019 14:29:12 +0000 (16:29 +0200)]
e2lib: split callcmd() further to allow for external poll loop

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoremove some excessive logging
Tobias Ulmer [Thu, 9 May 2019 14:27:02 +0000 (16:27 +0200)]
remove some excessive logging

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agogit: fix spaces in warning message
Tobias Ulmer [Tue, 7 May 2019 16:50:12 +0000 (18:50 +0200)]
git: fix spaces in warning message

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agoe2build: do not re-create last link pointing to the same dir
Tobias Ulmer [Tue, 7 May 2019 16:49:16 +0000 (18:49 +0200)]
e2build: do not re-create last link pointing to the same dir

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agocreate next changelog entry
Tobias Ulmer [Fri, 3 May 2019 17:50:50 +0000 (19:50 +0200)]
create next changelog entry

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agorelease e2factory-2.3.18rc1 e2factory-2.3.18rc1
Tobias Ulmer [Fri, 3 May 2019 17:50:50 +0000 (19:50 +0200)]
release e2factory-2.3.18rc1

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agogit: improve fetch-sources --update handling of different repo states
Tobias Ulmer [Fri, 3 May 2019 17:47:35 +0000 (19:47 +0200)]
git: improve fetch-sources --update handling of different repo states

This should fix several failing corner cases and also handles the new
no-local-branch state of the repository.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agogit: tolerate improper configuration of source for development
Tobias Ulmer [Fri, 3 May 2019 17:38:08 +0000 (19:38 +0200)]
git: tolerate improper configuration of source for development

Often one wants to create a git repo and start doing some explorative
work without setting up the repository on the server.

Allow this by downgrading the error messages to very loud warnings. Will
still fail to build in release mode.

Due to design limitations, multiple warnings may appear, but this might
be considered a good thing by some.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agogit: use policy module to reliably access flags
Tobias Ulmer [Fri, 3 May 2019 17:35:35 +0000 (19:35 +0200)]
git: use policy module to reliably access flags

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agogit: missed variable declaration in _check_git_remote()
Tobias Ulmer [Fri, 3 May 2019 17:32:22 +0000 (19:32 +0200)]
git: missed variable declaration in _check_git_remote()

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agogit: optionally skip workdir checkout
Tobias Ulmer [Fri, 3 May 2019 17:20:16 +0000 (19:20 +0200)]
git: optionally skip workdir checkout

Skips workdir checkout on git clone, like in older versions of
e2factory.  This may help to speed up fetch-sources of very large repos
and reduces disk space requirements in some scenarios (CI).

It's currently not documented and may go away. For one, configuring it
via the source config is a little awkward.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
5 years agogit: commitid and empty branch are not yet ready
Tobias Ulmer [Fri, 3 May 2019 17:16:50 +0000 (19:16 +0200)]
git: commitid and empty branch are not yet ready

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agonew-source: fix assertion and set up default build-mode
Tobias Ulmer [Thu, 25 Apr 2019 16:31:29 +0000 (18:31 +0200)]
new-source: fix assertion and set up default build-mode

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agofetch-sources: more consistent logging
Tobias Ulmer [Wed, 24 Apr 2019 16:54:55 +0000 (18:54 +0200)]
fetch-sources: more consistent logging

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2tool: access command line options more safely
Tobias Ulmer [Wed, 24 Apr 2019 16:52:42 +0000 (18:52 +0200)]
e2tool: access command line options more safely

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agopolicy: wrappers to access command line options
Tobias Ulmer [Wed, 24 Apr 2019 16:52:22 +0000 (18:52 +0200)]
policy: wrappers to access command line options

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogeneric_git.current_branch: fix output
Tobias Ulmer [Wed, 10 Apr 2019 17:24:14 +0000 (19:24 +0200)]
generic_git.current_branch: fix output

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogit: _check_git_remote: don't fail with unrelated msg if remote doesn't exist
Tobias Ulmer [Tue, 9 Apr 2019 14:15:05 +0000 (16:15 +0200)]
git: _check_git_remote: don't fail with unrelated msg if remote doesn't exist

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogeneric_git: new git_config_table() returns all settings in a dictionary
Tobias Ulmer [Tue, 9 Apr 2019 14:05:50 +0000 (16:05 +0200)]
generic_git: new git_config_table() returns all settings in a dictionary

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogeneric_git: add current_branch()
Tobias Ulmer [Tue, 9 Apr 2019 14:04:40 +0000 (16:04 +0200)]
generic_git: add current_branch()

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: misuse of warnf() should trigger an assertion
Tobias Ulmer [Tue, 9 Apr 2019 14:01:27 +0000 (16:01 +0200)]
e2lib: misuse of warnf() should trigger an assertion

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: add experimental support for loading .e2/e2.conf.local
Tobias Ulmer [Wed, 20 Mar 2019 16:42:04 +0000 (17:42 +0100)]
e2lib: add experimental support for loading .e2/e2.conf.local

config {} entries in this file will be merged into the regular e2.conf
rmconfig {} entries set to true will be removed from e2.conf

If --e2-config is given, e2.conf.local will not be loaded.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: support e2.conf config.site.tmpdir setting and E2_TMPDIR
Tobias Ulmer [Tue, 19 Mar 2019 16:38:42 +0000 (17:38 +0100)]
e2lib: support e2.conf config.site.tmpdir setting and E2_TMPDIR

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: improve verification of e2.conf some more
Tobias Ulmer [Mon, 18 Mar 2019 19:51:49 +0000 (20:51 +0100)]
e2lib: improve verification of e2.conf some more

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: improve e2.conf verification
Tobias Ulmer [Fri, 15 Mar 2019 17:20:54 +0000 (18:20 +0100)]
e2lib: improve e2.conf verification

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogit: if branch does not exists, use the remotes branch
Tobias Ulmer [Mon, 4 Mar 2019 15:48:09 +0000 (16:48 +0100)]
git: if branch does not exists, use the remotes branch

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoadjust to generic_git.list_refs changes
Tobias Ulmer [Wed, 6 Mar 2019 18:15:37 +0000 (19:15 +0100)]
adjust to generic_git.list_refs changes

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogeneric_git: try to disambiguate "remote" and be more explicit
Tobias Ulmer [Wed, 6 Mar 2019 18:07:58 +0000 (19:07 +0100)]
generic_git: try to disambiguate "remote" and be more explicit

While "origin" can sometimes be part of a ref, it's not a ref. Don't
pretend otherwise.
Attempt to make it more obvious when we're connecting to a remote repo
vs. working on the local repo.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogeneric_git: add git_url_cache to turn server:location into git url
Tobias Ulmer [Wed, 6 Mar 2019 18:03:10 +0000 (19:03 +0100)]
generic_git: add git_url_cache to turn server:location into git url

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2build: log build step
Tobias Ulmer [Mon, 4 Mar 2019 15:21:33 +0000 (16:21 +0100)]
e2build: log build step

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogeneric_git: use arg instead of reinventing the wheel
Tobias Ulmer [Fri, 1 Mar 2019 16:24:00 +0000 (17:24 +0100)]
generic_git: use arg instead of reinventing the wheel

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogeneric_git: sprinkle some asserts
Tobias Ulmer [Fri, 1 Mar 2019 16:23:28 +0000 (17:23 +0100)]
generic_git: sprinkle some asserts

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoassrt: return important arguments similar to assert()
Tobias Ulmer [Fri, 1 Mar 2019 16:15:29 +0000 (17:15 +0100)]
assrt: return important arguments similar to assert()

assert() returns all argument, which is easy to do with the C interface
but complicates the Lua code. It also doesn't seem all that useful.

Instead we return the primary argument(s) only.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agouse generic_git helper functions
Tobias Ulmer [Thu, 28 Feb 2019 19:14:17 +0000 (20:14 +0100)]
use generic_git helper functions

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogeneric_git: make list_refs() a public interface
Tobias Ulmer [Thu, 28 Feb 2019 18:58:46 +0000 (19:58 +0100)]
generic_git: make list_refs() a public interface

Optionally takes a git remote string instead of the default "origin"

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogit: write git archive error messages to debug.log
Tobias Ulmer [Thu, 28 Feb 2019 18:39:33 +0000 (19:39 +0100)]
git: write git archive error messages to debug.log

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogit: include source name in error message
Tobias Ulmer [Thu, 28 Feb 2019 18:34:15 +0000 (19:34 +0100)]
git: include source name in error message

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: wait: fix log message on EINTR
Tobias Ulmer [Wed, 20 Feb 2019 16:10:12 +0000 (17:10 +0100)]
e2lib: wait: fix log message on EINTR

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2build: for interactive playground use, setup standard file descriptors
Tobias Ulmer [Mon, 18 Feb 2019 18:32:46 +0000 (19:32 +0100)]
e2build: for interactive playground use, setup standard file descriptors

Because we request a pty for signaling purposes, interactive use of the
shell isn't possible. To enable interactive use, duplicate the standard
descriptors of the parent and set them up in the child which will end
up being bash.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2build: use e2lib.get_tool_flags_argv_e2_su_2_2
Tobias Ulmer [Mon, 18 Feb 2019 18:31:48 +0000 (19:31 +0100)]
e2build: use e2lib.get_tool_flags_argv_e2_su_2_2

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: e2_su_2_2 factor out tool command construction
Tobias Ulmer [Mon, 18 Feb 2019 18:26:03 +0000 (19:26 +0100)]
e2lib: e2_su_2_2 factor out tool command construction

e2lib.get_tool_flags_argv_e2_su_2_2 is now used to return the various
possible combinations of e2-su-2.2 calls, ready for arguments to be
inserted.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: extend call_tool_argv to return exit code of tool
Tobias Ulmer [Mon, 18 Feb 2019 18:23:47 +0000 (19:23 +0100)]
e2lib: extend call_tool_argv to return exit code of tool

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoeio: implement dup()
Tobias Ulmer [Mon, 18 Feb 2019 17:03:15 +0000 (18:03 +0100)]
eio: implement dup()

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agogit: use appropriate wait wrapper
Tobias Ulmer [Fri, 15 Feb 2019 11:20:00 +0000 (12:20 +0100)]
git: use appropriate wait wrapper

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agocall e2-su-2.2 and sudo with pty=true
Tobias Ulmer [Fri, 15 Feb 2019 11:07:31 +0000 (12:07 +0100)]
call e2-su-2.2 and sudo with pty=true

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2tool: disable write buffering for debug.log
Tobias Ulmer [Fri, 15 Feb 2019 11:05:05 +0000 (12:05 +0100)]
e2tool: disable write buffering for debug.log

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2: install signal handler and dispose our subprocess
Tobias Ulmer [Fri, 15 Feb 2019 11:03:53 +0000 (12:03 +0100)]
e2: install signal handler and dispose our subprocess

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: callcmd: add argument to run command under a pseudo tty
Tobias Ulmer [Fri, 15 Feb 2019 10:53:40 +0000 (11:53 +0100)]
e2lib: callcmd: add argument to run command under a pseudo tty

Running under a pseudo tty allows using the TIOCSIG ioctl to terminate
non-user owned processes, in particular setuid programs like e2-su or
sudo.

Various improvements around signal handling during forking, with better
error handling and reporting.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: finish: if we received a signal, exit with the signal code
Tobias Ulmer [Fri, 15 Feb 2019 10:42:08 +0000 (11:42 +0100)]
e2lib: finish: if we received a signal, exit with the signal code

Receiving a signal causes subsequent errors which hide the true cause
for termination. Make sure we always exit with 128 + signalno and let
the user know that above errors were caused by a signal.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: interrupt_hook: send interrupt to children
Tobias Ulmer [Fri, 15 Feb 2019 10:38:28 +0000 (11:38 +0100)]
e2lib: interrupt_hook: send interrupt to children

note interrupt_hook() no longer terminates e2factory

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: add children_.. functions to track and terminate sub processes
Tobias Ulmer [Fri, 15 Feb 2019 10:27:04 +0000 (11:27 +0100)]
e2lib: add children_.. functions to track and terminate sub processes

If a child process has an associated pseudo terminal, it's terminated
via TIOCSIG ioctl, otherwise the standard kill() function is used.

Allows us to interrupt root-owned children (eg e2-su, sudo, ...)

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: support waitpid WNOHANG with wait(pid, true)
Tobias Ulmer [Fri, 15 Feb 2019 10:10:45 +0000 (11:10 +0100)]
e2lib: support waitpid WNOHANG with wait(pid, true)

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoMakefile: link against libutil, required by forkpty()
Tobias Ulmer [Wed, 13 Feb 2019 19:01:37 +0000 (20:01 +0100)]
Makefile: link against libutil, required by forkpty()

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoassrt: pass optional message to assert()
Tobias Ulmer [Wed, 13 Feb 2019 18:42:37 +0000 (19:42 +0100)]
assrt: pass optional message to assert()

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: close unused sync pipe ends before reading from child
Tobias Ulmer [Wed, 13 Feb 2019 18:24:56 +0000 (19:24 +0100)]
e2lib: close unused sync pipe ends before reading from child

Otherwise we could end up in a situation where we wait for a faulty
child, but hang reading our own pipe.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: handle read EINTR in poll loop
Tobias Ulmer [Wed, 13 Feb 2019 17:50:12 +0000 (18:50 +0100)]
e2lib: handle read EINTR in poll loop

Maybe eio.read() should generally loop on EINTR?

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: rename: don't shadow the errno module
Tobias Ulmer [Wed, 13 Feb 2019 17:48:53 +0000 (18:48 +0100)]
e2lib: rename: don't shadow the errno module

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: wait: format log message
Tobias Ulmer [Wed, 13 Feb 2019 17:45:36 +0000 (18:45 +0100)]
e2lib: wait: format log message

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: handle EINTR in poll() and wait()
Tobias Ulmer [Wed, 13 Feb 2019 14:11:11 +0000 (15:11 +0100)]
e2lib: handle EINTR in poll() and wait()

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agotransport: rename file instead of calling mv
Tobias Ulmer [Wed, 13 Feb 2019 13:55:17 +0000 (14:55 +0100)]
transport: rename file instead of calling mv

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agole2lib: block other signals during signal handler execution
Tobias Ulmer [Tue, 12 Feb 2019 18:55:07 +0000 (19:55 +0100)]
le2lib: block other signals during signal handler execution

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agole2lib: add a ioctl(TIOCSIG) wrapper function
Tobias Ulmer [Tue, 12 Feb 2019 18:52:44 +0000 (19:52 +0100)]
le2lib: add a ioctl(TIOCSIG) wrapper function

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agole2lib: add functions to block and unblock signals
Tobias Ulmer [Tue, 12 Feb 2019 18:24:28 +0000 (19:24 +0100)]
le2lib: add functions to block and unblock signals

Signed-off-by: Tobias Ulmer <tu@emlix.com>
6 years agoe2lib: implement forkpty
Tobias Ulmer [Tue, 12 Feb 2019 18:06:05 +0000 (19:06 +0100)]
e2lib: implement forkpty

Signed-off-by: Tobias Ulmer <tu@emlix.com>