make splitsep preserve backslashes (RHBZ#851295)

splitsep() would drop escapes from its inputs. For example:

  splitsep ':' 'first:middle:\e\s\c\a\p\e\d' a b c

gave a='first', b='middle', c='escaped'. Even worse:

  splitsep ':' '\e\s\c\a\p\e\d:middle:last' a b c

gave a='escaped', b='escaped', c='escaped:middle:last'.

This fixes the quoting so both calls return the values you'd expect
(e.g. 'first', 'middle', '\e\s\c\a\p\e\d').
hide 'setsid --help' output in emergency_shell()

When emergency_shell() happens, it does 'setsid --help' to figure out if
the setsid binary supports the '-c' flag (to set the controlling tty).

This output shows up in the logs (and on-screen if you're using
rd.debug), which keeps confusing people looking for other problems.

Using "case" instead of "strstr" lets us avoid this.
livenet: simplify writing net.ifaces

commit db2b12f removed the rd.neednet argument and uses /tmp/net.ifaces
instead. This means we don't need to mess with CMDLINE.
add debug_shell(), use it in non-emergency places

If the user requests rd.break=cmdline, that's not an emergency, it's
just debugging. We don't need to run the emergency hook and the message
shouldn't say "Warning", since nothing's really wrong.

So: add a debug_shell function which doesn't emit a warning, doesn't run
the emergency hook, and won't make the system halt.
dracut-lib: add importlib <lib-name> [for <symbol>...]

This gives us an 'importlib' function that can be used to source
the various libraries (e.g. 'net', 'url', 'img') in the initramfs.
If the library is missing, a warning will be printed.

It won't load a library that has been already loaded in this
interpreter, so you can import multiple times with no problems.

For added assurance and maintainability, you can do something like:

  importlib net for ip_to_var set_ifname

This imports everything in net-lib.sh like usual, but it will print
warnings if it can't find variables or functions (or aliases or
commands) named 'ip_to_var' and 'set_ifname'.
move fix_bootif to net-lib

This might be useful to other parts of dracut; move it to net-lib.sh.
net-genrules: accept MAC address for $iface, cleanups

A MAC address is a unique identifier for a particular network interface.

We can use the MAC to generate udev rules to bring up that interface,
like we currently do with BOOTIF.

This patch allows interfaces to be specified as a MAC address, either
in the usual colon-separated form or the PXE-style dash-separated form.

(The latter is more useful on the commandline, since it allows for
arguments like: "ip=77-77-6f-6f-64-73:dhcp")

This is useful since it's common for a user who is booting a new OS for
the first time to know the MAC of the device, but not know what the
kernel name will be.
Don't explode when mixing BOOTIF and ip=

Now that we can use a MAC as a device identifier, we can just bring up
the device specified by BOOTIF as a normal interface.

So instead of ignoring everything but BOOTIF, we'll put BOOTIF in the
IFACES list and bring it up as normal, defaulting to DHCP if nothing
else is specified.

We can also handle anaconda-style 'ksdevice=bootif' this way.
net-lib: add find_iface_with_link()

Add a function to look at the system network interfaces and return the
first one it finds with an active link (if any.)