Add openeuler osinfo into osinfo-db

This commit is contained in:
lei_ju 2020-11-02 11:37:27 +08:00
parent 8ee44c9a3a
commit 52a23bfbfc
2 changed files with 221 additions and 5 deletions

View File

@ -0,0 +1,202 @@
From b8a15e78916f50f08a03185bd3d0bd9766633b58 Mon Sep 17 00:00:00 2001
From: leiju <lj3074194431@163.com>
Date: Mon, 2 Nov 2020 09:08:30 +0800
Subject: [PATCH] Add openeuler osinfo
diff --git a/install-script/openeuler.org/openeuler-kickstart-jeos.xml b/install-script/openeuler.org/openeuler-kickstart-jeos.xml
new file mode 100644
index 0000000..470b919
--- /dev/null
+++ b/install-script/openeuler.org/openeuler-kickstart-jeos.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<libosinfo version="0.0.1">
+
+ <install-script id='http://openeuler.org/openeuler/kickstart/jeos'>
+ <profile>jeos</profile>
+ <expected-filename>openeuler.ks</expected-filename>
+ <config>
+ <param policy="required" name="admin-password"/>
+ <param value-map="http://x.org/x11-keyboard" policy="optional" name="l10n-keyboard"/>
+ <param policy="optional" name="l10n-language"/>
+ <param policy="optional" name="l10n-timezone"/>
+ <param policy="optional" name="target-disk"/>
+ <param policy="optional" name="script-disk"/>
+ </config>
+ <injection-method>cdrom</injection-method>
+ <injection-method>disk</injection-method>
+ <template>
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <xsl:output method="text"/>
+
+ <xsl:template name="target-disk">
+ <xsl:choose>
+ <xsl:when test="config/target-disk != ''">
+ <xsl:value-of select="config/target-disk"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>/dev/sda</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="script-disk">
+ <xsl:variable name="script-disk">
+ <xsl:value-of select="config/script-disk"/>
+ </xsl:variable>
+ <xsl:value-of select="substring-after($script-disk, '/dev/')"/>
+ </xsl:template>
+
+ <xsl:template name="rootfs">
+ <xsl:text>ext4</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="bootfs">
+ <xsl:text>ext4</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="keyboard">
+ <xsl:text>us</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="Language">
+ <xsl:text>en_US.UTF-8</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="Network">
+ <xsl:text>localhost.localdomain</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="Services">
+ <xsl:text>chronyd</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="Ignoredisk">
+ <xsl:text>vda</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="Timezone">
+ <xsl:text>Asia/Shanghai</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="/command-line">
+ <xsl:text>ks=hd:</xsl:text>
+ <xsl:call-template name="script-disk"/>
+ <xsl:text>:/</xsl:text>
+ <xsl:value-of select="script/expected-filename"/>
+ </xsl:template>
+
+ <xsl:template match="/install-script-config">
+# Install script for <xsl:value-of select="os/short-id"/> profile <xsl:value-of select="script/profile"/>
+install
+cdrom
+
+# Use graphical install
+graphical
+
+# %packages
+@^minimal-environment
+@development
+
+%end
+keyboard --xlayouts='<xsl:call-template name="keyboard"/>'
+
+# System language
+lang <xsl:call-template name="Language"/>
+
+# Network information
+network --hostname=<xsl:call-template name="Network"/>
+
+# Run the Setup Agent on first boot
+firstboot --enable
+
+# System services
+services --enabled='<xsl:call-template name="Services"/>'
+
+ignoredisk --only-use=<xsl:call-template name="Ignoredisk"/>
+
+autopart
+
+# Partition clearing information
+clearpart --none --initlabel
+
+# System timezone
+timezone --utc <xsl:value-of select="config/l10n-timezone"/>
+
+# Root password
+rootpw --iscrypted <xsl:value-of select="config/admin-password"/>
+
+%end
+
+%anaconda
+
+@base
+
+@core
+
+@hardware-support
+
+%end
+ </xsl:template>
+ </xsl:stylesheet>
+ </template>
+ </install-script>
+</libosinfo>
diff --git a/os/openeuler.org/openeuler-20.03.xml b/os/openeuler.org/openeuler-20.03.xml
new file mode 100644
index 0000000..db0c53d
--- /dev/null
+++ b/os/openeuler.org/openeuler-20.03.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<libosinfo version="0.0.1">
+
+ <os id="http://openeuler.org/openeuler/20.03">
+ <short-id>openeuler20.03</short-id>
+ <name>openEuler 20.03</name>
+ <version>20.03</version>
+ <vendor>openEuler</vendor>
+ <vendor xml:lang="ca">openEuler</vendor>
+ <vendor xml:lang="de">openEuler</vendor>
+ <vendor xml:lang="es">openEuler</vendor>
+ <vendor xml:lang="fr">openEuler</vendor>
+ <vendor xml:lang="id">openEuler</vendor>
+ <vendor xml:lang="it">openEuler</vendor>
+ <vendor xml:lang="ja">openEuler</vendor>
+ <vendor xml:lang="pl">openEuler</vendor>
+ <vendor xml:lang="pt_BR">openEuler</vendor>
+ <vendor xml:lang="uk">openEuler</vendor>
+ <family>linux</family>
+ <distro>openeuler</distro>
+
+ <release-date>2020-03-30</release-date>
+ <eol-date>2024-03-30</eol-date>
+
+ <media arch="x86_64">
+ <url>https://repo.openeuler.org/openEuler-20.03-LTS/ISO/x86_64/openEuler-20.03-LTS-x86_64-dvd.iso</url>
+ <iso>
+ <volume-id>openEuler 20.03 x86_64</volume-id>
+ <system-id>LINUX</system-id>
+ </iso>
+ <kernel>isolinux/vmlinuz</kernel>
+ <initrd>isolinux/initrd.img</initrd>
+ </media>
+
+ <media arch="aarch64">
+ <url>https://repo.openeuler.org/openEuler-20.03-LTS/ISO/aarch64/openEuler-20.03-LTS-aarch64-dvd.iso</url>
+ <iso>
+ <volume-id>openEuler 20.03 aarch64</volume-id>
+ <system-id>LINUX</system-id>
+ </iso>
+ </media>
+
+ <installer>
+ <script id='http://openeuler.org/openeuler/kickstart/jeos'/>
+ </installer>
+ </os>
+</libosinfo>
--
2.23.0

