summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/linux-build.eclass33
1 files changed, 16 insertions, 17 deletions
diff --git a/eclass/linux-build.eclass b/eclass/linux-build.eclass
index 11e595fb..38188702 100644
--- a/eclass/linux-build.eclass
+++ b/eclass/linux-build.eclass
@@ -157,26 +157,23 @@ _linux-build_src_prepare_build() {
sys-boot/syslinux:0 /boot/extlinux/extlinux.conf
)
- for (( i = 0 ; i < ${#BOOTLOADERS[@]} ; i+=2 )) ; do
- if has_version "${BOOTLOADERS[i]}" && [[ -e "${EPREFIX}/${BOOTLOADERS[i+1]}" ]] ; then
- BOOTLOADER=Yes
- BOOTLOADER_DIR="${BOOTLOADERS[i+1]%/*}"
- BOOTLOADER_FILE="${BOOTLOADERS[i+1]##*/}"
+ KV_INSTALLED="$(best_version ${CATEGORY}/${PN}:${SLOT})"
+ KV_INSTALLED="${KV_INSTALLED/#${CATEGORY}\/${PN}-}"
- break
- fi
- done
+ if [[ -n "${KV_INSTALLED}" ]] ; then
+ for (( i = 0 ; i < ${#BOOTLOADERS[@]} ; i+=2 )) ; do
+ if ! has_version "${BOOTLOADERS[i]}" || [[ ! -e "${EPREFIX}/${BOOTLOADERS[i+1]}" ]] ; then
+ continue
+ fi
- if [[ "${BOOTLOADER}" == "Yes" ]] ; then
- KV_INSTALLED="$(best_version ${CATEGORY}/${PN}:${SLOT})"
- KV_INSTALLED="${KV_INSTALLED/#${CATEGORY}\/${PN}-}"
+ BOOTLOADER_DIR="${BOOTLOADERS[i+1]%/*}"
+ BOOTLOADER_FILE="${BOOTLOADERS[i+1]##*/}"
- if [[ -n "${KV_INSTALLED}" ]] ; then
mkdir -p "${WORKDIR}/bootloader/${BOOTLOADER_DIR}"
# Handle collision protect
- for (( i = 0 ; i < 9999 ; i++ )) ; do
- printf -v BOOTLOADER_PROTECTED_FILE "._cfg%04d_${BOOTLOADER_FILE}" "${i}"
+ for (( j = 0 ; j < 9999 ; j++ )) ; do
+ printf -v BOOTLOADER_PROTECTED_FILE "._cfg%04d_${BOOTLOADER_FILE}" "${j}"
if [[ ! -e "${EPREFIX}/${BOOTLOADER_DIR}/${BOOTLOADER_PROTECTED_FILE}" ]] ; then
break
fi
@@ -194,8 +191,10 @@ _linux-build_src_prepare_build() {
rm "${WORKDIR}/bootloader/${BOOTLOADER_DIR}/${BOOTLOADER_PROTECTED_FILE}"
fi
- echo "CONFIG_PROTECT=${BOOTLOADER_DIR}/${BOOTLOADER_FILE}" > "${WORKDIR}/env.d_42-${PN}"
- fi
+ _CONFIG_PROTECT+=( "${BOOTLOADER_DIR}/${BOOTLOADER_FILE}" )
+ done
+
+ echo "CONFIG_PROTECT='${_CONFIG_PROTECT[@]}'" > "${WORKDIR}/env.d_42-${P}"
fi
_linux-build_configval MODULES || ewarn "CONFIG_MODULES is not set"
@@ -388,7 +387,7 @@ _linux-build_src_install_build() {
doins -r "${WORKDIR}"/bootloader/boot/*
insinto /etc/env.d
- newins "${WORKDIR}/env.d_42-${PN}" "42-${PN}"
+ newins "${WORKDIR}/env.d_42-${P}" "42-${P}"
fi
use savedconfig && save_config "${BUILDDIR}/.config"