RPi-Distro / rpi-source

Raspberry Pi kernel source installer
MIT License
140 stars 39 forks source link

download-only option #3

Closed Ircama closed 3 years ago

Ircama commented 3 years ago

download-only option

Added --download-only option, to just download the kernel source tarball, without unpacking and installing it. Sometimes it is not required to have the whole kernel unpacked, but just a single directory, that can be easily extracted from the tarball, like in the following example:

kdir=$(rpi-source -s|grep commit|awk 'NF>1{print $NF}')
tar xvf /root/linux-$kdir.tar.gz linux-$kdir/path-to-extract

[edit: revised code to only keep download-only option]

pelwell commented 3 years ago

I'd prefer you not to reformat the code at all, but if you are then please make it a different commit (or even a different PR), otherwise it makes it harder to focus on the substantive changes when reviewing.

Ircama commented 3 years ago

@pelwell you are right, I'll update the PR

Ircama commented 3 years ago

PR revised to only keep the --download-only option. I'll use another PR for the improved error message. (I will leave out the older last point related to formatting with black.)