The shorter and thorough guide to updating Libreboot on an X200

19 respostas [Última entrada]
hack and hack
Desconectado
Joined: 04/02/2015

1 - in the CLI (update the URL according to the stable relese you want):
wget -r --no-parent https://libreboot.org/release/stable/20160907/

2 - check the shasum/gpg https://libreboot.org/gpg/ . It's rather straightforward, just follow the guide. For the complete CLI beginner, just type the bold text and press enter. Check the result so that what you downloaded isn't corrupted.

2) Get the MAC adress of the laptop, most likely on a sticker at the bottom of the laptop. Get the ROM image you need. For this, you need to pick it in the grub folder, knowing if it's 4, 8 or 16m (can't remember how I know that, so if anyone knows, please let us know), and pick the vesab version. Also pick the keyboard layout you want. I suggest staying classic (querty, or the classic one in your language) because of the stuff to type in GRUB at first. Better be familiar with it.
See instructions here, at "MAC adress" for the X200" https://libreboot.org/docs/install/index.html#flashrom, and here https://libreboot.org/docs/hcl/gm45_remove_me.html#ich9gen.
Basically, you generate a specific file which contains your personal MAC adress and put it back in the ROM image.

Warning: your files need to be in the same folder. The scripts like ./cbfstool etc. are in the utils compressed file. Extract them, and move your files in the same folder, and cd to that folder in the CLI for anything to happen. You should be a bit familiar with the CLI.

3 - https://libreboot.org/docs/gnulinux/encrypted_debian.html
According to this, following the way you named your volume group and logical volume, this sequence that allows you to boot by typing this in GRUB (press c to get to the right place to type this), you will have to personalize it accordingly and put it in a file called grubtest.cfg, which is inside your ROM image. just change the default menu entry 'Load Operating System' to say this inside (again, modify it according according to the way you named your volumegroup and logical volume). This means toreplace everything that's between the {} in that section by this:

cryptomount -a
set root='lvm/volumegroup-logicalvolume'
linux /vmlinuz root=/dev/mapper/volumegroup-logicalvolume cryptdevice=/dev/mapper/volumegroup-logicalvolume:root
initrd /initrd.img

So first extract grubtest.cfg from the ROM, modify it (see right above),
Then put it back inside the ROM, and flash your modified ROM.
See here for instructions, rather straightforward: https://libreboot.org/docs/gnulinux/grub_cbfs.html

When booting, it will fail because by default, it reads grub.cfg, which we haven't modified yet. get back to the GRUB menu, and select grubtest.cfg (3rd or 4th option maybe). It should work.
If it does, finish the job with the "final section" in that same page. Make sure to rename the sections grub into grubtest inside grub.cfg that was generated (just read the instructions, nothing special).

Final touch, you can remove (replacing it didn't work for me) the background image, so that you have a black background instead:
https://libreboot.org/docs/grub/index.html
Make sure that the name is the same as the one in the command. For this, use the print command to display what's inside the ROM. When you're done, flash the ROM one last time.

Voilà! Enjoy!

I can see the appeal in a modular manual (less repetitions), but it needs to be more detailed for my needs. So I just made the guide I wanted to read.

SuperTramp83

I am a translator!

Desconectado
Joined: 10/31/2014

good, maybe you should wiki it?

hack and hack
Desconectado
Joined: 04/02/2015

Thanks.
Sure, why not. But how do I create a new entry?
I can edit existing articles, but that's it.

SuperTramp83

I am a translator!

Desconectado
Joined: 10/31/2014

> But how do I create a new entry?

I believe this is the linky (add child page)
https://trisquel.info/en/node/add/book?parent=268

hack and hack
Desconectado
Joined: 04/02/2015

I mean by turning the computer on, failing to log in, then getting back to the GRUB menu, pressing "c".
From there, you type :
cryptomount -a (press "enter")
set root='/lvm/yourvolumegroup-yourlogicalvolume' (press "enter")
linux /vmlinuz root=/dev/mapper/yourvolumegroup-yourlogicalvolume cryptdevice=/dev/mapper/yourvolumegroup-yourlogicalvolume:root (press "enter")
initrd /initrd.img (press "enter")
boot (press "enter")

yourvolumegroup-yourlogicalvolume
are the names given to both of these during Trisquel's encrypted install. See the partitioning chapter here for clarifications: https://libreboot.org/docs/gnulinux/encrypted_debian.html

I assume here that you have already Libreboot and Trisquel installed, and that you're trying to update Libreboot.

hack and hack
Desconectado
Joined: 04/02/2015

Good, then when booting manually, you get an error about vmlinuz, right? What does it says exactly? What do you mean by "vmlinuz is missing"?

hack and hack
Desconectado
Joined: 04/02/2015

Maybe try this then: https://askubuntu.com/questions/150691/missing-vmlinuz-from-boot

or this https://askubuntu.com/questions/257078/casper-vmlinuz-not-found

or even something here might help: https://www.reddit.com/r/archlinux/comments/31bwrx/error_loading_vmlinuzlinux_not_found/

Of course, you can also try #libreboot and you better be patient because you can have an answer after hours. But it seems related to Trisquel, since vmlinuz seems to be part of the kernel. But I might be wrong. Hope this helps a bit.

hack and hack
Desconectado
Joined: 04/02/2015

Wait, I just remembered something: it's possible to access the HDD from a liveUSB. I can't remember how the procedure is called, but I know I've detailed it in this forum (and did it obviously). Oh right, it('s called chrooting, and it might be easier to troubleshoot while being logged.

hack and hack
Desconectado
Joined: 04/02/2015

I have no idea if it would work with a cdrom, but I guess it should work. I'm looking for a chrooting tutorial I've posted somwhere in the forum.

hack and hack
Desconectado
Joined: 04/02/2015

I just have written an answer that the forum refused to let me publish (access denied)...

Anyway, here it is:
https://stephentanner.com/restoring-grub-for-an-encrypted-lvm.html

I took it from here: https://trisquel.info/en/forum/netinsall-tty-apt-get-update-not-working#comment-98813

The idea is to start a livecd or liveusb, open the CLI, then type a bunch of commands in order to access your encrypted disk.

From there, you need to know more about vmlinuz and how to replace it or rename it or whatever makes it work.
Hence the links I've posted above (I don't know if they precisely apply to your problem though).
Also this explains a bit more: https://en.wikipedia.org/wiki/Vmlinux

No problem, I know how irritating it is to make Libreboot work. My case was special, but it took me 6 months because of a damn bug: impossible to boot when the cd drive is inside the Ultrabase.

But that's as far as I can go right now, you need to try chrooting (just follow the instructions and adapt them if needed), and you need to find out what to do with vmlinuz.
I'll keep trying to help if I can though.

Just stay as calm as you can, be patient, and never give up :)

hack and hack
Desconectado
Joined: 04/02/2015

Is it an error while chrooting?
What is /dev/zapper?
At which step are you exactly?
Trying to mount the partitions, as in this?
mkdir /media/linux
mount /dev/main/root /media/linux
mount /dev/main/usr /media/linux/usr
mount -o bind /proc /media/linux/proc
mount -o bind /dev /media/linux/dev
mount -o bind /sys /media/linux/sys

From the livecd or usb, in the CLI, the first command you need to type is modprobe dm-crypt, followed by
cryptsetup luksOpen /dev/sda3 linux (can be sdaX, X being a number. maybe fdisk -l might tell you the name of your encrypted drive, I don't remember exactly how I've figured it out).

hack and hack
Desconectado
Joined: 04/02/2015

That's just a guess, but maybe try to go in the /media folder and create a /usr folder, then try again (you'll most likely need to be as root user to do so).
I don't know if it's supposed to be there by default or not, I can't remember exactly how it went for me.

GNUbahn
Desconectado
Joined: 02/18/2016

CalmStorm, I have the same issue: After installing Trisquel on libreboot and trying to boot I get stopped by the "error: file `/vmlinuz' not found" message.

And I've found no way of solving it yet.

I have an 'appointment' with Leah Rowe, that she will guide me to a solution via #libreboot some day. I already discussed this with her and together we found, that I apparently have no /boot/ and no vmlinuz files, which she finds "strange".

By email Leah suggested me to "add a symlink in your / to make that file, or you can modify your grub like so: https://libreboot.org/docs/gnulinux/grub_cbfs.html"

And to this in this way:

"Boot trisquel live usb and mount the installed partition then go into
/boot/grub on that partition in your terminal and do:

ln -s grub.cfg libreboot_grub.cfg

reboot and it should work"

If you manage to solve this, please let me know.

hack and hack
Desconectado
Joined: 04/02/2015

I don't have the problem, but out of curiosity:
I think either vmlinuz is really missing, or GRUB links to it the wrong way.

vmlinuz is supposed to be in the /boot folder as far as I know (https://superuser.com/questions/62575/where-is-vmlinux-on-my-ubuntu-installation), so that would be the first thing I'd check.
From there, either it's a problem with the Trisquel install, or GRUB needs to be updated I guess.
Either way, you'd neet to chroot (a.k.a. "mount the installed partition from a liveUSB or liveCD").

If you have no /boot, maybe it's on its own partition: https://bbs.archlinux.org/viewtopic.php?id=132806

GNUbahn
Desconectado
Joined: 02/18/2016

CalmStorm: Did you ever access Trisquel after installation?

hack and hack
Desconectado
Joined: 04/02/2015

He didn't, he can't boot manually (cryptomount -a etc.). Specifically because of that vmlinuz thing missing.

GNUbahn
Desconectado
Joined: 02/18/2016

Thanks, that's what I thought, I just had to be sure.

I'll look into your other comments later, when I have some time.

Ignacio.Agullo
Desconectado
Joined: 09/29/2009

name at domain, Ven 30 Set 2016 23:25:33 CEST:

> 2) Get the MAC adress of the laptop, most likely on a sticker at the
> bottom of the laptop. Get the ROM image you need. For this, you need
> to pick it in the grub folder, knowing if it's 4, 8 or 16m (can't
> remember how I know that, so if anyone knows, please let us know),

The command to get the size of your ROM is:

# dmidecode | grep ROM\ Size

...as seen in https://libreboot.org/docs/install/x200_external.html

------------------------------------------------------------------------
Ignacio Agulló · name at domain

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Ignacio.Agullo
Desconectado
Joined: 09/29/2009

Just happened to update Libreboot on my x200, following the
instructions at https://libreboot.org . Things are OK now, but I
experienced an issue, which I'll report here.

I chose to have a fully encrypted disk, and that's OK. But
then I chose to add a GRUB password, and that's where I found trouble.
By any inexplicable process, adding a GRUB password at grubtest.cfg
always caused my keyboard to malfunction. The shift key started
working oddly: it stopped working, but only for the letter keys. So,
when at boot time I had to introduce the disk passphrase and I needed
symbols, there was no problem - but when I needed a capital letter, I
would have to turn Caps Lock on (and then off again if it followed a
non-capital letter). When system was finally started, the keyboard
problems still were present, making it difficult to write capital
letters every time. I reflashed the x200 using different ROMs, even
from old versions of Libreboot, but it only got worst from there.
Caps Lock stopped working mid-boot: the Caps Lock light would stop
reacting to the keypress and the passphrase would no longer be
recognized. I got to the point that there was no way to boot the
system, so I had to resort to an Trisquel USB with the libreboot utils
so I could boot Trisquel live and reflash the system from there.

So far, I have been unsuccessful to get Libreboot work well with
a GRUB password.

------------------------------------------------------------------------
Ignacio Agulló · name at domain

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

GNUbahn
Desconectado
Joined: 02/18/2016

I am not sure if this is an appropriate comment, but:

As I wrote above, Leah advised me to add the symlink for vmlinuz myself (by the above mentioned commands). So I booted from a live-usb, mounted the encrypted partition and found, that the vmlinuz symlink to the vmlinuz file in /boot/ is there!

So why wont Libreboot read it?