I am trying to install the system76-driver
package. At the end of install, this info/note is emitted:
The System76 Driver package provides the following system services:
system76.service System76 airplane-mode hotkey and LED support
(!) To use system76.service, you must add "ec_sys.write_support=1" to your kernel command line
Since this is a new install using dracut
, I figured that it would be as simple as:
[root@my-host dracut.conf.d]# cat /etc/dracut.conf.d/system76-kernel.conf
# Needed for system76.service
# See: https://support.system76.com/articles/system76-software/
kernel_cmdline+=" ec_sys.write_support=1 "
[root@my-host dracut.conf.d]# dracut-rebuild
And then a reboot.
But after a reboot, I don’t see the command line in /proc/cmdline
. I got curious and started looking into how dracut-rebuild
worked:
[root@my-host dracut.conf.d]# cat $(which dracut-rebuild)
#!/usr/bin/env bash
#
# Rebuild all the initrds using dracut
# This finds the best token for systemd-boot
find_token() {
if [[ -s /etc/kernel/entry-token ]] ; then
cat /etc/kernel/entry-token
elif [[ -s /etc/machine-id ]] ; then
cat /etc/machine-id
elif [[ $(grep "^IMAGE_ID=" /etc/os-release) ]] ; then
grep "^IMAGE_ID=" /etc/os-release | awk -F"=" '{print $2}'
elif [[ $(grep "^ID=" /etc/os-release) ]] ; then
grep "^ID=" /etc/os-release | awk -F"=" '{print $2}'
fi
}
[[ -f /etc/kernel-install-for-dracut.conf ]] && source /etc/kernel-install-for-dracut.conf
ESP=$(bootctl --print-esp-path)
TOKEN=$(find_token)
while read -r pkgbase; do
kernelversion=$(basename "${pkgbase%/pkgbase}")
kernelname=$(cat "${pkgbase}")
INITRD_PATH="${ESP}/${TOKEN}/${kernelversion}"
if [[ ! -d "$INITRD_PATH" ]] ; then
echo 'Failed to build initrds, use "sudo reinstall-kernels" instead' 1>&2
exit 1
fi
echo "Running dracut for ${kernelname}-${kernelversion}"
[[ ${DRACUT_QUIET} == "true" ]] && DRACUT_EXTRA_PARAMS=" --quiet"
dracut --force --hostonly --no-hostonly-cmdline${DRACUT_EXTRA_PARAMS} "${INITRD_PATH}/initrd" "${kernelversion}"
[[ ${NO_DRACUT_FALLBACK} != "true" ]] && dracut --force --no-hostonly${DRACUT_EXTRA_PARAMS} "${INITRD_PATH}/initrd-fallback" "${kernelversion}"
done < <(find /usr/lib/modules -maxdepth 2 -type f -name pkgbase)
The docs offer seemingly conflicting details about the --hostonly
and ``-no-hostonly-cmdline` options.
My question:
- What do i need to do to add kernel commandline args?