repart: try harder to find OS prefix
This teaches repart to look for the root block device both as the backing for /sysroot and for /sysusr/usr. The latter is a new addition, and starts making more sense with the next commit. It's about supporting systems that are shipped with only a /usr/ fs, but where a root fs is allocated and formatted on first boot via systemd-repart (or a similar tool). In this case it's useful to be able to mount the ultimate /usr/ early on without mounting the root fs right-away (simple because the rootfs might not exist yet, and we need the repart data encoded in /usr/ to actually format it). Hence, instead of requiring that we mount /sysroot/ first and /sysroot/usr/ second as we did so far, let's rearrange things slightly: 1. We mount the /usr/ file system we discover to /sysusr/usr/ 2. We mount the root file system we discover to /sysroot/ 3. Once both are established we bind mount /sysusr/usr/ to /sysroot/usr/ And that' it. The first two steps can happen in either order, and we can access /usr/ with or without a rootfs being around. This commit implements nothing of the above. Instead, it teaches systemd-repart to check both /sysroot/ and /sysusr/ for repart drop-ins, and use the first of these hierarchies it finds populated. This way systemd-repart can be spawned once /usr is mounted and it will work correctly without root fs having to exist, or we can invoke it when the root fs is already mounted, where it also will work correctly.
Loading
Please register or sign in to comment