LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-12-2023, 12:57 PM   #1
cwizardone
LQ Veteran
 
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,104

Rep: Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279
GRUB2 in Slackware? Discussion and Instruction.


I've asked that the very informative grub related posts be moved here. Whether that happens or not, we'll see.


Edit in: This thread title reminds me of the old Berkeley Farms radio commercials. Berkeley Farms sold milk and other dairy products. Found a web site, but don't know if they are actually still in business.
As you may know, Berkeley, California is the home of the University of California, and is located in the urban San Francisco Bay Area.
Each radio commercial ended with the voice of Mel Blanc saying, "Farms in Berkeley?! Mooooo..."
Seems kind of dumb today, but it brings back a lot of memories.

Last edited by cwizardone; 08-12-2023 at 01:36 PM.
 
Old 08-12-2023, 01:06 PM   #2
Jeebizz
Senior Member
 
Registered: May 2004
Distribution: Slackware15.0 64-Bit Desktop, Debian 11 non-free Toshiba Satellite Notebook
Posts: 4,186

Rep: Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379
Is it going to be GRUB or GRUB2 ?
 
1 members found this post helpful.
Old 08-12-2023, 01:19 PM   #3
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
May I express my opinion? No? Thought so.
Anyhow, GRUB(2) is the most pointless and useless piece of software for a distro like Slackware (or Gentoo). There are tens of megabytes of junk installed to the hard drive doing what ..? All this may be great for Ubuntu with automated kernel upgrades, but we are not running Ubuntu here.
Nowadays we have EFI boot and every mobo has boot menu. Install as many EFI stub kernels as you want and don't waste your time with a bootloader which is more like an OS. You can even multiboot using this mobo menu, you can have a bootloader(s) there for another OS which cannot boot directly from EFI as Linux does.
Or for gods sake, if you just must have a bootloader then Syslinux is absolutely great for legacy boot, LiLo is to be considered, too.
 
3 members found this post helpful.
Old 08-12-2023, 01:20 PM   #4
cwizardone
LQ Veteran
 
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,104

Original Poster
Rep: Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279
Quote:
Originally Posted by Jeebizz View Post
Is it going to be GRUB or GRUB2 ?
It would have to be GRUB2.
I'll change the title.
 
Old 08-12-2023, 01:22 PM   #5
Jeebizz
Senior Member
 
Registered: May 2004
Distribution: Slackware15.0 64-Bit Desktop, Debian 11 non-free Toshiba Satellite Notebook
Posts: 4,186

Rep: Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379
Quote:
Originally Posted by cwizardone View Post
It would have to be GRUB2.
I'll change the title.
Fair enough but I guess I should also have clarified - as Pat alluded to switching to GRUB; so I assumed just GRUB as perhaps GRUB2 is too bleeding edge still for Slackware? I don't know.
 
1 members found this post helpful.
Old 08-12-2023, 01:23 PM   #6
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,508

Rep: Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469
Quote:
Originally Posted by Jeebizz View Post
Is it going to be GRUB or GRUB2 ?
Obviously GRUB2.
 
6 members found this post helpful.
Old 08-12-2023, 01:24 PM   #7
Jeebizz
Senior Member
 
Registered: May 2004
Distribution: Slackware15.0 64-Bit Desktop, Debian 11 non-free Toshiba Satellite Notebook
Posts: 4,186

Rep: Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379
I'm going to post Luckycyborg's mini tutorial here as I think it is a good addition:


Quote:
Originally Posted by LuckyCyborg View Post
Here's a mini-tutorial.

1. Setup the /etc/mkinitrd.conf

This config file wasn't invented by me, but by our BDFL and it's part of Slackware. You even have an /etc/mkinitrd.conf.sample on your system! ;p

