diff options
-rwxr-xr-x | mbuto | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -1135,9 +1135,15 @@ usage() { echo " kernel version. Default: $(uname -r)" echo " -m PATH" echo " relative root for /lib/modules. Default: /" - echo " -p PROFILE" - echo " select profile for add-ons, one of:" + echo " -p PROFILE|FILE" + echo " select profile for add-ons, built-in PROFILEs are:" echo " base bash kata kata_debug passt kselftests" + echo + echo " alternatively, an executable shell script FILE" + echo " including assignments of configuration variables can be" + echo " used. To avoid collisions with built-in profiles, FILE" + echo " needs to be as a command, e.g. './passt', not 'passt'" + echo echo " Default: base" echo echo " kselftests sub-options (same as run_kselftests.sh):" @@ -1247,9 +1253,13 @@ fi # Create working directory wd="$("${MKTEMP}" -d)" -# Apply profile requested via -p, if any, from matching profile_*() function -if [ -n "${PROFILE}" ]; then - notice "Applying profile ${PROFILE}" +# Apply profile requested from file or matching profile_*() function +if [ -x "${PROFILE}" ] && __profile_file="$(command -v ${PROFILE})" && \ + [ "${PROFILE}" = "${__profile_file}" ]; then + notice "Applying profile from file ${PROFILE}" + . "${PROFILE}" +else + notice "Applying built-in profile ${PROFILE}" eval "profile_${PROFILE}" || err "profile ${PROFILE} not found" fi |