mkinitcpio: refer to /usr/lib/modules uniformly

This should have been done as part of b65cf9cd9.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
mkinitcpio: refuse to run without hooks defined

This still doesn't solve all our problems, but it gets us closer.
There's no point in creating an image if HOOKS aren't present as this is
the bread and butter of any sane mkinitcpio recipe.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
bash-completion: align whitespace with rest of repo

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
gitignore: ignore the right manpage section

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
functions: add parseopts for longopt fun

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
mkinitcpio: adopt parseopts for option parsing

Updates the doc and bash-completion, as well. Also adds the previously
unmentioned -A option to the --help output.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
lsinitcpio: adopt parseopts for option parsing

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Add manpage for lsinitcpio

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
mkinitcpio.8: manpage cleanup

tweak styling of synopsis and link to lsintcpio in SEE ALSO

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
mkinitcpio: dont exit from usage

Additionally, exit zero after returning.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
lsinitcpio: show file sizes in analyze output

Always display the file size on disk, but also display the uncompressed
size for compressed images. Borrows my own size_to_human function from
paccache and elsewhere.

Before:

==> Compressed with: gzip
  -> Compression ratio: .377
  -> Estimated decompression time: 0.058s

After:

==> Size: 2.67 MiB
==> Compressed with: gzip
  -> Uncompressed size: 7.07 MiB (.377 ratio)
  -> Estimated decompression time: 0.059s

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
lsinitcpio: avoid exiting from usage

Print a more helpful message when no image is specified.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
create lsinitcpio symlink for bash completion

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
mmc: add install hook

Thanks to Radoslaw Nadstawny (Rad3k) for writing this.

Satsifies FS#21022.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
mkinitcpio: check return of cd before listing hooks

$ mkinitcpio -L
==> Available hooks
/usr/bin/mkinitcpio: line 173: cd: /lib/initcpio/install: No such file or directory

sort and dedupe as well, since we deal with a hierarchy which may (for
some horrible reason) contain duplicates.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
bash-completion: avoid using cd

Introduce _files_from_dir, which loops over arguments to find files in
the given directories. Additionally allow passing a flag which will
strip suffixes from any found files.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
functions: add missing local for iterator

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
functions: align error output with GNU getopt_long

Display the name of the program.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init_functions: add support for PARTUUID tags

libblkid (and thus blkid) gain support for this in util-linux 2.22. This
block gets refactored slightly to cut out the monotony.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
init_functions: remove non-devtmpfs case

devtmpfs is no longer supported elsewhere, so this is essentially dead
code.

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