• Home (current)
  • वर्तमान निदेशक => /bin/X11/
  • सूचना एवं अपलोड
    Info Server
Indian Cyber Force
Folders रचयन्तु सञ्चिकां रचयन्तु RansomWeb लॉगआउट
Current File : //bin/X11/kernel-install
#!/usr/bin/env bash
# -*- 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 <http://www.gnu.org/licenses/>.

SKIP_REMAINING=77

usage()
{
    echo "Usage:"
    echo "  $0 [OPTIONS...] add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE ...]"
    echo "  $0 [OPTIONS...] remove KERNEL-VERSION"
    echo "Options:"
    echo "  -h,--help     Print this help"
    echo "  -v,--verbose  Increase verbosity"
}

dropindirs_sort()
{
    local suffix=$1; shift
    local -a files
    local f d i

    readarray -t files <<<"$(
        for d in "$@"; do
            for i in "$d/"*"$suffix"; do
                if [[ -e "$i" ]]; then
                    echo "${i##*/}"
                fi
            done
        done | sort -Vu
    )"

    for f in "${files[@]}"; do
        for d in "$@"; do
            if [[ -e "$d/$f" ]]; then
                echo "$d/$f"
                continue 2
            fi
        done
    done
}

export LC_COLLATE=C

for i in "$@"; do
    if [ "$i" == "--help" -o "$i" == "-h" ]; then
        usage
        exit 0
    fi
done

KERNEL_INSTALL_VERBOSE=0
if [ "$1" == "--verbose" -o "$1" == "-v" ]; then
    shift
    KERNEL_INSTALL_VERBOSE=1
fi
export KERNEL_INSTALL_VERBOSE

if [[ "${0##*/}" == 'installkernel' ]]; then
    COMMAND='add'
    # make install doesn't pass any parameter wrt initrd handling
    INITRD_OPTIONS=()
else
    COMMAND="$1"
    shift
    INITRD_OPTIONS=( "${@:3}" )
fi

KERNEL_VERSION="$1"
KERNEL_IMAGE="$2"

# Reuse directory created without a machine ID present if it exists.
if [[ -d /efi/Default ]] || [[ -d /boot/Default ]] || [[ -d /boot/efi/Default ]]; then
    MACHINE_ID="Default"
elif [[ -f /etc/machine-id ]]; then
    read MACHINE_ID < /etc/machine-id
else
    MACHINE_ID="Default"
fi

if [[ ! $COMMAND ]] || [[ ! $KERNEL_VERSION ]]; then
    echo "Not enough arguments" >&2
    exit 1
fi

if [[ -d /efi/loader/entries ]] || [[ -d /efi/$MACHINE_ID ]]; then
    ENTRY_DIR_ABS="/efi/$MACHINE_ID/$KERNEL_VERSION"
elif [[ -d /boot/loader/entries ]] || [[ -d /boot/$MACHINE_ID ]]; then
    ENTRY_DIR_ABS="/boot/$MACHINE_ID/$KERNEL_VERSION"
elif [[ -d /boot/efi/loader/entries ]] || [[ -d /boot/efi/$MACHINE_ID ]]; then
    ENTRY_DIR_ABS="/boot/efi/$MACHINE_ID/$KERNEL_VERSION"
elif mountpoint -q /efi; then
    ENTRY_DIR_ABS="/efi/$MACHINE_ID/$KERNEL_VERSION"
elif mountpoint -q /boot/efi; then
    ENTRY_DIR_ABS="/boot/efi/$MACHINE_ID/$KERNEL_VERSION"
else
    ENTRY_DIR_ABS="/boot/$MACHINE_ID/$KERNEL_VERSION"
fi

export KERNEL_INSTALL_MACHINE_ID=$MACHINE_ID

ret=0

readarray -t PLUGINS <<<"$(
    dropindirs_sort ".install" \
        "/etc/kernel/install.d" \
        "/usr/lib/kernel/install.d"
)"

case $COMMAND in
    add)
        if [[ ! "$KERNEL_IMAGE" ]]; then
            echo "Command 'add' requires an argument" >&2
            exit 1
        fi

        if [[ ! -f "$KERNEL_IMAGE" ]]; then
            echo "Kernel image argument ${KERNEL_IMAGE} not a file" >&2
            exit 1
        fi

        for f in "${PLUGINS[@]}"; do
            if [[ -x $f ]]; then
                [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
                    echo "+$f add $KERNEL_VERSION $ENTRY_DIR_ABS $KERNEL_IMAGE ${INITRD_OPTIONS[@]}"
                "$f" add "$KERNEL_VERSION" "$ENTRY_DIR_ABS" "$KERNEL_IMAGE" "${INITRD_OPTIONS[@]}"
                x=$?
                if [[ $x == $SKIP_REMAINING ]]; then
                    break
                fi
                ((ret+=$x))
            fi
        done
        ;;

    remove)
        for f in "${PLUGINS[@]}"; do
            if [[ -x $f ]]; then
                [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
                    echo "+$f remove $KERNEL_VERSION $ENTRY_DIR_ABS"
                "$f" remove "$KERNEL_VERSION" "$ENTRY_DIR_ABS"
                x=$?
                if [[ $x == $SKIP_REMAINING ]]; then
                    break
                fi
                ((ret+=$x))
            fi
        done

        [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
            echo "Removing $ENTRY_DIR_ABS"

        rm -rf "$ENTRY_DIR_ABS"
        ((ret+=$?))
        ;;

    *)
        echo "Unknown command '$COMMAND'" >&2
        exit 1
        ;;
esac

exit $ret
Frontend Submission – Verilere bak
Menu
  • Top 10

Verilere bak

Follow us
  • facebook
  • twitter
Search
Login
Create
Menu

Verilere bak

Login

You are here:

  1. Home
  2. Frontend Submission

Frontend Submission

  • Story

    Mix text with images and embeds

  • Image

    JPG, PNG or GIF

  • Audio

    MP3 or SoundCloud embed, MixCloud, etc.

  • Video

    MP4 or YouTube embed, Vimeo, Dailymotion, etc.

  • Gallery

    A collection of images

  • Embed

    Facebook post, Twitter status, etc.

  • Link

    External site's link

  • Open list

    Everyone can submit new list items and vote up for the best submission

  • Ranked list

    Everyone can vote up for the best list item

  • Classic list

    A list-based article

  • Meme

    Create a funny pic

  • Trivia quiz

    What do you know about ...?

  • Personality quiz

    What type of person are you?

  • Poll

    One or multiple questions about a subject or person

  • Versus

    A poll where each question has two competing answers

  • Hot or Not

    A poll where each question has two opposite answers

Bir yanıt yazın Yanıtı iptal et

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

  • facebook
  • twitter

© 2017 bring the pixel. Remember to change this

  • Home
  • Contact us
Back to Top
Close
  • Top 10
  • Home
  • Animals
  • Funny
  • WOW
  • WTF
  • Features
  • facebook
  • twitter
Create

Log In

Sign In

Forgot password?

Forgot password?

Enter your account data and we will send you a link to reset your password.

Back to Login

Your password reset link appears to be invalid or expired.

Log in

Privacy Policy

Accept

Add to Collection

  • Public collection title

  • Private collection title

No Collections

Here you'll find all collections you've created before.

Close
of

Processing files…

Hey Friend!
Before You Go…

Get the best viral stories straight into your inbox before everyone else!

Don't worry, we don't spam

Close

Newsletter

Don’t miss out on new posts!

Don't worry, we don't spam

Close