diff options
author | Thomas Bächler <thomas@archlinux.org> | 2010-01-05 23:45:52 +0100 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2010-01-05 23:45:52 +0100 |
commit | 7fd17e6df5e82433759b27811707b6dc0b940835 (patch) | |
tree | db4081eb2593aa1170cc6bd2633ac24c97a1f669 | |
parent | 253cdd0f65aaabfecc73f6e26a6732339681781b (diff) | |
download | mkinitcpio-7fd17e6df5e82433759b27811707b6dc0b940835.tar.gz mkinitcpio-7fd17e6df5e82433759b27811707b6dc0b940835.tar.xz |
Revert 1558dfbf3b2a42f43594acf6e3d8f9b329ff1133 and 984cbd4eb023001668eea530e2b5ed2e57ba3693 and depend on bash
There was no proper upgrade path for these changes. This can be reconsidered once a clean upgrade path is provided.
Compatibility with non-bash shells is not as important as backwards-compatibility of existing configurations.
-rwxr-xr-x | mkinitcpio | 21 | ||||
-rw-r--r-- | mkinitcpio.d/example.preset | 2 |
2 files changed, 5 insertions, 18 deletions
@@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # mkinitcpio - modular tool for building an init ramfs cpio image # # IMPORTANT: We need to keep a common base syntax here @@ -113,32 +113,17 @@ while getopts ':c:k:s:b:g:a:p:m:vH:LMhS:' arg; do done shift $((${OPTIND} - 1)) -. "${FUNCTIONS}" - # use preset $PRESET if [ -n "${PRESET}" ]; then if [ -f "${PRESETDIR}/${PRESET}.preset" ]; then - echo " -------------------------------------------------------------------" - echo " WARNING: Defining PRESETS as a bash array is no longer supported." - echo " PRESETS should be defined as a string in all mkinitcpio" - echo " preset files for compatibility with dash." - echo " -------------------------------------------------------------------" - # Use -b, -m and -v options specified earlier PRESET_MKOPTS="${0}" [ -n "${BASEDIR}" ] && PRESET_MKOPTS="${PRESET_MKOPTS} -b ${BASEDIR}" [ -n "${MESSAGE}" ] && PRESET_MKOPTS="${PRESET_MKOPTS} -m \"${MESSAGE}\"" [ "${QUIET}" = "n" ] && PRESET_MKOPTS="${PRESET_MKOPTS} -v" - # Build all images - echo "==> Using ${PRESETDIR}/${PRESET}.preset" - if grep -q "PRESETS=(" ${PRESETDIR}/${PRESET}.preset; then - die "Invalid definition of PRESETS." - fi - . ${PRESETDIR}/${PRESET}.preset - - for p in ${PRESETS}; do + for p in ${PRESETS[@]}; do echo "==> Building image \"${p}\"" PRESET_CMD="${PRESET_MKOPTS}" @@ -230,6 +215,8 @@ fi BASEDIR=$(echo ${BASEDIR} | tr -s /) MODULEDIR=$(echo ${MODULEDIR} | tr -s /) +. "${FUNCTIONS}" + if [ "${SHOW_AUTOMODS}" = "y" ]; then echo "Modules autodetected:" . "${INSTDIR}/autodetect" diff --git a/mkinitcpio.d/example.preset b/mkinitcpio.d/example.preset index 9b9b32e..3fb32f1 100644 --- a/mkinitcpio.d/example.preset +++ b/mkinitcpio.d/example.preset @@ -1,7 +1,7 @@ # Example mkinitcpio preset file # preset names -PRESETS="default fallback" +PRESETS=('default' 'fallback') # ALL_kver is used if presetname_kver is not set # note for distribution kernels: this should be in a separate file |