Broken NO_DRACUT_FALLBACK="true" in /etc/kernel-install-for-dracut.conf

I noticed that the option NO_DRACUT_FALLBACK=“true” in /etc/kernel-install-for-dracut.conf is no longer working. I am now getting fallback entries again:

Configured kernels in /boot/loader/entries :
4bd88beaa35549b5922de02c8064cbf1-6.1.49-1-lts-fallback.conf
4bd88beaa35549b5922de02c8064cbf1-6.1.49-1-lts.conf
4bd88beaa35549b5922de02c8064cbf1-6.1.49-273.1-tkg-cfs.conf
4bd88beaa35549b5922de02c8064cbf1-6.1.49-x64v3-xanmod1-1-lts-fallback.conf
4bd88beaa35549b5922de02c8064cbf1-6.1.49-x64v3-xanmod1-1-lts.conf
4bd88beaa35549b5922de02c8064cbf1-6.4.12-273.1-tkg-cfs-fallback.conf
4bd88beaa35549b5922de02c8064cbf1-6.4.12-273.1-tkg-cfs.conf
memtest86-efi.conf

As you can see, the kernel 6.1.49-273.1-tkg-cfs does not have a fallback entry because I installed it in the morning of 28. August. The kernels I installed starting the 29. August all have fallback entries.

Is this update the culprit?

[2023-08-28T15:58:20+0200] [ALPM] upgraded kernel-install-for-dracut (1.8-1 -> 1.9-1)

PS
Interesting is, that I do not see additional fallback initrd’s.

Content of /boot:

4bd88beaa35549b5922de02c8064cbf1/
4bd88beaa35549b5922de02c8064cbf1/6.1.49-1-lts/
4bd88beaa35549b5922de02c8064cbf1/6.1.49-1-lts/initrd
4bd88beaa35549b5922de02c8064cbf1/6.1.49-1-lts/linux
4bd88beaa35549b5922de02c8064cbf1/6.1.49-273.1-tkg-cfs/
4bd88beaa35549b5922de02c8064cbf1/6.1.49-273.1-tkg-cfs/initrd
4bd88beaa35549b5922de02c8064cbf1/6.1.49-273.1-tkg-cfs/linux
4bd88beaa35549b5922de02c8064cbf1/6.1.49-x64v3-xanmod1-1-lts/
4bd88beaa35549b5922de02c8064cbf1/6.1.49-x64v3-xanmod1-1-lts/initrd
4bd88beaa35549b5922de02c8064cbf1/6.1.49-x64v3-xanmod1-1-lts/linux
4bd88beaa35549b5922de02c8064cbf1/6.4.12-273.1-tkg-cfs/
4bd88beaa35549b5922de02c8064cbf1/6.4.12-273.1-tkg-cfs/initrd
4bd88beaa35549b5922de02c8064cbf1/6.4.12-273.1-tkg-cfs/linux
EFI/
EFI/BOOT/
EFI/BOOT/BOOTX64.EFI
EFI/Linux/
EFI/memtest86/
EFI/memtest86/Benchmark/
EFI/memtest86/Benchmark/mt86Bench-20221217-101353.ptx
EFI/memtest86/MemTest86-20221001-073419.log
EFI/memtest86/MemTest86-20221001-101000.log
EFI/memtest86/MemTest86-20221217-101305.log
EFI/memtest86/MemTest86-20221228-105102.log
EFI/memtest86/MemTest86-20230405-155018.log
EFI/memtest86/MemTest86-20230621-190515.log
EFI/memtest86/MemTest86-20230725-114053.log
EFI/memtest86/MemTest86-20230731-143525.log
EFI/memtest86/MemTest86.log
EFI/memtest86/blacklist.cfg
EFI/memtest86/memtestx64.efi
EFI/memtest86/mt86.png
EFI/memtest86/unifont.bin
EFI/systemd/
EFI/systemd/systemd-bootx64.efi
System Volume Information/
loader/
loader/entries/
loader/entries/4bd88beaa35549b5922de02c8064cbf1-6.1.49-1-lts-fallback.conf
loader/entries/4bd88beaa35549b5922de02c8064cbf1-6.1.49-1-lts.conf
loader/entries/4bd88beaa35549b5922de02c8064cbf1-6.1.49-273.1-tkg-cfs.conf
loader/entries/4bd88beaa35549b5922de02c8064cbf1-6.1.49-x64v3-xanmod1-1-lts-fallback.conf
loader/entries/4bd88beaa35549b5922de02c8064cbf1-6.1.49-x64v3-xanmod1-1-lts.conf
loader/entries/4bd88beaa35549b5922de02c8064cbf1-6.4.12-273.1-tkg-cfs-fallback.conf
loader/entries/4bd88beaa35549b5922de02c8064cbf1-6.4.12-273.1-tkg-cfs.conf
loader/entries/memtest86-efi.conf
loader/entries.srel
loader/loader.conf
loader/random-seed

That probably happened in the last update.

I will take a look at it and fix it tonight.

Thanks for reporting it.

1 Like

Should be fixed in 1.9.1. Available in the AUR now.

1 Like

No, it is still broken. I removed kernel 6.4.12-273.1-tkg-cfs and reinstalled it and I still get the fallback entry.

loader/entries/4bd88beaa35549b5922de02c8064cbf1-6.4.13-273.1-tkg-cfs-fallback.conf
loader/entries/4bd88beaa35549b5922de02c8064cbf1-6.4.13-273.1-tkg-cfs.conf

But this is only a fallback config. dracut is not doing any fallback stuff:

( 4/10) Running kernel-install...
:: kernel-install installing kernel 6.4.13-273.1-tkg-cfs
dracut: Executing: /usr/bin/dracut --hostonly --no-hostonly-cmdline -f /boot/4bd88beaa35549b5922de02c8064cbf1/6.4.13-273.1-tkg-cfs/initrd 6.4.13-273.1-tkg-cfs
dracut: *** Including module: systemd ***
dracut: *** Including module: systemd-initrd ***
dracut: *** Including module: i18n ***
dracut: *** Including module: kernel-modules ***
dracut: *** Including module: kernel-modules-extra ***
dracut: *** Including module: rootfs-block ***
dracut: *** Including module: terminfo ***
dracut: *** Including module: udev-rules ***
dracut: Skipping udev rule: 40-redhat.rules
dracut: Skipping udev rule: 50-firmware.rules
dracut: Skipping udev rule: 50-udev.rules
dracut: Skipping udev rule: 91-permissions.rules
dracut: Skipping udev rule: 80-drivers-modprobe.rules
dracut: Skipping udev rule: 70-persistent-net.rules
dracut: *** Including module: dracut-systemd ***
dracut: *** Including module: ostree ***
dracut: *** Including module: usrmount ***
dracut: *** Including module: base ***
dracut: *** Including module: fs-lib ***
dracut: *** Including module: shutdown ***
dracut: *** Including modules done ***
dracut: *** Installing kernel module dependencies ***
dracut: *** Installing kernel module dependencies done ***
dracut: *** Resolving executable dependencies ***
dracut: *** Resolving executable dependencies done ***
dracut: *** Hardlinking files ***
dracut: Mode:                     real
dracut: Method:                   sha256
dracut: Files:                    1422
dracut: Linked:                   108 files
dracut: Compared:                 0 xattrs
dracut: Compared:                 164 files
dracut: Saved:                    6.35 MiB
dracut: Duration:                 0.066947 seconds
dracut: *** Hardlinking files done ***
dracut: *** Generating early-microcode cpio image ***
dracut: *** Constructing AuthenticAMD.bin ***
dracut: *** Store current command line parameters ***
dracut: *** Stripping files ***
dracut: *** Stripping files done ***
dracut: *** Creating image file '/boot/4bd88beaa35549b5922de02c8064cbf1/6.4.13-273.1-tkg-cfs/initrd' ***
dracut: *** Creating initramfs image file '/boot/4bd88beaa35549b5922de02c8064cbf1/6.4.13-273.1-tkg-cfs/initrd' done ***
( 5/10) Cleaning up...
( 6/10) Cleaning up...
( 7/10) Updating dvb modules...
# /usr/share/libalpm/scripts/my-dvb-modules.sh  (exit)
( 8/10) Removing unnecessary cached files from /mnt/zM2/packages
==> no candidate packages found for pruning
( 9/10) Updating package lists...
(10/10) Removing obsolete cached package files (keeping the latest two)...
==> no candidate packages found for pruning

Are you sure that isn’t an old entry. If you do an ls -l on that directory, what is the timestamp on that file?

It is not old entries. Just installed linux-lts-6.1.50-1-x86_64:

-rwx------ 1 root root   52 2022-03-15@10:56 memtest86-efi.conf
-rwx------ 1 root root  560 2023-08-29@07:04 4bd88beaa35549b5922de02c8064cbf1-6.1.49-x64v3-xanmod1-1-lts-fallback.conf
-rwx------ 1 root root  608 2023-08-29@07:04 4bd88beaa35549b5922de02c8064cbf1-6.1.49-x64v3-xanmod1-1-lts.conf
-rwx------ 1 root root  542 2023-08-31@07:06 4bd88beaa35549b5922de02c8064cbf1-6.4.13-273.1-tkg-cfs-fallback.conf
-rwx------ 1 root root  584 2023-08-31@07:06 4bd88beaa35549b5922de02c8064cbf1-6.4.13-273.1-tkg-cfs.conf
-rwx------ 1 root root  542 2023-08-31@08:32 4bd88beaa35549b5922de02c8064cbf1-6.1.50-273.1-tkg-cfs-fallback.conf
-rwx------ 1 root root  584 2023-08-31@08:32 4bd88beaa35549b5922de02c8064cbf1-6.1.50-273.1-tkg-cfs.conf
drwx------ 3 root root 4,0K 2023-08-31@13:46 ..
-rwx------ 1 root root  518 2023-08-31@13:51 4bd88beaa35549b5922de02c8064cbf1-6.1.50-1-lts-fallback.conf
-rwx------ 1 root root  552 2023-08-31@13:51 4bd88beaa35549b5922de02c8064cbf1-6.1.50-1-lts.conf

And just to be sure that NO_DRACUT_FALLBACK is set properly:

╰─# cat /etc/kernel-install-for-dracut.conf     
# This config file controls the automation provided by kernel-install-for-dracut

# When DRACUT_QUIET is set to true, dracut will operate with quiet flag set suppressing most output
#DRACUT_QUIET="false"

# When NO_FALLBACK is set to true, no fallback initrd will be generated
NO_DRACUT_FALLBACK="true"

And the point is: Dracut is actually not creating a fallback initrd. But a *fallback.conf file for systemd is created.

Can you share the contents of /usr/lib/kernel/install.d/90-loaderentry-fallback.install

Can you also share ls /etc/kernel/install.d

`/usr/lib/kernel/install.d/90-loaderentry-fallback.install`
╰─# cat /usr/lib/kernel/install.d/90-loaderentry-fallback.install 
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <https://www.gnu.org/licenses/>.

set -e

COMMAND="${1:?}"
KERNEL_VERSION="${2:?}"
ENTRY_DIR_ABS="${3:?}"
KERNEL_IMAGE="$4"
INITRD_OPTIONS_SHIFT=4

[ "$KERNEL_INSTALL_LAYOUT" = "bls" ] || exit 0

MACHINE_ID="${KERNEL_INSTALL_MACHINE_ID:?}"
ENTRY_TOKEN="${KERNEL_INSTALL_ENTRY_TOKEN:?}"
BOOT_ROOT="${KERNEL_INSTALL_BOOT_ROOT:?}"

[ -n "$BOOT_MNT" ] || BOOT_MNT="$(stat -c %m "$BOOT_ROOT")"
if [ "$BOOT_MNT" = '/' ]; then
    ENTRY_DIR="$ENTRY_DIR_ABS"
else
    ENTRY_DIR="${ENTRY_DIR_ABS#"$BOOT_MNT"}"
fi

KERNEL_DEST="$ENTRY_DIR_ABS/linux"
KERNEL_ENTRY="$ENTRY_DIR/linux"
LOADER_ENTRY="$BOOT_ROOT/loader/entries/${ENTRY_TOKEN}-${KERNEL_VERSION}-fallback.conf"

