diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 2dddc39816..11c19304f8 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -163,12 +163,13 @@ update_bls_cmdline() local cmdline="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" local -a files=($(get_sorted_bls)) - if [[ ! -f /etc/kernel/cmdline ]] || - [[ /etc/kernel/cmdline -ot /etc/default/grub ]]; then - # anaconda has the correct information to create this during install; - # afterward, grubby will take care of syncing on updates. If the user - # has modified /etc/default/grub, try to cope. - echo "$cmdline" > /etc/kernel/cmdline + if [ -w /etc/kernel ] && + [[ ! -f /etc/kernel/cmdline || + /etc/kernel/cmdline -ot /etc/default/grub ]]; then + # anaconda has the correct information to create this during install; + # afterward, grubby will take care of syncing on updates. If the user + # has modified /etc/default/grub, try to cope. + echo "$cmdline" > /etc/kernel/cmdline fi for bls in "${files[@]}"; do