]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
initscripts: Drop console_init and 10-console.rules.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 9 Oct 2011 15:02:42 +0000 (17:02 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 9 Oct 2011 15:02:42 +0000 (17:02 +0200)
initscripts/initscripts.nm
initscripts/src/Makefile
initscripts/src/console_init.c [deleted file]
initscripts/udev/10-console.rules [deleted file]

index ca0e7af051dd1dc19497248f8cf0065e3c56cfcf..44ed337c9494fcc8121149c7213dbbd946d450a0 100644 (file)
@@ -6,7 +6,7 @@
 name       = initscripts
 epoch      = 1
 version    = 2.99
-release    = 6
+release    = 7
 
 groups     = Base System/Boot
 url        =
index 9a979e40666489fddbafc3b7fafed84113ac8e41..a6b0f3135db9c3ba730ffacab1ca7e7064e8a4ff 100644 (file)
@@ -1,5 +1,5 @@
 
-PROGS = console_init ipcalc securetty
+PROGS = ipcalc securetty
 
 CC = gcc
 CFLAGS += -D_GNU_SOURCE $(shell pkg-config --cflags glib-2.0)
@@ -15,7 +15,6 @@ test: ipcalc
 install: $(PROGS)
        # Install binaries
        -mkdir -pv $(DESTDIR)/lib/udev $(DESTDIR)/{,s}bin
-       install -v -m 755 console_init $(DESTDIR)/lib/udev/
        install -v -m 755 ipcalc $(DESTDIR)/bin
        install -v -m 755 securetty $(DESTDIR)/sbin
 
@@ -25,9 +24,6 @@ install: $(PROGS)
        install -v -m 644 ipcalc.1 $(DESTDIR)/usr/share/man/man1
        install -v -m 644 securetty.8 $(DESTDIR)/usr/share/man/man8
 
-console_init: console_init.o shvar.o
-       $(CC) $(LDFLAGS) $(shell pkg-config --libs glib-2.0) -o $@ $?
-
 ipcalc: ipcalc.o
        $(CC) $(LDFLAGS) -o $@ $< -lpopt
 
diff --git a/initscripts/src/console_init.c b/initscripts/src/console_init.c
deleted file mode 100644 (file)
index 22083a8..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2008-2009 Red Hat, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *
- */
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <linux/kd.h>
-
-#include "shvar.h"
-
-static char *lang = NULL;
-static char *font = NULL;
-static char *acm = NULL;
-static char *unimap = NULL;
-static char *keymap = NULL;
-
-static int linux_console(int fd) {
-       unsigned char twelve = 12;
-
-       if (ioctl(fd, TIOCLINUX, &twelve) >= 0) 
-               return 1;
-       return 0;
-}
-
-static int configured_as_utf8() {
-        shvarFile *i18nfile = NULL;
-
-        if ((i18nfile = svNewFile("/etc/sysconfig/i18n")) == NULL)
-                return 1; /* assume UTF-8 */
-
-        lang = svGetValue(i18nfile, "LANG");
-        font = svGetValue(i18nfile, "SYSFONT");
-        acm = svGetValue(i18nfile, "SYSFONTACM");
-        unimap = svGetValue(i18nfile, "UNIMAP");
-        svCloseFile(i18nfile);
-        if (!lang)
-                return 1;
-        if (g_str_has_suffix(lang,".utf8") || g_str_has_suffix(lang,".UTF-8"))
-                return 1;
-       return 0;
-}
-
-static int read_keymap() {
-       shvarFile *keyboard = NULL;
-       char *tmp;
-       struct stat sb;
-       
-       if (!stat("/etc/sysconfig/console/default.kmap",&sb)) {
-               keymap = "/etc/sysconfig/console/default.kmap";
-               return 0;
-       }
-
-       if ((keyboard = svNewFile("/etc/sysconfig/keyboard")) == NULL)
-               return 0;
-
-       tmp = svGetValue(keyboard, "KEYMAP");
-       if (tmp)
-               keymap = tmp;
-       tmp = svGetValue(keyboard, "KEYTABLE");
-       if (tmp) {
-               if (keymap) free(keymap);
-               asprintf(&keymap, "%s.map", tmp);
-       }
-       return 0;
-}
-
-static void set_font(char *device) {
-       int pid;
-       
-       if ( (pid = fork()) == 0) {
-               char *args[] = { "setfont", "latarcyrheb-sun16", "-C", NULL,
-                                NULL, NULL, NULL, NULL, NULL };
-
-               if (font)
-                       args[1] = font;
-               args[3] = device;
-               if (acm) {
-                       args[4] = "-m"; 
-                       args[5] = acm;
-                       if (unimap) {
-                               args[6] = "-u";
-                               args[7] = unimap;
-                       }
-               } else  if (unimap) {
-                       args[4] = "-u";
-                       args[5] = unimap;
-               }
-               execv("/bin/setfont", args);
-               exit(1);
-       }
-}
-
-static void set_keyboard(int fd, int utf8) {
-       if (ioctl(fd, KDSKBMODE, utf8 ? K_UNICODE : K_XLATE))
-               perror("could not set keyboard mode");
-}
-
-static void set_terminal(int fd, int utf8) {
-       if (utf8)
-               write(fd, "\033%G", 3);
-       else
-               write(fd, "\033%@", 3);
-}
-
-static void set_keymap(int fd, int utf8) {
-       int pid;
-       
-       if ((pid = fork()) == 0) {
-               char *args[] = { "loadkeys", "-q", NULL, NULL, NULL };
-               dup2(fd, 0);
-               dup2(fd, 1);
-               
-               if (utf8) {
-                       args[2] = "-u";
-                       args[3] = keymap;
-               } else {
-                       args[2] = keymap;
-               }
-               execv("/bin/loadkeys", args);
-               exit(1);
-       }
-}
-
-int main(int argc, char **argv) {
-       char *device;
-       int dev;
-
-       if (argc < 2) {
-               printf("usage: console_init <device>\n");
-               exit(1);
-       }
-       chdir("/dev");
-       device = argv[1];
-       dev = open(device, O_RDWR);
-       if (linux_console(dev)) {
-               int utf8 = configured_as_utf8();
-
-               set_keyboard(dev, utf8);
-               set_terminal(dev, utf8);
-               set_font(device);
-               read_keymap();
-               if (keymap)
-                       set_keymap(dev,utf8);
-       }
-       return 0;
-}
diff --git a/initscripts/udev/10-console.rules b/initscripts/udev/10-console.rules
deleted file mode 100644 (file)
index e7609c5..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# do not edit this file, it will be overwritten on update
-
-ACTION!="add", GOTO="console_end"
-
-# Console initialization - keyboard, font, etc.
-KERNEL=="tty0",                RUN+="/lib/udev/console_init %k"
-
-# Check and set up serial and serial-like consoles if necessary
-KERNEL=="console",     RUN+="/lib/udev/console_check %k"
-KERNEL=="ttySG*",      RUN+="/lib/udev/console_check %k"
-KERNEL=="xvc*",                RUN+="/lib/udev/console_check %k"
-KERNEL=="hvsi*",       RUN+="/lib/udev/console_check %k"
-KERNEL=="hvc*",                RUN+="/lib/udev/console_check %k"
-
-LABEL="console_end"