Talk:Systemd-boot

From ArchWiki
Jump to navigation Jump to search

$esp pseudo-var

I'd suggest replacing $esp that's prominent in the article with the standard /boot, i.e. replace

$esp is used to denote the mountpoint in this article.

with

In this article, /boot is used as the mountpoint.

And replace $esp instances accordingly. Changing the mountpoint is immediate to anyone who wants to do so, so another pseudo-var isn't required.

In addition, it's confusing to those who wish to go with the recommended /boot mountpoint. -- Alad (talk) 10:33, 5 January 2016 (UTC)

While that could make sense, we'd create an inconsistency with all the other boot loader articles, which do use $esp as well: GRUB, Syslinux, EFISTUB and rEFInd. Personally, I don't think that using a variable like that is creating confusion, especially after [1]. — Kynikos (talk) 07:12, 9 January 2016 (UTC)

Keys inside the boot menu, clarification

once you use keys to change timeout (-,T,+,t), this setting is saved in a non-volatile EFI variable; in this way `loader.conf` setting is overridden; a) how to clear the non-volatile EFI variable? b) how to show values of non-volatile EFI variables? --nTia89 (talk) 14:22, 27 May 2016 (UTC)

https://bbs.archlinux.org/viewtopic.php?pid=1733461#p1733461
a) maybe reflashing the bios ^^ or efivar -w (be carefully you can brick your motherboard) b) also with efivar --name var -p
—This unsigned comment is by Fallback (talk) 21:13, 31 August 2017‎. Please sign your posts with ~~~~!

The section about Windows 8+ overriding boot settings is incorrect

I have a dual boot with Windows 10 and it does not override your boot settings or make Windows the default at each boot as explained in the wiki (it might during a major upgrade that work more or less as a new install, like Windows 8 -> Windows 10).

