lbmk/blobutil
Ferass 'Vitali64' EL HAFIDI f787044642 Do not rely on bashisms and behaviour undefined by the POSIX specification.
By making lbmk fully POSIX-compliant, it will be easier to port lbmk to
other systems implementing POSIX such as Alpine Linux and FreeBSD.

Signed-off-by: Ferass 'Vitali64' EL HAFIDI <vitali64pmemail@protonmail.com>
2022-12-27 15:50:41 +00:00

45 lines
877 B
Bash
Executable file

#!/bin/sh
# SPDX-FileCopyrightText: 2022 Caleb La Grange <thonkpeasant@protonmail.com>
# SPDX-License-Identifier: GPL-3.0-only
./.gitcheck
script_dir="resources/scripts/blobs"
modes=$(ls -1 ${script_dir})
Print_help(){
cat <<- EOF
Usage: ./blobutil [mode] <options>
Example: ./blobutil download x230_12mb
Possible options for mode are
${modes}
Mode descriptions:
download: Try to automatically generate blobs for specified board
inject: Inject blobs for specified board into specified rom
extract: Extract blobs from specified rom for specified board
EOF
}
if [ $# -gt 0 ]; then
mode="${1}"
shift
args="$@"
if [ ! -f "${script_dir}/${mode}" ]; then
printf "Error: No mode ${mode}\n"
Print_help
exit 1
else
./${script_dir}/${mode} ${args}
fi
else
printf 'Error: You must specify a mode\n'
Print_help
fi
./.gitcheck clean