lsinitrd: add "catinitrd" functionality
lsinitrd <initramfs image> [<file to cat>]master
parent
3636d59e38
commit
430bfefda3
7
lsinitrd
7
lsinitrd
|
|
@ -19,9 +19,14 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
[[ $# -eq 1 ]] || { echo "Usage: $(basename $0) <initramfs file>" ; exit 1 ; }
|
[[ $# -eq 1 || $# -eq 2 ]] || { echo "Usage: $(basename $0) <initramfs file> [<filename>]" ; exit 1 ; }
|
||||||
[[ -f $1 ]] || { echo "$1 does not exist" ; exit 1 ; }
|
[[ -f $1 ]] || { echo "$1 does not exist" ; exit 1 ; }
|
||||||
|
|
||||||
|
if [[ $# -eq 2 ]]; then
|
||||||
|
zcat $1 | cpio --extract --verbose --quiet --to-stdout ${2#/} 2>/dev/null
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
echo "$1:"
|
echo "$1:"
|
||||||
echo "========================================================================"
|
echo "========================================================================"
|
||||||
zcat $1 | cpio --extract --verbose --quiet --to-stdout 'dracut-*' 2>/dev/null
|
zcat $1 | cpio --extract --verbose --quiet --to-stdout 'dracut-*' 2>/dev/null
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue