Welcome to the Linux Foundation Forum!

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

Options

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

  • richardorido
    Options

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

  • yttrium32
    Options

    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.

  • abhinavjain
    Options

    @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.

  • richardorido
    Options

    @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

  • abhinavjain
    Options

    @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