mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
Then inside, split packages/lkmc into kernel_modules and userland, to keep userland out of the kernel_modules parent path, which makes no sense. Copy built modules and userland to the output rootfs overlay. Document Linux distro tradeoffs.
27 lines
374 B
C
27 lines
374 B
C
#define _XOPEN_SOURCE 700
|
|
#include <stdio.h>
|
|
#include <sys/reboot.h>
|
|
#include <unistd.h>
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int i;
|
|
|
|
puts("args:");
|
|
for (i = 0; i < argc; ++i)
|
|
puts(argv[i]);
|
|
puts("");
|
|
|
|
puts("env:");
|
|
extern char **environ;
|
|
char **env = environ;
|
|
while (*env) {
|
|
printf("%s\n", *env);
|
|
env++;
|
|
}
|
|
puts("");
|
|
|
|
/* Poweroff. */
|
|
reboot(RB_POWER_OFF);
|
|
}
|