#!/bin/bash

## Copyright (C) 2023 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## Copyright (C) 2023 - 2023 Friedrich Doku <friedrichdoku@gmail.com>
## See the file COPYING for copying conditions.

#set -x
set -e

kernel="$(kernel-file-detect)"

initrd="$(printf "%s\n" "$kernel" | sed "s#vmlinuz#initrd.img#")"
## example initrd:
## /boot//initrd.img-5.10.0-20-amd64

if ! test -r "$kernel"; then
   printf "%s\n" "$0: ERROR: Kernel File '$kernel' not found or not readable!" >&2
   exit 1
fi

printf "%s\n" "$initrd"
