On Sun, May 05, 2019 at 08:57:55PM +0300, cho...@jtan.com wrote: [...] > Currently after every upgrade I patch /etc/rc to run /etc/rc.blockdev > (containing bioctl -cC -p /etc/sd0.key -l sd0a softraid0) before the > additional filesystems are checked or mounted.
The order of sdX may change if e.g. a USB drive is plugged in during boot. You know you _can_ use the device UUID which AFAIK should be much more robust than using sdX. I used the following line at some point in an rc.local: bioctl -c C -l b3914b7ba0818788.a softraid0 > Before I resign myself to patching /etc/rc in perpetuity, is there a > better or more canonical way to activate a second encrypted disc using a > key file in /etc before filesystems defined in /etc/fstab are checked or > mounted (it becomes /srv)? That would be rc.local. From rc(8): Normally, rc.local contains commands and daemons that are not part of the stock installation. > The patch I use is below. Ignore the date; I've been using this since > around 6.2 at least. I feel rather silly saying that you're welcome to > use this tiny patch if it's useful, but there it is and you are. I empathize with your drive to get hands-on with the code to find a solution to a problem and the desire to share it, but the solution you are proposing should be discouraged. You are proposing a trivial 1-line patch to a file that isn't meant to be patched; ignoring the man page that contains a valid place for local customizations. For yourself, the closer you stay to the default install especially in regards to infrastructure like rc(8), the less likely you will run into bugs that are not reproducible by others.