mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-27 19:33:23 +00:00
16 lines
268 B
Bash
Executable File
16 lines
268 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
if [ $# -ne 2 ]; then
|
|
echo "Usage: mkinitramfs <dir> <cpio>"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -d "$1" ]; then
|
|
echo "Creating $2 from $1"
|
|
(cd "$1"; find . | cpio -o -H newc) > "$2"
|
|
else
|
|
echo "The first argument must be a directory"
|
|
exit 1
|
|
fi
|