Skip to content

Instantly share code, notes, and snippets.

@tienthanh2509
Created January 1, 2018 06:24
Show Gist options
  • Save tienthanh2509/274cebeeb5ad43c50f43bfdd68fe747f to your computer and use it in GitHub Desktop.
Save tienthanh2509/274cebeeb5ad43c50f43bfdd68fe747f to your computer and use it in GitHub Desktop.
#!/bin/bash
# Build NanoPi NEO firmware from source
export http_proxy=http://10.8.0.1:3128/
export https_proxy=http://10.8.0.1:3128/
export HTTP_PROXY=http://10.8.0.1:3128/
export HTTPS_PROXY=http://10.8.0.1:3128/
export ARCH=arm
export CROSS_COMPILE=arm-linux-
export CROSS_COMPILE=arm-linux-gnueabihf-
export GCC_COLORS=auto
apt-get install -y \
bc \
build-essential \
nano \
git-core \
xz-utils \
device-tree-compiler
mkdir -p /opt/FriendlyARM/toolchain/
tar xvf arm-cortexa9-linux-gnueabihf-4.9.3-20160512.tar.xz -C /opt/FriendlyARM/toolchain/
git clone -b sunxi-v2017.x --depth=1 https://github.com/friendlyarm/u-boot.git /opt/FriendlyARM/u-boot/
cd /opt/FriendlyARM/u-boot/
make nanopi_neo_defconfig
make -j12
# dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
git clone -b sunxi-4.11.y --depth=1 https://github.com/friendlyarm/linux.git /opt/FriendlyARM/linux
cd /opt/FriendlyARM/linux
touch .scmversion
make sunxi_defconfig -j12
make zImage dtbs -j12
mkdir -p /opt/FriendlyARM/boot/
cp arch/arm/boot/zImage /opt/FriendlyARM/boot/
cp arch/arm/boot/dts/sun8i-h3-nanopi*.dtb /opt/FriendlyARM/boot/
git clone --depth=1 https://github.com/friendlyarm/sd-fuse_nanopi.git /opt/FriendlyARM/rootfs
cd /opt/FriendlyARM/rootfs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment