diff --git a/srcpkgs/initramfs-tools/files/lsinitramfs b/srcpkgs/initramfs-tools/files/lsinitramfs new file mode 100755 index 0000000000..91c65e1d14 --- /dev/null +++ b/srcpkgs/initramfs-tools/files/lsinitramfs @@ -0,0 +1,51 @@ +#!/bin/sh + +set -eu + +usage() +{ + echo "Usage: $(basename $0) " +} + +if [ "$#" -eq 0 ] ; then + usage >&2 + exit 1 +fi + +cpio_args="--extract --quiet --list" + +OPTIONS=`getopt -o hl --long help,long -n "$0" -- "$@"` +# Check for non-GNU getopt +if [ $? != 0 ] ; then echo "W: non-GNU getopt" >&2 ; exit 1 ; fi + +eval set -- "$OPTIONS" + +while true; do + case "$1" in + -h|--help) + usage + exit 0 + ;; + -l|--long) + cpio_args="${cpio_args:+${cpio_args} --verbose}" + shift + ;; + --) + shift + break + ;; + *) + echo "Internal error!" >&2 + exit 1 + esac +done + +for initramfs in "$@" ; do + if ! [ -r "${initramfs}" ] ; then + echo "Specified file could not be read." >&2 + exit 1 + else + echo "${initramfs}" + zcat "${initramfs}" | cpio ${cpio_args} + fi +done diff --git a/srcpkgs/initramfs-tools/files/lsinitramfs.8 b/srcpkgs/initramfs-tools/files/lsinitramfs.8 new file mode 100644 index 0000000000..d802c76451 --- /dev/null +++ b/srcpkgs/initramfs-tools/files/lsinitramfs.8 @@ -0,0 +1,47 @@ +.TH LSINITRAMFS 8 "2010/06/16" "Linux" "lsinitramfs manual" + +.SH NAME +lsinitramfs \- list content of an initramfs image + +.SH SYNOPSIS +.B lsinitramfs +.RI [ options ] " " [ ] +.br + +.SH DESCRIPTION +The +.B lsinitramfs +command lists the content of given initramfs images. It allows to quickly check +the content of one (or multiple) specified initramfs files. + +.SH OPTIONS + +.TP +.B -h +Display usage information and exit. + +.TP +.B -l +Display long and more verbose listing of initramfs content. + +.SH USAGE EXAMPLES + +List initramfs content of current running kernel: + +.PP +.B lsinitramfs /boot/initrd.img-$(uname -r) + +List content of two initramfs files in verbose mode: + +.PP +.B lsinitramfs -l /boot/vmlinuz-2.6.31-grml64 /boot/vmlinuz-2.6.33-grml64 + +.SH AUTHOR +The initramfs-tools are written by Maximilian Attems +and numerous others. + +.SH SEE ALSO +.BR +.IR initramfs-tools (8), +.IR mkinitramfs (8), +.IR update-initramfs (8).