mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
getting started: explain ./build vs ./build-linux after the useful example
This commit is contained in:
24
README.adoc
24
README.adoc
@@ -152,14 +152,6 @@ hello /root/.profile
|
||||
|
||||
Besides a seamless <<qemu-buildroot-setup-getting-started,initial build>>, this project also aims to make it effortless to modify and rebuild several major components of the system, to serve as an awesome development setup.
|
||||
|
||||
While developing individual components, you will most often want to use specific build commands such as `./build-linux` instead of the more generic `./build` helper.
|
||||
|
||||
You can see what `./build` does with:
|
||||
|
||||
....
|
||||
./build --dry-run
|
||||
....
|
||||
|
||||
===== Your first Linux kernel hack
|
||||
|
||||
Let's hack up the <<linux-kernel-entry-point, Linux kernel entry point>>, which is an easy place to start.
|
||||
@@ -185,12 +177,20 @@ Then rebuild the Linux kernel, quit QEMU and reboot the modified kernel:
|
||||
|
||||
and, surely enough, your message has appeared at the beginning of the boot.
|
||||
|
||||
We could have used just `./build` as in the initial build, but doing just `./build-linux` will save us a bit of time.
|
||||
|
||||
The link:build[`./build`] script is just a lightweight wrapper, but when you start modifying components such as the Linux kernel, it is better to run individual steps directly.
|
||||
|
||||
So you are now officially a Linux kernel hacker, way to go!
|
||||
|
||||
We could have used just link:build[] as in the <<qemu-buildroot-getting-started,initial build>> instead of link:build-linux[], but building just the required individual components is preferred during development:
|
||||
|
||||
* saves a few seconds from parsing Make scripts and reading timestamps
|
||||
* makes it easier to understand what is being done in more detail
|
||||
* allows passing more specific options to customize the build
|
||||
|
||||
The link:build[] script is just a lightweight wrapper that calls the smaller build scripts, and you can see what `./build` does with:
|
||||
|
||||
....
|
||||
./build --dry-run
|
||||
....
|
||||
|
||||
===== Your first kernel module hack
|
||||
|
||||
Edit link:kernel_modules/hello.c[] to contain:
|
||||
|
||||
Reference in New Issue
Block a user