update bash completion

- change scavenging of /lib/modules to avoid grabbing extramodules dirs
- add missing options for lsinitcpio and mkinitcpio
- use _filedir for completing -b

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
hooks/resume: Remove unused function

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
hooks/resume: Remove grep usage

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Makefile: install binaries to /usr/bin

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init: don't tell the kernel about the path to modprobe

Remove this ancient relic. It's not been needed in a very long time.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init: create /run/initramfs after mounting /run

We'll use this as a channel to communicate with later userspace.

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

Beyond stylistic cleanup, add a conditional to ensure that we don't
show the 'waiting for device' message if it already exists.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
autodetect: store rootfstype for use by other hooks

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init: use util-linux's /bin/mount

Providing this means we no longer need blkid for FS detection, as mount
will do this for us. Adds a slight bloat to the image, in exchange for a
huge convenience. Messaging is changed to assume that /bin/mount will
provide useful feedback for us on failure.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init_functions: move root resolution to separate function

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

This allows a caller to pass in a device by name and get a /dev node
returned. Note that this is heavily limited in that only the root device
can be identified by major:minor.

This might break init's API, if such a thing exists.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init_functions: resolve M:m to device file

Rather than immediately defaulting to /dev/root, attempt to resolve the
major/minor pair back to a block device. If we can't do this properly,
then fallback to /dev/root.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
fsck: implement basic fsck support

This adds support for fsck'ing root at bootstrap if the fsck binary and
necessary helpers are included.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
install/fsck: new install hook to add fsck and helpers

Provides /sbin/fsck and any helper binaries to the image. If processed
after the autodetect hook, only the helper for the root FS is added.

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

Do variable name validation via the case labels rather than via PEs.
This frees up the fallthrough case to simply ignore things we don't
understand (and not exist).

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
use util-linux's switch_root binary

This is a much better solution than busybox's, as it will move our API
filesystems and /run for us.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init: Remove grep usage

The only downside is on systems where devtmpfs is not enabled
will see and error message, anyway /dev will be tmpfs as fallback like now.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init: Remove sed cmd usage

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init: Remove unneeded test

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
hooks/net: Refactor and remove sed cmd usage.

* ipconfig cmd writes a file in /tmp that is ready for direct evaluation.
We can use this instead of parsing the output, to do this some variable
renames are needed.

* Add /tmp as part of "base" layout since this can be used by others hooks/cmds.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>