Linux on the Yoga 2

This was probably more useful when I first wrote it, in 2016 or so. But, one never knows, someone may still have a yoga2 and make use of it. Later versions of both Linux and FreeBSD work rather well with it.

There are several more in depth reviews and articles about the Yoga 2 on the web. One can start with the Arch Wiki's article which links to a few of the others. There's also a review of using it with Fedora here.

I decided to put up this small page because there were a few issues that no one seemed to mention, and though the Yoga 2 is already being replaced by the Yoga 3, it may help someone in the future.

I don't make much use of the touch screen. This machine was given to me, it's not that one that I would have bought. (Nothing against touch screens, it's just that I seldom have use for them.) I primarily use this for browsing, some work in terminal, and to watch videos.

Installation

I do a minimal installation of Fedora, adding packages afterwards. As I mention below, when trying the live Workstation install, I didn't have the sound, video, or wireless problems I mention here.

When booting, holding the function key and F12 will give you a boot menu. Holding the function key and F2 gives you the BIOS configuration menu. There's also a very small button by the power switch. Pushing this button--you may need a paper clip to do it if you don't have nails--will boot into a menu that allows you to choose the boot device or go to the Bios setup. Keep in mind that if you blow away all partitions, there's no reinstall media, so be sure you want to completely get rid of Windows before doing so. (In my case, I had no use for it, so this wasn't an issue.)

With Fedora and Arch, before boot, one has the chance to hit tab for options. You can add nomodeset to the kernel options--if you don't, the fonts will be very tiny and difficult to read.

In both cases, the wireless could be problematic during installation. I have a Zenbook, which thoughtfully includes a USB to RJ45 ethernet adapter, which worked quite well with the Yoga. Lenovo doesn't include such an adapater, so if you're installing Linux, you may wish to get the full DVD of either Arch or Fedora. Fear not, it's easy to get the wireless working afterwards. Be sure you install rfkill as you'll need it to unblock the wireless after installation

With Fedora, one must install the iwl7260-firmware package for the wireless to be seen.

The articles linked above cover installation in more detail. Here are the little things that made me decide to put this page up. These are issues that I had in both Fedora and Arch.

Sound

Sound doesn't work out of the box. The sound card is not the default device. I haven't researched this too deeply, but I was able to fix this by creating an alsa.conf file. Change to the /etc/modprobe.d directory and create a file called alsa.conf. The file should read
options snd-hda-intel index=1

and then sound works after a reboot. There may be a way to reload it without a reboot, but I didn't research it.

Video drivers

As mentioned, the fonts were extremely small if I didn't use the nomodeset option. The trouble with using said option is that if I did, I wasn't able to get X working with the Intel driver. If using nomodeset, X only works with the vesa driver. So, once I have a working install, I need to change both X and the console font. (With the desktop environments, such as Gnome and KDE, there are GUI tools to adjust fontsize, such as DPI scaling, but I prefer openbox and dwm, which lack such tools.)

The vesa driver is adequate but if playing videos with the mpv player, the screen would sometimes go black. Aside from that, with my limited use, I didn't notice any drastic performance difference.

Adding the following to .Xdefaults makes the fonts readable in X, whether using the Intel or vesa driver, in the two terminals I use, urxvt and uxterm. The Xft line is necessary for reasonable font size in browsers, Libreoffice, and, no doubt, other applications which I haven't yet used.

As mentioned in more detail below, one can also just use xrandr with something like
xrandr --output eDP1 --scale .7x.7

The smaller the scale number, e.g. .5x.5, the larger the font. Your system may use eDP-1 rather than eDP1, running xrandr with no arguments will tell you what your system uses.

I've had to play with fonts, adding, for example, the liberation-ttf fonts. The reader can experiment. Other times, my usual terminus worked with
Xft.dpi:192
URxvt*font:xft:Terminus:size=24
UXTerm*facename:Terminus:size=12

I believe the dpi should be in multiples of 96, but the ArchLinux Wiki has suggested 180 as resolution and that has worked for me as well

The UXterm facename is a wee bit clearer to me if I change its size to 24 as well, but then its cursor is huge. The reader can play with sizes to fit their needs. If using Arch, which, at least in its package of dwm, uses st as a default terminal, starting it with
st -f "Terminus:size=24"

