GithubHelp home page GithubHelp logo

rpi-source's People

Contributors

aristochen avatar beaulac avatar christopherlr avatar denvera avatar ircama avatar jason3-14butler avatar jgartrel avatar lifanxi avatar lurch avatar notro avatar pelwell avatar peterogb avatar rkosegi avatar xecdesign avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpi-source's Issues

Bookworm Support

rpi-source always succeeds on Bullseye but fails on Bookworm if rpi-update has not previously been run (which creates /boot/firmware/.firmware_revision):

*** SoC: BCM2711
ERROR:
Can't find a source for this kernel

Linux raspberrypi 6.1.0-rpi4-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.54-1+rpt2 (2023-10-05) aarch64 GNU/Linux

Add support for 64-bit kernels

I had trouble compiling a kernel module with errors along these lines:

ERROR: modpost: "__const_udelay" [/home/pi/rtl8812au/88XXau.ko] undefined!
ERROR: modpost: "__arch_copy_from_user" [/home/pi/rtl8812au/88XXau.ko] undefined!
ERROR: modpost: "_raw_spin_unlock" [/home/pi/rtl8812au/88XXau.ko] undefined!
ERROR: modpost: "__rcu_read_lock" [/home/pi/rtl8812au/88XXau.ko] undefined!
ERROR: modpost: "__rcu_read_unlock" [/home/pi/rtl8812au/88XXau.ko] undefined!
ERROR: modpost: "cpu_hwcap_keys" [/home/pi/rtl8812au/88XXau.ko] undefined!
ERROR: modpost: "csum_ipv6_magic" [/home/pi/rtl8812au/88XXau.ko] undefined!
ERROR: modpost: "__warn_printk" [/home/pi/rtl8812au/88XXau.ko] undefined!
ERROR: modpost: "arm64_const_caps_ready" [/home/pi/rtl8812au/88XXau.ko] undefined!
ERROR: modpost: "__udelay" [/home/pi/rtl8812au/88XXau.ko] undefined!
ERROR: modpost: "preempt_schedule_notrace" [/home/pi/rtl8812au/88XXau.ko] undefined!
ERROR: modpost: "__arch_copy_to_user" [/home/pi/rtl8812au/88XXau.ko] undefined!

I found out from aircrack-ng/rtl8812au#933 that rpi-source does not support 64-bit kernels.
I was able to compile the module properly by using the rpi-source from #2.
Since that was not merged, and the issue still persists, and to give more visibility to anyone who might face the same thing, I open this issue here.
It might be worthwhile to indicate in README.md that rpi-source does not support 64-bit kernels.

insmod fails with "Invalid module format"

I've got an rpi4 running Raspbian.

$ uname -a
Linux bbbridge 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

Following the directions in README.md (I am actually trying to recompile the mcp251xfd driver). Everything builds fine and installs fine, but when I try to load the module I get the following message:

$ sudo modprobe mcp251xfd
modprobe: ERROR: could not insert 'mcp251xfd': Exec format error

dmesg shows mcp251xfd: disagrees about version of symbol module_layout

I did uncompress /proc/modules.gz and make prepare before executing KERNEL=kernel8 make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- KERNEL=kernel8 SUBDIRS=drivers/net/can/spi/mcp251xfd modules.

What am I doing wrong? Is the documentation out of date?

Resolution : ImportError: No module named request

When command : sudo chmod +x /usr/local/bin/rpi-source && /usr/local/bin/rpi-source -q --tag-update , the error occur

Traceback (most recent call last): File "/usr/local/bin/rpi-source", line 14, in <module> import urllib.request, urllib.parse, urllib.error ImportError: No module named request

Resolution

  1. move to /usr/local/bin/rpi-source
  2. open file : sudo vim /usr/local/bin/rpi-source
  3. change #!/usr/bin/env python to #!/usr/bin/env python3

Error while running the command "rpi-source" in terminal

