From 379e637f1d8035f68c63ad8928c004ca74418b13 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Tue, 28 Mar 2017 17:39:33 +0000 Subject: [PATCH 1/3] Move platform-specific ONIE installer config files with rest of device-specific files --- .gitignore | 3 ++- build_image.sh | 12 ++++++++++++ .../x86_64-accton_as7512_32x-r0/installer.conf | 0 .../x86_64-centec_e582_48x6q-r0/installer.conf | 0 .../dell/x86_64-dell_s6000_s1220-r0/installer.conf | 0 .../dell/x86_64-dell_s6100_c2538-r0/installer.conf | 0 .../dell/x86_64-dell_z9100_c2538-r0/installer.conf | 0 .../x86_64-ew_es6220_x48q2h4-r0/installer.conf | 0 .../x86_64-facebook_wedge100-r0/installer.conf | 0 .../ingrasys/x86_64-ingrasys_s9100-r0/installer.conf | 0 .../mellanox/x86_64-mlnx_msn2700-r0/installer.conf | 0 .../x86_64-mlnx_x86-r5.0.1400/installer.conf | 0 12 files changed, 14 insertions(+), 1 deletion(-) rename installer/x86_64/platforms/x86_64-accton_as7512_32x-r0 => device/accton/x86_64-accton_as7512_32x-r0/installer.conf (100%) rename installer/x86_64/platforms/x86_64-centec_e582_48x6q-r0 => device/centec/x86_64-centec_e582_48x6q-r0/installer.conf (100%) rename installer/x86_64/platforms/x86_64-dell_s6000_s1220-r0 => device/dell/x86_64-dell_s6000_s1220-r0/installer.conf (100%) rename installer/x86_64/platforms/x86_64-dell_s6100_c2538-r0 => device/dell/x86_64-dell_s6100_c2538-r0/installer.conf (100%) rename installer/x86_64/platforms/x86_64-dell_z9100_c2538-r0 => device/dell/x86_64-dell_z9100_c2538-r0/installer.conf (100%) rename installer/x86_64/platforms/x86_64-ew_es6220_x48q2h4-r0 => device/embedway/x86_64-ew_es6220_x48q2h4-r0/installer.conf (100%) rename installer/x86_64/platforms/x86_64-facebook_wedge100-r0 => device/facebook/x86_64-facebook_wedge100-r0/installer.conf (100%) rename installer/x86_64/platforms/x86_64-ingrasys_s9100-r0 => device/ingrasys/x86_64-ingrasys_s9100-r0/installer.conf (100%) rename installer/x86_64/platforms/x86_64-mlnx_msn2700-r0 => device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf (100%) rename installer/x86_64/platforms/x86_64-mlnx_x86-r5.0.1400 => device/mellanox/x86_64-mlnx_x86-r5.0.1400/installer.conf (100%) diff --git a/.gitignore b/.gitignore index 81a7535baec..00f97edcec9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Build system related .platform -.sku # Build artifacts fsroot/ @@ -39,3 +38,5 @@ dockers/docker-base/Dockerfile platform/*/docker-syncd-*/Dockerfile platform/*/docker-syncd-*-rpc/Dockerfile +# Installer-related files and directories +installer/x86_64/platforms/ diff --git a/build_image.sh b/build_image.sh index ab2e85b4836..2da70ad57cf 100755 --- a/build_image.sh +++ b/build_image.sh @@ -27,6 +27,18 @@ if [ "$IMAGE_TYPE" = "onie" ]; then echo "Build ONIE installer" mkdir -p `dirname $OUTPUT_ONIE_IMAGE` sudo rm -f $OUTPUT_ONIE_IMAGE + + # Copy platform-specific ONIE installer config files where onie-mk-demo.sh expects them + rm -rf ./installer/x86_64/platforms/ + mkdir -p ./installer/x86_64/platforms/ + for VENDOR in `ls ./device`; do + for PLATFORM in `ls ./device/$VENDOR`; do + if [ -f ./device/$VENDOR/$PLATFORM/installer.conf ]; then + cp ./device/$VENDOR/$PLATFORM/installer.conf ./installer/x86_64/platforms/$PLATFORM + fi + done + done + ## Generate an ONIE installer image ## Note: Don't leave blank between lines. It is single line command. ./onie-mk-demo.sh $TARGET_PLATFORM $TARGET_MACHINE $TARGET_PLATFORM-$TARGET_MACHINE-$ONIEIMAGE_VERSION \ diff --git a/installer/x86_64/platforms/x86_64-accton_as7512_32x-r0 b/device/accton/x86_64-accton_as7512_32x-r0/installer.conf similarity index 100% rename from installer/x86_64/platforms/x86_64-accton_as7512_32x-r0 rename to device/accton/x86_64-accton_as7512_32x-r0/installer.conf diff --git a/installer/x86_64/platforms/x86_64-centec_e582_48x6q-r0 b/device/centec/x86_64-centec_e582_48x6q-r0/installer.conf similarity index 100% rename from installer/x86_64/platforms/x86_64-centec_e582_48x6q-r0 rename to device/centec/x86_64-centec_e582_48x6q-r0/installer.conf diff --git a/installer/x86_64/platforms/x86_64-dell_s6000_s1220-r0 b/device/dell/x86_64-dell_s6000_s1220-r0/installer.conf similarity index 100% rename from installer/x86_64/platforms/x86_64-dell_s6000_s1220-r0 rename to device/dell/x86_64-dell_s6000_s1220-r0/installer.conf diff --git a/installer/x86_64/platforms/x86_64-dell_s6100_c2538-r0 b/device/dell/x86_64-dell_s6100_c2538-r0/installer.conf similarity index 100% rename from installer/x86_64/platforms/x86_64-dell_s6100_c2538-r0 rename to device/dell/x86_64-dell_s6100_c2538-r0/installer.conf diff --git a/installer/x86_64/platforms/x86_64-dell_z9100_c2538-r0 b/device/dell/x86_64-dell_z9100_c2538-r0/installer.conf similarity index 100% rename from installer/x86_64/platforms/x86_64-dell_z9100_c2538-r0 rename to device/dell/x86_64-dell_z9100_c2538-r0/installer.conf diff --git a/installer/x86_64/platforms/x86_64-ew_es6220_x48q2h4-r0 b/device/embedway/x86_64-ew_es6220_x48q2h4-r0/installer.conf similarity index 100% rename from installer/x86_64/platforms/x86_64-ew_es6220_x48q2h4-r0 rename to device/embedway/x86_64-ew_es6220_x48q2h4-r0/installer.conf diff --git a/installer/x86_64/platforms/x86_64-facebook_wedge100-r0 b/device/facebook/x86_64-facebook_wedge100-r0/installer.conf similarity index 100% rename from installer/x86_64/platforms/x86_64-facebook_wedge100-r0 rename to device/facebook/x86_64-facebook_wedge100-r0/installer.conf diff --git a/installer/x86_64/platforms/x86_64-ingrasys_s9100-r0 b/device/ingrasys/x86_64-ingrasys_s9100-r0/installer.conf similarity index 100% rename from installer/x86_64/platforms/x86_64-ingrasys_s9100-r0 rename to device/ingrasys/x86_64-ingrasys_s9100-r0/installer.conf diff --git a/installer/x86_64/platforms/x86_64-mlnx_msn2700-r0 b/device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf similarity index 100% rename from installer/x86_64/platforms/x86_64-mlnx_msn2700-r0 rename to device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf diff --git a/installer/x86_64/platforms/x86_64-mlnx_x86-r5.0.1400 b/device/mellanox/x86_64-mlnx_x86-r5.0.1400/installer.conf similarity index 100% rename from installer/x86_64/platforms/x86_64-mlnx_x86-r5.0.1400 rename to device/mellanox/x86_64-mlnx_x86-r5.0.1400/installer.conf From 61279bd6ae6a9fafcc86f544b5822d86585cc617 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Tue, 28 Mar 2017 20:53:48 +0000 Subject: [PATCH 2/3] Merge contents of dell-s6000-replace-reboot.sh into s6000 installer conf file --- .../x86_64-dell_s6000_s1220-r0/installer.conf | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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 f778372ded1..eb135bee0ff 100644 --- a/device/dell/x86_64-dell_s6000_s1220-r0/installer.conf +++ b/device/dell/x86_64-dell_s6000_s1220-r0/installer.conf @@ -1,2 +1,23 @@ ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="processor.max_cstate=1 intel_idle.max_cstate=0" -./dell-s6000-replace-reboot.sh + +echo "Replace ONIE reboot with Dell reset commands" + +# set I2C GPIO mux +echo 1 > /sys/class/gpio/export +echo 2 > /sys/class/gpio/export +echo out > /sys/class/gpio/gpio1/direction +echo out > /sys/class/gpio/gpio2/direction +echo 0 > /sys/class/gpio/gpio1/value +echo 0 > /sys/class/gpio/gpio2/value + +# replace the original reboot binary with the following command +# sync flushes file system buffers +# i2cset command triggers a hard system reboot, required by ASIC to operate correctly +rm /sbin/reboot +cat <> /sbin/reboot +#!/bin/sh +sync +i2cset -y 0 0x31 1 0xfd +EOF + +chmod a+x /sbin/reboot From a008596229c06cb038dcfdb6cee859fa07466e76 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Tue, 28 Mar 2017 20:55:03 +0000 Subject: [PATCH 3/3] Remove dell-s6000-replace-reboot.sh --- installer/x86_64/dell-s6000-replace-reboot.sh | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100755 installer/x86_64/dell-s6000-replace-reboot.sh diff --git a/installer/x86_64/dell-s6000-replace-reboot.sh b/installer/x86_64/dell-s6000-replace-reboot.sh deleted file mode 100755 index 5854133cc4a..00000000000 --- a/installer/x86_64/dell-s6000-replace-reboot.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -echo "Replace ONIE reboot with Dell reset commands" - -# set I2C GPIO mux -echo 1 > /sys/class/gpio/export -echo 2 > /sys/class/gpio/export -echo out > /sys/class/gpio/gpio1/direction -echo out > /sys/class/gpio/gpio2/direction -echo 0 > /sys/class/gpio/gpio1/value -echo 0 > /sys/class/gpio/gpio2/value - -# replace the original reboot binary with the following command -# sync flushes file system buffers -# i2cset command triggers a hard system reboot, required by ASIC to operate correctly -rm /sbin/reboot -cat <> /sbin/reboot -#!/bin/sh -sync -i2cset -y 0 0x31 1 0xfd -EOF - -chmod a+x /sbin/reboot