[Libosinfo] [PATCH 2/2] ubuntu: Add jeos install-script (version >= 6.06)
Fabiano Fidêncio
fabiano at fidencio.org
Wed Dec 26 08:45:02 UTC 2012
script base on: https://github.com/clalancette/oz/tree/master/oz/auto
---
data/install-scripts/Makefile.am | 1 +
data/install-scripts/ubuntu.xml | 142 +++++++++++++++++++++++++++++++++++++++
data/oses/ubuntu.xml.in | 55 +++++++++++++++
3 files changed, 198 insertions(+)
create mode 100644 data/install-scripts/ubuntu.xml
diff --git a/data/install-scripts/Makefile.am b/data/install-scripts/Makefile.am
index b916f64..c168cfa 100644
--- a/data/install-scripts/Makefile.am
+++ b/data/install-scripts/Makefile.am
@@ -3,6 +3,7 @@ databasedir = $(pkgdatadir)/db/install-scripts/
database_DATA = \
debian.xml \
fedora.xml \
+ ubuntu.xml \
windows-sif.xml \
windows-cmd.xml \
windows-reg.xml \
diff --git a/data/install-scripts/ubuntu.xml b/data/install-scripts/ubuntu.xml
new file mode 100644
index 0000000..6fe4dfc
--- /dev/null
+++ b/data/install-scripts/ubuntu.xml
@@ -0,0 +1,142 @@
+<libosinfo version="0.0.1">
+ <!-- JEOS PROFILE -->
+ <install-script id='http://fedoraproject.org/scripts/ubuntu/jeos'>
+ <profile>jeos</profile>
+ <expected-filename>preseed.cfg</expected-filename>
+ <config>
+ <param name="admin-password" policy="required"/>
+ <param name="l10n-keyboard" policy="optional"/>
+ <param name="l10n-language" policy="optional"/>
+ <param name="l10n-timezone" policy="optional"/>
+ </config>
+ <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>
+ <!-- IDE -->
+ <xsl:text>/dev/hda</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="keyboard-from-language">
+ <xsl:variable name="locale">
+ <xsl:choose>
+ <xsl:when test="contains(config/l10n-language,'.')">
+ <xsl:value-of select="substring-before(config/l10n-language,'.')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="config/l10n-language"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="substring-after($locale,'_')"/>
+ </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"/>
+
+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:call-template name="keyboard-from-language"/>
+
+d-i netcfg/choose_interface select auto
+d-i netcfg/get_hostname string <xsl:value-of select="config/hostname"/>
+d-i netcfg/get_domain string unassigned-domain
+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 < 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 < 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 < 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 > 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 < 6.10">
+d-i pkgsel/install-language-support boolean false
+</xsl:if>
+
+<xsl:choose>
+ <xsl:when test="os/version < 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 < 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 > 10.10">
+d-i pkgsel/include/install-recommends boolean true
+d-i pkgsel/include string openssh-server python-software-properties
+ </xsl:when>
+</xsl:choose>
+
+d-i grub-installer/only_debian boolean true
+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 > 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 < 6.10">
+d-i prebaseconfig/reboot_in_progress note
+</xsl:if>
+ </xsl:template>
+ </xsl:stylesheet>
+ </template>
+ </install-script>
+
+</libosinfo>
diff --git a/data/oses/ubuntu.xml.in b/data/oses/ubuntu.xml.in
index 8c3c8d2..484fd14 100644
--- a/data/oses/ubuntu.xml.in
+++ b/data/oses/ubuntu.xml.in
@@ -362,6 +362,9 @@
<initrd>casper/initrd.img</initrd>
</media>
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/6.10">
@@ -443,6 +446,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/7.04">
@@ -506,6 +513,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/7.10">
@@ -569,6 +580,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/8.04">
@@ -645,6 +660,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/8.10">
@@ -699,6 +718,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/9.04">
@@ -757,6 +780,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/9.10">
@@ -811,6 +838,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/10.04">
@@ -858,6 +889,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/10.10">
@@ -925,6 +960,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/11.04">
@@ -992,6 +1031,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/11.10">
@@ -1059,6 +1102,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/12.04">
@@ -1120,6 +1167,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
<os id="http://ubuntu.com/ubuntu/12.10">
@@ -1181,6 +1232,10 @@
<kernel>casper/vmlinuz</kernel>
<initrd>casper/initrd.img</initrd>
</media>
+
+ <installer>
+ <script id='http://fedoraproject.org/scripts/ubuntu/jeos'/>
+ </installer>
</os>
</libosinfo>
--
1.8.0.2
More information about the Libosinfo
mailing list