case "$COMMAND" in
    remove)
        [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
            echo "Removing ${LOADER_ENTRY%.conf}*.conf"
        exec rm -f \
            "$LOADER_ENTRY" \
            "${LOADER_ENTRY%.conf}"*".conf"
        ;;
    add)
        ;;
    *)
        exit 0
        ;;
esac

if [ -f /etc/os-release ]; then
    # shellcheck source=/dev/null
    . /etc/os-release
elif [ -f /usr/lib/os-release ]; then
    # shellcheck source=/dev/null
    . /usr/lib/os-release
fi

[ -n "$PRETTY_NAME" ] || PRETTY_NAME="Linux $KERNEL_VERSION"

SORT_KEY="$IMAGE_ID"
[ -z "$SORT_KEY" ] && SORT_KEY="$ID-${KERNEL_VERSION}-fallback"

if [ -n "$KERNEL_INSTALL_CONF_ROOT" ]; then
    if [ -f "$KERNEL_INSTALL_CONF_ROOT/cmdline" ]; then
        BOOT_OPTIONS="$(tr -s "$IFS" ' ' <"$KERNEL_INSTALL_CONF_ROOT/cmdline")"
    fi
elif [ -r /etc/kernel/cmdline_fb ]; then
    BOOT_OPTIONS="$(tr -s "$IFS" ' ' </etc/kernel/cmdline_fb)"
elif [ -f /etc/kernel/cmdline ]; then
    BOOT_OPTIONS="$(tr -s "$IFS" ' ' </etc/kernel/cmdline)"
elif [ -f /usr/lib/kernel/cmdline ]; then
    BOOT_OPTIONS="$(tr -s "$IFS" ' ' </usr/lib/kernel/cmdline)"
else
    BOOT_OPTIONS="$(tr -s "$IFS" '\n' </proc/cmdline | grep -ve '^BOOT_IMAGE=' -e '^initrd=' | tr '\n' ' ')"
fi

BOOT_OPTIONS="${BOOT_OPTIONS% }"

# If the boot entries are named after the machine ID, then suffix the kernel
# command line with the machine ID we use, so that the machine ID remains
# stable, even during factory reset, in the initrd (where the system's machine
# ID is not directly accessible yet), and if the root file system is volatile.
if [ "$ENTRY_TOKEN" = "$MACHINE_ID" ] && ! echo "$BOOT_OPTIONS" | grep -q "systemd.machine_id="; then
    BOOT_OPTIONS="$BOOT_OPTIONS systemd.machine_id=$MACHINE_ID"
fi

TRIES_FILE="${KERNEL_INSTALL_CONF_ROOT:-/etc/kernel}/tries"

if [ -f "$TRIES_FILE" ]; then
    read -r TRIES <"$TRIES_FILE"
    if ! echo "$TRIES" | grep -q '^[0-9][0-9]*$'; then
        echo "$TRIES_FILE does not contain an integer." >&2
        exit 1
    fi
    LOADER_ENTRY="${LOADER_ENTRY%.conf}+$TRIES.conf"
fi

if ! [ -d "$ENTRY_DIR_ABS" ]; then
    echo "Error: entry directory '$ENTRY_DIR_ABS' does not exist" >&2
    exit 1
fi

install -m 0644 "$KERNEL_IMAGE" "$KERNEL_DEST" || {
    echo "Error: could not copy '$KERNEL_IMAGE' to '$KERNEL_DEST'." >&2
    exit 1
}
chown root:root "$KERNEL_DEST" || :

