Blame install-script/debian.org/debian-preseed-desktop.xml

Packit 92e302
Packit 92e302
<libosinfo version="0.0.1">
Packit 92e302
  
Packit 92e302
     See http://www.gnu.org/licenses/ for a copy of the license text -->
Packit 92e302
  <install-script id="http://debian.org/debian/preseed/desktop">
Packit 92e302
    <profile>desktop</profile>
Packit 92e302
    <expected-filename>preseed.cfg</expected-filename>
Packit 92e302
    <can-pre-install-drivers>true</can-pre-install-drivers>
Packit 92e302
    <config>
Packit 92e302
      
Packit 92e302
      <param name="l10n-keyboard" policy="optional" value-map="http://x.org/x11-keyboard"/>
Packit 92e302
      <param name="l10n-language" policy="optional"/>
Packit 92e302
      <param name="l10n-timezone" policy="optional"/>
Packit 92e302
      
Packit 92e302
      <param name="user-login" policy="required"/>
Packit 92e302
      <param name="user-realname" policy="optional"/>
Packit 92e302
      <param name="user-password" policy="optional"/>
Packit 92e302
      <param name="admin-password" policy="optional"/>
Packit 92e302
      
Packit 92e302
      <param name="user-password" policy="required"/>
Packit 92e302
      <param name="admin-password" policy="required"/>
Packit 92e302
      <param name="avatar-location" policy="optional"/>
Packit 92e302
      <param name="avatar-disk" policy="optional"/>
Packit 92e302
      
Packit 92e302
      <param name="hostname" policy="optional"/>
Packit 92e302
      <param name="domain" policy="optional"/>
Packit 92e302
      <param name="target-disk" policy="optional"/>
Packit 92e302
    </config>
Packit 92e302
    <injection-method>initrd</injection-method>
Packit 92e302
    <needs-internet>true</needs-internet>
Packit 92e302
    <template>
Packit 92e302
      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
Packit 92e302
        <xsl:output method="text"/>
Packit 92e302
        <xsl:template name="target-disk">
Packit 92e302
          <xsl:choose>
Packit 92e302
            <xsl:when test="config/target-disk != ''">
Packit 92e302
              <xsl:value-of select="config/target-disk"/>
Packit 92e302
            </xsl:when>
Packit 92e302
            <xsl:otherwise>
Packit 92e302
              <xsl:text>/dev/vda</xsl:text>
Packit 92e302
            </xsl:otherwise>
Packit 92e302
          </xsl:choose>
Packit 92e302
        </xsl:template>
Packit 92e302
        <xsl:template name="avatar-disk">
Packit 92e302
          <xsl:choose>
Packit 92e302
            <xsl:when test="config/avatar-disk != ''">
Packit 92e302
              <xsl:value-of select="config/avatar-disk"/>
Packit 92e302
            </xsl:when>
Packit 92e302
            <xsl:otherwise>
Packit 92e302
              <xsl:text>/dev/sda</xsl:text>
Packit 92e302
            </xsl:otherwise>
Packit 92e302
          </xsl:choose>
Packit 92e302
        </xsl:template>
Packit 92e302
        <xsl:template name="hostname">
Packit 92e302
          <xsl:choose>
Packit 92e302
            <xsl:when test="config/hostname != ''">
Packit 92e302
              <xsl:value-of select="config/hostname"/>
Packit 92e302
            </xsl:when>
Packit 92e302
            <xsl:otherwise>
Packit 92e302
              <xsl:text>locahost</xsl:text>
Packit 92e302
            </xsl:otherwise>
Packit 92e302
          </xsl:choose>
Packit 92e302
        </xsl:template>
Packit 92e302
        <xsl:template name="user-fullname">
Packit 92e302
          <xsl:choose>
Packit 92e302
            <xsl:when test="config/user-realname != ''">
Packit 92e302
              <xsl:value-of select="config/user-realname"/>
Packit 92e302
            </xsl:when>
Packit 92e302
            <xsl:otherwise>
Packit 92e302
              <xsl:value-of select="config/user-login"/>
Packit 92e302
            </xsl:otherwise>
Packit 92e302
          </xsl:choose>
Packit 92e302
        </xsl:template>
Packit 92e302
        <xsl:template name="l10n-language">
Packit 92e302
          <xsl:choose>
Packit 92e302
            <xsl:when test="config/l10n-language != '' and config/l10n-language != 'C'">
Packit 92e302
              <xsl:value-of select="config/l10n-language"/>
Packit 92e302
            </xsl:when>
Packit 92e302
            <xsl:otherwise>
Packit 92e302
              <xsl:text>en_US</xsl:text>
Packit 92e302
            </xsl:otherwise>
Packit 92e302
          </xsl:choose>
Packit 92e302
        </xsl:template>
Packit 92e302
        <xsl:template name="l10n-keyboard">
Packit 92e302
          <xsl:choose>
Packit 92e302
            <xsl:when test="config/l10n-keyboard != '' and config/l10n-keyboard != 'C'">
Packit 92e302
              <xsl:value-of select="config/l10n-keyboard"/>
Packit 92e302
            </xsl:when>
Packit 92e302
            <xsl:otherwise>
Packit 92e302
              <xsl:text>us</xsl:text>
Packit 92e302
            </xsl:otherwise>
Packit 92e302
          </xsl:choose>
Packit 92e302
        </xsl:template>
Packit 92e302
        <xsl:template match="/command-line">
Packit 92e302
          <xsl:text> keyboard-configuration/xkb-keymap=</xsl:text>
Packit 92e302
          <xsl:call-template name="l10n-keyboard"/>
Packit 92e302
          <xsl:text> debconf/priority=critical</xsl:text>
Packit 92e302
        </xsl:template>
Packit 92e302
        <xsl:template match="/install-script-config">
