Closed hongkongkiwi closed 1 year ago
Nope, only at configure time using --with-config=/path/to/file
. It's sort of like /etc/inittab
in SysV init.
Similar to #224, neat request if finit.config=/path/to/file
existed then overrides for tests and similar would be possible.
This would be useful to me, if implemented, perhaps we could hardcode allowed filenames at compile time? That way user cannot arbitrarily specify a filename and then when something is passed finit just checks against kv to see if it was allowed at compile time.
Might help to mitigate any possible security issues? Just a thought today about this.
Good idea, I was a bit concerned about the security aspects as well! Thanks :)
What about this?
This works since finit.conf is read first (right?)
Yes, that would work. (I'm assuming you meant finit.config=/etc/finit.conf
, not fstab :)
Yep! :)
I'm receiving these log messages (I don't have any file named /etc/fstab). The fstab file should be compiled as /etc/fstab.noslot I believe (SIDE NOTE: is there anyway to check what the compiled in vars are? possible to display this info somewhere e.g. initctl ver)
[ ⋯ ] Checking filesystem sysfsWARNING: couldn't open /etc/fstab: No such file or directory
[ OK ]
[ ⋯ ] Checking filesystem sysfsWARNING: couldn't open /etc/fstab: No such file or directory
[ OK ]
[ ⋯ ] Checking filesystem sysfsWARNING: couldn't open /etc/fstab: No such file or directory
[ OK ]
[ ⋯ ] Checking filesystem sysfsWARNING: couldn't open /etc/fstab: No such file or directory
[ OK ]
[ ⋯ ] Checking filesystem sysfsWARNING: couldn't open /etc/fstab: No such file or directory
[ OK ]
[ OK ] Mounting filesystems from /etc/fstab.slot.flash_recovery_rootfs.0
[ OK ] Enabling system swap
swapon: failed to parse /etc/fstab: No such file or directory
My custom fstab file passed via finit.fstab= is correctly mounted though, so these are just warnings.
Great, thanks for testing this! I'll have a look at what this could be later tonight. When I tested I had the std /etc/fstab, of course ...
Re: side note -- no, not from the tools themselves, only config.log
and config.h
are available.
Found two things so far, looking at BusyBox sources:
FSTAB_FILE=/etc/fstab.alt
environemnt set, this also seems to be supported by the util-linux counterpartFor swap, this was an oversight on my part and I'll see what I can do about fishing out swap partitions and files manually and calling swapon /dev/partition
or swapon /swapfile
from what I can find.
For fsck, I'll set the environment variable and hope it works since I don't have a system with swap to test on atm. But I'll make note of it and test during the coming weekend. (Which is when I hope to release Finit 4.3)
Ouch, I see now we both mixed up the issues a bit. Our last three comments above should probably've been on #224 ... oh well. I've pushed a few fixes and additions. Again, the swap fixes have not been tested on a system with swap/swapfile yet.
I wanted to clarify this feature request a bit and narrow it down.
rcsd_dir=/etc/mydir
(otherwise fallback to whatever is configured at compile time, or just fail if nothing configured, similar to how fstab works)finit.conf=/etc/finit.conf
with fallback to compile time value or, finit should drop to rescue shell if no finit.conf passed and no compile time fallback specified.I think these two changes are very powerful and allow the user to specify completely different sets of scenarios. For example, you might want a factory test mode which you can simply specify that with kernel cmdline finit.conf=/etc/factory_test.conf
and a completely specific and special set of behaviour would start.
A similar functionality can be used with runlevels, but your limited to a few scenarios with no way to specifically name each one. Also, there are some hardcoded functionality which cannot be changed with runlevels (e.g. in my above example the rcsd_dir), so being able to specify a different finit.conf (which in turn specifies it's own rcsd_dir) would be extremely powerful.
The above changes (I think) should be backwards compatible, so existing users won't see a difference.
100% agree from me. Thank you for taking the time to pin this down <3
There, finally completed! :-)
We now have the following kernel command line option:
-- finit.config=/etc/factory.conf
... and top-level configuration directive (from /etc/factory.conf
):
rcsd /etc/factory.d
I would like (for testing) to specify a different /etc/finit.conf file. Is it possible to pass a kernel param to specify what config file init uses?