Skip to content

Instantly share code, notes, and snippets.

@kangear
Last active August 26, 2016 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kangear/17e3d118ef89c791212e to your computer and use it in GitHub Desktop.
Save kangear/17e3d118ef89c791212e to your computer and use it in GitHub Desktop.

Linux mainline for rk3188

RK's Loader + Linux(latest) + miniroot(ext4).

###Get the source code

git clone -b stable --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
cd linux-next

wget https://raw.githubusercontent.com/naobsd/linux/naobsd/next-20150306/arch/arm/configs/rk30_rk31_defconfig -O arch/arm/configs/rockchip_defconfig

###Build kernel We have to build two files:

  • zImage (the kernel)
  • rk3188-radxarock.dtb (the device tree blob)
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
make rockchip_defconfig
make -j8 zImage dtbs

###Create kernel image Create kernel image We need to append the device tree blob to zImage (CONFIG_ARM_APPENDED_DTB option) until we can use U-Boot device tree support.

cat arch/arm/boot/zImage arch/arm/boot/dts/rk3188-radxarock.dtb > zImage-dtb
rkcrc -k zImage-dtb kernel.img

###Create miniroot Ext4 rootfs Image get make_ext4 tools

git clone git@github.com:EpicAOSP/make_ext4.git
sudo cp make_ext4/bin/* /usr/bin/

create miniroot images

git clone https://github.com/kangear/miniroot.git
make_ext4fs -l 20M -s miniroot.ext4img miniroot
simg2img miniroot.ext4img miniroot.ext4.img
# the miniroot.ext4.img is finally miniroot image file.
sudo dd bs=4M if=miniroot.ext4.img of=/dev/sdX

run from eMMC at first when see this:

Waiting for root device /dev/mmcblk0p1...

then plug in sdcard. it will boot fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment