summaryrefslogtreecommitdiffstats
path: root/helper/kernel.inc
diff options
context:
space:
mode:
Diffstat (limited to 'helper/kernel.inc')
-rw-r--r--helper/kernel.inc38
1 files changed, 18 insertions, 20 deletions
diff --git a/helper/kernel.inc b/helper/kernel.inc
index af2af38b..61fa3efd 100644
--- a/helper/kernel.inc
+++ b/helper/kernel.inc
@@ -7,21 +7,21 @@
# copies kernel modules as given in the module config file
# * depends on 'depmod'
# * requires REQUIRED_KERNEL_MODULES to be set.
-# (entries must be a relative path to /lib/modules/<KERNEL_VERSION>)
+# (entries must be a relative path to /lib/modules/<KERNEL_CURRENT_VERSION>)
#
# ex: for /lib/modules/3.2.0/kernel/fs/nfs/nfs.ko
# must be given as kernel/fs/nfs/nfs.ko
#
-# this code depends on KERNEL_VERSION, this file needs to be sourced after helper/system.inc!
-# (TODO: maybe source system.inc if KERNEL_VERSION is empty.
-if [ -z "${KERNEL_VERSION}" ]; then
+# this code depends on KERNEL_CURRENT_VERSION, this file needs to be sourced after helper/system.inc!
+# (TODO: maybe source system.inc if KERNEL_CURRENT_VERSION
+if [ -z "${KERNEL_CURRENT_VERSION}" ]; then
. ${ROOT_DIR}/helper/system.inc
- [ -z "${KERNEL_VERSION}" ] && perror "KERNEL_VERSION still not set after sourcing, something is very wrong..."
+ [ -z "${KERNEL_CURRENT_VERSION}" ] && perror "KERNEL_CURRENT_VERSION still not set after sourcing, something is very wrong..."
fi
# set global KERNEL_TARGET_NAME
-KERNEL_TARGET_NAME="vmlinuz-${KERNEL_VERSION}-openslx"
+KERNEL_TARGET_NAME="kernel"
check_kernel_build_dir() {
[ -d "${MODULES_DIR}/kernel/build" ] && KERNEL_BUILD_DIR="${MODULES_DIR}/kernel/build" \
@@ -31,7 +31,7 @@ check_kernel_build_dir() {
}
copy_kernel_modules() {
-
+ pinfo "Copying kernel modules for kernel ${KERNEL_CURRENT_VERSION}..."
[ -z "${REQUIRED_KERNEL_MODULES}" ] && perror "REQUIRED_KERNEL_MODULES is empty. Check your config file."
check_kernel_build_dir
#
@@ -104,8 +104,9 @@ copy_kernel_modules() {
copy_firmware() {
+ pinfo "Copying firmware for kernel ${KERNEL_CURRENT_VERSION}..."
[ -z "${REQUIRED_FIRMWARE}" ] && perror "REQUIRED_FIRMWARE is empty. Check your config file."
- local HORST=$(pwd)
+ local OLD_DIR=$(pwd)
check_kernel_build_dir
#
# process firmware list
@@ -126,14 +127,14 @@ copy_firmware() {
# if we didn't found it in the kernel build directory, check for firmware in the system firmware directory
if [ $FOUND -ne 1 ]; then
- for CANDIDATE in "/${FIRMWARE_DIR}/${FIRMWARE}" "/${FIRMWARE_DIR}/${KERNEL_VERSION}/${FIRMWARE}"; do
+ for CANDIDATE in "/${FIRMWARE_DIR}/${FIRMWARE}" "/${FIRMWARE_DIR}/${KERNEL_CURRENT_VERSION}/${FIRMWARE}"; do
if [ -e "${CANDIDATE}" ]; then
- if [ $(echo "${CANDIDATE}" | grep -c "${KERNEL_VERSION}") -eq 0 ]; then
+ if [ $(echo "${CANDIDATE}" | grep -c "${KERNEL_CURRENT_VERSION}") -eq 0 ]; then
pdebug "Copying from system: '${CANDIDATE}'"
FIRMWARE_LIST+=" ${CANDIDATE}"
else
pdebug "Copying from system: '${CANDIDATE}' to ${FIRMWARE_DIR}/${KERNEL_NEW_VERSION}/${FIRMWARE}"
- FIRMWARE_LIST+=" /${FIRMWARE_DIR}/${KERNEL_VERSION}/${FIRMWARE}"
+ FIRMWARE_LIST+=" /${FIRMWARE_DIR}/${KERNEL_CURRENT_VERSION}/${FIRMWARE}"
fi
FOUND=1
fi
@@ -152,26 +153,23 @@ copy_firmware() {
# post-process to fix the path of the firmwares found on the system unter /lib/firmware/$(uname -r)
# which have to be copied to /lib/firmware/${KERNEL_NEW_VERSION}
- if [ -d "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_VERSION}" ]; then
+ if [ -d "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_CURRENT_VERSION}" ]; then
mkdir -p "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_NEW_VERSION}/"
- #mv -f "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_VERSION}/"* "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_NEW_VERSION}/"
- cd "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_VERSION}" || perror "old kernel but no old kernel"
+ cd "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_CURRENT_VERSION}" || perror "old kernel but no old kernel"
tarcopy "$(ls)" "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_NEW_VERSION}/"
cd -
- rm -r "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_VERSION}" || perror "something went very wrong..."
+ rm -r "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_CURRENT_VERSION}" || perror "something went very wrong..."
else
- pdebug "No ${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_VERSION} directory, skipping the merge."
+ pdebug "No ${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_CURRENT_VERSION} directory, skipping the merge."
fi
- cd "$HORST"
+ cd "$OLD_DIR"
}
copy_kernel() {
-
- local TOOL_STR="$TOOL_STR copy_kernel:"
-
check_kernel_build_dir
+ local TOOL_STR="$TOOL_STR copy_kernel:"
local KERNEL_DIR="${MODE_DIR}/builds/kernel"
pinfo "Copying '${KERNEL_TARGET_NAME}' to '${KERNEL_DIR}'."
[ -d "${KERNEL_DIR}" ] || mkdir -p "${KERNEL_DIR}"