Welcome to the Linux Foundation Forum!

Should you build "hello world" kernel module in the kernel source directory?

Instead, can we build it outside the kernel source directory in a separate folder?
Because I want to create a new directory in home (~/hello_mod) and generate a patch there.

Answers

  • That's what I did but how do you generate the patch?

  • I think it might be better to create a module inside the source directory and load it using the make file. Then create a patch from there.

  • @yttrium32 said:
    I think it might be better to create a module inside the source directory and load it using the make file. Then create a patch from there.

    Yes, and remember to check with ./scripts/checkpatch.pl so that you can ensure your patch has no "other" warnings.

  • @abhinavjain said:

    @yttrium32 said:
    I think it might be better to create a module inside the source directory and load it using the make file. Then create a patch from there.

    Yes, and remember to check with ./scripts/checkpatch.pl so that you can ensure your patch has no "other" warnings.

    You can achieve this with a post-commit hook that checks all your commits whenever you git commit

  • @richardorido said:

    @abhinavjain said:

    @yttrium32 said:
    I think it might be better to create a module inside the source directory and load it using the make file. Then create a patch from there.

    Yes, and remember to check with ./scripts/checkpatch.pl so that you can ensure your patch has no "other" warnings.

    You can achieve this with a post-commit hook that checks all your commits whenever you git commit

    Interesting, I shall check that out then, thanks.

Categories

Upcoming Training