Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Rock/Booting Linux"

(Build the kernel: Added "cd ..")
Line 22: Line 22:
 
     make rk3188_radxa_rock_defconfig
 
     make rk3188_radxa_rock_defconfig
 
     make -j8
 
     make -j8
 +
The kernel will be at '''arch/arm/boot/Image'''
 +
=== Build the modules ===
 +
    mkdir modules
 +
    export INSTALL_MOD_PATH=./modules
 +
    make modules && make modules_install
 +
    tar zcvf 3.0.36+.tar.gz modules/lib/modules/3.0.36+/
 
     cd ..
 
     cd ..
 +
Now you have all the kernel modules in '''3.0.36+.tar.gz'''.
  
 
=== Generate the ramdisk ===
 
=== Generate the ramdisk ===

Revision as of 06:05, 25 January 2014

Requirement

  • a radxa rock board(full version or lite version)
  • a desktop/laptop running Windows(XP 32/64bit, Windows 7 32/64 bit)
  • a micro usb cable, one side plugged in to the OTG port of radxa rock, the other side plugged in to the usb port on desktop/laptop


Install the toolchain

Install ARM toolchain and building kernel related pacakges if you don't have them on your host.

   sudo apt-get install gcc-arm-linux-gnueabihf
   sudo apt-get install lzop libncurses5-dev
   export ARCH=arm
   export CROSS_COMPILE=arm-linux-gnueabihf-

Build the kernel

   git clone -b wip/rockchip-3.0-radxa-rock https://github.com/linux-rockchip/rockchip-3.0.git
   cd rockchip-3.0
   make rk3188_radxa_rock_defconfig
   make -j8

The kernel will be at arch/arm/boot/Image

Build the modules

   mkdir modules
   export INSTALL_MOD_PATH=./modules
   make modules && make modules_install
   tar zcvf 3.0.36+.tar.gz modules/lib/modules/3.0.36+/
   cd ..

Now you have all the kernel modules in 3.0.36+.tar.gz.

Generate the ramdisk

   git clone https://github.com/radxa/initrd.git
   cd initrd
   find . ! -path "./.git*"  | cpio -H newc  -ov > ../initrd.img
   cd ..

Generate the boot.img

   wget http://dl.radxa.com/rock/tools/linux/mkbootimg
   sudo apt-get install lib32stdc++6
   chmod +x mkbootimg
   ./mkbootimg --kernel rockchip-3.0/arch/arm/boot/Image --ramdisk initrd.img -o boot.img

Modify the parameter

The linux rootfs maybe in the different partition or media(nand or uSD card or USB disk), so you need to tell the kernel which is the right rootfs to mount. So change the root= command line in your parameter to the rootfs you want to mount. The examples are:

   root=/dev/block/mtd/by-name/linuxroot        # rootfs in the nand partition named "linuxroot"
   root=/dev/mmcblk0p1                          # rootfs in the uSD card first partition
   root=/dev/sda1                               # rootfs in the U disk or the USB hard drive first partition
   root=LABEL=linuxroot                         # rootfs in the partition with label "linuxroot", can be in uSD, U disk or USB hard drive.

Next step

Now you refer flash the image to flash the generated boot.img to "boot" partition parameter to "parameter" partition of your radxa rock board. And download a prebuilt rootfs or make your own rootfs. You will get linux system boot into ramdisk and then switch root to real rootfs.