]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: SAUCE: (no-up) add compat_uts_machine= kernel command line override
authorAndy Whitcroft <apw@canonical.com>
Fri, 27 Nov 2015 17:38:30 +0000 (17:38 +0000)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
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=<type> to allow the LINUX32 personality to return
that type for uname.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
kernel/sys.c

index 842914ef7de4b58a09c1b545d4cf804cb075983a..411116eaebd7c83a13bf2ec2b70f52ae3424b71a 100644 (file)
@@ -1098,6 +1098,21 @@ out:
 
 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 && \