]> rtime.felk.cvut.cz Git - novaboot.git/log
novaboot.git
17 months agonix: Update flake inputs master
Michal Sojka [Sat, 29 Oct 2022 20:33:16 +0000 (22:33 +0200)]
nix: Update flake inputs

This is mainly to have new bats version (used in another branch).

17 months agonix: Switch from lorri to "use nix"
Michal Sojka [Sat, 29 Oct 2022 20:32:54 +0000 (22:32 +0200)]
nix: Switch from lorri to "use nix"

17 months agotests: Fix expect sendcont test
Michal Sojka [Sat, 29 Oct 2022 19:55:03 +0000 (21:55 +0200)]
tests: Fix expect sendcont test

For some reason, more didn't exit automatically.

23 months agoserver: Drop novaboot-delayed-power-off.target
Michal Sojka [Tue, 26 Apr 2022 08:51:49 +0000 (10:51 +0200)]
server: Drop novaboot-delayed-power-off.target

We used it in our first implementation of delayed power off, but now,
it is unused.

23 months agoserver: Unify installation target to PREFIX
Michal Sojka [Tue, 19 Apr 2022 21:54:44 +0000 (23:54 +0200)]
server: Unify installation target to PREFIX

Previously, we installed something to $PREFIX, something directly to
/usr/lib and /lib. Now, we use $PREFIX everywhere.

23 months agoUpdate changelog for 20220425a release 20220425a
Michal Sojka [Mon, 25 Apr 2022 21:51:50 +0000 (23:51 +0200)]
Update changelog for 20220425a release

23 months agoFix u-boot prompt handling
Michal Sojka [Mon, 25 Apr 2022 20:49:03 +0000 (22:49 +0200)]
Fix u-boot prompt handling

Commit 9c9a064 ("Reset u-boot download timeout with every '#'",
2022-04-03) broke behavior on systems with '#' in u-boot prompt. Due
to that commit, the prompt after file transfer is not detected and
novaboot timeouts. We fix that by switching the order of expect
patterns so that the prompt has priority over progress bar '#'
characters.

23 months agoUpdate changelog for 20220425 release 20220425
Michal Sojka [Mon, 25 Apr 2022 20:37:23 +0000 (22:37 +0200)]
Update changelog for 20220425 release

23 months agoserver: Refactor delayed power-off logic
Michal Sojka [Mon, 25 Apr 2022 20:21:32 +0000 (22:21 +0200)]
server: Refactor delayed power-off logic

From time to time, I'm facing problems with delayed power off not
working. I'm not sure what is the exact reason, but a potential reason
could be that the board was powered on but the systemd service
novaboot-delayed-power-off.service, which is responsible for powering
off, was not started. To prevent that, we change the logic so that
powering on happens as a start job of the same service.

2 years agodoc: Add preliminary Raspberry Pi guide
Michal Sojka [Sun, 3 Apr 2022 08:26:09 +0000 (10:26 +0200)]
doc: Add preliminary Raspberry Pi guide

2 years agotests: Fix grub server tests
Michal Sojka [Tue, 12 Apr 2022 22:42:51 +0000 (00:42 +0200)]
tests: Fix grub server tests

The behavior was probably changed in the recent network booting
changes. Since those tests were disabled, we didn't catch that a test
needs to be changed too.

2 years agotests: Check that server ssh login works and reenable server tests
Michal Sojka [Tue, 12 Apr 2022 22:28:43 +0000 (00:28 +0200)]
tests: Check that server ssh login works and reenable server tests

2 years agotests: Fix ssh key setup for server tests
Michal Sojka [Tue, 12 Apr 2022 21:59:12 +0000 (23:59 +0200)]
tests: Fix ssh key setup for server tests

2 years agoReset u-boot download timeout with every '#'
Michal Sojka [Sun, 3 Apr 2022 12:25:53 +0000 (14:25 +0200)]
Reset u-boot download timeout with every '#'

Previously, we used two consecutive hash characters, but it turned out
that a Raspberry Pi, on our network experiences few timeouts at the
beginning (see '#T ' sequences below) and there are never two
consecutive hashes before the timeout elapses.

    U-Boot> tftpboot ${kernel_addr_r} /rpi/kernel
    Using ethernet@7d580000 device
    TFTP from server 10.35.95.2; our IP address is 10.35.95.45
    Filename '/rpi/kernel'.
    Load address: 0x80000
    Loading: #T #T T T Kernel load: timeout at /home/wsh/.nix-profile/bin/novaboot line 1298, <> line 7.

