{"id":428,"date":"2012-09-12T00:16:57","date_gmt":"2012-09-12T00:16:57","guid":{"rendered":"http:\/\/rglinuxtech.com\/?p=428"},"modified":"2012-09-12T00:16:57","modified_gmt":"2012-09-12T00:16:57","slug":"grub2-stop-the-insanity","status":"publish","type":"post","link":"https:\/\/rglinuxtech.com\/?p=428","title":{"rendered":"Grub2 &#8211; Stop the Insanity!"},"content":{"rendered":"<p>I am one of those people who compiles a lot of new kernels, and have become increasingly frustrated by the user-unfriendliness of <strong>grub2<\/strong>..<\/p>\n<p>Now the latest version of grub2 has introduced &#8211; for reasons that I cannot fathom &#8211; two levels of menu, and relegated most of the multiple-choice kernel version boot options to the secondary menu &#8211; euphemistically called &#8221;<strong>Advanced options for&#8230;..<\/strong>&#8221;.<\/p>\n<p>The problem with this is that the conventional ways of pre-selecting the kernel version to boot are broken by this..\u00a0\u00a0 The ludicrous assumption would appear to be that the operator is sitting in front of the computer screen\/keyboard when it boots, which is <span style=\"text-decoration:underline;\">not<\/span> the case when the system is remote &#8211; or &#8216;headless&#8217; (or both..).<\/p>\n<p>There is a useful grub2 configuration tool &#8211; <strong>grub-customizer<\/strong> &#8211; that would work, but only sees the top-level menu, which usually consists of only the last-installed kernel version, and (if installed) the MSWin boot..<br \/>\n<a title=\"http:\/\/launchpad.net\/grub-customizer\" href=\"http:\/\/launchpad.net\/grub-customizer\" target=\"_blank\">http:\/\/launchpad.net\/grub-customizer<\/a><\/p>\n<p>After much fruitless searching among the mostly-out-of-date info online, I decided to simply try to revert the menu to the older grub2 pre-2.0 single-level one, and this was actually quite easy.<\/p>\n<p>Simply download the source to a 1.99 version of grub2 &#8211; I used 1.99-rc1 &#8211; untar it, and go the the utils\/grub.d directory.\u00a0\u00a0\u00a0 There you will find the older version of the configuration parameter file that generates the entries for grub.cfg when grub2-mkconfig is run..\u00a0\u00a0 The file you need is <strong>10_linux_in<\/strong>, which will need to be renamed to just <strong>10_linux<\/strong> for Fedora systems..<\/p>\n<p>Copy this file to \/etc\/grub.d on your system, and make it executable (<strong># chmod 0755 10_linux<\/strong>).\u00a0\u00a0\u00a0 Then edit the first few lines to correctly reference the exec, prefix, etc.<\/p>\n<p>For Fedora, this will be:<\/p>\n<pre> .............\n\n prefix=\"\/usr\"\n exec_prefix=\"\/usr\"\n bindir=\"\/usr\"\n libdir=\"\/usr\/share\"\n . ${libdir}\/grub\/grub-mkconfig_lib\nexport TEXTDOMAIN=grub\nexport TEXTDOMAINDIR=\"${datarootdir}\/locale\"\n\n .............<\/pre>\n<p>The rest of the contents should be OK as they are..<\/p>\n<p>Once this has been done, simply recreate grub.cfg:<br \/>\n<strong># grub2-mkconfig -o \/boot\/grub2\/grub.cfg<\/strong><\/p>\n<p>Then, if you (re)run grub-customizer, you will see <span style=\"text-decoration:underline;\">all<\/span> the <em>bootable<\/em> kernel versions, and can re-sequence them as needed&#8230;<\/p>\n<div id=\"attachment_434\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/d1507750.u268.pipeten.co.uk\/wp_rglinuxtech\/wp-content\/uploads\/2012\/09\/grub_customizer.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-434\" class=\"size-full wp-image-434\" title=\"grub_customizer\" src=\"http:\/\/d1507750.u268.pipeten.co.uk\/wp_rglinuxtech\/wp-content\/uploads\/2012\/09\/grub_customizer.png\" alt=\"\" width=\"600\" height=\"463\" srcset=\"https:\/\/rglinuxtech.com\/wp_rglinuxtech\/wp-content\/uploads\/2012\/09\/grub_customizer.png 816w, https:\/\/rglinuxtech.com\/wp_rglinuxtech\/wp-content\/uploads\/2012\/09\/grub_customizer-300x231.png 300w, https:\/\/rglinuxtech.com\/wp_rglinuxtech\/wp-content\/uploads\/2012\/09\/grub_customizer-624x482.png 624w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-434\" class=\"wp-caption-text\">Grub-Customizer, with Fedora 17<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I am one of those people who compiles a lot of new kernels, and have become increasingly frustrated by the user-unfriendliness of grub2.. Now the latest version of grub2 has introduced &#8211; for reasons that I cannot fathom &#8211; two levels of menu, and relegated most of the multiple-choice kernel version boot options to the secondary menu <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/rglinuxtech.com\/?p=428\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[5,6,10,11,14,15,19,20],"tags":[30,154,179,180,181,324,343],"class_list":["post-428","post","type-post","status-publish","format-standard","hentry","category-compilation","category-crash-and-burn","category-fedora","category-hacks","category-kernel","category-linux-2","category-opinion","category-performance-2","tag-2-tier-menus","tag-fedora-2","tag-grub-1-99","tag-grub-customizer","tag-grub2","tag-revert-to-single-level-menu","tag-solution"],"_links":{"self":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=428"}],"version-history":[{"count":0,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/428\/revisions"}],"wp:attachment":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}