From 77273faf14ef9dee42f26d105ff9d9d2888eb953 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Fri, 27 Nov 2015 17:38:30 +0000 Subject: [PATCH] UBUNTU: SAUCE: (no-up) add compat_uts_machine= kernel command line override We wish to use the arm64 buildds to build armhf binaries in 32bit chroots. To make this work we need uname to return armv7l machine type. To achieve this add a kernel command line override for the 32bit machine type. Add compat_uts_machine= to allow the LINUX32 personality to return that type for uname. Signed-off-by: Andy Whitcroft --- kernel/sys.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kernel/sys.c b/kernel/sys.c index f8e543f1e38a..88b98ae4afa7 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1262,6 +1262,21 @@ SYSCALL_DEFINE0(setsid) DECLARE_RWSEM(uts_sem); +#ifdef COMPAT_UTS_MACHINE +static char compat_uts_machine[__OLD_UTS_LEN+1] = COMPAT_UTS_MACHINE; + +static int __init parse_compat_uts_machine(char *arg) +{ + strncpy(compat_uts_machine, arg, __OLD_UTS_LEN); + compat_uts_machine[__OLD_UTS_LEN] = 0; + return 0; +} +early_param("compat_uts_machine", parse_compat_uts_machine); + +#undef COMPAT_UTS_MACHINE +#define COMPAT_UTS_MACHINE compat_uts_machine +#endif + #ifdef COMPAT_UTS_MACHINE #define override_architecture(name) \ (personality(current->personality) == PER_LINUX32 && \