summaryrefslogtreecommitdiff
path: root/lsinitramfs
blob: e395de8ea7857cc71452a2aaa50691ea32fee5a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

set -eu

usage()
{
	echo "Usage: $(basename $0) <initramfs file>"
}

if [ "$#" -eq 0 ] ; then
	usage >&2
	exit 1
fi

if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
	usage
	exit 0
fi

for i in "$@" ; do
	if ! [ -r "$i" ] ; then
		echo "Specified file could not be read." >&2
		exit 1
	else
		echo "$i"
		zcat "$i" | cpio --extract --verbose --quiet --list
		fi
done