main/bash: fix application of patches

make sure all paches are properly applied

(cherry picked from commit 15b4fa33117ac233ea3deb3927348ae3a45cd08e)