shutdown: share dm teardown with lvm

lvm is a chatty bitch and wants to tell all its friends about what it's
doing. Mostly this just goes poorly with udev, but now its lvmetad as
well. Use dmsetup as a shortcut and just tear down the volumes without
worrying about the needless accounting.

Guys? GUYS?!?! GUYS IM TEARING STUFF DOWN NOW!!!11!!!111

Fixes FS#32680.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
shutdown: avoid talking to udev via dmsetup

Similar to c257b0d7b4dd.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
shutdown: copy kexec from host if requested and not available

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
usbinput: use autodetection on newer kernels

This is a partial "revert" of 822a88700e since kernels as of 3.5 add
module aliases for hid devices.

Fixes FS#32575.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init: condense early module loading

Since mkinitcpio rewrites its runtime config, we can guarantee that
these variable are sanitized of extraneous whitespace. Meld the two
calls together, ensuring that we retain the ordering, but only call
modprobe once.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init: use exponential backoff in poll_device

Start at .1 second and double the interval, capping at 1s.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init: remove needless workaround for empty rootdelay

Adjust the test in poll_device to look for either an unset OR an empty
2nd parameter.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init: declare defaults earlier

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init: remove unneeded variable expansion

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
drop support for reading /etc/rc.conf

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
obsolete old-style install hook API

This removes any meaning from the definitions of MODULES, BINARIES,
FILES, and SCRIPT within install hooks. It also removed the deprecated
checked_modules() function, which is replaced by add_checked_modules().

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
build: move manpages to subdir

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
functions: only show the basename of a deprecated hook

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Makefile: copy directories, not individual files on install

This allow preservation of symlinks.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
merge most storage hooks into a single 'block' hook

As the autodetect hook gets better with every kernel release, we can
"afford" to remove the needless segregation of block device driver hooks
and simply merge all the "vanilla" or "unstacked" block device drivers.
This should make a lot of setups, like usb or virtio, easier as you
won't need to remember to add the hook.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
modconf: add new hook to simply inclusion of modprobe config

Add this as a default in the config file.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
unique _modpaths arrays in during build

Declaring _modpaths as an associative array allows us to forego the
printf|sort -u|xargs cp pipeline as we can guarantee that the array is
already prepared.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
selectively decompress modules on install

Don't make any assumptions about the compression on modules and scan the
passed in module list for telltale extensions. This has the benefit of
doing nothing when modules are uncompressed, and adds support for
decompression of XZ modules.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
shutdown: teardown loop devices only after umount

This still isn't really ideal, but attempting to detach loops while
they're still mounted will definitely fail. Ideally, the loop device is
in autoclear mode and dropping its refcount to 0 on umount will cause
the backing file to be detached from the loop.

Of course, this all gets way too complicated for userspace to handle
when dealing with the sort of rat's nest of loop devices that ArchISO
sets up. The kernel doesn't help us out here by populating things like
holders/ and slaves/, but I'm not sure it could.

Maybe there's a better way...

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
replace find_in_dirs with PATH= manipulation

Declaring our lookup paths like normal colon delimited PATHs lets us
reuse them for builtins like source and type to do the same work that
this function previously did.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>