commit fd883c831957af3fa2f396d9a6f2f3b3ca7cf8ba
parent 51ca55377bdb81a93047753878b6e2ec23115e91
Author: Martin Kloeckner <mjkloeckner@gmail.com>
Date: Sun, 3 Nov 2024 16:36:35 -0300
update grub blog post
Diffstat:
3 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/blog/grub-linux-version-fix/grub-linux-version-fix.md b/blog/grub-linux-version-fix/grub-linux-version-fix.md
@@ -1,23 +1,25 @@
%%
-title: "GRUB: Incorrect Linux version `booting Linux linux ...`"
+title: "GRUB menu: Linux version not detected"
date: "02-Nov-2024"
%%
-# GRUB: Incorrect Linux version `booting Linux linux ...`
+# GRUB menu: Linux version not detected
-If for some reason your grub installation doesn't detect your Linux version
-properly, and displays it wrong or as `Arch Linux with Linux version linux` like
-in my case, you can solve it modifying the following files.
+If your grub installation doesn't detect the Linux versions properly, and
+displays it wrong in the prompt menu at boot, like in my case in which appeared
+as `Arch Linux with Linux version linux`, you can solve it by modifying the
+helper scripts which grub uses to build the configuration file.
The problem is cause by the script `grub-mkconfig` which is used to build the
grub configuration file `grub.cfg` (generally located on `/boot/grub/grub.cfg`).
-This script uses other helper scripts located on `/etc/grub.d/`, and in
-particular the file used to detect the Linux version is `/etc/grub.d/10_llinux`.
-This script uses the file name of the kernel for which the menu entry is being
-built (for example `/boot/vmlinuz-6.1.0-25-amd64`) to get the Linux version, but
-there are distributions like Arch Linux that doesn't add the suffix of version
-to the kernel file (for example `/boot/vmlinuz-linux`).
+The script `grub-mkconfig` uses other helper scripts located on `/etc/grub.d/`,
+and in particular the file used to detect the Linux version is
+`/etc/grub.d/10_linux`. The script `10_linux` uses the file name of the kernel
+for which the menu entry is being built (for example
+`/boot/vmlinuz-6.1.0-25-amd64`) to get the Linux version, but there are
+distributions like Arch Linux that doesn't add the suffix of version to the
+kernel file (for example `/boot/vmlinuz-linux`).
The solution is to to modify the file `/etc/grub.d/10_linux` and make the
following changes (also as a [diff file](https://gist.githubusercontent.com/mjkloeckner/214a0ee42c920affe572e12e933a1bb0/raw/24bda0dfa02c7baba3b983fb71662c1904645fa8/fix-grub-linux-display-version.diff)):
@@ -53,10 +55,11 @@ following changes (also as a [diff file](https://gist.githubusercontent.com/mjkl
submenu_indentation="$grub_tab"
```
-This modification makes the command `grub-mkconfig` get the Linux version of the
-kernel file, from the output of the `file` command executed on that kernel file.
-*Note* that the output of the command gets parsed with GNU grep, which has the
-option of enabling Perl regular expressions (`-P` option) this allows the use of
-positive lookbehind (`(?<=version)`).
+This modification makes the script `10_linux` get the Linux version of the
+kernel file, from the output of the `file` command executed on that kernel
+file (for example `$ file /boot/vmlinuz-linux`). *Note* that the output of the
+command gets parsed with GNU grep, which has the option of enabling Perl
+regular expressions (`-P` option) this allows the use of positive look-behind
+(`(?<=version)`).
-* [Previous diff file as Github gist](https://gist.github.com/mjkloeckner/214a0ee42c920affe572e12e933a1bb0)
+* [Previous diff file as GitHub gist](https://gist.github.com/mjkloeckner/214a0ee42c920affe572e12e933a1bb0)
diff --git a/common/blog_index.shtml b/common/blog_index.shtml
@@ -4,7 +4,7 @@
<tbody id="blog-index-tbody">
<tr id="entry" onclick="window.location='/blog/grub-linux-version-fix/grub-linux-version-fix.html';">
<td id="date"><a href="/blog/grub-linux-version-fix/grub-linux-version-fix.html">02-Nov-2024</a></td>
- <td id="title"><a href="/blog/grub-linux-version-fix/grub-linux-version-fix.html">GRUB: Incorrect Linux version `booting Linux linux ...`</a></td>
+ <td id="title"><a href="/blog/grub-linux-version-fix/grub-linux-version-fix.html">GRUB menu: Linux version not detected</a></td>
</tr>
<tr id="entry" onclick="window.location='/blog/spending-money-on-thinkpads/spending-money-on-thinkpads.html';">
<td id="date"><a href="/blog/spending-money-on-thinkpads/spending-money-on-thinkpads.html">14-Oct-2023</a></td>
diff --git a/common/latest_uploads.shtml b/common/latest_uploads.shtml
@@ -4,7 +4,7 @@
<tbody id="blog-index-tbody">
<tr id="entry" onclick="window.location='/blog/grub-linux-version-fix/grub-linux-version-fix.html';">
<td id="date"><a href="/blog/grub-linux-version-fix/grub-linux-version-fix.html">02-Nov-2024</a></td>
- <td id="title"><a href="/blog/grub-linux-version-fix/grub-linux-version-fix.html">GRUB: Incorrect Linux version `booting Linux linux ...`</a></td>
+ <td id="title"><a href="/blog/grub-linux-version-fix/grub-linux-version-fix.html">GRUB menu: Linux version not detected</a></td>
</tr>
<tr id="entry" onclick="window.location='/blog/spending-money-on-thinkpads/spending-money-on-thinkpads.html';">
<td id="date"><a href="/blog/spending-money-on-thinkpads/spending-money-on-thinkpads.html">14-Oct-2023</a></td>