[Libosinfo] [PATCH 1/3] debian: Fix JEOS installation script
Lasse Schuirmann
lasse.schuirmann at gmail.com
Tue Jun 24 12:52:38 UTC 2014
grub-installer does not accept the boot device unless given after a
certain command.
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666974 for more
info.
This also introduces default values so that no questions are asked if
localization or target disk are not given.
---
data/install-scripts/debian.xml | 57 ++++++++++++++++++++++++++++++++---------
1 file changed, 45 insertions(+), 12 deletions(-)
diff --git a/data/install-scripts/debian.xml b/data/install-scripts/debian.xml
index c5c8592..e08b86b 100644
--- a/data/install-scripts/debian.xml
+++ b/data/install-scripts/debian.xml
@@ -1,4 +1,5 @@
<libosinfo version="0.0.1">
+ <!-- JEOS PROFILE -->
<install-script id='http://debian.org/scripts/debian/jeos'>
<profile>jeos</profile>
<expected-filename>preseed.cfg</expected-filename>
@@ -8,6 +9,7 @@
<param name="l10n-keyboard" policy="optional" value-map="http://libosinfo.fedorahosted.org/x11-keyboard"/>
<param name="l10n-timezone" policy="optional"/>
<param name="l10n-language" policy="optional"/>
+ <param name="target-disk" policy="optional"/>
</config>
<injection-method>initrd</injection-method>
<template>
@@ -17,33 +19,64 @@
<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/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'">
+ <xsl:value-of select="config/l10n-language"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>en_US</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="l10n-keyboard">
+ <xsl:choose>
+ <xsl:when test="config/l10n-keyboard != '' and config/l10n-keyboard != 'C'">
+ <xsl:value-of select="config/l10n-keyboard"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>us</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
<xsl:template match="/command-line">
- <xsl:text>file=/</xsl:text>
- <xsl:value-of select="script/expected-filename"/>
- <xsl:text> debian-installer/locale=</xsl:text>
- <xsl:value-of select="config/l10n-language"/>
<xsl:text> keyboard-configuration/xkb-keymap=</xsl:text>
- <xsl:value-of select="config/l10n-keyboard"/>
- <xsl:text> auto-install/enableconsole-setup/ask_detect=false debconf/priority=critical netcfg/choose_interface=auto</xsl:text>
+ <xsl:call-template name="l10n-keyboard"/>
+ <xsl:text> debconf/priority=critical</xsl:text>
</xsl:template>
<xsl:template match="/install-script-config">
-d-i debian-installer/locale select <xsl:value-of select="config/l10n-language"/>
+d-i debian-installer/locale select <xsl:call-template name="l10n-language"/>
d-i console-setup/ask_detect boolean false
-d-i console-setup/layoutcode string <xsl:value-of select="config/l10n-keyboard"/>
+d-i console-setup/layoutcode string <xsl:call-template name="l10n-keyboard"/>
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string localhost
d-i netcfg/get_domain string localdomain
d-i netcfg/disable_dhcp boolean false
-d-i mirror/http/proxy string
+d-i mirror/http/proxy string
d-i netcfg/wireless_wep string
d-i clock-setup/utc boolean true
d-i time/zone select <xsl:value-of select="config/l10n-timezone"/>
+d-i partman-auto/disk string <xsl:call-template name="target-disk"/>
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select home
+
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
@@ -56,8 +89,9 @@ d-i passwd/root-password-again password <xsl:value-of select="config/admin-passw
tasksel tasksel/first multiselect standard
-d-i grub-installer/only_debian boolean true
-d-i grub-installer/with_other_os boolean true
+# Workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666974
+d-i grub-installer/only_debian boolean false
+d-i grub-installer/bootdev string <xsl:call-template name="target-disk"/>
d-i apt-setup/security_host string
d-i apt-setup/services-select multiselect
@@ -69,5 +103,4 @@ d-i finish-install/reboot_in_progress note
</xsl:stylesheet>
</template>
</install-script>
-
</libosinfo>
--
2.0.0
More information about the Libosinfo
mailing list