So, first you should execute this command:
Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh -c
It will output something like:
Code:
SOURCE_TREE="/boot/initrd-tree"
CLEAR_TREE="1"
OUTPUT_IMAGE="/boot/initrd.gz"
KERNEL_VERSION="6.1.45"
KEYMAP="us"
MODULE_LIST="usb-storage:uas:xhci-hcd:xhci-pci:ohci-pci:ehci-pci:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-asus:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd2:mbcache:crc32c_intel:crc32c_generic:ext4"
LUKSDEV=""
ROOTDEV="/dev/sda3"
ROOTFS="ext4"
RESUMEDEV=""
RAID=""
LVM=""
UDEV="1"
WAIT="1"
After inspecting its output, you should do:
Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh -c > /etc/mkinitrd.conf
Further, you can tune the /etc/mkinitrd.conf as you like and please note that you should to this step once. After all, it's just a config file.

2. Generating the initrd

Assuming that you intend to use the generic kernel 6.1.45, you should do:
Code:
mkinitrd -c -k 6.1.45 -o /boot/initrd-6.1.45.img
And yes, the GRUB2 scripts likes the versioned initrds.

3. Installing GRUB2

IF you have a hardware with the legacy BIOS, you should execute this command:
Code:
grub-install --target=i386-pc --recheck /dev/sdX
IF you have a hardware using UEFI, you should mount /boot/efi and execute this command:
Code:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Slackware --recheck
4. Updating the GRUB2 configuration

All you have to do is to execute this command:
Code:
grub-mkconfig -o /boot/grub/grub.cfg
For your convenience in future, you can create this /usr/sbin/update-grub script:
Code:
#!/bin/sh

set -e

exec grub-mkconfig -o /boot/grub/grub.cfg "$@"
And there is time to reboot and enjoy your GRUB2 setup with the generic kernel.

On the future, each time you upgrade the kernel, you should execute these 2 commands:
Code:
mkinitrd -c -k <KERNEL VERSION> -o /boot/initrd-<KERNEL VERSION>.img

grub-mkconfig -o /boot/grub/grub.cfg
That's all.
 
7 members found this post helpful.
Old 08-12-2023, 01:25 PM   #8
Jeebizz
Senior Member
 
Registered: May 2004
Distribution: Slackware15.0 64-Bit Desktop, Debian 11 non-free Toshiba Satellite Notebook
Posts: 4,186

Rep: Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379
Quote:
Originally Posted by volkerdi View Post
Obviously GRUB2.
In the words of Zoidburg:
Click image for larger version

Name:	hooray-zoidberg.jpg
Views:	24
Size:	26.4 KB
ID:	41471
 
1 members found this post helpful.
Old 08-12-2023, 01:26 PM   #9
cwizardone
LQ Veteran
 
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,104

Original Poster
Rep: Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279Reputation: 7279
Quote:
Originally Posted by Jeebizz View Post
Fair enough but I guess I should also have clarified - as Pat alluded to switching to GRUB; so I assumed just GRUB as perhaps GRUB2 is too bleeding edge still for Slackware? I don't know.
GRUB2, https://www.gnu.org/software/grub/
Scroll down to "GRUB Legacy," click on it and you will get a brief history, etc.
 
Old 08-12-2023, 01:27 PM   #10
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,508

Rep: Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469
Quote:
Originally Posted by Emerson View Post
May I express my opinion? No? Thought so.
Anyhow, GRUB(2) is the most pointless and useless piece of software for a distro like Slackware (or Gentoo). There are tens of megabytes of junk installed to the hard drive doing what ..? All this may be great for Ubuntu with automated kernel upgrades, but we are not running Ubuntu here.
Nowadays we have EFI boot and every mobo has boot menu. Install as many EFI stub kernels as you want and don't waste your time with a bootloader which is more like an OS. You can even multiboot using this mobo menu, you can have a bootloader(s) there for another OS which cannot boot directly from EFI as Linux does.
Or for gods sake, if you just must have a bootloader then Syslinux is absolutely great for legacy boot, LiLo is to be considered, too.
I like GRUB2 just about as much as you do, but the fact is that at this point it is the only bootloader for Linux that actually works in all circumstances. And if that's the case, then supporting old, rotten bootloaders is a waste of limited resources.

