summaryrefslogtreecommitdiffstats
path: root/lsinitcpio
AgeCommit message (Collapse)AuthorFilesLines
2013-10-21lsinitcpio: separate decompression from archive readingDave Reisner1-3/+3
This essentially reverts 306dcbd7b21f8a680 which foolishly assumes that kernel and libarchive decompression support stay in sync. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-09-07lsinitcpio: return success based on echo, not hexdumpDave Reisner1-0/+1
The impetus for doing this was a bug in util-linux's hexdump which never saw a release. For uniformity, simply echo an empty line here. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-09-07lsinitcpio: add support for lz4 compressed imageDave Reisner1-1/+6
Note that this requires a very recent version of lz4 utilities as it uses lz4, and not the original lz4c tool, in order to be command line API compliant with other compression tools. See upstream discussions: https://code.google.com/p/lz4/issues/detail?id=83 Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-05-07lsinitcpio: remove unused variablesDave Reisner1-3/+0
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-03-09lsinitcpio: shortcut lzop involvement to bsdtarDave Reisner1-8/+4
libarchive 3.1 supports LZO now, so we no longer need this indirection everywhere. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-01-21Do more to determine the color caps of the termDave Reisner1-16/+1
823e24 wasn't really correct, since running 'tput setaf 0' effectively sanity checks the terminfo as well as checking existance. However, it does nothing to affirm that the terminal is capable of supporting colors. Moreover, *never* fall back on the hardcoded escapes as doing so implies that we've found a broken terminfo and we have no idea what the terminal is capable of doing. This reverts commit 823e2454176d4381cd3acc30481e9d84cdc298b1.
2013-01-13factor out kver detection to functions fileDave Reisner1-4/+1
This leaves bash completion with a duplication, but this is intentional to avoid pulling in the entire functions file and worrying about pollution. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-01-12use type to determine availability of tputDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-01-12lsinitcpio: further cut out dependency on fileDave Reisner1-12/+52
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-01-12lsinitcpio: avoid redundanciesDave Reisner1-2/+2
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-01-12lsinitcpio: abort on unknown file formatsDave Reisner1-1/+6
Specficially, abort when a user tries to run lsinitcpio on a kernel image. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-01-12lsinitcpio: fail hard if the image can't be extractedDave Reisner1-2/+4
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-11-26lsinitcpio: use compound command for parseopts execDave Reisner1-3/+1
Pedantic, but at least this makes us consistent with mkinitcpio. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-11-12lsinitcpio: initialize _opt_verbose to empty stringDave Reisner1-1/+1
FS#32605. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-10-25lsinitcpio: Add -V/--version option to display versionEric Bélanger1-2/+12
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
2012-10-07commit to some level of style in variable namingDave Reisner1-56/+53
This is an ugly patch, and probably does more than I'd like it to. The idea is that mkinitcpio adopts some sort of consistent style which I'm actually happy with. I define 3 kinds of variables: 1) local variables: all lower case, and scoped within functions. Use freely, as they're well contained. 2) global variables: these are known to mkinitcpio internally, but are global in scope. They mainly carry runtime configuration and collected data during the image generation process. These are always lower case, but carry a leading underscore to denote that they're global. 3) "API" variables: also global in scope, but exist "outside" of mkinitcpio -- either drawn in from the configuration file, or "exported" to the install hooks. These are always all upper case. When introducing new variables, extreme care must be taken to pick names that will not conflict with the environment inherited by mkinitcpio. A HACKING file is introduced with a similar description of the above, and more. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-30lsinitcpio: add -l, --list option; define as defaultDave Reisner1-5/+18
This is the default action for lsinitcpio. Add it just for the purpose of clarity. This change also separates out true options from 'actions' and validates that the user only passed a single action to lsinitcpio. Update the manpage accordingly. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-30lsinitcpio: add -c, --config option to dump configDave Reisner1-3/+9
Now that mkinitcpio stores the build time config file in the image, we should have a way of easily getting it back out. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-30lsinitcpio: move image analysis to separate functionDave Reisner1-66/+70
git (at least version 1.7.12.1) does a great job of showing the absolute wrong code moving around in this patch. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-07-15lsinitcpio: comment on why bsdtar alone isn't good enoughDave Reisner1-1/+3
I almost deleted this, replacing it with only bsdtar. Add a comment so I'm not tempted to do this again. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-08lsinitcpio: show only regular files as binaries0.9.2Dave Reisner1-2/+1
Show only regular files in /usr/bin instead of everything (including the mess of symlinks to busybox and kmod). It's also a nice to have since we're showing more about the multiple hook points now. This mostly restores the behavior prior to f7b8a6f0fd. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-18lsinitcpio: Always show extraction timeDave Reisner1-2/+2
Even for uncompressed images, estimate the work being done to extract to ramfs. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-18lsinitcpio: add support for listing new hooksDave Reisner1-21/+20
Read this out of the image config for -a output. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-18lsinitcpio: extract the image to a tempdirDave Reisner1-18/+45
We read the image a number of times. Extract the image to a temp directory so we can just extract it once and use the filesystem to our advantage. This requires a temp dir which we can nuke on an EXIT trap, but the whole operation is sped is a bit, especially for larger images. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-02lsinitcpio: fallback on 80 cols when tput failsDave Reisner1-0/+3
This only happens when the terminfo file is missing, but its a simple fix. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-22lsinitcpio: avoid exiting from usageDave Reisner1-4/+4
Print a more helpful message when no image is specified. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-22lsinitcpio: show file sizes in analyze outputDave Reisner1-3/+28
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>
2012-04-22lsinitcpio: adopt parseopts for option parsingDave Reisner1-15/+31
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-02-20lsinitcpio: trim binaries during discoveryDave Reisner1-3/+3
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-02-20lsinitcpio: detect kver separate from modulesDave Reisner1-6/+4
mkinitcpio will always create /lib/modules/$kernver/kernel in the image, so we can use this to detect the kernel the image was built for, even if the image contains no modules. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-12-26lsinitcpio: remove duplicate in_array functionDave Reisner1-9/+0
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-12-16lsinitcpio: cleanup binary displayDave Reisner1-1/+1
- trim leading paths from all binaries - sort alphabetically - add same trailing indent as the module display Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-12-05lsinitcpio: read VERSION stamp out of image fileDave Reisner1-1/+4
Report this version on -a if it's found. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-11-29lsinitcpio: columnize binaries outputDave Reisner1-3/+3
Now that we're including symlinks to busybox on the prebuilt image, this display needs a bit of tidying up. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-01lsinitcpio: follow symlinks only when necessaryDave Reisner1-2/+4
If the image we're pointing to is a symlink, show the resolution as part of the name in -a's output. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-01lsinitcpio: disable color when stdout isn't a ttyDave Reisner1-1/+1
This was a copypasta error when taking this from makepkg, which has special concerns in this regard. lsinitcpio should only concern itself with stdout. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-07-05lsinitcpio: fix logical error in reading compression0.7.2Dave Reisner1-1/+1
2011-07-01lsinitcpio: add optional colorized outputDave Reisner1-16/+43
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-07-01lsinitcpio: append, not overwrite found hooksDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-06-16lsinitcpio: new utility to dump contents of imagesDave Reisner1-0/+138
Signed-off-by: Dave Reisner <d@falconindy.com>