Kernel module compilation

Discussion in 'Off Topic' started by Berion, Sep 27, 2018.

  1. 2,876
    2,752
    372
    Berion

    Berion Developer

    Joined:
    Feb 3, 2015
    Messages:
    2,876
    Likes Received:
    2,752
    Trophy Points:
    372
    Gender:
    Male
    Location:
    Poland
    Could someone help me compiling kernel module? I have never did this so I blindly step by tutorials and I failed. ;)

    So what I did:
    Code:
    sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)
    mkdir ufs && cd ufs
    sudo apt-get source linux-image-$(uname -r)
    sudo apt-get source linux-headers-$(uname -r)
    sudo apt-get install libncurses5-dev libncursesw5-dev
    Then I changed config in amd64 from: "CONFIG_UFS_FS=m" to
    Code:
    CONFIG_UFS_FS=m
    CONFIG_UFS_FS_WRITE=y
    
    And trying compile it. This is what I got:
    ufs_rw_ko_1.png ufs_rw_ko_2.png

    What am I doing wrong?

    PS: Linux Mint 18.3.
     
  2. 7,903
    6,673
    647
    bguerville

    bguerville Moderator

    Joined:
    Feb 25, 2015
    Messages:
    7,903
    Likes Received:
    6,673
    Trophy Points:
    647
    Location:
    Earth
    Did you remember to "make amd64_CONFIG" before compiling (amd64_CONFIG is obviously to be replaced with the name of your modded config file)? You should normally use "make config" after editing the config file, before you launch "make dep".
     
    Last edited: Sep 28, 2018
    Berion likes this.
  3. 2,876
    2,752
    372
    Berion

    Berion Developer

    Joined:
    Feb 3, 2015
    Messages:
    2,876
    Likes Received:
    2,752
    Trophy Points:
    372
    Gender:
    Male
    Location:
    Poland
    @bguerville No, I didn't do that. I never compiling kernel so everything is new to me.

    So... I goes to unpacked kernel src and type "make config" and I was asking about hundreds of questions which about I have no idea. :) So I'm not sure if this is a good way... I quit it.

    I found "/boot/config-4.10.0-38-generic" so I changed line no. 8300 "# CONFIG_UFS_FS_WRITE is not set" to "CONFIG_UFS_FS_WRITE=y". But still I cannot compile with the same errors. I trying move this into linux-hwe-4.15.0 with changed filename but still I cannot compile that module...

    I even don't understand why when I'm using 4.10.0-38-generic, downloaded "linux-hwe_4.15.0-38.41~16.04.1" using "sudo apt-get source linux-image-$(uname -r)". And "uname -r" tells me it is "4.10.0-38-generic"...

    I feel like a blind child in the woods. Could You help me compile this sh*t? I'm not sure if I could solve this myself.

    PS: Linux Mint 18.3 64bit with Cinnamon.
     

Share This Page