Skip to content

Conversation

@aanderse
Copy link
Contributor

In containerized or virtualized environments, standard mount point directories may not exist at boot. Ensure they are created before attempting to mount.


when running finix in a container we can skip stage 1 (initramfs) entirely - this change let's me boot directly into finit in my stage 2 without the need for a shell script to mkdir and then call finit! 🚀

In containerized or virtualized environments, standard mount point
directories may not exist at boot.  Ensure they are created before
attempting to mount.
Comment on lines +527 to +528
if (!fisdir(fs[i].file))
mkdir(fs[i].file, 0755);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly run Finit on systems with read-only root (squashfs), so I'm used to it the hard way, but this is better, much more user-friendly 😃

What do you think about skipping fisdir() and just:

if (mkdir(...) && errno != EEXIST)
    warn("Failed creating mountpoint %s", ...); // strerror(errno) is appended

This may bombard the user with a lot of warnings, but at bringup you want to know, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants