GNU/Linux installation on libreboot machines

19 replies [Last post]
Cyberhawk

I am a translator!

Online
Joined: 07/27/2010

Hello everyone!

I just received my first librebooted machine, the X200 Thinkpad. Thank you vikings!

It has Trisquel 8 installed, with full disk encryption, ready to go. I'm enjoying the great keyboard on this thing right now as I type. Feels great to finally own this!

Since this is the first time I ever held a machine with libreboot in my hands, I have some questions.

1. How much of a hit does performance take with full disk encryption? My past experiences show that performance does take a very significant hit when encrypting /home. But maybe I was doing it wrong? My new X200 feels really fast and responsive, but I didn't try anything more demanding than using abrowser yet...

2. How difficult is it to install a GNU/Linux on the X200 with libreboot? I read the documentation on libreboot.org and it mentions typing in commands in the grub menu, and manually creating a grub configuration after install to get a bootmenu and prevent manually typing boot commands each time. Is that actually required for all machines with libreboot?

uboot
Offline
Joined: 05/31/2016

1. I use full disk encryption since a while now and I would say it is not significant. Since I'm using a SSD, this is very hard to see a difference. It depends on the cipher algorithm you use I guess. (I use serpent-xts)

2. It is very easy. Libreboot (coreboot) only init the hardware then switch to a payload, GRUB, which sits on the flashchip rather than on your hard drive. It includes a grub.cfg (grub config) which allows to boot from your hard drive, a usb key, a cdrom etc.. This file can be tweaked to allow more configuration.
You don't need to install GRUB actually (since it is already there, on the flashchip) but for pratical reason, you can still install it on your hard drive. (For example, if you need to boot your OS on a other computer) -> When you start your x200, GRUB (payload) will locate the second GRUB (installed on your hard drive) and it will boot normally.

Unless you are configuring full disk encryption*, you don't have anything to tweak, just install GNU/Linux normally.

*In this case, since the disk is fully encrypted (including /boot partition), you must tweak the grub config file to tell it to run the cryptomount command (which prompts for your passphrase) and write a little entry to boot the kernel and initramfs.
Example on my setup, yours will surely be different of course.
menuentry 'Load Operating System' {
insmod ahci
insmod part_msdos
insmod part_gpt
cryptomount -a # Unlocking the encrypted drive
set root="lvm/rocket-root" # Set root partition
linux /boot/vmlinuz-linux-libre-lts root=/dev/rocket/root cryptdevice=/dev/sda1:root:allow-discards rw # Load the kernel
initrd /boot/initramfs-linux-libre-lts.img # Load initramfs
boot
}

Cyberhawk

I am a translator!

Online
Joined: 07/27/2010

thank you for the detailed answer! I think I might try a re-install in the future. The worst that can happen is, I'll have to re-format all the drives and lose all data, right?

uboot
Offline
Joined: 05/31/2016

Since your Trisquel 8 installation is fully encrypted, a Trisquel reinstall or installation of an other distro implies to fully format the drive.
So indeed you will lose the data on it. ;)
it will not touch the grub.cfg file (the one in the coreboot filesystem in the flashchip) since you need to use various tools to tweak it (namely flashrom to extract the rom and "cbfstool" to show the content of the coreboot filesystem where grub.cfg resides) so no worries here.

I don't know what you want to achieve ? A standard clean installation unencrypted ? Or with full disk encryption like the one vikings set up ? For the latter, it might implies to tweak the grub.cfg file a little. Maybe vikings are using a custom grub.cfg, better ask them directly.
If you have a hard drive laying around, you can also switch the hard drive and try to install the distro of your choice until you're feeling comfortable.

Cyberhawk

I am a translator!

Online
Joined: 07/27/2010

My goal was initially to have different partitions for / and /home, and install with the KDE environment. I did check "no operating system" when ordering, but somehow I got a X200 with Trisuqel 8 installed. I actually have a spare SSD laying around, which I definitely can practice on.

But right now it seems I did something wrong with the docking station, the notebook has gone into some hibernate state and I can't wake it up anymore :P The screen remains black but the notebook seems to be running (I can hear an extremely quiet fan running). The inidicator LED on the X200 also seems to show that it is turned on. But the screen is black, can't do anything about it. Can't turn it off too, when I turn it off it just powers back on instantly. It beeps when removed from the docking station and keeps beeping until the notebook is put back on the dock...

uboot
Offline
Joined: 05/31/2016

Mmh. I have a docking station for my x200 but I don't use it much. I'm not sure hibernation is fully working with Libreboot. I would disable it entirely.
Try to install a fresh Trisquel install with separated / & /home as you said, don't forget to add a big enough /swap partition (this will be handy to test hibernation)
Something like that :

MBR
1. /boot (500M)
2. /root (30G)
3. /swap (8G or 16G)
4. /home (remaining space)

Then, once Trisquel installed, make sure to configure resume variable :

With the partition scheme above, your /swap partition is on /dev/sda3, so in /etc/default/grub

GRUB_CMDLINE_LINUX="resume=/dev/sda3"

(Don't forget to update : "update-grub" )

But maybe Trisquel installer take care of this, who knows :)

Cyberhawk

I am a translator!

Online
Joined: 07/27/2010

Sleep and hibernate don't work, sad but true. Have to keep the lid open even when the X200 sits on the dock, which really looks stupid on my table (otherwise the machine boots normally, only to end up in sleep mode right after login, even though I disabled sleep and hibernate as far as I can tell).

Thanks for the suggestion with customized resume variable, I'll be able to reinstall in about two weeks when I'll be having more spare time.

CalmStorm

I am a member!

Offline
Joined: 12/31/2014

Hmm... I never have had that problem with suspend even with trisquel 7. Trisquel 8 I imagine could be different, but more than likely its something of a bug.

Hibernate however works very badly on trisquel 7, so I assume the same can be said for trisquel 8.

Cyberhawk

I am a translator!

Online
Joined: 07/27/2010

libreboot cannot do sleep or hibernate in general, at least not reliably. Vikings recommends disabling those options as far as possible to avoid any issues.

Of course, seeing how far free BIOS replacements have come, I think sleep and hibernate will eventually be available too.

chaosmonk

I am a member!

I am a translator!

Offline
Joined: 07/07/2017

> libreboot cannot do sleep or hibernate in general, at least not reliably.

Suspend and hibernate have always worked reliably with my librebooted
X60 and X200.

Cyberhawk

I am a translator!

Online
Joined: 07/27/2010

That's interesting, did you customize some configuration files? Are you using a certain version of libreboot?

CalmStorm

I am a member!

Offline
Joined: 12/31/2014

in 2014 I was using trisquel up until, I think 2016, then I changed to Debian jessie and switched sometimes with testing, then Devuan jessie sometimes though moving to its form of stretch, ascii... and then follow back to one years ago exactly I switched to Hyperbola, which I haven't tried hibernate too often, but suspend, hardly ever a problem and hibernate also hasn't been a problem.
Though, I am not sure why this is, but occasionaly after being left on too long it freezes on really rare occasions. Weird right?

My point being, Devuan, Debian both occasionally have problems with hibernate, (if using FDE!)
and Trisquel 7 doesn't really hibernate without the crappy original kernel. and Trisquel 8 might have fixes for hibernate/suspend, but probably not hibernate.

Also, This was all on my x200!

My other point being, I THINK, though I could be wrong, its a ubuntu base problem.

Trisquel was better off being a fork of debian and then being moved about to look like it is now without using ubuntu. That's just my opinion though. Making an easy installer like the one ubuntu has and then changing it to install a debian like os shouldn't be too hard right?

Because, I know debian and devuan rarely have this issue. Ubuntu might, I am not sure if it does, but It might. I never used ubuntu and trisquel is, a ubuntu derivative whether libre or not which has had this issue of hibernation.

I could only hibernate back then by using the original kernel when I installed trisquel. Once though I installed a different kernel, forget about it...

My experience is this basically.

chaosmonk

I am a member!

I am a translator!

Offline
Joined: 07/07/2017

> That's interesting, did you customize some configuration files? Are you
> using a certain version of libreboot?

On the X60 I think I just followed the libreboot documentation to
install libreboot. This was about a year and a half ago, but I'm pretty
sure that I did not customize it at all.

I bought the X200 with libreboot pre-installed, so it's possible that
the vendor customized the config files in some way, but I did not.

ThinkFreePC
Offline
Joined: 12/09/2018

Never had a problem with suspend, or hibernate using Libreboot. Those with issues should maybe try installing Powertop. It has helped some with screen dimming and whining issues, so might help with the suspend, hibernate problems! However, I had screen dimming and whining on my X200 and it didn't work for me. I had to change the hex value using intel-gpu program, screen works perfectly fine now!

SuperTramp83

I am a translator!

Offline
Joined: 10/31/2014

>I had screen dimming and whining on my X200 and it didn't work for me. I had to change the hex value using intel-gpu program, screen works perfectly fine now!

Care to elaborate for those who might have the same issue in the future?

Cyberhawk

I am a translator!

Online
Joined: 07/27/2010

Thanks for all the input!

I just recently managed to re-install Trisquel, with no encryption and an 8GB swap in addition to my 8GB RAM. That ought to be more than enough for me.

> I could only hibernate back then by using the original kernel when I installed trisquel. Once though I installed a different kernel, forget
> about it...

During installation I choose linux-generic, so maybe suspending and/or hibernating will work now, checking it later today.

> I bought the X200 with libreboot pre-installed, so it's possible that
> the vendor customized the config files in some way, but I did not

my X200 also came with libreboot pre-installed and out of the box it could not suspend, and the problem was the machine did not want to wake up. It is hard to tell if the notebook was trying to go into suspend or hibernate, it was triggered by closing the lid while the machine was powered on. I had to pull the battery out to make it shutdown properly.

chaosmonk

I am a member!

I am a translator!

Offline
Joined: 07/07/2017

> my X200 also came with libreboot pre-installed and out of the box it
> could not suspend, and the problem was the machine did not want to wake
> up.

I have a few friends with macbooks running GNU/Linux, for whom
hibernation works with some kernels but not others. I don't know if it
will help, but you might try out a few different versions of the kernel.

Cyberhawk

I am a translator!

Online
Joined: 07/27/2010

So right now, after reinstall, suspend seems to work a bit better. Kernel is 4.4.0-140-generic. When I try suspending from the main menu (using KDE), the same problem occurs.

But when closing the lid the notebook goes to suspend after a short period of inactivity and wakes up immediately after opening the lid again. Fortunately, this does not happen while on the docking station, so I don't have to keep the lid open all the time while it is sitting on the dock.

At least I think it is going to suspend when lid is closed. The moon-shaped LED turns on, which I suspect is supposed to indicate suspend, or maybe hibernate? Who knows.

That's exactly how I would expect the notebook to perform. Not suspending while sitting on the dock with closed lid, while disabling the screen and suspending if the lid is closed while running on battery power off the dock.

Magic Banana

I am a member!

Online
Joined: 07/24/2010

The power management preferences in MATE's control center allows to define what to do "when laptop lid is closed". "Blank screen" is a possibility.

Cyberhawk

I am a translator!

Online
Joined: 07/27/2010

I'm using KDE, but the options seem to be the same. I chose "blank screen" and that's what it does, but after a short moment (half a minute?) the moon-shaped LED turns on, which probably means suspend.

That's also how I think suspend should work, I would not want to leave a computer running all the time and suspend or hibernate instead of reboot.

So all in all, the X200 is running great after the reinstall. Reinstalling turned out to be much less of an issue than I thought it would be. Thanks again for all the input!

So happy to have this little guy. It's not really the kind of "as-new" condition that was promised, but what else to expect of a 10-year old machine? I can live with some scratches on the back of the lid, I'll put stickers there eventually anyway.