2019-07-26 00:06:41 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-09-11 12:12:10 -05:00
|
|
|
# Copyright (C) Marvell Inc
|
2019-07-26 00:06:41 -05:00
|
|
|
#
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ -d "/etc/sonic" ]; then
|
|
|
|
echo "Installing SONiC in SONiC"
|
|
|
|
install_env="sonic"
|
|
|
|
elif grep -Fxqs "DISTRIB_ID=onie" /etc/lsb-release > /dev/null
|
|
|
|
then
|
|
|
|
echo "Installing SONiC in ONIE"
|
|
|
|
install_env="onie"
|
|
|
|
else
|
|
|
|
echo "Installing SONiC in BUILD"
|
|
|
|
install_env="build"
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $(dirname $0)
|
|
|
|
if [ -r ./machine.conf ]; then
|
|
|
|
. ./machine.conf
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -r ./onie-image-armhf.conf ]; then
|
|
|
|
. ./onie-image-armhf.conf
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "Installer: platform: $platform"
|
|
|
|
|
2019-09-11 12:12:10 -05:00
|
|
|
# install_uimage will be overriden from platform.conf as it is non generic
|
2019-07-26 00:06:41 -05:00
|
|
|
install_uimage() {
|
|
|
|
echo "Copying uImage to NOR flash:"
|
|
|
|
flashcp -v demo-${platform}.itb $mtd_dev
|
|
|
|
}
|
|
|
|
|
2019-09-11 12:12:10 -05:00
|
|
|
# hw_load will be overriden from platform.conf as it is non generic
|
2019-07-26 00:06:41 -05:00
|
|
|
hw_load() {
|
|
|
|
echo "cp.b $img_start \$loadaddr $img_sz"
|
|
|
|
}
|
|
|
|
|
|
|
|
. ./platform.conf
|
|
|
|
|
2019-09-11 12:12:10 -05:00
|
|
|
install_uimage
|
2019-07-26 00:06:41 -05:00
|
|
|
|
2019-09-11 12:12:10 -05:00
|
|
|
hw_load_str="$(hw_load)"
|
2019-07-26 00:06:41 -05:00
|
|
|
|
|
|
|
cd /
|
|
|
|
|
|
|
|
# Set NOS mode if available. For manufacturing diag installers, you
|
|
|
|
# probably want to skip this step so that the system remains in ONIE
|
|
|
|
# "installer" mode for installing a true NOS later.
|
|
|
|
if [ -x /bin/onie-nos-mode ] ; then
|
|
|
|
/bin/onie-nos-mode -s
|
|
|
|
fi
|