will open a more easily read terminal. (That's a stopgap solution--both dwm and st involve editing config.h as part of their configuration, which is beyond the scope of this article)

The console fonts are also too tiny for me to easily read without nomodeset, so I change them as well.

In both Arch and Fedora, one edits the file /etc/vconsole.conf. (I had to create it in Arch--it already existed in Fedora). I use the line
FONT=ter-v32n

which was a font I found under /usr/share/kbd/consolefonts in Arch. The actual file is ter-v32n.psf.gz. When seeking fonts there, ignore the psf or psfu,gz suffixes.

In Fedora, the fonts are kept in /usr/lib/kbd/consolefonts. As I like the terminus fonts, I ran
dnf install terminus-fonts-console

to install the terminus fonts for console, then edited vconsole.conf to read FONT=ter-v32n.

You can specify the font on the kernel line when booting by adding to the end of the kernel line, the one that begins with linux and ends with, on RH based systems, rhgb quiet
vconsole.font=ter-v32n

(Because the kernel line may already have a font embedded in the initramfs image, you might have to rebuild the initramfs image file after making the change. I've not actually tried this, just mention the option.)

One quick fix for tiny fonts in X is to use xrandr. Running
xrandr --output eDP1 --scale .5x.5

Should scale things to double size or so. The user can experiment with how much larger they need their screen. Using .4 instead of .5 would make it large. The lower the number, the larger the fonts (and everything else). In case your brower's font doesn't make that clear, it's eDP1 the numeral one, not a lower case L. In Fedora, as of 26 at least, it is eDP-1, rather than eDP1. Typing xrandr with no arguments at a command prompt should show you how your system views the display.

Other distributions and systems

I also tried Fedora's Workstation live USB. It worked out of the box, including sound and font size. I stay with my minimal installs because it fits my personal workflow, but those who like Fedora's Gnome 3 should have a working install without having to make any adjustments. Wayland seems to autoscale.

Ubuntu's Unity, although it had tiny fonts, was easily resized by going to the system settings, opening display, and moving up the slider on the lower left, Scale for menu and title bars. Other things worked out of the box. The procedure is described in this ask Ubuntu post. Ubuntu 17.10 uses Gnome and Wayland by default, and Wayland auto scales it into a readable size.

Although I saw one suggestion to just add the Xft.dpi:196 to an .Xresources file on Lubuntu, that didn't work for me. I tried a couple of other things to resize fonts and icons in Lubuntu, but without success. I'm sure it can be done, but I didn't spend much time with it and only tried with a live USB.

LinuxMint-17.2 Cinnamon boots up with tiny fonts and icons, but if one goes to the menu, types in general, and clicks on the result, they are presented with a window that allows them to set Desktop Scaling to Double (Hi-DPI) which should be sufficient for most people. Other things worked out of the box.

VoidLInux has a few issues. When booting the install media, hit tab and add nomodeset. The wireless card was blocked by rfkill, but the Void install media didn't include rfkill, though once the system is installed, it is included in the base util-linux package. Therefore when booting the install mediea, hit tab. You'll see the kernel line. At the end of it add nomodeset (so that fonts aren't tiny, see below) and
modprobe.blacklist=ideapad_laptop

This lets you bring up the wireless during installation. I believe the next Void live ISO will include util-linux, so you may be able to, by the time you read this, just use rfkill to get a list of devices. It's usually phy0. Then, if the number in front of it is 3, you can run rfkill unblock 3, or just run rfkill unblock all if you don't feel like checking.

One can use a USB to ethernet adapter or choose local rather than network during installation. In my case, I installed it on a system that had Fedora. Before I knew the modprobe.blacklist method, I mounted the Fedora partition and ran /mnt/usr/sbin/rfkill to unblock the wireless. This enabled me to set up the wireless to use it during the installation.

The fonts are tiny by default, so the first time I booted after installation, I edited the kernel line, adding nomodeset. I then installed Terminus-fonts, and edited /etc/rc.conf, which is where one designates the console font in Void, to read ter-v32n. Aside from that, like minimal Fedora and Arch, I had to create an alsa.conf file. The rfkill block on the wireless persisted on reboots, The fix, found for me by Void forum user cr6, was to create a file, /etc/modprobe.d/blacklist.conf. In there put the line
blacklist ideapad_laptop

I found the fonts hard to read, so I added an xrandr line (you have to install xrandr) to my .xinit just before the exec <window manager> line.
xrandr --output eDP1 --scale .7x.7

To make the mouse bigger I installed Xcursor-themes and then added the following to my .Xdefaults
Xcursor*theme: Adwaita
Xcursor*size:  32

This gives me a black, more or less a standard cursor. There is also whiteglass if you want a white cursor, and redglass if you want a red one. There are a few more themes in there too, usually in /usr/share/icons. (In FreeBSD, /usr/local/share/icons).

Firefox fonts were still too small, but this was fixed by adding
Xft.dpi:150

to $HOME/.Xresources.

Aside from those minor issues, it runs quite well and has become the distribution that I usually run on the laptop.

FreeBSD

FreeBSD will install and as of February, 2021, (wow, hard to believe I first did this around 2016), works pretty well, with 11.2-RELEASE and later. I tend to install CURRENT on it, but 11.2 should be fine. I have gotten better results with the Intel video with 12.x and higher.

I upgraded the wireless card to a dual band (that can use 5GHz as well as 2.4Ghz). In Linux, this resulted in a tremendous speed increase, for example, transferring a large file in between local computers at 35-50 MB/s. However both FreeBSD and OpenBSD, though they could connect to the 5GHz channel without a problem, were unable to us 802.11n mode, only reaching speeds of 2-3 MB's on the local network. I occasionally get speeds of 11 MB, but the 2-3MBs is more typical.

During installation, and after each bootup, the screen will be be covered with messages like
ugen0.4: <ELAN> at usb0
hid_get_item: Number of items truncated to 255, 

due to the touch screen. The way to fix it is to see the ugen number, which for me, with the power attached, is ugen0.5, go to a different virtual console (you have to press the function and alt keys to do so), and run
usbconfig -d 0.4 power_off

(If I'm not using the power cord, it will usually show as ugen0.4). The message on the screen, gives the ugen number.)

During installation, when I sometimes can't get to another console, I fix it by choosing single user mode, (number 2 at the boot menu). As it boots, even in single user mode, one will see if it's 0.4, 0.5, or something else. In single user mode I type the usbconfig command above. It's still a bit hard to do, it's best to stare at the keys, not the screen, even if you touch type. Once it's done, the garbage messages stop, type exit, and you can begin the installation. Running 12.x or higher, the wireless works out of the box and can be used during installation. However, as mentioned above, it's still slower than Linux.

After installation, in /etc/rc.conf, one can add
wlans_iwm0="wlan0"

If this is done, upon boot, one will see wlan0. FreeBSD-11 and later longer show wireless cards like iwm0 or, as another example, urtwn0 in ifconfig. See this commit.

The machine's Haswell ULT Intel video card isn't supported out of the box, but works with the drm-kmod pkg. See the wiki page for instructions. Otherwise you have to use the vesa driver, which is painfully slow. Fonts are also tiny by default--the entries I mentioned earlier, for dpi, help, the most important one being the dpi entry. I would recommend increasing mouse size as well. This can be done by installing xcursor-themes, then, the user can change the size, 32 being a good size for me. I changed over to whiteglass and call it in .Xdefaults
Xcursor*theme: whiteglass
Xcursor*size 32

This gives me an easy to see cursor for me. It's standard white in color. Some people prefer redglass which will give you a red colored cursor. In FreeBSD I got it with pkg install xcursor-themes. Some other themes, such as Adwaita, are included. Just check /usr/local/share/icons, the names of the different themes are there. Again, on the Thinkpad T495 32 is a better size for me.

With OpenBSD, having the same problem of an almost invisible cursor, I did the same thing. However, at least as of 6.3, OpenBSD only offers cursor-themes through ports, so you will have to install ports and use it for redglass. I didn't spend much time looking for alternatives, I just wanted to stop having to search all over for a tiny mouse.

I use dwm built from ports with a customized config.h file. Although I increased the size of the font in that file, the status bar was still showing tiny fonts until I added the xft.dpi line in .Xdefaults.

With 13.x and 14-CURRENT at time of writing, I've found that the console fonts are a readable size out of the box.

As mentioned on the wiki, you can add the drm-next-kmod package with pkg install. Then, add yourself to the video group and add the following to /etc/rc.conf.
kld_list="/boot/modules/i915kms.ko"

In 12.x, this will make console fonts very tiny, so also add to to /boot/loader.conf
kern.vt.fb.default_mode="800x600"

As of 14-CURRENT, though, the console fonts are fine, with or without the drm-kmod package.

I also like to change from the default kernel with CURRENT (which has a lot of debugging stuff) to GENERIC-NODEBUG.

For the less experienced, it's probably worth pointing out that CURRENT is not recommended for beginners. It's more of a developer/tester version, but in this case, I'm using it for the better hardware support.

OpenBSD

OpenBSD is at 6.3. Both the ELAN Touch screen and uhidev give a lot of garbage messages at the prompt. I've not found a way to disable the ELAN messages, but you can get rid of the uhidev ones When booting during installation At the boot prompt run
boot -c

This will lead you to a ukc prompt. At the prompt type
disable uhidev
disable ugen
quit 

You will still get garbage messages about the ELAN Touch screen, but it's greatly lessened. (In 6.2, this was boot -k.)

Lately thouugh, (Oct 2019) I can't even get 6.3 to work with X. Although some people on daemonforums.org have given great help, I have to admit it's not working for me at the moment. I hope to update.

During installation, if you have a primary partition, you can choose to make it an OpenBSD one quite easily. If you have a logical partition, I find it easier to do it with Linux, prior to install. See my OpenBSD multiboot page.

If not using the whole disk, then during install, choose o for OpenBSD partition and choose a as in auto to let it automatically partition the OpenBSD slice. If there is an existing partition (or if you create it during installation), this will be the default.

There was a rhythm to the garbage ELAN touchscreen messages so that I was able to work around it. Upon reboot after install, I could just go to ttyC1, as messages would persist on ttyC0.

If, like me, you don't use the touchscreen at all, you can permanently eliminate the uhidev messages. Once logged in
config -e -f /bsd

This brings you to a ukc> prompt.
disable uhidev
disable ugen
quit

If you use the touchscreen, (which works out of the box), don't disable uhidev, it's necessary.

There has been some work on inteldrm, and while some people have posted that this has fixed things for them, others, including myself, would get a black screen upon starting X. For me, the fix is to create an /etc/X11/xorg.conf.d/50-intel.conf file. It reads
Section "Device"
  Identifier "default device"
  Driver "intel"
EndSection

I installed openbox and included the .Xdefaults lines for dpi and terminus font mentioned above and after doing that, everything was readable.

The console font is very small, and difficult to read, especially as the ELAN garbage messages are showing up on tty/C0. However, one should log in on C0, otherwise, drm0 (for sound) will have wrong permissions and things like mpv won't work properly.

Upon first boot, until I get X configured to my liking, I like to run boot -c at the boot> prompt and disable inteldrm, by typing, oddly enough, disable inteldrm at the ukc prompt that will appear. Then I can add my packages, configure .Xdefaults to my liking, and so on without eyestrain. When done, I can reboot and do my work from X.

One workaround for drm0 is to edit /etc/fbtab. (Thanks to user johnR at daemonforums for the suggestion.) One can add
/dev/ttyC1   0600 /dev/drm0

Actually using xenodm may be the easiest way, although I wouldn't try until having my .Xdefaults set up. It allows you to avoid the garbage messages on screen as well as the tiny fonts in console. To enable xenodm, as mentioned in the faq, just type rcctl enable xenodm and it will work on the next boot.

However, for whatever reason, as of 6.4 and up, xendom is not working for me. The screen just goes black. My guess is that there are too many messages being spit onto ttyC1, as there was nothing in the logs. So I haven't been able to go above 6.3. I used a USB to ethernet dongle for the install, and afterwards ran fw_update. The wireless then worked. With all the garbage on the screen about the ELAN touchpad, it was too much trouble to try to get it working for the installation itself.

As mentioned in the iwm man page, the wireless card does not work with 802.11.ac. The upgraded 7260 card would only do internal transfers, even on a 5GHz network, at 2-3MBs, vs the 20-30 of a Linux install.

If one is looking to run a BSD on this laptop, at present (CURRENTLY?--heh), I would recommend FreeBSD-12 (CURRENT), but OpenBSD can certainly be made usable. For me, though, I haven't gotten X working with anything later than 6.3.