Ufff, I haven’t been writing here for a while. But I’m back!
Few weeks ago I bought a Lenovo Thinkpad 11e Chromebook (at auction).
Why? I found out that you can install Linux on these devices, which are called Chromebooks. Also, I needed a more portable (and cheaper) device than my main “machine” (Lenovo Legion Y520), which could serve as a device for opening browser (Firefox) and terminal.
When it got delivered to me, I did installed a SeaBIOS (more later) and EndeavourOS on it for testing. And actually I was happy that Linux can work on it.
However there is a little issue with running Linux on my Chromebook… The laptop I bought is the 4th version of that model - under Linux (or probably any other OS than ChromeOS) internal sound and suspend/hibernate will not work. It’s not a big problem, sound issue can be probably solved with external USB sound card (or using Bluetooth speaker/headset). And suspend/hibernate can be replaced with locking (and disabling) screen (this Thinkpad has a good battery).
You can find info about possible problems with your Chromebook here.
Also, I run into an issue when once I closed the laptop’s lid (when its default behaviour was suspend). The result was a recovery of ChromeOS (I could not boot into SeaBIOS). But, heyyy, at least I decided to write it up!
Okay, so installing Linux on Thinkpad 11e (4th) consists of two phases:
- Enabling the Legacy Boot Mode (SeaBIOS)
- Installing distro of your choice (I tried btwOS, I mean Arch)
SeaBIOS
SeaBIOS is a BIOS that will allow us booting into different OS than ChromeOS.
Note: On some older Chromebooks, you can even get Coreboot working (on those ones suspend and audio should work out of the box).
In normal case, Chromebook works in Normal/Verified Boot Mode (it just boots straight into ChromeOS). You can get one into Recovery Mode (you can recover ChromeOS from USB pendrive). From there is only one step to getting Developer Mode, which allows eg. root/shell access. And if your device in the Developer Mode, you can get into Legacy Boot Mode (SeaBIOS). But first you have to enable it!
Steps
Power off Chromebook.
Remove the battery.
Press Esc+Refresh+Power until you will see info about the Recovery Mode at the display.
Then click Enter to enable the Developer Mode. Wait… Chromebook will perform factory reset (your all data goes brrr).
After a while, you should boot into Developer Mode (screen with “OS verification is off”). Click Ctrl+d to boot ChromeOS.
Log as Guest, open Chrome and click Ctrl+Alt+T for opening a terminal.
Type shell
Copy-paste commands from here to run a script made by MrChromebox.
The commands should be similar to lines below (copy paste from the link above!)
cd; curl -LO mrchromebox.tech/firmware-util.sh
sudo install -Dt /usr/local/bin -m 755 firmware-util.sh
sudo firmware-util.sh
When the script is up and running select “Install/Update RW_LEGACY Firmware” by pressing 1 and then Enter. You might be asked for setting default boot from USB - I clicked N (as No).
Then you can choose “Set Boot Options (GBB flags)” (click 3 followed by Enter) and select option 1. Setting this flag will automatically boot to the SeaBIOS from Developer Mode after 1 second.
Reboot the Chromebook. You should see Developer Mode screen, you can boot from here to ChromeOS (Ctrl+d) or to Legacy Boot Mode - SeaBIOS (Ctrl+l). If set that option 1 in flags, it should automatically goes to SeaBIOS.
Install Linux
I decided to install Arch Linux, so you can omit steps below if you want give other distro a try. However it may be worth looking at the Post Install Tips section!
Steps
Run this:
ls /sys/firmware/efi/efivars
You should see an error about not existing directory - which means the system may be booted in BIOS mode.
Now you should set up connection. Check if your wifi is not blocked:
rfkill
If not then connect to your WiFi with iwctl:
iwctl
> device list
> station list
> station station_name scan
> station station_name get-networks
> station station_name connect wifi_name
Check if your device can reach internet:
ping archlinux.org
Set the ntp:
timedatectl set-ntp true
Disk partitioning time! I decided to erase whole MMC memory (where ChromeOS is installed) - the disk was /dev/mmcblk1 for me. You may check your with:
fdisk -l
After running command below, new partitions should look like:
| Partition | Type | Size |
|---|---|---|
| /dev/mmcblk1p1 | BIOS boot | 1M |
| /dev/mmcblk1p2 | Root | 27G |
| /dev/mmcblk1p1 | Swap | 2,1G |
fdisk /dev/mmcblk1 # disk device
# deleting old partitions, click this d multiple times
> d
# print current state, should be 0 partitions
> p
# create new BIOS boot partition
> n
part num: > enter
1st sector: > enter
last sector: > +1M
# list partition types, check number for BIOS boot; 4 in my case
> l
# change partition type of the first one
> t
partition type: > 4
# root partition
> n
> enter
> enter
> +27G
# swap partition
> n
> enter
> enter
> enter
# check partition number for Linux swap; 19 in my case
> l
# change partition type of the third one
> t
partition num: > 3
partition type: > 19
# prints current state, 3 partitions should be listed
> p
# writes changes
> w
Format the partitions:
mkfs.ext4 /dev/mmcblk1p2 # partition with root
mkswap /dev/mmcblk1p3 # partition with swap
Mount the partitions:
mount /dev/mmcblk1p2 /mnt # partition with root
swapon /dev/mmcblk1p3 # partition with swap
Install basic packages and vim (if you don’t like vim, you may install nano instead):
pacstrap /mnt base linux linux-firmware vim
Generate the fstab file:
genfstab -U /mnt >> /mnt/etc/fstab
Chroot into the new system:
arch-chroot /mnt
Set the time zone and generate /etc/adjtime:
ln -sf /usr/share/zoneinfo/Europe/Warsaw /etc/localtime
hwclock --systohc
Uncomment en_US.UTF-8 UTF-8 in /etc/locale.gen and generate locales. Set the LANG variable in /etc/locale.conf:
vim /etc/locale.gen
locale-gen
# paste: LANG=en_US.UTF-8
vim /etc/locale.conf
Set the hostname (content of the file after —):
vim /etc/hostname
---
pyro
vim /etc/hosts
---
127.0.0.1 localhost
::1 localhost
127.0.1.1 pyro
Create a new initramfs:
mkinitcpio -P
Set password for root:
passwd
Install NetworkManager for connecting to WiFi:
pacman -Syu
pacman -S networkmanager
Install GRUB as a boot loader.:
pacman -S grub
grub-install /dev/mmcblk1 # the drive, not partition!
grub-mkconfig -o /boot/grub/grub.cfg
Install Intel microcode and enable it by regenerating GRUB config (in output should appear: Found initrd image: /boot/intel-ucode.img …):
pacman -S intel-ucode
grub-mkconfig -o /boot/grub/grub.cfg
Exit chroot environment, unmount all partitions and shutdown:
exit
umount -R /mnt
shutdown now
Now power on the device and boot to MMC from SeaBIOS. You should see GRUB and be able to boot into Arch!
Arch Post Install
Start and enable NetworkManager service, then use nmtui to connect with WiFi:
systemctl start NetworkManager
systemctl enable NetworkManager
nmtui
Install sudo, create a new user, give him/her ability to run sudo (by adding to wheel group) and change password of the user:
pacman -S sudo
useradd --create-home arek
usermod -aG wheel arek
EDITOR=vim visudo # uncomment %wheel ALL=(ALL) ALL
passwd arek
Install the bash completion:
pacman -S bash-completion
Xorg + i3
Install Xorg stuff with i3 and a display manager (and enable it):
pacman -S xorg xf86-video-intel mesa xorg-xinit
# choose i3-wm or i3-gaps
pacman -S i3 lightdm lightdm-gtk-greeter
systemctl enable lightdm
After reboot you should see a GUI for login and an i3 session (if you have passed correct passsword 😄).
Install some other useful stuff:
pacman -S xfce4-terminal git firefox feh network-manager-applet noto-fonts
Post Install Tips
Suspend
Disable suspend on lid close - open /etc/systemd/logind.conf and modify HandleLidSwitch to ignore:
sudo vim /etc/systemd/logind.conf
---
HandleLidSwitch=ignore
And restart the service:
sudo systemctl restart systemd-logind
If you want to lock device on a shortcut (with switching off the screen), you may look at line from my i3 config below:
bindsym $mod+Shift+s exec --no-startup-id i3lock & sleep 2 && xset dpms force off
I will try to put that locking a screen after lid get closed in my free time and update here!
Sources:
- MrChromebox page - this guy is awesome!
- GalliumOS Wiki
- Arch Wiki - Installation guide