linux內(nèi)核之1:man 支持內(nèi)核函數(shù)

linux-penguin

1. 下載內(nèi)核代碼

$ git clone https://mirrors.tuna.tsinghua.edu.cn/git/linux-stable.git

2. 創(chuàng)建所需分支

2.1 查看所有分支

$ git branch -a

得到類似輸出:

* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/linux-2.6.11.y
  remotes/origin/linux-2.6.12.y
  remotes/origin/linux-2.6.13.y
  remotes/origin/linux-2.6.14.y
  remotes/origin/linux-2.6.15.y
  remotes/origin/linux-2.6.16.y
  remotes/origin/linux-2.6.17.y
  remotes/origin/linux-2.6.18.y
  remotes/origin/linux-2.6.19.y
  remotes/origin/linux-2.6.20.y
  remotes/origin/linux-2.6.21.y
  remotes/origin/linux-2.6.22.y
  remotes/origin/linux-2.6.23.y
  remotes/origin/linux-2.6.24.y
  remotes/origin/linux-2.6.25.y
  remotes/origin/linux-2.6.26.y
  remotes/origin/linux-2.6.27.y
  remotes/origin/linux-2.6.28.y
  remotes/origin/linux-2.6.29.y
  remotes/origin/linux-2.6.30.y
  remotes/origin/linux-2.6.31.y
  remotes/origin/linux-2.6.32.y
  remotes/origin/linux-2.6.33.y
  remotes/origin/linux-2.6.34.y
  remotes/origin/linux-2.6.35.y
  remotes/origin/linux-2.6.36.y
  remotes/origin/linux-2.6.37.y
  remotes/origin/linux-2.6.38.y
  remotes/origin/linux-2.6.39.y
  remotes/origin/linux-3.0.y
  remotes/origin/linux-3.1.y
  remotes/origin/linux-3.10.y
  remotes/origin/linux-3.11.y
  remotes/origin/linux-3.12.y
  remotes/origin/linux-3.13.y
  remotes/origin/linux-3.14.y
  remotes/origin/linux-3.15.y
  remotes/origin/linux-3.16.y
  remotes/origin/linux-3.17.y
  remotes/origin/linux-3.18.y
  remotes/origin/linux-3.19.y
  remotes/origin/linux-3.2.y
  remotes/origin/linux-3.3.y
  remotes/origin/linux-3.4.y
  remotes/origin/linux-3.5.y
  remotes/origin/linux-3.6.y
  remotes/origin/linux-3.7.y
  remotes/origin/linux-3.8.y
  remotes/origin/linux-3.9.y
  remotes/origin/linux-4.0.y
  remotes/origin/linux-4.1.y
  remotes/origin/linux-4.10.y
  remotes/origin/linux-4.11.y
  remotes/origin/linux-4.12.y
  remotes/origin/linux-4.13.y
  remotes/origin/linux-4.14.y
  remotes/origin/linux-4.15.y
  remotes/origin/linux-4.16.y
  remotes/origin/linux-4.17.y
  remotes/origin/linux-4.2.y
  remotes/origin/linux-4.3.y
  remotes/origin/linux-4.4.y
  remotes/origin/linux-4.5.y
  remotes/origin/linux-4.6.y
  remotes/origin/linux-4.7.y
  remotes/origin/linux-4.8.y
  remotes/origin/linux-4.9.y
  remotes/origin/master

2.2 創(chuàng)建本地分支

$ git checkout -b linux-3.10.y origin/linux-3.10.y

查看創(chuàng)建后的本地分支情況:

[zoug2016 linux-stable]$ git branch -v
* linux-3.10.y e7a59c7 Linux 3.10.108
  master       ce397d2 Linux 4.18-rc1

3. 安裝依賴xmlto

xmlto的作用: Convert xml to many other formats

$ sudo yum install xmlto

4. 編譯mandocs和安裝

4.1 編譯

$ make mandocs

4.2 安裝

$ sudo make installmandocs

5 測試man內(nèi)核函數(shù)幫助

$ man printk

查看內(nèi)核make支持的選項說明:

$ make help

$ make help
Cleaning targets:
  clean       - Remove most generated files but keep the config and
                    enough build support to build external modules
  mrproper    - Remove all generated files + config + various backup files
  distclean   - mrproper + remove editor backup and patch files

