{"id":1276,"date":"2014-09-08T01:00:00","date_gmt":"2014-09-08T00:00:00","guid":{"rendered":"https:\/\/www.fussylogic.co.uk\/blog\/?p=1276"},"modified":"2015-02-19T20:36:37","modified_gmt":"2015-02-19T20:36:37","slug":"dell-xps-15-and-linux","status":"publish","type":"post","link":"https:\/\/www.fussylogic.co.uk\/blog\/?p=1276","title":{"rendered":"Dell XPS 15 and Linux"},"content":{"rendered":"<p>I\u00e2\u20ac\u2122ve got an XPS15 \u00e2\u20ac\u201c Dell\u00e2\u20ac\u2122s flagship laptop. This article is my notes on how I set it up to run Linux.<\/p>\n<p>I\u00e2\u20ac\u2122ve had considerably harder times than I had with this laptop when I was installing Linux on laptops in the past. Everything \u00e2\u20ac\u0153Just Works\u00e2\u20ac\u009d once you install the necessary drivers. All in all, very positive for both Linux and this laptop.<\/p>\n<h2 id=\"windows\">Windows<\/h2>\n<p>You\u00e2\u20ac\u2122ll want rid, but I\u00e2\u20ac\u2122d suggest checking your hardware with Windows before you start wiping hard disks and installing Linux. Quick checks:<\/p>\n<ul>\n<li>Webcam<\/li>\n<li>SD Card<\/li>\n<li>Touch screen<\/li>\n<li>Touch pad<\/li>\n<li>WiFi<\/li>\n<\/ul>\n<h2 id=\"firmware-upgrade\">Firmware Upgrade<\/h2>\n<p>Then, being that we\u00e2\u20ac\u2122ll want a way of <a href=\"https:\/\/wiki.ubuntu.com\/DellBIOS\">doing updates without Windows<\/a>, we\u00e2\u20ac\u2122ll ensure we can by using a FreeDOS USB stick.<\/p>\n<ul>\n<li><a href=\"http:\/\/xps-15.wikia.com\/wiki\/Latest_Drivers\">Latest firmware<\/a> from Dell. A06 at time of writing.<\/li>\n<li><a href=\"http:\/\/chtaube.eu\/computers\/freedos\/bootable-usb\/\">FreeDOS image<\/a>. I got the 250MB image. It\u00e2\u20ac\u2122s a tiny download when zipped though because it\u00e2\u20ac\u2122s all empty space.<\/li>\n<\/ul>\n<p>The firmware is a DOS executable, and we want it on the FreeDOS image. The image is a disk image though, and not a partition image:<\/p>\n<pre><code>$ fdisk -l freedos.img \n\nDisk freedos.img: 250 MB, 250000384 bytes\n101 heads, 32 sectors\/track, 151 cylinders, total 488282 sectors\nUnits = sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisk identifier: 0x00052fbf\n\n      Device Boot      Start         End      Blocks   Id  System\nfreedos.img1   *           1      488281      244140+   e  W95 FAT16 (LBA)<\/code><\/pre>\n<p>This tell us that the first partition starts at \u00e2\u20ac\u0153sector\u00e2\u20ac\u009d 1, which is, from this information, 512 bytes in. We can <a href=\"http:\/\/www.andremiller.net\/content\/mounting-hard-disk-image-including-partitions-using-linux\">mount this image<\/a> then with:<\/p>\n<pre><code>$ mount -o loop,offset=512 freedos.img \/mnt\/<\/code><\/pre>\n<p>Then you copy the Dell firmware executable to this mounted directory. Then write it to a USB stick with (remembering that this is a <em>disk<\/em> image, not a partition image so it goes to a disk):<\/p>\n<pre><code>$ dd if=freedos.img of=\/dev\/sdb bs=4M<\/code><\/pre>\n<p>Be careful you get the right output device \u00e2\u20ac\u201c it would be a disaster to write this to your system hard disk.<\/p>\n<p>Now you can reboot. Push F2 to enter the BIOS setup; then disable <em>Secure Boot<\/em>, which will in turn enable <em>Legacy Boot<\/em>; save the new settings; then F12 to choose the USB stick as the boot drive.<\/p>\n<pre><code>C:\\&gt; cd XPS15\nC:\\&gt; 9530a06.exe<\/code><\/pre>\n<p>And follow instructions. As it happens mine was already loaded with A06, so I didn\u00e2\u20ac\u2122t need to do anything. However, this procedure will work for any future updates Dell releases.<\/p>\n<h2 id=\"disk-partitioning\">Disk partitioning<\/h2>\n<p>Initial SSD partitioning (as reported by Windows)<\/p>\n<ul>\n<li>500MB EFI System Partition<\/li>\n<li>40MB OEM Partition<\/li>\n<li>750MB Recovery Partition<\/li>\n<li>7.97GB Recovery Partition<\/li>\n<li>8GB OEM Partition<\/li>\n<li>7.37GB OEM Partition<\/li>\n<li>459.58GB Boot, Page File, Crash Dump, Primary Partition<\/li>\n<\/ul>\n<p>The Debian installer disagrees with what Windows reports:<\/p>\n<ul>\n<li>1MB Free space<\/li>\n<li>524.3MB (fat32) EFI system partition<\/li>\n<li>41.9MB (fat32) Basic data partition<\/li>\n<li>134.2MB Microsoft recovery partition<\/li>\n<li>786.3MB (ntfs) Basic data partition<\/li>\n<li>493.5GB (ntfs) Basic data partition<\/li>\n<li>8.6GB (ntfs) Microsoft recovery partition<\/li>\n<li>8.6GB Basic data partition (assume this is Rapid Start partition)<\/li>\n<li>335.4kB Free space<\/li>\n<\/ul>\n<p>This, actually, seems wrong. There is certainly a recovery partition from Dell \u00e2\u20ac\u201c where\u00e2\u20ac\u2122s that gone? Seems like a Debian bug, but I\u00e2\u20ac\u2122ve got no way of confirming.<\/p>\n<h3 id=\"mb-efi-system-partition-fat32\">500MB EFI System Partition (fat32)<\/h3>\n<p>This partition is what a UEFI bootloader will look for for its managed boot. A quick peak at it in the debian installer\u00e2\u20ac\u2122s console shows:<\/p>\n<ul>\n<li><code>EFI\/<\/code>\n<ul>\n<li><code>Boot\/bootx64.efi<\/code><\/li>\n<li><code>Microsoft\/Boot\/<\/code> contains lots of Microsoft \u00e2\u20ac\u0153stuff\u00e2\u20ac\u009d<\/li>\n<\/ul>\n<\/li>\n<li>en-us\/\n<ul>\n<li><code>bootmgr.efi.mui<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"mb-oem-partition-fat32\">40MB OEM Partition (fat32)<\/h3>\n<p>Empty.<\/p>\n<h3 id=\"mb-microsoft-recovery-partition\">134.2MB Microsoft recovery partition<\/h3>\n<p>?<\/p>\n<h3 id=\"mb-ntfs-basic-data-partition\">786.3MB (ntfs) Basic data partition<\/h3>\n<p>?<\/p>\n<h3 id=\"gb-ntfs-basic-data-partition\">493.5GB (ntfs) Basic data partition<\/h3>\n<p>Main Windows partition.<\/p>\n<h3 id=\"gb-ntfs-microsoft-recovery-partition\">8.6GB (ntfs) Microsoft recovery partition<\/h3>\n<p>Not sure, but this could be the Intel Rapid Storage partition.<\/p>\n<p>Intel Rapid Storage uses an SSD partition to speed up HDD access, acting as a cache. That\u00e2\u20ac\u2122s pretty useless here because there is no HDD.<\/p>\n<h3 id=\"gb-basic-data-partition\">8.6GB Basic data partition<\/h3>\n<p>Presume this to be the Intel Rapid Start partition.<\/p>\n<p>Intel Rapid Start takes a copy of RAM and stores it to the SSD, that\u00e2\u20ac\u2122s not going to work very well on a 16GB machine which has only 8GB partitions. This seems like a <a href=\"http:\/\/www.tomshardware.co.uk\/answers\/id-1901262\/intel-rapid-start-intel-rapid-storage.html\">standard<\/a> mistake by Dell.<\/p>\n<h2 id=\"debian\">Debian<\/h2>\n<h3 id=\"bios\">BIOS<\/h3>\n<p>You\u00e2\u20ac\u2122ll need to disable <em>Secure Boot<\/em>, which will auto-enable <em>Legacy Boot<\/em>; however, it seems the Debian\u00e2\u20ac\u2122s installation images are happy with UEFI these days, so you can disable <em>Legacy Boot<\/em>. This has the advantage that the Debian installer will then install the UEFI version of grub in <code>\/boot\/efi\/EFI\/debian\/grubx64.efi<\/code>. UEFI seems a much less terrifying way of controlling early boot than rewriting MBRs \u00e2\u20ac\u201c the EFI partition is a standard <code>fat32<\/code> partitions, and so is pretty easy to alter.<\/p>\n<h3 id=\"partitioning\">Partitioning<\/h3>\n<p>The first decision is the new partition table. There are quite a few of the above partitions that we really don\u00e2\u20ac\u2122t need. Here\u00e2\u20ac\u2122s my suggested new schema:<\/p>\n<pre><code>$ sudo gdisk -l \/dev\/sda\nGPT fdisk (gdisk) version 0.8.10\n\nPartition table scan:\n  MBR: protective\n  BSD: not present\n  APM: not present\n  GPT: present\n\nFound valid GPT with protective MBR; using GPT.\nDisk \/dev\/sda: 1000215216 sectors, 476.9 GiB\nLogical sector size: 512 bytes\nDisk identifier (GUID): A8F5A3A5-C068-4E51-AD31-51AF34E944F8\nPartition table holds up to 128 entries\nFirst usable sector is 34, last usable sector is 1000215182\nPartitions will be aligned on 2048-sector boundaries\nTotal free space is 2669 sectors (1.3 MiB)\n\nNumber  Start (sector)    End (sector)  Size       Code  Name\n   1            2048         1026047   500.0 MiB   EF00  EFI system partition\n   2         1026048         1107967   40.0 MiB    FFFF  Basic data partition\n   3         1107968        34662399   16.0 GiB    8400  Intel Rapid Start\n   4        34662400        71419903   17.5 GiB    8200  Linux Swap\n   5        71419904      1000214527   442.9 GiB   8300  Linux ext4<\/code><\/pre>\n<p>I\u00e2\u20ac\u2122ve left the two <code>fat32<\/code> partitions alone, resized the IRST partition to match the memory and added a swap partition for Linux, which should be bigger than main memory for suspend-to-disk purposes (although with IRST, that should never be necessary).<\/p>\n<p>During install, you need only delete all but the first two partitions, then create three appropriately-sized partitions ready for <em>Rapid Start<\/em> and Linux. It\u00e2\u20ac\u2122s important to make sure the <em>Rapid Start<\/em> partition is 16 GiB exactly (if you\u00e2\u20ac\u2122ve got 16 GiB of memory) note that that is <em>gibibytes<\/em> not <em>gigabytes<\/em>. If you specify it as 16 GB it will end up too small.<\/p>\n<p>You won\u00e2\u20ac\u2122t need much swap, so I abandoned the \u00e2\u20ac\u0153twice main memory\u00e2\u20ac\u009d rule of thumb and just gave \u00e2\u20ac\u0153main memory plus a bit\u00e2\u20ac\u009d.<\/p>\n<p>Other than the ext4 partition, I suggest leaving all the type code setting and GUID changes for the <em>Rapid Start<\/em> partition to after you have a working system. When you do, you can use <code>gdisk<\/code> to <a href=\"http:\/\/mjg59.dreamwidth.org\/26022.html\">set the partition GUID code<\/a> (not the \u00e2\u20ac\u0153unique GUID\u00e2\u20ac\u009d, confusingly) and <code>Code<\/code> of the partition.<\/p>\n<pre><code>Partition number (1-5): 3\nPartition GUID code: D3BFE2DE-3DAF-11DF-BA40-E3A556D89593 (Intel Rapid Start)\nPartition unique GUID: D3BFE2DE-3DAF-11DF-BAFC-F23A556D8959\nFirst sector: 1107968 (at 541.0 MiB)\nLast sector: 34662399 (at 16.5 GiB)\nPartition size: 33554432 sectors (16.0 GiB)\nAttribute flags: 0000000000000000\nPartition name: &#39;Intel Rapid Start&#39;<\/code><\/pre>\n<p>After this, you\u00e2\u20ac\u2122ll need a reboot, and a check in the BIOS setup that Intel Rapid Start is enabled. It\u00e2\u20ac\u2122s worked without trouble for me with the above in place.<\/p>\n<p>In case you\u00e2\u20ac\u2122re unaware, <em>Intel Rapid Start<\/em> works on a computer in sleep (i.e.\u00c2\u00a0suspend to RAM). It waits for a period (default 120 minutes, but I altered mine with the Windows tool before I wiped it to 60 minutes) then does a sort of half-wake, copies the contents of RAM to the <em>Rapid Start<\/em> partition, which it finds by virtue of the magic GUID, and then does a full power off. On next power up, the BIOS sees that there is data in that partition restores the partition to RAM, then continues as if it were doing a restart from sleep. This means you can always just sleep the laptop, with no worries that the small power drain from keeping the RAM refreshed will drain the battery \u00e2\u20ac\u201c it won\u00e2\u20ac\u2122t once <em>Rapid Start<\/em> has kicked in. You can tell it\u00e2\u20ac\u2122s working because once it\u00e2\u20ac\u2122s in <em>Rapid Start<\/em> mode you\u00e2\u20ac\u2122ll need the power switch (and a slightly longer start time) to get the laptop back on, as opposed to the simple lid opening that wakes a normal suspend-to-RAM. Personally I think this is a really good feature \u00e2\u20ac\u201c convenience of a suspend-to-RAM with the safety of a non-volatile suspend-to-disk.<\/p>\n<h3 id=\"wifi\">WiFi<\/h3>\n<p>There are a <a href=\"http:\/\/blog.ananelson.com\/2014\/03\/installing-debian-on-your-shiny-new-laptop\/\">few difficulties around the WiFi firmware<\/a> with Debian. We can work around them though.<\/p>\n<p>There is, supposedly, a Debian <a href=\"http:\/\/cdimage.debian.org\/cdimage\/unofficial\/non-free\/cd-including-firmware\/\">netinst<\/a> image that includes the non-free firmware. Having checked, the non-free firmware blobs are certainly in the image. Unfortunately, they don\u00e2\u20ac\u2122t seem to do you much good. They are stored as <code>.deb<\/code>s, which don\u00e2\u20ac\u2122t help you at all during installation, as there doesn\u00e2\u20ac\u2122t seem to be a way of extracting a deb from the command line in the installer, <code>dpkg<\/code> isn\u00e2\u20ac\u2122t available. All the documentation suggests that it should work. It didn\u00e2\u20ac\u2122t for me though.<\/p>\n<p>The alternative is to use <a href=\"http:\/\/blog.ananelson.com\/2014\/03\/installing-debian-on-your-shiny-new-laptop\/\">the full debian CD1<\/a>. This is sufficient to install a non-graphical Debian system \u00e2\u20ac\u201c just as with a netinst image, only without a network connection needed. Then you are in a position to extract the firmware deb using your fully operational system. Just store, in this case, the <code>firmware-iwlwifi<\/code> package on a (separate) USB stick.<\/p>\n<p>Once you\u00e2\u20ac\u2122ve got a Debian installation, mount this second stick and run<\/p>\n<pre><code>$ dpkg -i firmware-iwlwifi-WHATEVER.deb\n$ modprobe -r iwlwifi\n$ modprobe iwlwifi<\/code><\/pre>\n<p>You should now have a <code>wlan0<\/code> when you run <code>ifconfig -a<\/code>. Next you\u00e2\u20ac\u2122ll need a way of connecting to a wifi network. <code>network-manager<\/code> is the easiest way. <code>apt-get install network-manager<\/code> and it will pull in all the other necessary packages. Then you can run <code>network-manager<\/code>\u00e2\u20ac\u2122s new command line UI.<\/p>\n<pre><code>$ nmtui<\/code><\/pre>\n<p>Now you\u00e2\u20ac\u2122ve got a network connection you can install a proper <code>\/etc\/apt\/sources.list<\/code>, and start copying your configuration over as you would any other install.<\/p>\n<h2 id=\"graphics\">Graphics<\/h2>\n<p>The XPS 15 has an integrated Intel graphics card, and a discrete nVidia graphics card. For the most part, the Intel graphics will be fine (and lower power) for us. All we really will want is the nVidia card powered down. The <code>bumblebee<\/code> project lets us do that, but it needs a kernel module to help it, so you\u00e2\u20ac\u2122ll need the headers for your kernel too.<\/p>\n<pre><code>$ apt-get install linux-headers-3.14-2-amd64 build-essential\n$ apt-get install bumblebee<\/code><\/pre>\n<p>Then a reboot to let the <code>bbswitch<\/code> driver and new config kick in.<\/p>\n<p>This seemed to take about 1W off my power usage (measured by <code>powertop<\/code>) in command line mode.<\/p>\n<h3 id=\"x\">X<\/h3>\n<p>Installed. Worked instantly with no need to fiddle with any drivers.<\/p>\n<p>The screen DPI, while detected and listed in the xorg log file seemed to be ignored when viewing the output of <code>xdpyinfo | grep -B 2 resolution<\/code>. Rather than create a load of <code>xorg.conf<\/code> sections (which ruins all the auto-detect work) I just made a little script in <code>\/etc\/X11\/Xsession.d\/90-xps-15<\/code>:<\/p>\n<pre><code>xrandr --fbm 346x194<\/code><\/pre>\n<p>This should give KDE enough to work with to make its fonts the right height on screen.<\/p>\n<h3 id=\"qtkde\">Qt\/KDE<\/h3>\n<p>With the DPI set correctly as above, you will still probably want to alter your task bar height, window decoration sizes, and icon sizes using KDE\u00e2\u20ac\u2122s <code>systemsettings<\/code>. For the most part I just doubled everything.<\/p>\n<p>There are still a few areas were the HiDPI causes KDE problems. Particular with Qt-supplied widgets. Qt seems to draw widgets at fixed pixel sizes, hopefully they\u00e2\u20ac\u2122ll get around to drawing them at fixed point sizes. Checkboxes and radio buttons are particularly awful.<\/p>\n<p>You can tweak Qt a little with the <code>qt4-qtconfig<\/code> package.<\/p>\n<p>Skype, being a Qt and Microsoft app, has some horrible hard-coded size problems, I think we just have to live with them for now.<\/p>\n<h3 id=\"firefox\">Firefox<\/h3>\n<p>Go to <code>about:config<\/code> and change <code>layout.css.devPixelsPerPx<\/code> to (I suggest) 2.0.<\/p>\n<h3 id=\"gtk\">Gtk<\/h3>\n<p>Install the <code>kde-config-gtk-style<\/code> package, and use KDE\u00e2\u20ac\u2122s <code>systemsettings<\/code> to set your Gtk applications to use the same font as your KDE applications.<\/p>\n<h2 id=\"touch\">Touch<\/h2>\n<h3 id=\"touchpad\">Touchpad<\/h3>\n<p>After a bit of tweaking, here\u00e2\u20ac\u2122s my <code>\/etc\/X11\/xorg.conf.d\/10-synaptics.conf<\/code>:<\/p>\n<pre><code>Section &quot;InputClass&quot;\n        MatchDriver &quot;synaptics&quot;\n        Identifier &quot;BuiltIn ClickPad&quot;\n        # Overall\n        Option &quot;ClickPad&quot; &quot;true&quot;\n        #                         RBL RBR RBT RBB MBL MBR MBT MBB\n        Option &quot;SoftButtonAreas&quot; &quot;60% 0   85% 0   41% 59% 85% 0&quot;\n        # Palm\n        Option &quot;PalmDetect&quot; &quot;true&quot;\n        Option &quot;PalmMinWidth&quot; &quot;2&quot;\n        Option &quot;PalmMinZ&quot; &quot;2&quot;\n        # Features\n        Option &quot;VertEdgeScroll&quot; &quot;false&quot;\n        Option &quot;HorizEdgeScroll&quot; &quot;false&quot;\n        Option &quot;VertTwoFingerScroll&quot; &quot;true&quot;\n        # Buttons\n        Option &quot;TapButton1&quot; &quot;1&quot;\n        Option &quot;TapButton2&quot; &quot;2&quot;\n        Option &quot;TapButton3&quot; &quot;3&quot;\n        Option &quot;ClickButton1&quot; &quot;1&quot;\n        Option &quot;ClickButton2&quot; &quot;3&quot;\n        Option &quot;ClickButton3&quot; &quot;2&quot;\nEndSection<\/code><\/pre>\n<p>Palm detection seems broken at present (problem seems to be in <a href=\"https:\/\/bugzilla.kernel.org\/show_bug.cgi?id=77161\">the kernel<\/a>). Until it\u00e2\u20ac\u2122s fixed you\u00e2\u20ac\u2122ll get annoying jumps while you\u00e2\u20ac\u2122re typing. A good workaround is to use <code>syndaemon<\/code> to disable the pad whenever the keyboard is in use.<\/p>\n<p>For everything else, set the \u00e2\u20ac\u02dcFeatures\u00e2\u20ac\u2122 and \u00e2\u20ac\u02dcButtons\u00e2\u20ac\u2122 section to suit your own tastes.<\/p>\n<h3 id=\"touchscreen\">Touchscreen<\/h3>\n<p>Personally, I\u00e2\u20ac\u2122d like to disable this for the vast majority of the time, I\u00e2\u20ac\u2122ve got no real use for it on a laptop. I\u00e2\u20ac\u2122ve not found a way yet unfortunately. Worse, it seems to use about a Watt of power.<\/p>\n<p>Update: you can disable it with <code>xinput<\/code>.<\/p>\n<pre><code>$ xinput\n\u00e2\u017d\u00a1 Virtual core pointer                          id=2    [master pointer  (3)]\n\u00e2\u017d\u0153   \u00e2\u2020\u00b3 Virtual core XTEST pointer                id=4    [slave  pointer  (2)]\n\u00e2\u017d\u0153   \u00e2\u2020\u00b3 SynPS\/2 Synaptics TouchPad                id=13   [slave  pointer  (2)]\n\u00e2\u017d\u0153   \u00e2\u2020\u00b3 SYNAPTICS Synaptics Large Touch Screen    id=10   [slave  pointer  (2)]\n\u00e2\u017d\u00a3 Virtual core keyboard                         id=3    [master keyboard (2)]\n    \u00e2\u2020\u00b3 Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]\n    \u00e2\u2020\u00b3 Power Button                              id=6    [slave  keyboard (3)]\n    \u00e2\u2020\u00b3 Video Bus                                 id=7    [slave  keyboard (3)]\n    \u00e2\u2020\u00b3 Video Bus                                 id=8    [slave  keyboard (3)]\n    \u00e2\u2020\u00b3 Power Button                              id=9    [slave  keyboard (3)]\n    \u00e2\u2020\u00b3 AT Translated Set 2 keyboard              id=12   [slave  keyboard (3)]\n    \u00e2\u2020\u00b3 Dell WMI hotkeys                          id=14   [slave  keyboard (3)]\n$ xinput disable 10<\/code><\/pre>\n<p>Re-enable it for those times you want it in the same way, but with <code>xinput enable<\/code>.<\/p>\n<h2 id=\"power\">Power<\/h2>\n<p>Install the <code>laptop-mode-tools<\/code> package. Install the <code>powertop<\/code> package.<\/p>\n<p>The screen seems particularly power hungry. When the screen is off, even with the system busy, power drops to about 8W. With it on and busy, 15W.<\/p>\n<p>With non-intense activity (just typing or browsing, nothing going on in the background), mine is sitting at about 12-15W and lasts a solid 6 to 7 hours.<\/p>\n<h2 id=\"sd-card\">SD Card<\/h2>\n<p>Works without fuss.<\/p>\n<h2 id=\"usb\">USB<\/h2>\n<p>The XHCI USB 3.0 host controller driver seems not quite up to scratch yet on Linux. It has occasionally stopped me suspending the system, and locked up USB when I plug a Nexus phone into the high speed port. I\u00e2\u20ac\u2122ve got no real desire for USB 3.0 at present, so I worked around this by removing the module.<\/p>\n<pre><code>$ cat \/etc\/modprobe.d\/adp-blacklist.conf \nblacklist xhci_hcd<\/code><\/pre>\n<p>This might improve with later versions of Linux than the one I have at time of writing (3.16-2).<\/p>\n<p>A better solution is to use <em>systemd<\/em> to remove the module on suspend, and add it back on resume. This means you can have all the USB goodness without suspend being affected.<\/p>\n<pre><code>#!\/bin\/sh\n# \/lib\/systemd\/system-sleep\/xhci_hcd\n\nMODPROBE=\/sbin\/modprobe\n\n[ &quot;$1&quot; = &quot;post&quot; ] &amp;&amp; exec ${MODPROBE} xhci_hcd\n[ &quot;$1&quot; = &quot;pre&quot; ] &amp;&amp; exec ${MODPROBE} -r xhci_hcd\n\nexit 0<\/code><\/pre>\n<h2 id=\"replacement-parts\">Replacement Parts<\/h2>\n<p>The battery will be the obvious first thing to start degrading. After four months of pretty much daily use I\u00e2\u20ac\u2122ve already experienced this:<\/p>\n<pre><code>$ grep &quot;&quot; \/sys\/class\/power_supply\/BAT1\/energy_full*\n\/sys\/class\/power_supply\/BAT1\/energy_full:84920000\n\/sys\/class\/power_supply\/BAT1\/energy_full_design:91000000<\/code><\/pre>\n<p>That is to say: 7% capacity loss, or 1.67% per month. Extrapolating, that will be 29 months until 50% of battery life is lost. The battery can be replaced, it is a 7D1WJ and seems to be between \u00c2\u00a3160 and \u00c2\u00a3320. Sigh.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I\u00e2\u20ac\u2122ve got an XPS15 \u00e2\u20ac\u201c Dell\u00e2\u20ac\u2122s flagship laptop. This article is my notes on how I set it up to run Linux. I\u00e2\u20ac\u2122ve had considerably harder times than I had with this laptop when I was installing Linux on laptops in the past. Everything \u00e2\u20ac\u0153Just Works\u00e2\u20ac\u009d once you install the necessary drivers. All in all,\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.fussylogic.co.uk\/blog\/?p=1276\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[133,6,134],"_links":{"self":[{"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1276"}],"collection":[{"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1276"}],"version-history":[{"count":5,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1276\/revisions"}],"predecessor-version":[{"id":1310,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1276\/revisions\/1310"}],"wp:attachment":[{"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}