Giter Site home page Giter Site logo

rpi-source's Introduction

rpi-source's People

Contributors

beaulac avatar denvera avatar lifanxi avatar notro avatar peterogb 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpi-source's Issues

advice for modifying driver

Following the instruction in the wiki I can compile and load the hello world driver.

Now I am trying to compile a driver for a touch panel IC (FT5206). A bit of background on my project can be found here: https://www.raspberrypi.org/forums/viewtopic.php?t=185948.

The source code from the driver is here: https://github.com/focaltech-systems/drivers-input-touchscreen-FTS_driver (which is where the manufacturer of my screen pointed me).

I know I need to modify the driver source code so that it compiles and functions on my system, but this is all new to me. Can anyone offer some advice on learning how to write/modify drivers?

Also, if there's any specific advice for this IC and driver I'd be very happy for feedback.

Thanks in advance!

Wrong kernel version string for 3.18.7-v7+

Hi @notro,

I tried rpi-source on Raspbian for kernel 3.18.7-v7+, but it builds modules for version 3.18.7+-v7 (note the position of the plus sign). When I try to insmod I get "Invalid module format", presumably because of the version mismatch.

Not sure if this is related to issue #9.

new kernel problem

I made all the steps, i got the 4.8 gcc, but this error occurs. any ideas? please help

make -C /lib/modules/4.1.20+/build M=/home/pi/spi-config modules
make[1]: *** /lib/modules/4.1.20+/build: No such file or directory. Stop.
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2

is there a way of updating script for another kernel version?

This script works great.. but it's downloading 4.1.13+, when my system's running 4.1.18-v7+. It winds up making an incompatible module. It would be great to point it to a source hosted in Dropbox.

greenbag@lotusland:~$ sudo rpi-source --skip-gcc --verbose
Check for update to rpi-source
download: https://api.github.com/repos/notro/rpi-source/git/refs/heads/master

 *** Using: /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz
Latest changes: raspberrypi-firmware (1.20151118-1~wily1.0) wily; urgency=medium

 *** Latest firmware revision: 2a329e0c7d8ea19c085bac5633aa4fccee0f21be
Latest change made by  Serge Schneider <[email protected]>  Wed, 18 Nov 2015 15:59:24 +0000
download: https://raw.githubusercontent.com/raspberrypi/firmware/2a329e0c7d8ea19c085bac5633aa4fccee0f21be/extra/git_hash

 *** Linux source commit: bc1669c846b629cface0aaa367afb2b9c6226faf

 *** Download kernel source
wget  -O /home/greenbag/linux-bc1669c846b629cface0aaa367afb2b9c6226faf.tar.gz https://github.com/raspberrypi/linux/archive/bc1669c846b629cface0aaa367afb2b9c6226faf.tar.gz
--2016-03-10 20:36:25--  https://github.com/raspberrypi/linux/archive/bc1669c846b629cface0aaa367afb2b9c6226faf.tar.gz
Resolving github.com (github.com)... 192.30.252.131
Connecting to github.com (github.com)|192.30.252.131|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/raspberrypi/linux/tar.gz/bc1669c846b629cface0aaa367afb2b9c6226faf [following]
--2016-03-10 20:36:26--  https://codeload.github.com/raspberrypi/linux/tar.gz/bc1669c846b629cface0aaa367afb2b9c6226faf
Resolving codeload.github.com (codeload.github.com)... 192.30.252.161
Connecting to codeload.github.com (codeload.github.com)|192.30.252.161|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 128512095 (123M) [application/x-gzip]
Saving to: ‘/home/greenbag/linux-bc1669c846b629cface0aaa367afb2b9c6226faf.tar.gz’

/home/greenbag/linux-bc1669c846b629cface0aaa36 100%[===================================================================================================>] 122.56M  1.64MB/s   in 1m 50s 

2016-03-10 20:38:16 (1.12 MB/s) - ‘/home/greenbag/linux-bc1669c846b629cface0aaa367afb2b9c6226faf.tar.gz’ saved [128512095/128512095]


 *** Unpack kernel source
cd /home/greenbag && tar --checkpoint=100 --checkpoint-action=dot -xzf /home/greenbag/linux-bc1669c846b629cface0aaa367afb2b9c6226faf.tar.gz
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
 *** set 'EXTRAVERSION = +' in Makefile
sed -i 's/EXTRAVERSION =.*/EXTRAVERSION = +/' /home/greenbag/linux-bc1669c846b629cface0aaa367afb2b9c6226faf/Makefile

 *** Create symlink: /home/greenbag/linux
rm -f /home/greenbag/linux
ln -s /home/greenbag/linux-bc1669c846b629cface0aaa367afb2b9c6226faf /home/greenbag/linux

 *** Create /lib/modules/<ver>/{build,source} symlinks
sudo rm -f /lib/modules/$(uname -r)/build /lib/modules/$(uname -r)/source
sudo ln -sf /home/greenbag/linux /lib/modules/$(uname -r)/build
sudo ln -sf /home/greenbag/linux /lib/modules/$(uname -r)/source

 *** .config
writef(/home/greenbag/linux-bc1669c846b629cface0aaa367afb2b9c6226faf/.config)

 *** Module.symvers
download_to: https://raw.githubusercontent.com/raspberrypi/firmware/2a329e0c7d8ea19c085bac5633aa4fccee0f21be/extra/Module7.symvers -> /home/greenbag/linux-bc1669c846b629cface0aaa367afb2b9c6226faf/Module.symvers
cd /home/greenbag/linux-bc1669c846b629cface0aaa367afb2b9c6226faf && cp -a Module.symvers Module.symvers.backup

 *** make modules_prepare
cd /home/greenbag/linux && make modules_prepare 
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
#
# configuration written to .config
#
  CHK     include/config/kernel.release
  UPD     include/config/kernel.release
  WRAP    arch/arm/include/generated/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/asm/cputime.h
  WRAP    arch/arm/include/generated/asm/current.h
  WRAP    arch/arm/include/generated/asm/emergency-restart.h
  WRAP    arch/arm/include/generated/asm/errno.h
  WRAP    arch/arm/include/generated/asm/exec.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  WRAP    arch/arm/include/generated/asm/ipcbuf.h
  WRAP    arch/arm/include/generated/asm/irq_regs.h
  WRAP    arch/arm/include/generated/asm/kdebug.h
  WRAP    arch/arm/include/generated/asm/local.h
  WRAP    arch/arm/include/generated/asm/local64.h
  WRAP    arch/arm/include/generated/asm/mcs_spinlock.h
  WRAP    arch/arm/include/generated/asm/msgbuf.h
  WRAP    arch/arm/include/generated/asm/param.h
  WRAP    arch/arm/include/generated/asm/parport.h
  WRAP    arch/arm/include/generated/asm/poll.h
  WRAP    arch/arm/include/generated/asm/preempt.h
  WRAP    arch/arm/include/generated/asm/resource.h
  WRAP    arch/arm/include/generated/asm/rwsem.h
  WRAP    arch/arm/include/generated/asm/scatterlist.h
  WRAP    arch/arm/include/generated/asm/seccomp.h
  WRAP    arch/arm/include/generated/asm/sections.h
  WRAP    arch/arm/include/generated/asm/segment.h
  WRAP    arch/arm/include/generated/asm/sembuf.h
  WRAP    arch/arm/include/generated/asm/serial.h
  WRAP    arch/arm/include/generated/asm/shmbuf.h
  WRAP    arch/arm/include/generated/asm/siginfo.h
  WRAP    arch/arm/include/generated/asm/simd.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  WRAP    arch/arm/include/generated/asm/socket.h
  WRAP    arch/arm/include/generated/asm/sockios.h
  WRAP    arch/arm/include/generated/asm/termbits.h
  WRAP    arch/arm/include/generated/asm/termios.h
  WRAP    arch/arm/include/generated/asm/timex.h
  WRAP    arch/arm/include/generated/asm/trace_clock.h
  WRAP    arch/arm/include/generated/asm/unaligned.h
  CHK     include/generated/uapi/linux/version.h
  UPD     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  HOSTCC  scripts/basic/bin2c
  Generating include/generated/mach-types.h
  CC      kernel/bounds.s
  CHK     include/generated/bounds.h
  UPD     include/generated/bounds.h
  CC      arch/arm/kernel/asm-offsets.s
  CHK     include/generated/asm-offsets.h
  UPD     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  SHIPPED scripts/dtc/dtc-lexer.lex.c
  SHIPPED scripts/dtc/dtc-parser.tab.h
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  SHIPPED scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/genksyms/genksyms.o
  SHIPPED scripts/genksyms/parse.tab.c
  HOSTCC  scripts/genksyms/parse.tab.o
  SHIPPED scripts/genksyms/lex.lex.c
  SHIPPED scripts/genksyms/keywords.hash.c
  SHIPPED scripts/genksyms/parse.tab.h
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  GEN     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/pnmtologo
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/recordmcount
  HOSTCC  scripts/sortextable

 *** Help: https://github.com/notro/rpi-source/wiki
greenbag@lotusland:~$ 


  CC [M]  /home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/../../common/rtusb_dev_id.o
  CC [M]  /home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/../../common/frq_cal.o
  LD [M]  /home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/mt7650u_sta.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/mt7650u_sta.mod.o
  LD [M]  /home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/mt7650u_sta.ko
make[1]: Leaving directory '/home/greenbag/linux-bc1669c846b629cface0aaa367afb2b9c6226faf'
cp -f /home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/mt7650u_sta.ko /tftpboot 2>/dev/null || :
greenbag@lotusland:~/mt7610u_wifi_sta_v3002_dpo_20130916$ sudo make install
make -C /home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux -f Makefile.6 install
make[1]: Entering directory '/home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux'
mkdir: cannot create directory ‘/etc/Wireless’: File exists
rm -rf /etc/Wireless/RT2860STA
mkdir /etc/Wireless/RT2860STA
cp /home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/conf/RT2860STA.dat /etc/Wireless/RT2860STA/.
install -d /lib/modules/4.1.18-v7+/kernel/drivers/net/wireless/
install -m 644 -c mt7650u_sta.ko /lib/modules/4.1.18-v7+/kernel/drivers/net/wireless/
/sbin/depmod -a 4.1.18-v7+
make[1]: Leaving directory '/home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux'
greenbag@lotusland:~$

greenbag@lotusland:~/mt7610u_wifi_sta_v3002_dpo_20130916$ sudo make install
make -C /home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux -f Makefile.6 install
make[1]: Entering directory '/home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux'
mkdir: cannot create directory ‘/etc/Wireless’: File exists
rm -rf /etc/Wireless/RT2860STA
mkdir /etc/Wireless/RT2860STA
cp /home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/conf/RT2860STA.dat /etc/Wireless/RT2860STA/.
install -d /lib/modules/4.1.18-v7+/kernel/drivers/net/wireless/
install -m 644 -c mt7650u_sta.ko /lib/modules/4.1.18-v7+/kernel/drivers/net/wireless/
/sbin/depmod -a 4.1.18-v7+
make[1]: Leaving directory '/home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux'
greenbag@lotusland:~$

greenbag@lotusland:~/mt7610u_wifi_sta_v3002_dpo_20130916$ sudo modprobe mt7650u_sta.ko
modprobe: FATAL: Module mt7650u_sta.ko not found.
greenbag@lotusland:~/mt7610u_wifi_sta_v3002_dpo_20130916$ sudo insmod /home/greenbag/mt7610u_*/os/linux/mt7650u_sta.ko
insmod: ERROR: could not insert module /home/greenbag/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/mt7650u_sta.ko: Invalid module format
greenbag@lotusland:~$

greenbag@lotusland:~$ uname -r
4.1.18-v7+
greenbag@lotusland:~$

linux-bc1669c846b629cface0aaa367afb2b9c6226faf = 4.1.13+

OSMC: ERROR: Can't find source for this kernel

`osmc@osmc:~$ rpi-source

*** gcc version check: OK
ERROR:
Can't find a source for this kernel

Help: https://github.com/notro/rpi-source/wiki
osmc@osmc:~$
`

I just installed the gcc and did the sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update install thing.

It doesn't matter if I skip gcc nor I run --verbose it's always the same error. I'm using OSMC in my raspberry pi. How can I fix this?

