Compiling module on OpenWRT: make can't find build directory

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












My setup:



  • OpenWRT 18.06.1

  • Raspberry Pi 2 B

  • Kernel 4.9.120

Attempting to build a very simple hello world kernel module results in the following error:



# make
make -C /lib/modules/4.9.120/build M=/c_programming/hellomodule modules
make[1]: *** /lib/modules/4.9.120/build: No such file or directory. Stop.
make: *** [Makefile:6: all] Error 2


Makefile isn't a problem, since it works on Ubuntu just fine. What I've done so far:



  • I've checked and the directory indeed is missing.

  • Checked with opkg find '*headers*' however there's no packages linux-headers-<release> like on Ubuntu.

How should I proceed to actually build this thing ?









share

























    up vote
    0
    down vote

    favorite












    My setup:



    • OpenWRT 18.06.1

    • Raspberry Pi 2 B

    • Kernel 4.9.120

    Attempting to build a very simple hello world kernel module results in the following error:



    # make
    make -C /lib/modules/4.9.120/build M=/c_programming/hellomodule modules
    make[1]: *** /lib/modules/4.9.120/build: No such file or directory. Stop.
    make: *** [Makefile:6: all] Error 2


    Makefile isn't a problem, since it works on Ubuntu just fine. What I've done so far:



    • I've checked and the directory indeed is missing.

    • Checked with opkg find '*headers*' however there's no packages linux-headers-<release> like on Ubuntu.

    How should I proceed to actually build this thing ?









    share























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      My setup:



      • OpenWRT 18.06.1

      • Raspberry Pi 2 B

      • Kernel 4.9.120

      Attempting to build a very simple hello world kernel module results in the following error:



      # make
      make -C /lib/modules/4.9.120/build M=/c_programming/hellomodule modules
      make[1]: *** /lib/modules/4.9.120/build: No such file or directory. Stop.
      make: *** [Makefile:6: all] Error 2


      Makefile isn't a problem, since it works on Ubuntu just fine. What I've done so far:



      • I've checked and the directory indeed is missing.

      • Checked with opkg find '*headers*' however there's no packages linux-headers-<release> like on Ubuntu.

      How should I proceed to actually build this thing ?









      share













      My setup:



      • OpenWRT 18.06.1

      • Raspberry Pi 2 B

      • Kernel 4.9.120

      Attempting to build a very simple hello world kernel module results in the following error:



      # make
      make -C /lib/modules/4.9.120/build M=/c_programming/hellomodule modules
      make[1]: *** /lib/modules/4.9.120/build: No such file or directory. Stop.
      make: *** [Makefile:6: all] Error 2


      Makefile isn't a problem, since it works on Ubuntu just fine. What I've done so far:



      • I've checked and the directory indeed is missing.

      • Checked with opkg find '*headers*' however there's no packages linux-headers-<release> like on Ubuntu.

      How should I proceed to actually build this thing ?







      kernel-modules c openwrt





      share












      share










      share



      share










      asked 6 mins ago









      Sergiy Kolodyazhnyy

      7,97511849




      7,97511849

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475183%2fcompiling-module-on-openwrt-make-cant-find-build-directory%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475183%2fcompiling-module-on-openwrt-make-cant-find-build-directory%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay