Firefly开源社区

打印 上一主题 下一主题

build kernel有幾段文字看不懂要幹嘛?

81

积分

0

威望

0

贡献

游客

积分
81

build kernel有幾段文字看不懂要幹嘛?

发表于 2017-5-27 23:09:44      浏览:8127 | 回复:1        打印      只看该作者   [复制链接] 楼主
我用macbook, 再用parallel 裝ubuntu 16.04
我依照 http://wiki.t-firefly.com/index. ... 288/Build_kernel/en 的步驟去安裝,
一切看來都順利, 但是有兩段我看不懂要我幹嘛, 請幫忙指點,
謝謝.
1) 拷貝kernel modules到root file system, 在wiki上是寫 /path/to/your/rfs/
    請問依照我現在的狀況, 我是要把 /path/to/your/rfs/ 換成什麼?
    我現在都還只是在ubuntu 16.04上compile kernel而已, 所以不知道這一段是我要把code複製到哪去..
    是要我把rockchip linux kernel modules 拷貝到我的開發版上嗎? 還是拷貝到我現在compile source code的哪一個目錄?
2) 要修改 parameter file? 那是什麼東西?
    還有CMDLINE: ...這一段是在說什麼? 看不懂..
    是要我在那一個步驟加上什麼嗎? 還是要我改哪一個檔案?
    我用grep找了一遍全部檔案, 比較可能的檔案是
    arch/sh/configs/polaris_defconfig:CONFIG_CMDLINE="console=ttySC1,115200 root=/dev/mtdblock2 rootfstype=jffs2 mem=63M mtdparts=physmap-flash.0:0x00100000(bootloader)ro,0x00500000(Kernel)ro,0x00A00000(Filesystem)"
    arch/sh/configs/shmin_defconfig:CONFIG_CMDLINE="console=ttySC1,115200 root=1f01 mtdparts=phys_mapped_flash:64k(firm)ro,-(sys) netdev=34,0x300,eth0 "
    請問是要我去改這兩個檔案嗎? 那我要改成什麼?
    還是要我去改 arch/arm/configs/firefly-rk3288_defconfig 檔案呢? 不過這個檔案, 我看了一遍, 好像沒地方適合加東西, 只看到一行比較接近的, CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND=y

我對這部分不太懂, 再請幫忙, 謝謝.
   
Copy the kernel module files to the root file system:
rsync -av ./modules_install/ /path/to/your/rfs/
You can also copy to the development board, using ssh remote connection:
rsync -av ./modules_install/ root@<Board IP>:/
Modify Parameter File
The root file system can reside on different partitions in different storage devices (eMMC, TF card or USB disk, etc). It must be specified in the kernel's command line. There is a CMDLINE in the paramter file:
CMDLINE:console=tty0 ... mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),...,-@0x00394000(user)
Add one of below according to your need: (# and contents after are comments, no need to enter):
root=/dev/block/mtd/by-name/linuxroot        # flash partition named "linuxroot"root=/dev/mmcblk0p1          # First partition of TF cardroot=/dev/sda1               # First partition of USB diskroot=LABEL=linuxroot         # Partition whose label is "linuxroot"

回复

使用道具 举报

81

积分

0

威望

0

贡献

游客

积分
81
发表于 2017-5-27 23:12:19        只看该作者  沙发
以下是我完整的kernel compile動作, 基本上完全跟 wiki 上講的一樣, 只是wiki上有2個地方錯誤, 因此我調整了一下

===== prepare working environment on ubuntu 16.04 =====
$ mkdir /home/linweiting/rk3288

===== get linux arm gcc compiler and library =====
$ sudo apt-get install gcc-arm-linux-gnueabihf build-essential lzop libncurses5-dev libssl-dev
$ sudo apt-get install libc6:i386

===== get google android arm compiling toolchain and assign bash shell variables for compiling =====
$ cd ~/rk3288
$ mkdir toolchain
$ cd toolchain
$ wget https://android.googlesource.com ... oid-4.4.2_r1.tar.gz
$ tar zxvf android-4.4.2_r1.tar.gz
$ vim .bashrc
  export ARCH=arm
  export CROSS_COMPILE=/home/linweiting/rk3288/toolchain/bin/arm-eabi-

===== install firefly mkbootimg utility to /usr/local/bin/ =====
$ cd ~/rk3288/
$ git clone https://github.com/neo-technologies/rockchip-mkbootimg.git
$ cd rockchip-mkbootimg
$ make && sudo make install

===== get rockchip linux kernel source code =====
$ cd ~/rk3288/
$ git clone https://bitbucket.org/T-Firefly/firefly-rk3288-kernel.git

===== compile rockchip linux kernel image =====
$ cd ~/rk3288/firefly-rk3288-kernel
$ find ./ -name \*dts | grep 3288
  ./arch/arm/boot/dts/rk3288-tb1.dts
  ./arch/arm/boot/dts/rk3288-chrome.dts
  ./arch/arm/boot/dts/rk3288-tesco.dts
  ./arch/arm/boot/dts/firefly-rk3288_beta.dts
  ./arch/arm/boot/dts/rk3288-fpga.dts
  ./arch/arm/boot/dts/rk3288-box-rk808.dts
  ./arch/arm/boot/dts/rk3288-p977_8846.dts
  ./arch/arm/boot/dts/firefly-rk3288.dts  ===> this file is what we need
  ./arch/arm/boot/dts/rk3288-p977.dts
  ./arch/arm/boot/dts/rk3288-box.dts
  ./arch/arm/boot/dts/rk3288-tb.dts
$ make firefly-rk3288_defconfig
$ make -j8 firefly-rk3288.img
  
  Kernel: arch/arm/boot/zImage is ready
  Image:  kernel.img is ready
  Pack to resource.img successed!
  Image:  resource.img (with firefly-rk3288.dtb logo.bmp) is ready

===== compile rockchip linux kernel modules =====
$ cd ~/rk3288/firefly-rk3288-kernel
$ make modules
$ mkdir modules_install
$ make INSTALL_MOD_PATH=./modules_install modules_install

===== create Initramfs (the linux kernel will load the initramfs as the first root file system and it will find the actual root device and switch to it) =====
$ cd ~/rk3288/firefly-rk3288-kernel
$ git clone https://github.com/TeeFirefly/initrd.git
$ cd initrd
$ make all
$ ls ../initrd.img  (*the initrd.img is generated to the parent folder)

===== package liunx kernel and initrd.img into boot.img =====
$ cd ~/rk3288/firefly-rk3288-kernel
$ mkbootimg --kernel arch/arm/boot/zImage --ramdisk initrd.img -o boot.img
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表