From patchwork Tue Aug 14 19:45:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 10566129 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 32F131390 for ; Tue, 14 Aug 2018 19:47:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2471D29BD5 for ; Tue, 14 Aug 2018 19:47:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1413829C28; Tue, 14 Aug 2018 19:47:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 96DEA29BD5 for ; Tue, 14 Aug 2018 19:47:56 +0000 (UTC) Received: from localhost ([::1]:46092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpfIJ-0002OK-Uk for patchwork-qemu-devel@patchwork.kernel.org; Tue, 14 Aug 2018 15:47:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpfGt-0002DJ-J7 for qemu-devel@nongnu.org; Tue, 14 Aug 2018 15:46:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpfGe-0007eb-9e for qemu-devel@nongnu.org; Tue, 14 Aug 2018 15:46:27 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:54427) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fpfGd-0007db-Qf for qemu-devel@nongnu.org; Tue, 14 Aug 2018 15:46:12 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.183]) with ESMTPSA (Nemesis) id 0M1Wqf-1g9Ozr2Dm5-00tUmr; Tue, 14 Aug 2018 21:45:30 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 14 Aug 2018 21:45:20 +0200 Message-Id: <20180814194520.22458-2-laurent@vivier.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180814194520.22458-1-laurent@vivier.eu> References: <20180814194520.22458-1-laurent@vivier.eu> X-Provags-ID: V03:K1:DG/oubvngm7QGnWuBhWM8n1KSaSsiJoNW4ZzjYej6nQFUWTjb2F AZl8nLe0mvJsZnmGX/UfrpZ9EQy6lr2YXdwJUFaK8xHLjgo8JLJeuz4smjPdxTqP1fjLdIy Lz/ZgypsuRhBcJiYY9q4JiVwlB1hnyycD05stmkiKYRV5KKqZBEY2JhhVJRf70lFLG8/mYo 1k4vwdpOwg9pf4V9rwzRg== X-UI-Out-Filterresults: notjunk:1;V01:K0:nmh6QjS4kkA=:HxxAUurPGTu08SgZ3Yy6PQ sidufuZxq83pVANspK3FPG99McPE5SbLgVAoPJV/SgAvH2CxSK7EBz5awRt7ZNQ7LyLOuXfAl ajhGGKMOuWq/slCjfStF7TFq3sCSY/B4xQgMzlaMEE/36qdolYOwdamkF2oD8OIB4E5210DSA qUfjgRbSOY+ygJLNGS7ZsNXH/uz52oqCHA6y7qAedjrFNn/4gJyAvZvjOhmeuj35a3q2ODJlE 5Qi5HM5Zw4TwNLOif8f/gl0DIi/hTCV+fyy8Ao0YYYyV1+bYmTzIQriszD/3jh1uIN0bHZGUN Tys3vRoJCFGtzNQeweVpqqScBOtV1lSl8Np3cPwbUCpFyXSnZO0SmRh4IkCSqB51P+zEhT3JX QsEzdOCyu2xOtyvUiduzGls0y7UF3uy24mpYPaKFUXcg6D8MXuS6LLnraEyPFo6hdKkFpb9Vk OcF1fzKwUbLuVpUD1z9vWWEmvTTcKlr7jrDm3iurNgjILv55Qooh/X4kEMRiD37j1MGHGNlr1 KfN9+B1OFadbAc7AuOkTpkaBLBFU8Wm/WJe7GbmtKp4RdJml6lNn86wPfgbnZt1v3ApI17lDt raZnQNVI/lw2UV3U0ce9hjfP4Kp815TrKATrWhKA0TwO/xTanl2dLRGc7nzAxbDHIc1X29hX7 GFJhOMBxpC2cmsGwgzHehBXdp7bh39IorDjeGBhGQdzajtmWkTWWpIUPB6a48u4brQaw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.73 Subject: [Qemu-devel] [PATCH 2/2] linux-user: add pseudo /proc/hardware for m68k X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 5850aba5be..f9a6ada611 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7746,7 +7746,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; @@ -7800,6 +7800,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 { @@ -7818,6 +7826,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 } };