Commit Graph
104 Commits
Author SHA1 Message Date
Mark D Horn 3339c19a50 Set the time zone on target system
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-23 10:03:34 -07:00
Mark D Horn 55512b1bf0 Refactor the telemetry bundle into the package
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-23 10:03:34 -07:00
Mark D Horn 6cd7271a06 Handle case of no available keyboard, language, tz
Show the os-core defaults in case none found.
These are also the defaults of /etc is cleared; i.e. reset stateless.

Change the default timezone to the system default of UTC.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-23 10:03:34 -07:00
Leandro Dorileo ce98bd1af0 linter: add go build -race
Use the -race flag to detect/test for race conditions.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-19 10:43:13 -07:00
Leandro Dorileo b44176d93b args: add StubImage argument
With this argument (either -S or --stub-image) we create the image
- if that's the case - and create the target file systems but don't
actually install content.

It's useful for pre-release validation where the content is generated
and dealt by the release tooling.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-19 10:42:55 -07:00
Mark D Horn a2afa04ca9 Fix the OS naming
Update product name and text on install screen

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-18 17:04:55 -07:00
Leandro Dorileo 281a3bd923 check-coverage: print all decreased coverage
With this change we check all the tests decreased and print them
all instead of printing the first and exiting.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-17 16:11:24 -07:00
Leandro Dorileo 02be437d40 user: check for user password
Don't try to change the user's password if the password is not set.
It's useful for systems for remote access only where the ssh-keys
are just enough - and no password required.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-17 12:36:56 -07:00
Leandro Dorileo 82beb2e89b user: add ssh-keys configuration
Add the user's ssh-keys configuration support as well as the required
bits to creathe the authorized_keys file.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-17 12:36:56 -07:00
Mark D Horn 6e38f979ce Redefine Log Levels
Redefine the log levels to that increasing the value increases
the amount of logging. 1 (ERR) ... 5 (Verbose Debug)

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-16 16:47:50 -07:00
Mark D Horn 245114f669 Allow setting Log-Level via kernel parameter
To enable debugging of an installation the log level may need to
be set via a kernel parameter as the installer should launch upon boot.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-16 16:47:50 -07:00
Mark D Horn 43690086b7 Setting Log Level should not be fatal
Changing the log level should not abort the installer.
Instead, force to highest or lowest value and log a warning.
This is particularly useful if set via the kernel command line
during debug of an installation we do not want to fail.

Moved setting the output log file name before setting level.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-16 16:47:50 -07:00
Mark D Horn dfe87189fd Change default log level to Info
Remove debug information by default.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-16 16:47:50 -07:00
Mark D Horn f6e0b2ba63 Add Install Steps as Info log messages
When the default logging is set to Info, have a baseline of
the installation steps logged.

Add additional testing to storage to ensure metrics do not slip.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-16 16:47:50 -07:00
Mark D Horn dfcb727914 Avoid logging repeated lines
Condense the output by caching repeated lines and printing a count.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-16 16:47:50 -07:00
Mark D Horn f77cced634 Remove the unfilter Out log function
Need to ensure the log out is without extraneous debug information.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-16 16:47:50 -07:00
Leandro Dorileo 557a637749 check-coverage: improve error handling and notification
One of the steps check-coverage does is running "make check" and
writing it to a temporary file. This patch improves this step by
detecting the failure and better notifying the user it has failed,
also we show the result to the user if that's the case. Also remove
the left over temporary file case it fails.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-16 14:16:46 -07:00
Leandro Dorileo b65ac90313 build: fix build
Make the "check" target as a single shell block, and 1) improve the
fail output display (by showing the left over files) and 2) ignore
the /tmp directory itself (avoiding to consider it as a left over
when some process has touched /tmp for example).

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-16 14:16:46 -07:00
Leandro Dorileo f1b632ad64 build: add build-local-travis target
This target is intended to be used to test local-travis out of the
regular check-coverage workflow.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-16 14:16:46 -07:00
Leandro Dorileo 5dcc2a0140 local-travis: add --config flag
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-16 14:16:46 -07:00
Leandro Dorileo df8ed2a1d3 installer image: set timeout
This patch sets the systemd-boot's timeout to 5 so the user may have
the opportunity to change the kernel arguments.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-10 15:10:16 -07:00
Leandro Dorileo 301bedfb2d image: fix image overwrite
We're failing to detect if the the target system block device is an
image file or a device file, with that we fail to overwrite the image
assuming the target file is /dev/<img-file> instead of setting the
loop device up and using it.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-10 13:24:05 -07:00
Leandro Dorileo 4a538fc6e8 updated code coverage
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Leandro Dorileo f9379723f3 mass installer: break line for version warning printing
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Leandro Dorileo 1074784a7a args: add --swupd-state
When creating images it's useful to have a --swupd-state to provide
an state dir outside the image so we don't duplicate the target's
content.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Leandro Dorileo 1aec5acbe1 readme: update the installer image generation documentation
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Leandro Dorileo 0742f0f521 args: add --block-device argument
With the --block-device command line argument the user can remap
or add an entry to configuration file's block-devices definition.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Leandro Dorileo d9d8e10566 model: add test for mixed block devices config
A alias can be used for a single partition only, this test makes
sure we test the case.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Leandro Dorileo 0a52b8e030 model: add test for kernel validation
Kernel configuration is mandatory. This test makes sure we cover that.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Leandro Dorileo 7c75841c3b block device alias: support the use of both device file and image
Make sure we keep only the used alias and make sure they can co-exist.
Currently if you have a device file alias and an image file alias
the image will always be created - even if it's not in use.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Leandro Dorileo 9574b4af9f installer image: use the clr-installer only
Create a custom image configuration file with a post-install hook
to "self install" clr-installer into the target system.

