diff options
-rw-r--r-- | functions | 8 | ||||
-rwxr-xr-x | mkinitcpio | 19 |
2 files changed, 14 insertions, 13 deletions
@@ -162,7 +162,7 @@ add_module() { done < <(modinfo -b "$BASEDIR" -k "$KERNELVERSION" -0 "$module" 2>/dev/null) if [[ -z $path ]]; then - error "module '$module' not found" + error "module not found: \`%s'" "$module" return 1 fi @@ -229,11 +229,11 @@ add_file() { src=$BASEDIR$1 - [[ -f "$src" ]] || { error "$src: No such file"; return 1; } + [[ -f "$src" ]] || { error "file not found: \`%s'" "$src"; return 1; } mode=$(stat -c %a "$src") if [[ -z "$mode" ]]; then - error "failed to stat file: \`$src'" + error "failed to stat file: \`%s'." "$src" return 1 fi @@ -251,7 +251,7 @@ add_binary() { binary=$BASEDIR$1 - [[ -f "$binary" ]] || { error "$binary not found"; return 1; } + [[ -f "$binary" ]] || { error "file not found: \`%s'" "$binary"; return 1; } dest=${2:-$binary} mode=$(stat -c %a "$binary") @@ -163,7 +163,7 @@ readonly NC BOLD BLUE GREEN RED YELLOW if [[ $BASEDIR ]]; then # resolve the path. it might be a relative path and/or contain symlinks if ! pushd "$BASEDIR" &>/dev/null; then - die "base directory '$BASEDIR' does not exist or is not a directory" + die "base directory does not exist or is not a directory: \`%s'" "$BASEDIR" fi BASEDIR=$(pwd -P) BASEDIR=${BASEDIR%/} @@ -172,13 +172,14 @@ fi if [[ $optkver ]]; then if ! KERNELVERSION=$(get_kernver "$optkver"); then - die "'$optkver' is an invalid kernel specifier" + [[ ${optkver:0:1} == / ]] && optkver=$BASEDIR$optkver + die "invalid kernel specifier: \`%s'" "$optkver" fi fi if [[ $TMPDIR ]]; then if [[ ! -d $TMPDIR ]]; then - error "'$TMPDIR' does not exist or is not a directory" + error "Temporary directory does not exist or is not a directory: \`%s'" "$TMPDIR" unset TMPDIR cleanup 1 fi @@ -207,7 +208,7 @@ if [[ $PRESET ]]; then if [[ ${!preset_kver:-$ALL_kver} ]]; then preset_cmd+=(-k "${!preset_kver:-$ALL_kver}") else - warning "No kernel version specified. Skipping image '%s'" "$p" + warning "No kernel version specified. Skipping image \`%s'" "$p" continue fi @@ -215,7 +216,7 @@ if [[ $PRESET ]]; then if [[ ${!preset_config:-$ALL_config} ]]; then preset_cmd+=(-c "$BASEDIR${!preset_config:-$ALL_config}") else - warning "No configuration file specified. Skipping image '%s'" "$p" + warning "No configuration file specified. Skipping image \`%s'" "$p" continue fi @@ -223,7 +224,7 @@ if [[ $PRESET ]]; then if [[ ${!preset_image} ]]; then preset_cmd+=(-g "$BASEDIR${!preset_image}") else - warning "No image file specified. Skipping image '%s'" "$p" + warning "No image file specified. Skipping image \`%s'" "$p" continue fi @@ -237,19 +238,19 @@ if [[ $PRESET ]]; then done cleanup 0 else - die "Preset $PRESET does not exist. Exiting." + die "Preset not found: \`%s'" "$PRESET" fi fi if [[ $GENIMG ]]; then IMGPATH=$(readlink -f "$GENIMG") if [[ -z $IMGPATH || ! -w ${IMGPATH%/*} ]]; then - die "error: unable to write to path: '$GENIMG'" + die "error: unable to write to path: \`%s'" "$GENIMG" fi fi if [[ ! -f "$CONFIG" ]]; then - die "config file '$CONFIG' cannot be found, aborting..." + die "Config file does not exist: \`%s'" " $CONFIG" fi . "$CONFIG" |