\section{Kernel Configuration}

\begin{frame}
   {Kernel Command Line}
   \begin{itemize}
      \item Parameters passed to the system at boot on the
      \textbf{kernel command line}

      \item Placed on the \texttt{linux} or \texttt{linux16}
      line in the \textbf{GRUB} configuration file:
      \file{grub.cfg} somewhere under \filelink{/boot}

      \item Can be  modified interactively at boot

      \item Exact appearance will depend on \textbf{Linux} distribution
      and version:
      \begin{kcode}
linux /boot/vmlinuz-4.15.0-58-generic \
       root=UUID=5cec328b-bcd6-46d2-bcfa-8430257cd7a5 \
       ro find_preseed=/preseed.cfg auto noprompt \
       priority=critical locale=en_US quiet crashkernel=512M-:192M
      \end{kcode}
      or

      \begin{cmd}
$ cat /proc/cmdline
   \end{cmd}
      \begin{response}
BOOT_IMAGE=/boot/vmlinuz-4.15.0-58-generic \
     root=UUID=5cec328b-bcd6-46d2-bcfa-8430257cd7a5\
     ro find_preseed=/preseed.cfg auto noprompt \
     priority=critical locale=en_US quiet crashkernel=512M-:192M
   \end{response}

   \end{itemize}
\end{frame}

\cprotect\note {

   Sample kernel command lines will depend on distributions and might look
   like:
   \begin{kcode} 
linux /boot/vmlinuz-4.19.0 root=UUID=7ef4e747-afae-48e3-90b4-9be8be8d0258 ro quiet crashkernel=384M-:128M

linuxefi /boot/vmlinuz-5.2.9 root=UUID=77461ee7-c34a-4c5f-b0bc-29f4feecc743 ro crashkernel=auto rhgb quiet
\end{kcode}

   and would be found in \filelink{grub.cfg} in a
   subdirectory under \filelink{boot}, such as
   \filelink{/boot/grub} or in a place like
   \filelink{/boot/efi/EFI/centos/grub.cfg}.

   Everything after the \texttt{vmlinuz} file specified is an
   option.  Any options not understood by the kernel will be
   passed to \textbf{init} (\texttt{pid = 1}) the first user
   process to be run on the system.
   To see what command line a system was booted with type:
   \begin{cmd}
$ cat /proc/cmdline
   \end{cmd}
   \vspace{-12pt}
   \begin{klst}[]
BOOT_IMAGE=(hd0,msdos1)/boot/vmlinuz-5.11.0 root=UUID=7a8244d5-f289-4067-8ad6-9090080b7e35 ro resume=UUID=d602c4e1-ef8a-4945-8e3b-e98fcc8bfba2 rhgb quiet
   \end{klst}

   \begin{info}[BLSFG Changes things]
      \textbf{Fedora} and \textbf{RHEL/CentOS 8} now use
      \textbf{BLSFG} (Boot Loader Specification
      Configuration) which alters where the kernel command
      line is set.
      You should now look in \filelink{/boot/grub2/grubenv}
      for that information.

      We will discuss this later in more detail when we take
      up \textbf{grub} in a full chapter.

   \end{info}

}

\section{Kernel Boot Parameters}
\begin{frame}
   {Kernel Boot Parameters}

   \begin{itemize}
      \item Appear on the kernel line in \filelink{grub.cfg}
      \item Can also be supplied interactively at boot
      \item Parameters can be specified either as:
      \begin{itemize}
         \item a simple value as an argument
         \item in the form \verb?param=value? where
         \verb?value? can be a string, integer, array of
         integers etc.
      \end{itemize}
      \begin{kcode}
vmlinuz root=/dev/sda6 .....  noapic .... crashkernel=256M
      \end{kcode}
      \item No intentionally secret, hidden, parameters
      \item
      Enumerated in \filelink{kernel-parameters.txt} in the kernel source
   \end{itemize}

\end{frame}

\cprotect\note{

   Kernel options are placed at the end of the kernel
   line and are separated by spaces.  An example of
   kernel boot parameters (all on one line):

   \begin{kcode}
linux16 /boot/vmlinuz-3.19.1.0 root=UUID=178d0092-4154-4688-af24-cda272265e08 ro 
        vconsole.keymap=us crashkernel=auto  vconsole.font=latarcyrheb-sun16 rhgb quiet LANG=en_US.UTF-8
   \end{kcode}
   \begin{itemize}
      \item \verb?root?: root filesystem
      \item \verb?ro?: mounts root device read-only on boot
      \item \verb?vconsole.keymap?: which keyboard to use on the console
      \item \verb?crashkernel?: how much memory to set aside for \textbf{kernel crashdumps}
      \item \verb?vconsole.font?: which font to use on the console
      \item \texttt{rhgb}: for graphical boot
      \item \texttt{quiet}: disables most log messages
      \item \texttt{LANG}: is the system language
   \end{itemize}

   See \textbf{man bootparam} and
   \filelink{kernel-parameters.txt} in the kernel
   documentation.  Kernel documentation can be found in a
   package with a name like \textbf{kernel-doc} or
   \textbf{linux-doc}, or online at
   \url{http://kernel.org/doc/Documentation/}.  }



