[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/10] linux-user: add pseudo /proc/hardware for m68k
From: |
Laurent Vivier |
Subject: |
[Qemu-devel] [PULL 02/10] linux-user: add pseudo /proc/hardware for m68k |
Date: |
Thu, 23 May 2019 16:43:28 +0200 |
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 <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
---
linux-user/syscall.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 68484a83e69e..e5545cbafac7 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 {
@@ -6865,6 +6873,9 @@ static int do_openat(void *cpu_env, int dirfd, const char
*pathname, int flags,
#endif
#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 }
};
--
2.20.1
- [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 01/10] linux-user: add pseudo /proc/cpuinfo for sparc, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 07/10] linux-user: Add support for setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 04/10] linux-user: Add support for SIOCSPGRP ioctl for all targets, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 02/10] linux-user: add pseudo /proc/hardware for m68k,
Laurent Vivier <=
- [Qemu-devel] [PULL 09/10] linux-user: Align mmap_find_vma to host page size, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 05/10] linux-user: Add support for SIOC<G|S>IFPFLAGS ioctls for all targets, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 03/10] linux-user: Fix support for SIOCATMARK and SIOCGPGRP ioctls for xtensa, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 08/10] linux-user: Fix shmat emulation by honoring host SHMLBA, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 06/10] linux-user: Sanitize interp_info and, for mips only, init field fp_abi, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 10/10] linux-user: Pass through nanosecond timestamp components for stat syscalls, Laurent Vivier, 2019/05/23
- Re: [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches, no-reply, 2019/05/23
- Re: [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches, Peter Maydell, 2019/05/24