Configuration targets:
  config      - Update current config utilising a line-oriented program
  nconfig         - Update current config utilising a ncurses menu based program
  menuconfig      - Update current config utilising a menu based program
  xconfig     - Update current config utilising a QT based front-end
  gconfig     - Update current config utilising a GTK based front-end
  oldconfig   - Update current config utilising a provided .config as base
  localmodconfig  - Update current config disabling modules not loaded
  localyesconfig  - Update current config converting local mods to core
  silentoldconfig - Same as oldconfig, but quietly, additionally update deps
  defconfig   - New config with default from ARCH supplied defconfig
  savedefconfig   - Save current config as ./defconfig (minimal config)
  allnoconfig     - New config where all options are answered with no
  allyesconfig    - New config where all options are accepted with yes
  allmodconfig    - New config selecting modules when possible
  alldefconfig    - New config with all symbols set to default
  randconfig      - New config with random answer to all options
  listnewconfig   - List new options
  oldnoconfig     - Same as silentoldconfig but set new symbols to n (unset)

Other generic targets:
  all         - Build all targets marked with [*]
* vmlinux     - Build the bare kernel
* modules     - Build all modules
  modules_install - Install all modules to INSTALL_MOD_PATH (default: /)
  firmware_install- Install all firmware to INSTALL_FW_PATH
                    (default: $(INSTALL_MOD_PATH)/lib/firmware)
  dir/            - Build all files in dir and below
  dir/file.[oisS] - Build specified target only
  dir/file.lst    - Build specified mixed source/assembly target only
                    (requires a recent binutils and recent build (System.map))
  dir/file.ko     - Build module including final link
  modules_prepare - Set up for building external modules
  tags/TAGS   - Generate tags file for editors
  cscope      - Generate cscope index
  gtags           - Generate GNU GLOBAL index
  kernelrelease   - Output the release version string
  kernelversion   - Output the version stored in Makefile
  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH
                    (default: /home/zoug/work/linuxLearn/linux-kernel/linux-stable/usr)

Static analysers
  checkstack      - Generate a list of stack hogs
  namespacecheck  - Name space analysis on compiled kernel
  versioncheck    - Sanity check on version.h usage
  includecheck    - Check for duplicate included header files
  export_report   - List the usages of all exported symbols
  headers_check   - Sanity check on exported headers
  headerdep       - Detect inclusion cycles in headers
  coccicheck      - Check with Coccinelle.

Kernel packaging:
  rpm-pkg             - Build both source and binary RPM kernel packages
  binrpm-pkg          - Build only the binary kernel package
  deb-pkg             - Build the kernel as an deb package
  tar-pkg             - Build the kernel as an uncompressed tarball
  targz-pkg           - Build the kernel as a gzip compressed tarball
  tarbz2-pkg          - Build the kernel as a bzip2 compressed tarball
  tarxz-pkg           - Build the kernel as a xz compressed tarball
  perf-tar-src-pkg    - Build perf-3.2.102.tar source tarball
  perf-targz-src-pkg  - Build perf-3.2.102.tar.gz source tarball
  perf-tarbz2-src-pkg - Build perf-3.2.102.tar.bz2 source tarball
  perf-tarxz-src-pkg  - Build perf-3.2.102.tar.xz source tarball

Documentation targets:
 Linux kernel internal documentation in different formats:
  htmldocs        - HTML
  pdfdocs         - PDF
  psdocs          - Postscript
  xmldocs         - XML DocBook
  mandocs         - man pages
  installmandocs  - install man pages generated by mandocs
  cleandocs       - clean all generated DocBook files

Architecture specific targets (x86):
* bzImage      - Compressed kernel image (arch/x86/boot/bzImage)
  install      - Install kernel using
                  (your) ~/bin/installkernel or
                  (distribution) /sbin/installkernel or
                  install to $(INSTALL_PATH) and run lilo
  fdimage      - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)
  fdimage144   - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)
  fdimage288   - Create 2.8MB boot floppy image (arch/x86/boot/fdimage)
  isoimage     - Create a boot CD-ROM image (arch/x86/boot/image.iso)
                  bzdisk/fdimage*/isoimage also accept:
                  FDARGS="..."  arguments for the booted kernel
                  FDINITRD=file initrd for the booted kernel

  x86_64_defconfig         - Build for x86_64
  i386_defconfig           - Build for i386

  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build
  make V=2   [targets] 2 => give reason for rebuild of target
  make O=dir [targets] Locate all output files in "dir", including .config
  make C=1   [targets] Check all c source with $CHECK (sparse by default)
  make C=2   [targets] Force check of all c source with $CHECK
  make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections
  make W=n   [targets] Enable extra gcc checks, n=1,2,3 where
        1: warnings which may be relevant and do not occur too often
        2: warnings which occur quite often but may still be relevant
        3: more obscure warnings, can most likely be ignored
        Multiple levels can be combined with W=12 or W=123