I believe that even booting EFI stub you'll run into the same black screen issues that occur with elilo on some UEFI systems.
 
12 members found this post helpful.
Old 08-12-2023, 01:29 PM   #11
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,363

Rep: Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078
Quote:
Originally Posted by Jeebizz View Post
Fair enough but I guess I should also have clarified - as Pat alluded to switching to GRUB; so I assumed just GRUB as perhaps GRUB2 is too bleeding edge still for Slackware? I don't know.
Code:
GRUB 2 has replaced what was formerly known as GRUB
 (i.e. version 0.9x), which has, in turn, become GRUB Legacy. 
Enhancements to GRUB are still being made, but the current 
released versions are quite usable for normal operation.

GRUB Legacy is no longer being developed.
https://www.gnu.org/software/grub/
 
2 members found this post helpful.
Old 08-12-2023, 01:31 PM   #12
rizitis
Member
 
Registered: Mar 2009
Location: Greece,Crete
Distribution: Slackware64-current, Slint
Posts: 638

Rep: Reputation: 487Reputation: 487Reputation: 487Reputation: 487Reputation: 487
Question: by running mkinitrd -c ...
Code:
mkinitrd -c     Clear  the  existing  initrd tree (by default in /boot/initrd‐tree/)
              first.  If this is not done, running mkinitrd  will  add  additional
              modules to the existing initrd.
what will happen if custom generic kernels exist in the system?
 
2 members found this post helpful.
Old 08-12-2023, 01:41 PM   #13
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,508

Rep: Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469
Quote:
Originally Posted by rizitis View Post
Question: by running mkinitrd -c ...
Code:
mkinitrd -c     Clear  the  existing  initrd tree (by default in /boot/initrd‐tree/)
              first.  If this is not done, running mkinitrd  will  add  additional
              modules to the existing initrd.
what will happen if custom generic kernels exist in the system?
This makes a good point. I do not see any reason why GRUB2, once installed, ever needs to be futzed with again. Is this not one of the selling points of GRUB? Unlike LILO, the files referenced in the GRUB config file can be completely changed out without any requirement to reinstall or reconfigure GRUB. But in order for this to work, *the filenames must remain the same*.

Now, I know that LuckyCyborg loves versioned filenames as used elsewhere almost as much as he believes I love LILO, elilo, etc, but I don't think that's how we want to do this. I think that initrd.gz will be fine as an unversioned file as it's always been. The kernel file will be versioned (as always), but with an unversioned symlink pointing to it (and used in the GRUB config). Then when a new kernel (and symlink) is installed, and the initrd updated, everything should just work concerning GRUB. Versioning a Slackware initrd doesn't make a lot of sense anyway - it can support multiple different kernel versions with a single initrd. What's the filename version supposed to be then?

The scripts that come with GRUB2 as well as things like os-prober are probably not relevant for our purposes as we just want a simple starting configuration. Since we don't plan to mess with it later, you'll be able to change it (or not) without a future update plowing over the top of it.

Also, this method allows managing GRUB2 from a foreign operating system without having to reconfigure anything there after a Slackware kernel/initrd update.

Last edited by volkerdi; 08-12-2023 at 01:43 PM.
 
15 members found this post helpful.
Old 08-12-2023, 01:55 PM   #14
mickski56
Member
 
Registered: Mar 2018
Distribution: Slackware
Posts: 74

Rep: Reputation: Disabled
Whats wrong with limine too new ?
 
1 members found this post helpful.
Old 08-12-2023, 01:59 PM   #15
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,508

Rep: Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469Reputation: 8469
Quote:
Originally Posted by mickski56 View Post
Whats wrong with limine too new ?
Having every functional bootloader included is not essential for our purpose here.
 
4 members found this post helpful.
  


Reply

Tags
grub, grub2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration