diff options
Diffstat (limited to 'files')
-rwxr-xr-x | files/bootless | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/files/bootless b/files/bootless index 900eb32..a06c98d 100755 --- a/files/bootless +++ b/files/bootless @@ -158,8 +158,13 @@ function bootless_image { bootless_rsync ${BOOTLESS_DIR} ${tmpdir}/boot # Make rescue disk + echo "Generating the rescue image..." grub-mkrescue -o ${output} ${tmpdir} + # Check rescue disk + echo "Generated image details:" + xorriso -indev ${output} -toc + # Optionally copy to removable media if [ ! -z "$device" ]; then # Issue a warning @@ -207,6 +212,16 @@ function bootless_check { exit 1 } +# Check dependencies +function bootless_check_dependencies { + for dependency in $DEPENDENCIES; do + if ! which $dependency 2> /dev/null; then + echo "$NAME: unmet dependency $dependency, please install it" + exit 1 + fi + done +} + # Load bootless_load $* @@ -215,10 +230,14 @@ NAME="bootless" BOOTLESS_VERSION="0.0.1" BOOTLESS_ACTION="$1" BOOTLESS_DIR="$2" +DEPENDENCIES="xorriso grub-mkrescue rsync dd" # Output name and version echo "$NAME $BOOTLESS_VERSION" +# Check dependencies +bootless_check_dependencies + # Parameter verification if [ -z "$BOOTLESS_DIR" ]; then bootless_usage |