summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-core/emlog/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-core/emlog/files')
-rw-r--r--meta-oe/recipes-core/emlog/files/0001-Remove-modules_clean-from-clean-target.patch33
-rw-r--r--meta-oe/recipes-core/emlog/files/0001-emlog-Do-not-use-no_llseek-with-kernel-6.12.0.patch32
-rw-r--r--meta-oe/recipes-core/emlog/files/Drop-use-of-error-h.patch115
-rw-r--r--meta-oe/recipes-core/emlog/files/emlog.initd25
4 files changed, 205 insertions, 0 deletions
diff --git a/meta-oe/recipes-core/emlog/files/0001-Remove-modules_clean-from-clean-target.patch b/meta-oe/recipes-core/emlog/files/0001-Remove-modules_clean-from-clean-target.patch
new file mode 100644
index 0000000000..beba528b33
--- /dev/null
+++ b/meta-oe/recipes-core/emlog/files/0001-Remove-modules_clean-from-clean-target.patch
@@ -0,0 +1,33 @@
1From fd0a4ee201b5c7b24da79dcd346ac121978951a0 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 29 Mar 2020 19:58:36 -0700
4Subject: [PATCH] Remove modules_clean from clean target
5
6This is needed when building applications (w/o module)
7Since OE will run 'make clean' before reconfiguring, this
8will try to run module_clean and will wrongly try to look for removing
9modules from /lib/modules
10
11Upstream-Status: Inappropriate [ OE-Specific ]
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 Makefile | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/Makefile b/Makefile
19index c60863f..fc897d5 100644
20--- a/Makefile
21+++ b/Makefile
22@@ -23,7 +23,7 @@ all: modules nbcat mkemlog
23
24 install: modules_install nbcat_install mkemlog_install
25
26-clean: modules_clean nbcat_clean mkemlog_clean
27+clean: nbcat_clean mkemlog_clean
28
29 modules:
30 $(MAKE) -C $(KDIR) M=$(CURDIR) modules
31--
322.26.0
33
diff --git a/meta-oe/recipes-core/emlog/files/0001-emlog-Do-not-use-no_llseek-with-kernel-6.12.0.patch b/meta-oe/recipes-core/emlog/files/0001-emlog-Do-not-use-no_llseek-with-kernel-6.12.0.patch
new file mode 100644
index 0000000000..86f719b0bb
--- /dev/null
+++ b/meta-oe/recipes-core/emlog/files/0001-emlog-Do-not-use-no_llseek-with-kernel-6.12.0.patch
@@ -0,0 +1,32 @@
1From dca01ea62833249d78ac3bdf277b73424bf93e89 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 14 Dec 2024 09:55:10 -0800
4Subject: [PATCH] emlog: Do not use no_llseek with kernel 6.12.0+
5
6no_llseek is finally gone with 6.12-rc1 [1]
7
8[1] https://github.com/torvalds/linux/commit/cb787f4ac0c2e439ea8d7e6387b925f74576bdf8
9
10Upstream-Status: Submitted [https://github.com/nicupavel/emlog/pull/16]
11---
12 emlog.c | 7 ++++++-
13 1 file changed, 6 insertions(+), 1 deletion(-)
14
15diff --git a/emlog.c b/emlog.c
16index 2ead738..b45c72d 100644
17--- a/emlog.c
18+++ b/emlog.c
19@@ -464,7 +464,12 @@ static const struct file_operations emlog_fops = {
20 .open = emlog_open,
21 .release = emlog_release,
22 .poll = emlog_poll,
23- .llseek = no_llseek, /* no_llseek by default introduced at v2.6.37-rc1 */
24+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
25+ /* no_llseek by default introduced at v2.6.37-rc1 and
26+ * removed in 6.12.0
27+ */
28+ .llseek = no_llseek,
29+#endif
30 .owner = THIS_MODULE,
31 };
32
diff --git a/meta-oe/recipes-core/emlog/files/Drop-use-of-error-h.patch b/meta-oe/recipes-core/emlog/files/Drop-use-of-error-h.patch
new file mode 100644
index 0000000000..4c5a191ac4
--- /dev/null
+++ b/meta-oe/recipes-core/emlog/files/Drop-use-of-error-h.patch
@@ -0,0 +1,115 @@
1From 41de28a92297f4cb0c5a8d7356cde9190176947b Mon Sep 17 00:00:00 2001
2From: Fabio Berton <fabio.berton@ossystems.com.br>
3Date: Thu, 14 Mar 2019 19:54:27 -0300
4Subject: [PATCH] Drop use of error.h
5Organization: O.S. Systems Software LTDA.
6
7The error.h does not work with musl and this project being embedded
8friendly it makes sense to avoid glibc-specific code.
9
10Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
11Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
12---
13Upstream-Status: Pending
14
15 mkemlog.c | 29 ++++++++++++++---------------
16 1 file changed, 14 insertions(+), 15 deletions(-)
17
18diff --git a/mkemlog.c b/mkemlog.c
19index e3354ed..7bcdfce 100644
20--- a/mkemlog.c
21+++ b/mkemlog.c
22@@ -21,7 +21,6 @@
23 #include <unistd.h>
24 #include <fcntl.h>
25 #include <stdlib.h>
26-#include <error.h>
27 #include <errno.h>
28
29 #define EMLOG_DEVICE "/dev/emlog"
30@@ -40,16 +39,16 @@ int main(int argc, char** argv) {
31 FILE *max_size_file = NULL;
32 uid_t uid = -1;
33 if (argc < 2 || argc > 5) {
34- error(1 ,0, USAGE);
35+ fprintf(stderr, USAGE);
36 }
37 file = argv[1];
38
39 max_size_file = fopen("/sys/module/emlog/parameters/emlog_max_size", "r");
40 if (max_size_file == NULL)
41- error(1, errno, "Emlog module not loaded\n");
42+ fprintf(stderr, "Emlog module not loaded\n");
43 rc = fscanf(max_size_file, "%d", &emlog_max_size);
44 if (rc != 1)
45- error(1, errno, "Unable to get emlog max size\n");
46+ fprintf(stderr, "Unable to get emlog max size\n");
47 fclose(max_size_file);
48 max_size_file = NULL;
49 if (argc > 2 ) {
50@@ -57,13 +56,13 @@ int main(int argc, char** argv) {
51 number = argv[2];
52 size_of_buffer = strtol(number, &end_of_number, 10);
53 if (errno) {
54- error(1, errno, "Invalid size provided\n" USAGE);
55+ fprintf(stderr, "Invalid size provided\n" USAGE);
56 }
57 if (end_of_number == number) {
58- error(1, 0, "Invalid size provided\n" USAGE);
59+ fprintf(stderr, "Invalid size provided\n" USAGE);
60 }
61 if (size_of_buffer < 1 || size_of_buffer > emlog_max_size) {
62- error(1, 0, "Invalid size provided must be a value between 1 and %d\n" USAGE, emlog_max_size);
63+ fprintf(stderr, "Invalid size provided must be a value between 1 and %d\n" USAGE, emlog_max_size);
64 }
65 }
66 if (argc > 3 ) {
67@@ -71,10 +70,10 @@ int main(int argc, char** argv) {
68 number = argv[3];
69 mode = strtol(number, &end_of_number, 8);
70 if (errno) {
71- error(1, errno, "Invalid mode provided\n" USAGE);
72+ fprintf(stderr, "Invalid mode provided\n" USAGE);
73 }
74 if (end_of_number == number || S_IFMT & mode) {
75- error(1, 0, "Invalid mode provided\n" USAGE);
76+ fprintf(stderr, "Invalid mode provided\n" USAGE);
77 }
78 }
79 if (argc > 4 ) {
80@@ -82,27 +81,27 @@ int main(int argc, char** argv) {
81 number = argv[4];
82 uid = strtol(number, &end_of_number, 10);
83 if (errno) {
84- error(1, errno, "Invalid uid provided\n" USAGE);
85+ fprintf(stderr, "Invalid uid provided\n" USAGE);
86 }
87 if (end_of_number == number) {
88- error(1, 0, "Invalid uid provided\n" USAGE);
89+ fprintf(stderr, "Invalid uid provided\n" USAGE);
90 }
91 }
92 rc = stat(EMLOG_DEVICE, &emlog_stat);
93 if (rc == -1) {
94- error(1, errno, "stat: " EMLOG_DEVICE);
95+ fprintf(stderr, "stat: " EMLOG_DEVICE);
96 }
97 if (!S_ISCHR(emlog_stat.st_mode)) {
98- error(1, 0, EMLOG_DEVICE " is not a valid emlog device\n");
99+ fprintf(stderr, EMLOG_DEVICE " is not a valid emlog device\n");
100 }
101 rc = mknod(file, mode | S_IFCHR, makedev(major(emlog_stat.st_rdev),size_of_buffer));
102 if (rc == -1) {
103- error(1, errno, "mknod: %s", file);
104+ fprintf(stderr, "mknod: %s", file);
105 }
106 if (uid != -1) {
107 rc = chown(file, uid, -1);
108 if (rc == -1) {
109- error(1, errno, "chown: %s", file);
110+ fprintf(stderr, "chown: %s", file);
111 }
112 }
113 printf("Log device %s created with buffer size of %d KiB\n", file, size_of_buffer);
114--
1152.20.1
diff --git a/meta-oe/recipes-core/emlog/files/emlog.initd b/meta-oe/recipes-core/emlog/files/emlog.initd
new file mode 100644
index 0000000000..361cf8029e
--- /dev/null
+++ b/meta-oe/recipes-core/emlog/files/emlog.initd
@@ -0,0 +1,25 @@
1#!/bin/sh
2PATH=/sbin:/usr/sbin:/bin:/usr/bin
3
4[ -r /etc/default/emlog ] && . /etc/default/emlog
5
6do_start() {
7 :
8}
9
10do_stop() {
11 nbcat /dev/emlog > /data/emlog
12}
13
14case "$1" in
15 start)
16 do_start || exit $?
17 ;;
18 stop)
19 do_stop || exit $?
20 ;;
21 *)
22 echo "Usage: $0 {stop}" >&2
23 exit 3
24 ;;
25esac