currently dumpkmap stores the keymap in the host endian format.
that makes it impossible to create portable kmaps for usage on different archs.

however, i'm not sure if (apart from the endian differences) the kernel keymaps differ between archs, so this may be unnecessary anyway.
--- busybox-1.20.2.org/console-tools/dumpkmap.c	2013-09-16 10:31:35.559126113 +0000
+++ busybox-1.20.2/console-tools/dumpkmap.c	2013-09-16 12:30:56.805869053 +0000
@@ -69,7 +69,8 @@
 						(char *)&ke.kb_table,
 						&ke.kb_value)
 				) {
-					write(STDOUT_FILENO, (void*)&ke.kb_value, 2);
+					unsigned short val = htons(ke.kb_value);
+					write(STDOUT_FILENO, &val, 2);
 				}
 			}
 		}
--- busybox-1.20.2.org/console-tools/loadkmap.c	2013-09-16 10:31:35.558126114 +0000
+++ busybox-1.20.2/console-tools/loadkmap.c	2013-09-16 12:32:35.680865504 +0000
@@ -66,7 +66,7 @@
 			for (j = 0; j < NR_KEYS; j++) {
 				ke.kb_index = j;
 				ke.kb_table = i;
-				ke.kb_value = ibuff[j];
+				ke.kb_value = ntohs(ibuff[j]);
 				ioctl(fd, KDSKBENT, &ke);
 			}
 		}
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to