Merge branch 'chip/next' of github.com:NextThingCo/CHIP-tools into chip/next
This commit is contained in:
commit
1a2acbc0d8
@ -6,7 +6,7 @@ source $SCRIPTDIR/common.sh
|
|||||||
##############################################################
|
##############################################################
|
||||||
# main
|
# main
|
||||||
##############################################################
|
##############################################################
|
||||||
while getopts "flu:" opt; do
|
while getopts "flpu:" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
f)
|
f)
|
||||||
echo "fastboot enabled"
|
echo "fastboot enabled"
|
||||||
@ -19,6 +19,9 @@ while getopts "flu:" opt; do
|
|||||||
u)
|
u)
|
||||||
BUILDROOT_OUTPUT_DIR="${OPTARG}"
|
BUILDROOT_OUTPUT_DIR="${OPTARG}"
|
||||||
;;
|
;;
|
||||||
|
p)
|
||||||
|
POCKET_CHIP=true
|
||||||
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
exit 1
|
exit 1
|
||||||
@ -94,7 +97,7 @@ prepare_uboot_script() {
|
|||||||
|
|
||||||
echo "nand write $UBOOT_MEM_ADDR 0x800000 $PADDED_UBOOT_SIZE" >> "${UBOOT_SCRIPT_SRC}"
|
echo "nand write $UBOOT_MEM_ADDR 0x800000 $PADDED_UBOOT_SIZE" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
echo "setenv bootargs root=ubi0:rootfs rootfstype=ubifs rw earlyprintk ubi.mtd=4" >> "${UBOOT_SCRIPT_SRC}"
|
echo "setenv bootargs root=ubi0:rootfs rootfstype=ubifs rw earlyprintk ubi.mtd=4" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
echo "setenv bootcmd 'if test -n \${fel_booted} && test -n \${scriptaddr}; then echo '(FEL boot)'; source \${scriptaddr}; fi; mtdparts; ubi part UBI; ubifsmount ubi0:rootfs; ubifsload \$fdt_addr_r /boot/sun5i-r8-chip.dtb; ubifsload \$kernel_addr_r /boot/zImage; bootz \$kernel_addr_r - \$fdt_addr_r'" >> "${UBOOT_SCRIPT_SRC}"
|
echo "setenv bootcmd 'gpio set PB2; if test -n \${fel_booted} && test -n \${scriptaddr}; then echo '(FEL boot)'; source \${scriptaddr}; fi; mtdparts; ubi part UBI; ubifsmount ubi0:rootfs; ubifsload \$fdt_addr_r /boot/sun5i-r8-chip.dtb; ubifsload \$kernel_addr_r /boot/zImage; bootz \$kernel_addr_r - \$fdt_addr_r'" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
echo "setenv fel_booted 0" >> "${UBOOT_SCRIPT_SRC}"
|
echo "setenv fel_booted 0" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
|
|
||||||
echo "echo Enabling Splash" >> "${UBOOT_SCRIPT_SRC}"
|
echo "echo Enabling Splash" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
@ -103,7 +106,11 @@ prepare_uboot_script() {
|
|||||||
echo "setenv splashpos m,m" >> "${UBOOT_SCRIPT_SRC}"
|
echo "setenv splashpos m,m" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
|
|
||||||
echo "echo Configuring Video Mode"
|
echo "echo Configuring Video Mode"
|
||||||
echo "setenv video-mode sunxi:640x480-24@60,monitor=composite-ntsc,overscan_x=40,overscan_y=20" >> "${UBOOT_SCRIPT_SRC}"
|
if [[ "${POCKET_CHIP}" == "true" ]]; then
|
||||||
|
echo "setenv video-mode" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
|
else
|
||||||
|
echo "setenv video-mode sunxi:640x480-24@60,monitor=composite-ntsc,overscan_x=40,overscan_y=20" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "saveenv" >> "${UBOOT_SCRIPT_SRC}"
|
echo "saveenv" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ function cache_download {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while getopts "ufdb:w:B:" opt; do
|
while getopts "ufdpb:w:B:" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
u)
|
u)
|
||||||
echo "updating cache"
|
echo "updating cache"
|
||||||
@ -76,12 +76,18 @@ while getopts "ufdb:w:B:" opt; do
|
|||||||
;;
|
;;
|
||||||
w)
|
w)
|
||||||
WHAT="$OPTARG"
|
WHAT="$OPTARG"
|
||||||
echo "WHAT = ${BRANCH}"
|
echo "WHAT = ${WHAT}"
|
||||||
;;
|
;;
|
||||||
d)
|
d)
|
||||||
echo "debian selected"
|
echo "debian selected"
|
||||||
WHAT="debian"
|
WHAT="debian"
|
||||||
;;
|
;;
|
||||||
|
p)
|
||||||
|
echo "PocketC.H.I.P selected"
|
||||||
|
WHAT="pocketchip"
|
||||||
|
BUILD=123
|
||||||
|
FLASH_SCRIPT=./chip-fel-flash.sh -p
|
||||||
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
exit 1
|
exit 1
|
||||||
@ -95,6 +101,8 @@ FW_IMAGE_DIR="${FW_DIR}/images"
|
|||||||
BASE_URL="http://opensource.nextthing.co/chip"
|
BASE_URL="http://opensource.nextthing.co/chip"
|
||||||
S3_URL="${BASE_URL}/${WHAT}/${BRANCH}/latest"
|
S3_URL="${BASE_URL}/${WHAT}/${BRANCH}/latest"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [[ -z "$BUILD" ]]; then
|
if [[ -z "$BUILD" ]]; then
|
||||||
ROOTFS_URL="$(wget -q -O- ${S3_URL})" || (echo "ERROR: cannot reach ${S3_URL}" && exit 1)
|
ROOTFS_URL="$(wget -q -O- ${S3_URL})" || (echo "ERROR: cannot reach ${S3_URL}" && exit 1)
|
||||||
if [[ -z "${ROOTFS_URL}" ]]; then
|
if [[ -z "${ROOTFS_URL}" ]]; then
|
||||||
@ -105,16 +113,25 @@ else
|
|||||||
ROOTFS_URL="${S3_URL%latest}$BUILD"
|
ROOTFS_URL="${S3_URL%latest}$BUILD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${WHAT}" == "buildroot" ]]; then
|
case "${WHAT}" in
|
||||||
BR_BUILD="$(wget -q -O- ${ROOTFS_URL}/build)"
|
"buildroot")
|
||||||
BUILD=${BR_BUILD}
|
BR_BUILD="$(wget -q -O- ${ROOTFS_URL}/build)"
|
||||||
ROOTFS_URL="${ROOTFS_URL}/images"
|
BUILD=${BR_BUILD}
|
||||||
BR_URL="${ROOTFS_URL}"
|
ROOTFS_URL="${ROOTFS_URL}/images"
|
||||||
else
|
BR_URL="${ROOTFS_URL}"
|
||||||
BR_BUILD="$(wget -q -O- ${ROOTFS_URL}/br_build)"
|
;;
|
||||||
BR_URL="${BASE_URL}/buildroot/${BRANCH%-gui}/${BR_BUILD}/images"
|
"debian")
|
||||||
BUILD="$(wget -q -O- ${ROOTFS_URL}/build)"
|
BR_BUILD="$(wget -q -O- ${ROOTFS_URL}/br_build)"
|
||||||
fi
|
BR_URL="${BASE_URL}/buildroot/${BRANCH%-gui}/${BR_BUILD}/images"
|
||||||
|
BUILD="$(wget -q -O- ${ROOTFS_URL}/build)"
|
||||||
|
;;
|
||||||
|
"pocketchip")
|
||||||
|
BR_BUILD=123
|
||||||
|
BUILD=123
|
||||||
|
ROOTFS_URL="http://opensource.nextthing.co/pocketchip"
|
||||||
|
BR_URL="$ROOTFS_URL"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
echo "ROOTFS_URL=${ROOTFS_URL}"
|
echo "ROOTFS_URL=${ROOTFS_URL}"
|
||||||
echo "BUILD=${BUILD}"
|
echo "BUILD=${BUILD}"
|
||||||
|
Loading…
Reference in New Issue
Block a user