Skip to content

Commit fffb1b5

Browse files
committed
modules/nixos/common/armv7l: vendor kernel patch
1 parent f5705f6 commit fffb1b5

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

modules/nixos/common/armv7l.nix

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
boot.kernelParams = [ "compat_uts_machine=armv7l" ];
1717

1818
boot.kernelPatches = [
19+
# https://lists.ubuntu.com/archives/kernel-team/2016-January/068203.html
20+
# https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/patch/?id=c1da50fa6eddad313360249cadcd4905ac9f82ea
1921
{
2022
name = "compat_uts_machine";
21-
patch = pkgs.fetchpatch {
22-
name = "compat_uts_machine.patch";
23-
url = "https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/patch/?id=c1da50fa6eddad313360249cadcd4905ac9f82ea";
24-
hash = "sha256-357+EzMLLt7IINdH0ENE+VcDXwXJMo4qiF/Dorp2Eyw=";
25-
};
23+
patch = ./compat_uts_machine.patch;
2624
}
2725
];
2826

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/kernel/sys.c b/kernel/sys.c
2+
index 259fda2..a2a48f0 100644
3+
--- a/kernel/sys.c
4+
+++ b/kernel/sys.c
5+
@@ -1099,6 +1099,21 @@ out:
6+
DECLARE_RWSEM(uts_sem);
7+
8+
#ifdef COMPAT_UTS_MACHINE
9+
+static char compat_uts_machine[__OLD_UTS_LEN+1] = COMPAT_UTS_MACHINE;
10+
+
11+
+static int __init parse_compat_uts_machine(char *arg)
12+
+{
13+
+ strncpy(compat_uts_machine, arg, __OLD_UTS_LEN);
14+
+ compat_uts_machine[__OLD_UTS_LEN] = 0;
15+
+ return 0;
16+
+}
17+
+early_param("compat_uts_machine", parse_compat_uts_machine);
18+
+
19+
+#undef COMPAT_UTS_MACHINE
20+
+#define COMPAT_UTS_MACHINE compat_uts_machine
21+
+#endif
22+
+
23+
+#ifdef COMPAT_UTS_MACHINE
24+
#define override_architecture(name) \
25+
(personality(current->personality) == PER_LINUX32 && \
26+
copy_to_user(name->machine, COMPAT_UTS_MACHINE, \

0 commit comments

Comments
 (0)