Therefore, we reset the timeout after just a single hash. Now the
above example runs as shown below:

    U-Boot> tftpboot ${kernel_addr_r} /rpi/kernel
    Using ethernet@7d580000 device
    TFTP from server 10.35.95.2; our IP address is 10.35.95.45
    Filename '/rpi/kernel'.
    Load address: 0x80000
    Loading: #T #T T ################################################  45 MiB
             2 MiB/s
    done

2 years agonix: Convert to flakes
Michal Sojka [Sun, 3 Apr 2022 12:22:39 +0000 (14:22 +0200)]
nix: Convert to flakes

We use flake-comapt to keep compatibility the old Nix.

2 years agonix: Adapt to renaming of buildPerlPackage
Michal Sojka [Sun, 3 Apr 2022 11:31:03 +0000 (13:31 +0200)]
nix: Adapt to renaming of buildPerlPackage

error: 'buildPerlPackage' has been renamed to/replaced by 'perlPackages.buildPerlPackage'

2 years agoserver: Doc grammar fixes
Michal Sojka [Fri, 7 Jan 2022 09:27:00 +0000 (10:27 +0100)]
server: Doc grammar fixes

2 years agoserver: Fix enabling of delayed power off
Michal Sojka [Fri, 17 Dec 2021 09:35:03 +0000 (10:35 +0100)]
server: Fix enabling of delayed power off

The documented procedure stopped working after the last commit because
the [Install] section was removed from
novaboot-delayed-power-off.service.

In addition to adding the [Install] section, we also reshuffle
documentation and update systemd unit dependencies to make
power-on/off operations more reliable. The latter should (hopefully)
fix some race conditions that were possible in the past.

2 years agodebian: Add example commands to produce package snapshot
Michal Sojka [Fri, 17 Dec 2021 10:20:47 +0000 (11:20 +0100)]
debian: Add example commands to produce package snapshot

2 years agoserver: Fix delayed power off
Michal Sojka [Thu, 18 Nov 2021 17:58:42 +0000 (18:58 +0100)]
server: Fix delayed power off

Th novaboot-delayed-power-off.service was meant to activate
system-level systemd timer at uses session shutdown. However, this
never worked, because an user service cannot be activated as a part of
session shutdown, because each service depends on app.slice and this
slice is being stopped in the shutdown sequence, which results in
removing the service start request from the shutdown transaction. This
behavior is demonstrated by the systemd debug log below:

    Pulling in novaboot-delayed-power-off.service/start from shutdown.target/start
    Added job novaboot-delayed-power-off.service/start to transaction.
    Pulling in app.slice/start from novaboot-delayed-power-off.service/start
    Pulling in novaboot-delayed-power-off.service/stop from app.slice/stop
    Added job novaboot-delayed-power-off.service/stop to transaction.
    Keeping job novaboot-delayed-power-off.service/stop because of app.slice/stop
    novaboot-delayed-power-off.service: Deleting job novaboot-delayed-power-off.service/start as dependency of job app.slice/start
    Keeping job novaboot-delayed-power-off.service/stop because of app.slice/stop
    Keeping job novaboot-delayed-power-off.service/stop because of app.slice/stop
    Keeping job novaboot-delayed-power-off.service/stop because of app.slice/stop
    Found redundant job novaboot-delayed-power-off.service/stop, dropping from transaction.

Therefore, we don't use a service with ExecStart, but use ExecStop to
start the shutdown timer and start the service by novaboot-shell
whenever the board is powered on.

2 years agoserver: Make systemd invoke novaboot-shell in the $HOME directory
Michal Sojka [Thu, 18 Nov 2021 17:57:14 +0000 (18:57 +0100)]
server: Make systemd invoke novaboot-shell in the $HOME directory

This is the same directory as where novaboot-shell is invoked by sshd.

2 years agodebian: Increase dh compat level to 13 20211022
Michal Sojka [Fri, 22 Oct 2021 13:16:58 +0000 (15:16 +0200)]
debian: Increase dh compat level to 13

2 years agoUpdate changelog for 20211022 release
Michal Sojka [Fri, 22 Oct 2021 13:04:59 +0000 (15:04 +0200)]
Update changelog for 20211022 release

