]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
udev: Install console_init script.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 21 Feb 2010 23:44:13 +0000 (00:44 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 21 Feb 2010 23:44:13 +0000 (00:44 +0100)
pkgs/core/udev/console_init [new file with mode: 0644]
pkgs/core/udev/udev.nm

diff --git a/pkgs/core/udev/console_init b/pkgs/core/udev/console_init
new file mode 100644 (file)
index 0000000..1aaaf4d
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/bash
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2008  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# 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, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+is_true() {
+       [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ]
+}
+
+# Native English speakers probably don't have /etc/sysconfig/console at all
+if [ -f /etc/sysconfig/console ]; then
+       . /etc/sysconfig/console
+fi
+
+# Setting default values
+[ -z "$UNICODE" ] && UNICODE=1
+[ -z "$FONT" ] && FONT="LatArCyrHeb-16"
+
+device="/dev/$1"
+
+# Figure out the mode to set the console into
+if is_true "${UNICODE}"; then
+       echo -en '\033%G' > $device
+else
+       echo -en '\033%@' > $device
+fi
+
+# Setting font
+setfont ${FONT} -C $device
+
+# Setting up keyboard
+if [ -n "$KEYMAP" ]; then
+       if is_true "${UNICODE}"; then
+               loadkeys -u $KEYMAP >/dev/null
+       else
+               loadkeys $KEYMAP >/dev/null
+       fi
+       [ -n "$KEYMAP_CORRECTIONS" ] && \
+               loadkeys $KEYMAP_CORRECTIONS >/dev/null
+fi
index 985ba2bd0c9f1229017ce492ca35983eec82a571..c0b9e9a1895cdc4304613d2209caad69154a770d 100644 (file)
@@ -66,4 +66,6 @@ define STAGE_INSTALL_CMDS
 
        ln -svf ../../../../lib/udev/udev-acl \
                $(BUILDROOT)/usr/lib/ConsoleKit/run-seat.d/udev-acl.ck
+
+       install -m 755 $(DIR_SOURCE)/console_init $(BUILDROOT)/lib/udev/
 endef