View File

@ -1,12 +1,15 @@
Name: osinfo-db %define debug_package %{nil}
%define PatchedSource ../%{name}-%{version}-patched.tar.xz
Name: osinfo-db
Version: 20180920 Version: 20180920
Summary: osinfo database files Summary: osinfo database files
Release: 2 Release: 3
License: LGPLv2+ License: LGPLv2+
URL: http://libosinfo.org/ URL: http://libosinfo.org/
Source0: https://fedorahosted.org/releases/l/i/libosinfo/%{name}-%{version}.tar.xz Source0: https://fedorahosted.org/releases/l/i/libosinfo/%{name}-%{version}.tar.xz
Source1: https://fedorahosted.org/releases/l/i/libosinfo/%{name}-%{version}.tar.xz.asc Source1: https://fedorahosted.org/releases/l/i/libosinfo/%{name}-%{version}.tar.xz.asc
Patch0: 0001-Add-openeuler-osinfo.patch
BuildRequires: intltool osinfo-db-tools BuildRequires: intltool osinfo-db-tools
Requires: hwdata Requires: hwdata
@ -15,10 +18,18 @@ osinfo-db provides the database files for use with the libosinfo
library. It provides information about guest operating systems for library. It provides information about guest operating systems for
use with virtualization provisioning tools. use with virtualization provisioning tools.
%prep
%setup -q
%patch0 -p1 -b .0001-Add-openeuler-osinfo
%build
tar -cvJf %{PatchedSource} ../%{name}-%{version}/
%install %install
osinfo-db-import --root %{buildroot} --dir %{_datadir}/osinfo %{SOURCE0} osinfo-db-import --root %{buildroot} --dir %{_datadir}/osinfo %{PatchedSource}
%files %files
%dir %{_datadir}/osinfo/
%{_datadir}/osinfo/datamap %{_datadir}/osinfo/datamap
%{_datadir}/osinfo/device %{_datadir}/osinfo/device
%{_datadir}/osinfo/install-script %{_datadir}/osinfo/install-script
@ -29,5 +40,8 @@ osinfo-db-import --root %{buildroot} --dir %{_datadir}/osinfo %{SOURCE0}
%{_datadir}/osinfo/LICENSE %{_datadir}/osinfo/LICENSE
%changelog %changelog
* Mon Nov 2 2020 leiju <leiju4@huawei.com> - 20180920-3
- Add openeuler osinfo into osinfo-db
* Mon Aug 12 2019 openEuler Buildteam <buildteam@openeuler.org> - 20180920-2 * Mon Aug 12 2019 openEuler Buildteam <buildteam@openeuler.org> - 20180920-2
- Package init - Package init