return "$_ret"
}
+determine_kernel_image() {
+ local kversion="$1"
+ local paths=(
+ "/lib/modules/${kversion}/vmlinuz"
+ "/lib/modules/${kversion}/vmlinux"
+ "/lib/modules/${kversion}/Image"
+ "/boot/vmlinuz-${kversion}"
+ "/boot/vmlinux-${kversion}"
+ )
+
+ for path in "${paths[@]}"; do
+ if [ -f "$path" ]; then
+ echo "$path"
+ return 0
+ fi
+ done
+
+ echo "Could not find a Linux kernel image for version '$kversion'!" >&2
+ return 1
+}
+
if ! is_func dinfo > /dev/null 2>&1; then
# shellcheck source=./dracut-logger.sh
. "${BASH_SOURCE[0]%/*}/dracut-logger.sh"
=== Initramfs Functions
-FIXME
+==== determine_kernel_image <kversion>
+Helper function for determining the path for the kernel image file.
=== Network Modules
}
test_setup() {
+ # shellcheck source=./dracut-functions.sh
+ . "$PKGLIBDIR"/dracut-functions.sh
+
# Create what will eventually be our root filesystem
call_dracut --tmpdir "$TESTDIR" \
--add-confdir test-root \
}
test_setup() {
+ # shellcheck source=./dracut-functions.sh
+ . "$PKGLIBDIR"/dracut-functions.sh
+
# create root filesystem
# shellcheck disable=SC2153
call_dracut --tmpdir "$TESTDIR" \
lsinitrd "$1" | grep modules.dep | head -1 | sed 's;.*/\([^/]\+\)/modules.dep;\1;'
}
-determine_kernel_image() {
- local kversion="$1"
- local paths=(
- "/lib/modules/${kversion}/vmlinuz"
- "/lib/modules/${kversion}/vmlinux"
- "/lib/modules/${kversion}/Image"
- "/boot/vmlinuz-${kversion}"
- "/boot/vmlinux-${kversion}"
- )
-
- for path in "${paths[@]}"; do
- if [ -f "$path" ]; then
- echo "$path"
- return 0
- fi
- done
-
- echo "Could not find a Linux kernel image for version '$kversion'!" >&2
- exit 1
-}
-
# terminal sequence to set color to a 'success' color (currently: green)
function SETCOLOR_SUCCESS() { echo -en '\033[0;32m'; }
# terminal sequence to set color to a 'failure' color (currently: red)