Skip to content

Commit

Permalink
Merge estuary-d05-3.0b to master.
Browse files Browse the repository at this point in the history
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 <armstar@sina.com>
  • Loading branch information
cailianchun committed Sep 8, 2016
1 parent 202e08c commit 2248852
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 29 deletions.
64 changes: 43 additions & 21 deletions build.sh
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
###################################################################################
Expand Down Expand Up @@ -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!"

1 change: 1 addition & 0 deletions deploy/mkpxe.sh
Expand Up @@ -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"

###################################################################################
Expand Down
1 change: 1 addition & 0 deletions deploy/mkusbinstall.sh
Expand Up @@ -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"

###################################################################################
Expand Down
9 changes: 5 additions & 4 deletions deploy/setup.sh
Expand Up @@ -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
Expand Down Expand Up @@ -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

###################################################################################
Expand Down
3 changes: 2 additions & 1 deletion 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
1 change: 1 addition & 0 deletions estuarycfg.json
Expand Up @@ -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"}
],
Expand Down
12 changes: 12 additions & 0 deletions include/binary-func.sh
Expand Up @@ -91,6 +91,18 @@ Copy_D03_binaries()
)
}

###################################################################################
# Copy_D05_binaries <src_dir> <target_dir>
###################################################################################
Copy_D05_binaries()
{
(
src_dir=$1
target_dir=$2
return 0
)
}

###################################################################################
# Copy_HiKey_binaries <src_dir> <target_dir>
###################################################################################
Expand Down
10 changes: 7 additions & 3 deletions include/doc-func.sh
Expand Up @@ -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
)
}
Expand Down
21 changes: 21 additions & 0 deletions submodules/build-platform.sh
Expand Up @@ -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
###################################################################################
Expand Down

0 comments on commit 2248852

Please sign in to comment.