[Concept] [PATCH v2 09/18] boot: Move type and OS checking into a new function