Skip to content

Commit

Permalink
1. Change a list of files into one file; 2. Add the platforms_asic to…
Browse files Browse the repository at this point in the history
… aboot image
  • Loading branch information
wen587 committed Sep 23, 2021
1 parent a81ccbc commit e53fc70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
11 changes: 8 additions & 3 deletions build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ generate_onie_device_list()
rm -rf ./installer/x86_64/devices/
mkdir -p ./installer/x86_64/devices/
for d in `find -L ./device -maxdepth 2 -mindepth 2 -type d`; do
if [ -f $d/platform_asic ] && grep -Fxq "$CONFIGURED_PLATFORM" $d/platform_asic; then
touch ./installer/x86_64/devices/${d##*/};
fi;
if [ -f $d/platform_asic ] && grep -Fxq "$CONFIGURED_PLATFORM" $d/platform_asic; then
echo "${d##*/}" >> ./installer/x86_64/devices/platforms_asic;
fi;
done
}

Expand Down Expand Up @@ -183,6 +183,11 @@ elif [ "$IMAGE_TYPE" = "aboot" ]; then
zip -g $ABOOT_BOOT_IMAGE version
rm version

generate_onie_device_list
cp ./installer/x86_64/devices/platforms_asic .platforms_asic
zip -g $OUTPUT_ABOOT_IMAGE .platforms_asic
rm .platforms_asic

zip -g $OUTPUT_ABOOT_IMAGE $ABOOT_BOOT_IMAGE
rm $ABOOT_BOOT_IMAGE
if [ "$SONIC_ENABLE_IMAGE_SIGNATURE" = "y" ]; then
Expand Down
9 changes: 4 additions & 5 deletions installer/x86_64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ VAR_LOG_SIZE=4096

# Verify image platform is inside devices list
# Temporarily set TIMEOUT as 10 seconds
if [ "$install_env" = "onie" ] && [ -d devices ]; then
if [ ! -f devices/$onie_platform ]; then
if [ "$install_env" = "onie" ]; then
if ! grep -Fxq "$onie_platform" devices/platforms_asic; then
TIMEOUT=10
echo "The image you're trying to install is of a different platform as the running plaform"
echo "The image you're trying to install is of a different platform as the running platform"
while true; do
read -t $TIMEOUT -r -p "Do you still wish to install this image?[Y/n]" input
read -t $TIMEOUT -r -p "Do you still wish to install this image? [y/n]: " input
STATUS=$?
if test $STATUS -eq 0; then
case $input in
Expand All @@ -121,7 +121,6 @@ if [ "$install_env" = "onie" ] && [ -d devices ]; then
exit 1
fi
done

fi
fi

Expand Down

0 comments on commit e53fc70

Please sign in to comment.