FreeBSD uses /etc/rc.d/encswap and /etc/rc.d/jail to mount encrypted swap partitions and start jails. http://www.freebsd.org/doc/en/books/handbook/swap-encrypting.html http://www.freebsd.org/doc/en/books/handbook/jails.html We should write OpenRC scripts to support this.
Created attachment 314689 [details] /etc/init.d/encswap I am attaching an init script for encswap. It is a derivative of the FreeBSD encswap init script to work on Gentoo FreeBSD. Conversion was trivial.
The code seems fine. Is the copyright notice just forgotten to change?
(In reply to comment #2) > The code seems fine. Is the copyright notice just forgotten to change? The original code lacked a copyright notice, but it belongs to the FreeBSD foundation. If a copyright notice is placed on it, then it should state that the FreeBSD Project owns it. We could add an additional line for the Gentoo Foundation, but our changes are trivial.
I'm not sure how we should handle this file's copyright notice. aballier, could you give us some comment on this?
(In reply to comment #4) > I'm not sure how we should handle this file's copyright notice. > aballier, could you give us some comment on this? to be honest, i dont consider 20 lines of shell to be copyrightable material. if we want to nitpick: if the non comment contents are 100% equal, this is fine imho; otherwise, you should say its based on a file from freebsd, with a link to it and its license statement, and state that the modifications you made are under the same license as the pointed file. where did you get that init script from ?
The init script is based on the script used in FreeBSD. You can find it here: http://svnweb.freebsd.org/base/release/9.0.0/etc/rc.d/encswap
Are there any objections to the following header? #!/sbin/runscript # Copyright 1992-2012 FreeBSD Project # Copyright 1999-2012 Gentoo Foundation # Released under the 2-clause BSD license # $Header: $
Created attachment 318174 [details, diff] Patch to add jail and encswap init scripts to OpenRC for FreeBSD After William Hubbs and I decided that these scripts belong in OpenRC, so I have produced a patch for OpenRC to provide them. Note that the jail script lacks the ability to start and stop individual jails. I hope to add that ability in the future by improving to OpenRC to support arguments to commands.
I rerecommend separating this patch so that each script is added in its own commit. Also, you don't need the 'signed-off-by' line in the commit message. Another concern I have is that the jail init script doesn't have a depend() function. Thanks, William
Created attachment 318194 [details, diff] Patch to add encswap script to OpenRC The patch is being split into two patches as per a discussion with William Hubbs in IRC.
Created attachment 318196 [details, diff] Patch to import jail init script from FreeBSD into OpenRC I made some minor tweaks to this since the previous patch. debug statements are now off by default and can be toggled on by setting DEBUG=yes. I also added depend() so that the script starts after networking.
Created attachment 318198 [details, diff] Patch to fix savecore script to play nicely with encswap Currently, it is possible to savecore to run before dumpon, which will prevent saved kernel dumps from being found. With encswap, it is possible for encswap to run before savecore, which will corrupt a stored kernel dump. This patch fixes both issues.
Created attachment 318206 [details, diff] Patch to add encswap script to OpenRC I attached the previous patch by mistake. This corrects that mistake.
Created attachment 365436 [details, diff] 0001-Import-jail-init-script-from-FreeBSD.patch All, This is what I currently have as the patch that would add the Jail init script; I'm sorry this apparently got lost in the shuffel. Do you still want this added to OpenRC? Thanks, William