Skip to content
Commits on Source (12)
......@@ -6,6 +6,8 @@ po/osinfo-db.pot
data/*/*/*.xml
data/*/*/*/*.xml
data/schema/osinfo.rng
tests/__pycache__
.pytest_cache
*~
#*
osinfo-db-*.tar.xz
......
[gitpublishprofile "default"]
base = master
to = libosinfo@redhat.com
prefix = osinfo-db PATCH
VPATH = .
ifdef SOURCE_DATE_EPOCH
......@@ -31,7 +30,7 @@ ARCHIVE = osinfo-db-$(TODAY).tar.xz
ZANATA = zanata
XMLLINT = xmllint
PYTHON = python3
V = 0
......@@ -51,6 +50,7 @@ INTLTOOL_MERGE_OPTS = $(INTLTOOL_MERGE_OPTS_$(V))
INTLTOOL_MERGE_OPTS_0 = -q
INTLTOOL_MERGE_OPTS_1 =
ABS_TOPDIR = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
all: $(ARCHIVE) osinfo-db.spec mingw-osinfo-db.spec
......@@ -121,9 +121,4 @@ update-po:
done
check: $(DATA_FILES) $(SCHEMA_FILES)
for xml in `find data -name '*.xml' | sort`; do \
if ! $(XMLLINT) --relaxng data/schema/osinfo.rng --noout $$xml; then \
exit 1; \
fi; \
done
INTERNAL_OSINFO_DB_DATA_DIR=data INTERNAL_OSINFO_DB_DATA_SRC_DIR=$(ABS_TOPDIR)data $(PYTHON) -m pytest $(ABS_TOPDIR)tests
......@@ -7,9 +7,9 @@ use with virtualization provisioning tools
osinfo-db is Free Software and licenced under GPLv2+.
The latest official releases can be found at:
Information about the latest official releases can be found at:
https://fedorahosted.org/releases/l/i/libosinfo/
https://libosinfo.org/download/
Dependencies
============
......@@ -17,8 +17,11 @@ Dependencies
- Required:
- osinfo-db-tools
- intltool
- Optional:
- xmllint (from libxml2) -- for testing
- Optional (for testing):
- python3
- python3-lxml
- python3-pytest
- python3-requests
Build reproducibility
=====================
......@@ -37,8 +40,8 @@ Patch submissions
=================
Patch submissions are welcomed from any interested contributor. Please
use the libosinfo list for any patch submissions, or discussions about
the code:
use the libosinfo list as the preferred way for patch submissions, or
discussions about the code:
https://www.redhat.com/mailman/listinfo/libosinfo
......@@ -47,4 +50,18 @@ homepage
https://libosinfo.org/
Testing
=======
In order to test osinfo-db, you should run:
$ make check
For a more complete test run, including testing the validity of the URLs
present in osinfo-db, you should export the OSINFO_DB_NETWORK_TESTS environment
variable to the build system. For example:
$ export OSINFO_DB_NETWORK_TESTS=1
$ make check
--End
......@@ -13,7 +13,7 @@
<!-- User options -->
<param name="user-login" policy="required"/>
<param name="user-fullname" policy="optional"/>
<param name="user-realname" policy="optional"/>
<param name="user-password" policy="optional"/>
<param name="admin-password" policy="optional"/>
......@@ -72,8 +72,8 @@
<xsl:template name="user-fullname">
<xsl:choose>
<xsl:when test="config/user-fullname != ''">
<xsl:value-of select="config/user-fullname"/>
<xsl:when test="config/user-realname != ''">
<xsl:value-of select="config/user-realname"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="config/user-login"/>
......
......@@ -10,16 +10,17 @@
<param name="l10n-timezone" policy="optional"/>
<param name="hostname" policy="optional"/>
<param name="user-login" policy="required"/>
<param name="user-password" policy="required"/>
<param name="admin-password" policy="required"/>
<param name="user-password" policy="optional"/>
<param name="admin-password" policy="optional"/>
<param name="avatar-location" policy="optional"/>
<param name="avatar-disk" policy="optional"/>
<param name="target-disk" policy="optional"/>
<param name="script-disk" policy="required"/>
<param name="script-disk" policy="optional"/>
</config>
<injection-method>cdrom</injection-method>
<injection-method>disk</injection-method>
<injection-method>floppy</injection-method>
<injection-method>initrd</injection-method>
<avatar-format>
<mime-type>image/png</mime-type>
</avatar-format>
......@@ -52,29 +53,39 @@
<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:choose>
<xsl:when test="os/version &gt; 10">
<xsl:text>ext4</xsl:text>
<xsl:when test="config/script-disk != ''">
<xsl:value-of select="config/script-disk"/>
</xsl:when>
<xsl:when test="os/version &gt; 9">
<xsl:text>/dev/sda</xsl:text>
</xsl:when>
<xsl:when test="os/version &gt; 6">
<xsl:text>/dev/sdb</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>ext3</xsl:text>
<xsl:text>/dev/hdb</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="substring-after($script-disk, '/dev/')"/>
</xsl:template>
<xsl:template name="bootfs">
<!-- The default values of avatar-disk consider the avatar is stored
in the same disk as the installation scripts. -->
<xsl:template name="avatar-disk">
<xsl:choose>
<xsl:when test="os/version &gt; 11">
<xsl:text>ext4</xsl:text>
<xsl:when test="config/avatar-disk != ''">
<xsl:value-of select="config/avatar-disk"/>
</xsl:when>
<xsl:when test="os/version &gt; 9">
<xsl:text>/dev/sda</xsl:text>
</xsl:when>
<xsl:when test="os/version &gt; 6">
<xsl:text>/dev/sdb</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>ext3</xsl:text>
<xsl:text>/dev/hdb</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
......@@ -95,15 +106,58 @@
</xsl:template>
<xsl:template match="/command-line">
<xsl:text>ks=hd:</xsl:text>
<xsl:text>ks=</xsl:text>
<xsl:choose>
<xsl:when test="script/preferred-injection-method = 'initrd'">
<xsl:text>file:/</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>hd:</xsl:text>
<xsl:call-template name="script-disk"/>
<xsl:text>:/</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="script/expected-filename"/>
<xsl:if test="script/installation-source = 'network'">
<xsl:choose>
<xsl:when test="os/version &lt; 19">
<xsl:text> method=</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> inst.repo=</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="installation-url"/>
</xsl:if>
</xsl:template>
<xsl:template name="installation-url">
<xsl:choose>
<xsl:when test="config/installation-url != ''">
<xsl:value-of select="config/installation-url"/>
</xsl:when>
<xsl:when test="tree/url != ''">
<xsl:value-of select="tree/url"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="url-or-mirrorlist">
<xsl:choose>
<xsl:when test="config/installation-url != '' or tree/url != ''">
<xsl:text> --url=</xsl:text>
<xsl:call-template name="installation-url"/>
</xsl:when>
<xsl:otherwise>
<xsl:text> --mirrorlist=</xsl:text>
<xsl:text>https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch</xsl:text>
</xsl:otherwise>
</xsl:choose>
</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"/>
<xsl:if test="count(media/variant) = 0 or not(contains(media/variant, 'netinst'))">
<xsl:if test="script/installation-source = 'media' and (count(media/variant) = 0 or not(contains(media/variant, 'netinst')))">
install
cdrom
</xsl:if>
......@@ -128,18 +182,13 @@ clearpart --all --drives=<xsl:call-template name="target-disk"/>
firstboot --disable
part biosboot --fstype=biosboot --size=1
part /boot --fstype <xsl:call-template name="bootfs"/> --recommended --ondisk=<xsl:call-template name="target-disk"/>
part pv.2 --size=1 --grow --ondisk=<xsl:call-template name="target-disk"/>
volgroup VolGroup00 --pesize=32768 pv.2
logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=768 --grow --maxsize=1536
logvol / --fstype <xsl:call-template name="rootfs"/> --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
autopart
reboot
<xsl:if test="contains(media/variant, 'netinst')">
<xsl:if test="script/installation-source = 'network' or contains(media/variant, 'netinst')">
repo --name=fedora --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch
repo --name=updates --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&amp;arch=$basearch
url --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch
url <xsl:call-template name="url-or-mirrorlist"/>
</xsl:if>
%packages
......@@ -195,7 +244,7 @@ fi
# Set user avatar
if test -n '<xsl:value-of select="config/avatar-location"/>'; then
mkdir /mnt/unattended-media
mount <xsl:value-of select='config/avatar-disk'/> /mnt/unattended-media
mount <xsl:call-template name="avatar-disk"/> /mnt/unattended-media
cp /mnt/unattended-media<xsl:value-of select="config/avatar-location"/> /var/lib/AccountsService/icons/<xsl:value-of select="config/user-login"/>
umount /mnt/unattended-media
fi
......
......@@ -5,16 +5,17 @@
<profile>jeos</profile>
<expected-filename>fedora.ks</expected-filename>
<config>
<param name="admin-password" policy="optional"/>
<param name="admin-password" policy="required"/>
<param name="l10n-keyboard" policy="optional" value-map="http://x.org/x11-keyboard"/>
<param name="l10n-language" policy="optional"/>
<param name="l10n-timezone" policy="optional"/>
<param name="target-disk" policy="optional"/>
<param name="script-disk" policy="required"/>
<param name="script-disk" policy="optional"/>
</config>
<injection-method>cdrom</injection-method>
<injection-method>disk</injection-method>
<injection-method>floppy</injection-method>
<injection-method>initrd</injection-method>
<template>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
......@@ -44,7 +45,20 @@
<xsl:template name="script-disk">
<xsl:variable name="script-disk">
<xsl:choose>
<xsl:when test="config/script-disk != ''">
<xsl:value-of select="config/script-disk"/>
</xsl:when>
<xsl:when test="os/version &gt; 9">
<xsl:text>/dev/sda</xsl:text>
</xsl:when>
<xsl:when test="os/version &gt; 6">
<xsl:text>/dev/sdb</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>/dev/hdb</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="substring-after($script-disk, '/dev/')"/>
</xsl:template>
......@@ -87,15 +101,58 @@
</xsl:template>
<xsl:template match="/command-line">
<xsl:text>ks=hd:</xsl:text>
<xsl:text>ks=</xsl:text>
<xsl:choose>
<xsl:when test="script/preferred-injection-method = 'initrd'">
<xsl:text>file:/</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>hd:</xsl:text>
<xsl:call-template name="script-disk"/>
<xsl:text>:/</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="script/expected-filename"/>
<xsl:if test="script/installation-source = 'network'">
<xsl:choose>
<xsl:when test="os/version &lt; 19">
<xsl:text> method=</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> inst.repo=</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="installation-url"/>
</xsl:if>
</xsl:template>
<xsl:template name="installation-url">
<xsl:choose>
<xsl:when test="config/installation-url != ''">
<xsl:value-of select="config/installation-url"/>
</xsl:when>
<xsl:when test="tree/url != ''">
<xsl:value-of select="tree/url"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="url-or-mirrorlist">
<xsl:choose>
<xsl:when test="config/installation-url != '' or tree/url != ''">
<xsl:text> --url=</xsl:text>
<xsl:call-template name="installation-url"/>
</xsl:when>
<xsl:otherwise>
<xsl:text> --mirrorlist=</xsl:text>
<xsl:text>https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch</xsl:text>
</xsl:otherwise>
</xsl:choose>
</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"/>
<xsl:if test="count(media/variant) = 0 or not(contains(media/variant, 'netinst'))">
<xsl:if test="script/installation-source='media' and (count(media/variant) = 0 or not(contains(media/variant, 'netinst')))">
install
cdrom
</xsl:if>
......@@ -127,20 +184,24 @@ zerombr <xsl:if test="os/version &lt; 14">yes</xsl:if>
clearpart --all --drives=<xsl:call-template name="target-disk"/>
<xsl:if test="os/version &gt; 15">
part biosboot --fstype=biosboot --size=1
</xsl:if>
<xsl:choose>
<xsl:when test="os/version &lt; 3">
part /boot --fstype <xsl:call-template name="bootfs"/> --recommended --ondisk=<xsl:call-template name="target-disk"/>
part pv.2 --size=1 --grow --ondisk=<xsl:call-template name="target-disk"/>
volgroup VolGroup00 --pesize=32768 pv.2
logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=768 --grow --maxsize=1536
logvol / --fstype <xsl:call-template name="rootfs"/> --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
</xsl:when>
<xsl:otherwise>
autopart
</xsl:otherwise>
</xsl:choose>
reboot
<xsl:if test="contains(media/variant, 'netinst')">
<xsl:if test="script/installation-source='network' or contains(media/variant, 'netinst')">
repo --name=fedora --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch
repo --name=updates --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&amp;arch=$basearch
url --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch
url <xsl:call-template name="url-or-mirrorlist"/>
</xsl:if>
%packages
......
......@@ -10,13 +10,15 @@
<param name="l10n-timezone" policy="optional"/>
<param name="hostname" policy="optional"/>
<param name="user-login" policy="required"/>
<param name="user-password" policy="required"/>
<param name="admin-password" policy="required"/>
<param name="script-disk" policy="required"/>
<param name="user-password" policy="optional"/>
<param name="admin-password" policy="optional"/>
<param name="target-disk" policy="optional"/>
<param name="script-disk" policy="optional"/>
</config>
<injection-method>cdrom</injection-method>
<injection-method>disk</injection-method>
<injection-method>floppy</injection-method>
<injection-method>initrd</injection-method>
<template>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
......@@ -24,24 +26,66 @@
<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>
<!-- virtio -->
<xsl:text>/dev/vda</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="script-disk">
<xsl:variable name="script-disk">
<xsl:choose>
<xsl:when test="config/script-disk != ''">
<xsl:value-of select="config/script-disk"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>/dev/sda</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="substring-after($script-disk, '/dev/')"/>
</xsl:template>
<xsl:template match="/command-line">
<xsl:text>ks=hd:</xsl:text>
<xsl:text>ks=</xsl:text>
<xsl:choose>
<xsl:when test="script/preferred-injection-method = 'initrd'">
<xsl:text>file:/</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>hd:</xsl:text>
<xsl:call-template name="script-disk"/>
<xsl:text>:/</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="script/expected-filename"/>
<xsl:if test="script/installation-source = 'network'">
<xsl:text> inst.repo=</xsl:text>
<xsl:call-template name="installation-url"/>
</xsl:if>
</xsl:template>
<xsl:template name="installation-url">
<xsl:choose>
<xsl:when test="config/installation-url != ''">
<xsl:value-of select="config/installation-url"/>
</xsl:when>
<xsl:when test="tree/url != ''">
<xsl:value-of select="tree/url"/>
</xsl:when>
</xsl:choose>
</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
keyboard <xsl:value-of select="config/l10n-keyboard"/>
keyboard '<xsl:value-of select="config/l10n-keyboard"/>'
lang <xsl:value-of select="config/l10n-language"/>
network --onboot yes --bootproto dhcp --noipv6 --hostname=<xsl:value-of select="config/hostname"/>
rootpw dummyPa55w0rd # Actual password set (or unset) in %post below
......@@ -50,18 +94,20 @@ timezone --utc <xsl:value-of select="config/l10n-timezone"/>
bootloader --location=mbr
zerombr
clearpart --all --drives=/dev/vda
clearpart --all --drives=<xsl:call-template name="target-disk"/>
firstboot --disable
part biosboot --fstype=biosboot --size=1
part /boot --fstype ext4 --recommended --ondisk=/dev/vda
part pv.2 --size=1 --grow --ondisk=/dev/vda
volgroup VolGroup00 --pesize=32768 pv.2
logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=768 --grow --maxsize=1536
logvol / --fstype xfs --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
autopart
<xsl:choose>
<xsl:when test="os/version &lt; 29">
ostreesetup --osname="fedora-workstation" --remote="fedora-<xsl:value-of select="os/version"/>" --url="file:///ostree/repo" --ref="fedora/<xsl:value-of select="os/version"/>/<xsl:value-of select="config/hardware-arch"/>/workstation" --nogpg
</xsl:when>
<xsl:otherwise>
ostreesetup --osname="fedora-silverblue" --remote="fedora-<xsl:value-of select="os/version"/>" --url="file:///ostree/repo" --ref="fedora/<xsl:value-of select="os/version"/>/<xsl:value-of select="config/hardware-arch"/>/silverblue" --nogpg
</xsl:otherwise>
</xsl:choose>
graphical
reboot
......
......@@ -18,6 +18,7 @@
<param name="post-install-drivers-location" policy="optional"/>
<param name="driver-signing" policy="optional"/>
</config>
<injection-method>cdrom</injection-method>
<injection-method>floppy</injection-method>
<avatar-format>
<mime-type>image/bmp</mime-type>
......@@ -47,6 +48,9 @@
<xsl:when test="config/script-disk != ''">
<xsl:value-of select="config/script-disk"/>
</xsl:when>
<xsl:when test="script/preferred-injection-method = 'cdrom'">
<xsl:text>E</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>A</xsl:text>
</xsl:otherwise>
......@@ -58,6 +62,9 @@
<xsl:when test="config/post-install-drivers-disk != ''">
<xsl:value-of select="config/post-install-drivers-disk"/>
</xsl:when>
<xsl:when test="script/preferred-injection-method = 'cdrom'">
<xsl:text>E</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>A</xsl:text>
</xsl:otherwise>
......@@ -86,8 +93,14 @@ net localgroup administrators <xsl:value-of select="config/user-realname"/> /add
net accounts /maxpwage:unlimited
REGEDIT /S <xsl:call-template name="script-disk"/>:\windows.reg
</xsl:if>
<!-- Do not try to copy the user avatar for Windows 8+.
Windows 8+ needs a more than one image, with different sizes, in order to
properly set the user's avatar all over the place.
Reference: https://gitlab.com/libosinfo/osinfo-db/issues/24 -->
<xsl:if test="os/version &lt; 6.2">
if not "<xsl:value-of select="config/avatar-location"/>"=="" copy "<xsl:value-of select="config/avatar-disk"/>:<xsl:value-of select="config/avatar-location"/>" "<xsl:call-template name="avatar-destination"/>
<xsl:text>&#xa;</xsl:text>
</xsl:if>
<xsl:call-template name="post-install-drivers-disk"/>:
<xsl:if test="config/driver-signing = 'false' and os/version &gt; 5.1">
......@@ -95,7 +108,7 @@ bcdedit.exe -set loadoptions DDISABLE_INTEGRITY_CHECKS
bcdedit.exe -set TESTSIGNING ON
</xsl:if>
for %%i in ("<xsl:call-template name="post-install-drivers-disk"/>:<xsl:value-of select="config/post-install-drivers-location"/>\*.cmd") do cmd /c %%i
for %%i in ("<xsl:call-template name="post-install-drivers-disk"/>:<xsl:value-of select="config/post-install-drivers-location"/>\*.cmd") do if not "%%i" == "<xsl:call-template name="post-install-drivers-disk"/>:\<xsl:value-of select="script/expected-filename"/>" cmd /c %%i
EXIT
</xsl:template>
......
......@@ -21,6 +21,7 @@
<param name="pre-install-drivers-location" policy="optional"/>
<param name="script-disk" policy="optional"/>
</config>
<injection-method>cdrom</injection-method>
<injection-method>floppy</injection-method>
<template>
<xsl:stylesheet
......@@ -45,6 +46,9 @@
<xsl:when test="config/script-disk != ''">
<xsl:value-of select="config/script-disk"/>
</xsl:when>
<xsl:when test="script/preferred-injection-method = 'cdrom'">
<xsl:text>E</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>A</xsl:text>
</xsl:otherwise>
......@@ -70,6 +74,9 @@
<xsl:when test="config/pre-install-drivers-disk != ''">
<xsl:value-of select="config/pre-install-drivers-disk"/>
</xsl:when>
<xsl:when test="script/preferred-injection-method = 'cdrom'">
<xsl:text>E</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>A</xsl:text>
</xsl:otherwise>
......@@ -213,7 +220,7 @@
<RunSynchronous wcm:action="add">
<RunSynchronousCommand>
<Order>1</Order>
<Path>cmd /C A:\windows.cmd >c:\windows\osinfo.log 2>&amp;1</Path>
<Path>cmd /C <xsl:call-template name="script-disk"/>:\windows.cmd ><xsl:call-template name="target-disk"/>:\windows\osinfo.log 2>&amp;1</Path>
<Description>Post installation setup</Description>
</RunSynchronousCommand>
</RunSynchronous>
......
......@@ -19,6 +19,7 @@
<param name="pre-install-drivers-disk" policy="optional"/>
<param name="pre-install-drivers-location" policy="optional"/>
</config>
<injection-method>cdrom</injection-method>
<injection-method>floppy</injection-method>
<template>
<xsl:stylesheet
......@@ -40,8 +41,11 @@
<xsl:template name="arch">
<xsl:choose>
<xsl:when test="count(config/hardware-arch) &gt; 0">
<xsl:value-of select="config/hardware-arch"/>
<xsl:when test="config/hardware-arch = 'x86_64'">
<xsl:text>amd64</xsl:text>
</xsl:when>
<xsl:when test="config/hardware-arch = 'i386'">
<xsl:text>x86</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>x86</xsl:text>
......@@ -54,6 +58,9 @@
<xsl:when test="config/pre-install-drivers-disk != ''">
<xsl:value-of select="config/pre-install-drivers-disk"/>
</xsl:when>
<xsl:when test="script/preferred-injection-method = 'cdrom'">
<xsl:text>E</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>A</xsl:text>
</xsl:otherwise>
......@@ -168,11 +175,11 @@
<LocalAccount wcm:action="add">
<Password>
<Value><xsl:value-of select="config/user-password"/></Value>
<PlainText>false</PlainText>
<PlainText>true</PlainText>
</Password>
<Name><xsl:value-of select="config/user-login"/></Name>
<DisplayName><xsl:value-of select="config/user-realname"/></DisplayName>
<Group>users</Group>
<Group>Users</Group>
</LocalAccount>
</LocalAccounts>
</xsl:if>
......
......@@ -7,6 +7,9 @@
<profile>desktop</profile>
<expected-filename>autoinst.xml</expected-filename>
<config>
<!-- System options -->
<param name="target-disk" policy="optional"/>
<!-- Localization options -->
<param name="l10n-keyboard" policy="optional" value-map="http://x.org/x11-keyboard"/>
<param name="l10n-language" policy="optional"/>
......@@ -18,13 +21,14 @@
<!-- Account options -->
<param name="admin-password" policy="optional"/>
<param name="user-fullname" policy="optional"/>
<param name="user-realname" policy="optional"/>
<param name="user-login" policy="required"/>
<param name="user-password" policy="optional"/>
<param name="avatar-location" policy="optional"/>
<param name="avatar-disk" policy="optional"/>
</config>
<injection-method>disk</injection-method>
<injection-method>initrd</injection-method>
<template>
<xsl:stylesheet
......@@ -33,6 +37,31 @@
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:template name="target-disk">
<xsl:choose>
<xsl:when test="config/target-disk != ''">
<xsl:value-of select="config/target-disk"/>
</xsl:when>
<xsl:otherwise>
<!-- virtio -->
<xsl:text>/dev/vda</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- The default values of avatar-disk consider the avatar is stored
in the same disk as the installation scripts. -->
<xsl:template name="avatar-disk">
<xsl:choose>
<xsl:when test="config/avatar-disk != ''">
<xsl:value-of select="config/avatar-disk"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>/dev/sda</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="l10n-language">
<xsl:choose>
<xsl:when test="config/l10n-language != '' and config/l10n-language != 'C'">
......@@ -66,8 +95,21 @@
</xsl:choose>
</xsl:template>
<xsl:template name="installation-url">
<xsl:choose>
<xsl:when test="config/installation-url != ''">
<xsl:value-of select="config/installation-url"/>
</xsl:when>
<xsl:when test="tree/url != ''">
<xsl:value-of select="tree/url"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="repo-oss"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="repo-oss">
<xsl:text> </xsl:text>
<xsl:text>http://download.opensuse.org/</xsl:text>
<xsl:if test="not(contains(os/version, 'tumbleweed'))">
<xsl:text>distribution/leap/</xsl:text>
......@@ -104,8 +146,20 @@
</xsl:template>
<xsl:template match="/command-line">
<xsl:text>autoyast=device://sda/</xsl:text>
<xsl:text>autoyast=</xsl:text>
<xsl:choose>
<xsl:when test="script/preferred-injection-method = 'initrd'">
<xsl:text>file:///</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>device://sda/</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="script/expected-filename"/>
<xsl:if test="script/installation-source = 'network'">
<xsl:text> install=</xsl:text>
<xsl:call-template name="installation-url"/>
</xsl:if>
</xsl:template>
<xsl:template match="/install-script-config">
......@@ -114,12 +168,12 @@
<device_map config:type="list">
<device_map_entry>
<firmware>hd0</firmware>
<linux>/dev/vda</linux>
<linux><xsl:call-template name="target-disk"/></linux>
</device_map_entry>
</device_map>
<global>
<activate>true</activate>
<append>resume=/dev/vda1 splash=silent quiet showopts</append>
<append>resume=<xsl:call-template name="target-disk"/>1 splash=silent quiet showopts</append>
<boot_boot>false</boot_boot>
<boot_extended>false</boot_extended>
<boot_mbr>false</boot_mbr>
......@@ -184,7 +238,7 @@
</networking>
<partitioning config:type="list">
<drive>
<device>/dev/vda</device>
<device><xsl:call-template name="target-disk"/></device>
<type config:type="symbol">CT_DISK</type>
<use>all</use>
</drive>
......@@ -228,7 +282,7 @@ fi
if test -n '<xsl:value-of select="config/avatar-location"/>'; then
# Set user avatar
mkdir /mnt/unattended-media
mount <xsl:value-of select='config/avatar-disk'/> /mnt/unattended-media
mount <xsl:call-template name="avatar-disk"/> /mnt/unattended-media
cp /mnt/unattended-media<xsl:value-of select="config/avatar-location"/> /var/lib/AccountsService/icons/<xsl:value-of select="config/user-login"/>
umount /mnt/unattended-media
......@@ -241,7 +295,7 @@ Icon=/var/lib/AccountsService/icons/<xsl:value-of select="config/user-login"/>
fi
# Enable default OpenSUSE repos
zypper ar -f <xsl:call-template name="repo-oss"/> repo-oss
zypper ar -f <xsl:call-template name="installation-url"/> repo-oss
zypper ar -f <xsl:call-template name="repo-non-oss"/> repo-non-oss
zypper ar -f <xsl:call-template name="repo-update-oss"/> repo-update-oss
<xsl:if test="not(contains(os/version, 'tumbleweed'))">
......@@ -327,7 +381,7 @@ zypper ar -f <xsl:call-template name="repo-update-oss"/> repo-update-oss
</user>
<user>
<encrypted config:type="boolean">false</encrypted>
<fullname><xsl:value-of select="config/user-fullname"/></fullname>
<fullname><xsl:value-of select="config/user-realname"/></fullname>
<user_password><xsl:value-of select="config/user-password"/></user_password>
<username><xsl:value-of select="config/user-login"/></username>
</user>
......
......@@ -7,6 +7,9 @@
<profile>jeos</profile>
<expected-filename>autoinst.xml</expected-filename>
<config>
<!-- System options -->
<param name="target-disk" policy="optional"/>
<!-- Localization options -->
<param name="l10n-keyboard" policy="optional" value-map="http://x.org/x11-keyboard"/>
<param name="l10n-language" policy="optional"/>
......@@ -16,6 +19,7 @@
<param name="admin-password" policy="required"/>
</config>
<injection-method>disk</injection-method>
<injection-method>initrd</injection-method>
<template>
<xsl:stylesheet
......@@ -24,6 +28,18 @@
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:template name="target-disk">
<xsl:choose>
<xsl:when test="config/target-disk != ''">
<xsl:value-of select="config/target-disk"/>
</xsl:when>
<xsl:otherwise>
<!-- virtio -->
<xsl:text>/dev/vda</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="l10n-language">
<xsl:choose>
<xsl:when test="config/l10n-language != '' and config/l10n-language != 'C'">
......@@ -57,8 +73,21 @@
</xsl:choose>
</xsl:template>
<xsl:template name="installation-url">
<xsl:choose>
<xsl:when test="config/installation-url != ''">
<xsl:value-of select="config/installation-url"/>
</xsl:when>
<xsl:when test="tree/url != ''">
<xsl:value-of select="tree/url"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="repo-oss"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="repo-oss">
<xsl:text> </xsl:text>
<xsl:text>http://download.opensuse.org/</xsl:text>
<xsl:if test="not(contains(os/version, 'tumbleweed'))">
<xsl:text>distribution/leap/</xsl:text>
......@@ -95,8 +124,20 @@
</xsl:template>
<xsl:template match="/command-line">
<xsl:text>autoyast=device://sda/</xsl:text>
<xsl:text>autoyast=</xsl:text>
<xsl:choose>
<xsl:when test="script-preferred-injection-method = 'initrd'">
<xsl:text>file:///</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>device://sda/</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="script/expected-filename"/>
<xsl:if test="script/installation-source = 'network'">
<xsl:text> install=</xsl:text>
<xsl:call-template name="installation-url"/>
</xsl:if>
</xsl:template>
<xsl:template match="/install-script-config">
......@@ -105,12 +146,12 @@
<device_map config:type="list">
<device_map_entry>
<firmware>hd0</firmware>
<linux>/dev/vda</linux>
<linux><xsl:call-template name="target-disk"/></linux>
</device_map_entry>
</device_map>
<global>
<activate>true</activate>
<append>resume=/dev/vda1 splash=silent quiet showopts</append>
<append>resume=<xsl:call-template name="target-disk"/>1 splash=silent quiet showopts</append>
<boot_boot>false</boot_boot>
<boot_extended>false</boot_extended>
<boot_mbr>false</boot_mbr>
......@@ -173,7 +214,7 @@
</networking>
<partitioning config:type="list">
<drive>
<device>/dev/vda</device>
<device><xsl:call-template name="target-disk"/></device>
<type config:type="symbol">CT_DISK</type>
<use>all</use>
</drive>
......@@ -206,7 +247,7 @@
<chrooted config:type="boolean">true</chrooted>
<source>
# Enable default OpenSUSE repos
zypper ar -f <xsl:call-template name="repo-oss"/> repo-oss
zypper ar -f <xsl:call-template name="installation-url"/> repo-oss
zypper ar -f <xsl:call-template name="repo-non-oss"/> repo-non-oss
zypper ar -f <xsl:call-template name="repo-update-oss"/> repo-update-oss
<xsl:if test="not(contains(os/version, 'tumbleweed'))">
......
......@@ -10,16 +10,17 @@
<param name="l10n-timezone" policy="optional"/>
<param name="hostname" policy="optional"/>
<param name="user-login" policy="required"/>
<param name="user-password" policy="required"/>
<param name="admin-password" policy="required"/>
<param name="user-password" policy="optional"/>
<param name="admin-password" policy="optional"/>
<param name="avatar-location" policy="optional"/>
<param name="avatar-disk" policy="optional"/>
<param name="target-disk" policy="optional"/>
<param name="script-disk" policy="required"/>
<param name="script-disk" policy="optional"/>
</config>
<injection-method>cdrom</injection-method>
<injection-method>disk</injection-method>
<injection-method>floppy</injection-method>
<injection-method>initrd</injection-method>
<avatar-format>
<mime-type>image/png</mime-type>
</avatar-format>
......@@ -35,7 +36,7 @@
<xsl:when test="config/target-disk != ''">
<xsl:value-of select="config/target-disk"/>
</xsl:when>
<xsl:when test="os/version &gt; 4">
<xsl:when test="os/version &gt; 5.5">
<!-- virtio -->
<xsl:text>/dev/vda</xsl:text>
</xsl:when>
......@@ -48,28 +49,125 @@
<xsl:template name="script-disk">
<xsl:variable name="script-disk">
<xsl:choose>
<xsl:when test="config/script-disk != ''">
<xsl:value-of select="config/script-disk"/>
</xsl:when>
<xsl:when test="os/version &gt; 5.5">
<xsl:text>/dev/sda</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>/dev/sdb</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="substring-after($script-disk, '/dev/')"/>
</xsl:template>
<!-- The default values of avatar-disk consider the avatar is stored
in the same disk as the installation scripts. -->
<xsl:template name="avatar-disk">
<xsl:choose>
<xsl:when test="config/avatar-disk != ''">
<xsl:value-of select="config/avatar-disk"/>
</xsl:when>
<xsl:when test="os/version &gt; 5.5">
<xsl:text>/dev/sda</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>/dev/sdb</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/command-line">
<xsl:text>ks=hd:</xsl:text>
<xsl:text>ks=</xsl:text>
<xsl:choose>
<xsl:when test="script/preferred-injection-method = 'initrd'">
<xsl:text>file:/</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>hd:</xsl:text>
<xsl:call-template name="script-disk"/>
<xsl:text>:/</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="script/expected-filename"/>
<xsl:if test="script/installation-source = 'network'">
<xsl:choose>
<xsl:when test="os/version &lt; 7">
<xsl:text> method=</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> inst.repo=</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="installation-url"/>
</xsl:if>
</xsl:template>
<xsl:template name="version">
<xsl:choose>
<xsl:when test="os/version &lt; 7">
<xsl:text>6</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>7</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="arch">
<xsl:choose>
<xsl:when test="config/hardware-arch = 'x86_64'">
<xsl:text>x86_64</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>i386</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="installation-url">
<xsl:choose>
<xsl:when test="config/installation-url != ''">
<xsl:value-of select="config/installation-url"/>
</xsl:when>
<xsl:when test="tree/url != ''">
<xsl:value-of select="tree/url"/>
</xsl:when>
<xsl:when test="os/distro = 'centos'">
<xsl:text>http://mirror.centos.org/centos/</xsl:text>
<xsl:call-template name="version"/>
<xsl:text>/os/</xsl:text>
<xsl:call-template name="arch"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="appstream-url">
<xsl:variable name="url">
<xsl:call-template name="installation-url"/>
</xsl:variable>
<xsl:value-of select="substring-before($url, 'BaseOS')"/>
<xsl:text>AppStream</xsl:text>
<xsl:value-of select="substring-after($url, 'BaseOS')"/>
</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"/>
<xsl:if test="script/installation-source = 'media'">
install
cdrom
</xsl:if>
keyboard us
lang <xsl:value-of select="config/l10n-language"/>
network --onboot yes --bootproto dhcp --noipv6 --hostname=<xsl:value-of select="config/hostname"/>
rootpw dummyPa55w0rd # Actual password set (or unset) in %post below
firewall --disabled
<xsl:if test="os/version &lt; 8">
authconfig --enableshadow --enablemd5
</xsl:if>
timezone --utc <xsl:value-of select="config/l10n-timezone"/>
bootloader --location=mbr
zerombr
......@@ -78,23 +176,18 @@ clearpart --all --drives=<xsl:call-template name="target-disk"/>
firstboot --disable
<xsl:choose>
<xsl:when test="os/version &lt; 7">
part /boot --fstype ext4 --size=1024 --ondisk=<xsl:call-template name="target-disk"/>
</xsl:when>
<xsl:otherwise>
part /boot --fstype ext4 --recommended --ondisk=<xsl:call-template name="target-disk"/>
</xsl:otherwise>
</xsl:choose>
part pv.2 --size=1 --grow --ondisk=<xsl:call-template name="target-disk"/>
volgroup VolGroup00 --pesize=32768 pv.2
logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=768 --grow --maxsize=1536
logvol / --fstype ext4 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
autopart
reboot
<xsl:if test="script/installation-source = 'network'">
url --url=<xsl:call-template name="installation-url"/>
<xsl:if test="os/version &gt; 7 or os/version = '8-unknown'">
repo --name=AppStream --baseurl=<xsl:call-template name="appstream-url"/>
</xsl:if>
</xsl:if>
%packages
@core
@x11
<xsl:choose>
<xsl:when test="os/version &lt; 7">
@basic-desktop
......@@ -102,6 +195,9 @@ reboot
@desktop-platform
</xsl:when>
<xsl:otherwise>
<xsl:if test="os/version &lt; 8">
@x11
</xsl:if>
@gnome-desktop
@multimedia
</xsl:otherwise>
......@@ -131,7 +227,7 @@ fi
# Set user avatar
if test -n '<xsl:value-of select="config/avatar-location"/>'; then
mkdir /mnt/unattended-media
mount <xsl:value-of select='config/avatar-disk'/> /mnt/unattended-media
mount <xsl:call-template name="avatar-disk"/> /mnt/unattended-media
cp /mnt/unattended-media<xsl:value-of select="config/avatar-location"/> /home/<xsl:value-of select="config/user-login"/>/.face
umount /mnt/unattended-media
fi
......
......@@ -5,16 +5,17 @@
<profile>jeos</profile>
<expected-filename>rhel.ks</expected-filename>
<config>
<param name="admin-password" policy="optional"/>
<param name="admin-password" policy="required"/>
<param name="l10n-keyboard" policy="optional"/>
<param name="l10n-language" policy="optional"/>
<param name="l10n-timezone" policy="optional"/>
<param name="target-disk" policy="optional"/>
<param name="script-disk" policy="required"/>
<param name="script-disk" policy="optional"/>
</config>
<injection-method>cdrom</injection-method>
<injection-method>disk</injection-method>
<injection-method>floppy</injection-method>
<injection-method>initrd</injection-method>
<template>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
......@@ -27,7 +28,7 @@
<xsl:when test="config/target-disk != ''">
<xsl:value-of select="config/target-disk"/>
</xsl:when>
<xsl:when test="os/version &gt; 4">
<xsl:when test="os/version &gt; 5.5">
<!-- virtio -->
<xsl:text>/dev/vda</xsl:text>
</xsl:when>
......@@ -40,22 +41,92 @@
<xsl:template name="script-disk">
<xsl:variable name="script-disk">
<xsl:choose>
<xsl:when test="config/script-disk != ''">
<xsl:value-of select="config/script-disk"/>
</xsl:when>
<xsl:when test="os/version &gt; 5.5">
<xsl:text>/dev/sda</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>/dev/sdb</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="substring-after($script-disk, '/dev/')"/>
</xsl:template>
<xsl:template match="/command-line">
<xsl:text>ks=hd:</xsl:text>
<xsl:text>ks=</xsl:text>
<xsl:choose>
<xsl:when test="script/preferred-injection-method = 'initrd'">
<xsl:text>file:/</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>hd:</xsl:text>
<xsl:call-template name="script-disk"/>
<xsl:text>:/</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="script/expected-filename"/>
<xsl:if test="script/installation-source = 'network'">
<xsl:choose>
<xsl:when test="os/version &lt; 7">
<xsl:text> method=</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> inst.repo=</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="installation-url"/>
</xsl:if>
</xsl:template>
<xsl:template name="version">
<xsl:choose>
<xsl:when test="os/version &lt; 7">
<xsl:text>6</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>7</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="arch">
<xsl:choose>
<xsl:when test="config/hardware-arch = 'x86_64'">
<xsl:text>x86_64</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>i386</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="installation-url">
<xsl:choose>
<xsl:when test="config/installation-url != ''">
<xsl:value-of select="config/installation-url"/>
</xsl:when>
<xsl:when test="tree/url != ''">
<xsl:value-of select="tree/url"/>
</xsl:when>
<xsl:when test="os/distro = centos">
<xsl:text>http://mirror.centos.org/centos/</xsl:text>
<xsl:call-template name="version"/>
<xsl:text>/os/</xsl:text>
<xsl:call-template name="arch"/>
</xsl:when>
</xsl:choose>
</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"/>
<xsl:if test="script/installation-source = 'media'">
install
cdrom
</xsl:if>
text
<!-- FIXME: RHEL requires keyboard layout to be a console layout so to do this right, we'll need
mapping from language to console layout. -->
......@@ -65,7 +136,9 @@ skipx
network --bootproto dhcp
rootpw <xsl:value-of select="config/admin-password"/>
firewall --disabled
<xsl:if test="os/version &lt; 8">
authconfig --enableshadow --enablemd5
</xsl:if>
selinux --enforcing
timezone --utc <xsl:value-of select="config/l10n-timezone"/>
bootloader --location=mbr
......@@ -73,30 +146,29 @@ zerombr
clearpart --all --drives=<xsl:call-template name="target-disk"/>
<xsl:choose>
<xsl:when test="os/version &lt; 7">
part /boot --fstype ext4 --size=1024 --ondisk=<xsl:call-template name="target-disk"/>
</xsl:when>
<xsl:otherwise>
part /boot --fstype ext4 --recommended --ondisk=<xsl:call-template name="target-disk"/>
</xsl:otherwise>
</xsl:choose>
part pv.2 --size=1 --grow --ondisk=<xsl:call-template name="target-disk"/>
volgroup VolGroup00 --pesize=32768 pv.2
logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=768 --grow --maxsize=1536
logvol / --fstype ext4 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
autopart
reboot
<xsl:if test="script/installation-source = 'network'">
url --url=<xsl:call-template name="installation-url"/>
</xsl:if>
%packages
<xsl:choose>
<xsl:when test="os/version &lt; 7">
@base
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="os/distro = centos">
@^minimal
</xsl:when>
<xsl:otherwise>
@standard
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
@core
%end
......
<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 -->
<install-script id='http://ubuntu.com/ubuntu/preseed/desktop'>
<profile>desktop</profile>
<expected-filename>preseed.cfg</expected-filename>
<config>
<!-- Localization options -->
<param name="l10n-keyboard" policy="optional" value-map="http://x.org/x11-keyboard"/>
<param name="l10n-timezone" policy="optional"/>
<param name="l10n-language" policy="optional"/>
<!-- User options -->
<param name="user-login" policy="required"/>
<param name="user-realname" policy="optional"/>
<param name="user-password" policy="required"/>
<!-- Misc -->
<param name="target-disk" policy="optional"/>
<param name="hostname" policy="optional"/>
</config>
<injection-method>initrd</injection-method>
<needs-internet>true</needs-internet>
<template>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/>
<xsl:template match="/command-line">
<xsl:text>file=/</xsl:text>
<xsl:value-of select="script/expected-filename"/>
<xsl:text> locale=</xsl:text>
<xsl:value-of select="config/l10n-language"/>
<xsl:text> keyboard-configuration/layoutcode=</xsl:text>
<xsl:value-of select="config/l10n-keyboard"/>
<xsl:text> hostname=</xsl:text>
<xsl:call-template name="hostname"/>
<xsl:text> priority=critical console-setup/ask_detect=false domain=unassigned-domain interface=auto</xsl:text>
<xsl:text> noprompt boot=casper automatic-ubiquity</xsl:text>
</xsl:template>
<xsl:template name="target-disk">
<xsl:choose>
<xsl:when test="config/target-disk != ''">
<xsl:value-of select="config/target-disk"/>
</xsl:when>
<xsl:otherwise>
<!-- virtio -->
<xsl:text>/dev/vda</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="hostname">
<xsl:choose>
<xsl:when test="config/hostname != ''">
<xsl:value-of select="config/hostname"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>ubuntu</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/install-script-config">
d-i pkgsel/include string ubuntu-desktop
d-i debian-installer/locale string <xsl:value-of select="config/l10n-language"/>
d-i netcfg/get_hostname string <xsl:call-template name="hostname"/>
d-i partman-auto/disk string <xsl:call-template name="target-disk"/>
d-i partman-auto/init_automatically_partition select Use the largest continuous free space
d-i partman-auto/method string regular
d-i partman/choose_partition select Finish partitioning and write changes to disk
d-i partman/confirm boolean true
d-i grub-installer/bootdev string <xsl:call-template name="target-disk"/>
d-i partman/confirm_nooverwrite boolean true
d-i clock-setup/ntp boolean true
d-i clock-setup/utc boolean true
d-i time/zone select <xsl:value-of select="config/l10n-timezone"/>
d-i passwd/user-fullname string <xsl:value-of select="config/user-realname"/>
d-i passwd/username string <xsl:value-of select="config/user-login"/>
d-i passwd/user-password password <xsl:value-of select="config/user-password"/>
d-i passwd/user-password-again password <xsl:value-of select="config/user-password"/>
d-i user-setup/allow-password-weak boolean true
d-i finish-install/reboot_in_progress note
#Temporary workaround for LP:1258245
d-i preseed/early_command string chmod 666 /dev/ttyS0
ubiquity ubiquity/summary note
ubiquity ubiquity/reboot boolean true
</xsl:template>
</xsl:stylesheet>
</template>
</install-script>
</libosinfo>
......@@ -21,7 +21,7 @@
<xsl:output method="text"/>
<xsl:template match="/command-line">
<xsl:text>file=file:/</xsl:text>
<xsl:text>file=/</xsl:text>
<xsl:value-of select="script/expected-filename"/>
<xsl:text> locale=</xsl:text>
<xsl:value-of select="config/l10n-language"/>
......@@ -38,8 +38,8 @@
<xsl:value-of select="config/target-disk"/>
</xsl:when>
<xsl:otherwise>
<!-- IDE -->
<xsl:text>/dev/hda</xsl:text>
<!-- virtio -->
<xsl:text>/dev/vda</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
......@@ -55,7 +55,8 @@
</xsl:choose>
</xsl:template>
<xsl:template match="/install-script-config">d-i debian-installer/locale string <xsl:value-of select="config/l10n-language"/>
<xsl:template match="/install-script-config">
d-i debian-installer/locale string <xsl:value-of select="config/l10n-language"/>
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string <xsl:value-of select="config/l10n-keyboard"/>
......@@ -67,69 +68,32 @@ d-i netcfg/wireless_wep string
d-i clock-setup/utc boolean true
d-i time/zone string <xsl:value-of select="config/l10n-timezone"/>
<xsl:if test="os/version &lt; 7.04">
d-i partman-auto/disk string <xsl:call-template name="target-disk"/>
</xsl:if>
<xsl:if test="os/version = 7.04">
d-i partman-auto/init_automatically_partition select Use the largest continuous free space
</xsl:if>
d-i partman-auto/method string regular
<xsl:choose>
<xsl:when test="os/version &lt; 7.10">
d-i partman-auto/choose_recipe select Separate /home partition
</xsl:when>
<xsl:otherwise>
d-i partman-auto/choose_recipe select home
</xsl:otherwise>
</xsl:choose>
d-i partman/confirm_write_new_label boolean true
<xsl:choose>
<xsl:when test="os/version &lt; 7.10">
d-i partman/choose_partition select Finish partitioning and write changes to disk
</xsl:when>
<xsl:otherwise>
d-i partman/choose_partition select finish
</xsl:otherwise>
</xsl:choose>
d-i partman/confirm boolean true
<xsl:if test="os/version &gt; 9.10">
d-i partman/confirm_nooverwrite boolean true
</xsl:if>
d-i passwd/root-login boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password <xsl:value-of select="config/admin-password"/>
d-i passwd/root-password-again password <xsl:value-of select="config/admin-password"/>
<xsl:if test="os/version &lt; 6.10">
d-i pkgsel/install-language-support boolean false
</xsl:if>
<xsl:choose>
<xsl:when test="os/version &lt; 7.10">
tasksel tasksel/first multiselect ubuntu-standard, ubuntu-desktop
</xsl:when>
<xsl:otherwise>
tasksel tasksel/first multiselect standard
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="os/version &lt; 8.04">
d-i mirror/http/proxy string
</xsl:when>
<xsl:when test="os/version = 10.04">
d-i pkgsel/include/install-recommends boolean true
d-i pkgsel/include string ltsp-server-standalone openssh-server python-software-properties
d-i preseed/late_command string chroot /target /usr/sbin/ltsp-update-sshkeys
</xsl:when>
<xsl:when test="os/version = 11.04">
d-i pkgsel/include/install-recommends boolean true
d-i pkgsel/include string openssh-server
<xsl:choose>
<xsl:when test="os/version &lt; 13.10">
<xsl:if test="os/version = 12.04">
d-i pkgsel/include string python-software-properties
</xsl:if>
<!-- Let's avoid installating python-software-properties
for 12.10 as it'd raise an error during installation. -->
</xsl:when>
<xsl:when test="os/version &gt; 11.04">
d-i pkgsel/include/install-recommends boolean true
d-i pkgsel/include string openssh-server python-software-properties
</xsl:when>
<xsl:otherwise>
d-i pkgsel/include string python3-software-properties
</xsl:otherwise>
</xsl:choose>
d-i grub-installer/only_debian boolean true
......@@ -138,15 +102,17 @@ d-i grub-installer/with_other_os boolean true
d-i apt-setup/security_host string
base-config apt-setup/security-updates boolean false
<xsl:if test="os/version &gt; 7.04">
ubiquity ubiquity/summary note
ubiquity ubiquity/reboot boolean true
</xsl:if>
d-i finish-install/reboot_in_progress note
<xsl:if test="os/version &lt; 6.10">
d-i prebaseconfig/reboot_in_progress note
</xsl:if>
# Unfortunately we have to manually force the system to boot without splash screen as,
# otherwise, the splash would be loaded and the user would have to manually switch to
# VT[0-6]
d-i preseed/late_command string \
in-target sed -i 's/\(GRUB_CMDLINE_LINUX_DEFAULT=\).*/\1\"\"/g' /etc/default/grub ; \
in-target bash -c 'update-grub2' ;
<xsl:if test="os/version = 13.04">
ubiquity ubiquity/success_command string sed -i 's/eject -p -m.*/&amp; [ "$prompt" ] || return 0/' /etc/init.d/casper
......