Gestionnaire de fichiers - Editer - /home/wwgoat/public_html/blog/kernel.tar
Arrière
postinst.d/51-dracut-rescue-postinst.sh 0000755 00000003214 14720724632 0014071 0 ustar 00 #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh export LANG=C KERNEL_VERSION="$1" KERNEL_IMAGE="$2" [[ -f /etc/os-release ]] && . /etc/os-release if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then systemd-machine-id-setup fi [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id [[ $MACHINE_ID ]] || exit 1 [[ -f $KERNEL_IMAGE ]] || exit 1 INITRDFILE="/boot/initramfs-0-rescue-${MACHINE_ID}.img" NEW_KERNEL_IMAGE="${KERNEL_IMAGE%/*}/vmlinuz-0-rescue-${MACHINE_ID}" [[ -f $INITRDFILE ]] && [[ -f $NEW_KERNEL_IMAGE ]] && exit 0 dropindirs_sort() { suffix=$1; shift args=("$@") files=$( while (( $# > 0 )); do for i in ${1}/*${suffix}; do [[ -f $i ]] && echo ${i##*/} done shift done | sort -Vu ) for f in $files; do for d in "${args[@]}"; do if [[ -f "$d/$f" ]]; then echo "$d/$f" continue 2 fi done done } # source our config dir for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do [[ -e $f ]] && . "$f" done [[ $dracut_rescue_image != "yes" ]] && exit 0 if [[ ! -f $INITRDFILE ]]; then dracut --no-hostonly -a "rescue" "$INITRDFILE" "$KERNEL_VERSION" ((ret+=$?)) fi if [[ ! -f $NEW_KERNEL_IMAGE ]]; then cp "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE" ((ret+=$?)) fi new-kernel-pkg --install "$KERNEL_VERSION" --kernel-image "$NEW_KERNEL_IMAGE" --initrdfile "$INITRDFILE" --banner "$NAME $VERSION_ID Rescue $MACHINE_ID" ((ret+=$?)) exit $ret install.d/50-depmod.install 0000755 00000000277 14720727223 0011535 0 ustar 00 #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh [[ $1 == "add" ]] || exit 0 [[ $2 ]] || exit 1 exec depmod -a "$2" install.d/51-dracut-rescue.install 0000755 00000004475 14720727223 0013040 0 ustar 00 #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh export LANG=C COMMAND="$1" KERNEL_VERSION="$2" BOOT_DIR_ABS="${3%/*}/0-rescue" KERNEL_IMAGE="$4" dropindirs_sort() { suffix=$1; shift args=("$@") files=$( while (( $# > 0 )); do for i in ${1}/*${suffix}; do [[ -f $i ]] && echo ${i##*/} done shift done | sort -Vu ) for f in $files; do for d in "${args[@]}"; do if [[ -f "$d/$f" ]]; then echo "$d/$f" continue 2 fi done done } [[ -f /etc/os-release ]] && . /etc/os-release if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then systemd-machine-id-setup fi [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id if [[ -f /etc/kernel/cmdline ]]; then readarray -t BOOT_OPTIONS < /etc/kernel/cmdline fi if ! [[ "${BOOT_OPTIONS[@]}" ]]; then readarray -t BOOT_OPTIONS < /proc/cmdline fi if ! [[ $BOOT_OPTIONS ]]; then exit 1 fi LOADER_ENTRY="/boot/loader/entries/${MACHINE_ID}-0-rescue.conf" BOOT_DIR="/${MACHINE_ID}/0-rescue" ret=0 case "$COMMAND" in add) for i in "/boot/loader/entries/${MACHINE_ID}-0-rescue.conf"; do [[ -f $i ]] && exit 0 done # source our config dir for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do [[ -e $f ]] && . "$f" done [[ $dracut_rescue_image != "yes" ]] && exit 0 [[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS" if ! cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'!" >&2 fi dracut --no-hostonly -a "rescue" "$BOOT_DIR_ABS"/initrd "$2" ((ret+=$?)) { echo "title $PRETTY_NAME - Rescue Image" echo "version $KERNEL_VERSION" echo "machine-id $MACHINE_ID" echo "options ${BOOT_OPTIONS[@]} rd.auto=1" echo "linux $BOOT_DIR/linux" echo "initrd $BOOT_DIR/initrd" } > $LOADER_ENTRY ((ret+=$?)) ;; remove) exit 0 ;; *) usage ret=1;; esac ((ret+=$?)) exit $ret install.d/90-loaderentry.install 0000755 00000003770 14720727223 0012622 0 ustar 00 #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh COMMAND="$1" KERNEL_VERSION="$2" BOOT_DIR_ABS="$3" KERNEL_IMAGE="$4" if [[ -f /etc/machine-id ]]; then read MACHINE_ID < /etc/machine-id fi if ! [[ $MACHINE_ID ]]; then exit 1 fi BOOT_DIR="/$MACHINE_ID/$KERNEL_VERSION" LOADER_ENTRY="/boot/loader/entries/$MACHINE_ID-$KERNEL_VERSION.conf" if [[ $COMMAND == remove ]]; then exec rm -f "$LOADER_ENTRY" fi if ! [[ $COMMAND == add ]]; then exit 1 fi if ! [[ $KERNEL_IMAGE ]]; then exit 1 fi if [[ -f /etc/os-release ]]; then . /etc/os-release elif [[ -f /usr/lib/os-release ]]; then . /usr/lib/os-release fi if ! [[ $PRETTY_NAME ]]; then PRETTY_NAME="Linux $KERNEL_VERSION" fi declare -a BOOT_OPTIONS if [[ -f /etc/kernel/cmdline ]]; then readarray -t BOOT_OPTIONS < /etc/kernel/cmdline fi if ! [[ ${BOOT_OPTIONS[*]} ]]; then read -a line -r < /proc/cmdline for i in "${line[@]}"; do [[ "${i#initrd=*}" != "$i" ]] && continue BOOT_OPTIONS[${#BOOT_OPTIONS[@]}]="$i" done fi if ! [[ ${BOOT_OPTIONS[*]} ]]; then echo "Could not determine the kernel command line parameters." >&2 echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2 exit 1 fi cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS/linux" && chown root:root "$BOOT_DIR_ABS/linux" && chmod 0644 "$BOOT_DIR_ABS/linux" || { echo "Could not copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'." >&2 exit 1 } mkdir -p "${LOADER_ENTRY%/*}" || { echo "Could not create loader entry directory '${LOADER_ENTRY%/*}'." >&2 exit 1 } { echo "title $PRETTY_NAME" echo "version $KERNEL_VERSION" echo "machine-id $MACHINE_ID" echo "options ${BOOT_OPTIONS[*]}" echo "linux $BOOT_DIR/linux" [[ -f $BOOT_DIR_ABS/initrd ]] && \ echo "initrd $BOOT_DIR/initrd" : } > "$LOADER_ENTRY" || { echo "Could not create loader entry '$LOADER_ENTRY'." >&2 exit 1 } exit 0 install.d/50-dracut.install 0000755 00000001260 14720727223 0011540 0 ustar 00 #!/bin/sh # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh if [[ -f /etc/kernel/cmdline ]]; then readarray -t BOOT_OPTIONS < /etc/kernel/cmdline fi if ! [[ "${BOOT_OPTIONS[@]}" ]]; then readarray -t BOOT_OPTIONS < /proc/cmdline fi unset noimageifnotneeded for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then noimageifnotneeded="yes" break fi done ret=0 case "$1" in add) dracut ${noimageifnotneeded:+--noimageifnotneeded} "$3"/initrd "$2" ret=$? ;; remove) rm -f -- "$3"/initrd ret=$? ;; esac exit $ret etc/sysconfig/kernel 0000644 00000000264 14720740565 0010542 0 ustar 00 # UPDATEDEFAULT specifies if new-kernel-pkg should make # new kernels the default UPDATEDEFAULT=yes # DEFAULTKERNEL specifies the default kernel package type DEFAULTKERNEL=kernel
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Génération de la page: 0 |
proxy
|
phpinfo
|
Réglages