dkorunic / uptime_hack

Linux kernel uptime hack module
38 stars 13 forks source link

Please port the code to raspbian #2

Closed parkour86 closed 3 months ago

parkour86 commented 6 years ago

I'm currently running Ubuntu 18.04 Kernel 4.15. The make command is failing to compile with a bunch of errors. I want to run this on a raspberry pi running raspbian kernel 4.14. Any way you could port the code to work on raspbian?

I tried an updated fork but that one seems to get errors too. https://github.com/mlnkrlc/uptime_hack

$ make
make -C /lib/modules/4.15.0-23-generic/build M=/home/parkour86/Github/uptime_hack  modules
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-23-generic'
Makefile:976: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
  CC [M]  /home/parkour86/Github/uptime_hack/uptime_hack.o
In file included from ./include/linux/module.h:18:0,
                 from /home/parkour86/Github/uptime_hack/uptime_hack.c:40:
/home/parkour86/Github/uptime_hack/uptime_hack.c:100:27: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
 module_param_call(hideme, param_kmod_hide, param_get_bool, &hideme,
                           ^
./include/linux/moduleparam.h:233:24: note: in definition of macro ‘module_param_call’
   { .flags = 0, .set = _set, .get = _get };  \
                        ^~~~
/home/parkour86/Github/uptime_hack/uptime_hack.c:100:27: note: (near initialization for ‘__param_ops_hideme.set’)
 module_param_call(hideme, param_kmod_hide, param_get_bool, &hideme,
                           ^
./include/linux/moduleparam.h:233:24: note: in definition of macro ‘module_param_call’
   { .flags = 0, .set = _set, .get = _get };  \
                        ^~~~
/home/parkour86/Github/uptime_hack/uptime_hack.c: In function ‘uptime_proc_show’:
/home/parkour86/Github/uptime_hack/uptime_hack.c:276:9: error: implicit declaration of function ‘cputime64_to_jiffies64’; did you mean ‘nsecs_to_jiffies64’? [-Werror=implicit-function-declaration]
  nsec = cputime64_to_jiffies64(real_idletime) * TICK_NSEC;
         ^~~~~~~~~~~~~~~~~~~~~~
         nsecs_to_jiffies64
cc1: some warnings being treated as errors
scripts/Makefile.build:339: recipe for target '/home/parkour86/Github/uptime_hack/uptime_hack.o' failed
make[2]: *** [/home/parkour86/Github/uptime_hack/uptime_hack.o] Error 1
Makefile:1552: recipe for target '_module_/home/parkour86/Github/uptime_hack' failed
make[1]: *** [_module_/home/parkour86/Github/uptime_hack] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-23-generic'
Makefile:9: recipe for target 'default' failed
make: *** [default] Error 2
Mic92 commented 5 years ago

This one might work: https://github.com/Mic92/uptime_hack Currently tested on 5.1 kernel. Older versions are available in the history.

dkorunic commented 3 months ago

Nice work @Mic92, thanks for keeping this ancient toy module up to date! 👍

dkorunic commented 3 months ago

Resolved by https://github.com/dkorunic/uptime_hack/commit/1cde69b1f25fe80df4e13bd3863ab6f4ceea04b7 from @Mic92.