Wrong version headers for 3.18.8-v7+

Hey @notro,

I've been trying to use your script to install the headers for my Raspberry Pi 2 which is using Linux Kernel 3.18.8-v7+ and it seems that the script is downloading linux-headers for 3.18.10+.

When I run your script, it completes successfully. If cd into /linux-7afb1c5b7cf33a3182c97ac9be7379394b9b462a and run make kernelversion I get 3.18.10+.

The driver's I am trying to build fail because of the version mismatch.I think it is using the wrong commit hash for the raspberrypi/linux github repo; giving me the wrong version of linux headers.

Thanks

Kernel unpack errors

Hello! Help me please

*** Unpack kernel source
.............................................tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/powerpc/boot/dts/include: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/powerpc/boot/dts: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/powerpc/boot: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/powerpc: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/mips/boot/dts/include: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/mips/boot/dts: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/mips/boot: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/mips: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/metag/boot/dts/include: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/metag/boot/dts: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/metag/boot: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/metag: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/cris/boot/dts/include: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/cris/boot/dts: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/cris/boot: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/cris: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/arm64/boot/dts/socionext: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/arm64/boot/dts/include: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/arm64/boot/dts/broadcom: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/arm64/boot/dts/arm: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/arm64/boot/dts: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/arm64/boot: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/arm64: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/arm/boot/dts/include: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/arm/boot/dts: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/arm/boot: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch/arm: Directory renamed before its status could be extracted
tar: linux-a2f34d45809d8685bca1e91989e35746499ac400/arch: Directory renamed before its status could be extracted
tar: Exiting with failure status due to previous errors
Traceback (most recent call last):
  File "/usr/bin/rpi-source", line 345, in <module>
    sh("cd %s && tar --checkpoint=100 --checkpoint-action=dot -xzf %s" % (args.dest, linux_tar))
  File "/usr/bin/rpi-source", line 85, in sh
    subprocess.check_call(cmd, shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'cd /root && tar --checkpoint=100 --checkpoint-action=dot -xzf /root/linux-a2f34d45809d8685bca1e91989e35746499ac400.tar.gz' returned non-zero exit status 2

How fix it?

Modules end up in wrong place

I've added my module code into sound/soc/bcm and sound/soc/codecs and added entries to Kconfig files and Makefiles. I run

make prepare
make SUBDIRS=sound/soc/bcm modules
sudo make SUBDIRS=sound/soc/bcm modules_install
make SUBDIRS=sound/soc/codecs modules
sudo make SUBDIRS=sound/soc/codecs modules_install

but the sound modules end up in
/lib/modules/4.1.7+-v7/extra

when I think they should be in
/lib/modules/4.1.7-v7+/kernel/sound/soc/bcm
/lib/modules/4.1.7-v7+/kernel/sound/soc/codecs

Note also the wrong version number "+-v7" vs "-v7+" as well as them all going into "extra" directory.
I'll be investigating this tomorrow evening.
PeterO

Cannot check disk space when device has too little used space

When destination is an empty FAT32 USB key, df outputs the following:

Filesystem     1K-blocks  Used Available Use% Mounted on
/dev/sda1       15229808  1232  15228576   1% /home/pi/mnt

The regex in check_diskspace does not match the used column, because it can only match a minimum of 5 characters.

It works fine if a bit more space is used, though, e.g.

Filesystem     1K-blocks  Used Available Use% Mounted on
/dev/sda1       15229808  12320  15228576   1% /home/pi/mnt

It would be nice to avoid this strange behavior by modifying the regex.

rpi_power_switch

I have followed the instructions to install rpi_power_switch but when I try to make it, I get the following error

pi@raspberrypi ~/fbtft_tools/rpi_power_switch $ make
make -C /lib/modules/3.12.25+/build M=/home/pi/fbtft_tools/rpi_power_switch modules
make: *** /lib/modules/3.12.25+/build: No such file or directory. Stop.
make: *** [all] Error 2

Regards, Steve.

HTTPError : 404

Hello,
With new kernel (4.1.x) I can't manage to download the latest kernel sources.

When I run REPO_URI=https://github.com/notro/rpi-firmware rpi-source --nomake --skip-gcc, I get:

*** rpi-update: https://github.com/notro/rpi-firmware

 *** Firmware revision: b2f5782d2a61cdfa1967942d34eae48900266ae1

 *** Linux source commit: 5d5a5ceb829329f490dd1c5cb634da66ef5d0f92

 *** Kernel source already installed: /home/pi/linux-5d5a5ceb829329f490dd1c5cb634da66ef5d0f92

I dont' understand where the "Linux source commit" version comes from, but this was the previous one I got installed.

When I basically run rpi-source, here is the output:

 *** gcc version check: OK

 *** rpi-update: https://github.com/Hexxeh/rpi-firmware

 *** Firmware revision: b2f5782d2a61cdfa1967942d34eae48900266ae1
ERROR:
Couldn't download https://raw.githubusercontent.com/Hexxeh/rpi-firmware/b2f5782d2a61cdfa1967942d34eae48900266ae1/git_hash, HTTPError: 404

Help: https://github.com/notro/rpi-source/wiki

Following the link effectively leads to a "Not found" page.

Am I missing something? (note that I have run sudo modprobe configs)

Thank you.

[Info] Delete data in homedir

When using this tool it seems that data is stored in the homedir.
Is there any way to delete it or to move it somewhere else ?

Thanks in advance.

gzip: stdin: invalid compressed data--format violated

I'm trying this on a fresh version of Raspbian from the official download site:

RASPBIAN STRETCH LITE
Minimal image based on Debian Stretch
Version:November 2017
Release date:2017-11-29
Kernel version:4.9

System info:

$ cat /proc/version
Linux version 4.9.73+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #1072 Sun Dec 31 19:28:20 GMT 2017

When trying to run rpi-source:

$ rpi-source --skip-gcc

 *** rpi-update: https://github.com/Hexxeh/rpi-firmware

 *** Firmware revision: 9fdd5ca79b8fea585ad92b36190158cca2b07eb6

 *** Linux source commit: fbcbd7e7494c6b04cf9e2b2c955ce7d3a9335bb1

 *** Download kernel source: Already downloaded /home/pi/linux-fbcbd7e7494c6b04cf9e2b2c955ce7d3a9335bb1.tar.gz

 *** Unpack kernel source
...................................................................................................................................................tar: Skipping to next header
.
gzip: stdin: invalid compressed data--format violated
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Traceback (most recent call last):
  File "/usr/bin/rpi-source", line 345, in <module>
    sh("cd %s && tar --checkpoint=100 --checkpoint-action=dot -xzf %s" % (args.dest, linux_tar))
  File "/usr/bin/rpi-source", line 85, in sh
    subprocess.check_call(cmd, shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'cd /home/pi && tar --checkpoint=100 --checkpoint-action=dot -xzf /home/pi/linux-fbcbd7e7494c6b04cf9e2b2c955ce7d3a9335bb1.tar.gz' returned non-zero exit status 2

rpi-source seems to pull the wrong kernel version on Raspbian 2018-03-13?

Don't really have an explanation for this. I'm trying to pull the kernel sources using rpi-source on Raspbian 2018-03-13 which uses Kernel 4.9.80. However, rpi-source somehow pulls Kernel version 4.14.24. I have used rpi-source with other Raspbian versions in the past, it always pulled the correct corresponding kernel version so far.

Here is what's happening (fresh Raspbian 2018-03-13 image with no changes):

Running kernel is 4.9.80

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.9.80-v7+ #1098 SMP Fri Mar 9 19:11:42 GMT 2018 armv7l GNU/Linux

rpi-source pulling commit 80a14a56dacb7cc2b40d5f37d00bedb0ceace130

pi@raspberrypi:~ $ rpi-source --skip-gcc

 *** Using: /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz

 *** Latest firmware revision: 3347884c7df574bbabeff6dca63caf686e629699

 *** Linux source commit: 80a14a56dacb7cc2b40d5f37d00bedb0ceace130

 *** Download kernel source
--2018-11-21 09:29:17--  https://github.com/raspberrypi/linux/archive/80a14a56dacb7cc2b40d5f37d00bedb0ceace130.tar.gz
Resolving github.com (github.com)... 192.30.253.112, 192.30.253.113
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/raspberrypi/linux/tar.gz/80a14a56dacb7cc2b40d5f37d00bedb0ceace130 [following]
--2018-11-21 09:29:18--  https://codeload.github.com/raspberrypi/linux/tar.gz/80a14a56dacb7cc2b40d5f37d00bedb0ceace130
Resolving codeload.github.com (codeload.github.com)... 192.30.253.121, 192.30.253.120
Connecting to codeload.github.com (codeload.github.com)|192.30.253.121|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘/home/pi/linux-80a14a56dacb7cc2b40d5f37d00bedb0ceace130.tar.gz’

Kernel sources downloaded and extracted:

pi@raspberrypi:~ $ ls -l
total 155928
drwxr-xr-x 24 pi pi      4096 Nov 21 09:33 linux-80a14a56dacb7cc2b40d5f37d00bedb0ceace130
-rw-r--r--  1 pi pi 159658880 Nov 20 21:24 linux-80a14a56dacb7cc2b40d5f37d00bedb0ceace130.tar.gz

Looking at the version shows 4.14.24:

pi@raspberrypi:~ $ cd linux-80a14a56dacb7cc2b40d5f37d00bedb0ceace130/
pi@raspberrypi:~/linux-80a14a56dacb7cc2b40d5f37d00bedb0ceace130 $ make kernelversion
4.14.24

But we're running Raspbian 2018-03-13 with kernel 4.9.80:

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.9.80-v7+ #1098 SMP Fri Mar 9 19:11:42 GMT 2018 armv7l GNU/Linux

rpi-source downloads wrong Module.symvers

I am on a Raspberry 4, therfore Module7l.symvers is the correct version. rpi-source downloads the wrong version Module7.symvers:

 *** Module.symvers
download_to: https://raw.githubusercontent.com/Hexxeh/rpi-firmware/f8c5a8734cde51ab94e07c204c97563a65a68636/Module7.symvers -> /usr/src/linux-216324a8655b7256961a378893f290d7fa1eecc4/Module.symvers

No source (Headers) for 4.0.9-v7+

Hi,
I am just trying to use rpi-source for a 4.0.9-v7+ build. Iam getting the follwing after a "sudo rpi-source --skip-gcc":

*** rpi-update: https://github.com/Hexxeh/rpi-firmware
 *** Firmware revision: ab7a48a014a52af09df2f7a298bf36d545d3c1fe
Traceback (most recent call last):
  File "/usr/bin/rpi-source", line 305, in <module>
    kernel = rpi_update_method(args.uri)
  File "/usr/bin/rpi-source", line 220, in rpi_update_method
    with gzip.open('/proc/config.gz', 'rb') as f:
  File "/usr/lib/python2.7/gzip.py", line 34, in open
    return GzipFile(filename, mode, compresslevel)
  File "/usr/lib/python2.7/gzip.py", line 89, in __init__
    fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
IOError: [Errno 2] No such file or directory: '/proc/config.gz'

Cannot get it running on my Raspberry Pi2 with Jessie (2016-03-18-raspbian-jessie.img)

I followed the installation instructions and it seems to install but when I try to run sudo rpi-source I get the message that there is a mismatch between gcc (4.9.2) and /proc/version (4.7.1)

pi@raspberrypi:~ $ sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update
    --2016-04-11 20:43:28--  https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source
    Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 23.235.43.133
    Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|23.235.43.133|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 12471 (12K) [text/plain]
    Saving to: ‘/usr/bin/rpi-source’

    /usr/bin/rpi-source                                         100%[==========================================================================================================================================>]  12.18K  --.-KB/s   in 0s

    2016-04-11 20:43:29 (27.7 MB/s) - ‘/usr/bin/rpi-source’ saved [12471/12471]

    pi@raspberrypi:~ $ sudo rpi-source
    ERROR:
    gcc version check: mismatch between gcc (4.9.2) and /proc/version (4.7.1)
    Skip this check with --skip-gcc

    Help: https://github.com/notro/rpi-source/wiki
    pi@raspberrypi:~ $

I can see that this a rather common message as it is featured on the page.
When I run the syntax that is in the gcc version check paragraph I get:

    pi@raspberrypi:~ $ cat /proc/version
    Linux version 3.18.16-v7 (ubuntu@ubuntu) (gcc version 4.7.1 20120402 (prerelease) (crosstool-NG 1.15.2) ) #4 SMP PREEMPT Thu Sep 10 22:40:21 CST 2015
    pi@raspberrypi:~ $ gcc --version | grep gcc
    gcc (Raspbian 4.9.2-10) 4.9.2
    pi@raspberrypi:~ $

But I cannot figure out how to continue :(
Hopefully someone can steer me into the right direction :)

can't get all the headers

Hi, thanks for rpi-source. I am trying to compile module for my TP-link TL-WN715N.
I tried this:

pi@raspberrypi ~ $ rpi-source 

 *** gcc version check: OK

 *** rpi-update: https://github.com/Hexxeh/rpi-firmware

 *** Firmware revision: ea072e1d615bbfeae5ad04f1c9367295dca84f06

 *** Linux source commit: 4507c9752292506fa6ef136114ad14ffd92b2ca5

 *** Download kernel source
--2015-09-05 13:55:42--  https://github.com/raspberrypi/linux/archive/4507c9752292506fa6ef136114ad14ffd92b2ca5.tar.gz
Resolving github.com (github.com)... 192.30.252.128
Connecting to github.com (github.com)|192.30.252.128|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/raspberrypi/linux/tar.gz/4507c9752292506fa6ef136114ad14ffd92b2ca5 [following]
--2015-09-05 13:55:49--  https://codeload.github.com/raspberrypi/linux/tar.gz/4507c9752292506fa6ef136114ad14ffd92b2ca5
Resolving codeload.github.com (codeload.github.com)... 192.30.252.144
Connecting to codeload.github.com (codeload.github.com)|192.30.252.144|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: `/home/pi/linux-4507c9752292506fa6ef136114ad14ffd92b2ca5.tar.gz'

    [                                                                                                                                                       <=>                ] 128,458,048 1.31M/s   in 4m 29s  

2015-09-05 14:00:25 (466 KB/s) - `/home/pi/linux-4507c9752292506fa6ef136114ad14ffd92b2ca5.tar.gz' saved [128458048]


 *** Unpack kernel source
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
 *** set 'EXTRAVERSION = +' in Makefile

 *** Create symlink: /home/pi/linux

 *** Create /lib/modules/<ver>/{build,source} symlinks

 *** .config

 *** Module.symvers
Traceback (most recent call last):
  File "/usr/bin/rpi-source", line 366, in <module>
    download_to(kernel.symvers, os.path.join(linux_dir, "Module.symvers"))
  File "/usr/bin/rpi-source", line 114, in download_to
    urllib.urlretrieve (url, file)
  File "/usr/lib/python2.7/urllib.py", line 93, in urlretrieve
    return _urlopener.retrieve(url, filename, reporthook, data)
  File "/usr/lib/python2.7/urllib.py", line 239, in retrieve
    fp = self.open(url, data)
  File "/usr/lib/python2.7/urllib.py", line 207, in open
    return getattr(self, name)(url)
  File "/usr/lib/python2.7/urllib.py", line 436, in open_https
    h.endheaders(data)
  File "/usr/lib/python2.7/httplib.py", line 958, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 818, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 780, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 1161, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 553, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
IOError: [Errno socket error] [Errno -2] Name or service not known

If I run rpi-source again, it says everything OK.
Then trying to compile your hello world example:

pi@raspberrypi ~/hello $ make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
make: Entering directory '/home/pi/linux-4507c9752292506fa6ef136114ad14ffd92b2ca5'

  ERROR: Kernel configuration is invalid.
         include/generated/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.


  WARNING: Symbol version dump ./Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /home/pi/hello/hello.o
In file included from <command-line>:0:0:
././include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory
 #include <generated/autoconf.h>
                                ^
compilation terminated.
scripts/Makefile.build:264: recipe for target '/home/pi/hello/hello.o' failed
make[1]: *** [/home/pi/hello/hello.o] Error 1
Makefile:1384: recipe for target '_module_/home/pi/hello' failed
make: *** [_module_/home/pi/hello] Error 2
make: Leaving directory '/home/pi/linux-4507c9752292506fa6ef136114ad14ffd92b2ca5'

Any suggestion what to do?
Thank you.

Privilage Level

Hello
I would like to ask if the lodable kernel modules that can be added it on the described way run with privilage levels. I asked because when i try on my module to write on an specific coprocessor ARMv7 register that need privilages make the system stack.

RPi4 gcc: error: unrecognized command line option ‘-mgeneral-regs-only’

When running rpi-source on Raspbian on a Raspberry Pi 4 I get:

gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
make[1]: *** [scripts/Makefile.build:266: scripts/mod/empty.o] Error 1
make: *** [Makefile:1110: prepare0] Error 2
Traceback (most recent call last):
  File "/usr/local/bin/rpi-source", line 412, in <module>
    sh("cd %s && make modules_prepare %s" % (linux_symlink, (" > /dev/null" if args.quiet else "")))
  File "/usr/local/bin/rpi-source", line 91, 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 /root/linux && make modules_prepare ' returned non-zero exit status 2

My kernel is 5.4.40-v8+ #1316 SMP PREEMPT Tue May 12 13:17:34 BST 2020 aarch64 GNU/Linux

RA8875 error

Hi!
I followed all the instructions, but when i am going to modprobe fbtft_device er_tftms05_2 or try to make a device with the fb_ra8875 driver, i get the following error message (from dmesg, after doing sudo modprobe fbtft_device custom name=fb_ra8875 buswidth=8 gpios=reset:25,dc:24 speed=1000000 ) :
[ 340.395373] fbtft_device: SPI devices registered:
[ 340.395421] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
[ 340.395437] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
[ 340.395447] fbtft_device: 'fb' Platform devices registered:
[ 340.395467] fbtft_device: bcm2708_fb id=-1 pdata? no
[ 340.395530] fbtft_device: Deleting spi0.0
[ 340.398395] fbtft_device: GPIOS used by 'fb_ra8875':
[ 340.398426] fbtft_device: 'reset' = GPIO25
[ 340.398436] fbtft_device: 'dc' = GPIO24
[ 340.398445] fbtft_device: SPI devices registered:
[ 340.398462] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
[ 340.398475] fbtft_device: fb_ra8875 spi0.0 1000kHz 8 bits mode=0x00
[ 340.434228] vmalloc: allocation failure: 0 bytes
[ 340.434262] modprobe: page allocation failure: order:0, mode:0x80d2
[ 340.434282] CPU: 0 PID: 2111 Comm: modprobe Tainted: G O 3.12.25+ # 1
[ 340.434356] from [](show stack+0x10/0x14)
[ 340.435807] from [](warn_alloc failed+0xe0/0x124)
[ 340.435871] from [](
vmalloc_node_range+0x154/0x1fc)
[ 340.435904] from
[ 340.435983] from [](fbtft_framebu ffer_alloc+0x12c/0x5a8 [fbtft])
[ 340.436057] [](fbtft_framebuffer_alloc+0x12c/0x5a8 [fbtft]) from [ ](fbtft_probe_common+0x3c/0x2d4 [fbtft])
[ 340.436113] [](fbtft_probe_common+0x3c/0x2d4 [fbtft]) from <c02af 440>
[ 340.436144] from
[ 340.436172] from [](bus_f or_each_dev+0x60/0x94)
[ 340.436198] from [](bus_ add_driver+0x1d4/0x2a4)
[ 340.436225] from [](driv er_register+0x78/0xf8)
[ 340.436269] from [](fbtft _driver_module_init+0xc/0x30 [fb_ra8875])
[ 340.436310] [](fbtft_driver_module_init+0xc/0x30 [fb_ra8875]) from
[ 340.436349] from [](load module+0x1d0c/0x2110)
[ 340.436379] from [](SyS_i nit_module+0xa4/0x114)
[ 340.436409] from [](ret
fast_syscall+0x0/0x30)
[ 340.436419] Mem-info:
[ 340.436429] Normal per-cpu:
[ 340.436441] CPU 0: hi: 186, btch: 31 usd: 138
[ 340.436469] active_anon:2066 inactive_anon:51 isolated_anon:0
[ 340.436469] active_file:2693 inactive_file:4957 isolated_file:0
[ 340.436469] unevictable:0 dirty:4 writeback:0 unstable:0
[ 340.436469] free:99170 slab_reclaimable:337 slab_unreclaimable:729
[ 340.436469] mapped:1215 shmem:59 pagetables:131 bounce:0
[ 340.436469] free_cma:998
[ 340.436533] Normal free:396680kB min:8192kB low:10240kB high:12288kB active_a non:8264kB inactive_anon:204kB active_file:10772kB inactive_file:19828kB unevict able:0kB isolated(anon):0kB isolated(file):0kB present:458752kB managed:447632kB mlocked:0kB dirty:16kB writeback:0kB mapped:4860kB shmem:236kB slab_reclaimable :1348kB slab_unreclaimable:2916kB kernel_stack:496kB pagetables:524kB unstable:0 kB bounce:0kB free_cma:3992kB writeback_tmp:0kB pages_scanned:0 all_unreclaimabl e? no
[ 340.436548] lowmem_reserve[]: 0 0
[ 340.436564] Normal: 2_4kB (EM) 4_8kB (UEC) 4_16kB (UEC) 9_32kB (UEM) 4_64kB ( UE) 2_128kB (UC) 2_256kB (MC) 2_512kB (EC) 3_1024kB (UMC) 3_2048kB (EMC) 94*4096 kB (MR) = 396680kB
[ 340.436634] 7711 total pagecache pages
[ 340.436647] 0 pages in swap cache
[ 340.436657] Swap cache stats: add 0, delete 0, find 0/0
[ 340.436665] Free swap = 102396kB
[ 340.436673] Total swap = 102396kB
[ 340.464252] 114688 pages of RAM
[ 340.464282] 99441 free pages
[ 340.464292] 2780 reserved pages
[ 340.464300] 754 slab pages
[ 340.464307] 7101 pages shared
[ 340.464315] 0 pages swap cached
[ 340.465751] fb_ra8875: probe of spi0.0 failed with error -12

I have no idea whats going on, need some help here.
Thanks!

IndexError: list index out of range

pi@raspbian:~$ rpi-source

*** SoC: BCM2711
Traceback (most recent call last):
File "/usr/local/bin/rpi-source", line 341, in
check_gcc()
File "/usr/local/bin/rpi-source", line 200, in check_gcc
if a[0] == b[0] and a[1] == b[1]:
IndexError: list index out of range

Pi3 support

Will there be support for Pi3 kernels, too?

Linux pi3 4.4.6+ #1 SMP PREEMPT Wed Apr 13 19:30:58 CEST 2016 armv7l GNU/Linux :

rpi-source --skip-gcc
ERROR:
Can't find a source for this kernel

Regards
Joachim

recipe for target 'include/generated/timeconst.h' failed

I freshly instlled the latest raspian kernel img today and afther that updated the kernel and finally got rpi-sorce and ran it wich resulted in error:

sudo rpi-update 
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Performing self-update
 *** Relaunching after update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Your firmware is already up to date

rpi-update
-------------------------------------------------------------------------------------------------------------
*** Add '+' to kernel release string

 *** Create symlink: /home/pi/linux

 *** Create /lib/modules/<ver>/{build,source} symlinks

 *** .config

 *** Module.symvers

 *** make modules_prepare
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  UPD     include/config/kernel.release
  WRAP    arch/arm/include/generated/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/asm/cputime.h
  WRAP    arch/arm/include/generated/asm/current.h
  WRAP    arch/arm/include/generated/asm/emergency-restart.h
  WRAP    arch/arm/include/generated/asm/errno.h
  WRAP    arch/arm/include/generated/asm/exec.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  WRAP    arch/arm/include/generated/asm/ipcbuf.h
  WRAP    arch/arm/include/generated/asm/irq_regs.h
  WRAP    arch/arm/include/generated/asm/kdebug.h
  WRAP    arch/arm/include/generated/asm/local.h
  WRAP    arch/arm/include/generated/asm/local64.h
  WRAP    arch/arm/include/generated/asm/mm-arch-hooks.h
  WRAP    arch/arm/include/generated/asm/msgbuf.h
  WRAP    arch/arm/include/generated/asm/msi.h
  WRAP    arch/arm/include/generated/asm/param.h
  WRAP    arch/arm/include/generated/asm/parport.h
  WRAP    arch/arm/include/generated/asm/poll.h
  WRAP    arch/arm/include/generated/asm/preempt.h
  WRAP    arch/arm/include/generated/asm/resource.h
  WRAP    arch/arm/include/generated/asm/rwsem.h
  WRAP    arch/arm/include/generated/asm/seccomp.h
  WRAP    arch/arm/include/generated/asm/sections.h
  WRAP    arch/arm/include/generated/asm/segment.h
  WRAP    arch/arm/include/generated/asm/sembuf.h
  WRAP    arch/arm/include/generated/asm/serial.h
  WRAP    arch/arm/include/generated/asm/shmbuf.h
  WRAP    arch/arm/include/generated/asm/siginfo.h
  WRAP    arch/arm/include/generated/asm/simd.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  WRAP    arch/arm/include/generated/asm/socket.h
  WRAP    arch/arm/include/generated/asm/sockios.h
  WRAP    arch/arm/include/generated/asm/termbits.h
  WRAP    arch/arm/include/generated/asm/termios.h
  WRAP    arch/arm/include/generated/asm/timex.h
  WRAP    arch/arm/include/generated/asm/trace_clock.h
  WRAP    arch/arm/include/generated/asm/unaligned.h
  CHK     include/generated/uapi/linux/version.h
  UPD     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  HOSTCC  scripts/basic/bin2c
  Generating include/generated/mach-types.h
  CC      kernel/bounds.s
  CHK     include/generated/bounds.h
  UPD     include/generated/bounds.h
  CHK     include/generated/timeconst.h
/bin/sh: 1: bc: not found
Kbuild:66: recipe for target 'include/generated/timeconst.h' failed
make[1]: *** [include/generated/timeconst.h] Error 127
Makefile:986: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
Traceback (most recent call last):
  File "/usr/bin/rpi-source", line 373, in <module>
    sh("cd %s && make modules_prepare %s" % (linux_symlink, (" > /dev/null" if args.quiet else "")))
  File "/usr/bin/rpi-source", line 85, in sh
    subprocess.check_call(cmd, shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'cd /home/pi/linux && make modules_prepare ' returned non-zero exit status 2

fatal error: openssl/bio.h: Datei oder Verzeichnis nicht gefunden

scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: Datei oder Verzeichnis nicht gefunden
#include <openssl/bio.h>
^~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.host:90: scripts/extract-cert] Fehler 1
make: *** [Makefile:1061: scripts] Fehler 2
Traceback (most recent call last):
File "./rpi-source", line 411, in
sh("cd %s && make modules_prepare %s" % (linux_symlink, (" > /dev/null" if args.quiet else "")))
File "./rpi-source", line 90, 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 /root/linux && make modules_prepare ' returned non-zero exit status 2

Version mismatch when running rpi-update and package manager

Hello,

I have been successfully using rpi-source for a few times now.
However, I have just let apt-get upgrade the package raspberrypi-kernel.
This seems to confuse rpi-source, which keeps grabbing the older sources.

My previous kernel was 4.9.80-v7+, apt-get upgraded it to 4.14.30-v7+.
When I run rpi-source (even after a reboot), it keeps detecting an older firmware/linux source commit:
*** Firmware revision: 5c80565c5c0c7f820258c792a98b56f22db2dd03
*** Linux source commit: a2f34d45809d8685bca1e91989e35746499ac400

I think I already had such an issue, and running rpi-update with a newer kernel "fixed" the issue.
But do you think it would be useful to have rpi-source check how the kernel was actually installed, and fetch the correct sources ?

Thanks

support ended? no kernel source for 4.14.81

is here still active development?
i tried "rpi-source" but get no source for kernel 4.14.81

tried to look help up, but the wiki is stuck on gcc4.8, my source is made with 4.9

how to get on bug-fixing? any hints/help?

hello world probelm

guys i try to run hello world example on the latest kernel version.
i follow the instructions from here https://github.com/notro/rpi-source/wiki , but i get this. any ideas?

pi@raspberrypi:~/hello $ make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
make: Entering directory '/home/pi/linux-48ba943bfb614ad9a09d4ffd1cfe54adb1550e09'
scripts/Makefile.build:44: /home/pi/hello/Makefile: No such file or directory
make[1]: *** No rule to make target '/home/pi/hello/Makefile'. Stop.
Makefile:1384: recipe for target 'module/home/pi/hello' failed
make: *** [module/home/pi/hello] Error 2

issues building on 4.4

I can build on raspbian 4.1, but by bumping to 4.4 (rpi-update) i keep getting the following, even on a fresh copy of raspbian.

pi@raspberrypi:~ $ rpi-source

*** gcc version check: OK

*** rpi-update: https://github.com/Hexxeh/rpi-firmware

*** Firmware revision: f325bb8328d0839617d66bea8bf396346f76c7a7

*** Linux source commit: cd560b8658868d9652ab31754e02f86daf6831ba

*** Download kernel source
--2016-04-22 13:37:39-- https://github.com/raspberrypi/linux/archive/cd560b8658868d9652ab31754e02f86daf6831ba.tar.gz
Resolving github.com (github.com)... 192.30.252.131
Connecting to github.com (github.com)|192.30.252.131|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/raspberrypi/linux/tar.gz/cd560b8658868d9652ab31754e02f86daf6831ba [following]
--2016-04-22 13:37:40-- https://codeload.github.com/raspberrypi/linux/tar.gz/cd560b8658868d9652ab31754e02f86daf6831ba
Resolving codeload.github.com (codeload.github.com)... 192.30.252.163
Connecting to codeload.github.com (codeload.github.com)|192.30.252.163|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 136108525 (130M) [application/x-gzip]
Saving to: â/home/pi/linux-cd560b8658868d9652ab31754e02f86daf6831ba.tar.gzâ

/home/pi/linux-cd560b8658868d 100%[================================================>] 129.80M 1.12MB/s in 2m 7s

2016-04-22 13:39:48 (1.02 MB/s) - â/home/pi/linux-cd560b8658868d9652ab31754e02f86daf6831ba.tar.gzâ saved [136108525/136108525]

*** Unpack kernel source
..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
*** Add '+' to kernel release string

*** Create symlink: /home/pi/linux

*** Create /lib/modules//{build,source} symlinks

*** .config

*** Module.symvers

*** make modules_prepare
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config/kernel.release
UPD include/config/kernel.release
WRAP arch/arm/include/generated/asm/bitsperlong.h
WRAP arch/arm/include/generated/asm/cputime.h
WRAP arch/arm/include/generated/asm/current.h
WRAP arch/arm/include/generated/asm/emergency-restart.h
WRAP arch/arm/include/generated/asm/errno.h
WRAP arch/arm/include/generated/asm/exec.h
WRAP arch/arm/include/generated/asm/ioctl.h
WRAP arch/arm/include/generated/asm/ipcbuf.h
WRAP arch/arm/include/generated/asm/irq_regs.h
WRAP arch/arm/include/generated/asm/kdebug.h
WRAP arch/arm/include/generated/asm/local.h
WRAP arch/arm/include/generated/asm/local64.h
WRAP arch/arm/include/generated/asm/mm-arch-hooks.h
WRAP arch/arm/include/generated/asm/msgbuf.h
WRAP arch/arm/include/generated/asm/msi.h
WRAP arch/arm/include/generated/asm/param.h
WRAP arch/arm/include/generated/asm/parport.h
WRAP arch/arm/include/generated/asm/poll.h
WRAP arch/arm/include/generated/asm/preempt.h
WRAP arch/arm/include/generated/asm/resource.h
WRAP arch/arm/include/generated/asm/rwsem.h
WRAP arch/arm/include/generated/asm/seccomp.h
WRAP arch/arm/include/generated/asm/sections.h
WRAP arch/arm/include/generated/asm/segment.h
WRAP arch/arm/include/generated/asm/sembuf.h
WRAP arch/arm/include/generated/asm/serial.h
WRAP arch/arm/include/generated/asm/shmbuf.h
WRAP arch/arm/include/generated/asm/siginfo.h
WRAP arch/arm/include/generated/asm/simd.h
WRAP arch/arm/include/generated/asm/sizes.h
WRAP arch/arm/include/generated/asm/socket.h
WRAP arch/arm/include/generated/asm/sockios.h
WRAP arch/arm/include/generated/asm/termbits.h
WRAP arch/arm/include/generated/asm/termios.h
WRAP arch/arm/include/generated/asm/timex.h
WRAP arch/arm/include/generated/asm/trace_clock.h
WRAP arch/arm/include/generated/asm/unaligned.h
CHK include/generated/uapi/linux/version.h
UPD include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
HOSTCC scripts/basic/bin2c
Generating include/generated/mach-types.h
CC kernel/bounds.s
CHK include/generated/bounds.h
UPD include/generated/bounds.h
CHK include/generated/timeconst.h
/bin/sh: 1: bc: not found
Kbuild:66: recipe for target 'include/generated/timeconst.h' failed
make[1]: *** [include/generated/timeconst.h] Error 127
Makefile:986: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
Traceback (most recent call last):
File "/usr/bin/rpi-source", line 373, in
sh("cd %s && make modules_prepare %s" % (linux_symlink, (" > /dev/null" if args.quiet else "")))
File "/usr/bin/rpi-source", line 85, in sh
subprocess.check_call(cmd, shell=True)
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'cd /home/pi/linux && make modules_prepare ' returned non-zero exit status 2

RLError: (SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),)

Getting always the same issue... what am i doing wrong?

root@retropie:~# wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update
--2016-04-26 05:14:58--  https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.31.17.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.31.17.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12471 (12K) [text/plain]
Saving to: ‘/usr/bin/rpi-source’

/usr/bin/rpi-source           100%[=================================================>]  12.18K  --.-KB/s   in 0.001s

2016-04-26 05:14:59 (19.8 MB/s) - ‘/usr/bin/rpi-source’ saved [12471/12471]

ERROR:
Couldn't download https://api.github.com/repos/notro/rpi-source/git/refs/heads/master, URLError: (SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),)

Help: https://github.com/notro/rpi-source/wiki
root@retropie:~#

Wrong kernel version downloaded on Jessie

I'm just coming back to my project that needs kernel module for an I2S device, and when I run rpi-source on a Jessie machine I end up with sources for 3.18.10 not 4.1.7 I'm investigating.

rpi-source adds a "+" to the kernel.release string

Hi there,

I want to add a kernel module in rabian jessie (4.9.35-v7)... when I download the sources via rpi-source it says during the process "*** Add "+" to kernel release string"

When I now make and make install my module it will compile for kernel-version 4.9.35-v7+ and not run on my actual kernel 4.9.35-v7

How can I solve this problem?
Thank you so much for helping me out!

Cheers!

Handle symlink exception

It would be nice if the following line handled odd cases like build and source being directories. Currently such an exception terminates the script and leaves it in a half-finished state.

sh("sudo rm -f /lib/modules/$(uname -r)/build /lib/modules/$(uname -r)/source")

General source path

Hi,

first: a great script !

But one point: why not using /usr/src for example to place the kernel source instead of placing it into /root home dir ?

HASH foobbar

Had 2 Problems

kernel.git_hash = download("%s/%s/git_hash" % (repo_raw, fw_rev)).strip()
kernel.symvers = "%s/%s/Module.symvers" % (repo_raw, fw_rev)

didn't work for me...
https://raw.githubusercontent.com/Hexxeh/rpi-firmware/1b900b71f268875a4f35637e89a5850277f81510/Module.symvers -> Error 404

-----> <------
My hack ;D

kernel.git_hash = download("%s/master/git_hash" % (repo_raw)).strip()
kernel.symvers = "%s/master/Module.symvers" % (repo_raw)

https://raw.githubusercontent.com/Hexxeh/rpi-firmware/master/Module.symvers

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.