Skip to content

Commit

Permalink
Revert "add onie image install's platform verification (sonic-net#8814)"
Browse files Browse the repository at this point in the history
This reverts commit ba2968d.
  • Loading branch information
TACappleman committed Dec 15, 2021
1 parent a60d011 commit f00e5f7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 93 deletions.
26 changes: 0 additions & 26 deletions build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,30 +87,11 @@ generate_onie_installer_image()
$ONIE_INSTALLER_PAYLOAD
}

# Generate asic-specific device list
generate_device_list()
{
local platforms_asic=$1

# Create an empty function, and later append to it
echo -n > $platforms_asic

for d in `find -L ./device -maxdepth 2 -mindepth 2 -type d`; do
if [ -f $d/platform_asic ]; then
if [ "$CONFIGURED_PLATFORM" = "generic" ] || grep -Fxq "$CONFIGURED_PLATFORM" $d/platform_asic; then
echo "${d##*/}" >> "$platforms_asic";
fi;
fi;
done
}

if [ "$IMAGE_TYPE" = "onie" ]; then
echo "Build ONIE installer"
mkdir -p `dirname $OUTPUT_ONIE_IMAGE`
sudo rm -f $OUTPUT_ONIE_IMAGE

generate_device_list "./installer/$TARGET_PLATFORM/platforms_asic"

generate_onie_installer_image

## Build a raw partition dump image using the ONIE installer that can be
Expand All @@ -122,8 +103,6 @@ elif [ "$IMAGE_TYPE" = "raw" ]; then
mkdir -p `dirname $OUTPUT_RAW_IMAGE`
sudo rm -f $OUTPUT_RAW_IMAGE

generate_device_list "./installer/$TARGET_PLATFORM/platforms_asic"

generate_onie_installer_image

echo "Creating SONiC raw partition : $OUTPUT_RAW_IMAGE of size $RAW_IMAGE_DISK_SIZE MB"
Expand Down Expand Up @@ -155,8 +134,6 @@ elif [ "$IMAGE_TYPE" = "raw" ]; then

elif [ "$IMAGE_TYPE" = "kvm" ]; then

generate_device_list "./installer/$TARGET_PLATFORM/platforms_asic"

generate_onie_installer_image
# Generate single asic KVM image
generate_kvm_image
Expand Down Expand Up @@ -193,9 +170,6 @@ elif [ "$IMAGE_TYPE" = "aboot" ]; then
zip -g $ABOOT_BOOT_IMAGE version
rm version

generate_device_list ".platforms_asic"
zip -g $OUTPUT_ABOOT_IMAGE .platforms_asic

zip -g $OUTPUT_ABOOT_IMAGE $ABOOT_BOOT_IMAGE
rm $ABOOT_BOOT_IMAGE
if [ "$SONIC_ENABLE_IMAGE_SIGNATURE" = "y" ]; then
Expand Down
22 changes: 0 additions & 22 deletions installer/arm64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,6 @@ VAR_LOG_SIZE=4096

[ -r platforms/$onie_platform ] && . platforms/$onie_platform

# Verify image platform is inside devices list
if [ "$install_env" = "onie" ]; then
if ! grep -Fxq "$onie_platform" platforms_asic; then
echo "The image you're trying to install is of a different ASIC type as the running platform's ASIC"
while true; do
read -r -p "Do you still wish to install this image? [y/n]: " input
case $input in
[Yy])
echo "Force installing..."
break
;;
[Nn])
echo "Exited installation!"
exit 1
;;
*)
echo "Error: Invalid input"
;;
esac
done
fi
fi

# If running in ONIE
if [ "$install_env" = "onie" ]; then
Expand Down
22 changes: 0 additions & 22 deletions installer/armhf/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,6 @@ VAR_LOG_SIZE=4096

[ -r platforms/$onie_platform ] && . platforms/$onie_platform

# Verify image platform is inside devices list
if [ "$install_env" = "onie" ]; then
if ! grep -Fxq "$onie_platform" platforms_asic; then
echo "The image you're trying to install is of a different ASIC type as the running platform's ASIC"
while true; do
read -r -p "Do you still wish to install this image? [y/n]: " input
case $input in
[Yy])
echo "Force installing..."
break
;;
[Nn])
echo "Exited installation!"
exit 1
;;
*)
echo "Error: Invalid input"
;;
esac
done
fi
fi

# If running in ONIE
if [ "$install_env" = "onie" ]; then
Expand Down
23 changes: 0 additions & 23 deletions installer/x86_64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,29 +92,6 @@ VAR_LOG_SIZE=4096

[ -r platforms/$onie_platform ] && . platforms/$onie_platform

# Verify image platform is inside devices list
if [ "$install_env" = "onie" ]; then
if ! grep -Fxq "$onie_platform" platforms_asic; then
echo "The image you're trying to install is of a different ASIC type as the running platform's ASIC"
while true; do
read -r -p "Do you still wish to install this image? [y/n]: " input
case $input in
[Yy])
echo "Force installing..."
break
;;
[Nn])
echo "Exited installation!"
exit 1
;;
*)
echo "Error: Invalid input"
;;
esac
done
fi
fi

# Pick up console port and speed from install enviroment if not defined yet.
# Console port and speed setting in cmdline is like "console=ttyS0,9600n",
# so we can use pattern 'console=ttyS[0-9]+,[0-9]+' to match it.
Expand Down

0 comments on commit f00e5f7

Please sign in to comment.