update_kernel.sh: improve cross platform support