2 years agoMake <<>> fail if it cannot open a file
Michal Sojka [Fri, 22 Oct 2021 12:47:54 +0000 (14:47 +0200)]
Make <<>> fail if it cannot open a file

By default, only a warning is printed and the script continues.

Example of this situation:

    % novaboot non-existent --gen-only
    novaboot: Read /home/wsh/.config/novaboot
    novaboot: Effective options: non-existent --gen-only
    Can't open non-existent: No such file or directory at /home/wsh/src/novaboot/novaboot line 362.

We do not add a test for this, because we make all warnings fatal when
running tests.

2 years agoReplace <> with <<>>
Michal Sojka [Fri, 22 Oct 2021 12:19:30 +0000 (14:19 +0200)]
Replace <> with <<>>

The reason is that <> can be dangerous. From Perl documentation:

    Since the null filehandle uses the two argument form of "open" in
    perlfunc it interprets special characters, so if you have a script like
    this:

while (<>) {
    print;
}

    and call it with "perl dangerous.pl 'rm -rfv *|'", it actually opens a
    pipe, executes the "rm" command and reads "rm"'s output from that pipe.
    If you want all items in @ARGV to be interpreted as file names, you can
    use the module "ARGV::readonly" from CPAN, or use the double diamond
    bracket:

while (<<>>) {
    print;
}

    Using double angle brackets inside of a while causes the open to use
    the three argument form (with the second argument being "<"), so all
    arguments in "ARGV" are treated as literal filenames (including "-").
    (Note that for convenience, if you use "<<>>" and if @ARGV is empty, it
    will still read from the standard input.)

2 years agoserver: Add run_novaboot to be used as default_cmd
Michal Sojka [Fri, 22 Oct 2021 08:49:09 +0000 (10:49 +0200)]
server: Add run_novaboot to be used as default_cmd

2 years agoserver: Allow reset_cmd to contain a shell function name
Michal Sojka [Fri, 22 Oct 2021 10:57:55 +0000 (12:57 +0200)]
server: Allow reset_cmd to contain a shell function name

2 years agoMerge branch 'feat/pxe-boot'
Michal Sojka [Mon, 28 Jun 2021 06:29:23 +0000 (08:29 +0200)]
Merge branch 'feat/pxe-boot'

2 years agoshell.nix: Add grub2 and dhcp
Michal Sojka [Mon, 28 Jun 2021 06:19:34 +0000 (08:19 +0200)]
shell.nix: Add grub2 and dhcp

This is to allow manual testing of --dhcp-tftp --grub2 functionality.
Currently, I don't have time to fully automate the tests, but this is
how I tested it manually:

1. Create testboot script with the following content:

       #!/usr/bin/env novaboot

       BOOT_METHOD=linux
       load kernel
       load ramdisk

2. Create a bridge interface:

       brctl addbr br0
       ip link set dev br0 up

3. Run:

       ./testboot --dhcp-tftp --grub2 --remote-cmd="sleep inf" --netif=br0

4. Verify that the Qemu VM boots GRUB2:

       sudo qemu-system-x86_64 -boot n -nic bridge,br=br0 -nographic

2 years agoAdd tests for GRUB2 BOOT_METHOD
Michal Sojka [Mon, 28 Jun 2021 06:11:10 +0000 (08:11 +0200)]
Add tests for GRUB2 BOOT_METHOD

2 years agogrub2: Don't perform unnecessary config modifications for the linux BOOT_METHOD
Michal Sojka [Sun, 27 Jun 2021 19:22:29 +0000 (21:22 +0200)]
grub2: Don't perform unnecessary config modifications for the linux BOOT_METHOD

2 years agoCreate tftpd.pid in default location
alberand [Wed, 31 Mar 2021 20:51:58 +0000 (22:51 +0200)]
Create tftpd.pid in default location

This way we restrict the user in commands which he can run under sudo.
It's better to use * wildcard in the pkill command as it doesn't write
anything to the filesystem.

2 years agotftpd: allow varying path to the *.pid while run by sudo
alberand [Wed, 31 Mar 2021 20:43:15 +0000 (22:43 +0200)]
tftpd: allow varying path to the *.pid while run by sudo

2 years agoDie in case of multiple initrds for the Linux kernel
Michal Sojka [Fri, 11 Jun 2021 10:42:30 +0000 (12:42 +0200)]
Die in case of multiple initrds for the Linux kernel

