From 7472cd303e622fe3dba3202d97f9909eb8436081 Mon Sep 17 00:00:00 2001 From: lguohan Date: Fri, 16 Jun 2017 00:05:41 -0700 Subject: [PATCH] [image]: load platform specific settings in sonic-to-sonic upgrade (#710) --- .../dell/x86_64-dell_s6000_s1220-r0/installer.conf | 4 ++++ installer/x86_64/install.sh | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/installer.conf b/device/dell/x86_64-dell_s6000_s1220-r0/installer.conf index eb135bee0f..a8fef61859 100644 --- a/device/dell/x86_64-dell_s6000_s1220-r0/installer.conf +++ b/device/dell/x86_64-dell_s6000_s1220-r0/installer.conf @@ -1,5 +1,7 @@ ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="processor.max_cstate=1 intel_idle.max_cstate=0" +if [ "$install_env" = "onie" ]; then + echo "Replace ONIE reboot with Dell reset commands" # set I2C GPIO mux @@ -21,3 +23,5 @@ i2cset -y 0 0x31 1 0xfd EOF chmod a+x /sbin/reboot + +fi diff --git a/installer/x86_64/install.sh b/installer/x86_64/install.sh index 18669893bc..f7d1dbb29a 100755 --- a/installer/x86_64/install.sh +++ b/installer/x86_64/install.sh @@ -36,7 +36,14 @@ if [ $(id -u) -ne 0 ] fi # get running machine from conf file -[ -r /etc/machine.conf ] && . /etc/machine.conf +if [ -r /etc/machine.conf ]; then + . /etc/machine.conf +elif [ -r /host/machine.conf ]; then + . /host/machine.conf +else + echo "cannot find machine.conf" + exit 1 +fi echo "onie_platform: $onie_platform" @@ -57,9 +64,10 @@ if [ -d "/etc/sonic" ]; then else echo "Installing SONiC in ONIE" install_env="onie" - [ -r platforms/$onie_platform ] && source platforms/$onie_platform fi +[ -r platforms/$onie_platform ] && . platforms/$onie_platform + # Install demo on same block device as ONIE onie_dev=$(blkid | grep ONIE-BOOT | head -n 1 | awk '{print $1}' | sed -e 's/:.*$//') blk_dev=$(echo $onie_dev | sed -e 's/[1-9][0-9]*$//' | sed -e 's/\([0-9]\)\(p\)/\1/')