# T420s FreeBSD-11 upgrade



## rdeiriar (Jul 28, 2016)

After upgrading my T420s (https://forums.freebsd.org/threads/17308/page-5#post-324950) to FreeBSD-11-BETA2 I thought it would be worthwhile to share my findings. The process was mostly painless, except for the two points below. It should be noted that, on my machine, the power usage when idle improved from 14-15w to 12-13w, a noticeable advantage

1. Beware of  the bootloader if using UEFI with ZFS

If you have just migrated to an UEFI system, like I have, when updating the bootloader after upgrading the ZFS pool, you are likely to make the same mistake that I did, `gpart bootcode....` will happily render the system unbootable. The UEFI way is to copy the efi bootloader to the efi boot partition on the boot device, in my case, ada0

`dd if=/boot/boot1.efifat of=/dev/ada0p1`

2. acpi_ibm requires flags for the sleep button to work

Add [FONT=Courier New]dev.acpi_ibm.0.handlerevents='0x04'[/FONT] to  /etc/sysctl.conf


----------



## Atsuri (Jul 31, 2016)

rdeiriar said:


> 2. acpi_ibm requires flags for the sleep button to work
> 
> Add [FONT=Courier New]dev.acpi_ibm.0.handlerevents='0x04'[/FONT] to  /etc/sysctl.conf


I am somewhat interested in Thinkpads as solid business/IT computers. Do all the other hotkeys for brightness, volume, bluetooth, etc. work out-of-the-box on your T420 with FreeBSD-11-BETA2? I just read the manpage for acpi_ibm() and supposedly multiple acpi events can be set via *.handlerevents.


----------



## rdeiriar (Aug 1, 2016)

The t420s works very well with FreeBSD 11, the only piece of hardware that i have not tried is the integrated webcam.
The following hotkeys work on mine

Volume
Mute 
Brightness
Led
Sleep

Minimum energy usage when doing casual things like writing this answer and reading FreeBSD's mailing lists is below 12w, thus giving a very reasonable 2 to 3 hours on battery 
I'm very pleased with this little machine, so much that i cannot think of any reason not to recommend it for FreeBSD


----------



## aragats (Aug 1, 2016)

I'm using FreeBSD 11 with my T430 for about a year. Everything works fine.
For the webcam I use cuse4bsd(3).


----------



## Seagate (Jan 9, 2017)

rdeiriar said:


> After upgrading my T420s (https://forums.freebsd.org/threads/17308/page-5#post-324950) to FreeBSD-11-BETA2 I thought it would be worthwhile to share my findings. The process was mostly painless, except for the two points below. It should be noted that, on my machine, the power usage when idle improved from 14-15w to 12-13w, a noticeable advantage
> 
> 1. Beware of  the bootloader if using UEFI with ZFS
> 
> ...




I am thinkpad T420 user with freebsd 11, may i know suspend and resume have run on your laptop ?
i've suspend but resuming in black screen.


----------



## aragats (Jan 9, 2017)

If you're talking about suspend to RAM (sleep), it works fine in my ThinkPad T430.
	
	



```
# acpiconf -s 3
```
No tweaks are needed.


----------



## Seagate (Jan 9, 2017)

aragats said:


> If you're talking about suspend to RAM (sleep), it works fine in my ThinkPad T430.
> 
> 
> 
> ...


i mean sleep when lid close and resume when lid is open


----------



## aragats (Jan 9, 2017)

Seagate said:


> sleep when lid close and resume when lid is open


Isn't it controlled by acpi? You should look into its configuration.
So, does it work when you manually issue the command above?


----------



## Seagate (Jan 9, 2017)

aragats said:


> Isn't it controlled by acpi? You should look into its configuration.
> So, does it work when you manually issue the command above?


yes, acpiconf -s 3 is work for suspend but resuming black screen.


----------



## aragats (Jan 9, 2017)

What video card do you have? Is it embedded Intel? If yes, do you have in your /boot/loader.conf

```
i915kms_load="YES"
```


----------



## Seagate (Jan 9, 2017)

aragats said:


> What video card do you have? Is it embedded Intel? If yes, do you have in your /boot/loader.conf
> 
> ```
> i915kms_load="YES"
> ```


Ok i've to try. my t420 have two gpu card. nvidia and intel, now i use intel. nvidia not loaded in /boot/loader.conf and not enabled in /etc/rc.conf.

updated : still not work, resume still black screen

here's part of my /boot/loader.conf

```
#linux_load="YES"
#nvidia_load="YES"
kern.vty=vt
hw.vga.textmode="1"

acpi_ibm_load="YES"
acpi_video_loads="YES"
hw.psm.synaptics_support="1"
drm.i915.enable_rc6=7
i915kms_load="YES"

fuse_load="YES"
sound_enable="YES"
snd_hda_load="YES"
if_iwn_load="YES"
```

my /etc/sysctl.conf

```
hw.acpi.reset_video=0
hw.acpi.lid_switch_state=S3
hw.acpi.sleep_button_state=S3
hw.acpi.power_button_state=S5
hw.acpi.sleep_delay=3
hw.acpi.verbose=1
hw.syscons.sc_no_suspend_vtswitch=0
dev.acpi_ibm.0.events=1
```


----------



## ASX (Jan 9, 2017)

Seagate said:


> acpi_video_load*s*="YES"



That 's' ... look like a typo.


----------



## Seagate (Jan 9, 2017)

ASX said:


> That 's' ... look like a typo.


thanks bro, but resume still not work


----------



## aragats (Jan 10, 2017)

Seagate , in my /etc/sysctl.conf I have only:
	
	



```
dev.acpi_ibm.0.handlerevents='0x04'
```
(and a couple of touchpad related lines).In my /boot/loader.conf the only related line is 
	
	



```
acpi_ibm_load="YES"
```


----------



## Seagate (Jan 10, 2017)

aragats said:


> Seagate , in my /etc/sysctl.conf I have only:
> 
> 
> 
> ...


i'll try to add
dev.acpi_ibm.0.handlerevents='0x04' and acpi_ibm_load="YES"
, there may be a match configuration between T420 and T430


----------



## spython01 (Oct 6, 2018)

I've got a similar issue running 11.1-RELEASE-p13 (yes I know, I've got to upgrade!) on a T430 wherein the volume up and down buttons (along with most of the other function keys) don't work.

My /boot/loader.conf has

```
acpi_ibm_load="YES"
```

and I've added the following line to /etc/sysctl.conf:

```
dev.acpi_ibm.0.handlerevents=0x15\ 0x16
```

Even after rebooting, the volume buttons do not work.  Any ideas or suggestions would be appreciated!


----------

