diff options
author | Dave Reisner <d@falconindy.com> | 2011-06-13 03:41:49 +0200 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2011-06-25 12:25:45 +0200 |
commit | 733afaaa9c52e55d047d5e6a5d689131e1fde3e6 (patch) | |
tree | 633bac5cb1e5d54adffabeaa8e57e5e53f70dd8b | |
parent | 8ca2543c17819e754d2ebf467acfc65a636d25f2 (diff) | |
download | mkinitcpio-733afaaa9c52e55d047d5e6a5d689131e1fde3e6.tar.gz mkinitcpio-733afaaa9c52e55d047d5e6a5d689131e1fde3e6.tar.xz |
mkinitcpio: allow absolute paths to preset files
Signed-off-by: Dave Reisner <d@falconindy.com>
-rwxr-xr-x | mkinitcpio | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -175,13 +175,17 @@ declare BUILDROOT=$TMPDIR/root # use preset $PRESET if [[ $PRESET ]]; then - if [[ -f "$PRESETDIR/$PRESET.preset" ]]; then + # allow absolute path to preset file, else resolve it + if [[ "${PRESET:0:1}" != '/' ]]; then + printf -v PRESET '%s/%s.preset' "$PRESETDIR" "$PRESET" + fi + if [[ -f "$PRESET" ]]; then # Use -b, -m and -v options specified earlier declare -a preset_mkopts preset_cmd [[ $BASEDIR ]] && preset_mkopts+=(-b "$BASEDIR") (( QUIET )) || preset_mkopts+=(-v) # Build all images - . "$PRESETDIR/$PRESET.preset" + . "$PRESET" for p in "${PRESETS[@]}"; do msg "Building image from preset: '$p'" preset_cmd=("${preset_mkopts[@]}") |