Execute "make" or "make all" to build all targets marked with [*] 
For further info see the ./README file
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末赠尾,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子气嫁,更是在濱河造成了極大的恐慌,老刑警劉巖寸宵,帶你破解...
    沈念sama閱讀 217,509評論 6 504
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異巫员,居然都是意外死亡,警方通過查閱死者的電腦和手機简识,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,806評論 3 394
  • 文/潘曉璐 我一進店門感猛,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人陪白,你說我怎么就攤上這事】皆螅” “怎么了袖瞻?”我有些...
    開封第一講書人閱讀 163,875評論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長聋迎。 經(jīng)常有香客問我,道長霉晕,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,441評論 1 293
  • 正文 為了忘掉前任拄轻,我火速辦了婚禮,結(jié)果婚禮上恨搓,老公的妹妹穿的比我還像新娘。我一直安慰自己斧抱,他們只是感情好计露,可當(dāng)我...
    茶點故事閱讀 67,488評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著宪郊,像睡著了一般掂恕。 火紅的嫁衣襯著肌膚如雪废膘。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,365評論 1 302
  • 那天斋配,我揣著相機與錄音,去河邊找鬼艰争。 笑死,一個胖子當(dāng)著我的面吹牛甩卓,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播逾柿,決...
    沈念sama閱讀 40,190評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼机错!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起弱匪,我...
    開封第一講書人閱讀 39,062評論 0 276
  • 序言:老撾萬榮一對情侶失蹤璧亮,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后枝嘶,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,500評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡群扶,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,706評論 3 335
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了提茁。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 39,834評論 1 347
  • 序言:一個原本活蹦亂跳的男人離奇死亡茴扁,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出峭火,到底是詐尸還是另有隱情,我是刑警寧澤卖丸,帶...
    沈念sama閱讀 35,559評論 5 345
  • 正文 年R本政府宣布,位于F島的核電站稍浆,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏衅枫。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,167評論 3 328
  • 文/蒙蒙 一步咪、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧益楼,春花似錦、人聲如沸感凤。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,779評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽坠陈。三九已至萨惑,卻和暖如春庸蔼,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背贮匕。 一陣腳步聲響...
    開封第一講書人閱讀 32,912評論 1 269
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留掏膏,地道東北人。 一個月前我還...
    沈念sama閱讀 47,958評論 2 370
  • 正文 我出身青樓馒疹,卻偏偏與公主長得像,于是被迫代替她去往敵國和親颖变。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,779評論 2 354

推薦閱讀更多精彩內(nèi)容

  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理腥刹,服務(wù)發(fā)現(xiàn),斷路器衔峰,智...
    卡卡羅2017閱讀 134,654評論 18 139
  • linux資料總章2.1 1.0寫的不好抱歉 但是2.0已經(jīng)改了很多 但是錯誤還是無法避免 以后資料會慢慢更新 大...
    數(shù)據(jù)革命閱讀 12,161評論 2 33
  • 觀其大綱 第1部分Linux的基礎(chǔ)知識第1章Linux概述第2章Linux系統(tǒng)的安裝KickStart開始自動安裝...
    周少言閱讀 1,484評論 1 10
  • Ubuntu的發(fā)音 Ubuntu梢褐,源于非洲祖魯人和科薩人的語言,發(fā)作 oo-boon-too 的音盈咳。了解發(fā)音是有意...
    螢火蟲de夢閱讀 99,260評論 9 467
  • 區(qū)塊鏈的信仰是什么?未來區(qū)塊鏈也許很美好鱼响,能完成很多事情,但是現(xiàn)在區(qū)塊鏈能做的事情真的不多丈积,什么都是虛的。賺錢才是...
    追夢者wang閱讀 154評論 0 0