i am unable to boot with my latest rpi-3.18.0 kernel and enabling the device tree?
You need to tell the rpi bootloader that your kernel has device tree enabled. You can do it using the mkknlimg
tool from the raspberrypi/tools
repository, e.g.:
mkknlimg linux/arch/arm/boot/zImage kernel.img
This will add a trailer to the kernel, thus marking it as "device tree compatible".
Is there a way to find out the exact source tree for specific Raspberry Pi kernel
It turns out that after reading a few more forums, I came across an answer. Here it is:
- Find out the firmware commit used to create the image on your Rpi run:
zgrep "* firmware as of" /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | head -1 | awk '{ print $5 }'
- List item
Find out the linux source commit used to create the firmware by seeing the contents of https://github.com/raspberrypi/firmware/blob/firmware_commit/extra/git_hash
3. Install the Linux sources on your raspberry pi:
cd /usr/src/
sudo wget https://github.com/raspberrypi/linux/archive/source_commit.tar.gz
sudo gunzip source_commit.tar.gz
sudo tar -xvf source_commit.tar
sudo mv linux-source_commit linux
sudo ln -s linux linux-headers-3.18.5+ (user your kernel version instead of 3.18.5+)
sudo ln -s linux /lib/modules/3.18.5+/build
This is a bit unrelated but still useful if you'd like to compile a kernel module without having to compile the whole kernel:
cd /lib/modules/3.18.5+/build
sudo make mrproper
sudo sh -c 'zcat /proc/config.gz > .config'
sudo wget https://github.com/raspberrypi/firmware/raw//extra/Module.symvers
sudo make modules_prepare
After this you should be able to compile your module.
How the modules are loaded at boot time? And what is the order in which they loaded at boot time? How to change it?
There few files, that instruct kernel how to load modules: modules.*
files in your kernel modules directory (/lib/modules/<kernel-version>
). Normally these files should not be edited manually since there is a nice tool called depmod
, which will analyse available modules and construct optimal order of loading. depmod
itself looks on symbols, exported by modules (EXPORT_SYMBOL
/EXPORT_SYMBOL_GPL
macro) and references to those symbols, which allows it to build correct initialization sequence.
During boot time available hardware is being probed and corresponding modules are being loaded by system initialization scripts (usually this is done in initrd). You can specify additional modules to be loaded (or blacklisted) during runtime using configuration files in modprobe.d
directory (please refer to modprobe.d(5)
man page)
Raspberry pi doesn't boot after config.txt was deleted
I have the found the solution, I used chkdsk from Windows. It restored and repaired the file system so all is good.
Related Topics
Spawn_Id: Spawn Id Exp6 Not Open
Linux Allocates Memory at Specific Physical Address
Find All Instances of Word Occurring in a File
Sublime Text 2 Build (Ctrl +B) Intel Fortran Compiler
Double Free - Crash or No Crash
Shell Script to Find The Nth Occurrence of a String and Print The Line Number
Testing - Intentionally Corrupt a .Z File Using 'Dd'
Using Awk to Get a Specific String in Line
Why Does Automating Sftp with Expect Hang After Sending The Password
Launching Sonar Scanner from a Gitlab Docker Runner
Use Awk to Print $0 Using The Same Format for All Columns
How to Build Kernel Debug Info as Separate File
Why a Static Library Can Depend on a Shared a Library
How to Efficiently Get 10% of Random Lines Out of The Large File in Linux
Restoring System Directories Permissions
Command Execution with Nohup in Background
How to Configure/Make/Install Against an Older Version of a Library