-
Notifications
You must be signed in to change notification settings - Fork 0
Build a uClinux kernel
Sam Duy edited this page Feb 14, 2018
·
2 revisions
- Cross compiler
$ sudo apt-get install gcc-arm-linux-gnueabi
- Download toolchains for uClinux, at: https://sourceforge.net/projects/uclinux/files/Tools/arm-uclinuxeabi-20160831/arm-uclinuxeabi-tools-20160831.tar.gz/download
After downloading, unzip it and copy to corresponding directories.
- Other dependency tools
$ sudo apt-get -y install libncurses5-dev bc lzop u-boot-tools genromfs
$ make menuconfig
- Select a vendor profile (configuration file): we choose a board
Versatile-PB-noMMU
fromARM
.- Reasons:
- It uses ARM architecture, that means we don't need to install other cross-compiler (like M68K, things will be more complicated).
- The machine
versatilepb
is supported by QEMU ARM - It does not have MMU (and the impact of lacking MMU is exactly what we want to verify).
- Reasons:
vendors/ARM/Versatile-PB-noMMU/config.arch
-
Save and Exit.
-
Make (with Debug Information enabled:
CONFIG_DEBUG_INFO=y
)
$ make modules CONFIG_DEBUG_INFO=y
$ make CONFIG_DEBUG_INFO=y
- It may complain that some compilers (such as:
arm-linux-gcc
,...) are lacked, we just need to make symlinks from the currentarm-linux-gnueabi-*
to them:
$ cd /usr/bin
$ for i in `ls arm-linux-gnueabi-*`; do ln -sf $i arm-linux${i#arm-linux-gnueabi}; done
-
Remember to download toolchains for uClinux (
arm-uClinux-gnueabi-*
) and install them to/usr/local
so that some modules can be built succesfully. (e.g.usr/net-tools/
,...) -
Some errors may appear when compiling modules in
usr/net-tools/
directory. For some reasons, the header files can't be found (or the parameter of INCLUDE DIR in the Makefile did not work as expected). One workaround for that is: copying all*.h
files fromusr/net-tools
andusr/net-tools/include/
to theusr/net-tools/lib
directory.
$ cd [build_root]
$ cp user/net-tools/*.h user/net-tools/lib/
$ cp user/net-tools/include/*.h user/net-tools/lib/
- Background
- Anatomy of Volatility
- Profile for Volatility
- uClinux profile for Volatility
- Results
- Conclusion
- Advanced topics