Skip to content

Instantly share code, notes, and snippets.

@sAsPeCt488
Last active June 2, 2023 21:08
Show Gist options
  • Save sAsPeCt488/0f535e81a5cde8babbf91c5782916b76 to your computer and use it in GitHub Desktop.
Save sAsPeCt488/0f535e81a5cde8babbf91c5782916b76 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Usage: $0 <initramfs.cpio.gz> <output-dir>"
exit -1
fi
# Decompress a .cpio.gz packed file system
mkdir $2
pushd . && pushd $2
cp "../$1" .
gzip -dc "$1" | cpio -idm &>/dev/null && rm "$1"
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment