發表文章

目前顯示的是 1月, 2014的文章

如何編譯特定的 Linux Module

這也不是一天兩天了,常常會對 Linux 的某些 Driver 做些 Patches,或對某些 Module 做修改,但每次要 compile 出那幾個 ko 檔時就很頭痛,既然只是修改特定的 module ,又不用重新做出新的 kernel image,為何每次都要將整個 kernel 重新 compile 呢?其實有方法可以只編譯特定的 kernel module 以並免不必要的時間浪費。 切換到目標 module 的目錄下,然後執行: make script make prepare make -C /usr/src/linux SUBDIRS=$PWD modules ※粗體字部份改成 kernel source 的位置即可。 Reference:http://fred-zone.blogspot.tw/2008/09/linux-module.html

strip 用法

Shared Library(*.so) strip --strip-debug --remove-section=.note --remove-section=.comment *.so kernel module(*.ko) strip -g -S -d *.ko or strip --strip-debug --strip-unneeded *.ko find ./ install/lib/modules/3.10.17/kernel/ -iname "*.ko" -exec strip -g -S -d {} \;

在 Linux 底下,如何讓 CPU 使用率達到 100% (使用 md5sum 與 gzip)

md5sum < /dev/urandom & cat /dev/urandom | gzip > /dev/null & reference: http://rainstingtw.blogspot.com/2013/07/Use-md5sum-gzip-CPU-fullloading.html

patch aufs for linux-3.10.17

git clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git aufs3-standalone.git cd aufs3-standalone.git git checkout origin/aufs3.10 --> 3.x 依據你的 kernel 版本 參考 README ... - apply ./aufs3-kbuild.patch to your kernel source files. - apply ./aufs3-base.patch too. - apply ./aufs3-mmap.patch too. - apply ./aufs3-standalone.patch too, if you have a plan to set   CONFIG_AUFS_FS=m. otherwise you don't need ./aufs3-standalone.patch. - copy ./{Documentation,fs,include/uapi/linux/aufs_type.h} files to your kernel source tree.   Never copy $PWD/include/uapi/linux/Kbuild.  cp -rfv ../aufs3-standalone.git/{Documentation,fs} ./  cp -rfv ../aufs3-standalone.git/include/uapi/linux/aufs_type.h ./include/uapi/linux/  patch -Np1 -i ../aufs3-standalone.git/aufs3-kbuild.patch  patch -Np1 -i ../aufs3-standalone.git/aufs3-base.patch  patch -Np1 -i ../aufs3-standalone.git/aufs3-mmap.patch  patch -Np1 -i ../aufs3-standalone.git/aufs3-standalone.patch 進入 menuconfig 選擇 aufs, 然後 make ...  exa

紙飛機教學

圖片
http://homepage3.nifty.com/papercraft/air2/index.html