From 22488522cce81dd2acb7b317fc4c9f3b3807b98a Mon Sep 17 00:00:00 2001 From: cailianchun Date: Thu, 8 Sep 2016 09:50:53 +0800 Subject: [PATCH] Merge estuary-d05-3.0b to master. 1. Add d05 support for usb deploy. 2. Add download address args. 3. Create softlink for binary/doc for each platform. 4. Change acpi by default for deploy. Signed-off-by: cailianchun --- build.sh | 64 ++++++++++++++++++++++++------------ deploy/mkpxe.sh | 1 + deploy/mkusbinstall.sh | 1 + deploy/setup.sh | 9 ++--- estuary.txt | 3 +- estuarycfg.json | 1 + include/binary-func.sh | 12 +++++++ include/doc-func.sh | 10 ++++-- submodules/build-platform.sh | 21 ++++++++++++ 9 files changed, 93 insertions(+), 29 deletions(-) diff --git a/build.sh b/build.sh index 152dc3f5..477ba145 100755 --- a/build.sh +++ b/build.sh @@ -26,7 +26,9 @@ if [ x"$CURDIR" = x"$TOPDIR" ]; then exit 1 fi -ESTUARY_INTERAL_FTP=`grep -Po "(?<=download_address: )(.*)" $TOPDIR/estuary.txt` +DOWNLOAD_FTP_ADDR=`grep -Po "(?<=estuary_interal_ftp: )(.*)" $TOPDIR/estuary.txt` +CHINA_INTERAL_FTP_ADDR=`grep -Po "(?<=china_interal_ftp: )(.*)" $TOPDIR/estuary.txt` + export PATH=$TOPDIR:$TOPDIR/include:$TOPDIR/submodules:$TOPDIR/deploy:$PATH export LC_ALL=C @@ -91,10 +93,15 @@ Options: --capacity: target distro partition size, default unit is GB --mac: target board mac address, --mac must be specified if deploy type is pxe + -a: download address, China or Estuary(default Estuary) + Example: ./estuary/build.sh --help ./estuary/build.sh -f ./estuary/estuarycfg.json + ./estuary/build.sh -f ./estuary/estuarycfg.json -a Estuary + ./estuary/build.sh -f ./estuary/estuarycfg.json -a China + ./estuary/build.sh -p QEMU -d Ubuntu ./estuary/build.sh -f ./estuary/estuarycfg.json --builddir=./workspace ./estuary/build.sh --file=./estuary/estuarycfg.json --builddir=./workspace @@ -133,6 +140,7 @@ do --deploy) DEPLOY[${#DEPLOY[@]}]=$ac_optarg ;; --capacity) CAPACITY=$ac_optarg ;; --mac) BOARDS_MAC=$ac_optarg ;; + -a) if [ x"$ac_optarg" = x"China" ]; then DOWNLOAD_FTP_ADDR=$CHINA_INTERAL_FTP_ADDR; fi ;; *) Usage ; echo "Unknown option $1" ; exit 1 ;; esac @@ -217,7 +225,7 @@ if ! check_ftp_update $estuary_version ./estuary; then echo "##############################################################################" echo "# Update estuary configuration file" echo "##############################################################################" - if ! update_ftp_cfgfile $estuary_version $ESTUARY_INTERAL_FTP ./estuary; then + if ! update_ftp_cfgfile $estuary_version $DOWNLOAD_FTP_ADDR ./estuary; then echo -e "\033[31mError! Update Estuary FTP configuration file failed!\033[0m" ; exit 1 fi rm -f distro/.*.sum distro/*.sum 2>/dev/null @@ -233,7 +241,7 @@ if [ x"$LOCALARCH" = x"x86_64" ]; then echo "# Download/Uncompress toolchain" echo "##############################################################################" mkdir -p toolchain - download_toolchains $ESTUARY_FTP_CFGFILE $ESTUARY_INTERAL_FTP toolchain + download_toolchains $ESTUARY_FTP_CFGFILE $DOWNLOAD_FTP_ADDR toolchain if [[ $? != 0 ]]; then echo -e "\033[31mError! Download toolchains failed!\033[0m" >&2 ; exit 1 fi @@ -311,7 +319,7 @@ if [ x"$DISTROS" != x"" ]; then echo "# Download distros (distros: $DISTROS)" echo "##############################################################################" mkdir -p distro - download_distros $ESTUARY_FTP_CFGFILE $ESTUARY_INTERAL_FTP distro $DISTROS + download_distros $ESTUARY_FTP_CFGFILE $DOWNLOAD_FTP_ADDR distro $DISTROS if [[ $? != 0 ]]; then echo -e "\033[31mError! Download distros failed!\033[0m" ; exit 1 fi @@ -335,7 +343,7 @@ if [ x"$PLATFORMS" != x"" ]; then echo "# Download binaries" echo "##############################################################################" mkdir -p prebuild - download_binaries $ESTUARY_FTP_CFGFILE $ESTUARY_INTERAL_FTP prebuild + download_binaries $ESTUARY_FTP_CFGFILE $DOWNLOAD_FTP_ADDR prebuild if [[ $? != 0 ]]; then echo -e "\033[31mError! Download binaries failed!\033[0m" ; exit 1 fi @@ -395,25 +403,10 @@ if [ x"$PLATFORMS" != x"" ]; then fi echo "" done - echo "Build estuary done!" + echo "Build platfroms done!" echo "" fi -################################################################################### -# Create distros softlink -################################################################################### -if [ x"$DISTROS" != x"" ]; then - echo "##############################################################################" - echo "# Create distros softlink" - echo "##############################################################################" - distros=`echo $DISTROS | tr ',' ' '` - binary_dir=$BUILD_DIR/binary/arm64 - for distro in ${distros[*]}; do - rm -f $binary_dir/${distro}_ARM64.tar.gz 2>/dev/null - ln -s ../../distro/${distro}_ARM64.tar.gz $binary_dir/${distro}_ARM64.tar.gz - done -fi - ################################################################################### # Quick Deployment ################################################################################### @@ -454,4 +447,33 @@ if echo $PLATFORMS | tr ',' ' ' | grep -w QEMU >/dev/null 2>&1; then echo "##############################################################################" build-qemu.sh --output=$BUILD_DIR --distros=$DISTROS fi +echo "" + +################################################################################### +# Create binary softlink +################################################################################### +echo "##############################################################################" +echo "# Create binary/distro softlink" +echo "##############################################################################" +# Please note that the platform directory must be in the same level directory with arm64! +# We'll not check the softlink under arm64 (copy it directly). +platforms=`echo $PLATFORMS | tr ',' ' '` +distros=`echo $DISTROS | tr ',' ' '` +for plat in ${platforms[*]}; do + plat_dir=$BUILD_DIR/binary/$plat + mkdir -p $plat_dir 2>/dev/null + pushd $plat_dir >/dev/null + find . -maxdepth 1 -type l -print | xargs rm -f + find ../arm64/ -maxdepth 1 -type f | xargs -i ln -s {} + find ../arm64 -type l | xargs -i cp -a {} ./ + popd >/dev/null +done + +echo "Create binary/distro softlink done!" +echo "" + +################################################################################### +# +################################################################################### +echo "Build Estuary done!" diff --git a/deploy/mkpxe.sh b/deploy/mkpxe.sh index 325d4780..a5e2111c 100755 --- a/deploy/mkpxe.sh +++ b/deploy/mkpxe.sh @@ -25,6 +25,7 @@ SERVER_IP= D02_CMDLINE="rdinit=/init crashkernel=256M@32M console=ttyS0,115200 earlycon=uart8250,mmio32,0x80300000 pcie_aspm=off" D03_CMDLINE="rdinit=/init console=ttyS0,115200 earlycon=hisilpcuart,mmio,0xa01b0000,0,0x2f8 pcie_aspm=off" +D05_CMDLINE="rdinit=/init console=ttyAMA0,115200 earlycon=pl011,mmio,0x602B0000 pcie_aspm=off crashkernel=256M@32M acpi=force" HiKey_CMDLINE="rdinit=/init console=tty0 console=ttyAMA3,115200 rootwait rw loglevel=8 efi=noruntime" ################################################################################### diff --git a/deploy/mkusbinstall.sh b/deploy/mkusbinstall.sh index 56e1c552..a6b5f641 100755 --- a/deploy/mkusbinstall.sh +++ b/deploy/mkusbinstall.sh @@ -22,6 +22,7 @@ WORKSPACE= D02_CMDLINE="rdinit=/init crashkernel=256M@32M console=ttyS0,115200 earlycon=uart8250,mmio32,0x80300000 pcie_aspm=off" D03_CMDLINE="rdinit=/init console=ttyS0,115200 earlycon=hisilpcuart,mmio,0xa01b0000,0,0x2f8 pcie_aspm=off" +D05_CMDLINE="rdinit=/init console=ttyAMA0,115200 earlycon=pl011,mmio,0x602B0000 pcie_aspm=off crashkernel=256M@32M acpi=force" HiKey_CMDLINE="rdinit=/init console=tty0 console=ttyAMA3,115200 rootwait rw loglevel=8 efi=noruntime" ################################################################################### diff --git a/deploy/setup.sh b/deploy/setup.sh index 7551b94e..079c6f02 100755 --- a/deploy/setup.sh +++ b/deploy/setup.sh @@ -7,13 +7,14 @@ echo 0 > /proc/sys/kernel/printk D02_CMDLINE="rdinit=/init crashkernel=256M@32M console=ttyS0,115200 earlycon=uart8250,mmio32,0x80300000 pcie_aspm=off ip=dhcp" D03_CMDLINE="rdinit=/init console=ttyS0,115200 earlycon=hisilpcuart,mmio,0xa01b0000,0,0x2f8 pcie_aspm=off ip=dhcp" +D05_CMDLINE="rdinit=/init console=ttyAMA0,115200 earlycon=pl011,mmio,0x602B0000 pcie_aspm=off crashkernel=256M@32M acpi=force ip=dhcp" HiKey_CMDLINE="rdinit=/init console=tty0 console=ttyAMA3,115200 rootwait rw loglevel=8 efi=noruntime" ################################################################################### # Global variable ################################################################################### INSTALL_TYPE="" -ACPI="NO" +ACPI="YES" ACPI_ARG="acpi=force" PART_BASE_INDEX=2 @@ -187,9 +188,9 @@ sleep 1s ################################################################################### # Select ACPI choice ################################################################################### -read -p "Use ACPI by force? y/n (n by default)" c -if [ x"$c" = x"y" ]; then - ACPI="YES" +read -p "Use ACPI by force? y/n (y by default)" c +if [ x"$c" = x"n" ]; then + ACPI="NO" fi ################################################################################### diff --git a/estuary.txt b/estuary.txt index f4e1aba8..d4256190 100644 --- a/estuary.txt +++ b/estuary.txt @@ -1 +1,2 @@ -download_address: http://open-estuary.org/download/AllDownloads/FolderNotVisibleOnWebsite/EstuaryInternalConfig +estuary_interal_ftp: http://open-estuary.org/download/AllDownloads/FolderNotVisibleOnWebsite/EstuaryInternalConfig +china_interal_ftp: ftp://117.78.41.188/FolderNotVisibleOnWebsite/EstuaryInternalConfig diff --git a/estuarycfg.json b/estuarycfg.json index 8d703600..903f95f2 100644 --- a/estuarycfg.json +++ b/estuarycfg.json @@ -2,6 +2,7 @@ "system":[ {"platform":"D02","install":"yes"}, {"platform":"D03","install":"yes"}, +{"platform":"D05","install":"no"}, {"platform":"HiKey","install":"yes"}, {"platform":"QEMU","install":"no"} ], diff --git a/include/binary-func.sh b/include/binary-func.sh index ba59a546..677b666a 100755 --- a/include/binary-func.sh +++ b/include/binary-func.sh @@ -91,6 +91,18 @@ Copy_D03_binaries() ) } +################################################################################### +# Copy_D05_binaries +################################################################################### +Copy_D05_binaries() +{ + ( + src_dir=$1 + target_dir=$2 + return 0 + ) +} + ################################################################################### # Copy_HiKey_binaries ################################################################################### diff --git a/include/doc-func.sh b/include/doc-func.sh index b613ce4a..d7d46dac 100755 --- a/include/doc-func.sh +++ b/include/doc-func.sh @@ -28,14 +28,18 @@ copy_all_docs() src_dir=$2 target_dir=$3 + mkdir -p $target_dir/arm64 + copy_plat_doc All $doc_src_dir $target_dir/arm64 || return 1 + for plat in ${platfroms[*]}; do mkdir -p $target_dir/$plat copy_plat_doc $plat $doc_src_dir $target_dir/$plat || return 1 + pushd $target_dir/$plat >/dev/null + find . -maxdepth 1 -type l -print | xargs rm -f + find ../arm64/ -maxdepth 1 -type f | xargs -i ln -s {} + popd >/dev/null done - mkdir -p $target_dir/arm64 - copy_plat_doc All $doc_src_dir $target_dir/arm64 || return 1 - return 0 ) } diff --git a/submodules/build-platform.sh b/submodules/build-platform.sh index 918c43cc..f27a46e3 100755 --- a/submodules/build-platform.sh +++ b/submodules/build-platform.sh @@ -166,6 +166,27 @@ fi echo "- Create distros done!" echo "" +################################################################################### +# Create distros softlink +################################################################################### +distros=`echo $DISTROS | tr ',' ' '` +if [ x"$distros" != x"" ]; then + echo "---------------------------------------------------------------" + echo "- Create distros softlink (distros: $DISTROS)" + echo "---------------------------------------------------------------" + + binary_dir=$OUTPUT/binary/arm64 + mkdir -p $binary_dir 2>/dev/null + pushd $binary_dir >/dev/null + for distro in ${distros[*]}; do + rm -f ${distro}_ARM64.tar.gz 2>/dev/null + ln -s ../../distro/${distro}_ARM64.tar.gz + done + popd >/dev/null + echo "- Create distros softlink done!" + echo "" +fi + ################################################################################### # End ###################################################################################