代码之家  ›  专栏  ›  技术社区  ›  Felipe

我不能加载Raspberry Pi的内核,然后使用modprobe来使用i2c\u存根

  •  0
  • Felipe  · 技术社区  · 7 年前

    # i2cdetect -y 1
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    70: -- -- -- -- -- -- -- --                         
    # ls /dev/*i2c*
    /dev/i2c-1
    

    然后我试着把这两个 make 命令 uname -r build 子目录。如果我硬编码 到包含 建造 子目录我可以继续,但是命令 sudo modprobe -r i2c_stub 之后我必须执行的命令将不起作用。错误: modprobe: FATAL: Module i2c_stub not found. . 我已经听过这个问题了 https://superuser.com/questions/952688/installing-new-driver-on-linux-missing-the-build-directory 但这并没有解决我的问题。

    # sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
    make: *** /lib/modules/4.4.16-v7+/build: No such file or directory.  Stop.
    # sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install
    make: *** /lib/modules/4.4.16-v7+/build: No such file or directory.  Stop.
    # uname -r
    4.4.16-v7+
    # ls -l /lib/modules/4.4.16-v7+/
    total 1716
    drwxr-xr-x 11 root root   4096 Aug  2  2016 kernel
    -rw-r--r--  1 root root 447387 Aug  2  2016 modules.alias
    -rw-r--r--  1 root root 463774 Aug  2  2016 modules.alias.bin
    -rw-r--r--  1 root root   4574 Aug  2  2016 modules.builtin
    -rw-r--r--  1 root root   6025 Aug  2  2016 modules.builtin.bin
    -rw-r--r--  1 root root 142062 Aug  2  2016 modules.dep
    -rw-r--r--  1 root root 207587 Aug  2  2016 modules.dep.bin
    -rw-r--r--  1 root root    302 Aug  2  2016 modules.devname
    -rw-r--r--  1 root root  58127 Aug  2  2016 modules.order
    -rw-r--r--  1 root root     55 Aug  2  2016 modules.softdep
    -rw-r--r--  1 root root 175706 Aug  2  2016 modules.symbols
    -rw-r--r--  1 root root 218826 Aug  2  2016 modules.symbols.bin
    # ls -l /lib/modules/4.9.35-v7+/
    total 1848
    lrwxrwxrwx  1 root root     33 Jul  3  2017 build -> /usr/src/linux-headers-4.9.35-v7+
    drwxr-xr-x 11 root root   4096 Jun 23 08:54 kernel
    -rw-r--r--  1 root root 478139 Jul  3  2017 modules.alias
    -rw-r--r--  1 root root 492852 Jul  3  2017 modules.alias.bin
    -rw-r--r--  1 root root   4778 Jul  3  2017 modules.builtin
    -rw-r--r--  1 root root   6290 Jul  3  2017 modules.builtin.bin
    -rw-r--r--  1 root root 153132 Jul  3  2017 modules.dep
    -rw-r--r--  1 root root 222028 Jul  3  2017 modules.dep.bin
    -rw-r--r--  1 root root    302 Jul  3  2017 modules.devname
    -rw-r--r--  1 root root  61224 Jul  3  2017 modules.order
    -rw-r--r--  1 root root     55 Jul  3  2017 modules.softdep
    -rw-r--r--  1 root root 198792 Jul  3  2017 modules.symbols
    -rw-r--r--  1 root root 245292 Jul  3  2017 modules.symbols.bin
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   Felipe    7 年前

    我必须恢复到目前的股票树莓内核。

    sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel https://www.raspberrypi.org/documentation/linux/kernel/updating.md