50 Commits

Author SHA1 Message Date
William Douglas 73d7f22c56 Update code for revive linter 2022-11-03 10:18:41 -07:00
Karthik Prabhu Vinod 54457ddc6d ISO: Add integrity check
Adding Implant code
initramFs Add verify checksum using checkisomd5
BIOS/UEFI menu changes

Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-05-28 21:37:31 -07:00
Karthik Prabhu Vinod cc27345a72 storage: Add Misc capabilities
a.) By default, block destructive install affecting other disks
b.) Add way to report effects on other disks
c.) Add force-install option
d.) Add Cleanup progress
e.) Fixes

Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-05-07 15:00:51 -07:00
Mark D Horn 59302346d6 linter: enable whitespace
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-24 14:53:17 -07:00
Mark D Horn b1b702385e swapfile: Add new swap file size option
The size of the swapfile can be set in the YAML file
and overridden by the command line argument.

Update for usage of XiB or XB units.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-04-15 17:23:59 -07:00
Karthik Prabhu Vinod f2c78d56e6 Make a tab(\t) count as 4 char
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-04-10 00:08:40 -07:00
Karthik Prabhu Vinod 8da9febcd4 Fix long line issues
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-04-10 00:08:40 -07:00
Mark D Horn ef45a32849 args: model: New options for partition checks
Add command line arguments and YAML file configurations for settings
skipping partition size checks during validation.

Skip Validation All implies Skip Size.

Never write skip validation options to YAML

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-03-27 15:07:10 -07:00
Karthik Prabhu Vinod 9b7a5b01b2 Args: Make --gui flag hidden in help
Fixes #683

Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2020-03-18 19:17:56 +00:00
ZVNexus 6272de6a21 Initial F2FS support for CLR Installer.
Signed-off-by: Alexander Koskovich <zvnexus@outlook.com>
2020-02-27 11:03:25 -08:00
Leandro Dorileo 2348394fd4 args: add --cbm-path
With the new flag we can easily instruct clr-installer to use an arbitrary
build/install, this flag eases the clr-boot-manager's CI by testing image generation
before we land new features.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2020-02-04 14:22:56 -08:00
Mark D Horn 0581bd8808 tui: high-contrast theme
Black and white theme to improve contrast

Active button reversed, bold, underline to standout

Fixes: #217

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-01-21 14:54:20 -08:00
Mark D Horn b9970047f9 Allow skipping swupd configuration file copy
Fixes: #600

Only copy the swupd configuration files from the host to the target
by default when running the interactive installer (gui or tui).
Otherwise, observe the setting from the configuration YAML or the
command line (highest) argument.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-12-11 10:47:05 -08:00
Mark D Horn dc513d49e3 args: Add Bundles command line option
Allow the user to override the default set of bundles on
the command line. This comma-separated list will override
either the default built-in bundle list or the bundle list
from a specified configuration file.

Note that the installer will still augment this list with
any RequiredBundle which is needed due to option selections
such as choosing a non-default keyboard or language, enabling
telemetry, or adding additional users.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-11-19 18:18:05 -08:00
Mark D Horn 200d9313f1 args: Add Template generation mode
Add new --template (-T) command mode which will generate
a YAML configuration file.

Attempt to improve test coverage.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-11-19 18:18:05 -08:00
Mark D Horn f74a0d1c46 args: Add retry to conf download
Fixes: #591

When attempting to download a configuration file supplied by
the kernel command line, keep trying forever. This is generally
used by a network boot installation.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-11-06 13:09:44 -08:00
Mark D Horn 3723f04da6 args: Provide clear url download error
Include a message about what URL we failed to download as well
as an exit status number.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-11-06 13:09:44 -08:00
John Akre 1deccf4e8c args: Create function for boolean flag checks
To reduce cyclomatic complexity, the boolean command line argument checks
were moved to a new function.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-11-04 09:06:25 -08:00
John Akre 53db1a1fd9 swupd: Support skipping optional bundles
Optionally included bundles (also-add) can now be omitted from the
install target by passing the --swupd-skip-optional flag or by setting
the swupdSkipOptional field in the config file.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-11-04 09:06:25 -08:00
Mark D Horn a3ac0ad7a4 args: Allow setting version on command line
We were only support version from the YAML file, now support
setting directly on the command line for swupd.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-10-08 16:45:11 -07:00
Mark D Horn 48499d44da args: Enable --swupd-url for shorthand
Allow setting the version url and content url to the same value
with a single argument of --swupd-url.
Useful for mixer

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-10-08 09:41:49 -07:00
Mark D Horn 2fdace713c args: improve test coverage
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-30 17:32:36 -07:00
Mark D Horn 2e3c5bf50b Support insecure updates over HTTP
Fixes: #478

Add new --allow-insecure-http flag to support the use of HTTP URLs.
This is needed to allow swupd to download content from http sites;
generally development mixes.

Also enable the use of the setting in both the TUI and GUI to allow
the user to set a swupd mirror which is HTTP.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-30 17:32:36 -07:00
John Akre 1527c25d6d Add offline install support
When creating installer images with offline support, installation
content for a minimum set of bundles will be downloaded to the
/var/lib/clr-installer/offline-content directory inside the installer
image. The offline-content directory will be used instead of the network
to install bundles when it exists.

To generate images with offline support, the --offline command line
argument or the offline config file field can be set.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-09-23 16:08:10 -07:00
Mark D Horn bfc624d8fc model: args: Clean up of temp config files
Need a new command line arg to flag for the deletion
of a temp state YAML file.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-12 19:20:47 -07:00
Mark D Horn 7c99f7d9c8 args: tui: gui: --gui flag to force graphics mode
Now check for mutually exclusive options.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-12 19:20:47 -07:00
Mark D Horn cdc91601b8 log: Change default to debug logging
Since the installation is usually a one-time run, change the default
logging level to debug to capture details on any install issues.
This will help improve resolving customer issues when they arise.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-06-17 18:53:55 -07:00
Mark D Horn 4d119cad7f swupd: Update help to be more accurate
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-05-29 18:11:52 -07:00
Mark D Horn b04333bc87 swupd: Add support for swupd --certpath
Fixes: #228

Enable the use of an alternate swupd certificate path.
Needed for mixes.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-05-29 18:11:52 -07:00
Mark D Horn 55df2389ae network: Always copy /etc network files
When executing interactively, text-base or graphical, we want
to always copy any local /etc network configuration files to
the target system.

If the user has made customer network settings, usually with
nmcli/nmtui for console, or NetworkManager on the desktop, these
will want to be propagated to the target.

Add command line option to avoid network copy.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-05-15 12:52:04 -07:00
Brian J Lovin d9c915b94f Add system checker command line option
Add a new command line option --system-check.

When run with this option, run a system chcker and exit with a 0 or 1
for passing/failing.

Checks for required CPU features using procfs and EFI firmware using
sysfs. Prints status and results to stdout.

Signed-off-by: Brian J Lovin brian.j.lovin@intel.com
2019-04-24 16:56:14 -07:00
Mark D Horn cff36aa736 Generate ISO Framework hook
Create the command line argument and configuration file changes
to support generating an ISO from the raw image.

TODO: Integrate the ISO generation code

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-19 15:06:47 -07:00
Mark D Horn 685ae93433 swupd: bug fix for state dir init
The initial value will be set incorrectly if the swupd mirror site is set.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-03-22 12:05:48 -07:00
Mark D Horn 786a1f27b5 Download User Messages
New functionality to download Pre and Post Installer messages
TODO: Display the messages as pop-ups
- Need to use system curl command to handle proxies for now

Refactoring for enabling:
- Moved FetchRemoteConfigFile from conf to network
- Move code for Clear Linux Version parsing until a utility function
  which is called early in the flow for reuse

Now that use external curl FILE protocol passes.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-03-11 17:11:55 -07:00
Reagan Lopez f61d7092ab Add support for ister json config
- The new -j flag detects ister json config format and converts it to yaml
- The existing -c flag also detects ister json config format, converts it to yaml
  and continues as usual
- Handles the ister "rest" option for physical targets
- Handles multiple targets

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-03-05 13:55:44 -08:00
Mark D Horn 4667cb8dac New Option to clean-up swupd state directory
Fixes #215

We already default to placing the swupd state cache directory
in the installation target. This change implements the only
missing part of the request to allow removing the state directory.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-02-14 16:59:21 -08:00
Mark D Horn c43135f6ee Support Encrypted partitions
Fixes #10

Enable encrypted partitions for all but /boot.

A single passphrase is used for all partitions which enable encryption
expect swap, which currently uses a random password each boot.
NOTE: If we need to support a large swap for laptop suspend/restore, we
should change from a random passphrase to the same known passphrase.

/etc/crypttab will attempt to use either the disk label or the
UUID to identify the disk instead of the physical disk name.

Swap partition would normally loose its UUID or Label each boot
due to dm-crypt and mkswap overwriting the connect. To maintain
identification of the partition, we use a trick from here:
https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption
of creating a small (1M) ext2 partition with label at the beginning
of the swap partition, then use an offset in the /etc/crypttab to
prevent overwriting this information.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-29 12:35:26 -08:00
Leandro Dorileo cc5db70e9e args: make --skip-diskspace-check optional
Add an argument to enable or disable the swupd's --skip-diskspace-check
argument.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-11-08 15:41:02 -08:00
Leandro Dorileo 536f80ea30 swupd: add new flags
Add the swupd's --format, --contenturl and --versionurl arguments.
These arguments are mapped with the --swupd prefix such as:
--swupd-format, --swupd-contenturl and --swupd-versionurl

And are used for constrained environments dealing with local installs,
specially with image generation in a network isolated environment.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-11-08 15:41:02 -08: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 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 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
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 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
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
Leandro Dorileo 5c1b69c8d4 testsuite: prepare to enable check-coverage.sh on CI
This patch fixes the tests coverage regressions and add a small fix
to the script where it doesn't remove the temporary coverage report
file if it fails. Now it can be enabled on the CI and avoid adding
new testsuite regressions.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-19 15:56:54 -07:00
Leandro Dorileo f7acd9b8c8 args: make linters happy
FPrintf's return wasn't being checked, this patch makes the linter
happy by checking the error condition.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-07 10:58:40 -07:00
Mark D Horn e84bb0e403 First Open Source push of code base
This is code is still alpha. The Text-based User Interface is
undergoing a resign of the layout before beta.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-08-13 14:14:30 -07:00