aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2022-06-12 14:40:44 -0300
committerSilvio Rhatto <rhatto@riseup.net>2022-06-12 14:40:44 -0300
commit35a502e10ddbb2f20e58b558e63439938bd0af5a (patch)
tree0654f68cf8ec848a6e49c07fe2e7502c4f272c9b
parente7ab332debafda20b9c9720095e35bbde7b92f13 (diff)
downloadbootless-35a502e10ddbb2f20e58b558e63439938bd0af5a.tar.gz
bootless-35a502e10ddbb2f20e58b558e63439938bd0af5a.tar.bz2
Fix: additional checks
-rwxr-xr-xfiles/bootless19
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