You are not logged in.

#1 2012-12-13 23:54:50

clcto
Member
Registered: 2012-12-13
Posts: 4

rEFInd using initramfs-arch-fallback.img

I am not exactly sure how initramfs-arch.img differs from the fallback image but when booting from rEFInd the kernel parameters always use initrd=\EFI\arch\initramfs-arch-fallback.img.

UEFISYS partition is mounted at /boot/efi and contains \EFI\arch\{vmlinuz-arch,initramfs-arch.img,initramfs-arch-fallback.img,linux.conf,refind_linux.conf}

\EFI\arch\linux.conf

root=/dev/disk/by-label/root ro rootfstype=ext4 add_efi_memmap initrd=\EFI\arch\initramfs-arch.img

\EFI\arch\refind_linux.conf

"Boot to Terminal" "root=PARTUUID=3b62f380-9d11-41d2-b3ee-b0720125036d ro rootfstype=ext4 add_efi_memmap systemd.unit=multi-user.target"

As I said, I don't know how they differ, when I would want to use one or the other, or if it is an issue to fallback instead of the regular ramdisk, but I am trying to figure out how to set it up to use the normal image and/or set up a menu like grub has to select which ramdisk to use at boot. Would this require using refind stanzas to add entries to the boot menu?

Offline

#2 2012-12-14 06:14:32

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: rEFInd using initramfs-arch-fallback.img

Creating rEFInd stanzas can certainly do the job, and is likely to be the simplest and most efficient way to go, given Arch's kernel-naming conventions. You might be able to pull it off by creating two entries in refind_linux.conf that explicitly mention the two initrd images, but rEFInd will scan for an initrd and add whichever one it finds first, so one entry will get the same initrd mentioned twice as kernel options and the other will get both mentioned. I'm not sure how that will work. Another way to do it would be to get creative with the naming or placement of the files -- for instance, if the EFI has EFI/arch1 and EFI/arch2, each with one initrd, it could work with auto-scanning.

Offline

#3 2012-12-15 06:57:16

Diaz
Member
From: Portugal
Registered: 2008-04-16
Posts: 366

Re: rEFInd using initramfs-arch-fallback.img

This is my refind_linux.conf file

## This file should be present in the same directory as the kernel file(s)
## More info at http://www.rodsbooks.com/refind/linux.html , http://www.rodsbooks.com/efi-bootloaders/efistub.html

"Boot with default" "root=PARTUUID=16960041-fe2e-44ba-a119-4c2db3bdd1a8 resume=PARTUUID=480921be-baf3-44bc-8023-8ab725b6a949 ro rootfstype=ext4 add_efi_memmap init=/bin/systemd quiet"
"Boot to terminal"  "root=PARTUUID=16960041-fe2e-44ba-a119-4c2db3bdd1a8 ro rootfstype=ext4 add_efi_memmap init=/bin/systemd systemd.log_level=debug systemd.unit=multi-user.target"
"Boot to rescue"    "root=PARTUUID=16960041-fe2e-44ba-a119-4c2db3bdd1a8 ro rootfstype=ext4 add_efi_memmap init=/bin/systemd systemd.log_level=debug systemd.unit=rescue.target"

And then I can choose which of this I want to boot at the selection menu if I want. By default it boots the first.

Now that I look at it I have no idea if the fallback image is working or not tongue

Offline

#4 2012-12-15 18:12:16

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: rEFInd using initramfs-arch-fallback.img

FWIW, I maintain rEFInd, and I'm thinking of adding a feature so that if you explicitly mention an initrd in the options in refind_linux.conf, rEFInd will not add the auto-probed initrd file. That might help out with the typical Arch configuration in which two initrds are linked to each kernel. Any thoughts on this?

Offline

#5 2012-12-15 20:00:49

clcto
Member
Registered: 2012-12-13
Posts: 4

Re: rEFInd using initramfs-arch-fallback.img

That would be great. That seemed logical when I was trying to figure this out, so I tried it. It would be a nice feature.

Offline

#6 2012-12-16 03:39:31

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: rEFInd using initramfs-arch-fallback.img

I've got a preliminary implementation in the rEFInd git repository or as a binary download. (Note: the binary download link will disappear once I release the next official version of rEFInd; if you're reading this beyond late December 2012, install rEFInd from the Arch repositories instead; it should be up-to-date by then.)

This isn't properly documented yet, but it's pretty simple: If you include an "initrd=" specification for an entry in refind_linux.conf, any initrd file that rEFInd locates by its usual method is ignored and is not passed to the kernel. Thus, you'd probably want a refind_linux.conf file that resembles the following:

"Boot standard initrd" "ro root=/dev/sda4 initrd=initramfs-linux.img"
"Boot fallback initrd" "ro root=/dev/sda4 initrd=initramfs-linux-fallback.img"

