kerninst: Sort by version and handle different versions.