[Libosinfo] [PATCH osinfo-db] Add a "Contribute" page

Fabiano Fidêncio fidencio at redhat.com
Thu Sep 13 13:39:55 UTC 2018


Let's add some instructions and examples on how to contribute with the
most basic scenarios of adding an OS info to osinfo-db.

--
While do think this is useful material to point to newcomers, I'm
totally fine about having it as a blogpost or somewhere else than our
git repo.

Also, I do believe that we can start growing the amount of docs/examples
we have and that it can help people to start helping us with some basic
patches of their favourite distro.

I'm looking forward to receiving some feedback about this and
suggestions on how this could be done better. :-)
--

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 CONTRIBUTE.md | 930 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 930 insertions(+)
 create mode 100644 CONTRIBUTE.md

diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md
new file mode 100644
index 0000000..f6d5790
--- /dev/null
+++ b/CONTRIBUTE.md
@@ -0,0 +1,930 @@
+# The OSes XML structure
+Firstly, let's start saying that OSes data are stored under
+`data/os/distributor` folder, where "distributor" should be named
+accordingly to the project's name.
+
+For instance, the current (by the time this document was written)
+"distributors" are:
+```
+  [fidencio at dahmer osinfo-db]$ ls data/os/
+  alpinelinux.org  centos.org        endlessos.com      gnome.org     microsoft.com  opensuse.org  suse.com
+  altlinux.org     cirros-cloud.net  fedoraproject.org  haiku-os.org  netbsd.org     oracle.com    system76.com
+  apple.com        debian.org        freebsd.org        mageia.org    novell.com     redhat.com    ubuntu.com
+  asianux.com      dragonflybsd.org  freedos.org        mandriva.com  openbsd.org    sun.com
+```
+
+Under each "distributor" folder contains the OSes and each version of the OS
+has its own data file:
+```
+  [fidencio at dahmer osinfo-db]$ ls data/os/fedoraproject.org/
+  fedora-10.xml.in  fedora-15.xml.in  fedora-1.xml.in   fedora-24.xml.in  fedora-2.xml.in  fedora-7.xml.in
+  fedora-11.xml.in  fedora-16.xml.in  fedora-20.xml.in  fedora-25.xml.in  fedora-3.xml.in  fedora-8.xml.in
+  fedora-12.xml.in  fedora-17.xml.in  fedora-21.xml.in  fedora-26.xml.in  fedora-4.xml.in  fedora-9.xml.in
+  fedora-13.xml.in  fedora-18.xml.in  fedora-22.xml.in  fedora-27.xml.in  fedora-5.xml.in  fedora-unknown.xml.in
+  fedora-14.xml.in  fedora-19.xml.in  fedora-23.xml.in  fedora-28.xml.in  fedora-6.xml.in  silverblue-28.xml.in
+```
+
+Each OS may contain a list of supported devices, as seen in the
+fedora-24.xml.in:
+```
+   <devices>
+     <device id="http://pcisig.com/pci/1af4/1050"/> <!-- virtio1.0-gpu -->
+   </devices>
+```
+
+The full list of devices can be find at `data/devices` and is seperated by the
+devices' vendors. Covering the addition of new devices is not in the scope of
+this document, though.
+
+Each OS may have support to install-scripts, as seen in the fedora-28.xml.in:
+```
+  <installer>
+    <script id='http://fedoraproject.org/fedora/kickstart/jeos'/>
+    <script id='http://fedoraproject.org/fedora/kickstart/desktop'/>
+  </installer>
+```
+
+The full list of install-scripts can be find at `data/install-script/` and is
+separated by "distributor" (in the same way as the OS data).
+
+The install-script is divided in two categories:
+- jeos: which stands for Just enough OS, that provides a "Minimal"
+  installation;
+- desktop: that provides a "Workstation" installation;
+
+Although we're not going to cover the addition of new installer scripts in
+this documment, mind to always test the installation-scripts when submitting a
+new OS that has support to it.
+
+Ideally, each OS data comes together with its ISO information which is part of
+libosinfo tests and are stored under `tests/isodata`.
+In this folder, each "distro" has its own entry:
+```
+  [fidencio at dahmer libosinfo]$ ls tests/isodata/
+  alpinelinux  asianux  debian        fedora   freedos  haiku   netbsd   opensuse  rhel  sles    windows
+  altlinux     centos   dragonflybsd  freebsd  gnome    mageia  openbsd  popos     sled  ubuntu
+```
+
+And each release of the distro has its own entry following its "short-id" name:
+```
+  [fidencio at dahmer libosinfo]$ ls tests/isodata/fedora/
+  fedora1   fedora12  fedora15  fedora18  fedora20  fedora23  fedora26  fedora3  fedora6  fedora9
+  fedora10  fedora13  fedora16  fedora19  fedora21  fedora24  fedora27  fedora4  fedora7  silverblue28
+  fedora11  fedora14  fedora17  fedora2   fedora22  fedora25  fedora28  fedora5  fedora8
+```
+
+And for each release, ideally, all ISOs released are added to our tests:
+```
+  [fidencio at dahmer libosinfo]$ ls tests/isodata/fedora/fedora28/
+  Fedora-Server-dvd-x86_64-28-1.1.iso.txt  Fedora-Server-netinst-x86_64-28-1.1.iso.txt  Fedora-Workstation-Live-x86_64-28-1.1.iso.txt
+```
+
+These "isodata" files are the output of `isodetect -d -i /path/to/the/iso`.
+
+With this basic knowledge in mind, let's cover the most 3 basic cases of adding
+new OS content to osinfo-db:
+- Updating the content of an existent release;
+- Adding a new release of an existent OS;
+- Adding a completely new OS;
+
+## Updating the content of an existent release
+Having to update the content of an existent release is a quite common case and
+may happen due to different reasons as, for instance:
+
+### Adding the end-of-life of a release
+  - https://gitlab.com/libosinfo/osinfo-db/commit/12a152b4afc74187b2d040fa38f373cd7e0a17d3
+```
+  Refs: v20170423-18-g12a152b
+  Author:     Pino Toscano <ptoscano at redhat.com>
+  AuthorDate: Fri Jul 7 13:44:05 2017 +0200
+  Commit:     Christophe Fergeau <cfergeau at redhat.com>
+  CommitDate: Thu Aug 3 16:59:07 2017 +0200
+
+      ubuntu: add EOL date for 16.10
+
+      Source:
+      https://lists.ubuntu.com/archives/ubuntu-announce/2017-July/000222.html
+  ---
+   data/os/ubuntu.com/ubuntu-16.10.xml.in | 1 +
+   1 file changed, 1 insertion(+)
+
+  diff --git a/data/os/ubuntu.com/ubuntu-16.10.xml.in b/data/os/ubuntu.com/ubuntu-16.10.xml.in
+  index 8e0ad1c..9557340 100644
+  --- a/data/os/ubuntu.com/ubuntu-16.10.xml.in
+  +++ b/data/os/ubuntu.com/ubuntu-16.10.xml.in
+  @@ -14,6 +14,7 @@
+       <derives-from id="http://ubuntu.com/ubuntu/16.04"/>
+
+       <release-date>2016-10-13</release-date>
+  +    <eol-date>2017-07-20</eol-date>
+
+       <resources arch="all">
+         <minimum>
+```
+
+  - https://gitlab.com/libosinfo/osinfo-db/commit/a9a1909e40d9051726cdd97b7130960d7cc350a0
+```
+  Refs: v20170423-17-ga9a1909
+  Author:     Pino Toscano <ptoscano at redhat.com>
+  AuthorDate: Thu Aug 3 09:52:08 2017 +0200
+  Commit:     Christophe Fergeau <cfergeau at redhat.com>
+  CommitDate: Thu Aug 3 16:59:07 2017 +0200
+
+      ubuntu: fix 16.10 locations
+
+      Ubuntu 16.10 is EOL, so switch to the archive for old releases
+  ---
+   data/os/ubuntu.com/ubuntu-16.10.xml.in | 16 ++++++++--------
+   1 file changed, 8 insertions(+), 8 deletions(-)
+
+  diff --git a/data/os/ubuntu.com/ubuntu-16.10.xml.in b/data/os/ubuntu.com/ubuntu-16.10.xml.in
+  index bea4182..8e0ad1c 100644
+  --- a/data/os/ubuntu.com/ubuntu-16.10.xml.in
+  +++ b/data/os/ubuntu.com/ubuntu-16.10.xml.in
+  @@ -30,7 +30,7 @@
+       </resources>
+
+       <media arch="i686">
+  -      <url>http://releases.ubuntu.com/releases/yakkety/ubuntu-16.10-server-i386.iso</url>
+  +      <url>http://old-releases.ubuntu.com/releases/yakkety/ubuntu-16.10-server-i386.iso</url>
+         <iso>
+           <volume-id>Ubuntu-Server 16.10(.\d)? i386</volume-id>
+         </iso>
+  @@ -38,7 +38,7 @@
+         <initrd>install/initrd.gz</initrd>
+       </media>
+       <media arch="x86_64">
+  -      <url>http://releases.ubuntu.com/releases/yakkety/ubuntu-16.10-server-amd64.iso</url>
+  +      <url>http://old-releases.ubuntu.com/releases/yakkety/ubuntu-16.10-server-amd64.iso</url>
+         <iso>
+           <volume-id>Ubuntu-Server 16.10(.\d)? amd64</volume-id>
+         </iso>
+  @@ -46,7 +46,7 @@
+         <initrd>install/initrd.gz</initrd>
+       </media>
+       <media arch="i686" live="true">
+  -      <url>http://releases.ubuntu.com/releases/yakkety/ubuntu-16.10-desktop-i386.iso</url>
+  +      <url>http://old-releases.ubuntu.com/releases/yakkety/ubuntu-16.10-desktop-i386.iso</url>
+         <iso>
+           <volume-id>Ubuntu 16.10(.\d)? i386</volume-id>
+         </iso>
+  @@ -54,7 +54,7 @@
+         <initrd>casper/initrd.lz</initrd>
+       </media>
+       <media arch="x86_64" live="true">
+  -      <url>http://releases.ubuntu.com/releases/yakkety/ubuntu-16.10-desktop-amd64.iso</url>
+  +      <url>http://old-releases.ubuntu.com/releases/yakkety/ubuntu-16.10-desktop-amd64.iso</url>
+         <iso>
+           <volume-id>Ubuntu 16.10(.\d)? amd64</volume-id>
+         </iso>
+  @@ -62,25 +62,25 @@
+         <initrd>casper/initrd.lz</initrd>
+       </media>
+       <media arch="aarch64">
+  -      <url>http://cdimage.ubuntu.com/releases/yakkety/release/ubuntu-16.10-server-arm64.iso</url>
+  +      <url>http://old-releases.ubuntu.com/releases/yakkety/ubuntu-16.10-server-arm64.iso</url>
+         <iso>
+           <volume-id>Ubuntu-Server 16.10(.\d)? arm64</volume-id>
+         </iso>
+       </media>
+       <media arch="ppc">
+  -      <url>http://cdimage.ubuntu.com/releases/yakkety/release/ubuntu-16.10-server-powerpc.iso</url>
+  +      <url>http://old-releases.ubuntu.com/releases/yakkety/ubuntu-16.10-server-powerpc.iso</url>
+         <iso>
+           <volume-id>Ubuntu-Server 16.10(.\d)? ppc</volume-id>
+         </iso>
+       </media>
+       <media arch="ppc64le">
+  -      <url>http://cdimage.ubuntu.com/releases/yakkety/release/ubuntu-16.10-server-ppc64el.iso</url>
+  +      <url>http://old-releases.ubuntu.com/releases/yakkety/ubuntu-16.10-server-ppc64el.iso</url>
+         <iso>
+           <volume-id>Ubuntu-Server 16.10(.\d)? ppc64</volume-id>
+         </iso>
+       </media>
+       <media arch="s390x">
+  -      <url>http://cdimage.ubuntu.com/releases/yakkety/release/ubuntu-16.10-server-s390x.iso</url>
+  +      <url>http://old-releases.ubuntu.com/releases/yakkety/ubuntu-16.10-server-s390x.iso</url>
+         <iso>
+           <volume-id>Ubuntu-Server 16.10(.\d)? s390x</volume-id>
+         </iso>
+```
+
+### Adding an ISO that is not yet recognized
+  This is a common case, mainly related to Windows ISOs and the more efficient
+  way to either provide a patch or a good bug report is to, as the first thing,
+  run `isoinfo -d -i /path/to/the/iso` and provide us its output. The output
+  contains the volume-id of the iso, as shown here (from a Windows 10 LTSB
+  Evaluation version):
+```
+  ...
+  Volume id: CESE_X64FREE_EN-US_DV5
+  ...
+```
+
+  The volume-id has then to be added to the specific OS data and the isoinfo
+  output has to be added to our tests.
+  Take a look on the following two commits as example:
+  - https://gitlab.com/libosinfo/osinfo-db/commit/552bba12dcfe39e6b7734333d8373338b9261e50
+```
+Refs: v20180903-8-g552bba1
+Author:     Fabiano Fidêncio <fidencio at redhat.com>
+AuthorDate: Thu Sep 6 15:30:02 2018 +0200
+Commit:     Fabiano Fidêncio <fidencio at redhat.com>
+CommitDate: Fri Sep 7 09:20:05 2018 +0200
+
+    win10: Add LTSB Evaluation media info
+
+    https://bugzilla.redhat.com/show_bug.cgi?id=1139394
+
+    Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
+    Reviewed-by: Cole Robinson <crobinso at redhat.com>
+---
+ data/os/microsoft.com/win-10.xml.in | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+diff --git a/data/os/microsoft.com/win-10.xml.in b/data/os/microsoft.com/win-10.xml.in
+index 737f6ce..32a581c 100644
+--- a/data/os/microsoft.com/win-10.xml.in
++++ b/data/os/microsoft.com/win-10.xml.in
+@@ -22,6 +22,9 @@
+     <variant id="enterprise-ltsb">
+       <_name>Microsoft Windows 10 Enterprise (Long Term Servicing Branch)</_name>
+     </variant>
++    <variant id="enterprise-ltsb-eval">
++      <_name>Microsoft Windows 10 Enterprise (Long Term Servicing Branch) Evaluation</_name>
++    </variant>
+
+     <!-- Education -->
+     <media arch="i686">
+@@ -77,6 +80,24 @@
+       </iso>
+     </media>
+
++    <!-- Enterprise LTSB (Eval) -->
++    <media arch="i686">
++      <variant id="enterprise-ltsb-eval"/>
++      <iso>
++        <volume-id>CESE_X86FREE_</volume-id>
++        <publisher-id>MICROSOFT CORPORATION</publisher-id>
++        <l10n-language regex="true" l10n-language-map="http://microsoft.com/win/8/l10n-language">[[:upper:][:digit:]_]*_([[:upper:]]*-[[:upper:]]*)</l10n
++      </iso>
++    </media>
++    <media arch="x86_64">
++      <variant id="enterprise-ltsb-eval"/>
++      <iso>
++        <volume-id>CESE_X64FREE_</volume-id>
++        <publisher-id>MICROSOFT CORPORATION</publisher-id>
++        <l10n-language regex="true" l10n-language-map="http://microsoft.com/win/8/l10n-language">[[:upper:][:digit:]_]*_([[:upper:]]*-[[:upper:]]*)</l10n
++      </iso>
++    </media>
++
+     <!-- No Variant -->
+     <media arch="i686">
+       <iso>
+```
+  - https://gitlab.com/libosinfo/libosinfo/commit/857f503f4bcd33169db8b0b5818343269e71547f
+```
+Refs: v1.2.0-18-g857f503
+Author:     Fabiano Fidêncio <fidencio at redhat.com>
+AuthorDate: Thu Sep 6 15:35:12 2018 +0200
+Commit:     Fabiano Fidêncio <fidencio at redhat.com>
+CommitDate: Fri Sep 7 09:16:32 2018 +0200
+
+    win10: Add LTSB Evaluation isodata
+
+    https://bugzilla.redhat.com/show_bug.cgi?id=1139394
+
+    Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
+    Reviewed-by: Cole Robinson <crobinso at redhat.com>
+---
+ tests/isodata/windows/win10/14393.0.160715-1616.RS1_RELEASE_CLIENTENTERPRISE_S_EVAL_X64FRE_EN-US.ISO.txt | 29 +++++++++++++++++++++++++++++
+ tests/isodata/windows/win10/14393.0.160715-1616.RS1_RELEASE_CLIENTENTERPRISE_S_EVAL_X86FRE_EN-GB.ISO.txt | 29 +++++++++++++++++++++++++++++
+ 2 files changed, 58 insertions(+)
+
+diff --git a/tests/isodata/windows/win10/14393.0.160715-1616.RS1_RELEASE_CLIENTENTERPRISE_S_EVAL_X64FRE_EN-US.ISO.txt b/tests/isodata/windows/win10/14393.
+new file mode 100644
+index 0000000..ca9c035
+--- /dev/null
++++ b/tests/isodata/windows/win10/14393.0.160715-1616.RS1_RELEASE_CLIENTENTERPRISE_S_EVAL_X64FRE_EN-US.ISO.txt
+@@ -0,0 +1,29 @@
++CD-ROM is in ISO 9660 format
++System id:
++Volume id: CESE_X64FREE_EN-US_DV5
++Volume set id: CESE_X64FREE_EN-US_DV5
++Publisher id: MICROSOFT CORPORATION
++Data preparer id: MICROSOFT CORPORATION, ONE MICROSOFT WAY, REDMOND WA 98052, (425) 882-8080
++Application id: CDIMAGE 2.56 (01/01/2005 TM)
++Copyright File id:
++Abstract File id:
++Bibliographic File id:
++Volume set size is: 1
++Volume set sequence number is: 1
++Logical block size is: 2048
++Volume size is: 1746893
++El Torito VD version 1 found, boot catalog is in sector 22
++NO Joliet present
++NO Rock Ridge present
++Eltorito validation header:
++    Hid 1
++    Arch 0 (x86)
++    ID 'Microsoft Corporation'
++    Key 55 AA
++    Eltorito defaultboot header:
++        Bootid 88 (bootable)
++        Boot media 0 (No Emulation Boot)
++        Load segment 0
++        Sys type 0
++        Nsect 8
++        Bootoff 21B 539
+diff --git a/tests/isodata/windows/win10/14393.0.160715-1616.RS1_RELEASE_CLIENTENTERPRISE_S_EVAL_X86FRE_EN-GB.ISO.txt b/tests/isodata/windows/win10/14393.
+new file mode 100644
+index 0000000..139c19f
+--- /dev/null
++++ b/tests/isodata/windows/win10/14393.0.160715-1616.RS1_RELEASE_CLIENTENTERPRISE_S_EVAL_X86FRE_EN-GB.ISO.txt
+@@ -0,0 +1,29 @@
++CD-ROM is in ISO 9660 format
++System id:
++Volume id: CESE_X86FREE_EN-GB_DV5
++Volume set id: CESE_X86FREE_EN-GB_DV5
++Publisher id: MICROSOFT CORPORATION
++Data preparer id: MICROSOFT CORPORATION, ONE MICROSOFT WAY, REDMOND WA 98052, (425) 882-8080
++Application id: CDIMAGE 2.56 (01/01/2005 TM)
++Copyright File id:
++Abstract File id:
++Bibliographic File id:
++Volume set size is: 1
++Volume set sequence number is: 1
++Logical block size is: 2048
++Volume size is: 1288647
++El Torito VD version 1 found, boot catalog is in sector 22
++NO Joliet present
++NO Rock Ridge present
++Eltorito validation header:
++    Hid 1
++    Arch 0 (x86)
++    ID 'Microsoft Corporation'
++    Key 55 AA
++    Eltorito defaultboot header:
++        Bootid 88 (bootable)
++        Boot media 0 (No Emulation Boot)
++        Load segment 0
++        Sys type 0
++        Nsect 8
++        Bootoff 219 537
+```
+
+## Adding a new release of an existent OS
+This is the most common case for submitting patches to the osinfo-db project
+and happens whenever a new release is out.
+
+It tends to be quite straightforward to do so as it's pretty much a copy aad
+past of the XML of the previous release. Here's one example of an addition
+of a new release:
+- https://gitlab.com/libosinfo/osinfo-db/commit/b4ce277defb7085350c5ee73ec62ba37728fde8b
+```
+Refs: <v20180720>
+Author:     Věra Cholasta <vbudikov at redhat.com>
+AuthorDate: Fri Jul 20 09:08:38 2018 +0200
+Commit:     Fabiano Fidêncio <fabiano at fidencio.org>
+CommitDate: Fri Jul 20 11:30:01 2018 +0200
+
+    ubuntu: Add support for Ubuntu18.04
+
+    Reviewed-by: Fabiano Fidêncio <fabiano at fidencio.org>
+---
+ data/os/ubuntu.com/ubuntu-18.04.xml.in | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 72 insertions(+)
+
+diff --git a/data/os/ubuntu.com/ubuntu-18.04.xml.in b/data/os/ubuntu.com/ubuntu-18.04.xml.in
+new file mode 100644
+index 0000000..ad13360
+--- /dev/null
++++ b/data/os/ubuntu.com/ubuntu-18.04.xml.in
+@@ -0,0 +1,72 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<libosinfo version="0.0.1">
++<!-- Licensed under the GNU General Public License version 2 or later.
++     See http://www.gnu.org/licenses/ for a copy of the license text -->
++  <os id="http://ubuntu.com/ubuntu/18.04">
++    <short-id>ubuntu18.04</short-id>
++    <short-id>ubuntubionic</short-id>
++    <_name>Ubuntu 18.04 LTS</_name>
++    <version>18.04</version>
++    <_vendor>Canonical Ltd</_vendor>
++    <family>linux</family>
++    <distro>ubuntu</distro>
++    <codename>Bionic Beaver</codename>
++    <upgrades id="http://ubuntu.com/ubuntu/17.10"/>
++    <derives-from id="http://ubuntu.com/ubuntu/17.10"/>
++
++    <release-date>2018-04-26</release-date>
++
++    <resources arch="all">
++      <minimum>
++        <cpu>1000000000</cpu>
++        <n-cpus>1</n-cpus>
++        <ram>1073741824</ram>
++        <storage>5368709120</storage>
++      </minimum>
++      <recommended>
++        <cpu>1000000000</cpu>
++        <ram>1073741824</ram>
++        <storage>16106127360</storage>
++      </recommended>
++    </resources>
++
++    <media arch="x86_64">
++      <url>http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04-server-amd64.iso</url>
++      <iso>
++        <volume-id>Ubuntu-Server 18.04(.\d)? LTS amd64</volume-id>
++      </iso>
++      <kernel>install/vmlinuz</kernel>
++      <initrd>install/initrd.gz</initrd>
++    </media>
++    <media arch="x86_64" live="true">
++      <url>http://releases.ubuntu.com/releases/bionic/ubuntu-18.04-desktop-amd64.iso</url>
++      <iso>
++        <volume-id>Ubuntu 18.04(.\d)? LTS amd64</volume-id>
++      </iso>
++      <kernel>casper/vmlinuz</kernel>
++      <initrd>casper/initrd.lz</initrd>
++    </media>
++    <media arch="aarch64">
++      <url>http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04-server-arm64.iso</url>
++      <iso>
++        <volume-id>Ubuntu-Server 18.04(.\d)? LTS arm64</volume-id>
++      </iso>
++    </media>
++    <media arch="ppc64le">
++      <url>http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04-server-ppc64el.iso</url>
++      <iso>
++        <volume-id>Ubuntu-Server 18.04(.\d)? LTS ppc64</volume-id>
++      </iso>
++    </media>
++    <media arch="s390x">
++      <url>http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04-server-s390x.iso</url>
++      <iso>
++        <volume-id>Ubuntu-Server 18.04(.\d)? LTS s390x</volume-id>
++      </iso>
++    </media>
++
++    <installer>
++      <script id='http://ubuntu.com/ubuntu/preseed/jeos'/>
++    </installer>
++  </os>
++</libosinfo>
+```
+- https://gitlab.com/libosinfo/libosinfo/commit/91e9e7ccc6588021a220d4cdaa6f832935b35124
+```
+Refs: v1.2.0-7-g91e9e7c
+Author:     Věra Cholasta <vbudikov at redhat.com>
+AuthorDate: Fri Jul 20 09:09:01 2018 +0200
+Commit:     Fabiano Fidêncio <fabiano at fidencio.org>
+CommitDate: Fri Jul 20 10:14:10 2018 +0200
+
+    ubuntu: Add test files for Ubuntu18.04
+
+    Reviewed-by: Fabiano Fidêncio <fabiano at fidencio.org>
+---
+ tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-desktop-amd64.iso.txt  | 29 +++++++++++++++++++++++++++++
+ tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-amd64.iso.txt   | 29 +++++++++++++++++++++++++++++
+ tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-arm64.iso.txt   | 29 +++++++++++++++++++++++++++++
+ tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-ppc64el.iso.txt | 17 +++++++++++++++++
+ tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-s390x.iso.txt   | 29 +++++++++++++++++++++++++++++
+ 5 files changed, 133 insertions(+)
+
+diff --git a/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-desktop-amd64.iso.txt b/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-desktop-amd64.iso.txt
+new file mode 100644
+index 0000000..025620f
+--- /dev/null
++++ b/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-desktop-amd64.iso.txt
+@@ -0,0 +1,29 @@
++CD-ROM is in ISO 9660 format
++System id:
++Volume id: Ubuntu 18.04 LTS amd64
++Volume set id:
++Publisher id:
++Data preparer id: XORRISO-1.2.4 2012.07.20.130001, LIBISOBURN-1.2.4, LIBISOFS-1.2.4, LIBBURN-1.2.4
++Application id:
++Copyright File id:
++Abstract File id:
++Bibliographic File id:
++Volume set size is: 1
++Volume set sequence number is: 1
++Logical block size is: 2048
++Volume size is: 938400
++El Torito VD version 1 found, boot catalog is in sector 201
++Joliet with UCS level 3 found
++Rock Ridge signatures version 1 found
++Eltorito validation header:
++    Hid 1
++    Arch 0 (x86)
++    ID ''
++    Key 55 AA
++    Eltorito defaultboot header:
++        Bootid 88 (bootable)
++        Boot media 0 (No Emulation Boot)
++        Load segment 0
++        Sys type 0
++        Nsect 4
++        Bootoff DFC5B 916571
+diff --git a/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-amd64.iso.txt b/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-amd64.iso.txt
+new file mode 100644
+index 0000000..124804d
+--- /dev/null
++++ b/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-amd64.iso.txt
+@@ -0,0 +1,29 @@
++CD-ROM is in ISO 9660 format
++System id:
++Volume id: Ubuntu-Server 18.04 LTS amd64
++Volume set id:
++Publisher id:
++Data preparer id: XORRISO-1.2.4 2012.07.20.130001, LIBISOBURN-1.2.4, LIBISOFS-1.2.4, LIBBURN-1.2.4
++Application id:
++Copyright File id:
++Abstract File id:
++Bibliographic File id:
++Volume set size is: 1
++Volume set sequence number is: 1
++Logical block size is: 2048
++Volume size is: 360448
++El Torito VD version 1 found, boot catalog is in sector 2110
++Joliet with UCS level 3 found
++Rock Ridge signatures version 1 found
++Eltorito validation header:
++    Hid 1
++    Arch 0 (x86)
++    ID ''
++    Key 55 AA
++    Eltorito defaultboot header:
++        Bootid 88 (bootable)
++        Boot media 0 (No Emulation Boot)
++        Load segment 0
++        Sys type 0
++        Nsect 4
++        Bootoff D100 53504
+diff --git a/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-arm64.iso.txt b/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-arm64.iso.txt
+new file mode 100644
+index 0000000..ce42a5e
+--- /dev/null
++++ b/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-arm64.iso.txt
+@@ -0,0 +1,29 @@
++CD-ROM is in ISO 9660 format
++System id:
++Volume id: Ubuntu-Server 18.04 LTS arm64
++Volume set id:
++Publisher id:
++Data preparer id: XORRISO-1.2.4 2012.07.20.130001, LIBISOBURN-1.2.4, LIBISOFS-1.2.4, LIBBURN-1.2.4
++Application id:
++Copyright File id:
++Abstract File id:
++Bibliographic File id:
++Volume set size is: 1
++Volume set sequence number is: 1
++Logical block size is: 2048
++Volume size is: 342740
++El Torito VD version 1 found, boot catalog is in sector 3998
++Joliet with UCS level 3 found
++Rock Ridge signatures version 1 found
++Eltorito validation header:
++    Hid 1
++    Arch 239 (Unknown Arch)
++    ID ''
++    Key 55 AA
++    Eltorito defaultboot header:
++        Bootid 88 (bootable)
++        Boot media 0 (No Emulation Boot)
++        Load segment 0
++        Sys type 0
++        Nsect 380
++        Bootoff 182AF 98991
+diff --git a/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-ppc64el.iso.txt b/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-ppc64el.iso.txt
+new file mode 100644
+index 0000000..d7c9249
+--- /dev/null
++++ b/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-ppc64el.iso.txt
+@@ -0,0 +1,17 @@
++CD-ROM is in ISO 9660 format
++System id: LINUX
++Volume id: Ubuntu-Server 18.04 LTS ppc64
++Volume set id:
++Publisher id:
++Data preparer id:
++Application id: GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM
++Copyright File id:
++Abstract File id:
++Bibliographic File id:
++Volume set size is: 1
++Volume set sequence number is: 1
++Logical block size is: 2048
++Volume size is: 377082
++CD-ROM uses ISO 9660:1999 relaxed format
++NO Joliet present
++Rock Ridge signatures version 1 found
+diff --git a/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-s390x.iso.txt b/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-s390x.iso.txt
+new file mode 100644
+index 0000000..19c702d
+--- /dev/null
++++ b/tests/isodata/ubuntu/ubuntu18.04/ubuntu-18.04-server-s390x.iso.txt
+@@ -0,0 +1,29 @@
++CD-ROM is in ISO 9660 format
++System id: LINUX
++Volume id: Ubuntu-Server 18.04 LTS s390x
++Volume set id:
++Publisher id:
++Data preparer id:
++Application id: GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM
++Copyright File id:
++Abstract File id:
++Bibliographic File id:
++Volume set size is: 1
++Volume set sequence number is: 1
++Logical block size is: 2048
++Volume size is: 289280
++El Torito VD version 1 found, boot catalog is in sector 1934
++Joliet with UCS level 3 found
++Rock Ridge signatures version 1 found
++Eltorito validation header:
++    Hid 1
++    Arch 0 (x86)
++    ID ''
++    Key 55 AA
++    Eltorito defaultboot header:
++        Bootid 88 (bootable)
++        Boot media 0 (No Emulation Boot)
++        Load segment 0
++        Sys type 0
++        Nsect FFFFE610
++        Bootoff 78F 1935
+```
+
+### ISOs with the same volume-id
+Please, mind that there are cases where the ISOs will have exactly the same
+"volume-id" and it's actually a quite common case.
+Let's take, for instance, the NetBSD 8.0 media info:
+- https://gitlab.com/libosinfo/osinfo-db/blob/wip/contribute/data/os/netbsd.org/netbsd-8.0.xml.in
+```
+<libosinfo version="0.0.1">
+
+  <os id="http://netbsd.org/netbsd/8.0">
+    <short-id>netbsd8.0</short-id>
+    <_name>NetBSD 8.0</_name>
+    <version>8.0</version>
+    <_vendor>NetBSD Project</_vendor>
+    <family>netbsd</family>
+    <distro>netbsd</distro>
+    <upgrades id="http://netbsd.org/netbsd/7.1.2"/>
+    <derives-from id="http://netbsd.org/netbsd/7.1.2"/>
+
+    <release-date>2018-07-17</release-date>
+
+    <media arch="x86_64">
+      <url>https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.0/images/NetBSD-8.0-amd64.iso</url>
+      <iso>
+        <system-id>NetBSD</system-id>
+        <volume-id>NETBSD_80</volume-id>
+        <volume-size>750526464</volume-size>
+      </iso>
+    </media>
+    ...
+    <media arch="i686">
+      <url>https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.0/images/NetBSD-8.0-i386.iso</url>
+      <iso>
+        <system-id>NetBSD</system-id>
+        <volume-id>NETBSD_80</volume-id>
+        <volume-size>709455872</volume-size>
+      </iso>
+    </media>
+    ...
+  </os>
+</libosinfo>
+
+```
+There you can see that the volume-id is the same (NETBSD_80) for all the ISOs
+provided by the distro.
+When dealing with those cases, the path taken to differentiate the ISOs is by
+their volume-size, which os part of the <iso> section. Let's take a look on
+those ISOs' info to understand how the volume-size has been calculated.
+- https://gitlab.com/libosinfo/libosinfo/blob/master/tests/isodata/netbsd/netbsd8.0/NetBSD-8.0-amd64.iso.txt
+```
+Setting input-charset to 'UTF-8' from locale.
+CD-ROM is in ISO 9660 format
+System id: NetBSD
+Volume id: NETBSD_80
+Volume set id:
+Publisher id: THE_NETBSD_PROJECT
+Data preparer id:
+Application id:
+Copyright File id:
+Abstract File id:
+Bibliographic File id:
+Volume set size is: 1
+Volume set sequence number is: 1
+Logical block size is: 2048
+Volume size is: 366468
+El Torito VD version 1 found, boot catalog is in sector 19
+NO Joliet present
+
+SUSP signatures version 1 found
+Rock Ridge signatures version 1 found
+Rock Ridge id 'IEEE_P1282'
+Eltorito validation header:
+    Hid 1
+    Arch 0 (x86)
+    ID ''
+    Cksum AA 55 OK
+    Key 55 AA
+    Eltorito defaultboot header:
+        Bootid 88 (bootable)
+        Boot media 0 (No Emulation Boot)
+        Load segment 0
+        Sys type 0
+        Nsect 4
+        Bootoff 214 532
+```
+The volume size of this ISO is its logical block size (2048)  multiplied by its
+volume size (366468): 2048 x 366468 = 750526464.
+
+- https://gitlab.com/libosinfo/libosinfo/blob/master/tests/isodata/netbsd/netbsd8.0/NetBSD-8.0-i386.iso.txt
+```
+Setting input-charset to 'UTF-8' from locale.
+CD-ROM is in ISO 9660 format
+System id: NetBSD
+Volume id: NETBSD_80
+Volume set id:
+Publisher id: THE_NETBSD_PROJECT
+Data preparer id:
+Application id:
+Copyright File id:
+Abstract File id:
+Bibliographic File id:
+Volume set size is: 1
+Volume set sequence number is: 1
+Logical block size is: 2048
+Volume size is: 346414
+El Torito VD version 1 found, boot catalog is in sector 19
+NO Joliet present
+
+SUSP signatures version 1 found
+Rock Ridge signatures version 1 found
+Rock Ridge id 'IEEE_P1282'
+Eltorito validation header:
+    Hid 1
+    Arch 0 (x86)
+    ID ''
+    Cksum AA 55 OK
+    Key 55 AA
+    Eltorito defaultboot header:
+        Bootid 88 (bootable)
+        Boot media 0 (No Emulation Boot)
+        Load segment 0
+        Sys type 0
+        Nsect 4
+        Bootoff 14 20
+```
+The volume size of this ISO is its logical block size (2048) multiplied by its
+volume size (346414): 2048 x 346414 = 709455872.
+
+## Adding a completely new OS
+Adding a completely new OS is not that different than adding the info of a new
+release of an existent OS.
+
+The main difference is that the "distributor" folder will have to be created on
+osinfo-db side and the "distro" and "short-id" folders will have to be created
+on libosinfo side.
+
+Here's an example of a new addition to the osinfo-db:
+- https://gitlab.com/libosinfo/osinfo-db/commit/3abb6f27337ddac627dd7cb217d5a3515487204b
+```
+Refs: v20180903-19-g3abb6f2
+Author:     Fabiano Fidêncio <fidencio at redhat.com>
+AuthorDate: Fri Sep 7 11:18:19 2018 +0200
+Commit:     Fabiano Fidêncio <fidencio at redhat.com>
+CommitDate: Tue Sep 11 22:35:30 2018 +0200
+
+    haiku: Add R1/Alpha1 media info
+
+    The mouse doesn't work at all in R1/Alpha1.
+
+    https://bugzilla.redhat.com/show_bug.cgi?id=1092627
+
+    Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
+    Reviewed-by: Cole Robinson <crobinso at redhat.com>
+---
+ data/os/haiku-os.org/haiku-r1alpha1.xml.in | 35 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 35 insertions(+)
+
+diff --git a/data/os/haiku-os.org/haiku-r1alpha1.xml.in b/data/os/haiku-os.org/haiku-r1alpha1.xml.in
+new file mode 100644
+index 0000000..af9301f
+--- /dev/null
++++ b/data/os/haiku-os.org/haiku-r1alpha1.xml.in
+@@ -0,0 +1,35 @@
++<libosinfo version="0.0.1">
++  <os id="http://haiku-os.org/haiku/r1alpha1">
++    <short-id>haikur1alpha1</short-id>
++    <_name>Haiku R1/Alpha1</_name>
++    <version>r1alpha1</version>
++    <_vendor>Haiku, Inc.</_vendor>
++    <family>beos</family>
++    <distro>haiku</distro>
++
++    <release-date>2009-09-14</release-date>
++    <eol-date>2010-05-10</eol-date>
++
++    <media arch="i686" live="true">
++      <iso>
++        <volume-id>Haiku</volume-id>
++        <system-id>FreeBSD</system-id>
++        <volume-size>398305280</volume-size>
++      </iso>
++    </media>
++
++    <resources arch="all">
++      <minimum>
++        <cpu>1000000000</cpu>
++        <n-cpus>1</n-cpus>
++        <ram>536870912</ram>
++        <storage>2147483648</storage>
++      </minimum>
++      <recommended>
++        <cpu>1000000000</cpu>
++        <ram>1073741824</ram>
++        <storage>4294967296</storage>
++      </recommended>
++    </resources>
++  </os>
++</libosinfo>
+```
+- https://gitlab.com/libosinfo/libosinfo/commit/08b9785488925e2ee95def6c786c127319573c67
+```
+Refs: v1.2.0-31-g08b9785
+Author:     Fabiano Fidêncio <fidencio at redhat.com>
+AuthorDate: Fri Sep 7 11:21:18 2018 +0200
+Commit:     Fabiano Fidêncio <fidencio at redhat.com>
+CommitDate: Tue Sep 11 22:17:31 2018 +0200
+
+    haiku: Add R1/Alpha1 isodata
+
+    https://bugzilla.redhat.com/show_bug.cgi?id=1092627
+
+    Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
+    Reviewed-by: Cole Robinson <crobinso at redhat.com>
+---
+ tests/isodata/haiku/haikur1alpha1/haiku-r1alpha1.iso.txt | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+
+diff --git a/tests/isodata/haiku/haikur1alpha1/haiku-r1alpha1.iso.txt b/tests/isodata/haiku/haikur1alpha1/haiku-r1alpha1.iso.txt
+new file mode 100644
+index 0000000..805c497
+--- /dev/null
++++ b/tests/isodata/haiku/haikur1alpha1/haiku-r1alpha1.iso.txt
+@@ -0,0 +1,29 @@
++CD-ROM is in ISO 9660 format
++System id: FreeBSD
++Volume id: Haiku
++Volume set id:
++Publisher id:
++Data preparer id:
++Application id: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING
++Copyright File id:
++Abstract File id:
++Bibliographic File id:
++Volume set size is: 1
++Volume set sequence number is: 1
++Logical block size is: 2048
++Volume size is: 194485
++El Torito VD version 1 found, boot catalog is in sector 1607
++NO Joliet present
++Rock Ridge signatures version 1 found
++Eltorito validation header:
++    Hid 1
++    Arch 0 (x86)
++    ID ''
++    Key 55 AA
++    Eltorito defaultboot header:
++        Bootid 88 (bootable)
++        Boot media 3 (2.88MB Floppy)
++        Load segment 0
++        Sys type 0
++        Nsect 1
++        Bootoff 648 1608
+```
+
+## Ensure that your changes do **not** break the current tests
+Before submitting a patch, please, do:
+osinfo-db:
+```
+[fidencio at dahmer osinfo-db]$ make
+  I18N      data/datamap/microsoft.com/win-7-l10n-language.xml
+  I18N      data/datamap/microsoft.com/win-8-l10n-language-reverse.xml
+  I18N      data/datamap/microsoft.com/win-8-l10n-
+  ...
+[fidencio at dahmer osinfo-db]$ export OSINFO_SYSTEM_DIR=$PWD/data
+```
+
+libosinfo:
+```
+[fidencio at dahmer libosinfo]$ make check LIBOSINFO_NETWORK_TESTS=1
+
+```
-- 
2.17.1




More information about the Libosinfo mailing list