SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have older hardware not before assembled into a working desktop but now it is and I want to learn how to use the UEFI/elilo capabilities it provides.
The motherboard is an Asus Sabertooth FX-990 and it supports UEFI. I have three portables running Slackware-14.2/x86_64, but they run with the older BIOS and lilo.
I've read a couple of blog posts and an undated slackbook page on 14.2 and elilo but am not yet sufficiently educated to install the OS and get it properly configured. I would like pointers to current docs that will teach me the new systems so I can migrate my knowledge of lilo (and mkinitrd) to the new procedures.
First make sure your firmware is set to boot in EFI mode (not legacy).
Then insert the Slackware64-14.2 DVD or USB stick.
Before running setup use cfdisk to partition the hard drive. You will need a partition of 100M of type EFI: in the drop down list of partition types, choose "ef EFI (FAT-12/16/32)". Alternatively you can use cgdisk then choose the partition type ef00 (for EFI System). Both utilities work.
The EFI partition should be equipped with a FAT file system. Let's say it's /dev/sda1, then just type:
Code:
mkfs.fat /dev/sda1
Alternatively, the installer can do it for you later.
Then run setup. After having set the Linux partitions, the installer will make an entry in /etc/fstab for the EFI partition, and if not yet done, will put a FAT system in it.
At the CONFIGURE step you will choose to install elilo and accept when asked to make an entry for Slackware in the firmware's menu. You can install lilo too, there will be no conflict as elilo installs its files in the EFI partition (mounted as /boot/efi) but lilo writes its boot sector elsewhere: this way you will be able to boot in EFI mode as well as in Legacy (aka BIOS) mode.
To elaborate a bit, the installer will put in the EFI partition, in /efi/boot/EFI/Slackware these files:
elilo.conf (similar to /etc/lilo.conf)
elilo.efi (the boot loader). elilo.efi reads the file elilo.conf every time it runs, so you don't have to reinstall it when e.g. you change the kernel and or the initrd, just put the new kernel and initrd in the EFI partition (eliloconfig can do it for you) and edit elilo.conf if need be.
vmlinuz (the kernel, copied from /boot and renamed)
initrd.gz (the initrd, copied from /boot case occurring)
Once installed, read the docs in /usr/doc/elilo-3.16/ and have a look at the script /usr/sbin/eliloconfig.
If you want more in depth knowledge or suffer of insomnia, read the UEFI specification. The current version is 2.7 (Errata A), get it from http://uefi.org/specifications. Also, elilo.efi is an executable file compliant to the Microsoft Portable Executable and Common Object File Format Specification usually abbreviated as PE/COFF, available here[1]. It's in the docx format, so you can read it with LibreOffice.
[1] I case someone wonders, Linux can convert the elf-like shared objects to the PE/COFF format using the objcopy program shipped in binutils. That's what is used to make the elilo's .efi binary for each architecture, as per the file Makefile.rules in the source tree:
It's not complicated, in particular if Slackware is going to be the only OS on given machine. You should just use gdisk instead of fdisk to create partitions, and remember to create a small partition (100MB may be enough) along with your swap and other partitions. In gdisk, assign EF00 as type of this partition, then format it as FAT32, and in Slackware installer, select to have it mounted under /boot/efi. When Slackware installation comes to selecting boot loader, you should choose ELILO from the list, and you should be pretty much good to go.
After the system booted for the first time, you can go into /boot/efi/EFI/Slackware and adjust ELILO config file elilo.conf for your needs. Its format is rather simple, and well documented, so that should not be hard.
The idea with EFI loading is that BIOS (now called EFI firmware) knows to read partition table, and FAT32 file system, so boot loaders are practically plain executable files on such file system, i.e. no more messing with MBR etc. So your ELILO boot loader is actually a file elilo.efi, also under /boot/efi/EFI/Slackware directory. The third file there is kernel.
Whenever you install new kernel, or when you are switching to generic kernel for the first time, you have to remember to create initrd.gz and copy it from /boot to /boot/efi/EFI/Slackware, and also to copy /boot/vmlinuz-generic-x.y.z into /boot/efi/EFI/Slackware/vmlinuz. That's all, and you don't have to run anything further, like lilo command in LILO case. However, when switching to generic kernels for the first time, remember to change elilo.conf, so that initrd.gz is mentioned there.
Edit: Haven't seen previous post until I hit send button, sorry for duplicated info.
In recent versions, as the ones shipped in the installer for Slackware 14.2, fdisk and cfdisk can handle EFI partition tables so can be used to set EFI partitions as gdisk and cgdisk.
Thank you both for clear, helpful explanations. I have two remaining questions for which I've still not found answers.
1.) The sequence and formats of partitions on the boot disk. Am I correct in assuming that sda1 is type EF00 formatted as FAT32 (100M or more in size), sda2 is type linux swap (82) and formatted ext4, and sda3 is type linux (83) and formatted ext4? The secondary disk will be formatted with three GPT partitions formatted ext4 and mounted with: sdb1 as /home, sdb2 as /opt, and adb3 as /data.
2.) What is the specific syntax for mkinitrd? Is it the same 'mkinitrd -c -k <kernel_number> -m ext4, -f ext4, -r /dev/sda1' or something different?
1.) The sequence and formats of partitions on the boot disk. Am I correct in assuming that sda1 is type EF00 formatted as FAT32 (100M or more in size), sda2 is type linux swap (82) and formatted ext4, and sda3 is type linux (83) and formatted ext4?
I can confirm that this order will work, as it's one that I'm using (and most natural, as for EFI and swap one has to specify size, and then leave the rest for ext4). But I guess other orders will work too, i.e. I think that EFI partition doesn't have to be first. (Also, note that you don't have to format swap partition, and that root ext4 partition could be formatted by Slackware installer).
Quote:
Originally Posted by rshepard
What is the specific syntax for mkinitrd? Is it the same 'mkinitrd -c -k <kernel_number> -m ext4, -f ext4, -r /dev/sda1' or something different?
Here, I'm using /usr/share/mkinitrd/mkinitrd_command_generator.sh helper script to determine correct mkinitrd arguments. So say, kernel gets updated, and there is new /boot/vmlinuz-generic-4.14.67 kernel. I would run:
and then in the printout there is "A suitable 'mkinitrd' command will be:" followed by mkinitrd command listed with needed arguments, that I would just copy and run to get initrd.gz created.
1.) The sequence and formats of partitions on the boot disk. Am I correct in assuming that sda1 is type EF00 formatted as FAT32 (100M or more in size), sda2 is type linux swap (82) and formatted ext4, and sda3 is type linux (83) and formatted ext4? The secondary disk will be formatted with three GPT partitions formatted ext4 and mounted with: sdb1 as /home, sdb2 as /opt, and adb3 as /data.
It doesn't matter much in which order you put the partitions, as far as I know. I would suggest to use a GPT partition label on the both drives. This has no inconvenience as far as I know and you will have more flexibility.
The swap should not have a file system, the installer will propose to use it as as swap, then include it in /etc/fstab and run swapon on it.
Quote:
2.) What is the specific syntax for mkinitrd? Is it the same 'mkinitrd -c -k <kernel_number> -m ext4, -f ext4, -r /dev/sda1' or something different?
Nothing specific for UEFI. To ease installation I suggest that you first install using the huge kernel, then after installation make your initrd. Don't forget to copy the generic kernel and the initrd in /boot/efi/EFI/Slackware. You can choose to make a stanza for it in elilo.conf: then rename the generic kernel in /boot/efi/EFI/Slackware kernel-generic and edit elilo.conf accordingly (don't forget: initrd=initrd.gz). Or be sure that /boot/vmlinuz be a symlink to the generic kernel and run eliloconfig as root after having built the initrd if you want a boot entry for the generic kernel only.
PS cgorac was faster this time!
Let's say that our answers complete each other
Last edited by Didier Spaier; 08-28-2018 at 12:10 PM.
I can confirm that this order will work, as it's one that I'm using (and most natural, as for EFI and swap one has to specify size, and then leave the rest for ext4). But I guess other orders will work too, i.e. I think that EFI partition doesn't have to be first. (Also, note that you don't have to format swap partition, and that root ext4 partition could be formatted by Slackware installer).
You're correct that swap is not formatted by me.
With the older system the first partition is the first one on the drive and it will be easier for me to continue that practice. Then swap, followed by /. I'll keep /home, /opt, and a new /data partition on the second (hard) drive
Here, I'm using /usr/share/mkinitrd/mkinitrd_command_generator.sh helper script to determine correct mkinitrd arguments. So say, kernel gets updated, and there is new /boot/vmlinuz-generic-4.14.67 kernel. I would run:
and then in the printout there is "A suitable 'mkinitrd' command will be:" followed by mkinitrd command listed with needed arguments, that I would just copy and run to get initrd.gz created.
Okay. I used the shell script once but then returned to the command line directly. I'll use the shell script this time.
It doesn't matter much in which order you put the partitions, as far as I know. I would suggest to use a GPT partition label on the both drives. This has no inconvenience as far as I know and you will have more flexibility.
Dedier,
I will use GPT partitions on both drives (and on the four external hard drives in a multibay case.) Reading about the advantages over DOS was quite eye-opening. I'll continue to use the same partition order as I have for a couple of decades because there's no reason to change ... as far as I now know.
The swap should not have a file system, the installer will propose to use it as as swap, then include it in /etc/fstab and run swapon on it.
You are, of course, correct and my fingers got ahead of my brain when I typed that. Thanks for pointing it out.
Nothing specific for UEFI. To ease installation I suggest that you first install using the huge kernel, then after installation make your initrd. Don't forget to copy the generic kernel and the initrd in /boot/efi/EFI/Slackware. You can choose to make a stanza for it in elilo.conf: then rename the generic kernel in /boot/efi/EFI/Slackware kernel-generic and edit elilo.conf accordingly (don't forget: initrd=initrd.gz). Or be sure that /boot/vmlinuz be a symlink to the generic kernel and run eliloconfig as root after having built the initrd if you want a boot entry for the generic kernel only.
Yes, the huge kernel has always been the installation default, but I then change to make the generic kernel the default (with an initrd) with the huge kernel as a backup. The UEFI process looks similar to that of lilo, but I'm making a list of what you and cgorac wrote to keep as a guide.
PS cgorac was faster this time!
Let's say that our answers complete each other
Yes, they do. And I really appreciate the education you both provided.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.