Packit 92e302
# For inspiration and explanations see:
Packit 92e302
# http://sfxpt.wordpress.com/2013/06/09/get-the-debianubuntu-ready-and-customized-the-way-you-like-in-10-minutes/
Packit 92e302
Packit 92e302
### Network
Packit 92e302
d-i netcfg/choose_interface select auto
Packit 92e302
d-i netcfg/get_hostname string <xsl:call-template name="hostname"/>
Packit 92e302
d-i netcfg/get_domain string <xsl:value-of select="config/domain"/>
Packit 92e302
d-i netcfg/disable_dhcp boolean false
Packit 92e302
Packit 92e302
Packit 92e302
### Localization
Packit 92e302
d-i debian-installer/locale string <xsl:call-template name="l10n-language"/>
Packit 92e302
d-i debian-installer/splash boolean false
Packit 92e302
d-i console-setup/ask_detect boolean false
Packit 92e302
Packit 92e302
Packit 92e302
### Time
Packit 92e302
d-i clock-setup/ntp boolean true
Packit 92e302
d-i clock-setup/utc boolean true
Packit 92e302
d-i time/zone select <xsl:value-of select="config/l10n-timezone"/>
Packit 92e302
Packit 92e302
Packit 92e302
### Account setup
Packit 92e302
Packit 92e302
## Root
Packit 92e302
d-i passwd/root-login boolean true
Packit 92e302
d-i passwd/root-password password <xsl:value-of select="config/admin-password"/>
Packit 92e302
d-i passwd/root-password-again password <xsl:value-of select="config/admin-password"/>
Packit 92e302
Packit 92e302
## User
Packit 92e302
d-i user-setup/allow-password-weak boolean true
Packit 92e302
d-i user-setup/encrypt-home boolean false
Packit 92e302
d-i passwd/user-fullname string <xsl:call-template name="user-fullname"/>
Packit 92e302
d-i passwd/username <xsl:value-of select="config/user-login"/>
Packit 92e302
d-i passwd/user-password password <xsl:value-of select="config/user-password"/>
Packit 92e302
d-i passwd/user-password-again password <xsl:value-of select="config/user-password"/>
Packit 92e302
Packit 92e302
Packit 92e302
### Partitioning
Packit 92e302
d-i partman-auto/disk string <xsl:call-template name="target-disk"/>
Packit 92e302
d-i partman-auto/method string regular
Packit 92e302
d-i partman-auto/choose_recipe select home
Packit 92e302
d-i partman/default_filesystem string ext4
Packit 92e302
d-i partman-auto/purge_lvm_from_device boolean true
Packit 92e302
# avoid any confirmation
Packit 92e302
d-i partman/choose_partition select finish
Packit 92e302
d-i partman/confirm_write_new_label boolean true
Packit 92e302
d-i partman/confirm_nooverwrite boolean true
Packit 92e302
d-i partman/confirm boolean true
Packit 92e302
Packit 92e302
Packit 92e302
### Apt
Packit 92e302
d-i apt-setup/use_mirror boolean true
Packit 92e302
d-i apt-setup/security_host string
Packit 92e302
d-i apt-setup/services-select multiselect
Packit 92e302
d-i apt-setup/volatile_host string
Packit 92e302
d-i apt-setup/security_host string
Packit 92e302
Packit 92e302
Packit 92e302
### Software selection
Packit 92e302
tasksel tasksel/first multiselect desktop ssh-server
Packit 92e302
Packit 92e302
### Install Qemu guest agent
Packit 92e302
<xsl:if test="os/version > 7"><xsl:text>d-i pkgsel/include string qemu-guest-agent xserver-xorg-video-qxl spice-vdagent </xsl:text><xsl:if test="os/version > 8"><xsl:text>spice-webdavd</xsl:text></xsl:if></xsl:if>
Packit 92e302
Packit 92e302
### Bootloader
Packit 92e302
Packit 92e302
## Dont use LILO
Packit 92e302
d-i lilo-installer/skip boolean true
Packit 92e302
Packit 92e302
## GRUB settings
Packit 92e302
# Workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666974
Packit 92e302
d-i grub-installer/only_debian boolean false
Packit 92e302
d-i grub-installer/bootdev string <xsl:call-template name="target-disk"/>
Packit 92e302
Packit 92e302
Packit 92e302
### Cleanup
Packit 92e302
d-i finish-install/reboot_in_progress note
Packit 92e302
Packit 92e302
### Remove the installation DVD from the apt-get's sources.list
Packit 92e302
d-i preseed/late_command string in-target sed -i '/cdrom/d' /etc/apt/sources.list
Packit 92e302
Packit 92e302
<xsl:choose><xsl:when test="config/avatar-location != ''">
Packit 92e302
### Set user avatar
Packit 92e302
d-i preseed/late_command string \
Packit 92e302
    mkdir /mnt/unattended-media ; \
Packit 92e302
    mount <xsl:call-template name="avatar-disk"/> /mnt/unattended-media ; \
Packit 92e302
    cp /mnt/unattended-media/<xsl:value-of select="config/avatar-location"/> /target/var/lib/AccountsService/icons/<xsl:value-of select="config/user-login"/> ; \
Packit 92e302
    umount /mnt/unattended-media ; \
Packit 92e302
    echo "[User]" >> /target/var/lib/AccountsService/users/<xsl:value-of select="config/user-login"/> ; \
Packit 92e302
    echo "Language=<xsl:value-of select="config/l10n-language"/>.UTF-8" >> /target/var/lib/AccountsService/users/<xsl:value-of select="config/user-login"/> ;\
Packit 92e302
    echo "XSession=gnome" >> /target/var/lib/AccountsService/users/<xsl:value-of select="config/user-login"/> ; \
Packit 92e302
    echo "Icon=/var/lib/AccountsService/icons/<xsl:value-of select="config/user-login"/>" >> /target/var/lib/AccountsService/users/<xsl:value-of select="config/user-login"/>
Packit 92e302
  </xsl:when></xsl:choose>
Packit 92e302
Packit 92e302
### Create an osinfo-install-successful file in /root
Packit 92e302
d-i preseed/late_command string in-target \
Packit 92e302
    touch /root/osinfo-install-successful
Packit 92e302
Packit 92e302
</xsl:template>
Packit 92e302
      </xsl:stylesheet>
Packit 92e302
    </template>
Packit 92e302
  </install-script>
Packit 92e302
</libosinfo>