0

I have cross-compiled and installed the Linux kernel with the real-time patch, version 3.18.16-rt13-v7+, on a raspberrypi but then I can't find the current kernel source in /usr/src. Then I tried the following, without success:

pi@raspberrypi:$ sudo apt-get source linux-image-$(uname -r)
 Reading package lists... Done
 Building dependency tree

 Reading state information... Done
 E: Unable to find a source package for linux-image-3.18.16-rt13-v7+

I need the kernel source in order to compile and install the Etherlab-master.

3
  • You shouldn't use sudo for apt-get source. – Munir Mar 10 '16 at 16:48
  • What command(s) did you use to deploy the kernel onto the RPi? It would usually only copy over the binary files and wouldn't copy the source code ; but you built it yourself, so you have all the source available, why can't you just copy it over? – fduff Mar 10 '16 at 20:24
  • Also, take a closer look at the Etherlab ./configure part, you can provide options there, things like the Linux source code location and you might even be able to cross-compile it on a PC before deploying it on the RPi, it's worth a try. – fduff Mar 10 '16 at 20:26
0

If there is not a /usr/src directory on your system, then the kernel source has not been installed. The easiest way to do this is by running:

sudo apt-get install linux-source

Update

Download the Latest Stable Kernel from kernel_archive unrar the kernel source

tar -xvJf linux-x.y.z.tar.xz

Configure the Kernel First , install libncurses & libncurses-dev

sudo apt-get install libncurses libncurses-dev

then

cd linux-x.y.z
make menuconfig

to use the default config select save to save the config in the file name .config

Compile and install

make
make modules
make modules_install
make install

Reboot your system

2
  • This won't do much in case you built a custom kernel. – fduff Mar 10 '16 at 20:27
  • @fduff He need only the kernel source , i will update – GAD3R Mar 10 '16 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.