summary refs log tree commit diff stats
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2019-05-17 15:31:49 +0200
committerLaurent Vivier <laurent@vivier.eu>2019-05-22 20:50:55 +0200
commit4ab6713ef6d963dcc462519054e0b137dfcf4698 (patch)
treeda682c2a7f8cb2f28f639ec97259b5d6b97a9774 /linux-user/syscall.c
parentfff6938264fc09e941b2e572e32fa70f7da7f884 (diff)
downloadfocaccia-qemu-4ab6713ef6d963dcc462519054e0b137dfcf4698.tar.gz
focaccia-qemu-4ab6713ef6d963dcc462519054e0b137dfcf4698.zip
linux-user: add pseudo /proc/hardware for m68k
Debian console-setup uses /proc/hardware to guess the keyboard layout.
If the file /proc/hardware cannot be opened, the installation fails.

This patch adds a pseudo /proc/hardware file to report the model of
the machine. Instead of reporting a known and fake model, it
reports "qemu-m68k", which is true, and avoids to set the configuration
for an Amiga/Apple/Atari and let the user to chose the good one.

Bug: https://github.com/vivier/qemu-m68k/issues/34
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190517133149.19593-3-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 68484a83e6..e5545cbafa 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6787,7 +6787,7 @@ static int is_proc_myself(const char *filename, const char *entry)
 }
 
 #if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) || \
-    defined(TARGET_SPARC)
+    defined(TARGET_SPARC) || defined(TARGET_M68K)
 static int is_proc(const char *filename, const char *entry)
 {
     return strcmp(filename, entry) == 0;
@@ -6847,6 +6847,14 @@ static int open_cpuinfo(void *cpu_env, int fd)
 }
 #endif
 
+#if defined(TARGET_M68K)
+static int open_hardware(void *cpu_env, int fd)
+{
+    dprintf(fd, "Model:\t\tqemu-m68k\n");
+    return 0;
+}
+#endif
+
 static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags, mode_t mode)
 {
     struct fake_open {
@@ -6866,6 +6874,9 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
 #if defined(TARGET_SPARC)
         { "/proc/cpuinfo", open_cpuinfo, is_proc },
 #endif
+#if defined(TARGET_M68K)
+        { "/proc/hardware", open_hardware, is_proc },
+#endif
         { NULL, NULL, NULL }
     };