added priliminary support for separate PocketC.H.I.P image

chip/stable
Alex Kaplan 7 years ago
parent 0e5a1b7e6c
commit c38ef3fa5d
  1. 13
      chip-fel-flash.sh
  2. 39
      chip-update-firmware.sh

@ -6,7 +6,7 @@ source $SCRIPTDIR/common.sh
##############################################################
# main
##############################################################
while getopts "flu:" opt; do
while getopts "flpu:" opt; do
case $opt in
f)
echo "fastboot enabled"
@ -19,6 +19,9 @@ while getopts "flu:" opt; do
u)
BUILDROOT_OUTPUT_DIR="${OPTARG}"
;;
p)
POCKET_CHIP=true
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
@ -94,7 +97,7 @@ prepare_uboot_script() {
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 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 "echo Enabling Splash" >> "${UBOOT_SCRIPT_SRC}"
@ -103,7 +106,11 @@ prepare_uboot_script() {
echo "setenv splashpos m,m" >> "${UBOOT_SCRIPT_SRC}"
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}"

@ -54,7 +54,7 @@ function cache_download {
}
while getopts "ufdb:w:B:" opt; do
while getopts "ufdpb:w:B:" opt; do
case $opt in
u)
echo "updating cache"
@ -82,6 +82,12 @@ while getopts "ufdb:w:B:" opt; do
echo "debian selected"
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
exit 1
@ -95,6 +101,8 @@ FW_IMAGE_DIR="${FW_DIR}/images"
BASE_URL="http://opensource.nextthing.co/chip"
S3_URL="${BASE_URL}/${WHAT}/${BRANCH}/latest"
if [[ -z "$BUILD" ]]; then
ROOTFS_URL="$(wget -q -O- ${S3_URL})" || (echo "ERROR: cannot reach ${S3_URL}" && exit 1)
if [[ -z "${ROOTFS_URL}" ]]; then
@ -105,16 +113,25 @@ else
ROOTFS_URL="${S3_URL%latest}$BUILD"
fi
if [[ "${WHAT}" == "buildroot" ]]; then
BR_BUILD="$(wget -q -O- ${ROOTFS_URL}/build)"
BUILD=${BR_BUILD}
ROOTFS_URL="${ROOTFS_URL}/images"
BR_URL="${ROOTFS_URL}"
else
BR_BUILD="$(wget -q -O- ${ROOTFS_URL}/br_build)"
BR_URL="${BASE_URL}/buildroot/${BRANCH%-gui}/${BR_BUILD}/images"
BUILD="$(wget -q -O- ${ROOTFS_URL}/build)"
fi
case "${WHAT}" in
"buildroot")
BR_BUILD="$(wget -q -O- ${ROOTFS_URL}/build)"
BUILD=${BR_BUILD}
ROOTFS_URL="${ROOTFS_URL}/images"
BR_URL="${ROOTFS_URL}"
;;
"debian")
BR_BUILD="$(wget -q -O- ${ROOTFS_URL}/br_build)"
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 "BUILD=${BUILD}"

Loading…
Cancel
Save