Hi,

What do you think about adding support to var rc script
to populate /var from files or command?

Attached patch adds three variables:
1. populate_var_mtree_enable
   Enable/disable populating /var from mtree.
   Defaults to YES to keep current behavior.

2. populate_var_files
   Files to be copied to /var (similar to mdconfig_md<X>_files)

3. populate_var_cmd
   Command to run to populate /var (similar to mdconfig_md<X>_cmd)

There is one behavior change.  If you set populate_var="YES" with
mtree and /usr fails to mount, the script will now exit with error.
If there is a use case for a non-empty /var, a separate /usr
and still wanting to set populate_var="YES" I can modify the
checks.


Some examples:
Keeping a var.tgz on a read-only root file system and extracting it.
/var is tmpfs specified in /etc/fstab or varmfs.
populate_var="YES"
populate_var_cmd="/usr/bin/tar xfzC /etc/var.tgz /var"
(add "mount /usr && " before tar if /usr is a separate file system)

Keeping a var source dir on root and copying the files from it.
Mtree can be skipped if the source dir contains all the subdirs.
populate_var="YES"
populate_var_mtree_enable="NO"
populate_var_files="/etc/var/*" or populate_var_files="/_var/*"


- Guy

Attachment: populate_var_files.patch
Description: Binary data

_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-rc
To unsubscribe, send any mail to "[email protected]"

Reply via email to