交叉編譯linux核心

來源:互聯網
上載者:User

交叉編譯linux核心 一.下載linux核心源碼      我使用的是linux-loongson-release-zb-kernel.tgz     將其解壓到/usr/src目錄下: tar -xzvf linux-loongson-release-zb-kernel.tgz     這樣在此目錄下會產生linux-loongson-release目錄  www.2cto.com  二.下載交叉編譯工具     : http://dev.lemote.com/files/binary/toolchain/kernel/gcc-3.4.6-newbin.ls2f.tar.gz     解壓放到/opt目錄下,先要修改/opt的許可權            sudo chmod 766 /opt           tar -xzf  gcc‐3.4.6‐newbin.ls2f.tar.gz -C /opt    然後在環鏡變數中制定其路徑          export PATH=/opt/gcc-3.4.6-newbin/bin:$PATH          也可把它寫入~/.bashrc,便於多次使用    設定可執行許可權         chmod +x /opt/gcc-3.4.6-newbin/bin -R  www.2cto.com  三.核心配置     在源碼目錄下:          cp arch/mips/configs/loongson3a_xxxx_config     注:目前在arch/mips/configs下有5個龍芯3a的設定檔          loongson3a_dawning_config          loongson3a_rs780e_config          loongson3a_server_2u_defconfig          loongson3a_server_blade_defconfig          loongson3a_server_config    然後再make config 你會發現龍芯3a預設配置已經寫到設定檔中去了. 四.編譯核心  www.2cto.com        1.本地編譯直接 make完成核心的編譯      2.交叉編譯情況下,進入核心源碼根目錄下,輸入:  make  ARCH=mips CROSS_COMPILE=mipsel-linux-          也可修改makefile,對於反覆編譯此法一勞永逸.修改根目錄下的makefile                    給ARCH變數賦值: ARCH ?= mips                    給CROSS_COMPILE 變數賦值CROSS_COOMPILE ?= mipsel‐linux‐      注:此步執行前要make menuconfig 進入配置介面把 Enable  loadable module support 選中.再把它的下一級目錄的3和4,或2和4選中.          並且修改完要選擇 Save an Alternate Configuration File進行儲存. 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.