From nobody Mon Nov 10 19:14:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1558100049; cv=none; d=zoho.com; s=zohoarc; b=aHwZLrseSYasy1g8FP3SgIF/tl1a/xyy/uaSBN/yIAjNM137tyUWfAnMST476+vudu3+LsQkGg4Dx74QJWh1RtxnNwerJtpujkI/QE0DU7qIxKCRu2RREQApbYsg/tLVPwXuO9KMxnS4gDozhJTWM1dp3cc/xWMruG2h0uZ1+oM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558100049; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=5tIjQuNwv9CFQyh012ocFchqjLF8FxqRnIeB8oyHC3s=; b=W9VEg500cP311BfNb45o2K5ghY6lYR4UV/tK+6WzHtR7LO6dGHDOQSe0zLdaibP1+DEvNn8aZp3xDcXoohGNZkM/aO5oLLLrFpsTMiqD3kNgNXLOFf5W2MVBKOvW7oPahbs6rMAKBgrAyyscrQ8gg/G2Dm3ApvsMvY8ssKqQpts= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558100049125701.4925416824523; Fri, 17 May 2019 06:34:09 -0700 (PDT) Received: from localhost ([127.0.0.1]:48718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRczp-0007vf-Pw for importer@patchew.org; Fri, 17 May 2019 09:34:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRcxw-00077a-NP for qemu-devel@nongnu.org; Fri, 17 May 2019 09:32:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRcxv-0000PA-MG for qemu-devel@nongnu.org; Fri, 17 May 2019 09:32:04 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:38211) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRcxv-0000O5-Db for qemu-devel@nongnu.org; Fri, 17 May 2019 09:32:03 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N0Fh1-1gUxhX1kwR-00xKLY; Fri, 17 May 2019 15:32:00 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 17 May 2019 15:31:49 +0200 Message-Id: <20190517133149.19593-3-laurent@vivier.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190517133149.19593-1-laurent@vivier.eu> References: <20190517133149.19593-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:MUxknIyAlww1SwVDciJLAafvYWAlnxkCPoZ4BNt5hBF/41lAK2r XoPVt9xO//K/COuscd/K0Eu4EZmKIjEMinhEWSm6TDgq/ewMDnhzWcR8Yt54u1x8WWHYSYG JbLqCmR1SXXB5Br1UGLOihFrXbgVH7bXlh1wraeO0Agnqp/MkCA8IIAhVsymdeg3xCdK44i AXiU3qtbBcJXSjEzw8Lqw== X-UI-Out-Filterresults: notjunk:1;V03:K0:Olv0kgpc8FQ=:6O/i3MAHrd/SA0VErQnKW5 DdJbSW8ge2AwaDFzF1UM8dBC1b6FMR+QQntnRnFUXpJ6//Fumc7MpCFCdLTdYLtaZhxcix1Hd 8W6YFldkHA7WfCwp8ONOYkPNLXLOB+nLT1Wj4c2QcmyR4MxWWi3gVUws7cSo3DaAg87bBeAID UGoO09eF4Jt1ISxgpKKOym8hux9FC4sARINxCfQh1k2v6XH5Stowj/qmFHCNUxWQJ1A8Wyqyg uDAc6LF34Qw3EDXinWn8HMGqqWEKozGUb6geZ917ITG9MbkUNz22HDG3cXrpwfDIQ7ZcPuWXj EHxI2tyW1HEiSk0GZJZq2tQnmMKU4FMbrt+RTXEOpGtHMWb9WZFlNzLVa7JyOzoIK3Zkpi4wf HVvwJCXmvJu3RP/r1/BV/HQMGj2m9U20dtoAT9ccnukghhK6UQpp0u8QAphj/C/xGi2Edk+4t eNhu41K3Bw/29AlXvIJV3tIwN/R44zxvqnV6aY7YQMG6i397E5GexQkUEYuvrppzu+7LdvLDr 8Gxhi3YSZZsok1mDUQQEy419gmk0MlhQbayXzBH/4LgikeSLZ1F2yzH+Gh/f3TOkrJ1lRnhOi EXAiEYVzFbMbJ7Xc4eCcT0XAb9SJPuQVr0ZzbGckpkVkBVHc8thrERC/099m7AIVVUqxaOiyk UZ78phwOGDZIf1p/trCMiw8g6EmP/tF0O26r+rObIoKiqEJX5/tmsPXUKxZRugrqbdGOPvI0j 0BTyipO5gKnjkqn1gCYPw4Xcrwbq0OqvjHWeCg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.135 Subject: [Qemu-devel] [PATCH v2 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Richard Henderson --- 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 43b1b106765c..544fcd02be9a 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) } =20 #if defined(HOST_WORDS_BIGENDIAN) !=3D 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) =3D=3D 0; @@ -6847,6 +6847,14 @@ static int open_cpuinfo(void *cpu_env, int fd) } #endif =20 +#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 f= lags, 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 } }; --=20 2.20.1