先帝创业未半而中道崩殂,今天下三分,益州疲弊,此诚危急存亡之秋也。然侍卫之臣不懈于内,忠志之士忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气,不宜妄自菲薄,引喻失义,以塞忠谏之路也先帝は天下を興す志半ばにして志半ばにして崩御されました。今、天下は三つに分かれ、益州は疲弊しており、まさに存亡の危機に瀕しております。しかしながら、宮中で職務に励む臣下や、外地で身を顧みず尽力する志士たちがいるのは、ひとえに先帝から受けた格別な恩義を思い、陛下に報いようとする志があるからです。今こそ陛下には広く臣下の意見に耳を傾け、先帝の遺徳を輝かせ、志士たちの士気を高めるべきです。決して自らを卑下したり、不適切な例えを用いて忠言の道を閉ざしたりしてはなりません。鍏堝笣鍒涗笟鏈崐鑰屼腑閬撳穿娈傦紝浠婂ぉ涓嬩笁鍒嗭紝鐩婂窞鐤插紛锛屾璇氬嵄鎬ュ瓨浜′箣绉嬩篃銆傜劧渚嶅崼涔嬭嚕涓嶆噲浜庡唴锛屽繝蹇椾箣澹繕韬簬澶栬€咃紝鐩栬拷鍏堝笣涔嬫畩閬囷紝娆叉姤涔嬩簬闄涗笅涔熴€傝瘹瀹滃紑寮犲湥鍚紝浠ュ厜鍏堝笣閬楀痉锛屾仮寮樺織澹箣姘旓紝涓嶅疁濡勮嚜鑿茶杽锛屽紩鍠诲け涔夛紝浠ュ蹇犺皬涔嬭矾涔
⬆️ Go up: /usr
#!/bin/bash
umask 022
usage=0
enable_fips=
check=0
boot_config=1
err_if_disabled=0
fips_install_complete=0
output_text=1
is_ostree_system=0
if test -f /run/ostree-booted; then
is_ostree_system=1
fi
enable2txt () {
case "$1" in
0)
echo "disabled"
;;
1)
echo "enabled"
;;
esac
}
cond_echo () {
if test "$output_text" != 0;then
echo "$@"
fi
}
while test $# -ge 1 ; do
case "$1" in
--enable)
enable_fips=1
;;
--disable)
enable_fips=0
;;
--check)
check=1
enable_fips=2
;;
--is-enabled)
check=1
enable_fips=2
err_if_disabled=1
output_text=0
;;
--no-bootcfg)
boot_config=0
;;
*)
usage=1
;;
esac
shift
done
if test $usage = 1 -o x$enable_fips = x ; then
echo "Check, enable, or disable the system FIPS mode."
echo "usage: $0 --enable|--disable [--no-bootcfg]"
echo "usage: $0 --check"
echo "usage: $0 --is-enabled"
exit 2
fi
# We don't handle the boot config on OSTree systems for now; it is assumed to be
# handled at a higher level. E.g. in Fedora CoreOS and RHEL CoreOS, it is
# intrinsically tied to the firstboot procedure.
if test "$is_ostree_system" = 1 && test "$enable_fips" = 1 && test "$boot_config" = 1; then
cond_echo "Cannot perform boot config changes on OSTree systems (use --no-bootcfg)"
exit 1
fi
if test -f /etc/system-fips ; then
# On OSTree systems, /etc/system-fips in the real root marks completion.
if test ! -d /boot -o "$is_ostree_system" = 1 -o ! -x /usr/bin/lsinitrd -o x"$(/usr/bin/lsinitrd -f etc/system-fips 2>/dev/null || test $? = 2 && echo y)" != x ; then
fips_install_complete=1
fi
fi
if test $check = 1 ; then
test $fips_install_complete = 0 && cond_echo "Installation of FIPS modules is not completed."
fips_enabled=$(cat /proc/sys/crypto/fips_enabled)
cond_echo "FIPS mode is $(enable2txt $fips_enabled)."
if test "$fips_enabled" = 1 ; then
if test $fips_install_complete = 0 ; then
cond_echo "Inconsistent state detected."
exit 1
fi
current="$(cat /etc/crypto-policies/state/current)"
if test "$(echo $current | cut -f 1 -d :)" != "FIPS" ; then
cond_echo "The current crypto policy ($current) is not a FIPS policy."
fi
fi
if test "$fips_enabled" != 1 && test "$err_if_disabled" = 1;then
exit 2
fi
exit 0
fi
if [ $(id -u) != 0 ]; then
echo "You must be root to run $(basename $0)"
exit 1
fi
if test $enable_fips = 1 ; then
if test $fips_install_complete = 0 ; then
fips-finish-install --complete
if test $? != 0 ; then
echo "Installation of FIPS modules could not be completed."
exit 1
fi
fi
update-crypto-policies --no-reload --set FIPS 2>/dev/null
else
update-crypto-policies --no-reload --set DEFAULT 2>/dev/null
fi
boot_device="$(df -P /boot | tail -1)"
echo "$boot_device" | grep -q ' /$' && boot_device='/' || boot_device=$(echo "$boot_device" | cut -d ' ' -f 1)
if test x"$boot_device" = x ; then
echo "Boot device not identified, you have to configure the bootloader manually."
boot_device_opt=" boot=UUID=<your-boot-device-uuid>"
boot_config=0
else
if test "$boot_device" = / ; then
boot_device_opt=""
else
boot_device_opt=" boot=UUID=$(blkid -s UUID -o value $boot_device)"
fi
fi
if test $boot_config=1 && test ! -x "$(command -v grubby)" ; then
echo "The grubby command is missing, please configure the bootloader manually."
boot_config=0
fi
echo "FIPS mode will be $(enable2txt $enable_fips)."
fipsopts="fips=$enable_fips$boot_device_opt"
if test $boot_config = 0 ; then
echo "Now you need to configure the bootloader to add kernel options \"$fipsopts\""
echo "and reboot the system for the setting to take effect."
else
grubby --update-kernel=ALL --args="$fipsopts"
if test x"$(uname -m)" = xs390x; then
if command -v zipl >/dev/null; then
zipl >/dev/null 2>&1
else
echo -n '`zipl` execution has been skipped: '
echo '`zipl` not found.'
fi
fi
echo "Please reboot the system for the setting to take effect."
fi
exit 0