Skip to content

Instantly share code, notes, and snippets.

@tetsu-koba
Created February 11, 2018 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tetsu-koba/0123aeda3298fc07fb79128dbb889f44 to your computer and use it in GitHub Desktop.
Save tetsu-koba/0123aeda3298fc07fb79128dbb889f44 to your computer and use it in GitHub Desktop.
Buildroot configs for nano pi neo vendor tree uboot and kernel
Buildroot configs for nano pi neo vendor tree uboot and kernel
Modified files:
configs/nanopi_neo_defconfig
board/friendlyarm/nanopi-neo/genimage.cfg
board/friendlyarm/nanopi-neo/boot.cmd
board/friendlyarm/nanopi-neo/post-image.sh
# Recompile with:
# mkimage -C none -A arm -T script -d boot.cmd boot.scr
setenv fsck.repair yes
setenv ramdisk rootfs.cpio.gz
setenv kernel zImage
setenv env_addr 0x45000000
setenv kernel_addr 0x46000000
setenv ramdisk_addr 0x47000000
setenv dtb_addr 0x48000000
fatload mmc 0 ${kernel_addr} ${kernel}
fatload mmc 0 ${dtb_addr} sun8i-h3-nanopi-neo.dtb
fdt addr ${dtb_addr}
# setup MAC address
fdt set ethernet0 local-mac-address ${mac_node}
# setup boot_device
fdt set mmc${boot_mmc} boot_device <1>
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 ro rootwait fsck.repair=${fsck.repair} panic=10 ${extra}
bootz ${kernel_addr} - ${dtb_addr}
image boot.vfat {
vfat {
files = {
"zImage",
"sun8i-h3-nanopi-neo.dtb",
"boot.scr"
}
}
size = 100M
}
image sdcard.img {
hdimage {
}
partition u-boot {
in-partition-table = "no"
image = "u-boot-sunxi-with-spl.bin"
offset = 8192
size = 1040384 # 1MB - 8192
}
partition boot {
partition-type = 0xC
bootable = "true"
image = "boot.vfat"
}
partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
size = 128M
}
}
BR2_arm=y
BR2_cortex_a7=y
BR2_ARM_FPU_VFPV4=y
BR2_CCACHE=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_11=y
BR2_TARGET_GENERIC_HOSTNAME="nanopi-neo"
BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the NanoPi NEO"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/friendlyarm/nanopi-neo/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/friendlyarm/nanopi-neo/post-image.sh"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="http://www.mediafire.com/file/57urrfmb7irxlbb/linux_4.11.2_20170707.tar.gz"
BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h3-nanopi-neo"
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_LABEL="rootfs"
BR2_TARGET_ROOTFS_EXT2_SIZE="128M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="http://www.mediafire.com/file/wessj3k3974nep1/u-boot_2017.05_20170707.tar.gz"
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="nanopi_neo"
BR2_TARGET_UBOOT_NEEDS_DTC=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin"
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
#!/bin/sh
# post-image.sh for Nanopi NEO, based on the Orange Pi PC
BOARD_DIR="$( dirname "${0}" )"
GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
rm -rf "${GENIMAGE_TMP}"
genimage \
--rootpath "${TARGET_DIR}" \
--tmppath "${GENIMAGE_TMP}" \
--inputpath "${BINARIES_DIR}" \
--outputpath "${BINARIES_DIR}" \
--config "${GENIMAGE_CFG}"
rm -f $BINARIES_DIR/sdcard.img.zip
zip $BINARIES_DIR/sdcard.img.zip $BINARIES_DIR/sdcard.img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment