<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Grub | Cyrille Froehlich</title>
    <link>https://cyrille.hazeliris.com/tag/grub/</link>
      <atom:link href="https://cyrille.hazeliris.com/tag/grub/index.xml" rel="self" type="application/rss+xml" />
    <description>Grub</description>
    <generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Fri, 25 Dec 2020 03:01:15 +0000</lastBuildDate>
    <image>
      <url>https://cyrille.hazeliris.com/media/icon_hua2ec155b4296a9c9791d015323e16eb5_11927_512x512_fill_lanczos_center_2.png</url>
      <title>Grub</title>
      <link>https://cyrille.hazeliris.com/tag/grub/</link>
    </image>
    
    <item>
      <title>Save last kernel used as grub&#39;s default</title>
      <link>https://cyrille.hazeliris.com/post/2020/12/25/set-grub-default-kernel/</link>
      <pubDate>Fri, 25 Dec 2020 03:01:15 +0000</pubDate>
      <guid>https://cyrille.hazeliris.com/post/2020/12/25/set-grub-default-kernel/</guid>
      <description>&lt;p&gt;The Nvidia driver currently available in buster-backport (450.80) seems to have issues with
the 5.9 kernel, resulting in an unavailable uvm module.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[ 8883.526038] nvidia_uvm: module uses symbols from proprietary module nvidia, inheriting taint.
[ 8883.526306] nvidia_uvm: Unknown symbol radix_tree_preloads (err -2)
[ 8883.526339] nvidia_uvm: Unknown symbol set_cpus_allowed_ptr (err -2)
[ 8883.526380] nvidia_uvm: Unknown symbol mmu_notifier_unregister (err -2)
[ 8883.526485] nvidia_uvm: Unknown symbol __mmu_notifier_register (err -2)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The next release (455.+) was said to fix this but has yet to reach the backports repository.
In the meantime, sticking to the 5.8 kernel is the easiest workaround. But I keep forgetting
to change the selection at boot time: power on the computer, untangle the mouse cord, look at
the screen and it&amp;rsquo;s already on the login. Speedy NVMe are great but better not blink .
Thus, I first thought of forcing grub to use the second entry as default and found these lines:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt; grep DEFAULT /etc/grub.d/*
...
if [ &amp;quot;x${GRUB_DEFAULT}&amp;quot; = &amp;quot;x&amp;quot; ] ; then GRUB_DEFAULT=0 ; fi
if [ &amp;quot;x${GRUB_DEFAULT}&amp;quot; = &amp;quot;xsaved&amp;quot; ] ; then GRUB_DEFAULT=&#39;${saved_entry}&#39; ; fi
...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So instead of hardcoding a value, it turns out we can also load a previously saved entry, just
by setting the two following variables in &lt;em&gt;/etc/default/grub&lt;/em&gt; and running &lt;em&gt;update-grub&lt;/em&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The first line enable the default selection based on the saved value, the second set the default
value on the current selection (thus a manual change on the grub menu is all that&amp;rsquo;s required to update
the saved default). Looking in the &lt;em&gt;/boot/grub/grub.cfg&lt;/em&gt;, we can see the additional command &lt;em&gt;savedefault&lt;/em&gt;
at the beginning of each menuentry section.&lt;/p&gt;
&lt;p&gt;Probably not a recent feature, but it is neat to find out your odd use-case is already handled nicely
in the configuration files.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
