[PATCH 2/2] We no longer need getkeymaps, mapshdr, or readmap.
Chris Lumens
clumens at redhat.com
Thu Aug 9 18:36:39 UTC 2012
---
scripts/Makefile.am | 2 +-
scripts/getkeymaps | 75 ---------------------------------
utils/Makefile.am | 1 -
utils/mapshdr.c | 59 --------------------------
utils/readmap.c | 119 ----------------------------------------------------
5 files changed, 1 insertion(+), 255 deletions(-)
delete mode 100755 scripts/getkeymaps
delete mode 100644 utils/mapshdr.c
delete mode 100644 utils/readmap.c
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 8ad9512..6204fd3 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -18,7 +18,7 @@
# Author: David Cantrell <dcantrell at redhat.com>
scriptsdir = $(libexecdir)/$(PACKAGE_NAME)
-dist_scripts_SCRIPTS = getkeymaps upd-updates
+dist_scripts_SCRIPTS = upd-updates
dist_scripts_DATA = pyrc.py
dist_noinst_SCRIPTS = getlangnames.py upd-kernel makeupdates
diff --git a/scripts/getkeymaps b/scripts/getkeymaps
deleted file mode 100755
index 137ae5e..0000000
--- a/scripts/getkeymaps
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-#
-# getkeymaps
-#
-# Copyright (C) 2007 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 as published by
-# the Free Software Foundation; either version 2 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/>.
-#
-
-ARCH=$1
-if [ -z "$ARCH" ]; then
- echo "usage: $0 <arch>"
- exit 1
-fi
-
-if [ "$ARCH" = "x86_64" -o "$ARCH" = "s390x" -o "$ARCH" = "ppc64" ]; then
- LIBDIR=lib64
-else
- LIBDIR=lib
-fi
-
-TOPDIR=`pwd`
-OUTPUT=$2
-if [ -z "$OUTPUT" ]; then
- echo "No output specified, using ${TMPDIR:-/tmp}/keymaps-$ARCH.$$"
- OUTPUT=${TMPDIR:-/tmp}/keymaps-$ARCH.$$
-fi
-
-UTILDIR=$3
-if [ -z "$UTILDIR" ]; then
- READMAP=../utils/readmap
- MAPSHDR=$TOPDIR/../utils/mapshdr
-else
- READMAP=$UTILDIR/usr/libexec/anaconda/readmap
- MAPSHDR=$UTILDIR/usr/libexec/anaconda/mapshdr
-fi
-
-TMP=${TMPDIR:-/tmp}/keymaps.$$
-
-rm -rf $TMP
-mkdir -p $TMP
-
-if [ $ARCH = "sparc" ]; then
- PATTERN={i386,sun}
-else
- PATTERN=i386
-fi
-
-MAPS=$(python -c "import system_config_keyboard.keyboard_models ; system_config_keyboard.keyboard_models.get_supported_models()")
-
-for map in $MAPS ; do
- eval find /lib/kbd/keymaps/$PATTERN -name "$map.map*.gz" | while read n; do
- /bin/loadkeys `basename $n .gz` >/dev/null
- $READMAP $TMP/`basename $n .map.gz`.map
- done
-done
-
-loadkeys us
-
-rm -f $TMP/defkeymap* $TMP/ANSI* $TMP/lt.map
-
-(cd $TMP; $MAPSHDR *.map) > $TMP/hdr
-cat $TMP/hdr $TMP/*.map | gzip -9 > $OUTPUT
-rm -rf $TMP
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 0a3a953..9932a15 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -22,6 +22,5 @@ SUBDIRS = log_picker
utilsdir = $(libexecdir)/$(PACKAGE_NAME)
dist_sbin_SCRIPTS = logpicker handle-sshpw
-utils_PROGRAMS = mapshdr readmap
MAINTAINERCLEANFILES = Makefile.in
diff --git a/utils/mapshdr.c b/utils/mapshdr.c
deleted file mode 100644
index ffba6b2..0000000
--- a/utils/mapshdr.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * mapshdr.c
- *
- * Copyright (C) 2007 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 as published by
- * the Free Software Foundation; either version 2 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/>.
- */
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "../pyanaconda/isys/lang.h"
-
-int main(int argc, char ** argv) {
- struct kmapHeader h;
- struct kmapInfo info;
- int i;
- struct stat sb;
- char * chptr;
-
- h.magic = KMAP_MAGIC;
- h.numEntries = argc - 1;
- write(1, &h, sizeof(h));
-
- for (i = 1; i < argc; i++) {
- if (stat(argv[i], &sb)) {
- fprintf(stderr, "stat error for %s: %s\n", argv[i],
- strerror(errno));
- exit(1);
- }
-
- memset(info.name, 0, KMAP_NAMELEN);
- strncpy(info.name, argv[i], KMAP_NAMELEN - 1);
-
- chptr = info.name + strlen(info.name) - 1;
- while (*chptr != '.') *chptr-- = '\0';
- *chptr = '\0';
-
- info.size = sb.st_size;
- write(1, &info, sizeof(info));
- }
-
- return 0;
-}
diff --git a/utils/readmap.c b/utils/readmap.c
deleted file mode 100644
index 035158c..0000000
--- a/utils/readmap.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * readmap.c
- *
- * Copyright (C) 2007 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 as published by
- * the Free Software Foundation; either version 2 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/>.
- */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <linux/keyboard.h>
-#ifdef NR_KEYS
-#undef NR_KEYS
-#define NR_KEYS 128
-#endif
-
-#include <linux/kd.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "../pyanaconda/isys/lang.h"
-
-int main(int argc, char ** argv) {
- int console;
- int kmap, key;
- struct kbentry entry;
- int keymaps[MAX_NR_KEYMAPS];
- int count = 0;
- int out;
- short keymap[NR_KEYS];
- int magic = KMAP_MAGIC;
- int verbose = 0;
-
- if (argc != 2) {
- printf("bad usage\n");
- exit(1);
- }
-
- if (getenv("DEBUG") != NULL)
- verbose = 1;
-
- memset(keymaps, 0, sizeof(keymaps));
-
- console = open("/dev/tty0", O_RDWR);
- if (console < 0) {
- perror("open VGA+KBD");
- exit(1);
- }
-
- for (kmap = 0; kmap < MAX_NR_KEYMAPS; kmap++) {
- for (key = 0; key < NR_KEYS; key++) {
- entry.kb_index = key;
- entry.kb_table = kmap;
- if (ioctl(console, KDGKBENT, &entry)) {
- perror("ioctl failed");
- exit(1);
- } else if (KTYP(entry.kb_value) != KT_SPEC) {
- keymaps[kmap] = 1;
- count++;
- break;
- }
- }
- }
-
- if (verbose) fprintf(stderr, "found %d valid keymaps\n", count);
-
- if (verbose) fprintf(stderr, "creating keymap file %s\n", argv[1]);
- if ((out = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 1) {
- perror("open keymap");
- exit(1);
- }
-
- if (write(out, &magic, sizeof(magic)) != sizeof(magic)) {
- perror("write magic");
- exit(1);
- }
-
- if (write(out, keymaps, sizeof(keymaps)) != sizeof(keymaps)) {
- perror("write header");
- exit(1);
- }
-
- for (kmap = 0; kmap < MAX_NR_KEYMAPS; kmap++) {
- if (!keymaps[kmap]) continue;
- for (key = 0; key < NR_KEYS; key++) {
- entry.kb_index = key;
- entry.kb_table = kmap;
- if (ioctl(console, KDGKBENT, &entry)) {
- perror("ioctl failed");
- exit(1);
- } else {
- keymap[key] = entry.kb_value;
- }
- }
-
- if (write(out, keymap, sizeof(keymap)) != sizeof(keymap)) {
- perror("write keymap");
- exit(1);
- }
- }
-
- close(out);
-
- return 0;
-}
--
1.7.11.2
More information about the anaconda-patches
mailing list