If installing clr-installer to an actual block device (i.e usb stick)
tweak the block-devices entries.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Mark D Horn 85705c3783 tui: Improve User account data entry
Fixes #28

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-09 16:37:41 -07:00
Mark D Horn 79db4a0f57 Make Escape press the Cancel button if defined
Instead of faking the cancel event, actually press the Cancel button
if it is defined for the page. This allows the cancel button function
to be executed.
2018-10-09 16:37:41 -07:00
Mark D Horn 1ecef3a7c5 Fix: Pipe Commands Hang
Command run through PipeRunAndLog would hang waiting for standard input.
We were overwriting the defined stdin input stream.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-09 16:37:15 -07:00
Mark D Horn 6135f281c8 tui: Fix default Language
The language code is what is stored in the configuration file and is
unmarshalled into the model, the language Tag is left uninitialized.
When we find the language code match on initialization, set the
language Tag correctly for display in the TUI.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-09 16:36:59 -07:00
Mark D Horn 681eb39690 Do not change default for Escape-Cancel
Two of the Enable/Disable configuration options were assuming
Confirm was enabled; otherwise disable. Escape to cancel should
not change the default answer.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-09 13:34:28 -07:00
Mark D Horn e2366149cd Disable Install on validation fail
If we had configured media for install, and then go back and remove
the target media the Install button was left enabled.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-09 13:34:03 -07:00
Mark D Horn 5baeb3dcca Make Disabled Text more readable
Blue text on black background was noted as hard to read
due to lack of contrast.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-09 13:32:08 -07:00
Mark D Horn dde6a196ec Make Key names consistent
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-09 13:30:11 -07:00
Leandro Dorileo 83105836d3 tui: support loop device
Loop devices are valid then don't exclude it when reading block device's
configuration, also make sure tui reacts properly.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 13:26:50 -07:00
Mark D Horn eb0c9a22f6 More temp file clean up
- Hid the makefile comment
- Catch additional test case that need to clean up the
  temp downloaded file

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-03 12:22:51 -07:00
Leandro Dorileo eb8c990d56 args: rename --mirror to --swupd-mirror
Preventing future confusions (when we implement dnf support) rename
the --mirror argument to --swupd-mirror and start creating a namespace
for the arguments.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 16:27:34 -07:00
Mark D Horn e550ed70ea Clean Up all temporary files and directories
Ensure both the main code and test clean up after themselves.

Testing for changes in the /tmp directory done in the Makefile
to ensure the testing is done outside of the code itself.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-02 16:24:45 -07:00
Mark D Horn 6d6cb675eb Note security processes for Clear Linux OS
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-02 16:24:02 -07:00
Leandro Dorileo e28d08b800 updated code coverage
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 14:16:42 -07:00
Leandro Dorileo 539f5a01e3 local-travis: passdown UPDATE_COVERAGE env var
Make the function to convert env vars to docker arguments more generic
(it was previously specific to proxy vars). Also start passing down
the UPDATE_COVERAGE environment variable - that way we can automatically
update the converage database when running "make check-coverage".

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 14:16:42 -07:00
Leandro Dorileo c9bafa6920 crypt: add Crypt() tests
We make sure multiple calls to crypt return different hashes.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 14:16:42 -07:00
Leandro Dorileo 76d871ee11 tests: make valid minimal a minimal test again
I started increasing the minimal test but it's minimal for a reason -
to be minimal.

This patch moves the pre and post hook tests to their own test file.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 10:04:10 -07:00
Leandro Dorileo 63b6dba299 Add required bits to make image and install a target system into it.
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 10:04:10 -07:00
Leandro Dorileo b1334c2648 storage: add block-devices alias support
With this the user can add alias block devices and use these alias
to expand target media's Name values, i.e:

block-devices: [
   {name: "target", file: "/dev/sda"}
]

targetMedia:
- name: ${target}
  type: disk
  ...

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 10:04:10 -07:00