DRIVER=processor
MODALIAS=cpu:type:x86,ven0002fam001Amod0002:feature:,0000,0001,0002,0003,0004,0005,0006,0007,0008,0009,000B,000C,000D,000E,000F,0010,0011,0013,0017,0018,0019,001A,0020,0021,0022,0023,0024,0025,0026,0027,0028,0029,002B,002C,002D,002E,002F,0030,0031,0034,0036,0037,0038,0039,003A,003B,003D,0064,0065,006E,0070,0074,0075,0079,007A,007F,0080,0081,0089,008C,008D,0091,0093,0094,0095,0096,0097,0098,0099,009A,009B,009C,009D,009E,009F,00C0,00C1,00C2,00C4,00C5,00C6,00C7,00C8,00C9,00D7,00EA,00F0,00F1,00F4,00F9,00FA,00FB,00FC,00FE,010F,0114,0115,0120,0121,0123,0125,0127,0128,0129,012A,0130,0131,0132,0133,0134,0135,0137,0138,013C,013D,013E,013F,0140,0141,0142,0143,0165,017A,0184,0185,018B,01A0,01A2,01A9,01AC,01AE,01AF,01B1,01B8,01BC,01C2,01E0,01E1,01E3,01E4,01E5,01E6,01EA,01EC,01EF,01F0,01F9,01FC,0201,0202,0203,0204,0206,0208,0209,020A,020B,020C,020E,0210,0216,021B,021C,0220,0221,0244,0248,025A,025B,025C,025D,025F,0280,0281,0282,0286,0288,029B,029C,029E

  9   	ˆl–Ým_J*j"Tâ€ÆY¸&”Å£Æƒh¹a–Ým_J*j"Tâ€ÆY¸&”Å£Ä      	auto
  <   ˆl–ß=¿J	µ2ÛR‚ œP ¸'.4Ê˜´oÈƒmð;_˜uÐb&=LyXÕ!#¢…�Re¤I�R?ÀÆ     #!/usr/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"

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

case "$COMMAND" in
    remove)
        if [ -f "/lib/modules/$KERNEL_VERSION/vmlinuz" ] && [ "$KERNEL_INSTALL_BOOT_ENTRY_TYPE" = "type2" ]; then
            [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
                echo "BOOT_ENTRY_TYPE=type2, not removing loader entries."
            exit 0
        fi
        [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
            echo "Removing $BOOT_ROOT/loader/entries/$ENTRY_TOKEN-$KERNEL_VERSION*.conf"
        exec rm -f \
            "$BOOT_ROOT/loader/entries/$ENTRY_TOKEN-$KERNEL_VERSION.conf" \
            "$BOOT_ROOT/loader/entries/$ENTRY_TOKEN-$KERNEL_VERSION+"*".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"

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 [ -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