Git Product home page Git Product logo

Comments (9)

vivier avatar vivier commented on July 30, 2024

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.

Yes, it's easy to add.
We need the same thing for sparc glibc(?) installer that checks /proc/cpuinfo to know if the system is sun4v or sun4u.

from qemu-m68k.

vivier avatar vivier commented on July 30, 2024

I have pushed a patch in my branch linux-user-proc.
The model that is reported is "qemu-m68k", let me know if there is any problem with that.

# uname -a
Linux Quad 4.17.9-200.fc28.x86_64 #1 SMP Mon Jul 23 21:41:29 UTC 2018 m68k GNU/Linux
# cat /proc/hardware
Model:		qemu-m68k

from qemu-m68k.

glaubitz avatar glaubitz commented on July 30, 2024

Have you tried whether this allows installing the console-setup package?

from qemu-m68k.

vivier avatar vivier commented on July 30, 2024

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.

from qemu-m68k.

glaubitz avatar glaubitz commented on July 30, 2024

Most likely not since the package will be installed with debconf in non-interactive mode during package builds. I'll test that tomorrow.

from qemu-m68k.

glaubitz avatar glaubitz commented on July 30, 2024

I should finally test this.

from qemu-m68k.

glaubitz avatar glaubitz commented on July 30, 2024

Without the patch:

(sid-m68k-sbuild)root@nofan:/# export DEBIAN_FRONTEND=noninteractive ; apt install keyboard-configuration 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
(...)
Selecting previously unselected package keyboard-configuration.
(Reading database ... 19725 files and directories currently installed.)
Preparing to unpack .../keyboard-configuration_1.187_all.deb ...
Unpacking keyboard-configuration (1.187) ...
Setting up keyboard-configuration (1.187) ...
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
/bin/sed: can't read /proc/hardware: No such file or directory
dpkg: error processing package keyboard-configuration (--configure):
 installed keyboard-configuration package post-installation script subprocess returned error exit status 2
Processing triggers for man-db (2.8.4-3) ...
Not building database; man-db/auto-update is not 'true'.
Errors were encountered while processing:
 keyboard-configuration
E: Sub-process /usr/bin/dpkg returned an error code (1)
(sid-m68k-sbuild)root@nofan:/#

With the (rebased) patch applied:

(sid-m68k-sbuild)root@nofan:/# export DEBIAN_FRONTEND=noninteractive ; apt install keyboard-configuration
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  keyboard-configuration
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/397 kB of archives.
After this operation, 2575 kB of additional disk space will be used.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US:en",
        LC_ALL = "en_US.UTF-8",
        LC_CTYPE = "en_US.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
debconf: delaying package configuration, since apt-utils is not installed
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
Selecting previously unselected package keyboard-configuration.
(Reading database ... 14921 files and directories currently installed.)
Preparing to unpack .../keyboard-configuration_1.187_all.deb ...
Unpacking keyboard-configuration (1.187) ...
Setting up keyboard-configuration (1.187) ...
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Processing triggers for man-db (2.8.4-3) ...
Not building database; man-db/auto-update is not 'true'.
(sid-m68k-sbuild)root@nofan:/#

So, it fixes the issue for me. Can we get it upstreamed?

from qemu-m68k.

glaubitz avatar glaubitz commented on July 30, 2024

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 }
     };

from qemu-m68k.

vivier avatar vivier commented on July 30, 2024

added by 4ab6713 ("linux-user: add pseudo /proc/hardware for m68k")

from qemu-m68k.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.