From 0c3a3e015b66eeac415580cb9f0391184e54853f Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Fri, 15 Jan 2021 14:48:59 -0500 Subject: added/finished Zroot mirror vdevs --- drafts/dell-dock.html | 82 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 64 insertions(+), 18 deletions(-) (limited to 'drafts/dell-dock.html') diff --git a/drafts/dell-dock.html b/drafts/dell-dock.html index 4be6691..4a9dd9a 100644 --- a/drafts/dell-dock.html +++ b/drafts/dell-dock.html @@ -1,18 +1,17 @@ -

Make Your Docking Station Work for You on FreeBSD

+

Make Your Docking Station Work for You (on FreeBSD)

- Here's the problem. I have a Dell Latitude E-series laptop running FreeBSD - 12.1-RELEASE. I also have a Dell E-Port II docking station on my desk. I - wanted to be able to take my shut, sleeping laptop and plop it down on the - docking station, hit the dock power button, and have the laptop wake up and - switch over to all of the docking station peripherals. All of the USB devices - did this without any additional work. However, the ethernet hookup, external - monitor, and speakers all required some additional tinkering. This assumes - that you're already familiar with wired and wireless network interfaces on - FreeBSD! + I have a Dell Latitude E-series laptop running FreeBSD 12.2-RELEASE. I also + have a Dell E-Port II docking station on my desk. I wanted to be able to take + my shut, sleeping laptop and plop it down on the docking station, hit the dock + power button, and have the laptop wake up and switch over to all of the + docking station peripherals. So I did it! And now I'm going to write about it + so I don't forget how. You need to know a little bit about FreeBSD + sysctl knobs, display outputs in X, sound devices, and + ifconfig networking.

-

Link Aggregation (Failover)

+

Switching from Ethernet to WiFi and Back Again, Seamlessly

FreeBSD doesn't magically swap from wireless to wired connections by default, @@ -20,21 +19,21 @@ FreeBSD handbook page on network aggregation - as it's where I found out how to do what I'm about to show you. Basically, + as it's where I found out about link aggregation and failover. Basically, aggregation lets you bind two of your network interfaces together into a single virtual interface. Failover lets your traffic continue moving as long - as one of the aggregated interfaces has is connected. The steps I had to - follow are as follows: + as one of the aggregated interfaces has is connected. + Here's what I had to do:

- +

All of this is configured in my rc.conf:

@@ -54,3 +53,50 @@ ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP" # <- con will take over. This transition happens instantly, and without interrupting traffic; active transactions aren't cut short for example.

+ +

Sleeping on Lid Close Except When Docked

+ +

+ This is an easy one. You can use sysctl to configure what happens + when a laptop lid is closed. I wanted the lid closing while undocked to + suspend (put the laptop to sleep). When it's docked however, I don't use the + internal display and wanted to be able to shut the lid and leave it shut. If you read ACPI(4) in the manual, you'll find this little passage: +

+ +
+
+hw.acpi.lid_switch_state + Suspend state (S1-S5) to enter when the lid switch (i.e., a + notebook screen) is closed. Default is "NONE" (do nothing). +
+
+
+

I changed this value a long time ago so closing the lid suspends the laptop. You can check with sysctl:

+ +
+
+$ sysctl hw.acpi.lid_switch_state
+hw.acpi.lid_switch_state: S3
+
+
+ +

Now, if I wanted to disable this functionality, I would just change this parameter as root:

+ +
+
+$ doas sysctl hw.acpi.lid_switch_state=NONE
+hw.acpi.lid_switch_state: NONE -> NONE
+
+
+ +This change takes effect immediately. I can open and close the lid and nothing happens but turning off the screen. Awesome. + +

Swapping Primary Display Outputs (Also Nvidia Screen-Tearing)

+ +

Switching Default Sound Device

+ +

Putting It All Together (Scripts Are Glue)

+ +

What I Didn't Have to Do

+ +usb devices, battery/charging -- cgit v1.2.3