2 years agodhcpd: Add sample config for different PXEClient architectures
alberand [Wed, 24 Feb 2021 17:59:23 +0000 (18:59 +0100)]
dhcpd: Add sample config for different PXEClient architectures

Also use path to binaries generated with grub-mknetdir.

2 years agotftpd: Set root to the dir specified in --server
Michal Sojka [Fri, 11 Jun 2021 10:39:22 +0000 (12:39 +0200)]
tftpd: Set root to the dir specified in --server

2 years agotftpd: Add call to grub-mknetdir
alberand [Sun, 28 Feb 2021 19:55:54 +0000 (20:55 +0100)]
tftpd: Add call to grub-mknetdir

2 years agoMove grub.cfg to the default location
alberand [Sat, 20 Mar 2021 08:15:03 +0000 (09:15 +0100)]
Move grub.cfg to the default location

The default path grub is looking for its config is
/boot/grub/grub.cfg.

2 years agoAdd BOOT_METHOD variable to control how to generate GRUB2 config
alberand [Fri, 19 Mar 2021 17:57:49 +0000 (18:57 +0100)]
Add BOOT_METHOD variable to control how to generate GRUB2 config

2 years agotftpd: Run with mapfile
alberand [Wed, 24 Feb 2021 17:16:06 +0000 (18:16 +0100)]
tftpd: Run with mapfile

This mapfile is needed as some pxeclient add zero byte \x00 to the end
of the filename. This is a known bug. The mapfile contains rule to
remove that byte.

2 years agoAdd test for GRUB2
Michal Sojka [Mon, 28 Jun 2021 06:15:39 +0000 (08:15 +0200)]
Add test for GRUB2

This will allow us to verify that the changes to GRUB2 config file
generation code in the subsequent commits work as intended.

2 years agoFix typo
alberand [Wed, 31 Mar 2021 17:47:14 +0000 (19:47 +0200)]
Fix typo

3 years agoCopy files to TFTP server with default permissions
Michal Sojka [Mon, 12 Apr 2021 06:26:00 +0000 (08:26 +0200)]
Copy files to TFTP server with default permissions

Previously, we used rsync's --perm option to mirror source permissions
at target. This could have caused the files to be inaccessible by the
TFTP server, because source permissions were to tight. To overcome
this problem, we now always set the target permissions to the default
value by using --chmod. From rsync manual:

    To give new files the destination-default permissions (while
    leaving existing files unchanged), make sure that the --perms
    option is off and use --chmod=ugo=rwX.

Note that this change does not require changes on the server
side (novaboot-shell).

3 years agoAdd --copy= as alias to --server=
alberand [Tue, 23 Mar 2021 17:28:22 +0000 (18:28 +0100)]
Add --copy= as alias to --server=

"Copy" better corresponds to what this option does.

[This commit message and documentation was updated by Michal Sojka.]

3 years agoUpdate changelog for 20210126a release 20210126a
Michal Sojka [Tue, 26 Jan 2021 18:42:52 +0000 (19:42 +0100)]
Update changelog for 20210126a release

3 years agotests: Skip server tests during Debian package build
Michal Sojka [Tue, 26 Jan 2021 18:41:45 +0000 (19:41 +0100)]
tests: Skip server tests during Debian package build

3 years agotests: Rework server tests to not require external ssh-agent
Michal Sojka [Tue, 26 Jan 2021 18:24:56 +0000 (19:24 +0100)]
tests: Rework server tests to not require external ssh-agent

3 years agoStrip trailing spaces in novaboot script load/copy lines
Michal Sojka [Tue, 26 Jan 2021 17:56:46 +0000 (18:56 +0100)]
Strip trailing spaces in novaboot script load/copy lines

Trailing spaces break device tree detection in U-Boot support, because
the device tree is detected by \.dtb$ regex.

3 years agotests: Add simple u-boot tests
Michal Sojka [Tue, 26 Jan 2021 17:53:55 +0000 (18:53 +0100)]
tests: Add simple u-boot tests

3 years agotests: Fix iprelay-cmd test to work on both Debian an NixOS
Michal Sojka [Tue, 26 Jan 2021 16:52:08 +0000 (17:52 +0100)]
tests: Fix iprelay-cmd test to work on both Debian an NixOS

