-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add finit.fstab= kernel cmdline param for finit #224
Comments
In the meantime, I plan to have a one-shot shell script that does the mounting and then use the condition <run/emmc-mount/done> in all subsequent services. This is necessary because I'm mounting my logs dir based on slot so everything hangs off of this. It's a workaround that I think should work, but if it would be really nice if I could just specify the fstab file directly in the kernel cmdline. |
I think the change could be simple if not objectionable to make this behaviour configurable, I can see the only reference to the fstab file (currently hardcoded) is in: Line 533 in f930953
So this would need to be read from a kernel cmdline var instead and if missing or blank, default to /etc/fstab . |
I just realise that this should also apply to these two plugins:
|
This is definitely possible to do, and I understand the use-case. Thanks for taking the time to describe it so clearly! I don't know when I'll have to to work on this, so a pull request would speed things up considerably. For now, I'm putting this on milestone Future, but only because there's not 4.4 planned yet (busy with 4.3). |
For now, FYR I've worked around this issue by adding a mount helper in the fstab file, which then mounts another fstab file ;) |
Aha, clever! Mount helpers are really magic :-) |
Changing target for this again, realizing I might actually have some need for this myself. I'll at least give it a try for the 4.3 release cycle ... as always, no promises! Paying customers and their release cadence takes precedence. |
Question for @hongkongkiwi: what would be a good fallback if Finit cannot find Here's the scene: a custom fstab can be selected at configure time using:
At boot, Finit is started with
A third fallback, to the UNIX default Maybe even |
In my mind, if this is configured the user has specifically hardcoded this: Then it should fallback to this file that makes sense (I guess the default is /etc/fstab), option (3)
However, maybe not all users will want this, so an easy way to handle it could be if not configured or empty like: I don't think we should ever fail to boot (1), because this is disastrous on an embedded system. I guess unless sulogin is disabled entirely it should always be there for emergency situations like this to investigate the issue. |
Yeah you're right, that's the most logical conclusion, and what I'd expect as well. So to summarize:
Additionally I propose:
I completely agree on your point of bricking embedded systems, yet there have been several different cases where users wanted their systems "parked" (blinking a specific LED pattern) so service personnel could easily see which units to replace, or continuously rebooting so that a service engineer could access the bootloader from a service port. At my old job we ended up with deferring to the kernel and how it was configured to handle oops/bug/init crashes, as I mentioned previously. There are so many use cases out there! :-) I'll give a good think and see what I can come up with, possibly another configure option, or more documentation around the |
There, done! Took a bit longer to complete than planned -- a bit too much at $DAYJOB atm. Hope it works to your liking 😃 |
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The swapon and swapoff commands do not support a custom fstab, they assume /etc/fstab is the only true source of swap devices and files. This change adds rudimentary (!) support for figuring out any swap device or file to use from any finit.fstab. Please note, options are not supported at the moment. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Ahhh, at first I was slightly confused about the swap and I realised that I have this line: It's actually commented out, so it shouldn't try to mount any swap I'm wondering if when your parsing the fstab file you ignore commented lines ;) |
This may need a new issue, but just wanted to get your take on it. |
It failed only because Finit calls |
I wanted to propose a simple feature for a future version of finit.
This would assist me greatly in my use case.
Basically, I'm using A/B update images and an emmc flash. So depending on which image is flashed, I will mount a particular set of mounts. The slot is set in the kernel cmdline and currently (before starting to use finit) I have a script which handles the correct mounting before any services are run.
For example, if I boot in slot a, then I will run
mount -T /etc/fstab.slota
instead of the default.Since finit takes care of a lot of nice stuff such as fsck and mounting, I was wondering if it's possible to have a kernel cmdline which sets which file finit uses for these operations? For example, if nothing is set it would continue to use mount -T /etc/fstab as normal, however if finit.fstab_file=/etc/fstab.slota is set (I can do this in my bootloader script) then finit would instead use this for all mount and related fsck operations.
This would make it really easy to handle different mount configurations dynamically based on slot.
The text was updated successfully, but these errors were encountered: