You are not logged in.

#1 2022-10-09 12:25:00

goldmund
Member
Registered: 2021-02-15
Posts: 73

[SOLVED] Libreboot – how to point Libreboot GRUB to the Arch install?

Hi!

I've got a librebooted ThinkPad x200 and struggle booting into my fresh installation of Arch. Libreboot comes with its own GRUB (i.e. no need to install GRUB through Arch) and I just can't point the Libreboot GRUB to the Arch install.

I configured Arch to use luks1 (heard that Libreboot doesn't support luks2), lvm and btrfs. I didn't find any info about Libreboot on the ArchWiki, but found a guide for Parabola which I have been following (I know it's not Arch, but better than nothing).

This is what the system looks like (view from arch-chroot):

# lsblk
NAME              MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
loop0               7:0    0 686.9M  1 loop  
sda                 8:0    0 465.8G  0 disk  
└─sda1              8:1    0 465.8G  0 part  
  └─lvm           254:0    0 465.8G  0 crypt 
    ├─vgroot-swap 254:1    0     7G  0 lvm   
    └─vgroot-root 254:2    0 458.8G  0 lvm   /home
                                             /
sdb                 8:16   1  28.7G  0 disk  
├─sdb1              8:17   1   783M  0 part  
└─sdb2              8:18   1    15M  0 part
# ls -lA /boot
total 86528
-rw------- 1 root root 50966832 Oct  9 12:05 initramfs-linux-fallback.img
-rw------- 1 root root 26626302 Oct  9 12:04 initramfs-linux.img
-rw-r--r-- 1 root root 11005696 Oct  9 11:53 vmlinuz-linux
# cat /etc/mkinitcpio.conf
MODULES=(btrfs i915)
BINARIES=()
FILES=()
HOOKS=(base udev autodetect modconf block keyboard keymap encrypt lvm2 fsck filesystems)

And this is the error message after reboot, in the GRUB console.

Could someone please tell me what I am doing wrong?

Last edited by goldmund (2022-10-16 13:48:53)

Offline

#2 2022-10-09 17:29:22

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

Re: [SOLVED] Libreboot – how to point Libreboot GRUB to the Arch install?

Are you using subvolumes? If so, see the btrfs wiki page for details of how to set this up.


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

#3 2022-10-09 18:34:51

goldmund
Member
Registered: 2021-02-15
Posts: 73

Re: [SOLVED] Libreboot – how to point Libreboot GRUB to the Arch install?

cfr wrote:

Are you using subvolumes? If so, see the btrfs wiki page for details of how to set this up.

I believe I set them up correctly, it should be according to the Wiki:

# cryptsetup luksFormat --type luks1 /dev/sda1
# cryptsetup open /dev/sda1 lvm
# pvcreate /dev/mapper/lvm
# vgcreate vgroot /dev/mapper/lvm
# lvcreate -L 4G vgroot -n swap
# lvcreate -l +100%FREE vgroot -n root
# mkfs.btrfs /dev/mapper/vgroot-root
# mount /dev/mapper/vgroot-root /mnt
# cd /mnt
# btrfs subv create @
# btrfs subv create @home
# btrfs subv create @snapshots
# cd
# umount /mnt
# mount -o compress=zstd,subvol=@ /dev/mapper/vgroot-root /mnt
# mkdir /mnt/home
# mount -o compress=zstd,subvol=@home /dev/mapper/vgroot-root /mnt/home

Offline

#4 2022-10-09 23:25:18

goldmund
Member
Registered: 2021-02-15
Posts: 73

Re: [SOLVED] Libreboot – how to point Libreboot GRUB to the Arch install?

The problem indeed seems to be with btrfs. I've just tried an empty HDD where I installed ext4 and booting into it through Libreboot worked.

So the question is: how to adjust this command inside GRUB console in such a way that GRUB finds it in the encrypted '@' btrfs subvolume?

linux /boot/vmlinuz-linux root=/dev/vgroot/root cryptdevice=/dev/sda1:root

Sorry for being so dumb... I have read so much already in the ArchWiki! I just need a kick in the right direction...

Offline

#5 2022-10-09 23:58:18

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

Re: [SOLVED] Libreboot – how to point Libreboot GRUB to the Arch install?

What I was thinking of was https://wiki.archlinux.org/title/Btrfs# … me_as_root. I've never used btrfs, but I remembered this could cause issues and I guessed your lsblk output might look the way it did if / etc. were subvolumes. However, this comes with lots of caveats since, as I say, I've never used btrfs myself.

However, that wouldn't cause the grub error you're seeing I don't think, unless /boot is on your root volume?

Last edited by cfr (2022-10-10 00:01:18)


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

#6 2022-10-10 00:20:59

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Libreboot – how to point Libreboot GRUB to the Arch install?

goldmund wrote:

So the question is: how to adjust this command inside GRUB console in such a way that GRUB finds it in the encrypted '@' btrfs subvolume?

linux /boot/vmlinuz-linux root=/dev/vgroot/root cryptdevice=/dev/sda1:root

Try...

linux /boot/vmlinuz-linux root=/dev/vgroot/root rootflags="subvol=/@" cryptdevice=/dev/sda1:root

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2022-10-10 11:02:53

goldmund
Member
Registered: 2021-02-15
Posts: 73

Re: [SOLVED] Libreboot – how to point Libreboot GRUB to the Arch install?

Thanks for your help, unfortunately this still hasn't worked as I am still seeing:

error: file '/boot/vmlinuz-linux' not found.

Could it perhaps have something to do with setting the variable 'root' as:

set root='vgroot-root'

?

It really goes over my head, I've been playing with this for hours!

Offline

#8 2022-10-16 13:47:49

goldmund
Member
Registered: 2021-02-15
Posts: 73

Re: [SOLVED] Libreboot – how to point Libreboot GRUB to the Arch install?

After 2 weeks of fruitless and desperate attempts, I have finally figured it out.

This is the correct configuration in the GRUB console:

cryptomount -a
set root='lvm/matrix-rootvol'
linux /@/boot/vmlinuz-linux root=/dev/mapper/matrix-rootvol rootflags=subvol=@ cryptdevice=/dev/sda1:root rw
initrd /@/boot/initramfs-linux.img
boot

Additionally, I have renamed the LVM volume group and logical volumes to their recommended names.

Luks1 is also not needed, the current version (20220710) of Libreboot can handle luks2 as long as you convert the key to pbkdf2:

cryptsetup luksConvertKey --pbkdf pbkdf2 /dev/sdX

More info is on the Libreboot website.

Arch is now booting! Thanks a lot for your help.

Last edited by goldmund (2022-10-16 14:23:42)

Offline

Board footer

Powered by FluxBB