3 years agodoc: Add missing "to"
Michal Sojka [Tue, 26 Jan 2021 15:03:51 +0000 (16:03 +0100)]
doc: Add missing "to"

3 years agoUpdate changelog for 20210126 release
Michal Sojka [Tue, 26 Jan 2021 14:18:15 +0000 (15:18 +0100)]
Update changelog for 20210126 release

3 years agoREADME: Fix link
Michal Sojka [Tue, 26 Jan 2021 11:46:50 +0000 (12:46 +0100)]
README: Fix link

3 years agoAdd README.md
Michal Sojka [Tue, 26 Jan 2021 11:08:46 +0000 (12:08 +0100)]
Add README.md

It is shorter than the current README.pod (man page), to which it
links. In addition to the man page, it contains installation
instructions and links to server-side documentation.

3 years agoserver: Split documentation to separate files
Michal Sojka [Tue, 26 Jan 2021 10:45:36 +0000 (11:45 +0100)]
server: Split documentation to separate files

It will be easier to look up the documentation on GitHub.

3 years agoserver: Add support for default_cmd configuration variable
Michal Sojka [Tue, 26 Jan 2021 10:38:14 +0000 (11:38 +0100)]
server: Add support for default_cmd configuration variable

3 years agoserver: Refactor console setup to a separate function
Michal Sojka [Mon, 25 Jan 2021 00:12:08 +0000 (01:12 +0100)]
server: Refactor console setup to a separate function

Also drop exec before the command, because it only causes troubles.
Thanks to dropping exec, we had to change the testsuite, because
without exec it starts a new process, which is not killed by "kill
$COPROC_PID" and since it holds a lock (via flock), we could not run
the following tests.

This change will be useful in next commits.

3 years agoserver: Document how to use shell function for console_cmd
Michal Sojka [Tue, 26 Jan 2021 08:39:45 +0000 (09:39 +0100)]
server: Document how to use shell function for console_cmd

3 years agoFixes for all tests to pass on NixOS
Michal Sojka [Tue, 26 Jan 2021 08:17:18 +0000 (09:17 +0100)]
Fixes for all tests to pass on NixOS

3 years agonix: Make Nix shell contain all needed Perl packages
Michal Sojka [Mon, 25 Jan 2021 00:25:47 +0000 (01:25 +0100)]
nix: Make Nix shell contain all needed Perl packages

Namely: novaboot dependencies as well as pod2X needed for README
creation during commit (my git hook).

3 years agoserver: Do not hardcode bash path
Michal Sojka [Sun, 24 Jan 2021 23:34:55 +0000 (00:34 +0100)]
server: Do not hardcode bash path

3 years agonix: Allow running (at least a part of) test suite from nix-shell
Michal Sojka [Sun, 24 Jan 2021 22:11:18 +0000 (23:11 +0100)]
nix: Allow running (at least a part of) test suite from nix-shell

3 years agoAdd test for functionality in the previous commit
Michal Sojka [Sun, 24 Jan 2021 22:10:53 +0000 (23:10 +0100)]
Add test for functionality in the previous commit

3 years agoPrioritize 'exiton' over 'expect_raw'
Martin Vajnar [Sun, 17 Jan 2021 22:58:53 +0000 (23:58 +0100)]
Prioritize 'exiton' over 'expect_raw'

3 years agoserver: Document automatic power off
Michal Sojka [Thu, 17 Dec 2020 11:21:16 +0000 (12:21 +0100)]
server: Document automatic power off

3 years agotests: Make shebangs NixOS compatible
Michal Sojka [Thu, 17 Dec 2020 09:19:14 +0000 (10:19 +0100)]
tests: Make shebangs NixOS compatible

3 years agoUpdate changelog for 20201217 release 20201217
Michal Sojka [Thu, 17 Dec 2020 07:43:37 +0000 (08:43 +0100)]
Update changelog for 20201217 release

3 years agoserver: Call "systemctl is-enabled" with --quiet
Michal Sojka [Thu, 17 Dec 2020 09:04:06 +0000 (10:04 +0100)]
server: Call "systemctl is-enabled" with --quiet

3 years agoRename novaboot-power-off.service to novaboot-delayed-power-off.service
Michal Sojka [Thu, 17 Dec 2020 08:58:17 +0000 (09:58 +0100)]
Rename novaboot-power-off.service to novaboot-delayed-power-off.service

