Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring of common code between the SYSV init and initramfs scripts.
* Move code from the SYSV init and initramfs scripts that is better served in a common code base library (zfs-functions). * Use "${VAR}" instead of "$VAR". * Add some comments to functions that didn't have any. * Create zfs_run_cmd() which records stderr, exit code etc. * zfs_set_ifs() needs to be a global func. Use this in zfs_run_cmd() before we run the actual command. * Dracut have the func emergency_shell() which does a little more. For those that don't have it, just run '/bin/sh -i -l'. * Minor fix/change to read_mtab(): * Strip control characters (space - \040) from /proc/mounts GLOBALY, not just first occurrence. * Don't replace unprintable characters ([/-. ]) for use in the variable name with underscore. No need, just remove them all together. * Move code snippet that fetches and mounts recursive filesystems into the new recursive_mount_filesystems() function. * Instead of using ZFS_CMD+zfs_action()+zfs_log_failure_msg() etc each and every time, use the more generic zfs_action() that does most of this for us. * Put the check for zfs debugging in check_zfs_debug(). Use this in zfs_action() to check if we should output the message we're called with.
- Loading branch information