In file included from ./arch/arm64/include/asm/lse.h:5,
                 from ./arch/arm64/include/asm/cmpxchg.h:14,
                 from ./arch/arm64/include/asm/atomic.h:16,
                 from ./include/linux/atomic.h:7,
                 from ./include/asm-generic/bitops/atomic.h:5,
                 from ./arch/arm64/include/asm/bitops.h:25,
                 from ./include/linux/bitops.h:68,
                 from ./include/linux/log2.h:12,
                 from kernel/bounds.c:13:
./arch/arm64/include/asm/atomic_ll_sc.h: In function '__ll_sc__cmpxchg_double':
./arch/arm64/include/asm/atomic_ll_sc.h:318:38: error: '__uint128_t' undeclared (first use in this function); did you mean '__int128__'?
  318 |  : "=&r" (tmp), "=&r" (ret), "+Q" (*(__uint128_t *)ptr)  \
      |                                      ^~~~~~~~~~~
./arch/arm64/include/asm/atomic_ll_sc.h:325:1: note: in expansion of macro '__CMPXCHG_DBL'
  325 | __CMPXCHG_DBL(   ,        ,  ,         )
      | ^~~~~~~~~~~~~
./arch/arm64/include/asm/atomic_ll_sc.h:318:38: note: each undeclared identifier is reported only once for each function it appears in
  318 |  : "=&r" (tmp), "=&r" (ret), "+Q" (*(__uint128_t *)ptr)  \
      |                                      ^~~~~~~~~~~
./arch/arm64/include/asm/atomic_ll_sc.h:325:1: note: in expansion of macro '__CMPXCHG_DBL'
  325 | __CMPXCHG_DBL(   ,        ,  ,         )
      | ^~~~~~~~~~~~~
./arch/arm64/include/asm/atomic_ll_sc.h:318:51: error: expected expression before ')' token
  318 |  : "=&r" (tmp), "=&r" (ret), "+Q" (*(__uint128_t *)ptr)  \
      |                                                   ^
./arch/arm64/include/asm/atomic_ll_sc.h:325:1: note: in expansion of macro '__CMPXCHG_DBL'
  325 | __CMPXCHG_DBL(   ,        ,  ,         )
      | ^~~~~~~~~~~~~
./arch/arm64/include/asm/atomic_ll_sc.h: In function '__ll_sc__cmpxchg_double_mb':
./arch/arm64/include/asm/atomic_ll_sc.h:318:38: error: '__uint128_t' undeclared (first use in this function); did you mean '__int128__'?
  318 |  : "=&r" (tmp), "=&r" (ret), "+Q" (*(__uint128_t *)ptr)  \
      |                                      ^~~~~~~~~~~
./arch/arm64/include/asm/atomic_ll_sc.h:326:1: note: in expansion of macro '__CMPXCHG_DBL'
  326 | __CMPXCHG_DBL(_mb, dmb ish, l, "memory")
      | ^~~~~~~~~~~~~
./arch/arm64/include/asm/atomic_ll_sc.h:318:51: error: expected expression before ')' token
  318 |  : "=&r" (tmp), "=&r" (ret), "+Q" (*(__uint128_t *)ptr)  \
      |                                                   ^
./arch/arm64/include/asm/atomic_ll_sc.h:326:1: note: in expansion of macro '__CMPXCHG_DBL'
  326 | __CMPXCHG_DBL(_mb, dmb ish, l, "memory")
      | ^~~~~~~~~~~~~