Also rework the logic to not relay on systemd's Conflicts but switch
off the timer explicitly in novaboot-power script.

3 years agoRun pre-commit hook in bash
Michal Sojka [Thu, 17 Dec 2020 07:39:55 +0000 (08:39 +0100)]
Run pre-commit hook in bash

We need "set -o pipefail" and it needs bash.

3 years agoMake novaboot shebang NixOS compatible
Michal Sojka [Thu, 17 Dec 2020 07:15:44 +0000 (08:15 +0100)]
Make novaboot shebang NixOS compatible

3 years agonix: Add derivation for novaboot-server
Michal Sojka [Thu, 17 Dec 2020 07:15:09 +0000 (08:15 +0100)]
nix: Add derivation for novaboot-server

3 years agoserver: Add missing files for delayed power-off
Michal Sojka [Sun, 1 Mar 2020 14:42:39 +0000 (15:42 +0100)]
server: Add missing files for delayed power-off

These should have been a part of commit 9dffa51 ("Simplify systemd
logic for automated delayed power off", 2019-11-21).

3 years agoCatch errors in pre-commit hook
Michal Sojka [Tue, 13 Oct 2020 21:26:56 +0000 (23:26 +0200)]
Catch errors in pre-commit hook

3 years agoAdd basic Nix support
Michal Sojka [Tue, 13 Oct 2020 21:25:40 +0000 (23:25 +0200)]
Add basic Nix support

3 years agodoc: Cosmetic changes
Michal Sojka [Thu, 6 Aug 2020 13:21:01 +0000 (15:21 +0200)]
doc: Cosmetic changes

3 years agodoc: Add section about booting Linux
Michal Sojka [Thu, 6 Aug 2020 13:20:21 +0000 (15:20 +0200)]
doc: Add section about booting Linux

4 years agoAllow configuring the default value of --netif globally in configuration files
Michal Sojka [Tue, 18 Feb 2020 10:49:30 +0000 (11:49 +0100)]
Allow configuring the default value of --netif globally in configuration files

4 years agoSimplify systemd logic for automated delayed power off
Michal Sojka [Thu, 21 Nov 2019 11:21:39 +0000 (12:21 +0100)]
Simplify systemd logic for automated delayed power off

TODO documentation

4 years agoserver: Use Makefile to install the server
Michal Sojka [Thu, 21 Nov 2019 11:17:53 +0000 (12:17 +0100)]
server: Use Makefile to install the server

This will become handy in the next commit.

4 years agotests: Get rid of asynchronous process substitution
Michal Sojka [Wed, 20 Nov 2019 22:10:07 +0000 (23:10 +0100)]
tests: Get rid of asynchronous process substitution

Under bash, processes substitution is run asynchronously. This means
that the messages printed by the process can be mixed with other
messages, which causes random tests to fail, because the wvtest
protocol lines are corrupted.

Now we run all processes synchronously and the test no longer fail
randomly.

4 years agoserver: User temporary RUN_DIR in $HOME does not exist
Michal Sojka [Mon, 18 Nov 2019 08:20:28 +0000 (09:20 +0100)]
server: User temporary RUN_DIR in $HOME does not exist

This is the case under pbuilder.

4 years agodebian: Add build-depends to be able to run tests under pbuilder
Michal Sojka [Mon, 18 Nov 2019 08:19:00 +0000 (09:19 +0100)]
debian: Add build-depends to be able to run tests under pbuilder

4 years agodebian: Fix version syntax in Depends
Michal Sojka [Mon, 18 Nov 2019 07:36:42 +0000 (08:36 +0100)]
debian: Fix version syntax in Depends

4 years agotests: Remove home directory for server tests
Michal Sojka [Sun, 17 Nov 2019 22:42:31 +0000 (23:42 +0100)]
tests: Remove home directory for server tests

It is not needed since commit 84f456f ("tests: Convert server tests to
use the account from last commit", 2019-11-16),

4 years agoAllow specifying /dev/null as load argument
Michal Sojka [Sun, 17 Nov 2019 20:33:56 +0000 (21:33 +0100)]
Allow specifying /dev/null as load argument

This is useful if only kernel parameters are important, but kernel
image is taken from somewhere else.

4 years agoserver: Ensure that configuration can depend on logged-in user name
Michal Sojka [Sun, 17 Nov 2019 15:44:23 +0000 (16:44 +0100)]
server: Ensure that configuration can depend on logged-in user name

4 years agoRevert "server: Add experimental support for the ssh sub-command"
Michal Sojka [Sun, 17 Nov 2019 14:49:46 +0000 (15:49 +0100)]
Revert "server: Add experimental support for the ssh sub-command"

This reverts commit 65dbc765ea6bb1eb7a5b72f34bfc71323617106a.

It would be better to use SSH port forwarding to access target's SSH.

4 years agotests: Convert server tests to use the account from last commit
Michal Sojka [Sat, 16 Nov 2019 22:30:28 +0000 (23:30 +0100)]
tests: Convert server tests to use the account from last commit

4 years agotest: Add script for creating test account
Michal Sojka [Sat, 16 Nov 2019 22:15:25 +0000 (23:15 +0100)]
test: Add script for creating test account

4 years agoDisable echo in default stty arguments
Jan Kaisrlik [Mon, 4 Nov 2019 16:28:01 +0000 (17:28 +0100)]
Disable echo in default stty arguments

From time to time I observe that the novaboot hangs in the uboot menu
with weird characters on the line like this

    => MC:   mmc@7000: 0^M^JLoading Environment from MMC... OK^M^JIn:    serial@3000^M^JNet:   eth0: ethernet@ff3f0000^M^JHit any key to stop autoboot:  2 ^H^H^H 0^M^J=> MC:   mmc@7000: 0^M^JLoading Environment from MMC... OK^M^JIn:    serial@3000^M^JNet:
    Unknown command 'MC:' - try 'help'

When I tried to play with stty options I realized that the echo option
breaks the communication. The reason is that when echo is
enabled (which is by default), all characters sent by the target are
echoed back to the target, which may interpret them.

To confirm that, I tested the following options:

    --stty="raw -crtscts -onlcr 115200 -echo" (working)
    --stty="raw -crtscts -onlcr 115200 echo" (not working)

It turns out that the problem appears only during the first initial
novaboot conversation with the bootloader after. After switching to
interactive mode, echo is automatically disabled by Expect.pm and for
subsequent boots, echo remains disabled.

[Note: Commit message updated by Michal Sojka based on GitHub
discussion https://github.com/wentasah/novaboot/pull/5 and his
investigation of the issue.]

4 years agotests: Make some server tests more readable
Michal Sojka [Thu, 31 Oct 2019 23:10:44 +0000 (00:10 +0100)]
tests: Make some server tests more readable

4 years agoserver: Always use flock with --no-fork
Michal Sojka [Thu, 31 Oct 2019 22:27:44 +0000 (23:27 +0100)]
server: Always use flock with --no-fork

Without this my test suite fails. The reason for not using --no-fork
was that it didn't work well on some systems. Since I'm annoyed by not
working test suite, I'm willing to investigate --no-fork problems if
they still exist on current Linux systems.

4 years agoImprove an error message
Michal Sojka [Thu, 31 Oct 2019 21:39:40 +0000 (22:39 +0100)]
Improve an error message

4 years agoserver: Add experimental support for the ssh sub-command
Michal Sojka [Thu, 24 Oct 2019 07:18:46 +0000 (09:18 +0200)]
server: Add experimental support for the ssh sub-command

4 years agoserver: Document get-config
Michal Sojka [Thu, 24 Oct 2019 06:50:23 +0000 (08:50 +0200)]
server: Document get-config

4 years agoserver: Mention get-config command in help message
Michal Sojka [Wed, 23 Oct 2019 11:40:25 +0000 (13:40 +0200)]
server: Mention get-config command in help message

4 years agoUpdate changelog for 20191023 release 20191023
Michal Sojka [Wed, 23 Oct 2019 08:28:38 +0000 (10:28 +0200)]
Update changelog for 20191023 release

4 years agoserver: Add novaboot users to the novaboot group
Michal Sojka [Tue, 15 Oct 2019 21:32:47 +0000 (23:32 +0200)]
server: Add novaboot users to the novaboot group

This is mainly intended for allowing "Match Group" configuration in
sshd_config.

4 years agoserver: Mention adduser-novaboot in novaboot-shell documentation
Michal Sojka [Tue, 15 Oct 2019 21:36:03 +0000 (23:36 +0200)]
server: Mention adduser-novaboot in novaboot-shell documentation