Terrapad as Proxmox hypervisor
My grandpa still uses a laptop, convertible and a mobile phone. Every few years, he wants to upgrade his device or replace a device which does not work anymore. That was the case with a terra pad 1162 which fell on the ground a had a touchscreen issue since then.
The device randomly taps on the screen without doing anything.
This also happens in the docked state (luckily, the device supports an USB-C docks) So it is quite unusable for normal operation.
Disabling Touchscreen on Linux
I tried to turn off the screen on linux through different ways:
- system settings don’t provide option to disable touchscreen
- udev settings to disable touchscreen device did not work (
SUBSYSTEM=="input", ATTRS{idVendor}=="0cb6", ATTRS{idProduct}=="0002", ATTR{authorized}="0"
) -udevadm info -a /dev/input/event10
showsid/vendor
instead, but I still could not get it to work - disallow loading
hid_multitouch
usingmodprobe -r hid_multitouch
Somehow nothing worked, so I installed Proxmox on the device to use it as a hypervisor if i can’t use it directly.
Proxmox on Terra Pad 1162 - aka issues with eMMC and Wifi
Unfortunatley, proxmox does not like being installed on a eMMC flash storage or SD card.
The install medium must be something like /dev/sdX
.
It is said, that proxmox wears off the storage a lot due to continous writing to the disk.
I therefore added a 512GB HDD as an install medium on one of the two USB3 ports.
Additionally, the Terra Pad does not have a Ethernet port. Wifi-Adapters often do not allow to be used with a bridge sending traffic from different ip addresses so proxmox discourages using wifi at all. I added a 100Mbit USB2 Ethernet adapter I had laying around on the second USB port after the installation was successful.
Finally I could use my new fanless proxmox server with 4GB RAM. Of course it is not much, but it is maybe enough to use it for some web pages and small installations.
The main benefit is the low energy consumption as this device uses about 5W idling. My Samsung Laptop Server uses 30W (with 3 disks and a bunch of services running).
But even using stress
the device only uses < 10W and stays at 60°C, of course the computing power is also very limited here
Turn off screen after boot
Of course as with every laptop server, we need to disable the LidSwitch Turnoff as the device should keep running if I close the Keyboard Lid.
On this device, the screen stays turned on with a closed lid, so I need to turn off the screen manually.
To do this, I changed the screen brightness to 0, as xset -display :0.0 dpms force off
did not work as xset is not available.
To automate this I had two ideas, to solve this, the first was to turn off the screen after a given time interval after boot.
root@terrapad:~# cat /etc/systemd/system/disable_screen.service
[Unit]
Description=disable screen after startup
[Service]
Type=oneshot
ExecStart=bash -c "echo 0 > /sys/class/backlight/intel_backlight/brightness"
TimeoutStartSec=1
which does not have an Install
section as it is only triggered by the timer, which is added here:
root@terrapad:~# cat /etc/systemd/system/disable_screen.timer
[Unit]
Description="Disable Screen after 5 minutes of boot"
[Timer]
OnBootSec=5min
[Install]
WantedBy=default.target
Finally run systemctl daemon-reload && systemctl enable disable_screen.timer
and the timer works after next boot.
The disadvantage is, that I can’t activate the screen without SSH or rebooting the device.
ACPID
as systemd-logind does not allow to run a script on change of the lidswitch, I needed to install its predecessor, acpid. Therefore I can create a script which turns the brightness on or off which is invoked on each lid state change
root@terrapad:~# cat /etc/acpi/lid.sh
grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]
then
echo 0 > /sys/class/backlight/intel_backlight/brightness
else
echo 200 > /sys/class/backlight/intel_backlight/brightness
fi
and to start the script add an event configuration for acpid:
root@terrapad:~# cat /etc/acpi/events/lm_lid
event=button/lid/*
action=/etc/acpi/lid.sh
Conclusion
Fortunatly, I created the systemd-timer solution first. Otherwise the screen would stay on after a reboot, as the lid switch is not triggered then. So I am using both solutions right now. Opening the lid now activates the screen as I wanted it to behave.
And I can use the broken TerraPad as a small proxmox host and test instance.