make[1]: *** [scripts/Makefile.build:118: kernel/bounds.s] Error 1
make: *** [Makefile:1289: prepare0] Error 2
Traceback (most recent call last):
  File "/usr/local/bin/rpi-source", line 421, in <module>
    sh("cd %s && make modules_prepare %s" % (linux_symlink, (" > /dev/null" if args.quiet else "")))
  File "/usr/local/bin/rpi-source", line 93, in sh
    subprocess.check_call(cmd, shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'cd /home/pi/linux && make modules_prepare ' returned non-zero exit status 2

Can't download headers

I'm using RPi 4B with kernal version 6.1.21-v8+.
According to docs, the following command should download the headers.

I need the headers to compile an Exar driver for use with a solar charge controller from Epever:
"sudo apt install linux-headers-rpi-v8"

How ever, the message returned is:
E: Unable to locate package linux-headers-rpi-v8.

After several weeks of inactivity (powered down), the driver no longer is listed in:
"ls /dev/tty*"

Any ideas?

My next move is to re-install the opsys. I've already done udate/upgrade.

I've been using:
"sudo rmmod xr_usb_serial_common.ko" and: "sudo insmod xr_usb_serial_common.ko"

My reference page for the download is:
https://www.raspberrypi.com/documentation/computers/linux_kernel.html

NOTE: At this point, the driver compiles and can be inserted/removed and is listed in 'lsmod' where the user is '0.'
The driver, however, is not listed in 'ls /dev/tty*.'

Do I need to do something else?

Thanks.

Text encoding breaks rpi-source

I'm getting this on a freshly installed script per README:

 *** Linux source commit: df4d584e66a660195422ca2b7ce1d68d1181f2a2
Traceback (most recent call last):
  File "/usr/local/bin/rpi-source", line 366, in <module>
    check_diskspace(args.dest)
  File "/usr/local/bin/rpi-source", line 178, in check_diskspace
    df = sh_out("df %s" % dir)
         ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/bin/rpi-source", line 101, in sh_out
    return out.decode('ascii')
           ^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 20: ordinal not in range(128)

If I experimentally change the line from 'ascii' to 'utf-8' it works, so it's probably a matter of properly setting up the console to the current running locale.

python3 support

First of all thank you for sharing.

Considering the latest raspi images (minimal) only have python 3.9 pre-installed, you think there might be a chance of updating your script to python3 ??

Yes I do think you have better things to do, however on the off chance that you do have 20 Minutes in your life for which you have no other use, do please consider.

Missing headers

Building DKMS modules on this kernel fails, because of missing headers.

Folders /lib/modules/KERNEL_V/build and /lib/modules/KERNEL_V/source are symlinked to non existing location /rpi-kernel/linux (this folder exists only in docker environment).

This causes dkms modules to fail.

Solution could be to include make INSTALL_HDR_PATH=/raspios/mnt/disk/usr/src headers_install in build.sh and then symlink the headers. Or copy whole /rpi-kernel/linux, but this would increase image size significantly.

Help for processor missing

Repo steps

$ rpi-source

ERROR:
Unexpected processor 4 (use --processor argument)

Help: https://github.com/RPi-Distro/rpi-source/blob/master/README.md

When you go to the README, the --processor argument is not explained.
Not sure if the answer is to use 3 (the 4th option starting from zero) or if 4 is a missing option that needs to be added or if it is something else completely.

My system

$ uname -a
Linux frigate 6.6.30-v8+ #1762 SMP PREEMPT Thu May  9 15:17:51 BST 2024 aarch64 GNU/Linux
$ cat /proc/cpuinfo | grep -i model
Model		: Raspberry Pi 5 Model B Rev 1.0

syntax error on line 261 when checking debian_changelog

after updating imported libraries and python version, I ran in some syntax error that I cannot put the time to take a deeper look.
when running rpi-source command, following output is thrown:

*** SoC: BCM2711

 *** Using: /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz
Traceback (most recent call last):
  File "/usr/local/bin/rpi-source", line 354, in <module>
    kernel = debian_method(debianlog)
  File "/usr/local/bin/rpi-source", line 261, in debian_method
    fw_rev = re.search(r'firmware as of ([0-9a-fA-F]+)', debian_changelog)
  File "/usr/lib/python3.9/re.py", line 201, in search
    return _compile(pattern, flags).search(string)
TypeError: cannot use a string pattern on a bytes-like object

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.