| Server IP : 20.75.53.88 / Your IP : 216.73.217.138 [ Web Server : Apache System : Linux VMRALP-3 4.4.0-256-generic #290~14.04.1-Ubuntu SMP Thu Jun 20 09:24:50 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29+esm15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Domains : 3 Domains MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/initramfs-tools/scripts/init-premount/ |
Upload File : |
#!/bin/sh
# amd64-microcode initramfs-tools boot script
# Copyright (C) 2012,2013 Henrique de Moraes Holschuh <hmh@debian.org>
# Released under the GPL v2 or later license
#
# Triggers kernel firmware update requests for processor microcode
# when required.
#
# dependencies: firmware loader, microcode kernel support (built-in/module)
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
prereqs)
prereqs
exit 0
;;
esac
# hack to strip spaces
is_amd()
{
[ "x$1" = "xvendor_id" ] && [ "x$2" = "xAuthenticAMD" ] && HAS_AMD=1
}
# Only continue if we do possibly have firmware to install
[ -d /lib/firmware/amd-ucode ] || exit 0
# module load will already have caused the microcode to be fetched
{ while read -r module trash ; do [ "x$module" = "xmicrocode" ] && exit 0 ; done ; } < /proc/modules
# don't run on non-AMD
HAS_AMD=0
{ while IFS=: read -r field value ; do is_amd $field $value ; done ; } < /proc/cpuinfo
[ $HAS_AMD -eq 0 ] && exit 0;
. /scripts/functions
if [ -e /sys/devices/system/cpu/microcode/reload ] ; then
echo 1 > /sys/devices/system/cpu/microcode/reload || {
log_warning_msg "could not update the microcode of every processor"
}
else
# Try all online processors, broken kernels need this,
# fixed kernels will accept it only on the BSP and update
# all processors anyway, and -EINVAL all others... but we
# don't know which one is the BSP, so we try all of them
# and hide errors, the kernel will log any real problem.
log_begin_msg "Requesting microcode update using per-core interface"
for i in /sys/devices/system/cpu/cpu[0-9]*/microcode/reload ; do
echo 1 2>/dev/null > "$i" || true
done
log_end_msg
fi
: