diff options
Diffstat (limited to 'meta-moblin/packages/sreadahead/sreadahead-0.02')
3 files changed, 0 insertions, 95 deletions
diff --git a/meta-moblin/packages/sreadahead/sreadahead-0.02/readahead_c.patch b/meta-moblin/packages/sreadahead/sreadahead-0.02/readahead_c.patch deleted file mode 100644 index a65c1088f5..0000000000 --- a/meta-moblin/packages/sreadahead/sreadahead-0.02/readahead_c.patch +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | --- | ||
2 | readahead.c | 7 +++++-- | ||
3 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
4 | |||
5 | Index: sreadahead-0.02/readahead.c | ||
6 | =================================================================== | ||
7 | --- sreadahead-0.02.orig/readahead.c 2008-09-23 22:35:20.000000000 +0200 | ||
8 | +++ sreadahead-0.02/readahead.c 2008-10-27 16:27:52.000000000 +0100 | ||
9 | @@ -69,7 +69,11 @@ void *one_thread(void *ptr) | ||
10 | int main(int argc, char **argv) | ||
11 | { | ||
12 | FILE *file = fopen("/etc/readahead.packed", "r"); | ||
13 | - | ||
14 | + if (!file) { | ||
15 | + perror("Couldnt open /etc/readahead.packed"); | ||
16 | + return -errno; | ||
17 | + } | ||
18 | + | ||
19 | daemon(0,0); | ||
20 | |||
21 | total_files = fread(&files, sizeof(struct readahead), MAXR, file); | ||
22 | @@ -81,7 +85,6 @@ int main(int argc, char **argv) | ||
23 | pthread_create(&three, NULL, one_thread, NULL); | ||
24 | pthread_create(&four, NULL, one_thread, NULL); | ||
25 | |||
26 | - printf("Waiting\n"); | ||
27 | pthread_join(one, NULL); | ||
28 | pthread_join(two, NULL); | ||
29 | pthread_join(three, NULL); | ||
diff --git a/meta-moblin/packages/sreadahead/sreadahead-0.02/set_to_idle.patch b/meta-moblin/packages/sreadahead/sreadahead-0.02/set_to_idle.patch deleted file mode 100644 index b48659048a..0000000000 --- a/meta-moblin/packages/sreadahead/sreadahead-0.02/set_to_idle.patch +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | diff -Naurp sreadahead-0.02/readahead.c sreadahead-0.02-nice/readahead.c | ||
2 | --- sreadahead-0.02/readahead.c 2008-11-06 00:57:17.000000000 -0500 | ||
3 | +++ sreadahead-0.02-nice/readahead.c 2008-11-06 02:28:29.000000000 -0500 | ||
4 | @@ -26,7 +26,18 @@ | ||
5 | #include <errno.h> | ||
6 | |||
7 | #include "readahead.h" | ||
8 | +#include <sys/syscall.h> | ||
9 | |||
10 | +# if defined(__i386__) | ||
11 | +# define __NR_ioprio_set 289 | ||
12 | +# elif defined(__x86_64__) | ||
13 | +# define __NR_ioprio_set 251 | ||
14 | +# else | ||
15 | +# error "Unsupported arch" | ||
16 | +# endif | ||
17 | + | ||
18 | +#define IOPRIO_WHO_PROCESS 1 | ||
19 | +#define IOPRIO_CLASS_SHIFT 13 | ||
20 | #define MAXR 1024 | ||
21 | static struct readahead files[MAXR]; | ||
22 | static unsigned int total_files = 0; | ||
23 | @@ -68,7 +79,15 @@ void *one_thread(void *ptr) | ||
24 | |||
25 | int main(int argc, char **argv) | ||
26 | { | ||
27 | - FILE *file = fopen("/etc/readahead.packed", "r"); | ||
28 | + int iopriority = 7; /* hard code for idle */ | ||
29 | + int iopriority_class = 3; /* 3 stands for idle */ | ||
30 | + int pid = 0; | ||
31 | + FILE *file; | ||
32 | + | ||
33 | + if (syscall(__NR_ioprio_set, IOPRIO_WHO_PROCESS, pid, iopriority | iopriority_class << IOPRIO_CLASS_SHIFT) == -1) | ||
34 | + perror("Can not set priority to idle class"); | ||
35 | + | ||
36 | + file = fopen("/etc/readahead.packed", "r"); | ||
37 | if (!file) { | ||
38 | perror("Couldnt open /etc/readahead.packed"); | ||
39 | return -errno; | ||
diff --git a/meta-moblin/packages/sreadahead/sreadahead-0.02/sreadahead-0.02-make.patch b/meta-moblin/packages/sreadahead/sreadahead-0.02/sreadahead-0.02-make.patch deleted file mode 100644 index d0ece663b5..0000000000 --- a/meta-moblin/packages/sreadahead/sreadahead-0.02/sreadahead-0.02-make.patch +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | diff -Nrup sreadahead-0.02.orig/Makefile sreadahead-0.02/Makefile | ||
2 | --- sreadahead-0.02.orig/Makefile 2008-09-23 22:36:24.000000000 +0200 | ||
3 | +++ sreadahead-0.02/Makefile 2008-09-26 07:43:19.000000000 +0200 | ||
4 | @@ -1,11 +1,18 @@ | ||
5 | -all: generate_filelist sreadahead | ||
6 | +CFLAGS=-Os -g -Wall | ||
7 | +PROGS=generate_filelist sreadahead | ||
8 | + | ||
9 | +all: $(PROGS) | ||
10 | |||
11 | |||
12 | generate_filelist: readahead.h filelist.c Makefile | ||
13 | - gcc -Os -g -Wall -W filelist.c -o generate_filelist | ||
14 | + $(CC) $(CFLAGS) -W filelist.c -o generate_filelist | ||
15 | |||
16 | sreadahead: readahead.h readahead.c Makefile | ||
17 | - gcc -Os -g -Wall -lpthread -W readahead.c -o sreadahead | ||
18 | + $(CC) $(CFLAGS) -lpthread -W readahead.c -o sreadahead | ||
19 | |||
20 | clean: | ||
21 | - rm -f *~ sreadahead generate_filelist | ||
22 | \ No newline at end of file | ||
23 | + rm -f *~ sreadahead generate_filelist | ||
24 | + | ||
25 | +install: all | ||
26 | + mkdir -p $(DESTDIR)/sbin | ||
27 | + install -p -m 755 $(PROGS) $(DESTDIR)/sbin | ||