Skip to content

Commit

Permalink
disable multipath in the upgrade path if needed
Browse files Browse the repository at this point in the history
additional check to only add multipath=off if not present
  • Loading branch information
ibrokethecloud authored and w13915984028 committed Oct 25, 2024
1 parent d0d234b commit 4382c2d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions package/upgrade/upgrade_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,18 @@ EOF
GRUBENV_FILE="/oem/grubcustom"
chroot $HOST_DIR /bin/bash -c "if ! [ -f ${GRUBENV_FILE} ]; then touch ${GRUBENV_FILE}; fi"

multiPathEnabled=$(yq '.os.externalStorageConfig.enabled // false' ${HOST_DIR}/oem/harvester.config)
if [ ${multiPathEnabled} == false ]
then
thirdPartyArgs=$(chroot $HOST_DIR grub2-editenv /oem/grubenv list |grep third_party_kernel_args | awk -F"third_party_kernel_args=" '{print $2}')
if [[ ${thirdPartyArgs} != *"multipath=off"* ]]
then
thirdPartyArgs="${thirdPartyArgs} multipath=off"
thirdPartyArgs=$(echo ${thirdPartyArgs} | xargs)
chroot $HOST_DIR grub2-editenv /oem/grubenv set third_party_kernel_args="${thirdPartyArgs}"
fi
fi

umount $tmp_rootfs_mount
rm -rf $tmp_rootfs_squashfs

Expand Down

0 comments on commit 4382c2d

Please sign in to comment.