Michal Sojka [Wed, 10 May 2017 09:01:49 +0000 (11:01 +0200)]
Add systemd units to power-on/off the target
The idea is that whenever somebody logs as a certain user, systemd switches
the target on. After all sessions of that user are closed, systemd starts
a timer and after its expiration, the target is switched off.
Not that power-on is not always working correctly. The reason is that
we would want the novaboot-target-on@XXX.service to finish before the user
is logged. This can be achieved by adding Before= directive to it, but the
problem is that user units do have UIDs and not names, so we cannot simply
write Before=user@%i.service.
Currently, I'm not sure how to properly solve this issue so the power-on
command is commented out. Power-off, however, work correctly.
Michal Sojka [Fri, 17 Feb 2017 20:54:47 +0000 (21:54 +0100)]
Fix test
It seems that at least Perl 5.24.1, if the parameter of 'do' (which we
use to read the configuration file) is relative patch that does not start
with ./, the file is only searched in Perl @INC path. This results in
test failure, because our configuration file in not in @INC.
Michal Sojka [Mon, 23 Mar 2015 08:17:55 +0000 (09:17 +0100)]
doc: Add encoding directive
POD manual says: if your encoding isn't US-ASCII or Latin-1, then put a
"=encoding encodingname" command early in the document so that pod
formatters will know how to decode the document.
Hopefully, this makes GitHub displaying en-dashes correctly.
Michal Sojka [Tue, 27 Jan 2015 12:38:44 +0000 (13:38 +0100)]
uboot: Make loading files and booting independent
When I want to boot the system from flash, I don't need to load
anything, but I need to run a boot command (UBOOT_CMD). This was not
possible without this change.
Michal Sojka [Mon, 15 Dec 2014 15:24:48 +0000 (16:24 +0100)]
Do not use nproc to determine the number of processors
On some systems (e.g. with busybox) nproc is not available. Instead use
sysconf(). The only problem is that the _SC_NPROCESSORS_CONF constant is
not defined in the Perl POSIX module. We define it here only for Linux.
Michal Sojka [Mon, 15 Dec 2014 14:07:50 +0000 (15:07 +0100)]
qemu is no longer hardcoded as default target
This was here only for compatibility with origin novaboot from the NUL
project. As this project seems to be no longer developed, we can
hopefully get rid of it.
Michal Sojka [Mon, 15 Dec 2014 12:41:13 +0000 (13:41 +0100)]
Always finish novaboot output with new line character
Previously, printed the character only when --exiton was in effect. It
is necessary to print it even in other cases, for example when novaboot
is started with --no-interaction.
The previous print command was erroneously changed to STDERR, so we
change it back to STDOUT.
Michal Sojka [Mon, 15 Dec 2014 12:35:44 +0000 (13:35 +0100)]
Execute --uboot-cmd even if there are no files to boot
This is useful in certain situations, for example when we want to
execute custom U-Boot command end exit novaboot without waiting for next
U-Boot prompt.
We also wrap kernel loading in an if block to suppress Perl warnings
about undefined $kbin.
Michal Sojka [Tue, 9 Dec 2014 09:17:53 +0000 (10:17 +0100)]
Flush serial line output after reset
This caused some problems when novaboot was used in other scripts and
those scripts looked for certain strings in novaboot output. It happened
that the string was found in the output before reset and therefore, the
whole thing didn't work correctly.
Michal Sojka [Tue, 2 Dec 2014 14:50:24 +0000 (15:50 +0100)]
Always use bi-direction target communication
I don't remember what was the reason for setting up bi-directional
interaction only when on terminal. It seems, it is useful to have also
when not on terminal - for example when running under socat.
With this change, I'm able to use novaboot with socat to load u-boot
to the target using X-modem protocol:
Michal Sojka [Tue, 25 Nov 2014 11:01:25 +0000 (12:01 +0100)]
Change target connection warning to error
In the previous commit I argued that it is a valid use case to override
target connection option from command line. I realized that this is not
true, because the implementation does not know which option was given
last and the effective option is determined by the implementation and
not by the position on the command line. Therefore, it is almost always
an error to specify target connection option multiple times.
Michal Sojka [Mon, 24 Nov 2014 09:53:51 +0000 (10:53 +0100)]
Warn when multiple target connection options are given
This may be problem when --remote-expect is used, but the expected string
is not produced by all connection methods. Then, --remote-expect will may
cause indefinite blocking. For example, when
Michal Sojka [Sun, 23 Nov 2014 23:18:34 +0000 (00:18 +0100)]
Implement user configuration file
Previously, it was recommended to use ~/.novaboot as user configuration
file, but this didn't work when working other directory, such as in
/tmp. Therefore a new configuration file ~/.config/novaboot is
introduced, which is read always when it exists.
Thanks to Michal Vokac for figuring out this problem.