-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for /proc/hardware in qemu-user #34
Comments
Yes, it's easy to add. |
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: vivier/qemu-m68k#34 Signed-off-by: Laurent Vivier <laurent@vivier.eu>
I have pushed a patch in my branch linux-user-proc.
|
Have you tried whether this allows installing the |
Yes, it works but it asks to "select the model of the keyboard of this machine", I don't know if it could be a problem or not. |
Most likely not since the package will be installed with |
I should finally test this. |
Without the patch:
With the (rebased) patch applied:
So, it fixes the issue for me. Can we get it upstreamed? |
I have used this rebased version: diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 280137da8c..4042b75942 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6694,7 +6694,7 @@ static int is_proc_myself(const char *filename, const char *entry)
return 0;
}
-#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) || defined(TARGET_M68K)
static int is_proc(const char *filename, const char *entry)
{
return strcmp(filename, entry) == 0;
@@ -6738,6 +6738,14 @@ static int open_net_route(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 {
@@ -6754,6 +6762,9 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
{ "/proc/net/route", open_net_route, is_proc },
#endif
+#if defined(TARGET_M68K)
+ { "/proc/hardware", open_hardware, is_proc },
+#endif
{ NULL, NULL, NULL }
}; |
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: vivier/qemu-m68k#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>
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: vivier/qemu-m68k#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>
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: vivier/qemu-m68k#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>
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: vivier/qemu-m68k#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>
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: vivier/qemu-m68k#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>
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: vivier/qemu-m68k#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>
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: vivier/qemu-m68k#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>
added by 4ab6713 ("linux-user: add pseudo /proc/hardware for m68k") |
On linux-m68k, the kernel adds a pseudo file called
hardware
to the/proc
filesystem in order to display some hardware information. Some packages likeconsole-setup
use this information to detect the type of m68k hardware being used.See: https://salsa.debian.org/installer-team/console-setup/blob/master/debian/keyboard-configuration.config#L300
Since
console-setup
is required for some packages to be built likexorg-server
, I have written a very small kernel module which adds the pseudo file containingModel: Atari Falcon (with Afterburner040)
which I just copied from the Aranym emulator.The source code for the kernel module is:
Now, in order to improve compatibility, I was wondering whether it would make sense to add support for the
/proc/hardware
pseudo file to qemu-user as well? Of course, this would apply to qemu-user on Linux only.The text was updated successfully, but these errors were encountered: