summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update NEWS for 1.3.0 releasev1.3.0Daniel P. Berrangé2019-01-301-0/+27
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Refresh translations from zanataDaniel P. Berrangé2019-01-3095-14834/+18261
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* test-os: Fix make syntax-checkFabiano Fidêncio2019-01-241-16/+16
| | | | | | | While applying the last patches a few trailing whitespaces have been introduced, making `make syntax-check` fail. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
* tools: Remove a reference to fedorahosted.orgFabiano Fidêncio2019-01-241-1/+1
| | | | | | | | | Although it's just the id used for the install script, let's remove the reference to the already sunset fedorahosted.org and just use "https://libosinfo.org/config" as the id. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* test-os: Add basic test for resourcesFabiano Fidêncio2019-01-242-0/+90
| | | | | | | | This test only ensures that libosinfo is able to properly load the resource info from an OS entry. Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* os: Make get_resources_*_without_inheritance() staticFabiano Fidêncio2019-01-243-47/+4
| | | | | | | With that we can get rid of osinfo_os_private.h Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* loader: Deal with network-install resourcesFabiano Fidêncio2019-01-241-0/+8
| | | | | Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* os: Deal with network-install resourcesFabiano Fidêncio2019-01-244-0/+65
| | | | | | | | | | | | | | network-install resources represent the resources to be used during a network installation. It may differs from the minimum resources as the network installers (not only the medias, but the trees) may download a huge amount of data to the RAM* consuming way more than the minimum or recommended RAM for the OS. *: anaconda downloads the whole stage2 of the installer into the RAM in order to perform a network installation. Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* test-os: Fix typo in resources testsFabiano Fidêncio2019-01-241-1/+1
| | | | | | | osinfo_os_get_recommended_resources -> osinfo_os_get_maximum_resources Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* loader: Fix typo when loading maximum resourcesFabiano Fidêncio2019-01-241-1/+1
| | | | | | | osinfo_os_add_recommended_resources -> osinfo_os_add_maximum_resources Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* os: Make get_maximum_resources() aware of inheritanceFabiano Fidêncio2019-01-242-2/+20
| | | | | Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* os: Group get_*_resources() togetherFabiano Fidêncio2019-01-241-33/+32
| | | | | Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* os: Remove extra line from _get_recommended_resources()Fabiano Fidêncio2019-01-241-1/+0
| | | | | Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* os: Fix typos in resources methodsFabiano Fidêncio2019-01-241-1/+1
| | | | | | | | methos -> method *private! -> *private*! Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* db: improve _guess_os_from_media() checksFabiano Fidêncio2019-01-151-0/+7
| | | | | | | | Do not check against a distro which doesn't have *any* of the values we use to check as match_regex() would just match whatever we compare to it. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
* tree: fix typo in the annotations: 'and' -> 'an'Fabiano Fidêncio2019-01-151-1/+1
| | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
* loader: improve warning message from loader_check_id()Fabiano Fidêncio2019-01-091-1/+1
| | | | | | | "should" needs to be changed to "must" as since commit 00f258a6be libosinfo refuses to load non-compliant named files. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
* README: Update download informationFabiano Fidêncio2019-01-091-2/+2
| | | | | | | Let's point to https://libosinfo.org/download/ instead of pointing to pagure, as it could change again in the future. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
* dragonflybsd: Add 5.4.1 test dataFabiano Fidêncio2019-01-041-0/+29
| | | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
* loader: refuse to load non-compliant named filesFabiano Fidêncio2019-01-041-8/+7
| | | | | | | | | There was a period of grace needed for backwards compatibility. After 3+ years, we can safely remove the code instroduced as part of 09ae3cf09 (which was released on 0.3.0). Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
* README: Reword the patch submission paragraphFabiano Fidêncio2019-01-041-2/+2
| | | | | | | | | Just mention that the libosinfo's mailing list is the *preferred* way to send patches. More info, as the one about the project accepting Merge Request, can be found in the project's website. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
* README: Update download linkFabiano Fidêncio2019-01-041-1/+1
| | | | | | | | Let's point to pagure instead of referring to the already sunset fedorahosted. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
* endlessos: Add Endless OS 3.4 isodataFelipe Borges2019-01-0412-0/+348
| | | | | | Signed-off-by: Felipe Borges <feborges@redhat.com> Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
* Use g_list_free_full where easily possiblePino Toscano2018-12-209-54/+20
| | | | | | | | | | Use g_list_free_full instead of g_list_foreach + g_list_free, so the lists are cleared with a single call. test-isodetect gets a void* wrapper, so there is no need to add casts everywhere. Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* media: Pass the source object to GTask newFabiano Fidêncio2018-12-201-1/+1
| | | | | | | | | | | | | | When creating the new GTask in osinfo_media_create_from_location_async, no source object has been passed. Consequently search_ppc_bootinfo_callback receives NULL as its source object, causing warnings when trying to unref it. Let's just pass the stream as the source object of the GTask in osinfo_media_create_from_location_async in order to avoid the issue. The issue has been introduced as part of 29f97cb7648. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
* media: Don't try to unref a NULL entryFabiano Fidêncio2018-12-201-1/+0
| | | | | | | In case g_file_read_finish() fails, the stream will always be NULL. The issue has been introduced as part of f977527c82. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
* media: Check whether PPC ISOs are bootableFabiano Fidêncio2018-12-202-7/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PPC ISOs do not have the "El Torito" extension that describes whether the media is bootable or not. However, they have a "bootinfo.txt" file placed under "ppc" directory in order to specify the media is bootable. So, let's add a few more checks looking for "/ppc/bootinfo.txt" in case the El Torito header is not found. The whole implementation has been based on the following sources: - The ISO 9660 (ECMA-119) specification: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-119.pdf - The ISO 9660 osdev wiki page: https://wiki.osdev.org/ISO_9660 - IBM's developer article: https://www.ibm.com/developerworks/linux/library/l-detecting-bootable-ibm-power-server-iso-images/index.html And what the implementation does is: - Access the *root* directory record, which has a fixed size of 33 bytes and is located at the bytes offset 156 of the PVD; - Load the *root* directory record extent content into the memory and: - Search for the the dir/file we're looking at; - In the dir is present, we load its directory record extent content into the memory and search for the next dir/file; - In case the file is present, we return that the media is bootable; - Otherwise, we return the media is non bootable; Mind, though, that this code is *not* generic enough to be adapted in case we want to search for a different dir/file and the reason for that is related to some ISOs using a TRANS.TBL table that translates the given name of a file to the shown name of the same file. If, for some reason, we ever want to take the path of having this code more generic we'd have to: - For each directory acessed, search for TRANS.TBL; - In case it's present, load its content into a hash table and, for each dir/file, check the name of the file we're looking for with the shown name (only present in the TRANS.TBL; - Otherwise, just follow the very same code we currently have; The decision for not implementing this TRANS.TBL changes is, mainly, because it'd make the code circa twice slower than it currently is (as we'd have to search for the TRANS.TBL as the first thing ...) without any specific gain for the needs we have right now. In case there's the need, in the future, it could be implemented in the way described here. https://gitlab.com/libosinfo/libosinfo/issues/8 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* media: Add set_non_bootable_media_error()Fabiano Fidêncio2018-12-201-4/+9
| | | | | | | | | This is a helper to set the "non bootable" error for a media. It'll become really handy in the next few patches in the series in order to avoid code duplication. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* media: Add create_from_location_async_data()Fabiano Fidêncio2018-12-201-34/+44
| | | | | | | | | This is a helper to create the OsinfoMedia from the CreateFromLocationAsyncData. It'll become really handy in the next few patches in the series in order to avoid code duplication. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* media: Use G_STATIC_ASSERT()Fabiano Fidêncio2018-12-201-3/+2
| | | | | | | | Let's use G_STATIC_ASSERT() instead of creating a dummy array to check the size of the _PrimaryVolumeDescriptor struct. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* media: Use better naming for goto labelsFabiano Fidêncio2018-12-201-8/+8
| | | | | | | | Let's replace EXIT for cleanup and ON_ERROR for error and follow a normal naming convention for the labels. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* media: Don't leak stream in case of errorsFabiano Fidêncio2018-12-201-0/+3
| | | | | | | | stream has to be freed whenever an error occurr on osinfo_media_create_from_location_async() internals. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* tools,install-script: Add "installation-source" parameterFabiano Fidêncio2018-12-201-0/+15
| | | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* test-install-script: Cover _(get|set)_installation_source()Fabiano Fidêncio2018-12-201-0/+24
| | | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* install-script: Add _(get|set)_installation_source()Fabiano Fidêncio2018-12-203-1/+71
| | | | | | | | | | As install-scripts may behave differently depending on their installation source, let's add two new methods to properly set what's the installation source being used with the script and then decide what we should do depending on the installation-source value. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* test-install-script: Cover _(get|set)_preferred_injection_method()Fabiano Fidêncio2018-12-202-0/+28
| | | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* install-script: Add _(get|set)_preferred_injection_method()Fabiano Fidêncio2018-12-203-0/+96
| | | | | | | | | | | | | | | | | | | | | Those new methods are going to be used to tell the install-scripts whether the injection-method that's going to be used is. We have to do so as the command-line may be different depending on the injection-method used, for example: - fedora using cdrom, disk or floppy: ks=hd:/(vda|sda)/fedora.ks - fedora using initrd: ks=file:/fedora.ks It's important to mention that although the methods are taking GFlags, those are treated as GEnum and only one value is expected to be set, as mentioned in the documentation. Also, mind that the usage of osinfo_entity_set_param() to store the nick of the OSINFO_INSTALL_SCRIPT_INJECTION_METHOD_* is intentional as the nick is exactly what's going to be used in the install-scripts to generate the proper command-line. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* freebsd: add FreeBSD 12.0 isodataRoman Bogorodskiy2018-12-174-0/+116
| | | | | Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* android-x86: Add Android-x86 8.1 test dataFelipe Borges2018-12-142-0/+58
| | | | | Signed-off-by: Felipe Borges <felipeborges@gnome.org> Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* test-media: Add tests for OsinfoMedia attributesFabiano Fidêncio2018-12-143-0/+106
| | | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* tests: Add basic tests for OsinfoMediaFabiano Fidêncio2018-12-143-0/+64
| | | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* media: Add _supports_installer_script()Fabiano Fidêncio2018-12-143-1/+68
| | | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* loader: Deal with "installer-script" media attributeFabiano Fidêncio2018-12-141-0/+9
| | | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* dragonflybsd: Add 5.4.0 test dataFabiano Fidêncio2018-12-141-0/+29
| | | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com>
* tree: cleanup non-fatal errors in load_key_info()Fabiano Fidêncio2018-12-111-0/+7
| | | | | | | | | | | | | | | | | There are errors which are not fatal and just ignored in load_keyinfo. However, as those have not been cleaned up, we could see messages like: (lt-osinfo-detect:20658): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: Key file does not have key “boot.iso” in group “images-x86_64” In order to avoid this, let's just call g_clear_error() after situations where an error may have been set but it can just be ignored. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
* tree: cleanup load_key_info()Fabiano Fidêncio2018-12-111-28/+35
| | | | | | | | | Instead of doing the same checks for key or group not found all over the place, let's just add a new function that does that and replace the old check for the new function. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
* os: Fix _find_install_script() annotationFabiano Fidêncio2018-12-101-1/+1
| | | | | | | | osinfo_os_find_install_script() returns an object which ownsership is not transferred. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
* db: improve _guess_os_from_tree() checksFabiano Fidêncio2018-12-101-4/+12
| | | | | | | | Do not check against a distro which doesn't have treeinfo data as match_regex() would just match whatever we compare to it. Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org> Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
* test-os: Cover osinfo_tree_has_treeinfo()Fabiano Fidêncio2018-12-102-8/+25
| | | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
* tree: Add osinfo_tree_has_treeinfo()Fabiano Fidêncio2018-12-104-0/+47
| | | | | | | | | | As not all the "trees" we stored in osinfo-db have "treeinfo" data, let's add a new method, osinfo_tree_has_treeinfo(), that can be used to check whether the tree has treeinfo or not. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Christophe Fergeau <cfergeau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>