shift "$INITRD_OPTIONS_SHIFT"
# All files listed as arguments, and staged files starting with "initrd" are installed as initrds.
for initrd in "${KERNEL_INSTALL_STAGING_AREA}"/microcode* "${@}" "${KERNEL_INSTALL_STAGING_AREA}"/initrd*; do
    [ -f "$initrd" ] || {
        case "$initrd" in
            "${KERNEL_INSTALL_STAGING_AREA}/initrd*" | "${KERNEL_INSTALL_STAGING_AREA}/microcode*")
            continue ;;
        esac
        echo "Error: '$initrd' is not a file." >&2
        exit 1
    }

    initrd_basename="${initrd##*/}"
    [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Installing $ENTRY_DIR_ABS/$initrd_basename"
    install -m 0644 "$initrd" "$ENTRY_DIR_ABS/$initrd_basename" || {
        echo "Error: could not copy '$initrd' to '$ENTRY_DIR_ABS/$initrd_basename'." >&2
        exit 1
    }
    chown root:root "$ENTRY_DIR_ABS/$initrd_basename" || :
done

mkdir -p "${LOADER_ENTRY%/*}" || {
    echo "Error: could not create loader entry directory '${LOADER_ENTRY%/*}'." >&2
    exit 1
}

[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Creating $LOADER_ENTRY"
{
    echo "# Boot Loader Specification type#1 entry"
    echo "# File created by $0 (systemd 254.1-1-arch)"
    echo "title      $PRETTY_NAME"
    echo "version    ${KERNEL_VERSION}-fallback"
    if [ "$ENTRY_TOKEN" = "$MACHINE_ID" ]; then
        # See similar logic above for the systemd.machine_id= kernel command line option
        echo "machine-id $MACHINE_ID"
    fi
    [ -n "$SORT_KEY" ] && echo "sort-key   $SORT_KEY"
    echo "options    $BOOT_OPTIONS"
    echo "linux      $KERNEL_ENTRY"

    have_initrd=
    for initrd in "${KERNEL_INSTALL_STAGING_AREA}"/microcode* "${@}" "${KERNEL_INSTALL_STAGING_AREA}"/initrd* "${ENTRY_DIR_ABS}/initrd-fallback"; do
        [ -f "$initrd" ] || continue
        echo "initrd     $ENTRY_DIR/${initrd##*/}"
        have_initrd=yes
    done

    # Try "initrd", generated by dracut in its kernel-install hook, if no initrds were supplied
    [ -z "$have_initrd" ] && [ -f "$ENTRY_DIR_ABS/initrd-fallback" ] && echo "initrd     $ENTRY_DIR/initrd-fallback"
    :
} >"$LOADER_ENTRY" || {
    echo "Error: could not create loader entry '$LOADER_ENTRY'." >&2
    exit 1
}
exit 0
╰─# ls /etc/kernel/install.d
50-dracut.install  90-loaderentry.install

You don’t have the latest version of /usr/lib/kernel/install.d/90-loaderentry-fallback.install with the fix.

What version of kernel-install-for-dracut do you have?

╰─# pacman -Q kernel-install-for-dracut                                 
kernel-install-for-dracut 1.9-1

The fix is 1.9.1. You have 1.9.

The updated package may not have hit the repos yet.

ok. I didnt get that. The versions look very similar 1.9.1 != 1.9-1

1 Like

I downloaded a snapshot of version 1.9.1 and installed it. It works. All good. Thanks!

1 Like

I have already installed kernel-install-for-dracut 1.9.1-1. Reboot, still the fallback entries present in the bootloader.

Have you removed the kernels and reinstalled them? The fallback entries do not disappear on their own.

No, I must have overlooked it. Can I do that with akm?

I dont use akm. Can not tell.

But you could use pacman:

sudo pacman -R linux linux-headers 
sudo pacman -S linux linux-headers

This command removes (-R) and installs (-S) the kernel again.
DO NOT REBOOT BETWEEN BOTH COMMANDS.

And if you use the LTS kernel it is

sudo pacman -R linux-lts linux-lts-headers 
sudo pacman -S linux-lts linux-lts-headers

Or you could just wait for the next regular kernel update. That will remove the old and install the new kernel and fix the problem for you automatically. The *.fallback.conf files are only a cosmetic issue. They do not use much space and are harmless. You can just let them be until they vanish automatically.

1 Like

thx @mbod :ok_hand:

Instead of removing the kernel packages, it is a lot safer to run kernel-install.

For example, you can run sudo kernel-install remove 6.4.12-arch1-1 and then sudo reinstall-kernels

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.