8 # If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory.
9 # So, let's skip to create initrd.
10 if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then
17 INITRD_IMAGE_PREGENERATED
=${KERNEL_IMAGE%/*}/initrd
18 if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then
19 # we found an initrd at the same place as the kernel
20 # use this and don't generate a new one
21 cp --reflink=auto
"$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/initrd" \
22 && chown root
:root
"$BOOT_DIR_ABS/initrd" \
23 && chmod 0600 "$BOOT_DIR_ABS/initrd" \
27 if [[ -f /etc
/kernel
/cmdline
]]; then
28 read -r -d '' -a BOOT_OPTIONS
< /etc
/kernel
/cmdline
29 elif [[ -f /usr
/lib
/kernel
/cmdline
]]; then
30 read -r -d '' -a BOOT_OPTIONS
< /usr
/lib
/kernel
/cmdline
33 if ! [[ ${BOOT_OPTIONS[*]} ]]; then
34 read -r -d '' -a BOOT_OPTIONS
< /proc
/cmdline
37 unset noimageifnotneeded
39 for ((i
=0; i
< "${#BOOT_OPTIONS[@]}"; i
++)); do
40 if [[ ${BOOT_OPTIONS[$i]} == root\
=PARTUUID\
=* ]]; then
41 noimageifnotneeded
="yes"
45 dracut
${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS"/initrd
"$KERNEL_VERSION"
49 rm -f -- "$BOOT_DIR_ABS"/initrd