The fact is that, Windows normally manage the default boot efi file $esp\boot\efi\bootx64.efi and keep it identical to $esp/EFI/Microsoft/Boot/bootmgfw.efi . This file is often updated (I don't know if it is at every boot, but very often). The default installation of systemd-boot put also a copy of itself at the default $esp\boot\efi\bootx64.efi and this can gives a conflict because it will be overwritten by Windows. If we manage to correctly put a default boot entry in the firmware that is not $esp\boot\efi\bootx64.efi, there will be no problems. If we have a motherboard that can only boot $esp\boot\efi\bootx64.efi then and only then we are in trouble and the work around described in the wiki can make sense. It would be safer not touching $esp\boot\efi\bootx64.efi, I think Windows expect we do not touch this file.

—This unsigned comment is by Olive (talk) 21:28, 1 July 2016‎ (UTC). Please sign your posts with ~~~~!

splash

add a section which talks about splash feature. --nTia89 (talk) 09:40, 9 July 2016 (UTC)

loader.conf: timeout 0?

Missing (for me) is what happens when "timeout 0" is set in loader.conf

—This unsigned comment is by Probackup-nl (talk) 11:09, 22 November 2017‎. Please sign your posts with ~~~~!

boot into windows once?

Does anyone know whether there is a way to reboot into windows once from linux using a command line. I.e. instead of "reboot", but "reboot-windows", which will boot into windows without me choosing anything at the boot menu. And on next reboot reboot into linux as the default sets?

—This unsigned comment is by Minxu (talk) 21:06, 28 January 2018‎. Please sign your posts with ~~~~!

run efibootmgr, note the number of the entry you want to boot next, run efibootmgr -n $number, that sets the boot entry as BootNext.Taifleh (talk) 11:20, 7 March 2018 (UTC)
You can use systemctl reboot --boot-loader-entry=<entry name> to directly boot a specific entry. However, this does not work with the auto-detected Windows Boot Loader, you have to create a boot entry. To list available options, run systemctl reboot --boot-loader-entry=help. The advantage is that you don't need efibootmgr installed. Might be worth to include in Systemd-boot#Choosing next boot? --help as mentioned there did not work for me. Qw3ry (talk) 08:58, 31 January 2020 (UTC)

objcopy use with intel-ucode.img

as it is nowhere to be found, i am clueless. how do i integrate the intel-ucode-img within an efi file in that manner? Taifleh (talk) 01:35, 7 March 2018 (UTC)

See Microcode#EFI_boot_stub_.2F_EFI_handover. -- Lahwaacz (talk) 07:18, 7 March 2018 (UTC)
Well, this was a kind of obvious solution. Thank you for sharing! Taifleh (talk) 09:58, 7 March 2018 (UTC)

I'm still having problems with this. Since we incorporate the ucode and initramfs within the binary EFI file, how do we reference it in the kernel-command-line.txt? What is the expected syntax for that file? Is it the same as /proc/cmdline contains? What about escaping the backslash character? I feel like this should be explained somewhere. When I try this, the kernel commandline is not being processed. Boot fails for my root partition cannot be mounted to /new_root. So initramfs is being loaded, and ucode is loaded as well. So it seems, it's not neccessary to mention initrd parameters in the kernel-command-line.txt. So how do I add my parameters (root=UUID=someuuid)... ? Taifleh (talk) 15:32, 7 March 2018 (UTC)

All you need to do is to concatenate the ucode file and your initrd with the ucode file being first. Then you use that combined file as I initrd. No need to for kernel command line arguments or anything. Hunger

arch.conf explanation could use some clearing up

Wouldn't it make a lot more sense to have the example options as `options root=/dev/sdxY rw` as opposed to some label? Also, in the explanation above it says `initrd=efipath` is a required option but I have never used this and booting into Arch works fine. Tonij (talk) 10:12, 5 December 2018 (UTC)

That's usually not a good idea, see Persistent_block_device_naming. -- Lahwaacz (talk) 23:03, 5 December 2018 (UTC)

System Rescue CD on ESP

Just like the already here "GRML on ESP" i tried to do the same with System Rescue CD (version 5.3.2). And unexpectedly it works! I followed the steps in the GRML section [2]:

- copied these files to

/boot/srcd/initram.igz
/boot/srcd/rescue64
/boot/srcd/systemrescuecd-x86-5.3.2.iso

- added an entry

title   SRCD
linux   /srcd/rescue64
initrd  /srcd/initram.igz
options docache setkmap=it isoloop=srcd/systemrescuecd-x86-5.3.2.iso

Before promoting to the main page, I'd like to have some feedback, thank you.

nTia89 (talk) 08:02, 23 September 2019 (UTC)

Let's not do this. As you have (unconsciously? why would you expect it not to work?) noticed yourself, the GRML section serves as an example that can be generalized easily enough. Robg (talk) 15:14, 23 September 2019 (UTC)
It was unexpected to me because I have just used that instructions for SRCD but I do not know neither what those files do nor have a theoretical base... It could have been easily a fluke! That's the reason why I wrote here. If you know it is logic and generic to every other distro, I'd like to add it to the section: I do not want to add a section for SRCD, a section for another distro, etc. but rework the section making it generic and keep GRML as example, because currently the section does not talk about it is a generic procedure! nTia89 (talk) 15:38, 23 September 2019 (UTC)
It is not generic, but you can easily find out yourself what are the proper file names for the kernel image and initial ramdisk, as well as what are the required kernel options. This page certainly won't become what we had before on the Multiboot USB drive page, one example is more than enough. -- Lahwaacz (talk) 20:59, 23 September 2019 (UTC)
I absolutely agree with you Lahwaacz, a notice box is enough but needed as well. nTia89 (talk) 21:08, 23 September 2019 (UTC)
I can live with a notice. Why don't you add one, NTia89, and me or Lahwaacz will adjust it if necessary. A single sentence of the kind "the below example can be generalized to..." should do. Robg (talk) 12:40, 24 September 2019 (UTC)
Done nTia89 (talk) 12:51, 24 September 2019 (UTC)

Installation update XBOOTLDR

The current wiki page states the installation section is out of date

--path is no longer referenced inside of the bootctl man pages.

There are 2 new arguments to use instead (from the man pages of bootclt):

--esp-path=
Path to the EFI System Partition (ESP). If not specified, /efi/, /boot/, and /boot/efi/ are checked in turn. It is recommended to mount the ESP to /efi/, if possible.
--boot-path=
Path to the Extended Boot Loader partition, as defined in the Boot Loader Specification. If not specified, /boot/ is checked. It is recommended to mount the Extended Boot Loader partition to /boot/, if possible.

the Extended boot loader is labeled guid bc13c2ff-59e6-4262-a352-b275fd6f7172 or Linux Extended Boot

This --boot-path allows for a new partition to be created and systemd-boot can read from that as well as from the ESP

This Linux Extended Boot partition should still be formatted to vfat, though it should be able to read other file systems as well.

This means kernels are no longer required to be installed on the esp and can instead be held on the new /boot partition which systemd-boot is able to read

You can now mount the ESP to /efi then mount the new Linux Extened Boot Partion to /boot and create a loader entry in /boot/loader/entries/arch.conf and systemd-boot will be able to read and boot it.

Longer write ups written by me can be found on reddit and on the fourms

Info about XBOOTLDR can be found here

Thegreatzach (talk) 19:40, 6 April 2020 (UTC)

EDIT:

The systemd gpt auto generator will only mount partitions that are on the same physical device.

Meaning that the Extended Boot Loader partition must be on the same disk as the ESP

source

Thegreatzach (talk) 13:30, 29 May 2020 (UTC)

A reference to formatting the XBOOTLDR as FAT would be helpful. I couldn't find reference to making it FAT on any other Wiki page. Callmejoe (talk) 05:46, 13 April 2021 (UTC)
https://wiki.archlinux.org/index.php/File_systems Scimmia (talk) 11:41, 13 April 2021 (UTC)
nothing on that page that refers to linux extended boot partitions and how they should be formatted related to systemd-boot Callmejoe (talk) 13:25, 13 April 2021 (UTC)
You said nothing told you how to make a FAT partition. That page does. And stop marking your edits as 'minor'. Scimmia (talk) 05:31, 14 April 2021 (UTC)

add link to aur:kernel-install-hook

see kernel-install(8)

tldr - kernel-install runs scripts in /usr/lib/kernel/install.d or /etc/kernel/install.d. It automatically installs kernel and initramfs in $BOOT/<MACHINE-ID>/<KERNEL-VERSION>/kernel and $BOOT/<MACHINE-ID>/<KERNEL-VERSION>/initrd respectively. It also installs boot entry to $BOOT/loader/entries/<MACHINE-ID>-<KERNEL-VERSION>.conf.

The kernel-install-hookAUR automatically runs kernel-install when needed.

This works well for me for with both dracut and mkinitcpio for initramfs.

Also make sure you only have one initramfs generator installed, otherwise it might generate two initramfs.

ENV25 (talk) 16:00, 21 March 2021 (UTC)

I wrote a newer pacman hook. AUR: pacman-hook-kernel-installAUR
ENV25 (talk) 12:56, 20 July 2021 (UTC)

Update systemd-boot#Configuration to use automatic tools bundled with systemd

Systemd bundles the kernel-install tool (as noted by ENV25 above) which makes it very easy to manage multiple kernels among different installs on a single ESP. I propose we rewrite the current configuration section to include this as an automatic method in a subsection, and move the current contents to a subsection as a manual method. The automatic section would include topics like how to mask the default mkinitcpio pacman hook to stop the kernels installing to /boot/vmlinuz and /boot/initramfs.img, making/installing1 pacman hooks to move new kernels on install, and how to make an initramfs (since mkinitcpio -P will no longer work) and patch other scripts that may use mkinitcpio -P.

1My current intent is to use kernel-install-hookAUR for the automation part because it includes kernel-reconfigure which makes new initramfs for all kernels on the currently booted install, so users have a drop-in replacement for mkinitcpio -P

If there's any support for or objection to writing this section and moving the current content into a subsection I'd like to hear it.

Lsdaniel (talk) 01:49, 20 July 2021 (UTC)

So you want to add a section on how to disable defaults, install unsupported packages, and edit scripts, all to make things *easier*? Doesn't make a lot of sense to me.
Scimmia (talk) 02:30, 20 July 2021 (UTC)
If all you're going to do is rant, just keep it to yourself. -- Alad (talk) 09:42, 20 July 2021 (UTC)
Is kernel-install the officially suggested tool (by upstream) for kernel management with systemd-boot? If so, I suppose we can make it the main subsection under "Configuration". In any case, how about we include Lsdaniel's proposed explanations in a subsection following "Adding loaders"? We can always decide on making it the main subsection later on and for now focus on the content. Also, many thanks to Lsdaniel for the kind editorial offer! -- Robg (talk) 12:51, 20 July 2021 (UTC)
The AUR package is only pacman hook to automatically run kernel-install every kernel upgrade. It can be installed without the package.
"Editing scripts" is only needed to disable the mkinitcpio pacman hooks that genereate /boot/initramfs-linux.img. You do the same when you install dracut.
ENV25 (talk) 13:20, 20 July 2021 (UTC)

Potential removal of "Loader configuration" section

Just my two cents, but I don't see why the Loader configuration section would be removed from this page. This information is useful and immediately pertinent, and perhaps more to the point, the way it is set up appears to track the style guide's example for avoiding duplicated article content. Specifically, the style guide references the "Kernel parameters" page, and if we look at the "Parameter list" section, they've done the exact same thing as in this article. There is a somewhat shorter summary of important information, followed by a link to the man pages for more information if needed. Retnuh66 (talk) 20:34, 9 September 2021 (UTC)

I wouldn't say that it's "more to the point", it's almost a full duplication of the man page. I would perhaps understand if it listed the most important/common options, but it actually lists everything. Can anyone honestly claim they care about the random-seed-mode option? -- nl6720 (talk) 10:11, 14 October 2021 (UTC)
The fact that something on wiki is duplication of the man page is not a very good criteria for removal. A lot of useful things are in man pages. If man pages were that good at communicating information we wouldn't need wikis. I think this section is in the right place and when I was transitioning to systemd-boot it made a lot of sense to me. Unless there is a truly better way to describe the configuration, this section is in the right place with the right amount of information. It makes sense. (EDIT: I agree with your comment on random-seed-mode, but that is the only extra thing there. Could be left for completion sake as an exception that confirms the rule.) Romstor (talk) 15:27, 16 October 2021 (UTC)
Wikis are there to supplement man pages instead, not copy-paste them. Manuals are living documents, copying them here will only lead to outdated information and offers nothing new either. -- Alad (talk) 15:36, 16 October 2021 (UTC)