[PATCH 2/2] Enable setting up multiple layouts on the installed system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We need to write a config file to the /etc/X11/xorg.conf.d/ defining
the layouts selected in the installation.
---
 pyanaconda/__init__.py   |   12 ++++++++++++
 pyanaconda/livecd.py     |    2 +-
 pyanaconda/yuminstall.py |    2 +-
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
index fd1e676..e29c85c 100644
--- a/pyanaconda/__init__.py
+++ b/pyanaconda/__init__.py
@@ -279,6 +279,16 @@ class Anaconda(object):
         else:
             self.methodstr = methodstr
 
+    def writeLayouts(self, root):
+        conf_dir = os.path.join(root, "/etc/X11/xorg.conf.d")
+        conf_file = "01-anaconda-keyboard.conf"
+
+        if not os.path.isdir(conf_dir):
+            os.makedirs(conf_dir)
+
+        with open(os.path.join(conf_dir, conf_file), "w") as f:
+            f.write(self.ksdata.keyboard.xorg_conf)
+
     def write(self):
         self.writeXdriver()
         self.instLanguage.write()
@@ -293,3 +303,5 @@ class Anaconda(object):
         self.users.write()
         self.security.write()
         self.firewall.write()
+        self.writeLayouts(ROOT_PATH)
+
diff --git a/pyanaconda/livecd.py b/pyanaconda/livecd.py
index f72d5d2..e2c1826 100644
--- a/pyanaconda/livecd.py
+++ b/pyanaconda/livecd.py
@@ -317,7 +317,7 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
             shutil.copyfile("/etc/modprobe.conf", 
                             ROOT_PATH + "/etc/modprobe.conf")
         # set the same keyboard the user selected in the keyboard dialog:
-        anaconda.keyboard.write(ROOT_PATH)
+        anaconda.writeLayouts(ROOT_PATH)
 
         # rebuild the initrd(s)
         vers = self.kernelVersionList()
diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index d895e27..532bd73 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -1619,7 +1619,7 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
             anaconda.network.copyConfigToPath()
             anaconda.storage.write()
             if not anaconda.isHeadless:
-                anaconda.keyboard.write(ROOT_PATH)
+                anaconda.writeLayouts(ROOT_PATH)
         else:
             # ensure that /etc/mtab is a symlink to /proc/self/mounts
             anaconda.storage.makeMtab()
-- 
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux