add tools to manipulate initramfs images

pull/63/head
TomasM 2018-10-11 04:27:19 -05:00
parent 3eca7a4f07
commit 8971fdb6ca
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#!/bin/bash
set -e
if [ "$1" = "-h" -o "$1" = "--help" -o "$2" = "" ]; then
echo ""
echo "Create initramfs image from a directory tree"
echo "Usage: $0 [source_directory] [target_initramfs_file.img]"
echo ""
exit 2
fi
cd "$1"
find . -print | cpio -o -H newc | xz -f --extreme --check=crc32 >"$2"

View File

@ -0,0 +1,15 @@
#!/bin/bash
set -e
if [ "$1" = "-h" -o "$1" = "--help" -o "$2" = "" ]; then
echo ""
echo "Unpack initramfs image to a directory"
echo "Usage: $0 [source_initramfs_file.img] [target_directory]"
echo ""
exit 2
fi
mkdir -p "$2"
(cd "$2"; xz -d | cpio -idv) < "$1"