Commit Graph

15 Commits

Author SHA1 Message Date
Fabiano Fidêncio 4d3b756e70 unattended: Use generate_*_for_tree()
Let's use generate_for_tree() and generate_command_line_for_tree()
methods whenever it's possible.

This method, similarly to generate_for_media() and
generate_command_line_for_media() will take an OsinfoTree as parameter
and will use its info in order to better decide how to properly generate
the install-script and kernel command-line.

It's important to mention that those APIs are part of libosinfo v1.6.0
release and that's the reason the check for them has been added.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-16 16:54:30 -04:00
Fabiano Fidêncio 6aa18520c6 unattended, installer: Pass _OsTree to prepare_install_script()
Later on, it'll be used to generate the install-script and the kernel
command-line based on the specific tree being used.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-16 16:54:30 -04:00
Fabiano Fidêncio 0a3dcdd1b9 installertreemedia: Add get_os_tree()
Let's allow to get the tree object from InstallerTreeMedia class.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-16 16:54:30 -04:00
Fabiano Fidêncio 5c494cef66 installertreemedia: Add os_tree to the _LocationData class
Let's get the _OsTree object and have it added to the _LocationData
class.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-16 16:54:30 -04:00
Fabiano Fidêncio 016cc1d866 urldetect: Add get_os_tree()
Let's add a method that allows the tree object to be retrieved from the
_DistroTree class.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-16 16:54:29 -04:00
Fabiano Fidêncio 6c15382847 urldetect: Store _OsTree object
As already done for _OsMedia, let's store the _OsTree object detected
as it'll be used later on in order to improve the installer script and
the kernel command line used for (tree based) unattended installations.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-16 16:54:29 -04:00
Cole Robinson a15770fbaf Fix codespell errors 2019-07-12 16:10:39 -04:00
Fabiano Fidêncio e5980863dd unattended: Always set "media" as install-source for ISOs
Let's set "media" as installation source for all the ISOs, even the
net-installer ones, as this can be dealt with on osinfo-db side.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-12 15:07:22 -04:00
Fabiano Fidêncio e775dd09f6 unattended: Use generate_*_for_media when possible
Let's use generate_for_media() generate_command_line_for_media() methods
whenever it's possible.

This method, differently from generate() and generate_command_line(),
will take an OsinfoMedia as parameter and will use its info in order to
better decide how to properly generate the install-script and the kernel
command-line.

It's important to mention that those APIs were released as part of
libosinfo v0.2.12, from May 26th, 2015. Knowing it's out for 4+ years
from the moment of this comment, I'm taken the path as not checking
whether the libosinfo used has this API or not.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-12 15:07:22 -04:00
Fabiano Fidêncio a3b9d6ffc4 unattended: Pass OsinfoMedia to OSInstallScript
Let's pass the OsinfoMedia object down to the OSInstallScript class so
it can be used, later on, to generate the install-script and kernel
command-line specifically for the media being used.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-12 15:07:22 -04:00
Fabiano Fidêncio 6d8bf5dff1 unattended: Simplify _generate_debug()
Instead of a creating a new Config object and setting and the needed
fields, let's just save the original user & admin passwords, set the
"[SCRUBBLED]" one for generating the debug output, and reset the
original values after that.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-12 15:07:22 -04:00
Fabiano Fidêncio 51d28f042b unattended: Don't log user & admin passwords
Logging user & admin passwords in the command-line is a security issue,
let's avoid doing so by:
- Not printing the values set by the user when setting up the
install-script config file;
- Removing the values used in the install-scripts, when printing their
content;

'CVE-2019-10183' has been assigned to the virt-install --unattended
admin-password=xxx disclosure issue.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-03 13:25:26 -04:00
Fabiano Fidêncio 58c6876450 unattended: Read the passwords from a file
Let's not expose the user/root password in the CLI and, instead, let's
rely on a file passed by the admin and read the password from there.

'CVE-2019-10183' has been assigned to the virt-install --unattended
admin-password=xxx disclosure issue.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-03 13:25:26 -04:00
Cole Robinson 6215c86fa2 virt-install: Warn about --location $DIR needing extra args
https://bugzilla.redhat.com/show_bug.cgi?id=1677019
2019-06-17 00:12:32 -04:00
Cole Robinson e9439a8ef1 virtinst: Move multiple installer .py files to virtinst/install/ 2019-06-17 00:12:32 -04:00