0

My kernal version is 3.18.11-v7+. Since the kernels from the Raspberry Pi Foundation kernels don't ship with a build directory, I installed the Debian-style package, which should include the build directory using

    sudo apt-get install linux-image-rpi-rpfv linux-headers-rpi-rpfv

Then I appended this at end of /boot/config.txt

  # Parameters to boot on raspbian kernel (linux-image-rpi-rpfv package)
    kernel=vmlinuz-3.18.11-v7+
   initramfs initrd.img-3.18.11-v7+ followkernel

After I reboot,the screen goes blank.

1 Answer 1

2

Are you sure that kernel requires an initramfs? I have not seen any that do on the pi, since it is a very specific hardware platform and the kernels are built exclusively for it. The purpose of an initramfs on normal PC distros is to facilitate the use of a wide range of hardware (based on information from the BIOS or other scanning, the kernel can pick which of a number of mutually exclusive drivers to load from inside the initramfs so that can mount the root filesystem). So I would ditch that line.

I can't find those packages in the Raspbian repos, but note that a "kernel headers" package does not include the source, which is what you need.

If cross compiling is an option, I'd recommend you get the 3.18 rpi kernel source directly. Since this is for the ARMv7 pi 2, pre-built cross-compilers are available on all mainstream linux distros, which saves you a major hassle. To create the default configuration, just use make bcmrpi_defconfig (that's what's used with the Raspbian kernels). You can also compile on the pi, but it will take a long time, as in hours.


If you do build against that source, the module created may or may not work with your current kernel; it likely may not. This will be clear one way or the other when you go to load it, because it will say something about "mismatched" symbols.

If so, you need to use a kernel built from the source you used to build the module (the issue is versioning; you can't use a module built against 3.17.1 with 3.17.2, and sometimes this gets even more finicky). In this case, possibly the kernel was already built when making the module -- the unfortunate part will be that it was not configured properly if you did not run make bcmrpi_config earlier. Check for a .config file in the top of the source tree, and if it is there:

mv .config .config-tmp
make bcmrpi_defconfig
diff .config .config-tmp

If .config didn't exist, or these are substantially different, you need to build the kernel (again). Run make bcmrpi_defconfig if you have not yet, then:

make -j4
make -j4 modules_install

These first two will take a long time on the pi. Then:

make install

There should be a new kernel in boot probably called vmlinuz although it may have a more elaborate name (make install will say what it is). You want to use that in /boot/config.txt as your kernel=.

2
  • I installed the rpi source and then called make in the cp210x driver as per the build instructions. It is now two hours since I did it. But the compiling is taking too long.. It is running many commands like CC [M] drivers/net/wireless/b43/pio.o CC [M] drivers/net/wireless/b43/rfkill.o CC [M] drivers/net/wireless/b43/ppr.o CC [M] drivers/net/wireless/b43/leds.o LD [M] drivers/net/wireless/b43/b43.o CC [M] drivers/net/wireless/b43legacy/main.o I dont know if I did something wrong Aug 6, 2015 at 14:17
  • No, it will take a long time if it needs to build a lot (or the whole) of the kernel, which it might. Builds produce a lot of output that may even include various warning: s, but anything that's a real error will be clearly indicated and cause the build to fail immediately. Not failing a build doesn't prove the software it produced works, though. I've added a few last paragraphs above that contains a further caveat. Note that on the pi 2 you can save much time compiling by using that -j4 switch to make, which will parallelize the build.
    – goldilocks
    Aug 6, 2015 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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