mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
el: 将 selinux 开关写在 cmdline
This commit is contained in:
parent
1dd9b25f72
commit
ca70bbb3fa
10
trans.sh
10
trans.sh
@ -2964,16 +2964,14 @@ disable_selinux_kdump() {
|
|||||||
os_dir=$1
|
os_dir=$1
|
||||||
|
|
||||||
# selinux
|
# selinux
|
||||||
|
# https://access.redhat.com/solutions/3176
|
||||||
|
# centos7 也建议将 selinux 开关写在 cmdline
|
||||||
|
# grep selinux=0 /usr/lib/dracut/modules.d/98selinux/selinux-loadpolicy.sh
|
||||||
|
# warn "To disable selinux, add selinux=0 to the kernel command line."
|
||||||
if [ -f $os_dir/etc/selinux/config ]; then
|
if [ -f $os_dir/etc/selinux/config ]; then
|
||||||
sed -i 's/^SELINUX=enforcing/SELINUX=disabled/g' $os_dir/etc/selinux/config
|
sed -i 's/^SELINUX=enforcing/SELINUX=disabled/g' $os_dir/etc/selinux/config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# https://access.redhat.com/solutions/3176
|
|
||||||
# shellcheck disable=SC2154
|
|
||||||
# openeuler 版本是 24.03
|
|
||||||
if [ "$distro" = openeuler ] || [ "$releasever" -ge 9 ]; then
|
|
||||||
chroot $os_dir grubby --update-kernel ALL --args selinux=0
|
chroot $os_dir grubby --update-kernel ALL --args selinux=0
|
||||||
fi
|
|
||||||
|
|
||||||
# kdump
|
# kdump
|
||||||
# grubby 只处理 GRUB_CMDLINE_LINUX,不会处理 GRUB_CMDLINE_LINUX_DEFAULT
|
# grubby 只处理 GRUB_CMDLINE_LINUX,不会处理 GRUB_CMDLINE_LINUX_DEFAULT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user