Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwlive.git;a=commitdiff;h=9692d0217384e126f7f88d330361648587bf0d6f

commit 9692d0217384e126f7f88d330361648587bf0d6f
Author: James Buren <[email protected]>
Date:   Sat Mar 2 07:40:32 2013 -0600

implement function for writing vconsole.conf

diff --git a/new/fwsetup/postconfig.c b/new/fwsetup/postconfig.c
index c674864..b22b5d8 100644
--- a/new/fwsetup/postconfig.c
+++ b/new/fwsetup/postconfig.c
@@ -90,6 +90,35 @@ static bool write_locale_conf(void)
return true;
}

+static bool write_vconsole_conf(void)
+{
+  FILE *file = 0;
+
+  if(g->kbdlayout == 0)
+  {
+    errno = EINVAL;
+    error(strerror(errno));
+    return false;
+  }
+
+  if((file = fopen("etc/vconsole.conf","wb")) == 0)
+  {
+    error(strerror(errno));
+    return false;
+  }
+
+  fprintf(file,
+    "KEYMAP=%s\n"
+    "FONT=%s\n",
+    g->kbdlayout,
+    "ter-v16b"
+  );
+
+  fclose(file);
+
+  return true;
+}
+
static bool is_root_setup(void)
{
FILE *file = 0;
@@ -323,6 +352,9 @@ static bool postconfig_run(void)
if(!write_locale_conf())
return false;

+  if(!write_vconsole_conf())
+    return false;
+
if(!is_root_setup() && (!ui_window_root(&account) || !root_action(&account)))
{
account_free(&account);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to