MAJOR=4
MINOR=57
DEVNAME=tty57
  "   ˆl–Ým_J*j"Tâ�ÆÛ¸ÈÅ£Âƒh¹¿Ä      MAJOR=4
MINOR=48
DEVNAME=tty48
  1   ˆl–ßi~”d
e¶¥8 ¸Û— 1hßÃ„eÖ™s_ŒuÐb&=LyYÿÁÆ ?÷     #!/usr/bin/bash
#
# functions used only by dracut and dracut modules
#
# Copyright 2005-2009 Red Hat, Inc.  All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
export LC_MESSAGES=C

if [[ $EUID == "0" ]] && ! [[ $DRACUT_NO_XATTR ]]; then
    export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,xattr,links -dfr"
else
    export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,links -dfr"
fi

# is_func <command>
# Check whether $1 is a function.
is_func() {
    [[ "$(type -t "$1")" == "function" ]]
}

if ! [[ $dracutbasedir ]]; then
    dracutbasedir=${BASH_SOURCE[0]%/*}
    [[ $dracutbasedir == dracut-functions* ]] && dracutbasedir="."
    [[ $dracutbasedir ]] || dracutbasedir="."
    dracutbasedir="$(readlink -f $dracutbasedir)"
fi

if ! is_func dinfo > /dev/null 2>&1; then
    # shellcheck source=./dracut-logger.sh
    . "$dracutbasedir/dracut-logger.sh"
    dlog_init
fi

# shellcheck disable=SC2154
if ! [[ $initdir ]]; then
    dfatal "initdir not set"
    exit 1
fi

if ! [[ -d $initdir ]]; then
    mkdir -p "$initdir"
fi

if ! [[ $kernel ]]; then
    kernel=$(uname -r)
    export kernel
fi

# shellcheck disable=SC2154
srcmods="$dracutsysrootdir/lib/modules/$kernel/"

# shellcheck disable=SC2154
[[ $drivers_dir ]] && {
    if ! command -v kmod &> /dev/null && vercmp "$(modprobe --version | cut -d' ' -f3)" lt 3.7; then
        dfatal 'To use --kmoddir option module-init-tools >= 3.7 is required.'
        exit 1
    fi
    srcmods="$drivers_dir"
}
export srcmods

# export standard hookdirs
[[ $hookdirs ]] || {
    hookdirs="cmdline pre-udev pre-trigger netroot "
    hookdirs+="initqueue initqueue/settled initqueue/online initqueue/finished initqueue/timeout "
    hookdirs+="pre-mount pre-pivot cleanup mount "
    hookdirs+="emergency shutdown-emergency pre-shutdown shutdown "
    export hookdirs
}

DRACUT_LDD=${DRACUT_LDD:-ldd}
DRACUT_TESTBIN=${DRACUT_TESTBIN:-/bin/sh}
DRACUT_LDCONFIG=${DRACUT_LDCONFIG:-ldconfig}

# shellcheck source=./dracut-functions.sh
. "$dracutbasedir"/dracut-functions.sh

# Detect lib paths
if ! [[ $libdirs ]]; then
    if [[ $("$DRACUT_LDD" "$dracutsysrootdir$DRACUT_TESTBIN") == */lib64/* ]] &> /dev/null \
        && [[ -d $dracutsysrootdir/lib64 ]]; then
        libdirs+=" /lib64"
        [[ -d $dracutsysrootdir/usr/lib64 ]] && libdirs+=" /usr/lib64"
    else
        libdirs+=" /lib"
        [[ -d $dracutsysrootdir/usr/lib ]] && libdirs+=" /usr/lib"
    fi

    libdirs+=" $(ldconfig_paths)"

    export libdirs
fi

# helper function for check() in module-setup.sh
# to check for required installed binaries
# issues a standardized warning message
require_binaries() {
    # shellcheck disable=SC2154
    local _module_name="${moddir##*/}"
    local _ret=0

    if [[ $1 == "-m" ]]; then
        _module_name="$2"
        shift 2
    fi

    for cmd in "$@"; do
        if ! find_binary "$cmd" &> /dev/null; then
            dinfo "dracut module '${_module_name#[0-9][0-9]}' will not be installed, because command '$cmd' could not be found!"
            ((_ret++))
        fi
    done
    return "$_ret"
}

require_any_binary() {
    local _module_name="${moddir##*/}"
    local _ret=1

    if [[ $1 == "-m" ]]; then
        _module_name="$2"
        shift 2
    fi

    for cmd in "$@"; do
     