[Concept] [PATCH v2 08/15] boot: Move preparing bootdev into a function