| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<libosinfo version="0.0.1"> |
| 3 |
|
| 4 |
<install-script id='http://fedoraproject.org/silverblue/kickstart/desktop'> |
| 5 |
<profile>desktop</profile> |
| 6 |
<expected-filename>silverblue.ks</expected-filename> |
| 7 |
<config> |
| 8 |
<param value-map="http://x.org/x11-keyboard" policy="optional" name="l10n-keyboard"/> |
| 9 |
<param policy="optional" name="l10n-language"/> |
| 10 |
<param policy="optional" name="l10n-timezone"/> |
| 11 |
<param policy="optional" name="hostname"/> |
| 12 |
<param policy="required" name="user-login"/> |
| 13 |
<param policy="optional" name="user-password"/> |
| 14 |
<param policy="optional" name="admin-password"/> |
| 15 |
<param policy="required" name="script-disk"/> |
| 16 |
</config> |
| 17 |
<injection-method>cdrom</injection-method> |
| 18 |
<injection-method>disk</injection-method> |
| 19 |
<injection-method>floppy</injection-method> |
| 20 |
<injection-method>initrd</injection-method> |
| 21 |
<template> |
| 22 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> |
| 23 |
|
| 24 |
<xsl:output method="text"/> |
| 25 |
|
| 26 |
<xsl:template name="script-disk"> |
| 27 |
<xsl:variable name="script-disk"> |
| 28 |
<xsl:value-of select="config/script-disk"/> |
| 29 |
</xsl:variable> |
| 30 |
<xsl:value-of select="substring-after($script-disk, '/dev/')"/> |
| 31 |
</xsl:template> |
| 32 |
|
| 33 |
<xsl:template match="/command-line"> |
| 34 |
<xsl:text>ks=</xsl:text> |
| 35 |
<xsl:choose> |
| 36 |
<xsl:when test="script/preferred-injection-method = 'initrd'"> |
| 37 |
<xsl:text>file:/</xsl:text> |
| 38 |
</xsl:when> |
| 39 |
<xsl:otherwise> |
| 40 |
<xsl:text>hd:</xsl:text> |
| 41 |
<xsl:call-template name="script-disk"/> |
| 42 |
<xsl:text>:/</xsl:text> |
| 43 |
</xsl:otherwise> |
| 44 |
</xsl:choose> |
| 45 |
<xsl:value-of select="script/expected-filename"/> |
| 46 |
</xsl:template> |
| 47 |
|
| 48 |
<xsl:template match="/install-script-config"> |
| 49 |
# Install script for <xsl:value-of select="os/short-id"/> profile <xsl:value-of select="script/profile"/> |
| 50 |
install |
| 51 |
keyboard '<xsl:value-of select="config/l10n-keyboard"/>' |
| 52 |
lang <xsl:value-of select="config/l10n-language"/> |
| 53 |
network --onboot yes --bootproto dhcp --noipv6 --hostname=<xsl:value-of select="config/hostname"/> |
| 54 |
rootpw dummyPa55w0rd # Actual password set (or unset) in %post below |
| 55 |
firewall --disabled |
| 56 |
timezone --utc <xsl:value-of select="config/l10n-timezone"/> |
| 57 |
bootloader --location=mbr |
| 58 |
zerombr |
| 59 |
|
| 60 |
clearpart --all --drives=/dev/vda |
| 61 |
|
| 62 |
firstboot --disable |
| 63 |
|
| 64 |
autopart |
| 65 |
|
| 66 |
<xsl:choose> |
| 67 |
<xsl:when test="os/version < 29"> |
| 68 |
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 |
| 69 |
</xsl:when> |
| 70 |
<xsl:otherwise> |
| 71 |
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 |
| 72 |
</xsl:otherwise> |
| 73 |
</xsl:choose> |
| 74 |
graphical |
| 75 |
reboot |
| 76 |
|
| 77 |
%post --erroronfail |
| 78 |
|
| 79 |
useradd -G wheel <xsl:value-of select="config/user-login"/> # Add user |
| 80 |
if test -z '<xsl:value-of select="config/user-password"/>'; then |
| 81 |
passwd -d <xsl:value-of select="config/user-login"/> # Make user account passwordless |
| 82 |
else |
| 83 |
echo '<xsl:value-of select="config/user-password"/>' |passwd --stdin <xsl:value-of select="config/user-login"/> |
| 84 |
fi |
| 85 |
|
| 86 |
if test -z '<xsl:value-of select="config/admin-password"/>'; then |
| 87 |
passwd -d root # Make root account passwordless |
| 88 |
else |
| 89 |
echo '<xsl:value-of select="config/admin-password"/>' |passwd --stdin root |
| 90 |
fi |
| 91 |
|
| 92 |
# Enable autologin |
| 93 |
echo "[daemon] |
| 94 |
AutomaticLoginEnable=true |
| 95 |
AutomaticLogin=<xsl:value-of select="config/user-login"/> |
| 96 |
|
| 97 |
[security] |
| 98 |
|
| 99 |
[xdmcp] |
| 100 |
|
| 101 |
[greeter] |
| 102 |
|
| 103 |
[chooser] |
| 104 |
|
| 105 |
[debug] |
| 106 |
" > /etc/gdm/custom.conf |
| 107 |
|
| 108 |
rm -f /etc/ostree/remotes.d/fedora-'<xsl:value-of select="os/version"/>'.conf |
| 109 |
ostree remote add --if-not-exists --set=gpgkeypath=/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-<xsl:value-of select="os/version"/>-primary fedora-<xsl:value-of select="os/version"/> 'https://dl.fedoraproject.org/atomic/repo/' |
| 110 |
|
| 111 |
%end |
| 112 |
</xsl:template> |
| 113 |
</xsl:stylesheet> |
| 114 |
</template> |
| 115 |
</install-script> |
| 116 |
</libosinfo> |