Skip to content

Commit

Permalink
el: 将 selinux 开关写在 cmdline
Browse files Browse the repository at this point in the history
  • Loading branch information
bin456789 committed Nov 29, 2024
1 parent 1dd9b25 commit ca70bbb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions trans.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2964,16 +2964,14 @@ disable_selinux_kdump() {
os_dir=$1

# 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
sed -i 's/^SELINUX=enforcing/SELINUX=disabled/g' $os_dir/etc/selinux/config
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
fi
chroot $os_dir grubby --update-kernel ALL --args selinux=0

# kdump
# grubby 只处理 GRUB_CMDLINE_LINUX,不会处理 GRUB_CMDLINE_LINUX_DEFAULT
Expand Down

0 comments on commit ca70bbb

Please sign in to comment.