Update keytab-lilo from LILO 22.8
authorH. Peter Anvin <hpa@zytor.com>
Tue, 10 Feb 2009 06:53:35 +0000 (22:53 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 10 Feb 2009 06:53:35 +0000 (22:53 -0800)
utils/keytab-lilo

index 7dbcf94..fd58e00 100755 (executable)
@@ -1,23 +1,8 @@
 #!/usr/bin/perl
-# --------------------------------------------------------------------------
-# This program was taken from the LILO-20 distribution; only this header
-# was added.
-#
-# LILO program code, documentation and auxiliary programs are
-# Copyright 1992-1997 Werner Almesberger.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms of parts of or the
-# whole original or derived work are permitted provided that the
-# original work is properly attributed to the author. The name of the
-# author may not be used to endorse or promote products derived from
-# this software without specific prior written permission. This work
-# is provided "as is" and without any express or implied warranties.
-# --------------------------------------------------------------------------
 
-eval { use bytes; }; eval { binmode STDOUT; };
+eval { use bytes; }
+eval { binmode STDOUT; }
 
-$DEFAULT_PATH = "/lib/kbd/keymaps";
 $DEFAULT_MAP = "us";
 $DEFAULT_EXT = ".map";
 
@@ -54,8 +39,7 @@ sub load_map
     local ($empty,$current);
 
     $map = $DEFAULT_MAP unless defined $map;
-    # $map = $DEFAULT_PATH."/".$map unless $map =~ m|/|;
-    # $map .= $DEFAULT_EXT unless $map =~ m|/[^/]+\.[^/]+$|;
+    $map .= $DEFAULT_EXT unless $map =~ m|/[^/]+\.[^/]+$|;
     if (!open(FILE,"loadkeys -m $map |")) {
        print STDERR "loadkeys -m $map: $!\n";
        exit 1;
@@ -64,9 +48,9 @@ sub load_map
     $empty = 1;
     while (<FILE>) {
        chop;
-       if (/^u_short\s+(\S+)_map\[\S+\]\s+=\s+{\s*$/) {
+       if (/^(static\s+)?u_short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) {
            die "active at beginning of map" if defined $current;
-           $current = $pfx.":".$1;
+           $current = $pfx.":".$2;
            next;
        }
        undef $current if /^};\s*$/;