[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/11] linux-user: always assume preserve_argv0 for now [!MERG
From: |
YAMAMOTO Takashi |
Subject: |
[PATCH v2 11/11] linux-user: always assume preserve_argv0 for now [!MERGE] |
Date: |
Mon, 31 May 2021 14:50:18 +0900 |
Just because the kernel I'm using is not new enough.
[!MERGE] because this is specific to my environment and
would break others.
Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
---
linux-user/main.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/linux-user/main.c b/linux-user/main.c
index be604a84f9..a3d8b7788f 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -726,7 +726,38 @@ int main(int argc, char **argv, char **envp)
/*
* get binfmt_misc flags
*/
+#if 0
preserve_argv0 = !!(qemu_getauxval(AT_FLAGS) & AT_FLAGS_PRESERVE_ARGV0);
+#else
+/*
+ * my kernel doesn't have the following commit. this is a crude workaroud.
+
+commit 2347961b11d4079deace3c81dceed460c08a8fc1
+Author: Laurent Vivier <laurent@vivier.eu>
+Date: Tue Jan 28 14:25:39 2020 +0100
+
+ binfmt_misc: pass binfmt_misc flags to the interpreter
+
+ It can be useful to the interpreter to know which flags are in use.
+
+ For instance, knowing if the preserve-argv[0] is in use would
+ allow to skip the pathname argument.
+
+ This patch uses an unused auxiliary vector, AT_FLAGS, to add a
+ flag to inform interpreter if the preserve-argv[0] is enabled.
+
+ Note by Helge Deller:
+ The real-world user of this patch is qemu-user, which needs to know
+ if it has to preserve the argv[0]. See Debian bug #970460.
+
+ Signed-off-by: Laurent Vivier <laurent@vivier.eu>
+ Reviewed-by: YunQiang Su <ysu@wavecomp.com>
+ URL: http://bugs.debian.org/970460
+ Signed-off-by: Helge Deller <deller@gmx.de>
+
+ */
+ preserve_argv0 = true;
+#endif
/*
* Manage binfmt-misc preserve-arg[0] flag
--
2.21.1 (Apple Git-122.3)
- [PATCH v2 01/11] linux-user: handle /proc/self/exe for execve, (continued)
- [PATCH v2 01/11] linux-user: handle /proc/self/exe for execve, YAMAMOTO Takashi, 2021/05/31
- [PATCH v2 02/11] linux-user: Fix the execfd case of /proc/self/exe open, YAMAMOTO Takashi, 2021/05/31
- [PATCH v2 03/11] linux-user: dup the execfd on start up, YAMAMOTO Takashi, 2021/05/31
- [PATCH v2 04/11] linux-user: make exec_path realpath, YAMAMOTO Takashi, 2021/05/31
- [PATCH v2 05/11] linux-user: Implement pivot_root, YAMAMOTO Takashi, 2021/05/31
- [PATCH v2 06/11] linux-user: add get_exe_path, YAMAMOTO Takashi, 2021/05/31
- [PATCH v2 07/11] linux-user: simplify is_proc_myself, YAMAMOTO Takashi, 2021/05/31
- [PATCH v2 08/11] linux-user: Implement exec of /proc/$pid/exe of qemu process, YAMAMOTO Takashi, 2021/05/31
- [PATCH v2 09/11] linux-user: Make the qemu detection for /proc/$pid/exe a bit conservative, YAMAMOTO Takashi, 2021/05/31
- [PATCH v2 10/11] linux-user: a crude hack for libcontainer (CLONE_PARENT) [!MERGE], YAMAMOTO Takashi, 2021/05/31
- [PATCH v2 11/11] linux-user: always assume preserve_argv0 for now [!MERGE],
YAMAMOTO Takashi <=
- Re: [PATCH v2 00/11] linux-user changes to run docker, no-reply, 2021/05/31