diff options
author | Dave Reisner <dreisner@archlinux.org> | 2013-12-06 02:31:42 +0100 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2013-12-06 02:31:42 +0100 |
commit | fe786a6b8d6cb82d972fd47b0033d5f42e00acdd (patch) | |
tree | 42754befcf4f2d80cd31d0a67d0e0761e9075f36 | |
parent | 4d0d81aacf6ea5aaa3a7dd1d538203460b216963 (diff) | |
download | mkinitcpio-fe786a6b8d6cb82d972fd47b0033d5f42e00acdd.tar.gz mkinitcpio-fe786a6b8d6cb82d972fd47b0033d5f42e00acdd.tar.xz |
prevent calling a preset from a preset
This is surely a configuration error as it's an infinite loop.
-rwxr-xr-x | mkinitcpio | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -241,6 +241,11 @@ process_preset() ( local preset=$1 preset_image= preset_options= local -a preset_mkopts preset_cmd + if (( MKINITCPIO_PROCESS_PRESET )); then + error "You appear to be calling a preset from a preset. This is a configuration error." + cleanup 1 + fi + # allow path to preset file, else resolve it in $_d_presets if [[ $preset != */* ]]; then printf -v preset '%s/%s.preset' "$_d_presets" "$preset" @@ -287,7 +292,7 @@ process_preset() ( fi msg2 "${preset_cmd[*]}" - "$0" "${preset_cmd[@]}" + MKINITCPIO_PROCESS_PRESET=1 "$0" "${preset_cmd[@]}" (( $? )) && ret=1 done |