I just bought myself a S3 Yoga 14. After installing Ubuntu 16.04, I found out that the key that was suppose to spew out 'pipe' and 'backward slash' (when shifted) actually spewed 'greater than' and 'less than'. This little write up explained how I fixed it.
As a reference, please read this first to get some relevant information:
http://www.antoniusdharijanto.com/2015/10/simple-key-re-mapping-on-ubuntu-1404.html
Steps
1. Figure out the keycode of the offending key
There's a little program 'xev' that when runs from terminal, it would give information about whatever key is pressed, including the keycode.
2. Figure out what the key from (1) is supposed to map into.
Since I have another laptop running Ubuntu, I just run xev there and figure out the keycode of the key 'pipe' and get the action from /usr/share/X11/xkb/keycodes/evdev
2. Re-map that keycode to pip
Open up /usr/share/X11/xkb/keycodes/evdev and remap that keycode to the proper functionality.
Update:
The key to be updated was:
<BKSL> = 94; // Note that other occurence of BKSL has to be commented out for this to work
Random useful tech stuffs I write to remind myself. Hopefully useful for you!
Showing posts with label ThinkPad x201. Show all posts
Showing posts with label ThinkPad x201. Show all posts
Thursday, May 4, 2017
Thursday, December 29, 2016
Fingerprint Authentication on Ubuntu 16.04
Just for fun, I googled around about how to enable fingerprint login in my X201 with Ubuntu 16.04. And then I came across this super cool tool that let you not only login, but to 'sudo' using fingerprint! How cool is that? Goodbye typing password while thinkering around with system-privilege :)
Here's how you install it:
Here's how you install it:
Friday, December 2, 2016
Some Daemons are Not Automatically Started on Ubuntu 16.04
I had a crucial daemon to prevent my laptop from restarting, which is thinkfan (explained here):
http://www.antoniusdharijanto.com/2014/09/corner-cases-of-ubuntu-1404-on-lenovo.html
After upgrading to 16.04, the daemon is no longer started automatically. I noticed this because my laptop restarted itself due to overheating. And the reason is because Ubuntu 16.04 uses systemctl daemon manager as oppose to upstart that 14.04 earlier used.
Here's the solution:
1. Make sure thinkfan is upgraded to the latest (e.g. sudo apt-get update && sudo apt-get install thinkfan). Latest version has systemctl enabled for it.
2. Check if thinkfan can run: sudo systemctl start thinkfan.service
3. Enable the daemon if (2) succeeded: sudo systemctl enable thinkfan.service
Optional:
4. To get it to restart automatically upon crash:
Edit /etc/systemd/system/multi-user.target.wants/thinkfan.service and add 'Restart=always' under [Service] section.
P.S. I notice the same think with mysql daemon. Using the same command, systemctl is smart enough to redirect the command onto sysv that mysql is using.
Enjoy!
Source:
https://www.digitalocean.com/community/tutorials/how-to-configure-a-linux-service-to-start-automatically-after-a-crash-or-reboot-part-1-practical-examples
http://www.antoniusdharijanto.com/2014/09/corner-cases-of-ubuntu-1404-on-lenovo.html
After upgrading to 16.04, the daemon is no longer started automatically. I noticed this because my laptop restarted itself due to overheating. And the reason is because Ubuntu 16.04 uses systemctl daemon manager as oppose to upstart that 14.04 earlier used.
Here's the solution:
1. Make sure thinkfan is upgraded to the latest (e.g. sudo apt-get update && sudo apt-get install thinkfan). Latest version has systemctl enabled for it.
2. Check if thinkfan can run: sudo systemctl start thinkfan.service
3. Enable the daemon if (2) succeeded: sudo systemctl enable thinkfan.service
Optional:
4. To get it to restart automatically upon crash:
Edit /etc/systemd/system/multi-user.target.wants/thinkfan.service and add 'Restart=always' under [Service] section.
P.S. I notice the same think with mysql daemon. Using the same command, systemctl is smart enough to redirect the command onto sysv that mysql is using.
Enjoy!
Source:
https://www.digitalocean.com/community/tutorials/how-to-configure-a-linux-service-to-start-automatically-after-a-crash-or-reboot-part-1-practical-examples
Thursday, December 1, 2016
Ubuntu 16.04 stucked on boot logo after an upgrade from 14.04
Yesterday I finally decided to let Ubuntu autoupgrade system update my 14.04 into 16.04. After some time, my laptop got really hot, which seems to be caused by some CPU-intensive operations of the upgrade. It got too hot until a point that the firmware decided to shut my laptop down forcefully. Crap! I'm in the middle of an update!
Yes, as you can already guess, my laptop now stucked on boot logo! What's even worse, the boot logo didn't even animate, which means it hung and I can't use emergency mode or tty2!
I almost thought I had to re-install the entire OS from scratch, which would have been much painful considering all the programming tools and libraries I've painstakingly installed throughout the past year! Fortunately, many people out there shared how they recovered their systems!
[SOLUTION]
There really are two things that need to be done:
1. Complete the unfinished upgrade
2. After (1), turned out my system still wouldn't boot, so need to diagnose and debug this.
1. Complete the unfinished upgrade
Yes, as you can already guess, my laptop now stucked on boot logo! What's even worse, the boot logo didn't even animate, which means it hung and I can't use emergency mode or tty2!
I almost thought I had to re-install the entire OS from scratch, which would have been much painful considering all the programming tools and libraries I've painstakingly installed throughout the past year! Fortunately, many people out there shared how they recovered their systems!
[SOLUTION]
There really are two things that need to be done:
1. Complete the unfinished upgrade
2. After (1), turned out my system still wouldn't boot, so need to diagnose and debug this.
1. Complete the unfinished upgrade
This can be done via "chroot"-ing onto the broken system via Live CD. For those unfamiliar, "chroot" is a mechanism to "get into" another Linux installation from a currently running one. In this case, the currently running is one from Live CD and the other one is mine that wouldn't boot. It's done as follow:
2. After (1), turned out my system still wouldn't boot, so need to diagnose and debug this.
I commented out the line that tried to mount the no-longer-existing path. And voilla! It worked like a charm!
a. fdisk -l #Figure out the disk where your other Linux is installed
b. mount /mnt/ /dev/sdX #'/dev/sdX' would be from step (a)
c. for i in /sys /proc /run /dev /dev/pts; do sudo mount --bind "$i" "/mnt$i"; done # This is so the chroot-ed system has access to current Linux's hardware nodes that are necessary, for example for internet connection
d. sudo chroot /mnt/ #After this, you're shell is under the other Linux!
It's time to complete/fix the upgrade that has been halted.
a. sudo apt-get update # Update the list of cached components
b. sudo apt-get upgrade # Upgrade the system
2. After (1), turned out my system still wouldn't boot, so need to diagnose and debug this.
For me, there's still a problem that causes my Linux to get stuck on boot loop. After a while, the system got into emergency mode, where there's an option to go into root shell to do something.
On the emergency mode:
1. journalctl
The shell immediately prompted me to run this command, so I did and found out the culprit:
"timeout waiting for device dev-disk-by..... " and several line below that, it seems that the failure is due to the system trying to mount /dev/disk/by-uuid/XXX that didn't exist. Turned out this was the path to my Windows partition, which changed after an upgrade to 16.04
2. vim /etc/fstabI commented out the line that tried to mount the no-longer-existing path. And voilla! It worked like a charm!
Credit:
http://www.webupd8.org/2014/01/how-to-fix-non-bootable-ubuntu-system.html
http://forums.debian.net/viewtopic.php?f=10&t=118828
Thursday, October 22, 2015
Ubuntu 14.04 suddenly won't boot? This is how you debug it!
After a couple days without rebooting my X201 that was running Ubuntu, I decided to reboot the system. And unfortunately, it won't boot afterwards! After passing the Ubuntu's familiar purplish-black blank background, it got stuck in a black screen. What scared me were that pressing caps-lock didn't even turn on the keyboard indicator and I also couldn't enter "console mode" (ctrl + alt + f1). I was scared that the system went into a hard-hang, perhaps because I accidentally installed some craps. However, it turned out that my xserver binary was missing; the file /usr/bin/X didn't exist, for some reason! How did I figure that out? This post explains it.
Ubuntu keeps different the logs of the last boot attempt. These logs can be used to triage booting issue and potentially are useful to fixing it too. It Through these logs, I was able to figure out my xserver issue. This is how you do it:
1. Boot the system, get it to the hanging state. This step is necessary in order to get the log files generated.
2. Boot to a live-session using Ubuntu CD or Ubuntu USB stick
3. Open "[path to partition]/var/log" of the partition where the problematic Ubuntu is installed. Note that this is not just "/var/log" because that belongs to the currently running live session.
4. Sort the log files by modified date, and open the logs that correspond to the booting attempt from step 1.
5. As there are different log files, I'd suggest to first look at boot.log, which is similar to the kernel log that you get from dmesg. If nothing is suspicious there, then it's likely to be a userspace issue.
6. In my case, I found my xserver problem through the log at /var/log/lightdm/lightdm.log. This is the suspicious snippet of the logs:
+0.05s] DEBUG: DisplayServer x-0: Logging to /var/log/lightdm/x-0.log
[+0.05s] DEBUG: DisplayServer x-0: Can't launch X server X -core, not found in path
[+0.05s] DEBUG: DisplayServer x-0: X server stopped
Through a quick google search, I figured that /usr/bin/X is where "X server X -core" is supposed to be located at. In my case, the file was missing, so it was rather obvious. I then rebooted to Ubuntu recovery mode (by holding "shift" right after the system passes bios), and reinstalled xserver via sudo apt-get install --reinstall xserver-xorg.
Hope this post can be useful!
Tuesday, October 6, 2015
Samsung SSD 850 EVO on ThinkPad X201
I had been contemplating about buying a new laptop to replace my 5 years old ThinkPad X201. My criterion were:
1. It has to run Linux (preferably Ubuntu, as I'm most familiar with this) well, like really well as it'll be my main OS.
2. Small (13" would be the largest)
3. Perhaps with NVIDIA GPU so I can run CUDA stuffs (as I've been into machine learning stuffs these days) on it and so some casual gaming.
Through focusing on criteria (1) and (2), I came across Dell XPS 13 Developer Edition, which is a laptop with native Ubuntu OS. Because it didn't come with Windows, guess what? It actually costed cheaper than the non-developer options that came with Windows! And the best part is that Ubuntu is optimized to run well on the laptop. Tempting. Very tempting. As finding a decent laptop to run Ubuntu had indeed been challenging, I drooled over the one with 256GB SSD and i7 CPU. But still I didn't buy it.
Thankfully, it didn't have an NVIDIA GPU! If only it had it, I'd have already bought it. So what's the deal? Well, I realized that my combo of X201 with Ubuntu had been serving me really well. There had almost been no time I needed more performance than what it offered (except, of course, for casual-gaming purposes, which I rarely do and I already have dedicated gaming devices anyway) So I thought: if it only had Intel's integrated GPU, how would it serve me better than my X201? Not much, really. Moreover, I already had a docking station for my X201! If I were to buy a new laptop, for sure I'd want to get a dock for it, and that'd be like $100+ extra. Bummer..
Long story short, instead of having abandoning it, I decided to give my Thinkpad X201 some love. I treated it with a 500GB Samsung SSD 850 EVO. How did it go? Really sweet! With Ubuntu 14.04 (w/o any form of disk encryption enabled), it booted in 12 seconds! Going to/resuming from hibernate was almost instantaneous! So far I've been loving it so much :)
1. It has to run Linux (preferably Ubuntu, as I'm most familiar with this) well, like really well as it'll be my main OS.
2. Small (13" would be the largest)
3. Perhaps with NVIDIA GPU so I can run CUDA stuffs (as I've been into machine learning stuffs these days) on it and so some casual gaming.
Through focusing on criteria (1) and (2), I came across Dell XPS 13 Developer Edition, which is a laptop with native Ubuntu OS. Because it didn't come with Windows, guess what? It actually costed cheaper than the non-developer options that came with Windows! And the best part is that Ubuntu is optimized to run well on the laptop. Tempting. Very tempting. As finding a decent laptop to run Ubuntu had indeed been challenging, I drooled over the one with 256GB SSD and i7 CPU. But still I didn't buy it.
Thankfully, it didn't have an NVIDIA GPU! If only it had it, I'd have already bought it. So what's the deal? Well, I realized that my combo of X201 with Ubuntu had been serving me really well. There had almost been no time I needed more performance than what it offered (except, of course, for casual-gaming purposes, which I rarely do and I already have dedicated gaming devices anyway) So I thought: if it only had Intel's integrated GPU, how would it serve me better than my X201? Not much, really. Moreover, I already had a docking station for my X201! If I were to buy a new laptop, for sure I'd want to get a dock for it, and that'd be like $100+ extra. Bummer..
Long story short, instead of having abandoning it, I decided to give my Thinkpad X201 some love. I treated it with a 500GB Samsung SSD 850 EVO. How did it go? Really sweet! With Ubuntu 14.04 (w/o any form of disk encryption enabled), it booted in 12 seconds! Going to/resuming from hibernate was almost instantaneous! So far I've been loving it so much :)
Profile-based CPU controls to save power / improve perf
In order to save more power and hence improve on-battery life, in Ubuntu, CPU governor as well as clock speeds can be controlled more finely using cpufreqd. To illustrate how this can be useful, my ThinkPad X201 (running Ubuntu 14.04), always uses performance governor although the laptop isn't being plugged to wall-charger. What a waste of power! cpufreqd allows different profiles to be set,depending on the charging status or battery-level. In a particular profile, CPU governor as well as min/max CPU clock can be customized. Moreover, there's also indicator-cpufreq, which provides a nice status bar icon indicating current CPU configuration (both governor and speed).
Here's how to get them up and running:
1. sudo apt-get install indicator-cpufreq cpufreqd cpufrequtils
2. sudo vim /etc/cpufreqd.conf # This is the file to configure the profile
Below is snippet of what I modified (the rest stays default):
[Profile]
name=Performance High
minfreq=70%
maxfreq=100%
policy=performance
#exec_post=echo 8 > /proc/acpi/sony/brightness
[/Profile]
[Profile]
name=Performance Low
minfreq=60%
maxfreq=80%
policy=performance
[/Profile]
Furthermore, the followings are useful for debugging:
1. cpufreq-info. This can be used to see what governor and clock are currently running. Also useful to see whether the configuration selected via indicator-cpufreq (e.g. manually choosing a different governor) is applied fine. In the past, I've had issue where my CPU clock was locked to 1.2GHZ (this was back on Ubuntu 12.04, for further detail, see my other blog post)
2. 'cat /var/log/syslog', as cpufreqd logs are written onto this.
3. [Added 10/21/2015] If for some reasons, the rules written under /etc/cpufreqd.conf doesn't get applied, check if cpufreqd daemon is actually running. If it's not, you can start it manually through sudo '/etc/init.d/cpufreqd start'. On my Thinkpad X201, without cpufreqd running, its max frequency is somehow capped in a weird manner.
Here's how to get them up and running:
1. sudo apt-get install indicator-cpufreq cpufreqd cpufrequtils
2. sudo vim /etc/cpufreqd.conf # This is the file to configure the profile
Below is snippet of what I modified (the rest stays default):
[Profile]
name=Performance High
minfreq=70%
maxfreq=100%
policy=performance
#exec_post=echo 8 > /proc/acpi/sony/brightness
[/Profile]
[Profile]
name=Performance Low
minfreq=60%
maxfreq=80%
policy=performance
[/Profile]
Furthermore, the followings are useful for debugging:
1. cpufreq-info. This can be used to see what governor and clock are currently running. Also useful to see whether the configuration selected via indicator-cpufreq (e.g. manually choosing a different governor) is applied fine. In the past, I've had issue where my CPU clock was locked to 1.2GHZ (this was back on Ubuntu 12.04, for further detail, see my other blog post)
2. 'cat /var/log/syslog', as cpufreqd logs are written onto this.
3. [Added 10/21/2015] If for some reasons, the rules written under /etc/cpufreqd.conf doesn't get applied, check if cpufreqd daemon is actually running. If it's not, you can start it manually through sudo '/etc/init.d/cpufreqd start'. On my Thinkpad X201, without cpufreqd running, its max frequency is somehow capped in a weird manner.
Sunday, October 4, 2015
Simple Key Re-Mapping on Ubuntu 14.04
This tutorial shows how a simple key remapping can be done using XKB, which is the standard keyboard mapper that Ubuntu 14.04 uses.
To give a little background, I have a ThinkPad X201. Around the laptop's arrow keys, there are two keys that act as BACK and FORWARD (as in the Internet-browser sense), which I found really redundant since I always use the combo of "ALT+LEFT" or "ALT+RIGHT" to achieve the same goal. And so I decided to remap these keys to "PG DOWN" and "PG UP" respectively.
As I researched around achieving this, I found that XKB is pretty complex. For example, it allows remapping a key to different keys, depending on the modifiers (e.g. A becomes B, while Alt+A would become Alt+C) While what I wanted was very simple, most of the resources I found online were pages long trying to explain the quirks of XKB. Now that I've learned how to achieve my remapping, I'm doing a brain-dump here :)
Goal: To map "BACK" and "FORWARD" to "Pg Down" and "Pg Up"
Steps:
aharijanto@aharijanto-ThinkPad-X201:/usr/share/X11/xkb/symbols$ git diff
diff --git a/symbols/inet b/symbols/inet
index 5c4784e..8e522aa 100644
--- a/symbols/inet
+++ b/symbols/inet
@@ -144,8 +144,10 @@ xkb_symbols "evdev" {
key <I163> { [ XF86Mail ] };
key <I164> { [ XF86Favorites ] };
key <I165> { [ XF86MyComputer ] };
- key <I166> { [ XF86Back ] };
- key <I167> { [ XF86Forward ] };
+// key <I166> { [ XF86Back ] };
+ key <I166> { [ Prior ] };
+// key <I167> { [ XF86Forward ] };
+ key <I167> { [ Next ] };
// key <I168> { [ ] }; // KEY_CLOSECD (opposite of eject)
key <I169> { [ XF86Eject ] };
key <I170> { [ XF86Eject, XF86Eject ] };
To give a little background, I have a ThinkPad X201. Around the laptop's arrow keys, there are two keys that act as BACK and FORWARD (as in the Internet-browser sense), which I found really redundant since I always use the combo of "ALT+LEFT" or "ALT+RIGHT" to achieve the same goal. And so I decided to remap these keys to "PG DOWN" and "PG UP" respectively.
As I researched around achieving this, I found that XKB is pretty complex. For example, it allows remapping a key to different keys, depending on the modifiers (e.g. A becomes B, while Alt+A would become Alt+C) While what I wanted was very simple, most of the resources I found online were pages long trying to explain the quirks of XKB. Now that I've learned how to achieve my remapping, I'm doing a brain-dump here :)
Goal: To map "BACK" and "FORWARD" to "Pg Down" and "Pg Up"
Steps:
- Figure out the keycodes for "BACK", "FORWARD", "Pg Down", and "Pg Up"
- The codes can be found at /usr/share/X11/xkb/keycodes/evdev
- They are: I166, I167, PGUP, and PGDN
- Figure out how the keycodes are used
- Go to /usr/share/X11/xkb/
- Grep for the keys above:
- I166 and I167 are used by /usr/share/X11/xkb/symbols/inet, by default mapped to "XF86_Back" and "XF86_Forward"
- PGUP and PGDN are used by many files. One of them is /usr/share/X11/xkb/symbols/pc, whic shows that they map to "Prior" and "Next"
- Customize the keycodes' mapping:
- In accordance to the finding in (2), change "XF86_Back" and "XF86_Forward" that are used by I166 and I167 to "Prior" and "Next"
- Erase XKB cache files
- Remove all *.xkm files under /var/lib/xkb/
- Reboot
- Enjoy!
aharijanto@aharijanto-ThinkPad-X201:/usr/share/X11/xkb/symbols$ git diff
diff --git a/symbols/inet b/symbols/inet
index 5c4784e..8e522aa 100644
--- a/symbols/inet
+++ b/symbols/inet
@@ -144,8 +144,10 @@ xkb_symbols "evdev" {
key <I163> { [ XF86Mail ] };
key <I164> { [ XF86Favorites ] };
key <I165> { [ XF86MyComputer ] };
- key <I166> { [ XF86Back ] };
- key <I167> { [ XF86Forward ] };
+// key <I166> { [ XF86Back ] };
+ key <I166> { [ Prior ] };
+// key <I167> { [ XF86Forward ] };
+ key <I167> { [ Next ] };
// key <I168> { [ ] }; // KEY_CLOSECD (opposite of eject)
key <I169> { [ XF86Eject ] };
key <I170> { [ XF86Eject, XF86Eject ] };
Tuesday, September 9, 2014
Corner cases of Ubuntu 14.04 on Lenovo ThinkPad x201
I've been using Ubuntu 14.04 for a couple months now.
cat /sys/devices/system/cpu/cpu0/cpufreq/bios_limit
To make workaround permanent, we can edit the kernel command line argument, just like what's explained on the same page:
Modify /etc/default/grub to be like this:
Everything works like a charm afterwards!
1. CPU got stucked on 1.2GhZ
Recently I installed a handy utility called indicator-cpufreq, which gives a system status bar icon indicating the currently used CPU governor and the current cpu frequency. I noticed that my CPU always got stucked on 1.2Ghz, no matter what I did. I have tried modifying it manually by echo-ing the sysfs node and using cpufreq-utils, without much luck. I then came across this page:
http://askubuntu.com/questions/340626/permanently-change-maximum-cpu-frequency
This page explains that there is a CPU bios_limit that if set wrongly, may prevent the CPU from going above the frequency threshold that's set there.
cat /sys/devices/system/cpu/cpu0/cpufreq/bios_limit
Turned out it really was the culprit!! For some weird reason it got set to 1.2GHZ!!
This is how you worked around it:
This is how you worked around it:
echo 1 > /sys/module/processor/parameters/ignore_ppc
To make workaround permanent, we can edit the kernel command line argument, just like what's explained on the same page:
Modify /etc/default/grub to be like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash processor.ignore_ppc=1"
Everything works like a charm afterwards!
I then installed cpufreqd, which is a daemon to customize CPU frequency based on the laptop's realtime battery status (e.g. power level, plug/unplugged, etc). Now my docked x201 is running buttery smooth at 2.67 GHZ :)
I want to check out how long will it take to build AOSP on this laptop now :)
I want to check out how long will it take to build AOSP on this laptop now :)
2. Intermittent shutdown due to overheating
Another problem I was facing is that after a couple hours of running docked, my laptop would shut itself off! When this happened, I undocked my laptop and noticed that it's abnormally hot!
I then realized that x201's airflow is located on its bottom, which got blocked by the dock. (sigh.. guess the dock isn't poorly designed.... :( )
Don't fret out though! There's solution!
I found this handy tool to control the fan speed of the laptop's.
Don't fret out though! There's solution!
I found this handy tool to control the fan speed of the laptop's.
http://www.thinkwiki.org/wiki/How_to_control_fan_speed
Basically, x201's fan can be controlled by this node:
/proc/acpi/ibm/fan
There are several levels that can be set, which corresponds to the RPM of the fan.
With this in mind, thinkfan can be used to automate the RPM of the fan depending on the reading of the thermal sensors. This page kindly describes how to set it up. (including how to run thinkfan as a daemon, custom setup for x201, etc)
With this in mind, thinkfan can be used to automate the RPM of the fan depending on the reading of the thermal sensors. This page kindly describes how to set it up. (including how to run thinkfan as a daemon, custom setup for x201, etc)
http://staff.science.uva.nl/~kholshei/thinkfan_guide/
Edit (10/06/2015):
The following steps are how I did it:
1. sudo apt-get install thinkfan
2. sudo echo "options thinkpad_acpi fan_control=1" > /etc/modprobe.d/thinkpad_acpi.conf
3. sudo vim /etc/default/thinkfan, change it to be the following (this is to load thinkfan on boot):
START=yes
4. sudo vim /etc/thinkfan.conf, change it to be the following (this is fan vs. sensor-reading):
# The way the config works is that it picks the highest value among all sysfs nodessensor /sys/devices/virtual/hwmon/hwmon0/temp1_input
sensor /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp4_input
sensor /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp2_input
#sensor /proc/acpi/ibm/thermal
(0, 0, 47)
(1, 46, 50)
(2, 49, 53)
(3, 52, 56)
(4, 55, 59)
(5, 58, 62)
(6, 61, 65)
(7, 64, 75)
#127 is for disengaged
(127, 74, 32767)
Edit (10/06/2015):
The following steps are how I did it:
1. sudo apt-get install thinkfan
2. sudo echo "options thinkpad_acpi fan_control=1" > /etc/modprobe.d/thinkpad_acpi.conf
3. sudo vim /etc/default/thinkfan, change it to be the following (this is to load thinkfan on boot):
START=yes
4. sudo vim /etc/thinkfan.conf, change it to be the following (this is fan vs. sensor-reading):
# The way the config works is that it picks the highest value among all sysfs nodessensor /sys/devices/virtual/hwmon/hwmon0/temp1_input
sensor /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp4_input
sensor /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp2_input
#sensor /proc/acpi/ibm/thermal
(0, 0, 47)
(1, 46, 50)
(2, 49, 53)
(3, 52, 56)
(4, 55, 59)
(5, 58, 62)
(6, 61, 65)
(7, 64, 75)
#127 is for disengaged
(127, 74, 32767)
And for debugging:
1. To see how a new config file works:
sudo thinkfan -n
2. To check current temperature:
cat /sys/devices/virtual/hwmon/hwmon0/temp1_input && cat /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp4_input && cat /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp2_input
'or'
cat /proc/acpi/ibm/thermal (in ubuntu 14.04, only shows one temperature)
3. To check fan level:
cat /proc/acpi/ibm/fan
(level shouldn't be 'auto' if thinkfan is really running)
4. ps aux | grep thinkfan <- you should see the process running
1. To see how a new config file works:
sudo thinkfan -n
2. To check current temperature:
cat /sys/devices/virtual/hwmon/hwmon0/temp1_input && cat /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp4_input && cat /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp2_input
'or'
cat /proc/acpi/ibm/thermal (in ubuntu 14.04, only shows one temperature)
3. To check fan level:
cat /proc/acpi/ibm/fan
(level shouldn't be 'auto' if thinkfan is really running)
4. ps aux | grep thinkfan <- you should see the process running
Subscribe to:
Posts (Atom)