Skip to content

Conversation

@IAmTheNerdNextDoor
Copy link

Prevents migrate from breaking ToaruOS and making it unusable if used outside of the boot process. This prevents the user from running migrate if migrate isn't in the cmdline at boot and prevents them from migrating again by using an invisible file marker check.

Came up with this for my own local fork of ToaruOS last week.

@klange
Copy link
Owner

klange commented Sep 24, 2025

The usual way I prevent silly mistakes by explorative users is to require a --really argument on things that shouldn't be manual run.

With migrate, I think a better option than having a file sitting around is to detect the conditions for which migration should have already happened, like the root filesystem being a tmpfs.

@IAmTheNerdNextDoor
Copy link
Author

With migrate, I think a better option than having a file sitting around is to detect the conditions for which migration should have already happened, like the root filesystem being a tmpfs.

Hmm, I'll see what I can do there. I'm not sure how to check if it's tmpfs in code but I'll try to find out how.

@klange
Copy link
Owner

klange commented Sep 24, 2025

The main way would be to look at /proc/mounts, though the current format is a bit awkward for parsing, especially with the tree layout.

@IAmTheNerdNextDoor
Copy link
Author

Right, I've tested this and it works on my fork. Lemme know what you think.

@klange
Copy link
Owner

klange commented Sep 24, 2025

I should have mentioned I am thinking of improving the formatting of /proc/mounts, so relying on the current formatting is not a good idea either. Nothing else currently depends on it (that I know of - always possible someone has some Toaru tooling floating around I'm blissfully unaware of). Let me get back to you on this in a bit.

@IAmTheNerdNextDoor
Copy link
Author

I should have mentioned I am thinking of improving the formatting of /proc/mounts, so relying on the current formatting is not a good idea either. Nothing else currently depends on it (that I know of - always possible someone has some Toaru tooling floating around I'm blissfully unaware of). Let me get back to you on this in a bit.

Alright then, looking forward to hearing from you again!

@IAmTheNerdNextDoor
Copy link
Author

Hey, just commenting to see how you are and if there's any updates on this PR. No rush of course!

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