Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo on ECS Liva (Bay Trail SoC)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
SiliconFiend
n00b
n00b


Joined: 28 Dec 2005
Posts: 11

PostPosted: Sat Dec 20, 2014 1:26 am    Post subject: Gentoo on ECS Liva (Bay Trail SoC) Reply with quote

I just picked up one of the ECS Liva (2 GB RAM, 32 GB eMMC, Intel Bay Trail N2807, Ethernet, USB 2.0 and USB 3.0, HDMI + VGA, WiFi+BlueTooth via M.2 card) on sale at Newegg to use as a MythTV frontend and I wanted to share some notes from my install experience, hopefully to save someone some time and frustration. First of all, when you're installing the included wireless antennas, don't try to pull off the plastic shields on the wires or you will likely pull off the connectors. Just push them up on the wire out of the way.

The only boot option for this system is USB (unless you can get PXE/netboot working, but I'll assume USB). So the first step is finding a workable USB boot disk. The Gentoo install ISOs claim to be hybrid and that you can just dd the ISO to the USB stick and boot from that, but I did not have any luck with that method. It was not recognized at all as valid boot media. I finally got it working by mounting the ISO from SysRescueCD (which is Gentoo-based) as a loopback (on another Linux system) and then running the included usb_inst.sh script. I suspect it's because the Gentoo install CDs may be MBR boot based and this system apparently only supports UEFI boot. Anyway, once it brought up the GRUB menu, I had to select the Alternative Kernel option; anything else wouldn't boot.
After booting, I followed the AMD64 Gentoo Handbook install instructions, but ran into some pitfalls as those instructions are again geared toward MBR boot but UEFI requires a different partitioning for boot. Here's how my partitions ended up (after some rearranging thanks to gparted):

mmcblk0p1: 128 MiB, EFI System partition (gdisk code EF00), formatted FAT32. Note that FAT32 seems to be important here, and that requires a minimum filesystem size.
mmcblk0p2: 128 MiB, boot (gdisk code 8300), formatted ext2
mmcblk0p3: 512 MiB, swap (gdisk code 8200), formatted with mkswap. Not sure if it's required for this system or even a good idea on an SSD, but...
mmcblk0p4: rest of disk (~29 GiB), root (gdisk code 8300), formatted brtrfs

I installed the stage3 tarball, chroot'd, did all the config steps in the handbook and then configured the kernel. This was by far the most time-consuming step and involved a lot of test, modify config, recompile and reinstall, reboot. One thing I did to try to get everything working is search for config features with BAY or TRAIL in the name and enable anything BayTrail related. There were also a number of SoC config options which were applicable. Also I enabled all the modules which were detected and loaded by the USB boot disk. Some key notes to getting the WiFi card working: It's a Broadcom 43241 and it uses the brcmfmac driver with the SDIO interface. It also needs the linux-firmware package installed, specifically the /lib/firmware/brcm/brcmfmac43241b4-sdio.bin file. One more thing I needed to do is to copy the NVRAM settings from /sys/firmware/efi/efivars/nvram-(some string of numbers) to /lib/firmware/brcm/brcmfmac43241b4-sdio.txt That file had some garbage characters on the first and last lines but I stripped them out with nano. Not sure if it was necessary to get rid of that garbage or not. Note that I did this step after already booting on the new kernel so the boot USB may not have what you need to get those nvram settings. The kernel needs efivars enabled at a minimum. More information about the firmware here. The kernel I installed was 3.16.5-gentoo (the boot USB was 3.14.something). The wireless driver (really just firmware files) on the ECS support website is targeted at an earlier kernel, because they are named brcmfmac-sdio.bin and brcmfmac-sdio.txt and the naming changed to more specific model names somewhere around 3.10 or 3.11 I think. Note that based on some discussion on a mailing list I did not enable power saving for the wireless driver. I may try to enable it now that everything's working, but the whole system is only 15 W max (and probably more like 5W typical), so I doubt it would make much difference anyway. The Ethernet port uses the RealTek r8169 driver. Video is the Intel i915 driver. USB uses the xhci driver. I can share my kernel config if someone wants it.

grub2-install seemed to work fine with the defaults (which is a 64 bit EFI install), but you need to mount /boot, and then mount the EFI system partition on /boot/efi before running grub2-install. I tried to keep it simple and boot with just a kernel without an initramfs, but I think the eMMC storage wouldn't work, so I used dracut to create the initramfs with
Code:
dracut --hostonly '' 3.16.5-gentoo
and then
Code:
grub2-mkconfig -o /boot/grub/grub.cfg


I had some struggles getting the WiFi adapter working the way I want. I made the mistake of putting dhcpcd and the net.wlan0 modules in the default runlevel, which caused wpa_supplicant to be started twice, and the second time (in net.wlan0), it threw the following error and wouldn't start (although wireless was still working, thanks to dhcpcd):
Code:
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore

I tried to use the net.* scripts as in the handbook but for some reason it didn't appear to be running dhcpcd for wlan0 after wpa_supplicant connected, so I gave up, removed the net.* scripts from the default runlevel and added dhcpcd back. It seems to be working now, but I'll probably revisit this since I'd prefer to use the net.* scripts because they seem to give me more control (and I want to try to set up an Ethernet bridge)

Some notes on installing packages: This thing is not a compile beast, but it is totally adequate (make sure you add MAKEOPTS="-j3" to take advantage of the 2 cores). I did an emerge mythtv and it pulled in 105 packages, including mariadb and most of the qt libs. It took about 5 hours to compile all that. For some reason it didn't pull in the xorg-server packages (I'll mention that to the mythtv package maintainer) and I think emerge xorg-server took maybe another hour. After installing all this it used only about 4 GiB. I don't envision installing much more but the 32 GB is plenty of space for this application.

The system is pretty quick to boot. Since it's only a frontend it's not running many services. From power-on to X starting is about 20 seconds. I had to add a 10 second delay before starting mythfrontend because it was coming up before the wireless card got an address, which put myth into "new config" mode. One nice thing--VAAPI worked right away; all the necessary libraries were pulled in automatically by way of the vaapi USE flag. I had to change the MythTV painter to OpenGL, but other than that, it worked great.

One other note: I also got an MCE remote to use with this system (an OEM-branded Ortek VRC1100). Thanks to devinput it worked right away out-of-the-box (even the mouse!). However, the "Back" (left arrow) button adjacent to the directional keys maps to Backspace, and the "Clear" button on the bottom center below the number buttons maps to Escape. MythTV did not fully support remapping those keys itself (some things worked, some didn't) so I used ir-keytable to swap them. I added the command in a udev rule as follows (based on a rule from here):
Code:
KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",IMPORT{program}="input_id %p"
KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ENV{ID_INPUT_KEYBOARD}=="1",ACTION=="add",SYMLINK="input/irremote0",RUN+="/usr/bin/ir-keytable --set-key=0x70029=KEY_BACKSPACE,0x7002a=KEY_ESC --device /dev/input/irremote0"
KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ENV{ID_INPUT_MOUSE}=="1",SYMLINK="input/irremote1"


With the one exception of the Bluetooth, everything is working on the system--HDMI (audio + video), VGA, analog audio, WiFi, Ethernet, etc. I haven't seen any indication of driver support for the Bluetooth but that's not important to me. I'm happy to share any config files, etc. if that will help someone. I'm pretty persistent and don't get easily frustrated when working with hardware, so I don't mind slogging it out until it works the way I want it to. As one of my customers once said: "An engineer will work on something until you take it away from him[/her]."

Edit: Added details about the hardware and antenna installation
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum