Friday, June 12, 2015

Brand spanking new Gigabyte P55W v4 laptop... Linux?!?

My workhorse Dell Inspiron 15R Special Edition that I got almost three years ago finally bit the dust.  It had Kubuntu 14.10 running from a SATA SSD and Windows 7 running off an mSATA SSD.  The laptop stopped detecting the power connection.  I tried multiple adapters (I had two, for both work and home), different wall sockets, etc., but nothing worked.  The power socket on the laptop had become very woodgie, with the male plug maintaining a very tenous connection and frequently falling out at the slightest jiggle.  I believe that an internal connection between the socket and the motherboard had become damaged.

After 3 years of faithful service, I wanted to go Dell again... but they've completely drunk the touchscreen, ultra-quad-wide-HD, Windows 8.1 Kool-aid that I couldn't find a laptop I liked.  I became hooked on the mSATA port, allowing me to showhorn two SSD disks plus the optical drive.  I ended up discovering a very new Gigabyte laptop, the P55W v4 (http://www.gigabyte.com/products/product-page.aspx?pid=5458#kf).  It only came out a few weeks ago but came with one of the first non-U (ulta lower power) mobile 5000-series CPUs (i7 5700HQ), up to 16GB, IPS FHD display, mSATA port, nVidia 970M... it looked really good.

Newegg had a great custom configuration (http://www.newegg.com/Product/Product.aspx?Item=N82E16834233094), the P55W-BNE, that perfectly met my needs.  Also, since the Dell was completely toast, I ripped out the extra memory, Samsung SATA SSD, and mSATA SSD and wanted to transfer it to the new lappy.  Turns out that the Newegg version was about as cheap as I could get for the features I wanted, since I reused the upgrades from the Dell (memory, SSDs).

But, would the Gigabyte run Linux?  There was a time running Linux on bleeding-edge hardware required persistence and determination.  The CPU was announced just a few weeks ago - this is HOT off the presses.  I pulled the OEM hard drive with Windows 8.1 (bleah) and the supplied 8G DDR3 1600 stick, replaced these with the parts from the Dell, and added the mSATA SSD (Gigabyte kindly provided a thermal pad for the mSATA SSD!).  The bottom of the Gigabyte is a single plastic part, so these replacements required me to completely remove the bottom (about 10 screws.  However, once the bottom was off, access to the SATA, mSATA, and memory slots was easy-peasy, which was in stark contrast to performing the same task on the Dell, which demanded that I remove four layers of case, keyboard, boards, and pray that I didn't snap off some plastic...

Naturally, I encountered problems:

  1. The system wouldn't boot at first.  I had to turn off secure boot in the BIOS as well as switch to the SATA conroller to IDE mode (from AHCI) and switch the boot method from UEFI to legacy OS.
  2. The bus order was different between the Gigabyte and the Dell, so my Linux drive (the Samsung with Kubuntu 14.10) switched from sda to sdb.  No huge biggie, since most of the Linux low-level disk access stuff (filesystems, grub, etc.) switched to using UUIDs, which aren't slot-specific.  I did have to modify /etc/fstab because I had hardcoded the Windows 7 NTFS drive's mountpoint (bad Jason!).
  3. The WLAN card wouldn't initialize.  syslog was showing me that it detected the WiFi hardware (Intel 7265-N) but couldn't find any compatible firmware for it.  I build my own custom kernels, so I was at 4.0.4, but it apparently doesn't include the firmware for this adapter.  I ended up dowloading the firmware directly from kernel.org: https://wireless.wiki.kernel.org/_media/en/users/drivers/iwlwifi-7260-ucode-25.17.12.0.tgz.  I copied the iwlwifi-7265D-12.ucode file from that package into /lib/firmware, and we were off to the races.
  4. The trackpad wouldn't work.  The system didn't even detect the touchpad at all.  It's attached to the i8042 input bus serial chip, and this is what I should have seen via cat /proc/bus/input/devices:

    I: Bus=0011 Vendor=0002 Product=000e Version=0000
    N: Name="ETPS/2 Elantech Touchpad"
    P: Phys=isa0060/serio1/input0
    S: Sysfs=/devices/platform/i8042/serio1/input/input8
    U: Uniq=
    H: Handlers=mouse0 event8
    B: PROP=1
    B: EV=b
    B: KEY=6420 30000 0 0 0 0
    B: ABS=260800011000003


    After googling around, I discovered a message that mentioned a patch for 3.13 to fix the problem, here: http://askubuntu.com/questions/529797/elantech-touchpad-not-detected-on-gigabyte-laptop.  The patch was to i8042.c.  I had a copy of the kernel source, so I looked into the file.  Turns out there was ALREADY a workaround for the problem in 4.0.4.  Yes!  The work around was controlled by an i8042 module parameter, 'kbdreset'.  A reboot and manually adding the 'i8042.kbdreset' parameter to the kernel boot line, my trackpad is now happy.

    To persist the change, I modified GRUB_CMDLINE_LINUX in /etc/defaults/grub with that option, and now it reliably comes up every time.
  5. I can't start Windows from the mSATA SSD.  I haven't yet fixed this...
In the end, most of these would probably have been fixed if I had installed fresh, but the most relevant stuff I did:
 
  1. I had to turn off secure boot in the BIOS as well as switch to the SATA conroller to IDE mode (from AHCI) and switch the boot method from UEFI to legacy OS.
  2. I ended up dowloading the Intel 7265-N wireless firmware directly from kernel.org: https://wireless.wiki.kernel.org/_media/en/users/drivers/iwlwifi-7260-ucode-25.17.12.0.tgz.  I copied the iwlwifi-7265D-12.ucode file from that package into /lib/firmware.  This fixed the wireless issue.
  3. I added i8042.kbdreset to GRUB_CMDLINE_LINUX in /etc/defaults/grub and regenerated the grub.cfg (update-grub) to fix the trackpad issue.
In the end, the Gigabyte P55W v4 seems to support Linux really well.  I'm happy!!

 I hope this may be useful for somebody down the line.

6 comments:

  1. Did you have to remove the battery? You didn't mention, but my experience ith changing hardware with power applied is definitely unhappy.

    ReplyDelete
    Replies
    1. I ask, because Gigabyte states that the customers are not to remove the battery. I gather that it's not so hard to do, after all, not soldered in, etc.

      Delete
  2. Yo, Byron. I did NOT attempt to remove the battery. When I saw that it didn't have a "port" or a mating connector, just wires diret to the motherboard... well, I didn't want to fight with that. It's possible that was an issue. And, of course you're correct, any kind of power is a BAD idea while fiddling with sensitive electronics like DDR memory... ;)

    ReplyDelete
  3. Thanks, Jason, even though it is a bit discouraging. Perhaps a solution is to run the battery all the way down.

    ReplyDelete
    Replies
    1. Fewer laptops are providing removable batteries (*thanks*, Apple), so this is going to become a more common problem. However, the new ZaReason Verix 547, on which I'm typing this right now, does have a big, removable battery! Yay!

      Delete
  4. Jason,quick question i have the p55w,i opt to buy my own msata and install.How did you disable secure boot? Its not giving me the option.

    ReplyDelete