aboutsummaryrefslogtreecommitdiff
path: root/utils/fakeuname/src
diff options
context:
space:
mode:
authorSergey V. Lobanov <sergey@lobanov.in>2022-01-26 15:32:00 +0300
committerRosen Penev <rosenp@gmail.com>2022-01-28 13:47:14 -0800
commit4b6fc857bee8a58e011a4526114e13ae78064fc9 (patch)
treeb9e015e0f5863cb60f9237951e1a3136e10710b0 /utils/fakeuname/src
parentdcedbe802744102b215835f1dd53bc2bb5756807 (diff)
fakeuname: add package
This package provides fakeuname host tool to avoid build platform detection for invalid configure/build scripts that are not friendly to cross-platform build. This fake uname tool returns Linux as OS name and target Linux version as OS version. Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
Diffstat (limited to 'utils/fakeuname/src')
-rw-r--r--utils/fakeuname/src/footer.py.inc20
-rw-r--r--utils/fakeuname/src/header.py.inc13
2 files changed, 33 insertions, 0 deletions
diff --git a/utils/fakeuname/src/footer.py.inc b/utils/fakeuname/src/footer.py.inc
new file mode 100644
index 000000000..f1e916ea2
--- /dev/null
+++ b/utils/fakeuname/src/footer.py.inc
@@ -0,0 +1,20 @@
+
+args_dict = {
+ "-a" : "%s %s %s %s %s %s %s %s" %
+ (kernel_name, nodename, kernel_release, kernel_version,
+ machine, processor, hardware_platform, operating_system),
+ "-m" : machine,
+ "-n" : nodename,
+ "-r" : kernel_release,
+ "-s" : kernel_name,
+ "-p" : processor,
+ "-v" : kernel_version,
+ "-i" : hardware_platform,
+ "-o" : operating_system,
+}
+
+input_args = sys.argv
+if len(input_args) == 1:
+ input_args = ["-s"]
+
+print(" ".join([args_dict[arg] for arg in input_args if arg in args_dict]))
diff --git a/utils/fakeuname/src/header.py.inc b/utils/fakeuname/src/header.py.inc
new file mode 100644
index 000000000..e11eba241
--- /dev/null
+++ b/utils/fakeuname/src/header.py.inc
@@ -0,0 +1,13 @@
+#!/usr/bin/env python3
+# Copyright 2022 Sergey V. Lobanov <sergey@lobanov.in>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import sys
+
+kernel_name="Linux"
+operating_system="GNU/Linux"
+nodename="OpenWrt"
+processor="unknown"
+hardware_platform="unknown"
+