That's an extremely basic example, of course; you could add options like those in the other examples in this thread, or you could add more lines to give yourself more boot-time options. To use this, you'd select your boot entry and then press Insert, F2, or + to get the options menu for your kernel. The submenu should then have these two options (although the first one will take on a different name; that's just a quirk of the way the code is structured).

FWIW, this version of rEFInd also includes a new EFI ext4fs driver, so rEFInd can load your kernel directly from an ext4fs partition. (You'll need to install the driver, though.)

Last edited by srs5694 (2012-12-16 19:36:35)

Offline

#7 2012-12-16 06:59:14

clcto
Member
Registered: 2012-12-13
Posts: 4

Re: rEFInd using initramfs-arch-fallback.img

srs5694 wrote:
"Boot standard initrd" "ro root=/dev/sda4 initramfs-linux.img"
"Boot fallback initrd" "ro root=/dev/sda4 initramfs-linux-fallback.img"

Should this be

"Boot standard initrd" "ro root=/dev/sda4 initrd=initramfs-linux.img"

or can you leave out the "initrd=" ?

Offline

#8 2012-12-16 19:36:07

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: rEFInd using initramfs-arch-fallback.img

clcto wrote:
srs5694 wrote:
"Boot standard initrd" "ro root=/dev/sda4 initramfs-linux.img"
"Boot fallback initrd" "ro root=/dev/sda4 initramfs-linux-fallback.img"

Should this be

"Boot standard initrd" "ro root=/dev/sda4 initrd=initramfs-linux.img"

or can you leave out the "initrd=" ?

You're right; I forgot the "initrd=" before the RAM disk file specifications. I'm going back to edit my original post....

Offline

#9 2012-12-19 02:58:48

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: rEFInd using initramfs-arch-fallback.img

I don't suppose this works if you specify the loader as well, does it? That would make it possible to specify options for the LTS kernel as well.

One thing I really, really would like to be able to do is enable text at the bottom of the screen reminding me how to view the submenus. (I need to remember that it is F2 as my keyboard lacks an Insert key but I also need to remember what all the other Fns do on booting...)

I just set this up. I got rather confused and screwed up the first time. In the end what I did was specify everything in refind.conf, copying config over from grub.cfg, and disabling auto-detection for the arch stub loader directory. This works although the menu entries get descriptions like "Boot Arch Linux With" which struck me as a bit odd. Is it possible to customize any of this? It is a minor issue but I already miss seeing "Llwytho Linux..."! (Although I guess I still need grub to launch an .iso so I can always take the scenic route via grub if I wish!)

[I should make clear that I think the wiki confused me - not rEFInd's documentation. Once I found the docs, I got it working on my second attempt.]


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2012-12-19 04:33:02

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: rEFInd using initramfs-arch-fallback.img

cfr wrote:

I don't suppose this works if you specify the loader as well, does it? That would make it possible to specify options for the LTS kernel as well.

I'm afraid I'm not quite parsing your question. Could you re-phrase it? To what loader are you referring?

One thing I really, really would like to be able to do is enable text at the bottom of the screen reminding me how to view the submenus. (I need to remember that it is F2 as my keyboard lacks an Insert key but I also need to remember what all the other Fns do on booting...)

Version 0.6.0 adds this feature. It's enabled by default, although you can disable the hints by adding the "hints" item to the "hideui" token in refind.conf. I need to refine it a bit, though; the hints for the information screen are inaccurate, for instance.

I just set this up. I got rather confused and screwed up the first time. In the end what I did was specify everything in refind.conf, copying config over from grub.cfg, and disabling auto-detection for the arch stub loader directory. This works although the menu entries get descriptions like "Boot Arch Linux With" which struck me as a bit odd.

The usual form for the prompts is "Boot X from Y," where X is a description or filename and Y is a filesystem label. If the filesystem label is blank, that gets left hanging. I have a fix in the work for this. It's up in rEFInd's git repository, but if you're not up for using git and compiling yourself, I've just put a test binary up here:

http://www.rodsbooks.com/refind-bin-0.6.0.2.zip

In this version, if the filesystem label is empty, rEFInd tries to find the filesystem type and size, so you get something like "Boot foo.efi from 217 GiB ext4 volume". Some of that information could get dropped, but in a worst-case scenario, it should now say "Boot foo.efi from unknown volume".

Of course, another approach is simply to give your filesystems names. You can do this with tune2fs (for ext2/3/4) or GParted; but if you're loading your kernel from your root filesystem, you may need to do this from an emergency disc. GParted's pretty conservative about modifying mounted filesystems. I just checked with a USB flash drive, and tune2fs let me do it on a mounted filesystem, but I'm not sure if that's really advisable.

Offline

#11 2012-12-19 22:12:38

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: rEFInd using initramfs-arch-fallback.img

srs5694 wrote:
cfr wrote:

I don't suppose this works if you specify the loader as well, does it? That would make it possible to specify options for the LTS kernel as well.

I'm afraid I'm not quite parsing your question. Could you re-phrase it? To what loader are you referring?

What I meant was that that means you can specify the initrd option in items listed in refind_linux.conf. Could you do the same for the loader option? Arch has 2 initrd for each kernel and 2 possible kernels. None have version numbers but it is nice to have them all in the same directory. I managed this by specifying them in refind.conf and disabling autoscanning for the arch directory but I just wondered if this would make it possible to manage that automatically.

Version 0.6.0 adds this feature. It's enabled by default, although you can disable the hints by adding the "hints" item to the "hideui" token in refind.conf. I need to refine it a bit, though; the hints for the information screen are inaccurate, for instance.

Good to know this is happening - thanks!

I just set this up. I got rather confused and screwed up the first time. In the end what I did was specify everything in refind.conf, copying config over from grub.cfg, and disabling auto-detection for the arch stub loader directory. This works although the menu entries get descriptions like "Boot Arch Linux With" which struck me as a bit odd.

The usual form for the prompts is "Boot X from Y," where X is a description or filename and Y is a filesystem label. If the filesystem label is blank, that gets left hanging. I have a fix in the work for this. It's up in rEFInd's git repository, but if you're not up for using git and compiling yourself, I've just put a test binary up here:

http://www.rodsbooks.com/refind-bin-0.6.0.2.zip

In this version, if the filesystem label is empty, rEFInd tries to find the filesystem type and size, so you get something like "Boot foo.efi from 217 GiB ext4 volume". Some of that information could get dropped, but in a worst-case scenario, it should now say "Boot foo.efi from unknown volume".

Of course, another approach is simply to give your filesystems names. You can do this with tune2fs (for ext2/3/4) or GParted; but if you're loading your kernel from your root filesystem, you may need to do this from an emergency disc. GParted's pretty conservative about modifying mounted filesystems. I just checked with a USB flash drive, and tune2fs let me do it on a mounted filesystem, but I'm not sure if that's really advisable.

Is this something different from the "name" gdisk shows for partitions? These show up correctly on my system:

$ ls /dev/disk/by-partlabel/
boot  efi  lvm

I guess refind doesn't pick up on labels for physical partitions? (Right now kernel is being booted from efi although I'll probably switch to boot when the ext4 driver arrives here. Obviously that means it is on a vfat partition - fat 32 now.)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#12 2012-12-19 23:23:53

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: rEFInd using initramfs-arch-fallback.img

cfr wrote:

What I meant was that that means you can specify the initrd option in items listed in refind_linux.conf. Could you do the same for the loader option? Arch has 2 initrd for each kernel and 2 possible kernels. None have version numbers but it is nice to have them all in the same directory. I managed this by specifying them in refind.conf and disabling autoscanning for the arch directory but I just wondered if this would make it possible to manage that automatically.

No, if you've got two kernels in one directory, each with its own associated initrd (or multiple initrds), the only way that rEFInd will be able to keep them straight is if the files use matched numbers in their names. This works fine with most distributions; I'm afraid that Arch really is the "odd man out" in this respect. I could of course add a "special-case" code to rEFInd's mapping for Arch, but that would run the risk of causing problems if somebody else's kernel happens to use the same name as Arch's but does not have the same matched initrd files. Given that Arch's kernel and initrd names are constant, it's probably better to just set up manual boot stanzas for Arch or (with one kernel and two initrds per directory) use the new refind_linux.conf initrd override.

Of course, another approach is simply to give your filesystems names.

Is this something different from the "name" gdisk shows for partitions?

Yes. Filesystem names and partition names are two entirely different things. At the moment, rEFInd can use filesystem names but not partition names. I tried to find a way to extract partition name data to use that if the filesystem name is empty, but I didn't see a way to do it. (There's probably an EFI system call that will do it, but I couldn't find it. The documentation is vast and isn't exactly organized in a way that makes it easy to find a way to perform Task X.) Perhaps I'll figure it out one of these days, or somebody may submit a patch that does this, but for the moment it's the filesystem label or the type code/size description.

Offline

#13 2012-12-20 00:19:40

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: rEFInd using initramfs-arch-fallback.img

If anybody else is looking to do this, I believe that dosfslabel can do this for vfat filesystems. I set a label for the EFI partition with this and used tune2fs as suggested for /boot. Since my third partition is lvm-on-luks, I don't think I have to worry about it showing up in refind's boot manager which is good since I have no clue how to set a label for that one. (Plus, this way I could unmount the partitions which I could hardly do with root!) I guess that, in any case, I'd have to set the labels for the filesystems within the logical volumes and not for the whole thing. (swap already shows up this way.)

I'd still like to be able to customise (localise) the text. English is everywhere!


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB