通過yocto給p1010rdb定製linux,並啟動linux

來源:互聯網
上載者:User

標籤:

一、通過yocto定製linux

  1.安裝yocto

    yocto只能在非root使用者下編譯,所以先建立一個使用者。

    useradd chen  passwd -d chen 重啟電腦進入chen使用者。

    給chen使用者添加root許可權,vim /etc/sudoers 第99行添加  chen   ALL=(ALL)   ALL    

                       chen ALL = NOPASSWD: /usr/bin/yum

    mkdir yocto  將光碟片中的資料拷貝到yocto下,光碟片名稱(yocto soure iso)。

    添加可執行許可權  chmod +x install        ./install  跟著步驟安裝好yocto。

  2.編譯linux檔案

    進入yocto的安裝資料夾:

    ./scripts/host-prepare.sh 配置yocto的環境變數。

    source ./fsl-setup-poky -m p1010rdb 開始編譯組建檔案。

    選擇編譯方式,這裡提供了以下幾種:

    fsl-image-minimal

    fsl-image-core

    fsl-image-full

    fsl-image-flash

    fsl-toolchain

    package-name(usdpaa)

    我選的是 fsl-image-minimal:

    bitbake fsl-image-minimal

    在編譯的時候會提示缺一個庫,直接用yum install 庫的名字  在繼續編譯就行了 

    等待編譯完成在QorIQ-SDK-V1.2-20120614-yocto/build_p1010rdb_release/tmp/deploy/images路徑下會產生編好的檔案系統,核心鏡像,驅動樹。

    

    提示:

      要留至少20g的硬碟空間給檔案使用。   

二、啟動linux

  這裡介紹兩種啟動linux的方法:

  1.通過tftp直接啟動

    開啟安裝包裡面的START_HERE.html 文檔,找到development deployment這一章,根據文檔操作確保主機上的tftp伺服器可以使用。

    配置板子的啟動參數:

      setenv ipaddr 192.168.1.10

      setenv serverip 192.168.1.20

      setenv gatewayip 192.168.1.1

      setenv bootargs  ‘root=/dev/ram rw ramdisk_size=10000000 console=ttyS0,115200‘

      saveenv

    啟動linux:

      tftp 0x1000000 uImage-p1010rdb.bin

      tftp 0x2000000 fsl-image-minimal-p1010rdb.rootfs.ext2.gz.u-boot

      tftp 0xc00000 uImage-p1010rdb.dtb

      bootm 0x1000000 0x2000000 0xc00000 啟動linux成功。

 

  2.通過nfs伺服器啟動

    在主機上構建nfs伺服器,mkdir /tftpboot/systembuilder  ,cp p1010rdb-rootfs.tar.gz /tftpboot/systembuilder

    tar xf p1010rdb-rootfs.tar.gz , chmod 777 /tftpboot/systembuilder -R

    vi /etc/exports   加入/tftpboot/systembuilder  *(rw, no_root_squash, async)

    配置啟動參數:

      setenv ipaddr 192.168.1.10

      setenv serverip 192.168.1.20

      setenv gatewayip 192.168.1.1

      setenv bootargs root=/dev/nfs rw nfsroot=192.168.1.20:/tftpboot/systembuilder nolock ip=192.168.1.10:192.168.1.20:192.168.1.1:255.255.0.0::eth0:off /> console=ttyS0,115200

        saveenv

    啟動linux:

      tftp 0x1000000 uImage-p1010rdb.bin

      tftp 0xc00000 uImage-p1010rdb.dtb

      bootm 0x1000000 - 0xc00000  啟動linux成功。

 

 

              

      

 

通過yocto給p1010rdb定製linux,並啟動linux

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.