How to calculate the hash value of the kernel image of another partition after the system is powered on?

hi everyone:
I have now made two partitions, such as A and B. The system starts from partition A, but I don't know whether partition B is good. I want to check the hash of the kernel image of partition B and compare it with partition A. Is there any solution .