https://wiki.archlinux.org/api.php?action=feedcontributions&user=Snakeroot&feedformat=atomArchWiki - User contributions [en]2024-03-28T11:45:56ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=KMSCON&diff=802425KMSCON2024-03-06T14:06:38Z<p>Snakeroot: Something I wish I'd known.</p>
<hr />
<div>[[Category:Terminal emulators]]<br />
[[ja:KMSCON]]<br />
[[zh-hans:KMSCON]]<br />
{{Related articles start}}<br />
{{Related|KMS}}<br />
{{Related|systemd}}<br />
{{Related articles end}}<br />
<br />
From the project's [https://cgit.freedesktop.org/~dvdhrm/kmscon/tree/README git repository]:<br />
<br />
:Kmscon is a simple terminal emulator based on linux [[kernel mode setting]]. It is an attempt to replace the in-kernel VT implementation with a userspace console.<br />
<br />
== Features ==<br />
<br />
Kmscon can function as a drop-in replacement for the in-kernel linux-console. Features include:<br />
<br />
* Full vt220 to vt510 implementation.<br />
* Full internationalization support:<br />
** Kmscon supports printing full Unicode glyphs, including the CJK ones.<br />
** Kmscon provides internationalized keyboard handling through libxkbcommon, thus allowing it to use the full range of keyboard layouts supported in X keyboard.<br />
* Hardware accelerated rendering.<br />
* [https://www.freedesktop.org/wiki/Software/systemd/multiseat/ Multi-seat] capability.<br />
<br />
{{Note|In order to be able to log into a kmscon console as root, you have to disable the {{ic|pam_securetty}} module by removing or commenting out the corresponding line in {{ic|/etc/pam.d/login}}. }}<br />
<br />
== Installation ==<br />
<br />
Despite its name, [[KMS]] is not a hard requirement for kmscon. Kmscon supports the following video backends: drm3d (Linux DRM hardware-rendering backend), drm2d (Linux DRM software-rendering backend), [[wikipedia:Linux framebuffer|superseded]] fbdev (Linux fbdev video backend). Make sure one of them is available on your system.<br />
<br />
Install the {{AUR|kmscon}} package or the {{AUR|kmscon-git}} package for a development version. Alternatively, install {{AUR|kmscon-patched-git}}. The patched version, along with its patched dependency ({{AUR|libtsm-patched-git}}), includes fixes and improvements.<br />
<br />
Normally, there is a special systemd configuration for tty1. To be conservative, you can continue to run the traditional agetty on tty1 and only run kmscon on all the other virtual terminals. Or you can run kmscon on both tty1 and the other VTs.<br />
<br />
To enable kmscon on tty1, [[disable]] {{ic|getty@tty1.service}} and [[enable]] {{ic|kmsconvt@tty1.service}}.<br />
<br />
To enable kmscon on all virtual terminals, run:<br />
<br />
{{bc|<br />
# ln -s /usr/lib/systemd/system/kmsconvt\@.service /etc/systemd/system/autovt\@.service<br />
}}<br />
<br />
This will make {{pkg|systemd}} start kmscon instead of agetty on each VT. More precisely, this will make ''systemd-logind'' use {{ic|kmsconvt@.service}} instead of {{ic|getty@.service}} for new VTs. Additionally, all other systemd units that use {{ic|getty@.service}} will not be affected by this change.<br />
<br />
If ''kmscon'' cannot start for whatever reason, this unit will cause {{ic|getty@.service}} to be started instead. Furthermore, if no VTs are available, this unit will not start anything.<br />
<br />
{{Warning|If you have replaced agetty on all terminals, take care to ensure ''kmscon'' presents you with a prompt before rebooting your machine, otherwise you may have to recover through a live CD.}}<br />
<br />
== CJK support ==<br />
<br />
Kmscon supports rendering CJK characters through the default font engine {{pkg|pango}}. However, {{pkg|fontconfig}} has to be ''globally'' configured to map the monospace font alias to proper CJK fonts. For Chinese users, the following template is provided and proved to result in satisfactory Chinese characters rendering:<br />
<br />
{{hc|/etc/fonts/conf.d/99-kmscon.conf|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<match><br />
<test name="family"><string>monospace</string></test><br />
<edit name="family" mode="prepend" binding="strong"><br />
<string>DejaVu Sans Mono</string><br />
<string>WenQuanYi Micro Hei Mono</string><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
Alternatively, we can add the following line to {{ic|/etc/kmscon/kmscon.conf}} for globally configuring kmscon using the fonts:<br />
<br />
{{hc|/etc/kmscon/kmscon.conf|<nowiki><br />
font-name=DejaVu Sans Mono, WenQuanYi Micro Hei Mono<br />
font-size=14<br />
</nowiki>}}<br />
<br />
See {{man|1|kmscon|url=}}.<br />
<br />
You need to have {{Pkg|ttf-dejavu}} and {{Pkg|wqy-microhei}}, both available from the official repositories, installed.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Problems with switching between Xorg and kmscon ===<br />
<br />
You may want to add {{ic|hwaccel}} to {{ic|/etc/kmscon/kmscon.conf}} if you have problems with switching between [[Xorg]] and kmscon. The file and folder are not part of the package and therefore have to be created manually. Another possibility would be [[Systemd#Editing provided units|editing the systemd service file]].<br />
<br />
=== No audio control ===<br />
<br />
As version 7, if you cannot control the audio, add your user to the {{ic|audio}} [[user group]]. Be aware of the [[Alsa#Installation|shortcomings]] of this choice.<br />
<br />
=== Vim does not clear terminal output ===<br />
<br />
Vim might open without clearing the terminal output, it is still possible to edit the file but the text will not be visible until it is changed. As a workaround, try setting the [[environment variable]] {{ic|1=TERM=vt220}}. Alternatively, another vim-like editor like {{Pkg|vi}} or [[Neovim]] might work.<br />
<br />
{{Note|Color support is not available if {{ic|TERM}} is set to {{ic|vt220}}.}}<br />
<br />
=== Automatic login ===<br />
<br />
It is possible to login as user ''username'' automatically without asking for password by adding this to {{ic|/etc/kmscon/kmscon.conf}}<br />
<br />
{{hc|/etc/kmscon/kmscon.conf|2= <br />
# Example: Login as user "''username''" without asking for password<br />
login=/bin/login -p -f ''username''<br />
}}<br />
<br />
Or as user ''root'':<br />
<br />
{{hc|/etc/kmscon/kmscon.conf|2=<br />
# Example: Login as root in a bash shell without asking for password<br />
login=/bin/bash --login<br />
}}<br />
<br />
=== HiDPI support ===<br />
<br />
You can change font size on the fly with {{ic|Ctrl++}}, {{ic|1=Ctrl+Shift+=}}, {{ic|Ctrl+-}} shortcuts. Also you can set 'font-dpi' and 'font-size' in {{ic|/etc/kmscon/kmscon.conf}} e.g. 'font-dpi=288' 288 is 96 * 3 that is 300% scaling. 96 is default.<br />
<br />
=== Window managers cannot be started from KMS console ===<br />
<br />
Starting an Xorg or Wayland session from the commandline, using [https://github.com/dvdhrm/kmscon/issues/65 {{ic|startx}}] or, e.g., [https://github.com/Cloudef/wlc/issues/206 {{ic|sway}}], will fail. Either keep a traditional, non-KMS tty for this purpose or use a login manager instead.</div>Snakeroothttps://wiki.archlinux.org/index.php?title=D-Bus&diff=796621D-Bus2024-01-10T16:51:09Z<p>Snakeroot: /* dbus-broker */ Correction per Talk page</p>
<hr />
<div>[[Category:System administration]]<br />
[[de:Qdbus]]<br />
[[ja:D-Bus]]<br />
[[ru:D-Bus]]<br />
[[zh-hans:D-Bus]]<br />
{{Out of date|Packages structure has changed and ''dbus-broker'' is the default now. [https://archlinux.org/news/making-dbus-broker-our-default-d-bus-daemon/]}}<br />
{{Expansion|Mention disabling of dbus services through use of {{ic|systemctl mask}} and overrides in {{ic|/etc/dbus-1/services}}}}<br />
<br />
[[Wikipedia:D-Bus|D-Bus]] is a message bus system that provides an easy way for inter-process communication. It consists of a daemon, which can be run both system-wide and for each user session, and a set of libraries to allow applications to use D-Bus.<br />
<br />
{{Pkg|dbus}} is pulled and installed as a dependency of {{Pkg|systemd}} and user session bus is [https://archlinux.org/news/d-bus-now-launches-user-buses/ started automatically] for each user.<br />
<br />
== Alternative implementations ==<br />
<br />
=== dbus-broker ===<br />
<br />
{{App|dbus-broker|A drop-in replacement for the ''libdbus'' reference implementation, which aims "to provide high performance and reliability, while keeping compatibility to the D-Bus reference implementation".|https://github.com/bus1/dbus-broker|{{Pkg|dbus-broker}}}}<br />
<br />
From January 9, 2024 ''dbus-broker'' is the default for Arch, although the reference implementation continues to be officially supported. To use ''dbus-broker'' install {{Pkg|dbus-broker}} and {{Pkg|dbus-broker-units}}. See the [https://archlinux.org/news/making-dbus-broker-our-default-d-bus-daemon/ transition announcement] and [https://gitlab.archlinux.org/archlinux/rfcs/-/blob/master/rfcs/0025-dbus-broker-default.rst related RFC] for more details.<br />
<br />
''dbus-broker'' runs both user-level dbus "session bus(ses)" and a system-level dbus "system bus". These in turn are started by system and user systemd services.<br />
<br />
The systemd system and user services are triggered by {{ic|dbus.socket}} at systemd system and user levels. The sockets trigger the relevant {{ic|dbus.service}}, the service file for which is a symlink to {{ic|dbus-broker.service}}. The {{ic|dbus-broker.service}} thus should not be expressly enabled.<br />
<br />
<br />
{{Note|{{Pkg|dbus-broker}} currently does not have [[AppArmor]] [https://github.com/bus1/dbus-broker/pull/286 support] }}<br />
<br />
=== reference implementation ===<br />
<br />
The reference implementation operates similarly to the default ''dbus-broker'' implementation and should be activated similarly if one elects to install {{Pkg|dbus-daemon-units}}.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Override dbus service ===<br />
<br />
You can override dbus services in {{ic|$XDG_DATA_HOME/dbus-1/services}}.<br />
<br />
If the service is already launched, the override will not work. We must kill the existing service's process, or launch our service earlier.<br />
<br />
You can use this to always use a particular service when you have several installed providing the same well-known bus name.<br />
<br />
See [[KDE Wallet#Automatic D-Bus activation]] for example.<br />
<br />
== Debugging ==<br />
<br />
* {{App|D-Spy|Easy to use D-Bus debugger GUI tool. D-Spy can be used to inspect D-Bus interfaces of running programs and invoke methods on those interfaces.|https://gitlab.gnome.org/GNOME/d-spy|{{Pkg|d-spy}}}}<br />
<br />
* {{App|QDbusViewer|GUI D-Bus debugger. Can be used to inspect D-Bus services and invoke methods on them.|https://doc.qt.io/qt-5/qdbusviewer.html|{{Pkg|qt5-tools}}}}<br />
<br />
You can also use {{man|1|busctl}} from [[systemd]].<br />
<br />
== See also ==<br />
<br />
* https://freedesktop.org/wiki/Software/dbus/<br />
* https://freedesktop.org/wiki/IntroductionToDBus/</div>Snakeroothttps://wiki.archlinux.org/index.php?title=D-Bus&diff=796616D-Bus2024-01-10T16:15:37Z<p>Snakeroot: /* dbus-broker */ Update to reflect implementation of RFC 25</p>
<hr />
<div>[[Category:System administration]]<br />
[[de:Qdbus]]<br />
[[ja:D-Bus]]<br />
[[ru:D-Bus]]<br />
[[zh-hans:D-Bus]]<br />
{{Out of date|Packages structure has changed and ''dbus-broker'' is the default now. [https://archlinux.org/news/making-dbus-broker-our-default-d-bus-daemon/]}}<br />
{{Expansion|Mention disabling of dbus services through use of {{ic|systemctl mask}} and overrides in {{ic|/etc/dbus-1/services}}}}<br />
<br />
[[Wikipedia:D-Bus|D-Bus]] is a message bus system that provides an easy way for inter-process communication. It consists of a daemon, which can be run both system-wide and for each user session, and a set of libraries to allow applications to use D-Bus.<br />
<br />
{{Pkg|dbus}} is pulled and installed as a dependency of {{Pkg|systemd}} and user session bus is [https://archlinux.org/news/d-bus-now-launches-user-buses/ started automatically] for each user.<br />
<br />
== Alternative implementations ==<br />
<br />
=== dbus-broker ===<br />
<br />
{{App|dbus-broker|A drop-in replacement for the ''libdbus'' reference implementation, which aims "to provide high performance and reliability, while keeping compatibility to the D-Bus reference implementation".|https://github.com/bus1/dbus-broker|{{Pkg|dbus-broker}}}}<br />
<br />
From January 9, 2024 ''dbus-broker'' is the default for Arch, although the reference implementation continues to be officially supported. To use ''dbus-broker'' install {{Pkg|dbus-broker}} and {{Pkg|dbus-broker-units}}. See the [https://archlinux.org/news/making-dbus-broker-our-default-d-bus-daemon/ transition announcement] and [https://gitlab.archlinux.org/archlinux/rfcs/-/blob/master/rfcs/0025-dbus-broker-default.rst related RFC] for more details.<br />
<br />
''dbus-broker'' runs both user-level dbus "session bus(ses)" and a system-level dbus "system bus". These in turn are started by system and user systemd services.<br />
<br />
The systemd system and user services are triggered by {{ic|dbus.socket}} at systemd system and user levels. The sockets trigger the relevant {{ic|dbus.service}}, the service file for which is a symlink to {{ic|dbus-broker.service}}. The {{ic|dbus-broker.service}} thus should not be expressly enabled; instead ensure that the {{ic|dbus.socket}} is enabled for both systemd system and users.<br />
<br />
<br />
{{Note|{{Pkg|dbus-broker}} currently does not have [[AppArmor]] [https://github.com/bus1/dbus-broker/pull/286 support] }}<br />
<br />
=== reference implementation ===<br />
<br />
The reference implementation operates similarly to the default ''dbus-broker'' implementation and should be activated similarly if one elects to install {{Pkg|dbus-daemon-units}}.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Override dbus service ===<br />
<br />
You can override dbus services in {{ic|$XDG_DATA_HOME/dbus-1/services}}.<br />
<br />
If the service is already launched, the override will not work. We must kill the existing service's process, or launch our service earlier.<br />
<br />
You can use this to always use a particular service when you have several installed providing the same well-known bus name.<br />
<br />
See [[KDE Wallet#Automatic D-Bus activation]] for example.<br />
<br />
== Debugging ==<br />
<br />
* {{App|D-Spy|Easy to use D-Bus debugger GUI tool. D-Spy can be used to inspect D-Bus interfaces of running programs and invoke methods on those interfaces.|https://gitlab.gnome.org/GNOME/d-spy|{{Pkg|d-spy}}}}<br />
<br />
* {{App|QDbusViewer|GUI D-Bus debugger. Can be used to inspect D-Bus services and invoke methods on them.|https://doc.qt.io/qt-5/qdbusviewer.html|{{Pkg|qt5-tools}}}}<br />
<br />
You can also use {{man|1|busctl}} from [[systemd]].<br />
<br />
== See also ==<br />
<br />
* https://freedesktop.org/wiki/Software/dbus/<br />
* https://freedesktop.org/wiki/IntroductionToDBus/</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Unified_kernel_image&diff=792851Unified kernel image2023-11-19T16:59:46Z<p>Snakeroot: /* pacman hook */ "Target=linux" is below the comment, not above</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[ja:Unified カーネルイメージ]]<br />
[[pt:Unified kernel image]]<br />
A [https://uapi-group.org/specifications/specs/boot_loader_specification/#type-2-efi-unified-kernel-images unified kernel image] (UKI) is a single executable which can be booted directly from UEFI firmware, or automatically sourced by boot-loaders with little or no configuration. <br />
<br />
Although Arch supported kernels themselves [[EFISTUB|can be loaded by UEFI firmware]], a unified image allows to incorporate all or a subset of the following:<br />
<br />
* a UEFI stub loader like {{man|7|systemd-stub}},<br />
* the [[kernel command line]],<br />
* [[microcode]],<br />
* an [[Arch boot process#initramfs|initramfs image]],<br />
* a [[Arch boot process#Kernel|kernel image]],<br />
* a splash screen.<br />
<br />
The resulting executable, and therefore all these elements can then be easily [[Unified Extensible Firmware Interface/Secure Boot#Signing EFI binaries|signed]] for use with [[Secure Boot]].<br />
<br />
{{Note|In the entire article {{ic|''esp''}} denotes the mountpoint of the [[EFI system partition]].}}<br />
<br />
== Preparing a unified kernel image ==<br />
<br />
=== mkinitcpio ===<br />
<br />
==== Kernel command line ====<br />
<br />
[[mkinitcpio]] supports reading [[kernel parameters]] from command line files in the {{ic|/etc/cmdline.d}} directory. Mkinitcpio will concatenate the contents of all files with a {{ic|.conf}} extension in this directory and use them to generate the kernel command line. Any lines in the command line file that start with a '''#''' character are treated as comments and ignored by mkinitcpio. Take care to '''remove entries''' pointing to microcode and initramfs. <br />
<br />
For example:<br />
<br />
{{hc|/etc/cmdline.d/root.conf|2=<br />
root=UUID=0a3407de-014b-458b-b5c1-848e92a327a3 rw<br />
}}<br />
<br />
{{Tip|<br />
* If your root file system is on a non-default Btrfs subvolume, make sure to set necessary mount flags in {{ic|rootflags}}. See [[Btrfs#Mounting subvolume as root]].<br />
* For example, if your system subvolume ID is {{ic|256}} (you can see your subvolume ID using {{ic|btrfs subvolume list ''btrfs_mountpoint''}}, or you can see the flags in {{ic|/etc/fstab}}), you should add {{ic|1=rootflags=subvolid=256}} to your kernel command line.<br />
* It is not necessary to copy all flags in {{ic|/etc/fstab}} since {{ic|rootflags}} is only used during boot. Systemd will read fstab, remount and apply flags listed there automatically after boot.<br />
}}<br />
<br />
{{hc|/etc/cmdline.d/security.conf|2=<br />
# enable apparmor<br />
lsm=landlock,lockdown,yama,integrity,apparmor,bpf audit=1 audit_backlog_limit=256<br />
}}<br />
<br />
Alternatively, {{ic|/etc/kernel/cmdline}} can be used to configure the kernel command line.<br />
<br />
For example:<br />
<br />
{{hc|/etc/kernel/cmdline|2=<br />
root=UUID=0a3407de-014b-458b-b5c1-848e92a327a3 rw quiet bgrt_disable<br />
}}<br />
<br />
{{Tip|<br />
* The {{ic|1=root=}} parameter may be omitted if the root partition is [[Systemd#GPT partition automounting|automounted by systemd]].<br />
* The {{ic|bgrt_disable}} parameter tells Linux to not display the OEM logo after loading the ACPI tables.<br />
}}<br />
<br />
==== .preset file ====<br />
<br />
Next, modify {{ic|/etc/mkinitcpio.d/linux.preset}}, or the preset that you are using, as follows, with the appropriate mount point of the [[EFI system partition]] :<br />
<br />
* Un-comment (i.e. remove {{ic|#}}) the {{ic|1=''PRESET''_uki=}} parameter for each item in {{ic|1=PRESETS=}},<br />
* Optionally, comment out {{ic|1=''PRESET''_image=}} to avoid storing a redundant {{ic|initramfs-*.img}} file,<br />
* Optionally, add or un-comment the {{ic|--splash}} parameter to each {{ic|1=''PRESET''_options=}} line for which you want to add a splash image.<br />
<br />
Here is a working example {{ic|linux.preset}} for the {{Pkg|linux}} kernel and the Arch splash screen.<br />
<br />
{{hc|/etc/mkinitcpio.d/linux.preset|2= <br />
# mkinitcpio preset file for the 'linux' package<br />
<br />
#ALL_config="/etc/mkinitcpio.conf"<br />
ALL_kver="/boot/vmlinuz-linux"<br />
ALL_microcode=(/boot/*-ucode.img)<br />
<br />
PRESETS=('default' 'fallback')<br />
<br />
#default_config="/etc/mkinitcpio.conf"<br />
#default_image="/boot/initramfs-linux.img"<br />
default_uki="''esp''/EFI/Linux/arch-linux.efi"<br />
default_options="--splash=/usr/share/systemd/bootctl/splash-arch.bmp"<br />
<br />
#fallback_config="/etc/mkinitcpio.conf"<br />
#fallback_image="/boot/initramfs-linux-fallback.img"<br />
fallback_uki="''esp''/EFI/Linux/arch-linux-fallback.efi"<br />
fallback_options="-S autodetect"<br />
}}<br />
<br />
{{Tip|<br />
* If all you want to do is boot from the unified kernel images, you can [[EFI system partition#Typical mount points|mount the ESP]] to {{ic|/efi}} and only those need to reside on the [[ESP]] partition.<br />
* You can append {{ic|--cmdline /etc/kernel/''fallback_cmdline''}} to {{ic|fallback_options}} to use different a different [[#Kernel command line|cmdline]] than above for the fallback image (e.g. without {{ic|quiet}}).<br />
* To omit embedding the kernel command line, add {{ic|--no-cmdline}} to {{ic|''PRESET''_options{{=}}}}. Kernel parameters will need to be passed via the boot loader.<br />
}}<br />
<br />
{{Note|{{ic|''PRESET''_uki}} options were previously known as {{ic|''PRESET''_efi_image}}, [https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/issues/134 changed November 2022], with older option deprecated but working for now.}}<br />
<br />
==== pacman hook ====<br />
<br />
A [[pacman hook]] is needed to trigger a rebuild after a microcode upgrade.<br />
<br />
{{hc|/etc/pacman.d/hooks/ucode.hook|2=<br />
[Trigger]<br />
Operation=Install<br />
Operation=Upgrade<br />
Operation=Remove<br />
Type=Package<br />
# Change to appropriate microcode package<br />
Target=amd-ucode<br />
# Change the linux part below and in the Exec line if a different kernel is used<br />
Target=linux<br />
<br />
[Action]<br />
Description=Update Microcode module in initcpio<br />
Depends=mkinitcpio<br />
When=PostTransaction<br />
NeedsTargets<br />
Exec=/bin/sh -c 'while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P'<br />
}}<br />
<br />
{{Tip|Consider merging this hook with other hooks that monitor the kernel package, such as the one for the [[NVIDIA#pacman hook|NVIDIA driver]], to avoid repeated mkinitcpio runs.}}<br />
<br />
==== Signing the UKIs for Secure Boot ====<br />
<br />
By using a mkinitcpio post hook ({{man|8|mkinitcpio|ABOUT POST HOOKS}}), the generated unified kernel images can be signed for [[Secure Boot]]. [[Create]] the following file and make it [[executable]]:<br />
<br />
{{hc|/etc/initcpio/post/uki-sbsign|2=<br />
#!/usr/bin/env bash<br />
<br />
uki="$3"<br />
<nowiki>[[ -n "$uki" ]] || exit 0</nowiki><br />
<br />
keypairs=(''/path/to/''db.key ''/path/to/''db.crt)<br />
<br />
for (( i=0; i<${#keypairs[@]}; i+=2 )); do<br />
key="${keypairs[$i]}" cert="${keypairs[(( i + 1 ))]}"<br />
if ! sbverify --cert "$cert" "$uki" &>/dev/null; then<br />
sbsign --key "$key" --cert "$cert" --output "$uki" "$uki"<br />
fi<br />
done<br />
}}<br />
<br />
Replace {{ic|''/path/to/''db.key}} and {{ic|''/path/to/''db.crt}} with the paths to the key pair you want to use for signing the image.<br />
<br />
==== Building the UKIs ====<br />
<br />
Finally, make sure that the directory for the UKIs exists and [[regenerate the initramfs]]. For example, for the ''linux'' preset:<br />
<br />
# mkdir -p ''esp''/EFI/Linux<br />
# mkinitcpio -p linux<br />
<br />
Optionally, remove any leftover {{ic|initramfs-*.img}} from {{ic|/boot}} or {{ic|/efi}}.<br />
<br />
=== kernel-install ===<br />
<br />
You can use [[systemd]]'s {{man|8|kernel-install}} script to automatically install kernels in the UKI format to the ''esp'' both for custom kernels and for kernel packages (installed using Pacman) by switching Pacman hooks from ''mkinitcpio'' to ''kernel-install''. <br />
<br />
{{ic|kernel-install}} is not an initramfs generator, but it is a framework where packages can hook into the installation/generation of kernels of the system, through its "plugin" system. During its execution it will call the proper initramfs generator of the system (i.e.: ''mkinitcpio''). The plugins are involved in kernel image/initramfs generation, signing, installation, etc. Packages that care about doing something during kernel installation can be notified by installing their own "plugin" for {{ic|kernel-install}}. (The "plugins" are located in {{ic|/usr/lib/kernel/install.d/}}.)<br />
<br />
There are configuration options like "layout" available that affect where and how the kernel is installed when {{ic|kernel-install}} is getting called.<br />
<br />
''mkinitcpio'' ships with a {{ic|kernel-install}} plugin that generates the appropriate image (a UKI image for layout=uki). Other programs, such as {{Pkg|sbctl}}, also ship with a {{ic|kernel-install}} plugin.<br />
<br />
To setup kernel-install to produce UKIs:<br />
<br />
* Set the kernel-install layout to 'uki'. e.g.: {{bc|1=# echo "layout=uki" >> /etc/kernel/install.conf}}<br />
* Mask the direct kernel installation Pacman hooks:{{bc|<nowiki># ln -s /dev/null /etc/pacman.d/hooks/60-mkinitcpio-remove.hook<br />
# ln -s /dev/null /etc/pacman.d/hooks/90-mkinitcpio-install.hook<br />
</nowiki>}}<br />
* Create a Pacman hook for ''kernel-install''. You can use {{AUR|pacman-hook-kernel-install}}.<br />
* Remove and reinstall the kernel packages that you use.<br />
<br />
=== dracut ===<br />
<br />
See [[dracut#Unified kernel image]] and [[dracut#Generate a new initramfs on kernel upgrade]].<br />
<br />
=== sbctl ===<br />
<br />
[[Install]] the {{Pkg|sbctl}} package. Store the kernel command line in {{ic|/etc/kernel/cmdline}}. Use the {{ic|sbctl bundle}} command with the {{ic|--save}} parameter to create a bundle and have it be regenerated by a Pacman hook at appropriate times:<br />
<br />
# sbctl bundle --save ''esp''/EFI/Linux/arch-linux.efi<br />
<br />
To create more EFI binaries for other kernels and initramfs images, repeat the above command with parameters {{ic|--kernel-img}} and {{ic|--initramfs}}, see {{man|8|sbctl|EFI BINARY COMMANDS}}. The EFI binaries can be regenerated at any time with {{ic|sbctl generate-bundles}}.<br />
<br />
=== ukify ===<br />
<br />
[[Install]] the {{Pkg|systemd-ukify}} package. Since ''ukify'' cannot generate an initramfs on its own, if required, it must be generated using [[dracut]], [[mkinitcpio]] or [[booster]].<br />
<br />
A minimal working example can look something like this:<br />
<br />
# /usr/lib/systemd/ukify build --linux=''/boot/vmlinuz-linux'' --initrd=''/boot/intel-ucode.img'' \<br />
--initrd=''/boot/initramfs-linux.img'' \<br />
--cmdline="''quiet rw''"<br />
<br />
{{Note|If [[Microcode#Early loading|external microcode initramfs images]] are used ({{ic|/boot/amd-ucode.img}} or {{ic|/boot/intel-ucode.img}}), they must always be placed '''first''', before the main initramfs image (e.g. {{ic|/boot/initramfs-linux.img}}).}}<br />
<br />
Then, copy the resulting file to the EFI system partition:<br />
<br />
# cp ''filename''.efi ''esp''/EFI/Linux/<br />
<br />
{{Tip|<br />
* To skip having copy over the resulting EFI executable to the EFI System Partition, use the {{ic|--output{{=}}''esp''/EFI/Linux/''filename''.efi}} command line option to ''ukify''.<br />
* When specifying the {{ic|--cmdline}} option, one can specify a file name to read the kernel parameters from (e.g. {{ic|/etc/kernel/cmdline}} by adding the {{ic|@}} symbol before the file name, like {{ic|--cmdline{{=}}@''/path/to/cmdline''}}.<br />
}}<br />
<br />
An example for automatic UKI building with a systemd service for normal kernel image with intel ucode and /efi mounted ESP:<br />
<br />
{{hc|/etc/ukify.conf|2=<br />
[UKI]<br />
Linux=/boot/vmlinuz-linux<br />
Initrd=/boot/intel-ucode.img /boot/initramfs-linux.img<br />
Cmdline=@/etc/kernel/cmdline<br />
OSRelease=@/etc/os-release<br />
Splash=/usr/share/systemd/bootctl/splash-arch.bmp<br />
}}<br />
<br />
{{Note|If the initramfs generator already bundles CPU microcode by default, then only specify the initramfs image in {{ic|1=Initrd=/boot/initramfs-linux.img}}.}}<br />
<br />
{{Accuracy|section=Automatic update of ukify-generated images via systemd path units is unreliable|Automatic update of ukify-generated images via systemd path units is unreliable}}<br />
<br />
{{hc|/etc/systemd/system/run_ukify.service|2=<br />
[Unit]<br />
Description=Run systemd ukify<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/lib/systemd/ukify build --config=/etc/ukify.conf --output ''esp''/EFI/Linux/archlinux-linux.efi<br />
}}<br />
<br />
{{hc|/etc/systemd/system/run_ukify.path|2=<br />
[Unit]<br />
Description=Run systemd ukify<br />
[Path]<br />
PathChanged=/boot/initramfs-linux.img<br />
PathChanged=/boot/intel-ucode.img<br />
Unit=run_ukify.service<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
Then [[enable]] {{ic|run_ukify.path}}.<br />
<br />
=== Manually ===<br />
<br />
Put the kernel command line you want to use in a file, and create the bundle file using {{man|1|objcopy}}.<br />
<br />
For [[microcode]], first concatenate the microcode file and your initrd, as follows:<br />
<br />
$ cat ''esp''/''cpu_manufacturer''-ucode.img ''esp''/initramfs-linux.img > /tmp/combined_initrd.img<br />
<br />
When building the unified kernel image, pass in {{ic|/tmp/combined_initrd.img}} as the initrd. This file can be removed afterwards.<br />
<br />
{{Note|For [[Unified Extensible Firmware Interface#UEFI firmware bitness|IA32 UEFI]], replace {{ic|/usr/lib/systemd/boot/efi/linuxx64.efi.stub}} with {{ic|/usr/lib/systemd/boot/efi/linuxia32.efi.stub}} in the following commands.}}<br />
<br />
{{bc|1=<br />
$ align="$(objdump -p /usr/lib/systemd/boot/efi/linuxx64.efi.stub {{!}} awk '{ if ($1 == "SectionAlignment"){print $2} }')"<br />
$ align=$((16#$align))<br />
$ osrel_offs="$(objdump -h "/usr/lib/systemd/boot/efi/linuxx64.efi.stub" {{!}} awk 'NF==7 {size=strtonum("0x"$3); offset=strtonum("0x"$4)} END {print size + offset}')"<br />
$ osrel_offs=$((osrel_offs + "$align" - osrel_offs % "$align"))<br />
$ cmdline_offs=$((osrel_offs + $(stat -Lc%s "/usr/lib/os-release")))<br />
$ cmdline_offs=$((cmdline_offs + "$align" - cmdline_offs % "$align"))<br />
$ splash_offs=$((cmdline_offs + $(stat -Lc%s "/etc/kernel/cmdline")))<br />
$ splash_offs=$((splash_offs + "$align" - splash_offs % "$align"))<br />
$ initrd_offs=$((splash_offs + $(stat -Lc%s "/usr/share/systemd/bootctl/splash-arch.bmp")))<br />
$ initrd_offs=$((initrd_offs + "$align" - initrd_offs % "$align"))<br />
$ linux_offs=$((initrd_offs + $(stat -Lc%s "''initrd-file''")))<br />
$ linux_offs=$((linux_offs + "$align" - linux_offs % "$align"))<br />
<br />
$ objcopy \<br />
--add-section .osrel="/usr/lib/os-release" --change-section-vma .osrel=$(printf 0x%x $osrel_offs) \<br />
--add-section .cmdline="/etc/kernel/cmdline" \<br />
--change-section-vma .cmdline=$(printf 0x%x $cmdline_offs) \<br />
--add-section .splash="/usr/share/systemd/bootctl/splash-arch.bmp" \<br />
--change-section-vma .splash=$(printf 0x%x $splash_offs) \<br />
--add-section .initrd="''initrd-file''" \<br />
--change-section-vma .initrd=$(printf 0x%x $initrd_offs) \<br />
--add-section .linux="''vmlinuz-file''" \<br />
--change-section-vma .linux=$(printf 0x%x $linux_offs) \<br />
"/usr/lib/systemd/boot/efi/linuxx64.efi.stub" "''linux''.efi"<br />
}}<br />
<br />
A few things to note:<br />
<br />
* The offsets are dynamically calculated so no sections overlap, as recommended in [https://github.com/systemd/systemd/commit/0fa2cac4f0cdefaf1addd7f1fe0fd8113db9360b#commitcomment-76747223].<br />
* The sections are aligned to what the {{ic|SectionAlignment}} field of the PE stub indicates (usually 0x1000).<br />
* The kernel image must be in the last section, to prevent in-place decompression from overwriting the sections that follow, as stated in [https://github.com/systemd/systemd/commit/0fa2cac4f0cdefaf1addd7f1fe0fd8113db9360b#commitcomment-84868898].<br />
<br />
After creating the image, copy it to the EFI system partition:<br />
<br />
# cp ''linux''.efi ''esp''/EFI/Linux/<br />
<br />
== Booting ==<br />
<br />
{{Note|When [[Secure Boot]] is active, unified kernel images with an embedded {{ic|.cmdline}} ignore all command line options passed to them (either using a boot entry or interactively). When Secure Boot is not active, the options passed via the command line override the embedded {{ic|.cmdline}}.}}<br />
<br />
=== systemd-boot ===<br />
<br />
[[systemd-boot#Unified kernel images|systemd-boot]] searches in {{ic|''esp''/EFI/Linux/}} for unified kernel images, and there is no further configuration needed. See {{man|7|sd-boot|FILES}} <br />
<br />
=== rEFInd ===<br />
<br />
[[rEFInd]] will autodetect unified kernel images on your EFI system partition, and is capable of loading them. They can also be manually specified in {{ic|refind.conf}}, by default located at:<br />
<br />
{{hc|''esp''/EFI/refind/refind.conf|2=<br />
menuentry "Arch Linux" {<br />
icon \EFI\refind\icons\os_arch.png<br />
ostype Linux<br />
loader \EFI\Linux\arch-linux.efi<br />
}<br />
}}<br />
<br />
Recall that no kernel parameters from {{ic|''esp''/EFI/refind_linux.conf}} will be passed when booting this way. If the UKI was generated without a {{ic|.cmdline}} section, specify the kernel parameters in the menu entry with an {{ic|options}} line.<br />
<br />
=== GRUB ===<br />
<br />
Similar to rEFInd, [[GRUB]] can chainload EFI UKIs as described in [[GRUB#Chainloading a unified kernel image]].<br />
<br />
=== Directly from UEFI ===<br />
<br />
[[efibootmgr]] can be used to create a UEFI boot entry for the ''.efi'' file:<br />
<br />
# efibootmgr --create --disk /dev/sd''X'' --part ''partition_number'' --label "Arch Linux" --loader '\EFI\Linux\arch-linux.efi' --unicode<br />
<br />
See {{man|8|efibootmgr}} for an explanation of the options.<br />
<br />
== See also ==<br />
<br />
* [https://uapi-group.org/specifications/specs/unified_kernel_image/ Unified kernel image specification]<br />
* [https://linderud.dev/blog/mkinitcpio-v31-and-uefi-stubs/ mkinitcpio v31 and UEFI stubs]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=LDAP_authentication&diff=788393LDAP authentication2023-09-25T16:13:28Z<p>Snakeroot: glibc 2.38-4 removed nscd</p>
<hr />
<div>[[Category:Networking]]<br />
[[Category:Authentication]]<br />
[[ja:LDAP 認証]]<br />
{{Related articles start}}<br />
{{Related|OpenLDAP}}<br />
{{Related|LDAP Hosts}}<br />
{{Related|Identity management}}<br />
{{Related articles end}}<br />
<br />
This is a guide on how to configure an Arch Linux installation to authenticate against an LDAP directory. This LDAP directory can be either local (installed on the same computer) or network (e.g. in a lab environment where central authentication is desired).<br />
<br />
The guide is divided into two parts. The first part deals with how to setup an [[OpenLDAP]] server that hosts the authentication directory. The second part deals with how to setup the NSS and PAM modules that are required for the authentication scheme to work on the client computers. If you just want to configure Arch to authenticate against an already existing LDAP server, you can skip to the [[#Client setup|second part]].<br />
<br />
; Terminology<br />
<br />
NSS (which stands for Name Service Switch) is a system mechanism to configure different sources for common configuration databases. For example, {{ic|/etc/passwd}} is a {{ic|file}} type source for the {{ic|passwd}} database.<br />
<br />
[[PAM]] (which stands for Pluggable Authentication Modules) is a mechanism used by Linux (and most *nixes) to extend its authentication schemes based on different plugins.<br />
<br />
So to summarize, we need to configure NSS to use the OpenLDAP server as a source for the {{ic|passwd}}, {{ic|shadow}} and other configuration databases and then configure PAM to use these sources to authenticate its users.<br />
<br />
== LDAP server setup ==<br />
<br />
=== Installation ===<br />
<br />
[[OpenLDAP#Installation|Install the OpenLDAP server]] and configure the [[OpenLDAP#The server|server]] and [[OpenLDAP#The client|client]]. After you have completed that, return here.<br />
<br />
=== Set up access controls ===<br />
<br />
To make sure that no-one can read the (encrypted) passwords from the LDAP server, but still allowing users to edit some of their own select attributes (such as own password and photo), create the temporary LDIF {{ic|allowpwchange.ldif}}<br />
{{note|Alter the domain components "example" and "org" to your needs}}<br />
<br />
{{bc|1=<br />
dn: olcDatabase={1}mdb,cn=config<br />
changetype: modify<br />
replace: olcAccess<br />
olcAccess: {0}to attrs=cn,givenName,sn,userPassword,shadowLastChange,mail,loginShell,photo by self write by anonymous auth by dn.base="cn=Manager,dc=example,dc=org" write by * none<br />
olcAccess: {1}to * by self read by dn.base="cn=Manager,dc=example,dc=org" write by * read<br />
}}<br />
<br />
Import it on database number 0 (cn=config):<br />
<br />
$ slapmodify -n 0 -l allowpwchange.ldif<br />
<br />
Then [[restart]] {{ic|slapd.service}} afterwards.<br />
<br />
=== Populate LDAP tree with base data ===<br />
<br />
Create a temporary file called {{ic|base.ldif}} with the following text.<br />
<br />
{{hc|base.ldif|2=<br />
# example.org<br />
dn: dc=example,dc=org<br />
dc: example<br />
o: Example Organization<br />
objectClass: dcObject<br />
objectClass: organization<br />
<br />
# Manager, example.org<br />
dn: cn=Manager,dc=example,dc=org<br />
cn: Manager<br />
description: LDAP administrator<br />
objectClass: organizationalRole<br />
objectClass: top<br />
roleOccupant: dc=example,dc=org<br />
<br />
# People, example.org<br />
dn: ou=People,dc=example,dc=org<br />
ou: People<br />
objectClass: top<br />
objectClass: organizationalUnit<br />
<br />
# Groups, example.org<br />
dn: ou=Group,dc=example,dc=org<br />
ou: Group<br />
objectClass: top<br />
objectClass: organizationalUnit<br />
}}<br />
<br />
Add it to your OpenLDAP tree:<br />
<br />
$ ldapadd -D "cn=Manager,dc=example,dc=org" -W -f base.ldif<br />
<br />
Test to make sure the data was imported:<br />
<br />
$ ldapsearch -x -b 'dc=example,dc=org' '(objectclass=*)'<br />
<br />
=== Adding users ===<br />
<br />
To manually add a user, create an {{ic|.ldif}} file like this:<br />
<br />
{{hc|user_joe.ldif|<nowiki><br />
dn: uid=johndoe,ou=People,dc=example,dc=org<br />
objectClass: top<br />
objectClass: person<br />
objectClass: organizationalPerson<br />
objectClass: inetOrgPerson<br />
objectClass: posixAccount<br />
objectClass: shadowAccount<br />
uid: johndoe<br />
cn: John Doe<br />
sn: Doe<br />
givenName: John<br />
title: Guinea Pig<br />
telephoneNumber: +0 000 000 0000<br />
mobile: +0 000 000 0000<br />
postalAddress: AddressLine1$AddressLine2$AddressLine3<br />
userPassword: {CRYPT}xxxxxxxxxx<br />
labeledURI: https://archlinux.org/<br />
loginShell: /bin/bash<br />
uidNumber: 9999<br />
gidNumber: 9999<br />
homeDirectory: /home/johndoe/<br />
description: This is an example user<br />
</nowiki>}}<br />
<br />
The {{ic|xxxxxxxxxx}} in the {{ic|userPassword}} entry should be replaced with the value in {{ic|/etc/shadow}} or use the {{ic|slappasswd}} command. Now add the user:<br />
<br />
$ ldapadd -D "cn=Manager,dc=example,dc=org" -W -f user_joe.ldif<br />
<br />
You can add a group similarly with<br />
<br />
{{hc|group_joe.ldif|2=<br />
dn: cn=joe,ou=Group,dc=example,dc=org<br />
objectClass: top<br />
objectClass: posixGroup<br />
cn: joe<br />
gidNumber: 9999<br />
}}<br />
<br />
{{Note|You can automatically migrate all of your local accounts (and groups, etc.) to the LDAP directory using PADL Software's {{aur|openldap-migrationtools}}.}}<br />
<br />
== Client setup ==<br />
<br />
Install the OpenLDAP client as described in [[OpenLDAP]]. Make sure you can query the server with {{ic|ldapsearch}}.<br />
<br />
Depending on your target, choose either [[#Online authentication|online-only]] or [[#Online and offline authentication with SSSD|online and offline]] authentication.<br />
<br />
=== Online authentication ===<br />
<br />
==== NSS configuration ====<br />
<br />
NSS is a system facility which manages different sources as configuration databases. For example, {{ic|/etc/passwd}} is a {{ic|file}} type source for the {{ic|passwd}} database, which stores the user accounts.<br />
<br />
[[Install]] the {{pkg|nss-pam-ldapd}} package.<br />
<br />
Edit {{ic|/etc/nsswitch.conf}} which is the central configuration file for NSS. It tells NSS which sources to use for which system databases. We need to add the {{ic|ldap}} directive to the {{ic|passwd}}, {{ic|group}} and {{ic|shadow}} databases, so be sure your file looks like this:<br />
<br />
passwd: files ldap<br />
group: files ldap<br />
shadow: files ldap<br />
<br />
Edit {{ic|/etc/nslcd.conf}} and change the {{ic|base}} and {{ic|uri}} lines to fit your ldap server setup.<br />
<br />
Edit the {{ic|binddn}} and the {{ic|bindpw}} if your LDAP server requires a password. Make sure you change the permission of your {{ic|/etc/nslcd.conf}} to {{ic|0600}} for {{ic|nslcd}} to start properly.<br />
<br />
Start {{ic|nslcd.service}} using systemd.<br />
<br />
You now should see your LDAP users when running {{ic|getent passwd}} on the client.<br />
<br />
==== PAM configuration ====<br />
<br />
The basic rule of thumb for PAM configuration is to include {{ic|pam_ldap.so}} wherever {{ic|pam_unix.so}} is included. Arch moving to {{pkg|pambase}} has helped decrease the amount of edits required. For more details about configuring pam, the [https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Smart_Cards/PAM_Configuration_Files.html Red Hat Documentation] is quite good. You might also want the upstream documentation for [https://arthurdejong.org/nss-pam-ldapd/ nss-pam-ldapd].<br />
<br />
{{Tip|If you want to prevent UID clashes with local users on your system, you might want to include {{ic|1=minimum_uid=10000}} or similar on the end of the {{ic|pam_ldap.so}} lines. You will have to make sure the LDAP server returns uidNumber fields that match the restriction.}}<br />
<br />
{{Note|Each facility (auth, session, password, account) forms a separate chain and the order matters. Sufficient lines will sometimes "short circuit" and skip the rest of the section, so the rule of thumb for ''auth'', ''password'', and ''account'' is ''sufficient'' lines before ''required'', but after required lines for the ''session'' section; ''optional'' can almost always go at the end. When adding your {{ic|pam_ldap.so}} lines, do not change the relative order of the other lines without good reason! Simply insert LDAP within the chain.}}<br />
<br />
First edit {{ic|/etc/pam.d/system-auth}}. This file is included in most of the other files in {{ic|pam.d}}, so changes here propagate nicely. Updates to {{pkg|pambase}} may change this file.<br />
<br />
Make {{ic|pam_ldap.so}} sufficient at the top of each section, except in the ''session'' section, where we make it optional.<br />
<br />
{{hc|/etc/pam.d/system-auth|<br />
'''auth sufficient pam_ldap.so'''<br />
auth required pam_unix.so try_first_pass nullok<br />
auth optional pam_permit.so<br />
auth required pam_env.so<br />
<br />
'''account sufficient pam_ldap.so'''<br />
account required pam_unix.so<br />
account optional pam_permit.so<br />
account required pam_time.so<br />
<br />
'''password sufficient pam_ldap.so'''<br />
password required pam_unix.so try_first_pass nullok sha512 shadow<br />
password optional pam_permit.so<br />
<br />
session required pam_limits.so<br />
session required pam_unix.so<br />
'''session optional pam_ldap.so'''<br />
session optional pam_permit.so<br />
}}<br />
<br />
Then edit both {{ic|/etc/pam.d/su}} and {{ic|/etc/pam.d/su-l}} identically. The {{ic|su-l}} file is used when the user runs {{ic|su --login}}.<br />
<br />
Make {{ic|pam_ldap.so}} sufficient at the top of each section but below {{ic|pam_rootok}}, and add {{ic|use_first_pass}} to {{ic|pam_unix}} in the ''auth'' section.<br />
<br />
{{hc|/etc/pam.d/su|<br />
#%PAM-1.0<br />
auth sufficient pam_rootok.so<br />
'''auth sufficient pam_ldap.so'''<br />
# Uncomment the following line to implicitly trust users in the "wheel" group.<br />
#auth sufficient pam_wheel.so trust use_uid<br />
# Uncomment the following line to require a user to be in the "wheel" group.<br />
#auth required pam_wheel.so use_uid<br />
auth required pam_unix.so '''use_first_pass'''<br />
'''account sufficient pam_ldap.so'''<br />
account required pam_unix.so<br />
'''session sufficient pam_ldap.so'''<br />
session required pam_unix.so<br />
}}<br />
<br />
To enable users to edit their password, edit {{ic|/etc/pam.d/passwd}}:<br />
<br />
{{hc|/etc/pam.d/passwd|2=<br />
#%PAM-1.0<br />
'''password sufficient pam_ldap.so'''<br />
password required pam_unix.so sha512 shadow nullok<br />
}}<br />
<br />
===== Create home folders at login =====<br />
<br />
If you want home folders to be created at login (eg: if you are not using NFS to store home folders), edit {{ic|/etc/pam.d/system-login}} and add {{ic|pam_mkhomedir.so}} to the ''session'' section above any "sufficient" items. This will cause home folder creation when logging in at a tty, from ssh, xdm, sddm, gdm, etc. You might choose to edit additional files in the same way, such as {{ic|/etc/pam.d/su}} and {{ic|/etc/pam.d/su-l}} to enable it for {{ic|su}} and {{ic|su --login}}. If you do not want to do this for ssh logins, edit {{ic|system-local-login}} instead of {{ic|system-login}}, etc.<br />
<br />
{{hc|/etc/pam.d/system-login|2=<br />
...top of file not shown...<br />
session optional pam_loginuid.so<br />
session include system-auth<br />
session optional pam_motd.so motd=/etc/motd<br />
session optional pam_mail.so dir=/var/spool/mail standard quiet<br />
-session optional pam_systemd.so<br />
session required pam_env.so<br />
'''session required pam_mkhomedir.so skel=/etc/skel umask=0077'''<br />
}}<br />
<br />
{{hc|/etc/pam.d/su-l|2=<br />
...top of file not shown...<br />
'''session required pam_mkhomedir.so skel=/etc/skel umask=0077'''<br />
session sufficient pam_ldap.so<br />
session required pam_unix.so<br />
}}<br />
<br />
===== Enable sudo =====<br />
<br />
To enable sudo from an LDAP user, edit {{ic|/etc/pam.d/sudo}}. You will also need to modify sudoers accordingly.<br />
<br />
{{hc|/etc/pam.d/sudo|<br />
#%PAM-1.0<br />
'''auth sufficient pam_ldap.so'''<br />
auth required pam_unix.so '''try_first_pass'''<br />
auth required pam_nologin.so<br />
}}<br />
<br />
You will also need to add in {{ic|/etc/openldap/ldap.conf}} the following:<br />
<br />
{{hc|/etc/openldap/ldap.conf|2=<br />
sudoers_base ou=sudoers,dc=example,dc=org<br />
}}<br />
<br />
=== Online and offline authentication with SSSD ===<br />
<br />
SSSD is a system daemon. Its primary function is to provide access to identity and authentication remote resource through a common framework that can provide caching and offline support to the system. It provides PAM and NSS modules, and in the future will D-BUS based interfaces for extended user information. It provides also a better database to store local users as well as extended user data.<br />
<br />
{{Note|You must configure [[OpenLDAP#OpenLDAP over TLS|StartTLS]] for your LDAP server, or SSSD will not work}}<br />
<br />
[[Install]] the {{pkg|sssd}} package.<br />
<br />
==== SSSD configuration ====<br />
<br />
If it does not exist create {{ic|/etc/sssd/sssd.conf}}.<br />
<br />
{{hc|/etc/sssd/sssd.conf|2=<br />
[sssd]<br />
config_file_version = 2<br />
services = nss, pam<br />
domains = LDAP<br />
<br />
[domain/LDAP]<br />
cache_credentials = true<br />
enumerate = true<br />
<br />
id_provider = ldap<br />
auth_provider = ldap<br />
<br />
ldap_uri = ldap://server1.example.org, ldap://server2.example.org<br />
ldap_search_base = dc=example,dc=org<br />
ldap_id_use_start_tls = true<br />
ldap_tls_reqcert = demand<br />
ldap_tls_cacert = /etc/openldap/certs/cacerts.pem<br />
chpass_provider = ldap<br />
ldap_chpass_uri = ldap://server1.example.org<br />
entry_cache_timeout = 600<br />
ldap_network_timeout = 2<br />
<br />
# OpenLDAP supports posixGroup, uncomment the following two lines<br />
# to get group membership support (and comment the other conflicting parameters)<br />
#ldap_schema = rfc2307<br />
#ldap_group_member = memberUid<br />
<br />
# Other LDAP servers may support this instead<br />
ldap_schema = rfc2307bis<br />
ldap_group_member = uniqueMember<br />
}}<br />
<br />
The above is an example only. See {{man|5|sssd.conf}} for the full details.<br />
<br />
Finally set the file permissions {{ic|chmod 600 /etc/sssd/sssd.conf}} otherwise sssd will fail to start.<br />
<br />
==== NSCD configuration ====<br />
{{Out of date|Still references {{ic|nscd}}.}}<br />
Disable caching for passwd, group and netgroup entries in {{ic|/etc/nscd.conf}} as it will interfere with sssd caching.<br />
<br />
Keep caching enabled for hosts entries otherwise some services may fail to start.<br />
<br />
{{hc|/etc/nscd.conf|<br />
# Begin /etc/nscd.conf<br />
''[...]''<br />
enable-cache passwd '''no'''<br />
''[...]''<br />
enable-cache group '''no'''<br />
''[...]''<br />
enable-cache hosts yes<br />
''[...]''<br />
enable-cache netgroup '''no'''<br />
''[...]''<br />
# End /etc/nscd.conf<br />
}}<br />
<br />
==== NSS configuration ====<br />
<br />
Edit {{ic|/etc/nsswitch.conf}} as follows:<br />
<br />
{{hc|/etc/nsswitch.conf|<br />
# Begin /etc/nsswitch.conf<br />
<br />
passwd: files '''sss'''<br />
group: files '''sss'''<br />
shadow: files '''sss'''<br />
'''sudoers: files sss'''<br />
<br />
publickey: files<br />
<br />
hosts: files dns myhostname<br />
networks: files<br />
<br />
protocols: files<br />
services: files<br />
ethers: files<br />
rpc: files<br />
<br />
netgroup: files<br />
<br />
# End /etc/nsswitch.conf<br />
}}<br />
<br />
==== PAM configuration ====<br />
<br />
The first step is to edit {{ic|/etc/pam.d/system-auth}} as follows:<br />
<br />
{{hc|/etc/pam.d/system-auth|2=<br />
#%PAM-1.0<br />
<br />
'''auth sufficient pam_sss.so forward_pass'''<br />
auth required pam_unix.so try_first_pass nullok<br />
auth optional pam_permit.so<br />
auth required pam_env.so<br />
<br />
'''account [default=bad success=ok user_unknown=ignore authinfo_unavail=ignore] pam_sss.so'''<br />
account required pam_unix.so<br />
account optional pam_permit.so<br />
account required pam_time.so<br />
<br />
'''password sufficient pam_sss.so'''<br />
password required pam_unix.so try_first_pass nullok sha512 shadow<br />
password optional pam_permit.so<br />
<br />
'''session required pam_mkhomedir.so skel=/etc/skel/ umask=0077'''<br />
session required pam_limits.so<br />
session required pam_unix.so<br />
'''session optional pam_sss.so'''<br />
session optional pam_permit.so<br />
}}<br />
<br />
{{Note|If you happen to use [[GNOME/Keyring]]: adding 'sufficient' in the beginning of the PAM stack results in Gnome Keyring not being unlocked. For a solution, look at [https://wiki.gnome.org/Projects/GnomeKeyring/Pam#Advanced_configuration Advanced PAM Configuration].}}<br />
<br />
These PAM changes will apply to fresh login. To also allow the {{ic|su}} command to authenticate through SSSD, edit {{ic|/etc/pam.d/su}}:<br />
<br />
{{hc|/etc/pam.d/su|2=<br />
#%PAM-1.0<br />
auth sufficient pam_rootok.so<br />
<br />
'''auth sufficient pam_sss.so forward_pass'''<br />
auth required pam_unix.so<br />
<br />
'''account [default=bad success=ok user_unknown=ignore authinfo_unavail=ignore] pam_sss.so'''<br />
account required pam_unix.so<br />
<br />
session required pam_unix.so<br />
'''session optional pam_sss.so'''<br />
}}<br />
<br />
===== Enable sudo =====<br />
<br />
Edit {{ic|/etc/pam.d/sudo}} as follows:<br />
<br />
{{hc|/etc/pam.d/sudo|<br />
#%PAM-1.0<br />
'''auth sufficient pam_sss.so'''<br />
auth required pam_unix.so try_first_pass<br />
auth required pam_nologin.so<br />
}}<br />
<br />
Also add sudo service to the list of enabled services and the search base in {{ic|/etc/sssd/sssd.conf}}:<br />
<br />
{{hc|/etc/sssd/sssd.conf|2=<br />
[sssd]<br />
...<br />
services = nss, pam, '''sudo'''<br />
...<br />
<br />
[domain/LDAP]<br />
...<br />
ldap_sudo_search_base = ou=sudoers,dc=example,dc=org<br />
...<br />
}}<br />
<br />
Alternately, [[sudo#Configuration|configure sudo]] to allow the desired LDAP users to use ''sudo''.<br />
<br />
===== Password management =====<br />
<br />
For changing expired passwords when logging in using {{ic|su}} add a password entry to {{ic|/etc/pam.d/su}} if it is missing:<br />
<br />
{{hc|/etc/pam.d/su|2=<br />
#%PAM-1.0<br />
<br />
[...]<br />
<br />
auth include system-auth<br />
account include system-auth<br />
session include system-auth<br />
'''password include system-auth'''<br />
}}<br />
<br />
[[Start/enable]] {{ic|sssd.service}}.<br />
<br />
You should now be able to see details of your ldap users with {{ic|getent passwd ''username''}} or {{ic|id ''username''}}.<br />
<br />
Once you have logged in with a user the credentials will be cached and you will be able to login using the cached credentials when the ldap server is offline or unavailable.<br />
<br />
== See also ==<br />
<br />
* [https://arthurdejong.org/nss-pam-ldapd/setup The official page of the nss-pam-ldapd packet]<br />
* [[debian:LDAP/NSS|Debian Wiki - LDAP/NSS]]<br />
* [[debian:LDAP/PAM|Debian Wiki - LDAP/PAM]]<br />
* [https://www.fatofthelan.com/technical/using-ldap-for-single-authentication/ Using LDAP for single authentication]<br />
* [https://web.archive.org/web/20121027055009/http://www.cs.dixie.edu/ldap/ Heterogeneous Network Authentication Introduction]<br />
* [https://readlist.com/lists/suse.com/suse-linux-e/36/182642.html Discussion on suse's mailing lists about nss-pam-ldapd]<br />
* [https://docs.fedoraproject.org/en-US/Fedora/15/html/Deployment_Guide/chap-SSSD_User_Guide-Introduction.html Fedora's SSSD User Guide]{{Dead link|2023|04|23|status=404}}</div>Snakeroothttps://wiki.archlinux.org/index.php?title=LDAP_Hosts&diff=788392LDAP Hosts2023-09-25T16:10:30Z<p>Snakeroot: glibc 2.38-4 removed nscd</p>
<hr />
<div>[[Category:Networking]]<br />
[[ja:LDAP ホスト]]<br />
{{Style|Written in first person and like a blog post.}}<br />
{{Out of date|Still references {{ic|rc.d}}.}}<br />
{{Related articles start}}<br />
{{Related|OpenLDAP}}<br />
{{Related|LDAP Authentication}}<br />
{{Related articles end}}<br />
<br />
This document will allow you to put your /etc/hosts into your LDAP server. At first make sure you have an LDAP server up and running (take [[LDAP authentication]] as an introduction). Next you need to create a proper ldif file from /etc/hosts. Actually mine is like:<br />
{{bc|<br />
127.0.0.1 localhost<br />
192.168.1.1 gojira.marex.local gojira<br />
192.168.1.50 gamera.marex.local gamera<br />
192.168.1.51 iris.marex.local iris<br />
192.168.1.52 zedan.marex.local zedan<br />
}}<br />
Where 127.0.0.1 is localhost (of course), 192.168.1.1 is the LDAP server, followed by at least 3 workstation (gamera, iris & zedan). For a ldif file you need to create a ou for your hosts and each host (I will call the next file hosts.ldif):<br />
{{bc|1=<br />
dn: ou=Hosts,dc=marex,dc=local<br />
objectClass: organizationalUnit<br />
objectClass: top<br />
ou: Hosts<br />
<br />
dn: cn=gojira+ipHostNumber=192.168.1.1,ou=Hosts,dc=marex,dc=local<br />
objectClass: ipHost<br />
objectClass: device<br />
objectClass: top<br />
cn: gojira<br />
ipHostNumber: 192.168.1.1<br />
<br />
dn: cn=gamera+ipHostNumber=192.168.1.50,ou=Hosts,dc=marex,dc=local<br />
objectClass: ipHost<br />
objectClass: device<br />
objectClass: top<br />
cn: gamera<br />
ipHostNumber: 192.168.1.50<br />
<br />
dn: cn=iris+ipHostNumber=192.168.1.51,ou=Hosts,dc=marex,dc=local<br />
objectClass: ipHost<br />
objectClass: device<br />
objectClass: top<br />
cn: iris<br />
ipHostNumber: 192.168.1.51<br />
<br />
dn: cn=zedan+ipHostNumber=192.168.1.52,ou=Hosts,dc=marex,dc=local<br />
objectClass: ipHost<br />
objectClass: device<br />
objectClass: top<br />
cn: zedan<br />
ipHostNumber: 192.168.1.52<br />
}}<br />
Next put the file into your LDAP server with your credentials (output truncated):<br />
{{bc|1=<br />
$ ldapadd -x -W -D 'cn=ldapadmin,dc=marex,dc=local' -h 192.168.1.1 -p 389 -f hosts.ldif<br />
...<br />
adding new entry "cn=zedan+ipHostNumber=192.168.1.52,ou=Hosts,dc=marex,dc=local"<br />
}}<br />
If everything filled up then edit your /etc/nss_ldap.conf and change the line beginning with nss_base_hosts to the following:<br />
{{bc|1=<br />
nss_base_hosts ou=Hosts,dc=marex,dc=local?one<br />
}}<br />
Now change the /etc/hosts in that way that only localhost, the LDAP server and the own name of the workstation exist. An example how it could look on the workstation gamera:<br />
{{bc|<br />
127.0.0.1 localhost<br />
192.168.1.1 gojira.marex.local gojira<br />
192.168.1.50 gamera.marex.local gamera<br />
}}<br />
On the LDAP server you can ignore every workstation. Finally you need to edit the hosts entry in your /etc/nsswitch.conf:<br />
{{bc|<br />
hosts: files dns ldap<br />
}}<br />
Now test your configuration:<br />
{{bc|<br />
$ getent hosts<br />
127.0.0.1 localhost<br />
192.168.1.1 gojira.marex.local gojira<br />
192.168.1.50 gamera.marex.local gamera<br />
192.168.1.1 gojira<br />
192.168.1.50 gamera<br />
192.168.1.51 iris<br />
192.168.1.52 zedan<br />
}}<br />
{{Out of date|Still references {{ic|nscd}}.}}<br />
The first 3 lines are from /etc/hosts, the last 4 lines are from your LDAP server. Finally to get ping working with LDAP you need to start nscd:<br />
{{bc|<br />
$ mkdir -p /var/db/nscd<br />
$ mkdir -p /var/run/nscd<br />
$ /etc/rc.d/nscd start<br />
$ ping iris<br />
PING iris (192.168.1.51) 56(84) bytes of data.<br />
...<br />
}}</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=782004Lenovo ThinkPad T14 (AMD) Gen 22023-06-26T15:28:28Z<p>Snakeroot: Reflect addition of guided mode in kernel 6.4</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || {{ic|1022:15df}} || {{Yes}}<br />
|-<br />
| Smartcard reader || {{ic|058f:9540}} || {{Yes}}<br />
|-<br />
| NFC reader || ??? || {{No}}<br />
|-<br />
| SIM || ??? || {{No}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam, the fingerprint reader and the NVMe controller.<br />
<br />
=== November 2021 security update ===<br />
<br />
On November 4, 2021 Lenovo pushed System Firmware Version 1.12, a UEFI/BIOS update, to LVFS. This is described as a security update (although without further detail). See [https://fwupd.org/lvfs/devices/com.lenovo.ThinkPadR1MET.firmware LVFS page for this update].<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
Note that keeping the Microsoft Certificates should not brick the machine.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{hc|$ lspci {{!}} grep Ethernet|<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)<br />
}}<br />
<br />
{{ic|enp5s0}} is the RJ45 port. {{ic|enp2s0f0}} is the proprietary connector next to the 2nd USB Type-C port for use in the ''Lenovo ThinkPad Ultra Docking Station'' or with a ''Lenovo ThinkPad Ethernet Extension Cable Gen 2'' cable.<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
{{hc|$ ip link|<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
4: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
== Unreliable mic mute LED ==<br />
<br />
The mic mute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per the [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 relevant thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics touchpad RMI bus non-functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see the [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 relevant thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Freezing Trackpad ==<br />
<br />
The trackpad may freeze randomly. The cure is to unload the psmouse module with ''rmmod'' and reload it with ''modprobe''.<br />
<br />
== Fingerprint reader unavailable after suspend ==<br />
<br />
There have been reports that while the fingerprint reader works well with fprintd after a cold start (including wake from hibernation) it vanishes from the list of available devices after sleep or suspend. As of July 2022, with the latest system firmware updates applied, this issue now seems to be resolved.<br />
<br />
== AMD P-State ==<br />
<br />
Starting with kernel 5.17, AMD processors should have more finesse in frequency control due to the inclusion of the AMD p-states driver. Starting with kernel 6.3, the AMD p-states driver provides EPP (energy preference performance) which provides a hint to the hardware if software wants to bias toward performance or energy efficiency. Starting with kernel 6.4, the AMD p-states driver provides a guided mode in which the driver requests minimum and maximum performance level and firmware autonomously selects a performance level in this range and appropriate to the current workload.<br />
<br />
Unfortunately, the {{ic|acpi_cprufreq}} driver does not play well with others. To get it working: <br />
<br />
* Blacklist {{ic|acpi_cpufreq}} by adding the entry {{ic|acpi_cpufreq}} to the {{ic|/etc/modprobe.d/blacklist.conf}} file; <br />
* Add {{ic|amd_pstate{{=}}passive}}, {{ic|amd_pstate{{=}}active}} or {{ic|amd_pstate{{=}}guided}} to your kernel boot options.<br />
<br />
Confirm if it has worked by running {{ic|cpupower frequency-info}} to confirm the driver being used. You can also load the {{ic|amd_pstate_ut}} module and review dmesg to confirm that the driver passed the relevant tests.<br />
<br />
Note that the amd_pstate driver is now a boolean option in the kernel configuration and can no longer be built as a module.<br />
<br />
For those using TLP to manage power, AMD p-state performance is slated for inclusion in the 1.06 release. For the impatient, switch to {{AUR|tlp-git}} in the AUR.<br />
<br />
== Sleep mode (S3) ==<br />
<br />
Sleep mode and, in particular, the lid switch are slow and flaky unless the sleep mode is set to ''Linux'' rather than ''Windows 10'' in the UEFI. Be sure that you have logged out of, rather than suspending, any Windows installation before changing this. <br />
<br />
See [[Power management/Suspend and hibernate]] for more details.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=AppArmor&diff=780809AppArmor2023-06-10T17:19:55Z<p>Snakeroot: Grammar</p>
<hr />
<div>[[Category:Access control]]<br />
[[Category:Kernel]]<br />
[[ja:AppArmor]]<br />
{{Related articles start}}<br />
{{Related|Security}}<br />
{{Related|SELinux}}<br />
{{Related|TOMOYO Linux}}<br />
{{Related articles end}}<br />
[https://apparmor.net/ AppArmor] is a [[Mandatory Access Control]] (MAC) system, implemented upon the [[Wikipedia:Linux_Security_Modules|Linux Security Modules]] (LSM).<br />
<br />
AppArmor, like most other LSMs, supplements rather than replaces the default Discretionary Access Control (DAC). As such it is impossible to grant a process more privileges than it had in the first place. <br />
<br />
Ubuntu, SUSE and a number of other distributions use it by default. RHEL (and its variants) use SELinux which requires good userspace integration to work properly. SELinux attaches labels to all files, processes and objects and is therefore very flexible. However configuring SELinux is considered to be very complicated and requires a supported filesystem. AppArmor on the other hand works using file paths and its configuration can be easily adapted.<br />
<br />
AppArmor proactively protects the operating system and applications from external or internal threats and even zero-day attacks by enforcing a specific rule set on a per application basis. Security policies completely define what system resources individual applications can access, and with what privileges. Access is denied by default if no profile says otherwise. A few default policies are included with AppArmor and using a combination of advanced static analysis and learning-based tools, AppArmor policies for even very complex applications can be deployed successfully in a matter of hours.<br />
<br />
Every breach of policy triggers a message in the system log, and AppArmor can be configured to notify users with real-time violation warnings popping up on the desktop.<br />
<br />
== Installation ==<br />
<br />
AppArmor is available in all [[Kernel#Officially supported kernels|officially supported kernels]].<br />
<br />
[[Install]] {{Pkg|apparmor}} for userspace tools and libraries to control AppArmor. To load all AppArmor profiles on startup, [[enable]] {{ic|apparmor.service}}.<br />
<br />
To enable AppArmor as default security model on every boot, set the following [[kernel parameter]]:<br />
<br />
lsm=landlock,lockdown,yama,integrity,apparmor,bpf<br />
<br />
{{Note|The {{ic|1=lsm=}} kernel parameter sets the initialization order of Linux security modules. The kernel's configured {{ic|1=lsm=}} value can be found with {{ic|1=zgrep CONFIG_LSM= /proc/config.gz}} and the current value with {{ic|cat /sys/kernel/security/lsm}}.<br />
* Make sure that {{ic|apparmor}} is the first "major" module in the list.[https://docs.kernel.org/admin-guide/LSM/index.html] Examples of valid values and their order can be found in [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/security/Kconfig security/Kconfig].<br />
* {{ic|capability}} should be omitted from {{ic|1=lsm=}} as it will always get included automatically.<br />
}}<br />
<br />
=== Custom kernel ===<br />
<br />
When [[Kernels#Compilation|compiling the kernel]], it is required to set at least the following options:<br />
<br />
CONFIG_SECURITY_APPARMOR=y<br />
CONFIG_AUDIT=y<br />
<br />
To enable the AppArmor Linux security model by default and omit the need to set kernel parameters, additionally set the {{ic|CONFIG_LSM}} option and specify {{ic|apparmor}} as the first "major" module in the list:<br />
<br />
CONFIG_LSM="landlock,lockdown,yama,integrity,apparmor,bpf"<br />
<br />
== Usage ==<br />
<br />
=== Display current status ===<br />
<br />
To test if AppArmor has been correctly enabled:<br />
<br />
{{hc|$ aa-enabled|<br />
Yes<br />
}}<br />
<br />
To display the current loaded status use {{man|8|aa-status}}:<br />
<br />
{{hc|# aa-status|<br />
apparmor module is loaded.<br />
44 profiles are loaded.<br />
44 profiles are in enforce mode.<br />
...<br />
0 profiles are in complain mode.<br />
0 processes have profiles defined.<br />
0 processes are in enforce mode.<br />
0 processes are in complain mode.<br />
0 processes are unconfined but have a profile defined.<br />
}}<br />
<br />
=== Parsing profiles ===<br />
<br />
To load (enforce or complain), unload, reload, cache and stat profiles use {{ic|apparmor_parser}}. The default action ({{ic|-a}}) is to load a new profile in enforce mode, loading it in complain mode is possible using the {{ic|-C}} switch, in order to overwrite an existing profile use the {{ic|-r}} option and to remove a profile use {{ic|-R}}. Each action may also apply to multiple profiles. Refer to {{man|8|apparmor_parser}} man page for more information.<br />
<br />
=== Disabling loading ===<br />
<br />
Disable AppArmor by unloading all profiles for the current session:<br />
<br />
# aa-teardown <br />
<br />
To prevent AppArmor profiles from loading at the next boot [[disable]] {{ic|apparmor.service}}. To prevent the kernel from loading AppArmor, remove the {{ic|1=lsm=}} [[kernel parameter]] that was added when [[#Installation|setting up AppArmor]].<br />
<br />
== Configuration ==<br />
<br />
=== Auditing and generating profiles ===<br />
<br />
To create new profiles the [[Audit framework]] should be running. This is because Arch Linux adopted [[systemd]] and does not do kernel logging to file by default. AppArmor can grab kernel audit logs from the userspace auditd daemon, allowing you to build a profile.<br />
<br />
New AppArmor profiles can be created by utilizing {{man|8|aa-genprof}} or {{man|8|aa-autodep}}. The profile is first created in ''complain mode'': in this mode policy violations are only reported but not enforced. The rules are interactively created by the {{man|8|aa-logprof}} tool available in {{pkg|apparmor}} package. Finally the profile should be set into ''enforce mode'' with {{man|8|aa-enforce}}. In this mode the policy defined by the rules in the respecting profile are enforced. If necessary, additional rules can be added by repeatedly executing {{man|8|aa-logprof}}, or the profile can be set back to complain mode with {{man|8|aa-complain}}. Detailed guide about using those tools is available at [https://gitlab.com/apparmor/apparmor/wikis/Profiling_with_tools AppArmor wiki - Profiling with tools].<br />
<br />
Note that {{man|8|aa-logprof}} also offers ''deny'' rules which are actually not strictly necessary as according to the basic AppArmor logic everything is forbidden which is not explicitly allowed by a rule. However, ''deny'' rules serve two purposes:<br />
<br />
# ''deny'' rules take precedence over ''allow'' rules. They are often used in many [https://man.archlinux.org/man/extra/apparmor/apparmor.d.5.en##include_mechanism abstractions] located in {{ic|/etc/apparmor.d/abstractions}} in order to block any access to important folders/files. This makes sure that inadvertently created allow rules do not make a profile too permissive.<br />
# ''deny'' rules silence logging and make subsequent runs of ''aa-logprof'' less noisy. It is important to keep in mind that ''deny'' rules are enforced also in ''complain mode'' - hence, if an application does not work properly even in complain mode it should be checked if a deny rule in the profile or in one of the included abstractions is the culprit.<br />
<br />
Alternatively profiles may be also created manually, see guide available at [https://gitlab.com/apparmor/apparmor/wikis/Profiling_by_hand AppArmor wiki - Profiling by hand].<br />
<br />
In addition to the default profiles in {{ic|/etc/apparmor.d/}}, there are more predefined profiles in {{ic|/usr/share/apparmor/extra-profiles/}}. Note that those are not necessarily deemed production-ready, so manual intervention or usage of {{man|8|aa-logprof}} may be required.<br />
<br />
=== Understanding profiles ===<br />
<br />
Profiles are human readable text files residing under {{ic|/etc/apparmor.d/}} describing how binaries should be treated when executed. A basic profile looks similar to this:<br />
<br />
{{hc|/etc/apparmor.d/usr.bin.test|<br />
#include <tunables/global><br />
<br />
profile test /usr/lib/test/test_binary {<br />
#include <abstractions/base><br />
<br />
# Main libraries and plugins<br />
/usr/share/TEST/** r,<br />
/usr/lib/TEST/** rm,<br />
<br />
# Configuration files and logs<br />
@{HOME}/.config/ r,<br />
@{HOME}/.config/TEST/** rw,<br />
}<br />
}}<br />
<br />
Strings preceded by a {{ic|@}} symbol are variables defined by abstractions ({{ic|/etc/apparmor.d/abstractions/}}), tunables ({{ic|/etc/apparmor.d/tunables/}}) or by the profile itself. {{ic|#include}} includes other profile-files directly. Paths followed by a set of characters are [https://man.archlinux.org/man/extra/apparmor/apparmor.d.5.en#Access_Modes access permissions]. Pattern matching is done using [https://man.archlinux.org/man/extra/apparmor/apparmor.d.5.en#Globbing AppArmor's globbing syntax].<br />
<br />
Most common use cases are covered by the following statements:<br />
<br />
* {{ic|r}} — read: read data<br />
* {{ic|w}} — write: create, delete, write to a file and extend it<br />
* {{ic|m}} — memory map executable: memory map a file executable<br />
* {{ic|x}} — execute: execute file; needs to be preceded by a [https://gitlab.com/apparmor/apparmor/wikis/AppArmor_Core_Policy_Reference#execute-rules qualifier]<br />
<br />
Remember that those permission do not allow binaries to exceed the permission dictated by the Discretionary Access Control (DAC).<br />
<br />
This is merely a short overview, for a more detailed guide be sure to have a look at the {{man|5|apparmor.d}} man page and [https://gitlab.com/apparmor/apparmor/wikis/AppArmor_Core_Policy_Reference documentation].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Get desktop notification on DENIED actions ===<br />
<br />
The notification daemon displays desktop notifications whenever AppArmor denies a program access. To automatically start ''aa-notify'' daemon on login follow below steps:<br />
<br />
Install the [[Audit framework]] and enable and start the userspace Linux Audit daemon. Allow your desktop user to read audit logs in {{ic|/var/log/audit}} by adding it to {{ic|audit}} [[user group]]:<br />
<br />
# groupadd -r audit<br />
# gpasswd -a ''user'' audit<br />
<br />
Add {{ic|audit}} group to {{ic|auditd.conf}}:<br />
{{hc|/etc/audit/auditd.conf|2=<br />
log_group = audit<br />
}}<br />
<br />
{{Tip|You may use other already existing system groups like {{ic|wheel}} or {{ic|adm}}.}}<br />
<br />
[[Install]] {{Pkg|python-notify2}} and {{Pkg|python-psutil}}.<br />
<br />
Create a [[desktop launcher]] with the below content:<br />
<br />
{{hc|~/.config/autostart/apparmor-notify.desktop|2=<br />
[Desktop Entry]<br />
Type=Application<br />
Name=AppArmor Notify<br />
Comment=Receive on screen notifications of AppArmor denials<br />
TryExec=aa-notify<br />
Exec=aa-notify -p -s 1 -w 60 -f /var/log/audit/audit.log<br />
StartupNotify=false<br />
NoDisplay=true<br />
}}<br />
<br />
Reboot and check if the {{ic|aa-notify}} process is running:<br />
<br />
$ pgrep -ax aa-notify<br />
<br />
{{Note|Depending on your specific system configuration there could be A LOT of notifications displayed.}}<br />
<br />
For more information, see {{man|8|aa-notify}}.<br />
<br />
=== Speed-up AppArmor start by caching profiles ===<br />
<br />
Since AppArmor has to translate the configured profiles into a binary format it may significantly increase the boot time. You can check current AppArmor startup time with:<br />
<br />
$ systemd-analyze blame | grep apparmor<br />
<br />
To enable caching AppArmor profiles, uncomment:<br />
<br />
{{hc|/etc/apparmor/parser.conf|2=<br />
## Turn creating/updating of the cache on by default<br />
write-cache<br />
}}<br />
<br />
To change default cache location add:<br />
<br />
{{hc|/etc/apparmor/parser.conf|2=<br />
cache-loc=/path/to/location<br />
}}<br />
<br />
{{Note|Since 2.13.1 default cache location is {{ic|/var/cache/apparmor/}}, previously it was {{ic|/etc/apparmor.d/cache.d/}}.}}<br />
<br />
Reboot and check AppArmor startup time again to see improvement:<br />
<br />
$ systemd-analyze blame | grep apparmor<br />
<br />
== Troubleshooting ==<br />
<br />
=== Failing to start Samba SMB/CIFS server ===<br />
<br />
See [[Samba#Permission issues on AppArmor]].<br />
<br />
=== No events caught by aa-logprof ===<br />
<br />
[[Audit framework]] logs may have the special character {{ic|0x1d}}[https://github.com/linux-audit/audit-userspace/issues/3]. There is a [https://gitlab.com/apparmor/apparmor/-/issues/271 AppArmor bug report], but a workaround is to run:<br />
<br />
# aa-logprof -f <(sed 's/\x1d.*//' < /var/log/audit/audit.log)<br />
<br />
== See also ==<br />
<br />
* [[Wikipedia:AppArmor]]<br />
* [https://gitlab.com/apparmor/apparmor/wikis/home AppArmor wiki]<br />
* [https://gitlab.com/apparmor/apparmor/wikis/AppArmor_Core_Policy_Reference AppArmor Core Policy Reference] — Detailed description of available options in a profile<br />
* [https://ubuntuforums.org/showthread.php?t=1008906 Ubuntu Tutorial] — General overview of available utilities and profile creation<br />
* [https://help.ubuntu.com/community/AppArmor Ubuntu Wiki] — Basic command overview<br />
* [https://gitlab.com/apparmor/apparmor/wikis/AppArmor_versions AppArmor Versions] — Version overview and links to the respective release notes<br />
* [https://gitlab.com/apparmor/apparmor/wikis/Kernel_interfaces Kernel Interfaces] — Low level interfaces to the AppArmor kernel module<br />
* [[wikipedia:Linux Security Modules]] — Linux kernel module on which basis AppArmor is build upon<br />
* [https://doc.opensuse.org/documentation/leap/security/single-html/book-security/index.html#part-apparmor AppArmor in openSUSE Security Guide]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=AppArmor&diff=780744AppArmor2023-06-09T15:56:22Z<p>Snakeroot: Grammar</p>
<hr />
<div>[[Category:Access control]]<br />
[[Category:Kernel]]<br />
[[ja:AppArmor]]<br />
{{Related articles start}}<br />
{{Related|Security}}<br />
{{Related|SELinux}}<br />
{{Related|TOMOYO Linux}}<br />
{{Related articles end}}<br />
[https://apparmor.net/ AppArmor] is a [[Mandatory Access Control]] (MAC) system, implemented upon the [[Wikipedia:Linux_Security_Modules|Linux Security Modules]] (LSM).<br />
<br />
AppArmor, like most other LSMs, supplements rather than replaces the default Discretionary Access Control (DAC). As such it is impossible to grant a process more privileges than it had in the first place. <br />
<br />
Ubuntu, SUSE and a number of other distributions use it by default. RHEL (and its variants) use SELinux which requires good userspace integration to work properly. SELinux attaches labels to all files, processes and objects and is therefore very flexible. However configuring SELinux is considered to be very complicated and requires a supported filesystem. AppArmor on the other hand works using file paths and its configuration can be easily adapted.<br />
<br />
AppArmor proactively protects the operating system and applications from external or internal threats and even zero-day attacks by enforcing a specific rule set on a per application basis. Security policies completely define what system resources individual applications can access, and with what privileges. Access is denied by default if no profile says otherwise. A few default policies are included with AppArmor and using a combination of advanced static analysis and learning-based tools, AppArmor policies for even very complex applications can be deployed successfully in a matter of hours.<br />
<br />
Every breach of policy triggers a message in the system log, and AppArmor can be configured to notify users with real-time violation warnings popping up on the desktop.<br />
<br />
== Installation ==<br />
<br />
AppArmor is available in all [[Kernel#Officially supported kernels|officially supported kernels]].<br />
<br />
[[Install]] {{Pkg|apparmor}} for userspace tools and libraries to control AppArmor. To load all AppArmor profiles on startup, [[enable]] {{ic|apparmor.service}}.<br />
<br />
To enable AppArmor as default security model on every boot, set the following [[kernel parameter]]:<br />
<br />
lsm=landlock,lockdown,yama,integrity,apparmor,bpf<br />
<br />
{{Note|The {{ic|1=lsm=}} kernel parameter sets the initialization order of Linux security modules. The kernel's configured {{ic|1=lsm=}} value can be found with {{ic|1=zgrep CONFIG_LSM= /proc/config.gz}} and the current value with {{ic|cat /sys/kernel/security/lsm}}.<br />
* Make sure that {{ic|apparmor}} is the first "major" module in the list.[https://docs.kernel.org/admin-guide/LSM/index.html] Examples of valid values and their order can be found in [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/security/Kconfig security/Kconfig].<br />
* {{ic|capability}} should be omitted from {{ic|1=lsm=}} as it will always get included automatically.<br />
}}<br />
<br />
=== Custom kernel ===<br />
<br />
When [[Kernels#Compilation|compiling the kernel]], it is required to set at least the following options:<br />
<br />
CONFIG_SECURITY_APPARMOR=y<br />
CONFIG_AUDIT=y<br />
<br />
To enable the AppArmor Linux security model by default and omit the need to set kernel parameters, additionally set the {{ic|CONFIG_LSM}} option and specify {{ic|apparmor}} as the first "major" module in the list:<br />
<br />
CONFIG_LSM="landlock,lockdown,yama,integrity,apparmor,bpf"<br />
<br />
== Usage ==<br />
<br />
=== Display current status ===<br />
<br />
To test if AppArmor has been correctly enabled:<br />
<br />
{{hc|$ aa-enabled|<br />
Yes<br />
}}<br />
<br />
To display the current loaded status use {{man|8|aa-status}}:<br />
<br />
{{hc|# aa-status|<br />
apparmor module is loaded.<br />
44 profiles are loaded.<br />
44 profiles are in enforce mode.<br />
...<br />
0 profiles are in complain mode.<br />
0 processes have profiles defined.<br />
0 processes are in enforce mode.<br />
0 processes are in complain mode.<br />
0 processes are unconfined but have a profile defined.<br />
}}<br />
<br />
=== Parsing profiles ===<br />
<br />
To load (enforce or complain), unload, reload, cache and stat profiles use {{ic|apparmor_parser}}. The default action ({{ic|-a}}) is to load a new profile in enforce mode, loading it in complain mode is possible using the {{ic|-C}} switch, in order to overwrite an existing profile use the {{ic|-r}} option and to remove a profile use {{ic|-R}}. Each action may also apply to multiple profiles. Refer to {{man|8|apparmor_parser}} man page for more information.<br />
<br />
=== Disabling loading ===<br />
<br />
Disable AppArmor by unloading all profiles for the current session:<br />
<br />
# aa-teardown <br />
<br />
To prevent AppArmor profiles from loading at the next boot [[disable]] {{ic|apparmor.service}}. To prevent the kernel from loading AppArmor, remove the {{ic|1=lsm=}} [[kernel parameter]] that was added when [[#Installation|setting up AppArmor]].<br />
<br />
== Configuration ==<br />
<br />
=== Auditing and generating profiles ===<br />
<br />
To create new profiles the [[Audit framework]] should be running. This is because Arch Linux adopted [[systemd]] and does not do kernel logging to file by default. AppArmor can grab kernel audit logs from the userspace auditd daemon, allowing you to build a profile.<br />
<br />
New AppArmor profiles can be created by utilizing {{man|8|aa-genprof}} or {{man|8|aa-autodep}}. The profile is first created in ''complain mode'': in this mode policy violations are only reported but not enforced. The rules are interactively created by the {{man|8|aa-logprof}} tool available in {{pkg|apparmor}} package. Finally the profile should be set into ''enforce mode'' with {{man|8|aa-enforce}}. In this mode the policy defined by the rules in the respecting profile are enforced. If necessary, additional rules can be added by repeatedly executing {{man|8|aa-logprof}}, or the profile can be set back to complain mode with {{man|8|aa-complain}}. Detailed guide about using those tools is available at [https://gitlab.com/apparmor/apparmor/wikis/Profiling_with_tools AppArmor wiki - Profiling with tools].<br />
<br />
Note that {{man|8|aa-logprof}} also offers ''deny'' rules which are actually not strictly necessary as according to the basic AppArmor logic everything is forbidden which is not explicitly allowed by a rule. However, ''deny'' rules serve two purposes:<br />
<br />
# ''deny'' rules take precedence over ''allow'' rules. They are often used in many [https://man.archlinux.org/man/extra/apparmor/apparmor.d.5.en##include_mechanism abstractions] located in {{ic|/etc/apparmor.d/abstractions}} in order to block any access to important folders/files. This makes sure that inadvertently created allow rules do not make a profile too permissive.<br />
# ''deny'' rules silence logging and make subsequent runs of ''aa-logprof'' less noisy. It is important to keep in mind that ''deny'' rules are enforced also in ''complain mode'' - hence, if an application does not work properly even in complain mode it should be checked if a deny rule in the profile or in one of the included abstractions is the culprit.<br />
<br />
Alternatively profiles may be also created manually, see guide available at [https://gitlab.com/apparmor/apparmor/wikis/Profiling_by_hand AppArmor wiki - Profiling by hand].<br />
<br />
In addition to the default profiles in {{ic|/etc/apparmor.d/}}, there are more predefined profiles in {{ic|/usr/share/apparmor/extra-profiles/}}. Note that those are not necessarily deemed production-ready, so manual intervention or usage of {{man|8|aa-logprof}} may be required.<br />
<br />
=== Understanding profiles ===<br />
<br />
Profiles are human readable text files residing under {{ic|/etc/apparmor.d/}} describing how binaries should be treated when executed. A basic profile looks similar to this:<br />
<br />
{{hc|/etc/apparmor.d/usr.bin.test|<br />
#include <tunables/global><br />
<br />
profile test /usr/lib/test/test_binary {<br />
#include <abstractions/base><br />
<br />
# Main libraries and plugins<br />
/usr/share/TEST/** r,<br />
/usr/lib/TEST/** rm,<br />
<br />
# Configuration files and logs<br />
@{HOME}/.config/ r,<br />
@{HOME}/.config/TEST/** rw,<br />
}<br />
}}<br />
<br />
Strings preceded by a {{ic|@}} symbol are variables defined by abstractions ({{ic|/etc/apparmor.d/abstractions/}}), tunables ({{ic|/etc/apparmor.d/tunables/}}) or by the profile itself. {{ic|#include}} includes other profile-files directly. Paths followed by a set of characters are [https://man.archlinux.org/man/extra/apparmor/apparmor.d.5.en#Access_Modes access permissions]. Pattern matching is done using [https://man.archlinux.org/man/extra/apparmor/apparmor.d.5.en#Globbing AppArmor's globbing syntax].<br />
<br />
Most common use cases are covered by the following statements:<br />
<br />
* {{ic|r}} — read: read data<br />
* {{ic|w}} — write: create, delete, write to a file and extend it<br />
* {{ic|m}} — memory map executable: memory map a file executable<br />
* {{ic|x}} — execute: execute file; needs to be preceded by a [https://gitlab.com/apparmor/apparmor/wikis/AppArmor_Core_Policy_Reference#execute-rules qualifier]<br />
<br />
Remember that those permission do not allow binaries to exceed the permission dictated by the Discretionary Access Control (DAC).<br />
<br />
This is merely a short overview, for a more detailed guide be sure to have a look at the {{man|5|apparmor.d}} man page and [https://gitlab.com/apparmor/apparmor/wikis/AppArmor_Core_Policy_Reference documentation].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Get desktop notification on DENIED actions ===<br />
<br />
The notification daemon displays desktop notifications whenever AppArmor denies a program access. To automatically start ''aa-notify'' daemon on login follow below steps:<br />
<br />
Install the [[Audit framework]] and enable and start the userspace Linux Audit daemon. Allow your desktop user to read audit logs in {{ic|/var/log/audit}} by adding it to {{ic|audit}} [[user group]]:<br />
<br />
# groupadd -r audit<br />
# gpasswd -a ''user'' audit<br />
<br />
Add {{ic|audit}} group to {{ic|auditd.conf}}:<br />
{{hc|/etc/audit/auditd.conf|2=<br />
log_group = audit<br />
}}<br />
<br />
{{Tip|You may use other already existing system groups like {{ic|wheel}} or {{ic|adm}}.}}<br />
<br />
[[Install]] {{Pkg|python-notify2}} and {{Pkg|python-psutil}}.<br />
<br />
Create a [[desktop launcher]] with the below content:<br />
<br />
{{hc|~/.config/autostart/apparmor-notify.desktop|2=<br />
[Desktop Entry]<br />
Type=Application<br />
Name=AppArmor Notify<br />
Comment=Receive on screen notifications of AppArmor denials<br />
TryExec=aa-notify<br />
Exec=aa-notify -p -s 1 -w 60 -f /var/log/audit/audit.log<br />
StartupNotify=false<br />
NoDisplay=true<br />
}}<br />
<br />
Reboot and check if the {{ic|aa-notify}} process is running:<br />
<br />
$ pgrep -ax aa-notify<br />
<br />
{{Note|Depending on your specific system configuration there could be A LOT of notifications displayed.}}<br />
<br />
For more information, see {{man|8|aa-notify}}.<br />
<br />
=== Speed-up AppArmor start by caching profiles ===<br />
<br />
Since AppArmor has to translate the configured profiles into a binary format it may significantly increase the boot time. You can check current AppArmor startup time with:<br />
<br />
$ systemd-analyze blame | grep apparmor<br />
<br />
To enable caching AppArmor profiles, uncomment:<br />
<br />
{{hc|/etc/apparmor/parser.conf|2=<br />
## Turn creating/updating of the cache on by default<br />
write-cache<br />
}}<br />
<br />
To change default cache location add:<br />
<br />
{{hc|/etc/apparmor/parser.conf|2=<br />
cache-loc=/path/to/location<br />
}}<br />
<br />
{{Note|Since 2.13.1 default cache location is {{ic|/var/cache/apparmor/}}, previously it was {{ic|/etc/apparmor.d/cache.d/}}.}}<br />
<br />
Reboot and check AppArmor startup time again to see improvement:<br />
<br />
$ systemd-analyze blame | grep apparmor<br />
<br />
== Troubleshooting ==<br />
<br />
=== Failing to start Samba SMB/CIFS server ===<br />
<br />
See [[Samba#Permission issues on AppArmor]].<br />
<br />
=== No events catched by aa-logprof ===<br />
<br />
[[Audit framework]] logs may have the special character {{ic|0x1d}}[https://github.com/linux-audit/audit-userspace/issues/3]. There is a [https://gitlab.com/apparmor/apparmor/-/issues/271 AppArmor bug report], but a workaround is to run:<br />
<br />
# aa-logprof -f <(sed 's/\x1d.*//' < /var/log/audit/audit.log)<br />
<br />
== See also ==<br />
<br />
* [[Wikipedia:AppArmor]]<br />
* [https://gitlab.com/apparmor/apparmor/wikis/home AppArmor wiki]<br />
* [https://gitlab.com/apparmor/apparmor/wikis/AppArmor_Core_Policy_Reference AppArmor Core Policy Reference] — Detailed description of available options in a profile<br />
* [https://ubuntuforums.org/showthread.php?t=1008906 Ubuntu Tutorial] — General overview of available utilities and profile creation<br />
* [https://help.ubuntu.com/community/AppArmor Ubuntu Wiki] — Basic command overview<br />
* [https://gitlab.com/apparmor/apparmor/wikis/AppArmor_versions AppArmor Versions] — Version overview and links to the respective release notes<br />
* [https://gitlab.com/apparmor/apparmor/wikis/Kernel_interfaces Kernel Interfaces] — Low level interfaces to the AppArmor kernel module<br />
* [[wikipedia:Linux Security Modules]] — Linux kernel module on which basis AppArmor is build upon<br />
* [https://doc.opensuse.org/documentation/leap/security/single-html/book-security/index.html#part-apparmor AppArmor in openSUSE Security Guide]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=776333Lenovo ThinkPad T14 (AMD) Gen 22023-04-24T16:18:26Z<p>Snakeroot: Add info about TLP. Correct typos</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || {{ic|1022:15df}} || {{Yes}}<br />
|-<br />
| Smartcard reader || {{ic|058f:9540}} || {{Yes}}<br />
|-<br />
| NFC reader || ??? || {{No}}<br />
|-<br />
| SIM || ??? || {{No}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam, the fingerprint reader and the NVMe controller.<br />
<br />
=== November 2021 security update ===<br />
<br />
On November 4, 2021 Lenovo pushed System Firmware Version 1.12, a UEFI/BIOS update, to LVFS. This is described as a security update (although without further detail). See [https://fwupd.org/lvfs/devices/com.lenovo.ThinkPadR1MET.firmware LVFS page for this update].<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
Note that keeping the Microsoft Certificates should not brick the machine.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{hc|$ lspci {{!}} grep Ethernet|<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)<br />
}}<br />
<br />
{{ic|enp5s0}} is the RJ45 port. {{ic|enp2s0f0}} is the proprietary connector next to the 2nd USB Type-C port for use in the ''Lenovo ThinkPad Ultra Docking Station'' or with a ''Lenovo ThinkPad Ethernet Extension Cable Gen 2'' cable.<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
{{hc|$ ip link|<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
4: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
== Unreliable mic mute LED ==<br />
<br />
The mic mute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per the [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 relevant thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics touchpad RMI bus non-functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see the [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 relevant thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Freezing Trackpad ==<br />
<br />
The trackpad may freeze randomly. The cure is to unload the psmouse module with ''rmmod'' and reload it with ''modprobe''.<br />
<br />
== Fingerprint reader unavailable after suspend ==<br />
<br />
There have been reports that while the fingerprint reader works well with fprintd after a cold start (including wake from hibernation) it vanishes from the list of available devices after sleep or suspend. As of July 2022, with the latest system firmware updates applied, this issue now seems to be resolved.<br />
<br />
== AMD P-State ==<br />
<br />
Starting with kernel 5.17, AMD processors should have more finesse in frequency control due to the inclusion of the AMD p-states driver. Additionally, staring with kernel 6.3, the AMD p-states driver provides EPP (energy preference performance) which provides a hint to the hardware<br />
if software wants to bias toward performance or energy efficiency. Unfortunately, the {{ic|acpi_cprufreq}} driver does not play well with others.<br />
<br />
Additionally, it is necessary to modify the kernel commandline to incorporate "amd_pstate=passive" (for non-EPP mode) or (post kernel 6.3) "amd_pstate=active" (EPP mode) in order to enable the amd_pstate or amd_pstate_epp driver, respectively.<br />
<br />
To get it working: <br />
<br />
* Blacklist {{ic|acpi_cpufreq}} by adding the entry {{ic|acpi_cpufreq}} to the {{ic|/etc/modprobe.d/blacklist.conf}} file; <br />
* Add {{ic|amd_pstate{{=}}passive}} or {{ic|amd_pstate{{=}}active}} to your kernel boot options.<br />
<br />
Confirm if it has worked by running {{ic|cpupower frequency-info}} to confirm the driver being used. You can also load the {{ic|amd_pstate_ut}} module and review dmesg to confirm that the driver passed the relevant tests.<br />
<br />
Note that the amd_pstate driver is now a boolean option in the kernel configuration and can no longer be built as a module.<br />
<br />
For those using TLP to manage power, AMD p-state peformance is slated for inclusion in the 1.06 release. For the impatient, switch to tlp-git in the AUR.<br />
<br />
== Sleep mode (S3) ==<br />
<br />
Sleep mode and, in particular, the lid switch are slow and flaky unless the sleep mode is set to ''Linux'' rather than ''Windows 10'' in the UEFI. Be sure that you have logged out of, rather than suspending, any Windows installation before changing this. <br />
<br />
See [[Power management/Suspend and hibernate]] for more details.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=776330Lenovo ThinkPad T14 (AMD) Gen 22023-04-24T16:11:37Z<p>Snakeroot: Reflect inclusion of EPP in kernel 6.3</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || {{ic|1022:15df}} || {{Yes}}<br />
|-<br />
| Smartcard reader || {{ic|058f:9540}} || {{Yes}}<br />
|-<br />
| NFC reader || ??? || {{No}}<br />
|-<br />
| SIM || ??? || {{No}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam, the fingerprint reader and the NVMe controller.<br />
<br />
=== November 2021 security update ===<br />
<br />
On November 4, 2021 Lenovo pushed System Firmware Version 1.12, a UEFI/BIOS update, to LVFS. This is described as a security update (although without further detail). See [https://fwupd.org/lvfs/devices/com.lenovo.ThinkPadR1MET.firmware LVFS page for this update].<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
Note that keeping the Microsoft Certificates should not brick the machine.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{hc|$ lspci {{!}} grep Ethernet|<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)<br />
}}<br />
<br />
{{ic|enp5s0}} is the RJ45 port. {{ic|enp2s0f0}} is the proprietary connector next to the 2nd USB Type-C port for use in the ''Lenovo ThinkPad Ultra Docking Station'' or with a ''Lenovo ThinkPad Ethernet Extension Cable Gen 2'' cable.<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
{{hc|$ ip link|<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
4: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
== Unreliable mic mute LED ==<br />
<br />
The mic mute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per the [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 relevant thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics touchpad RMI bus non-functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see the [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 relevant thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Freezing Trackpad ==<br />
<br />
The trackpad may freeze randomly. The cure is to unload the psmouse module with ''rmmod'' and reload it with ''modprobe''.<br />
<br />
== Fingerprint reader unavailable after suspend ==<br />
<br />
There have been reports that while the fingerprint reader works well with fprintd after a cold start (including wake from hibernation) it vanishes from the list of available devices after sleep or suspend. As of July 2022, with the latest system firmware updates applied, this issue now seems to be resolved.<br />
<br />
== AMD P-State ==<br />
<br />
Starting with kernel 5.17, AMD processors should have more finesse in frequency control due to the inclusion of the AMD p-states driver. Additionally, staring with kernel 6.3, the AMD p-states driver provides EPP (energy preference performance) which provides a hint to the hardware<br />
if software wants to bias toward performance or energy efficiency. Unfortunately, the {{ic|acpi_cprufreq}} driver does not play well with others.<br />
<br />
Additionally, it is necessary to modify the kernel commandline to incorporate "amd_pstate=passive" (for active mode) or (post kernel 6.3) "amd_pstate=active" (EPP mode) in order to enable the amd_pstate or amd_pstate_epp driver, respectively.<br />
<br />
To get it working: <br />
<br />
* Blacklist {{ic|acpi_cpufreq}} by adding the entry {{ic|acpi_cpufreq}} to the {{ic|/etc/modprobe.d/blacklist.conf}} file; <br />
* Add {{ic|amd_pstate{{=}}passive}} or {{ic|amd_pstate{{=}}passive}} to your kernel boot options.<br />
<br />
Confirm if it has worked by running {{ic|cpupower frequency-info}} to confirm the driver being used. You can also load the {{ic|amd_pstate_ut}} module and review dmesg to confirm that the driver passed the relevant tests.<br />
<br />
Note that the amd_pstate driver is now a boolean option in the kernel configuration and can no longer be built as a module.<br />
<br />
== Sleep mode (S3) ==<br />
<br />
Sleep mode and, in particular, the lid switch are slow and flaky unless the sleep mode is set to ''Linux'' rather than ''Windows 10'' in the UEFI. Be sure that you have logged out of, rather than suspending, any Windows installation before changing this. <br />
<br />
See [[Power management/Suspend and hibernate]] for more details.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=774069Lenovo ThinkPad T14 (AMD) Gen 22023-03-28T18:34:23Z<p>Snakeroot: /* AMD P-State */ Remove references to amd_pstate as a module and add explanation of the need for the amd_pstate=passive kernel parameter.</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || {{ic|1022:15df}} || {{Yes}}<br />
|-<br />
| Smartcard reader || {{ic|058f:9540}} || {{Yes}}<br />
|-<br />
| NFC reader || ??? || {{No}}<br />
|-<br />
| SIM || ??? || {{No}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam, the fingerprint reader and the NVMe controller.<br />
<br />
=== November 2021 security update ===<br />
<br />
On November 4, 2021 Lenovo pushed System Firmware Version 1.12, a UEFI/BIOS update, to LVFS. This is described as a security update (although without further detail). See [https://fwupd.org/lvfs/devices/com.lenovo.ThinkPadR1MET.firmware LVFS page for this update].<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
Note that keeping the Microsoft Certificates should not brick the machine.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{hc|$ lspci {{!}} grep Ethernet|<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)<br />
}}<br />
<br />
{{ic|enp5s0}} is the RJ45 port. {{ic|enp2s0f0}} is the proprietary connector next to the 2nd USB Type-C port for use in the ''Lenovo ThinkPad Ultra Docking Station'' or with a ''Lenovo ThinkPad Ethernet Extension Cable Gen 2'' cable.<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
{{hc|$ ip link|<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
4: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
== Unreliable mic mute LED ==<br />
<br />
The mic mute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per the [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 relevant thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics touchpad RMI bus non-functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see the [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 relevant thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Freezing Trackpad ==<br />
<br />
The trackpad may freeze randomly. The cure is to unload the psmouse module with ''rmmod'' and reload it with ''modprobe''.<br />
<br />
== Fingerprint reader unavailable after suspend ==<br />
<br />
There have been reports that while the fingerprint reader works well with fprintd after a cold start (including wake from hibernation) it vanishes from the list of available devices after sleep or suspend. As of July 2022, with the latest system firmware updates applied, this issue now seems to be resolved.<br />
<br />
== AMD P-State ==<br />
<br />
Starting with kernel 5.17, AMD processors should have more finesse in frequency control due to the inclusion of the AMD p-states driver. Unfortunately, the {{ic|acpi_cprufreq}} driver does not play well with others.<br />
<br />
Additionally, it is necessary to modify the kernel commandline to incorporate "amd_pstate=passive" in order to enable the amd_pstate driver.<br />
<br />
To get it working: <br />
<br />
* Blacklist {{ic|acpi_cpufreq}} by adding the entry {{ic|acpi_cpufreq}} to the {{ic|/etc/modprobe.d/blacklist.conf}} file; <br />
* Add {{ic|amd_pstate{{=}}passive}} to your kernel boot options.<br />
<br />
Confirm if it has worked by running {{ic|cpupower frequency-info}} to confirm the driver being used. You can also load the {{ic|amd_pstate_ut}} module and review dmesg to confirm that the driver passed the relevant tests.<br />
<br />
Note that the amd_pstate driver is now a boolean option in the kernel configuration and can no longer be built as a module.<br />
<br />
== Sleep mode (S3) ==<br />
<br />
Sleep mode and, in particular, the lid switch are slow and flaky unless the sleep mode is set to ''Linux'' rather than ''Windows 10'' in the UEFI. Be sure that you have logged out of, rather than suspending, any Windows installation before changing this. <br />
<br />
See [[Power management/Suspend and hibernate]] for more details.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=729245Lenovo ThinkPad T14 (AMD) Gen 22022-05-11T14:56:59Z<p>Snakeroot: This is not a universal problem; I've been unable to reproduce it, there is only one report for our model in the Lenovo forums (the other report is for the P1 sister model) and a quick Google didn't show any other report.</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || {{ic|1022:15df}} || {{Yes}}<br />
|-<br />
| Smartcard reader || {{ic|058f:9540}} || {{Yes}}<br />
|-<br />
| NFC reader || ??? || {{No}}<br />
|-<br />
| SIM || ??? || {{No}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam, the fingerprint reader and the NVME controller.<br />
<br />
=== November 2021 security update ===<br />
<br />
On November 4, 2021 Lenovo pushed System Firmware Version 1.12, a UEFI/BIOS update, to LVFS. This is described as a security update (although without further detail). See [https://fwupd.org/lvfs/devices/com.lenovo.ThinkPadR1MET.firmware LVFS page for this update].<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
Note that keeping the Microsoft Certificates should not brick the machine.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} does not seem to be configurable and shows as having no carrier even when the RJ45 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Unreliable mic mute LED ==<br />
<br />
The mic mute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per the [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 relevant thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics touchpad RMI bus non-functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see the [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 relevant thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Freezing Trackpad ==<br />
<br />
The trackpad may freeze randomly. The cure is to unload the psmouse module with rmmod and reload it with modprobe.<br />
<br />
== Fingerprint reader unavailable after suspend ==<br />
<br />
There have been reports that while the fingerprint reader well with fprintd after a cold start (including wake from hibernation) it vanishes from the list of available devices after sleep or suspend. Aside from hibernation, no other known workaround is available yet.<br />
<br />
== AMD P-State ==<br />
<br />
Starting with kernel 5.17, AMD processors should have more finesse in frequency control due to the inclusion of the AMD p-states driver. Unfortunately, the {{ic|acpi_cprufreq}} driver does not play well with others. To get it working, blacklist {{ic|acpi_cpufreq}} by adding the entry {{ic|acpi_cpufreq}} to the {{ic|/etc/modprobe.d/blacklist.conf}} file and force the loading of {{ic|amd_pstate}} by creating an {{ic|/etc/modules-load.d/amd_pstate.conf}} file with "amd_pstate" as its contents. Confirm if it has worked by running {{ic|sudo cpupower frequency-info}} to confirm the driver being used.<br />
<br />
== Sleep mode (S3) ==<br />
<br />
Sleep mode and, in particular, the lid switch are slow and flaky unless the sleep mode is set to {{ic|Linux}} rather than {{ic|Windows 10}} in the BIOS. Be sure that you have logged out of, rather than suspending, any Windows 10 installation before changing this.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Laptop/Lenovo&diff=725495Laptop/Lenovo2022-04-05T21:24:24Z<p>Snakeroot: Driver is in kernel now.</p>
<hr />
<div>[[Category:Lenovo]]<br />
[[ja:ノートパソコン/Lenovo]]<br />
{{Laptops navigation}}<br />
{{Related articles start}}<br />
{{Related|ThinkPad docks}}<br />
{{Related articles end}}<br />
<br />
== IBM/Lenovo ==<br />
<br />
=== ThinkPad ===<br />
<br />
==== ThinkPad battery control ====<br />
<br />
{{Merge|tp_smapi|[[tpacpi-bat]] is already covered in [[tp_smapi]]. [[tp_smapi#Supported laptops]] also already covers supported ThinkPads. ([[tp_smapi]] is already mentioned in the parent page at [[Laptop#See also]], so it may be unnecessary to mention it here again to avoid duplication.)}}<br />
<br />
For newer ThinkPads it is possible to set a stop and resume charge threshold with [https://github.com/teleshoes/tpacpi-bat tpacpi-bat]. A user-submitted list of ThinkPads compatible with tpacpi-bat is available [https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware here]. For many older, pre Ivy Bridge, ThinkPads [[tp_smapi]] is available.<br />
<br />
==== Edge series ====<br />
<br />
{{Laptops table header}}<br />
| [[Lenovo ThinkPad Edge E330]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad Edge E335]] || {{-}} || Yes || Yes || Yes || Yes || NA || Yes || NA || ||<br />
|-<br />
| Lenovo ThinkPad Edge E420s || {{-}} || Yes || Yes || Yes || Yes || Yes || NA || NA || SDcard (Yes), Webcam (Yes), Trackpoint (No) ||<br />
|-<br />
| [[Lenovo ThinkPad Edge E430]] || {{-}} || Yes || Yes* || Yes* || Not tested || Yes || NA || NA || SD card (yes) ||<br />
|-<br />
| [[Lenovo ThinkPad Edge E455]] || 2015-04-01 || Yes* || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| Lenovo ThinkPad Edge E460 || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (yes), Finger Print (yes), TouchPad/Trackpoint (yes*), Webcam (yes)|| Touchpad and trackpoint needs kernel parameters "i8042.noloop i8042.nomux i8042.nopnp i8042.reset" when using [[libinput]].<br />
|-<br />
| Lenovo ThinkPad Edge E470 || 2020-11-11 || Yes || Yes || Yes || Yes || Yes || Yes || NA || trackpoint (yes) ||<br />
|-<br />
| Lenovo ThinkPad Edge E530 || {{-}} || Yes || Yes* || Yes* || Yes || Yes || NA || NA || SD card (yes), Finger Print (yes) || E530 without fingerprint reader can be equipt with one.<br />
|-<br />
| Lenovo ThinkPad Edge E531 || {{-}} || Yes || Yes || Yes || Yes* || Yes || Yes || NA || SD card (yes), Touch Pad/Trackpoint (yes), Webcam (yes) || WiFi only works with {{Pkg|broadcom-wl-dkms}}<br />
|-<br />
| Lenovo ThinkPad Edge E540 || 2015-08-01 || Yes || Yes || Yes || Yes || Yes || Yes* || NA || SD card (yes), Finger Print (yes), touch pad and trackpoint (yes), Webcam (yes) ||<br />
|-<br />
| Lenovo ThinkPad Edge E545 || {{-}} || Yes || Yes || Yes || Yes* || Not tested || Yes || NA || SD card (yes), touch pad and trackpoint (yes) Webcam (yes) || wifi works only with {{Pkg|broadcom-wl-dkms}}<br />
|-<br />
| Lenovo ThinkPad Edge E580 || 2018-05-01 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Fingerprint sensor does not work because of proprietary firmware ||<br />
|-<br />
|}<br />
<br />
==== E series ====<br />
<br />
{{Laptops table header}}<br />
| Lenovo ThinkPad E485 || 2018-10-01 || Yes || Yes || Yes || Yes || Yes || Yes || N/A || || Missing IVRS map in ACPI Table, add {{ic|1=amd_iommu=pt ivrs_ioapic[32]=00:14.0}} in [[kernel parameters]]. In order to get X to work correctly, add {{ic|1=iommu=soft}} in [[kernel parameters]] (Linux 4.20 only). On Linux 5.2, add {{ic|1=iommu=pt}} to prevent render artifacts on X. In order to get microsd (SDHCI) working, {{ic|1=echo 'options sdhci debug_quirks2="0x8000"' > /etc/modprobe.d/sdhci.conf}} and change module load order {{ic|1=MODULES=(sdhci sdhci_pci)}} in {{ic|/etc/mkinitcpio.conf}} (line 7). Do not forget to run {{ic|mkinitcpio -p linux}} afterwards. If WiFi does not work on RTL8822BE adapter models, create a file {{ic|/etc/modprobe.d/wifi.conf}} and add the following lines: {{ic|blacklist rtw_pci<br />blacklist rtwpci}}. Then, install {{aur|rtw88-dkms-git}} and reboot.<br />
|-<br />
| Lenovo ThinkPad E585 || 2018-11-01 || Yes || Yes || Yes || Yes || Yes || Yes || N/A || || To solve all these issues mentioned here easier just install the latest BIOS update from Lenovo support website. Missing IVRS map in ACPI Table, add {{ic|1=amd_iommu=pt ivrs_ioapic[32]=00:14.0}} in [[kernel parameters]]. In order to get X to work correctly, add {{ic|1=iommu=soft}} in [[kernel parameters]] (Linux 4.20 only). In order to get microsd (SDHCI) working, {{ic|1=echo 'options sdhci debug_quirks2="0x8000"' > /etc/modprobe.d/sdhci.conf}} and change module load order {{ic|1=MODULES=(sdhci sdhci_pci)}} in {{ic|/etc/mkinitcpio.conf}} (line 7). Do not forget to run {{ic|mkinitcpio -p linux}} afterwards. Bluetooth does not work until a suspend/resume cycle occurs.<br />
|-<br />
| Lenovo ThinkPad E595 || 2020-05-24 || Yes || Yes || Yes || Yes || Yes || Yes || N/A || ||<br />
Update the bios, if missing IVRS map in ACPI Table.<br />
<br />
Bios update can help if Ethernet is not working.<br />
<br />
MicroSD does not work out of the box, see above (Lenovo ThinkPad E585) to fix it.<br />
<br />
Wake up from suspend broken on X.Org with kernel >= 5.2; works with kernel >= 5.6<br />
<br />
Add {{ic|1=acpi_backlight=vendor}} in [[kernel parameters]] to fix systemd warning {{ic|Failed to start Load/Save Screen Backlight Brightness of backlight:acpi_video0}}<br />
|-<br />
| Lenovo ThinkPad E15 Gen 2. || 2022-01-10 || Yes || Yes || Yes || Yes || Yes || Yes || N/A || ||<br />
Resume from hibernate will not work until {{ic|intel_lpss_pci}} is added to {{ic|MODULES()}} in {{ic|/etc/mkinitcpio.conf}}. See [[Power management/Suspend and hibernate#Suspend/hibernate does not work, or does not work consistently]] for details.<br />
<br />
The trackpoint and physical buttons will stop working after resuming from hibernate. Use {{ic|modprobe -r psmouse}} followed by {{ic|modprobe psmouse}} to get the functionailty back<br />
<br />
ALSA needs {{Pkg|sof-firmware}} to work<br />
<br />
Fingerprint reader is unsupported. Neither {{ic|fprintd}} nor {{ic|libfprintd-tod}} will work.<br />
<br />
If the Fn keys do not work, to update the BIOS, download the "Bootable CD" of the [https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-edge-laptops/thinkpad-e15-gen-2-type-20t8-20t9/downloads/driver-list/component?name=BIOS%2FUEFI BIOS Update], and use {{AUR|geteltorito}} to extract the .img from the .iso with {{ic|geteltorito.pl -o bios.img downloaded.iso}}, then use [[USB flash installation medium#Using etcher|etcher]] / {{AUR|mintstick}} / [[dd]] to make a bootable USB. See [https://makandracards.com/operations/39925-lenovo-laptop-bios-update-with-linux] for details.<br />
|-<br />
|}<br />
<br />
==== L series ====<br />
<br />
{{Laptops table header}}<br />
| [[Lenovo ThinkPad L380 Yoga]] || 2018-09-21 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint*, Fingerprint reader ||<br />
|-<br />
| Lenovo ThinkPad L390 || 2021-03-01 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Webcam, MicroSD card reader is working out of the box. Not working out of the box: Touchscreen, fingerprint reader, NFC || Touchscreen for model 20NRCTO1WW sort of works when blacklisting a kernel module: {{ic|echo "blacklist raydium_i2c_ts" > /etc/modprobe.d/blacklist_raydium.conf}} + update initramfs if required and reboot (see [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1849721 ''LaunchPad bug report''])<br />
|-<br />
| Lenovo ThinkPad L420 || 2014-11-23 || Yes || Yes || Yes || Yes || Not tested || Yes || NA || ||<br />
|-<br />
| Lenovo ThinkPad L430 || 2014-11-23 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint* ||<br />
|-<br />
| Lenovo ThinkPad L440 || 2019-01-24 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint (Touchpad cannot be disabled, as mouse buttons are shared with Trackpoint), Fingerprint reader, SD Card Reader ||<br />
|-<br />
| Lenovo ThinkPad L450 || 2019-11-01 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint, Fingerprint reader, SD Card Reader ||<br />
|-<br />
| Lenovo ThinkPad L460 || 2019-06-24 || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || Trackpoint, Fingerprint reader, SD Card Reader ||<br />
|-<br />
| Lenovo ThinkPad L470 || 2022-01-24 || Yes || Yes || Yes || Yes || Not tested || Yes || Not tested || Trackpoint, Fingerprint reader, SD Card Reader ||<br />
|-<br />
| Lenovo ThinkPad L490 || 2020-12-13 || Yes || Yes || Yes || Yes<sup>1</sup> || Yes || Yes || NA<sup>2</sup> || Trackpoint, SD Card Reader, Webcam, USB-C generic dongle, USB-C to HDMI video, USB-C Power Delivery (PD) are working. || <sup>1</sup>Wireless chipset (RTL8822BE) might not work on standard {{Pkg|linux}} kernel, showing errors like {{ic|1=failed to read ASPM, ret=-5}} and/or {{ic|failed to power on mac}} , but it should work by running {{Pkg|linux-lts}} kernel, with no further configuration. Wireless might not work with Arch Linux default installation media, since it uses default linux kernel. In order to install Arch Linux, use a [[Network_configuration|wired connection]], or create a custom installation media with [[Archiso#Kernel|LTS kernel]] to support device's wireless adapter instead. Do not forget to install {{Pkg|linux-lts}} and {{Pkg|linux-firmware}} packages before rebooting to a fresh installation.<br />
<sup>2</sup>There is a variant with LTE, but this specific testing machine does not have that module.<br />
* Fan will not work by default. Consider [[Fan_speed_control#ThinkPad laptops|configuring it]] in order to avoid thermal throttling (tested with {{AUR|thinkfan}}).<br />
* Fingerprint reader not tested.<br />
* ThinkPad [https://www.lenovo.com/us/en/accessories-and-monitors/cables-and-adapters/adapters/CABLE-BO-Ethernet-Extension-Adapter-2/p/4X90Q84427 ''Ethernet Extension Adapter Gen 2''] not tested.<br />
|-<br />
| Lenovo ThinkPad L520 || 2018-09-01 || Yes || Yes || Yes || Yes || Not tested|| Not tested|| Not tested|| Not tested ||<br />
|-<br />
| Lenovo ThinkPad L530 || 2014-11-23 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Trackpoint*, Fingerprint reader ||<br />
|-<br />
| Lenovo ThinkPad L560 || 2018-12-28 || Yes || Yes || Yes || Yes || Not tested || Not tested || NA || Trackpoint ||<br />
|-<br />
| Lenovo ThinkPad L590 || 2019-11-14 || Not tested || Not tested || Not tested || Not tested || Not tested || Not tested || NA || || Kernels >= 5 will not boot at all and freezes at different stages of startup.<br />
|-<br />
| Lenovo ThinkPad L13 Yoga Gen2 || 2021-08-10 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Micro SD Works, Fingerprint works after installing {{Pkg|fprintd}}, Touch / Pen innput, Webcam, Trackpoint, || Smartcard-Reader not tested<br />
|-<br />
| Lenovo ThinkPad L14 Gen1 (Intel) 20U1000XFR || 2020-09-17 || Yes || Yes || Yes || Yes || Not tested || Yes || NA || Touchpad physical buttons not working, Trackpoint not working, MicroSD card reader not tested ||<br />
|-<br />
| Lenovo ThinkPad L14 Gen1 (AMD) 20U50007UK || 2021-04-20 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Fingerprint reader does not work (No driver available). Smartcard-Reader works after installing drivers. DP over USB-C and HDMI works.<br />
|-<br />
| Lenovo ThinkPad L15 Gen1 (AMD) || 2021-01-30 || Yes || Yes || Yes || Yes<sup>1</sup> || Not tested || Yes || NA || Fingerprint reader (No driver available) || Kernel parameter {{ic|1=iommu=soft}} is required for UEFI BIOS versions earlier than 1.13, and {{ic|1=acpi_backlight=vendor}} allows saving/loading backlight brightness.<br />
<sup>1</sup> Random disconnections with {{ic|iwlwifi}} driver seems to be fixed by disabling power saving in iwlmvm. (See [[Wireless#Cause #6]])<br />
|-<br />
| Lenovo ThinkPad L15 Gen2 (AMD) 20X7000QMB|| 2021-07-20 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Touchpad, webcam, DP over USB-C ||<br />
|-<br />
| Lenovo ThinkPad L14 Gen2 (AMD) 20X50049GE || 2021-07-02 || Yes || Yes || Yes || Yes<sup>1</sup> || Yes<sup>1</sup> || Yes || NA || Smartcard-Reader works after installing drivers. DP over USB-C and HDMI works. IR-Camera does not work. || <sup>1</sup> For wireless to work, {{AUR|rtw89-dkms-git}} must be installed.<br />
|-<br />
| Lenovo ThinkPad L14 Gen2a (AMD) 20X50009GE || 2021-09-06 || Yes || Yes || Yes || Yes || Yes || Yes || NA || || Webcams work. Sleep does not work (even with Mainline 5.14, linux-hardened does not boot, IRQ86 and IRQ88 consume a lot of CPU. see [https://bbs.archlinux.org/viewtopic.php?pid=1991663#p1991663 thread on BBS] and [https://www.reddit.com/r/AMDLaptops/comments/pdpfaq/lenovo_thinkpad_l14_gen2_amd_linux/ thread on reddit].<br />
|}<br />
<br />
==== A series ====<br />
<br />
{{Laptops table header}}<br />
| Lenovo ThinkPad A485 || 2018-12 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Touch Pad/Trackpoint (yes), Webcam (yes) || bluetooth does not work when activating [[Laptop Mode Tools]] {{ic|runtime-pm}} module<br />
|}<br />
<br />
==== P series ====<br />
<br />
{{Laptops table header}}<br />
| [[Lenovo ThinkPad P50]] || 2016-04 || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader ({{AUR|libfprint-vfs009x-git}}), || Wifi requires Kernel 4.3.3+<br />
|-<br />
| [[Lenovo ThinkPad P70]] || 2016-04 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate not tested || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader ({{AUR|libfprint-vfs009x-git}}), || Wifi requires Kernel 4.3.3+<br />
|-<br />
| Lenovo ThinkPad P51 || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Yes (No GNSS/GPS) ||<br />
* Working: SD card, Webcam, Express card, Smartcard reader, Fingerprint Reader ({{AUR|libfprint-vfs009x-git}})<br />
* Not working: TPM, Color calibrator, UEFI flash <br />
|| HDMI audio requires nvhda module<br />
|-<br />
| [[Lenovo ThinkPad P52]] || 2018-09 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate not tested || NA || Webcam (yes), IR camera (yes), Touchpad (yes), SD Card Reader (yes), Smartcard Reader (yes with pcscd installed), Fingerprint (no) ||<br />
|-<br />
| [[Lenovo ThinkPad P1]] || 2018-12 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate not tested || NA || Webcam (Yes), multi-monitor (yes)||<br />
|-<br />
| [[Lenovo ThinkPad P1 (Gen 2)]] || 2019-09-01 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate working || NA || Webcam (not tested), multi-monitor (yes)||<br />
|-<br />
| [[Lenovo ThinkPad P52s]] || 2019-02 || Yes* (See Remarks) || Yes || Yes || Yes || Yes || Suspend (Yes), Hibernate (Yes) || Not tested || Webcam (Yes), Multi-monitor (Yes), Card Reader (Yes), Smartcard Reader (Yes), NFC (No, [https://github.com/nfc-tools/libnfc/issues/455 see this]), Fingerprint (No, [https://forums.lenovo.com/t5/Linux-Discussion/Thinkpad-T580-Synaptics-Metallica-MIS-Touch-Fingerprint-Reader/m-p/4057745 see this])|| *Intel graphics needs to be specified in the Xorg config for Xorg to work, see [[Lenovo ThinkPad P52s]]<br />
|-<br />
| [[Lenovo ThinkPad P53]] || 2019-12 || Yes || Yes || Yes || Yes || Yes || Suspend working, hibernate not tested || NA || Webcam (Yes), Multi-monitor (Yes), Hybrid nvidia/intel (Yes), Card Reader (Yes), Smartcard Reader (Yes), Fingerprint (Yes with libfprint and current beta firmware)|| Use nvidia-prime to switch between cards. External outputs are connected to the nvidia gpu.<br />
|-<br />
| Lenovo ThinkPad P53s || 2019-10 || Yes || Yes || Yes || Yes || Not tested || Not tested || Not tested || Webcam (Yes), Multi-monitor (Not testes), Card Reader (Not tested), Smartcard Reader (Not tested), Fingerprint (Not tested)|| Trackpad is really bad compared to the Thinkpad T480.<br />
|-<br />
| Lenovo ThinkPad P73 || 2020-06 || Yes || Yes || Yes || Yes || Not tested || Not tested || Not tested || Webcam (Yes), Multi-monitor (No), Card Reader (Not tested), Smartcard Reader (Not tested), Fingerprint (Not tested)||<br />
|-<br />
| [[Lenovo ThinkPad P43s]] || 2020-07 || Yes || Yes || Yes || Yes || Not tested || Not tested || Not tested || Webcam (Yes - both types), Multi-monitor (Yes), Card Reader (Yes), Smartcard Reader (Not tested), Fingerprint (Not tested)|| Also tested with Thunderbolt 3 eGPU and works well.<br />
|-<br />
| [[Lenovo ThinkPad P15s]] || 2020-05 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Webcam (Yes - both types), Multi-monitor (Yes), Card Reader (Yes), Smartcard Reader (Not tested), Fingerprint (Not tested)|| Also tested with Thunderbolt 3 dock (monitor, usb) and works well.<br />
|-<br />
| Lenovo ThinkPad P17 (Gen 1) || 2020-06 || Yes || Yes || Yes || Yes || Yes || Suspend (Yes), Hibernate (Unconfirmed) || NA || Webcam (Yes, but IR not tested), Multi-monitor (Yes, HDMI port and USB-C to HDMI via adapter), Card Reader (Not tested), Smartcard Reader (Yes), Fingerprint (Not tested), TrackPoint (Yes), TouchPad (Yes) || Thunderbolt 3 dock (Not tested). Graphics tested in Discrete mode only. Screen Brightness adjustment buttons may require kernel 5.1<br />
|-<br />
| Lenovo ThinkPad P14s (AMD) Gen 2 || 2022-02-19 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Webcam, Multi-monitor (Yes), Card Reader (Yes), Smartcard Reader (Yes), Fingerprint (Yes)|| WiFi requires rtw89 drivers available in the AUR. For better suspend battery usage, change sleep mode entry in the BIOS to Linux<br />
|}<br />
<br />
==== T series ====<br />
<br />
{{Laptops table header}}<br />
| IBM ThinkPad T60 || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Untested}} || {{-}} || ||<br />
|-<br />
| IBM ThinkPad T60p || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Untested}} || {{-}} || ThinkFinger ||<br />
|-<br />
| [[IBM ThinkPad T61]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || || ||<br />
|-<br />
| IBM ThinkPad T61p || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || || ||<br />
|-<br />
| [[Lenovo ThinkPad T400]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || {{-}} || ||<br />
|-<br />
| [[Lenovo ThinkPad T400s]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || {{-}} || ||<br />
|-<br />
| Lenovo ThinkPad T410 || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || {{-}} || ||<br />
|-<br />
| [[Lenovo ThinkPad T420]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || Card reader tested, no Fingerprint scanner||<br />
|-<br />
| [[Lenovo ThinkPad T420s]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || {{-}} || Card Reader ||<br />
|-<br />
| [[Lenovo ThinkPad T430]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}* || {{Yes}}* || {{Y|Untested}} || ||<br />
|-<br />
| [[#Lenovo ThinkPad T440p|Lenovo ThinkPad T440p]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}* || {{-}} || {{-}} || Card Reader || See below<br />
|-<br />
| [[Lenovo ThinkPad T440s]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}* || {{Yes}} || {{Yes}} || {{Y|Untested}} || || See wiki page for more details about wireless<br />
|-<br />
| [[Lenovo ThinkPad T450]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Untested}} || {{Y|Untested}} || {{-}} || SD Card reader ||<br />
|-<br />
| [[Lenovo ThinkPad T450s]] || 2015-10-01 || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || SD Card reader; fingerprint scanner||<br />
|-<br />
| [[Lenovo ThinkPad T460s]] || {{-}} || {{Yes}} || {{Y|No beep}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Untested}} || {{-}} || SD Card reader||<br />
|-<br />
| [[Lenovo ThinkPad T25]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || SD Card reader; fingerprint scanner; Touchscreen||<br />
|-<br />
| [[Lenovo ThinkPad T470]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || SD Card reader; fingerprint scanner||<br />
|-<br />
| [[Lenovo ThinkPad T470s]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || SD Card reader; fingerprint scanner||<br />
|-<br />
| [[Lenovo ThinkPad T480]] || 2018-07-01 || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Untested}} || {{-}} || Thunderbolt 3 (USB-C); SD Card reader; fingerprint scanner||<br />
|-<br />
| [[Lenovo ThinkPad T480s]] || {{-}} || {{Yes}} || {{Y|No beep}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Untested}} || Thunderbolt 3 (USB-C); SD Card reader; HDMI|| Cannot find a driver for fingerprint reader<br />
|-<br />
| [[Lenovo ThinkPad T490]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || Thunderbolt 3 (USB-C); microSD Card reader ||<br />
|-<br />
| [[Lenovo ThinkPad T495]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || SD Card reader ||<br />
|-<br />
| [[Lenovo ThinkPad T495s]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || ||<br />
|-<br />
| Lenovo ThinkPad T500 || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || {{-}} || ||<br />
|-<br />
| [[Lenovo ThinkPad T520]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || {{-}} || ||<br />
|-<br />
| [[Lenovo ThinkPad T530]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || ||<br />
|-<br />
| [[Lenovo ThinkPad T550]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || DisplayPort ||<br />
|-<br />
| Lenovo ThinkPad T560 || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}* || {{-}} || MiniDP; Fingerprint scanner; Intel + Nvidia GPU; Card Reader || See special notes for the hardware specifications of this test device<br />
|-<br />
| [[Lenovo ThinkPad T570]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Untested}} || {{Yes}}* || {{-}} || not yet fully tested ||<br />
|-<br />
| Lenovo ThinkPad T580 || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || SD Card Reader is supported; Fingerprint scanner works with {{AUR|python-validity}} || Tested on ''14 July 2021'' (with ''Linux 5.12.15'')<br />
|-<br />
| [[Lenovo ThinkPad T590]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || || Similar to the T490, the pointer occasionally jumps while pressing trackpad buttons<br />
|-<br />
| [[Lenovo ThinkPad T14 (AMD) Gen 1]] || 2020-12-30 || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || Card reader ||<br />
|-<br />
| [[Lenovo ThinkPad T14s (AMD) Gen 1]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || Card reader; Fingerprint sensor ||<br />
|-<br />
| [[Lenovo ThinkPad T14/T14s (Intel) Gen 1]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || SD Card Reader is supported; Fingerprint sensor; Intel + Nvidia GPU ||<br />
|-<br />
| Lenovo ThinkPad T14 (Intel) Gen 2 || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{-}} || ||<br />
|-<br />
| Lenovo ThinkPad T14 (AMD) Gen 2 || 2021-11-20 || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Yes}} || {{Y|Yes}} || {{-}} || ||<br />
|-<br />
| Lenovo ThinkPad T15 (Intel) Gen 2 || 2021-05-22 || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Untested}} || {{Y|Untested}} || Fingerprint scanner is supported ||<br />
|-<br />
| Lenovo ThinkPad T14s (AMD) Gen 2 || 2021-06-26 || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Yes}} || {{Y|Untested}} || {{Y|Untested}} || {{Y|Untested}} || || Wi-Fi driver is not in kernel as of 2021-06-26, kernel patch is available<br />
|-<br />
|}<br />
<br />
==== W series ====<br />
<br />
{{Laptops table header}}<br />
|-<br />
| Lenovo ThinkPad W500 || 2019-12 || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || SD card (Yes), Webcam (Yes), Fingerprint Reader (Yes) || Tested January 2020 / Linux 5.4.11<br />
|-<br />
| Lenovo ThinkPad W510 || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Touchscreen (Yes), Fingerprint Reader (Not tested) || Tested April 2017 / Linux 4.10.8<br />
|-<br />
| Lenovo ThinkPad W530 || 2016-03 || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader (Yes) || Tested September 2021 / Linux 5.14.6. ({{AUR|nvidia-470xx-dkms}} and {{AUR|nvidia-470xx-utils}} required for NVIDIA Quadro K1000M; does not work with {{Pkg|nvidia}} since version 495.44-2.)<br />
|-<br />
| Lenovo ThinkPad W540 || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader (Yes) || Tested April 2017 / Linux 4.10.8<br />
|-<br />
| Lenovo ThinkPad W541 || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || SD card (Yes), Webcam (Yes), Fingerprint Reader (Not tested) || Tested August 2018 / Linux 4.17.12<br />
|-<br />
| Lenovo ThinkPad W550s || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint Reader (Yes) || Tested April 2018 / Linux 4.15.15<br />
|-<br />
|}<br />
<br />
==== X series ====<br />
<br />
{{Laptops table header}}<br />
| [[IBM ThinkPad X60s]] || {{-}} || Yes || Yes || Yes || Yes || Yes || NA || NA || ||<br />
|-<br />
| Lenovo ThinkPad X61s || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD slot ||<br />
|-<br />
| [[Lenovo ThinkPad X100e]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Not tested || NA || SD card (Yes), Webcam (Yes) ||<br />
|-<br />
| Lenovo ThinkPad X131e || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || SD card (Yes), Webcam (Yes), [https://bbs.archlinux.org/viewtopic.php?id=159014 WLAN Led seems not controlled] ||<br />
|-<br />
| [[Lenovo ThinkPad X140e]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || SD card (Yes), Webcam (Yes), [https://bbs.archlinux.org/viewtopic.php?id=159014 WLAN Led seems not controlled] ||<br />
|-<br />
| [[Lenovo ThinkPad X200]] || {{-}} || Yes || Yes || Yes || Yes || Yes || NA || Yes || ||<br />
|-<br />
| [[Lenovo ThinkPad X200S]] || {{-}} || Yes || Yes || Yes || Yes || Yes || NA || Yes || Everything worked out of the box. However, fingerprint, SD card and webcam were not tested. Modem needs reset after sleep (sometimes). ||<br />
|-<br />
| [[Lenovo ThinkPad X201]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || ||<br />
|-<br />
| [[Lenovo ThinkPad X220]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes) || Intel Centrino Advanced-N 6205 [Taylor Peak] requires {{Pkg|linux-firmware}}<br />
|-<br />
| [[Lenovo ThinkPad X230]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), UMTS Modem (Yes), Accelerometer (No) ||<br />
|-<br />
| [[Lenovo ThinkPad X240]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || WWAN LTE (yes) || SD card (Yes), Webcam (Yes), Fingerprint (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X250]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X260]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Yes), Webcam (Yes), Fingerprint (Yes) || PSR powersaving is causing some microfreezes. Fix below.<br />
|-<br />
| [[Lenovo ThinkPad X270]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD Card (Yes), Webcam (Yes ? not with cheese but guvcview ?) ||<br />
|-<br />
| [[Lenovo ThinkPad X280]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Yes (Fibcom L830-EB-00) || Webcam (Yes) ||<br />
|-<br />
| Lenovo ThinkPad X390 || 2019-08-01 || Yes || Yes || Yes || Yes || Yes || Yes || Yes (Fibocom L830-EB) || Webcam (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X390 Yoga]] || 2020-02-01 || Yes || Yes || Yes || Yes || Yes || Yes || Yes (Fibocom L830-EB) || Webcam (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X395]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || Webcam (Yes), Fingerprint reader requires installing Synaptics drivers with fwupd, refer to [[Lenovo_ThinkPad_X1_Carbon_(Gen_7)#Fingerprint_sensor|here]].<!--No, WIP[https://forums.lenovo.com/t5/Other-Linux-Discussions/Linux-on-T495/m-p/4474320#M13440])--> || Prevent amdgpu issues by updating to latest BIOS [https://support.lenovo.com/us/en/downloads/ds540046]<br />
|-<br />
| [[Lenovo ThinkPad X13 Gen 1 (AMD)]] || {{-}} || Yes || Yes || Yes || Yes || Proprietary/nonfree || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X13 Yoga (Gen 2)]] || {{-}} || Yes || Yes || NA || Yes || Yes || Yes || No || Webcam (Yes), Fingerprint (Not Tested), Touchscreen & Pen (Yes), Accelerometer (Yes), NFC (Not Tested), Smart Card (Not Tested) ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon]] || {{-}} || Yes || Yes || Yes || Yes || Proprietary/nonfree || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 2)]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 3)]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 4)]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 5)]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Yes || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 6)]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Yes || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 7)]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Internal Mic not working out of the box ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 8)]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Not Tested || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Carbon (Gen 9)]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Partial || Webcam (Yes), Fingerprint (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Extreme]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || Fingerprint reader not supported, Thunderbolt ports not tested || Graphics requires some configuration to work correctly<br />
|-<br />
| [[Lenovo ThinkPad X1 Extreme (Gen 2)]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Extreme (Gen 3)]] || {{-}} || Yes || Yes || Yes || Not tested || Not tested || Yes || NA || ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Yoga (Gen 1)]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Partial || NA || SD card (Yes), Webcam (Yes), Fingerprint (Yes), Touchscreen (Yes), Accelerometer (No) ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Yoga (Gen 3)]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Partial || NA || SD card (Yes), Webcam (Yes), Fingerprint (No), Touchscreen (Yes), Accelerometer (Yes) ||<br />
|-<br />
| [[Lenovo ThinkPad X1 Yoga (Gen 4)]] || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || Webcam (Yes), Microphone (Yes), Fingerprint (Yes), Touchscreen (Yes), Accelerometer (Yes), NFC (No) ||<br />
|}<br />
<br />
==== Yoga Series ====<br />
<br />
{{Laptops table header}}<br />
| Lenovo ThinkPad Yoga 14 || 2015 || Yes || Yes || || Yes || Yes || Yes || || SD card (Yes), Webcam (Yes), Touchscreen (Yes), Tablet (Partial) || The Lenovo ThinkPad Yoga 14 (20FY) is a convertible 14-inch Ultrabook developed by Lenovo in 2015. It is one of many iterations in the ThinkPad line. It's also known as P40 Yoga (type 20GR, 20GQ), S3 (20G0, 20G1) and Yoga 460 (20EM, 20EL). A [https://download.lenovo.com/pccbbs/mobiles_pdf/p40_yoga14_mt20fy_yoga460_hmm_en_sp40j47499_01.pdf hardware maintenance manual is provided online].<br />
|-<br />
| [[Lenovo ThinkPad Yoga 260]] || 2015 || Yes || Yes || Yes || Yes || Yes || Unknown || Yes || SD card (Yes), Webcam (Yes), Fingerprint Reader (Unknown), Touchscreen (Yes), Tablet (Partial), Accelerometer (No) || Wifi requires Kernel 4.3.3+<br />
|-<br />
| [[Lenovo ThinkPad Yoga 370]] || 2017 || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Not tested}} || SD card (Yes), SD card (Yes), Stylus (Yes), Fingerprint Reader (Yes), Touchscreen (Yes), Tablet mode sensor (Yes), Accelerometer (Yes) ||<br />
|-<br />
| Lenovo Yoga 530 || 2018 || Yes || Yes || Not tested || Yes || Not tested || Not tested || Not tested || SD card (Not tested), Webcam (Yes), Fingerprint Reader (Not tested), Touchscreen (Yes), Tablet (Partial) || Trouble with touchpad, but worked with kernel parameters "i8042.noloop i8042.nomux i8042.nopnp i8042.reset" and xf86-input-synaptics<br />
|-<br />
| Lenovo Yoga 710 || 2016 || Yes || Yes || Yes || Yes || Not tested || Yes || Not tested || SD card (Yes), Webcam (Yes), Touchscreen || Everything works<br />
|-<br />
| Lenovo Yoga 720 || 2018 || Yes || Yes || NA || Yes || Yes || Yes || || Fingerprint (No), Touchscreen (Yes), Digitizer (Yes) || Digitizer tested in Krita on 720-13ikb<br />
|-<br />
| Lenovo Yoga S740-15IRH || 2019 || Yes || Yes || Not tested || Yes || Yes || Yes || Not tested || Fingerprint Reader (Not tested), Webcam (Yes), Microphone (Yes), SD card (No)<br />
|-<br />
| [[Lenovo Yoga 9 14ITL5]] || 2020 || Yes || Yes || N/A || Yes || Yes || Yes || N/A || Webcam (Yes), Touchscreen (Yes), Tablet (Yes), Accelerometer (Yes), Fingerprint Reader (No) || See [[Lenovo Yoga 9 14ITL5]] for more details.<br />
|-<br />
| Lenovo Yoga 920 || 2017 || Yes || Yes || Yes || Yes || Yes || Yes || Not tested || Webcam (Yes), Fingerprint Reader (No), Touchscreen (Yes), Active Pen (Yes), Accelerometer (Yes), Automatic Keyboard and Touchpad Disable (Yes, when the screen is flipped all the way) || On KDE, Autorotation can be achieved with custom scripts, the hardware supports it. Not sure whether automatic tablet mode like in Windows could work, would have to find sensor output.<br />
|-<br />
| Lenovo Yoga c930 || 2018 || Yes || Partially (Fix needed for hinge soundbar, bottom speakers not working. Microphone not working) || N/A || Yes || Not tested || Yes || N/A || Webcam (Yes), Touchscreen || See https://github.com/droserasprout/lenovo-yoga-c930-linux for more information and fixes.<br />
|-<br />
| Lenovo Yoga Slim 7 (AMD Ryzen 5) || 2020 || Yes || Yes || N/A || Yes || Yes || Yes, but no Suspend to RAM || N/A || Webcam (Yes), SD card (Yes), Fingerprint Reader (Unknown) || See https://github.com/jrandiny/yoga-slim7-ubuntu for more information and fixes.<br />
|-<br />
| Lenovo Yoga Slim 7 Pro (AMD Ryzen 7) || 2021 || Yes* (See remarks) || Yes || N/A || Yes || Yes || Yes* (See Remarks) || N/A || Webcam (Yes) || BIOS version G7CN16WW (and possibly above) needed for S3 sleep to work.<br />
|-<br />
| Lenovo Yoga Slim 7i Pro (Intel Core i7) || 2021-10-01 || Yes* || Yes* || N/A || Yes || Yes || Not tested || N/A || Webcam (Yes), Keyboard (Yes*) || Panel Self Refresh needs to be disabled with {{ic|1=i915.enable_psr=0}} to prevent screen flickering. {{Pkg|sof-firmware}} is required for the sound to work. Keyboard needs {{ic|i8042.direct}} and {{ic|i8042.dumbkbd}} kernel parameters.<br />
|-<br />
| [[Lenovo Yoga Slim 9 (intel)|Lenovo Yoga Slim 9 14ITL5]] || 2021-04-11 || Yes || No || N/A || Yes || Yes || Yes || N/A || Webcam (Yes), Touchscreen (Yes) || Touchpad requires additional work, keyboard needs special kernel parameter.<br />
|-<br />
| Lenovo Yoga C740 || 2021-01-17 || Yes || Yes* || N/A || Yes || Yes || Yes || N/A || Webcam (Yes), Fingerprint Reader (No) || *{{Pkg|sof-firmware}} is required for microphone support. Maximum charge can be limited with the ideapad_acpi driver. See [[#Battery Conservation Mode on IdeaPad laptops]]<br />
|-<br />
| Lenovo Yoga Duet 7 13IML05 || 2020-05-27 || Yes || No || N/A || Yes || Yes || Yes || N/A || Webcam (Yes), Touchscreen (Yes), Tablet (Yes), Accelerometer (Yes), Detachable keyboard/trackpad (Not when detached), SD Card (Not tested). || No fix for sound at present. Detachable keyboard/trackpad will connect via Bluetooth, but no events are received.<br />
|-<br />
| Lenovo Yoga 9i 15IMH5|| 2021 || Yes || Yes || N/A || Yes || Yes || Yes || N/A || Webcam (Yes), Fingerprint Reader (No), Touchscreen (Yes), Touchpad (Yes) || Issue with bottom speakers. Touchscreen on Xorg not well handeled with finger, with stylus it's OK, works perfectly with Wayland.<br />
|-<br />
| Lenovo Yoga Slim 7 Carbon 14ACN6 || 2021 || Yes || Yes* (partially, see notes) || N/A || Yes || Yes || Yes || N/A || Webcam (Yes), Touchscreen (Yes), Touchpad (Yes), Bluetooth (Yes), Microphone (Yes) || Issue with speakers having very low volume, with Bluetooth headphones the sound works as expected, built-in microphone works as expected. Otherwise works perfectly fine with touchscreen, wireless and all on GNOME/Wayland. Closing the lid to sleep works out of the box.<br />
|}<br />
<br />
==== Helix Series ====<br />
<br />
{{Laptops table header}}<br />
| [[Lenovo ThinkPad Helix]] || {{-}} || YES || YES || NA || YES || YES || NA || Touchscreen (yes), Pen (yes), Sensors (yes) || ||<br />
|-<br />
| [[Lenovo ThinkPad Helix 2nd Gen]] || 2018-04-01 || YES || YES || NA || YES || Not tested || Yes* (with updated BIOS) || Touchscreen (yes), Pen (not tested), Sensors (w/ patched kernel) || NA || Only suspend-to-idle ("freeze") is supported<br />
|-<br />
|}<br />
<br />
== Lenovo ==<br />
<br />
=== IdeaPad ===<br />
<br />
{{Laptops table header}}<br />
| Lenovo IdeaPad 120S || 2018-04-26 || {{Yes}} || {{Yes}} || {{Y|Not tested}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|N/A}} || Everything works ||<br />
|-<br />
| [[Lenovo IdeaPad Flex 10]] || {{-}} || {{Yes}}* || {{Yes}} || {{Y|Not tested}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|N/A}} || Touchscreen* ||<br />
|-<br />
| Lenovo IdeaPad Flex 14 || {{-}} || {{Yes}} || {{Yes}} || {{Y|Not tested}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|N/A}} || Fingerprint sensor ||<br />
|-<br />
| [[Lenovo IdeaPad S10]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Not tested}} || {{Y|N/A}} || ||<br />
|-<br />
| Lenovo IdeaPad S100 || {{-}} || {{Yes}} || {{Yes}} || {{Y|Not tested}} || {{Yes}} || {{Y|Not tested}} || {{Y|Not tested}} || {{Y|N/A}} || || The Bluetooth module is pretty arcane, so it was not tested.<br />
|-<br />
| [[Lenovo IdeaPad S400 Touch]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Not tested}} || {{Y|N/A}} || ||<br />
|-<br />
| Lenovo IdeaPad U430p || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Not tested}} || {{Y|N/A}} || ||<br />
|-<br />
| Lenovo IdeaPad Y700 || 2015-12-01 || {{Yes}} || {{Yes}}* || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Not tested}} || {{Y|N/A}} || Trackpad - [https://unix.stackexchange.com/questions/362165/lenovo-y700-elantech-touchpad-query-0x01-failed buggy] || [https://bugzilla.kernel.org/show_bug.cgi?id=151681 Trackpad requires pata_legacy to be blacklisted]<br />
|-<br />
| [[Lenovo IdeaPad Z580]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|N/A}} || ||<br />
|-<br />
| [[Lenovo IdeaPad 720s]] || 2018-03-01 || {{Yes}} || {{Yes}} || {{Yes}}* || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|N/A}} || Fingerprint reader not working || *requires USB or USB C dongle<br />
|-<br />
| [[Lenovo IdeaPad 720s (Ryzen)]] || 2018-02-01 || {{Y|Not tested}} || {{Y|Not tested}} || {{Yes}}* || {{R|No}} || {{Y|Not tested}} || {{Y|Not tested}} || {{Y|N/A}} || Fingerprint reader not tested but most likely not working || *requires USB or USB C dongle<br />
|-<br />
| Lenovo Ideapad 320 || 2018-03-01 || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Not tested}} || {{Y|N/A}} || To stop constant annoying messages by AMD-Vi, use 'iommu=soft' & 'amd_iommu=off' in kernel arguments ||<br />
|-<br />
| Lenovo Ideapad 320-15IKB || 2018-03-01 || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}|| {{Y|N/A}} || Synaptics Fingerprint does not work. There is a dead driver project [https://github.com/nmikhailov/Validity90 here] and little/no hope of Lenovo or Synaptics developing a driver for Linux ||<br />
|-<br />
| Lenovo Ideapad 330S-14IKB || 2019-10-01 || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Not tested}} || {{Y|Not tested}} || {{Y|N/A}} || {{ic|Firmware Error (ACPI): Could not resolve [^^^GFX0.AFN2], AE_NOT_FOUND (20181213/psargs-503)}} is raised every few seconds, and can only be turned off by disabling the ACPI ({{ic|1=acpi=off}}) or by connecting the laptop to a charger. Tried with both the stock BIOS and the latest update (7SCN34WW) to no avail. ||<br />
|-<br />
| Lenovo Ideapad N24 || 2018-04-01 || {{Yes}} || {{Yes}} || {{Y|Not tested}} || {{Yes}} || {{Y|Not tested}} ||{{Y|Not tested}} || {{Y|N/A}} || Touchscreen ||<br />
|-<br />
| Lenovo Ideapad 3-15ARE05 || 2020-10-27 || {{Yes}} || {{Yes}} || {{Y|Not tested}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|N/A}} || Touchpad requires blacklisting the {{ic|elants_i2c}} kernel module to work; fingerprint sensor (by Elan Microelectronics Corp. - USB ID 04f3:0c57) does not work (no support in [[fprint]]) ||<br />
|-<br />
| Lenovo IdeaPad 5 15ITL05 || 2020-09-15 || {{Yes}} || {{Yes}} || {{Yes}}* || {{Yes}} || {{Yes}} || {{Y|Not tested}} || {{Y|N/A}} || Secure boot and Intel VMD Controller need to be disabled in BIOS, sound requires sof-firmware, xbacklight does not work (use light), fingerprint sensor (by Shenzhen Goodix Technology Co., Ltd. - USB ID 27c6:55a2) does not work (no support in fprint) || *requires USB or USB C dongle<br />
|-<br />
| [[Lenovo IdeaPad 5 15are05]] || 2020-11-09 || {{Yes}} || {{Yes}} || {{Yes}}* || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|N/A}} || Screen backlight control requires {{ic|1=acpi_backlight=video}} kernel argument; fingerprint sensor (by Shenzhen Goodix Technology Co., Ltd. - USB ID 27c6:55a2) does not work (no support in [[fprint]]) || *required USB or USB C dongle<br />
|-<br />
| Lenovo IdeaPad 3 Gaming 15ARH05 || 2021-11-03 || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|N/A}} || N/A || Fn+Q to change fan/performance modes seems to be working, although there is no way inside Linux to tell as of kernel 5.14 (had to reboot into the firmware), {{ic|ideapad_laptop}} does not show said changes in the {{ic|fan_mode}} interface<br />
|-<br />
| Lenovo Ideapad 5 Pro 16ACH || 2021-12-13 || {{Yes}} || {{Yes}} || {{Yes}}* || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|N/A}} ||120hz screen, brightness adjustment, function keys and keyboard backlight is working. Wi-Fi (MEDIATEK Corp. Device 7961) works out of the box|| *requires USB or USB C dongle<br/><br/>There appears to be no way to control the keyboard backlight through software. The machine always boots with the keyboard backlight disabled. Using {{ic|Fn+Spacebar}} still works to control the backlight.<br />
|-<br />
|}<br />
<br />
=== Battery Conservation Mode on IdeaPad laptops and Others ===<br />
<br />
Battery Conservation Mode is a feature that limits battery charging to 55-60% of its capacity to improve battery life, being most useful when the laptop tends to run on external power much of the time. This works on many Lenovo laptops like IdeaPad and Thinkbook series. To check if your laptop is supported, try to set the battery conservation mode in the Vantage app on Windows. If it works on Windows, it can be enabled or disabled on Linux in the following manner:<br />
<br />
:First make sure the '''ideapad_laptop''' kernel module is loaded, with the {{ic|lsmod}} command.<br />
:If it is, run the following command as root to enable Battery Conservation Mode:<br />
<br />
# echo 1 >/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode<br />
<br />
:A 0 will in turn disable the feature.<br />
<br />
{{Note|1=<br><br />
* Both the presence and implementation of this feature vary by model. Particularly, the name of the folder '''VPC2004:00''' could differ.<br />
* If the above does not work on your laptop, you can try a different method described [https://forums.linuxmint.com/viewtopic.php?f=49&t=286237#p1583578 here], which may require some (further) trial and error.}}<br />
<br />
=== B series ===<br />
<br />
{{Laptops table header}}<br />
| Lenovo B50 || {{-}} || Yes || Yes || Yes || Yes || Not tested || Not tested || Not tested || ||<br />
|-<br />
| Lenovo B50-70 || {{-}} || Yes* ||Yes || Yes || Yes || Yes || Not tested || NA || See below* ||<br />
|-<br />
| Lenovo B450 || {{-}} || Yes ||Yes || Yes || Yes || NA || Not tested || NA || ||<br />
|-<br />
|}<br />
<br />
=== K series ===<br />
<br />
{{Laptops table header}}<br />
| Lenovo K450e || {{-}} || Yes || Yes || Yes || Yes || Not tested || Yes || Not tested || ||<br />
|-<br />
|}<br />
<br />
=== N series ===<br />
<br />
{{Laptops table header}}<br />
| Lenovo N200 (3000) || {{-}} || Yes* || Yes || Yes || Yes || Yes* || NA || NA || See below ||<br />
|-<br />
|}<br />
<br />
=== S series ===<br />
<br />
{{Laptops table header}}<br />
| [[Lenovo S20-30]] || 2020-06-26 || Yes || Yes || Yes || Yes* || ? || Yes || NA || SD Card (Yes), VGA Out (Yes), Touchpad (Yes) ||<br />
|-<br />
| Lenovo S21e-20 || 2015-07-01 || Yes || Yes || NA || Yes* || ? || Yes || NA || SD Card (Yes), USB 3.0 (Yes), HDMI Out (?), Touchpad (Yes*) ||<br />
|-<br />
|}<br />
<br />
=== U Series ===<br />
<br />
{{Laptops table header}}<br />
| Lenovo U31-70 || 2015-10-01 || Yes || Yes || Yes || Yes* || Yes || Yes || NA || SD Card (Yes), USB 3.0 (Yes), HDMI Out (Yes), Touchpad (Yes), Webcam (Yes) ||<br />
|-<br />
|}<br />
<br />
=== V Series ===<br />
<br />
{{Laptops table header}}<br />
| Lenovo V110-15ISK || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Not Tested}} || {{Yes}} || {{Y|NA}} || SD Card (Yes), USB 3.0 (Not Tested), HDMI Out (Not Tested), Touchpad (Yes), Webcam (Yes) ||<br />
|-<br />
| Lenovo V130-15IKB || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|NA}} || SD Card (Yes), USB 4.0 (Yes), HDMI Out (Yes), Touchpad (Yes), Webcam (Yes) ||<br />
|-<br />
| Lenovo V330-15IKB || 2018-10-01 || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Y|Not Tested}} || {{Yes}} || {{Y|NA}} || Fingerprint (No, no driver exists for the Validity/Synaptics 06cb:0081 Fingerprint Reader), Touchpad (Yes), Webcam (Yes) ||<br />
|-<br />
| Lenovo V15-IIL || 2022-02-16 || {{Yes}} || {{Yes}} || {{No}} || {{Yes}} || {{Yes}} || {{Y|Not Tested}} || {{Y|NA}} || SD-Card Reader (Yes), HDMI Out (Yes), USB 3.0 (Yes), Touchpad (Yes), Webcam (Yes) || Wireless is not working at start, {{ic|rfkill unblock all}} should be run for it to work. Touchpad needs {{ic|1=pci=nocrs}} in [[kernel parameters]] to be detected.<br />
|-<br />
| [[Lenovo V15 G2-ALC]] || {{-}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{G|Works with {{Pkg|bluez}}}} || {{Yes}} || {{Y|NA}} || HDMI Out (Yes), USB 3.0 (Yes), Type-C (Yes), Touchpad (Yes), Webcam (Yes) || Wireless is not working at start, {{ic|rfkill unblock all}} should be run for it to work.<br />
|-<br />
|}<br />
<br />
=== Legion series ===<br />
<br />
{{Laptops table header}}<br />
| Lenovo Legion Y520 || 2019-06-01 || Yes || Yes || Yes || Yes || Yes || Yes || Yes || SD card (Not working properly), Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Not tested), Touchpad (Yes), NVMe M.2 SSD (Yes), GeForce GTX 1050 Ti (Yes) || Tested Feb 2020 / Linux 5.5.4. Must change SATA configuration in BIOS from RAID to AHCI in order to recognize SSD.<br />
|-<br />
| Lenovo Legion Y520 || 2020-10-06 || Yes || Yes || Yes || Yes || Yes || Yes || NA || SD card (Not working properly), Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Yes, also works as DisplayPort), Touchpad (Yes), NVMe M.2 SSD (Yes), GeForce GTX 1050 (Yes) || Tested Oct 2020 / Linux 5.8.13. Must change SATA configuration in BIOS from RAID to AHCI in order to recognize SSD. Some CPU throttling is possible [https://unix.stackexchange.com/questions/491944/cpu-temperatures-in-linux-throttling-or-wrong-reading]. Fan control does not seem to work [https://unix.stackexchange.com/questions/523899/laptop-fan-always-says-its-running-at-8-rpm]<br />
|-<br />
| Lenovo Legion Y730 || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || Yes || Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Not tested), Touchpad (Yes), NVMe M.2 SSD (Yes), GeForce GTX 1050 Ti (Yes) || Tested September 2019 / Linux 5.2.13. Must change SATA configuration in BIOS from RAID to AHCI in order to recognize SSD. Disable nouveau at kernel command line with module_blacklist=nouveau or nouveau.modeset=0<br />
|-<br />
| Lenovo Legion Y7000P-1060 || 2019-03-01 || Yes || Yes || Yes || Yes || Yes || Yes || No || Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Yes), Mini DisplayPort (Not tested), Touchpad (Yes), NVMe SSD (Yes), GeForce GTX 1060 Mobile (Yes) || First tested Aug 2019 / Linux 5.2.9.<br />
<br />
https://linux-hardware.org/index.php?computer=af3a4bc1494f<br />
|-<br />
| Lenovo Legion Y540 || 2020-02-01 || Yes || Yes || Yes || Yes || Yes || Yes || No || Webcam (Yes), USB & USB C (Yes), HDMI (Yes), TouchPad (Yes), NVMe SSD (Yes with AHCI in UEFI), Geforce GTX 1650,1660Ti (Yes, with nvidia and nvidia-prime, with or without switchable/discrete graphics in UEFI), Mini Display Port (Yes, with nvidia and nvidia-prime), Hibernation (Yes, see remarks) || Tested on 4 September 2020 with Linux 5.8.5<br />
Only hibernation to file was tested, setting resume and resume_offset kernel parameters was not enough, adding intel_lpss_pci to [[initramfs]] as mentioned [[Power management/Suspend and hibernate#Suspend/hibernate does not work, or does not work consistently|here]] did the job.<br />
|-<br />
| Lenovo Legion Y545 || 2020-05-01 || Yes || Yes || Yes || Yes || Yes || Yes || No || Webcam (Yes), USB & USB C (Yes), HDMI (Yes), TouchPad (Yes), NVMe SSD (Yes with AHCI in UEFI), Geforce GTX 1650,1660Ti (Yes, with nvidia and nvidia-prime, with or without switchable/discrete graphics in UEFI), Mini Display Port (Not tested), Hibernation (Yes) || Tested on 17 October 2020 with Linux 5.8.14 (Installed Arch on 17 May 2020)<br />
|-<br />
| Lenovo Legion 5 || 2020-11-05 || Yes || Yes || Yes || Yes || Yes || Yes || Untested || USB & USB C (Yes), HDMI (only with NVIDIA Card, Touchpad (Yes with kernel>5.11), NVMe M.2 SSD (Yes), GeForce 1650Ti (Switchable graphical with PRIME, need reboot). || AMD Version. Tested with Linux 5.9.3.<br />
|-<br />
| Lenovo Legion 5i || 2020-08-15 || Yes || Yes || Yes || Yes || Yes || Yes || NA || Webcam (Yes), USB & USB 3.0 (Yes), HDMI (Yes), USB-C (Not tested), Touchpad (Yes), NVMe M.2 SSD (Yes), GeForce RTX 2060 (Yes, switchable graphics works flawlessly with [[NVIDIA Optimus#Using optimus-manager]]) || Intel Version. Cannot change brightness in dynamic graphics mode as of Linux 5.12.13 (26 June 2021).<br />
|-<br />
| Lenovo Legion 5Pi || 2020-08-11 || Yes || Yes || Yes || Yes || Untested || Yes || Untested || USB & USB C (Yes), HDMI (Untested), TouchPad (Yes), NVMe SSD (Yes), Nvidia GeForce GTX 1660 Ti Mobile (Yes, switchable graphics works flawlessly with [[NVIDIA Optimus#Using optimus-manager]]) || Tested on 11 Aug 2020 with Linux 5.7.12. Brightness keys do not work.<br />
|-<br />
| [[Lenovo Legion 7i]] || 2020-08-02 || Yes || No || Yes || Yes || Yes || Yes || N/A || Webcam (Yes), USB & USB C (Yes), HDMI (Untested), TouchPad (Yes), NVMe SSD (In AHCI mode in UEFI), Nvidia Card (Untested) || Sound does not work. Tested on 2 Aug 2020 with Linux 5.7.11<br />
|-<br />
| Lenovo Legion 5 Pro || 2021-07-21 || Yes || Yes || Yes || Yes || Yes || Yes || N/A || Webcam, USB & USB C, HDMI, DisplayPort via USB C, Touchpad, NVMe SSD all work. || Linux 5.12.15. 165Hz only works on discrete mode (with Nvidia GeForce RTX3060 laptop). Brightness control both in discrete and hybrid modes. Discrete mode works on [[NVIDIA]] Driver Version: 460.6 with {{bc|1=Option "RegistryDwords" "EnableBrightnessControl=1"}} added to xorg.conf. Broken in versions 470 and [https://forums.developer.nvidia.com/t/laptop-backlight-control-regression-with-465-24-02/175585/44 495], [https://forums.developer.nvidia.com/t/laptop-backlight-control-regression-with-465-24-02/175585/76 works in beta 510] without extra Xorg configuration. Cannot see CPU temperature or control fans. {{ic|Fn+q}} works to change performance/balanced/quiet mode. {{ic|Fn+l}} works to toggle Y light on back of screen. Realtek RTL8852AE WiFi 6 802.11ax PCIE Adapter requires {{Pkg|linux-firmware}} and {{AUR|rtw89-dkms-git}}. RGB keyboard backlight can be controlled with [https://github.com/imShara/l5p-kbl l5p-kbl].<br />
|}<br />
<br />
=== ThinkBook series ===<br />
<br />
{{Laptops table header}}<br />
| Lenovo ThinkBook 13s Gen 2 AMD || {{-}} || Yes || Yes || N/A || Yes || Yes || Yes || N/A || USB & USB C (Yes), HDMI Out (Yes), Touchpad (Yes), Webcam (Yes), NVMe SSD (Yes), Fingerprint (Untested) || Tested Feb 2021 with Linux 5.10.16<br />
|-<br />
| Lenovo ThinkBook 13s Gen 2 Intel || {{-}} || Yes || Yes || N/A || Yes || Yes || Yes || N/A || USB & USB C (Yes), Thunderbolt 4 (Yes), HDMI Out (Yes), Touchpad (Yes), Webcam (Yes), NVMe SSD (Yes), Fingerprint (No) || Tested Apr 2021 with Linux 5.11.14<br />
|-<br />
| Lenovo ThinkBook 14 Gen 3 ACL (Ryzen) || 2021 || Yes || Yes || Yes || Yes || Yes || Yes || N/A || USB & USB C (Yes), HDMI Out (Yes), Touchpad (Yes), Webcam (Yes), NVMe SSD (Yes), '''Fingerprint (NO - Elan 04f3:0c4b)''', Cardreader (Yes) || Tested November 2021 with Linux 5.15.2<br />
|-<br />
| Lenovo ThinkBook 15 Gen 2 AMD || {{-}} || Yes || Yes || Yes || Yes || Yes || Yes || N/A || USB & USB C (Yes), HDMI Out (Yes), Touchpad (Yes), Webcam (Yes), NVMe SSD (Yes), '''Fingerprint (NO - Elan 04f3:0c4b)''', Cardreader (Yes) For battery conservation look at IdeaPad section|| Tested Mar 2021 with Linux 5.10.19<br />
|-<br />
| Lenovo ThinkBook 16p Gen 2 AMD || {{-}} || Yes || Yes || N/A || Yes || Yes || Yes || N/A || USB & USB C (Yes), Touchpad (Yes), Webcam (Yes), NVMe SSD (Yes), '''Fingerprint (NO - Elan 04f3:0c4b)''', Cardreader (Yes)|| Tested Nov 2021 with Linux 5.15.4<br />
|-<br />
|}<br />
<br />
== Special Notes (*): ==<br />
<br />
{{Accuracy|Lots of vague or unproven bugs/workarounds, poor writing}}<br />
<br />
=== Lenovo ideapad 3 14IIL05 ===<br />
<br />
Passing pci=nocrs as kernel parameter fixes the touchpad. Unfortunately this also disabled my wifi(it was seen by iwctl but never presented a station no matter what i did). I see others online also have this problem(various posts on stackexchange etc). I finally managed to fix it by ''also'' passing pci=realloc so the full line is:<br />
<br />
pci=nocrs pci=realloc<br />
<br />
for getting both wifi and touchpad working.<br />
<br />
Note: I am using refind as boot manager(holy cow so much more straight-forward and less confusing than grub2) and i seem to recall being unable to boot with pci=realloc using grub2. This could just be me dreaming though so it probably bears testing first.<br />
<br />
Everything else works, except the brightness keys -- which sometimes work, and sometimes do not. I have not figured out in which instance they work or not yet.<br />
<br />
=== Lenovo U31-70 ===<br />
<br />
Wireless needs {{Pkg|linux}} >= 4.3 and latest {{Pkg|linux-firmware}}, both packages are currently in testing. Copy one of the firmware blobs {{ic|eeprom_ar6320_2p1_NFA345i.bin}} or {{ic|eeprom_ar6320_2p1_NFA345i_highTX.bin}} from the windows driver to {{ic|/usr/lib/firmware/ath10k/QCA6174/hw2.1/board-pci-168c:0041:17aa:3545.bin}}.<br />
<br />
Wireless with firmware blobs from windows driver may no longer work on {{Pkg|linux}} >= 4.4. Download firmware blob https://github.com/kvalo/ath10k-firmware/blob/f428f53b36b144971c9c4c3d2ebd5fa8cae86c89/QCA6174/hw2.1/board-2.bin and copy it to {{ic|/usr/lib/firmware/ath10k/QCA6174/hw2.1/board-2.bin}}. Tested with {{Pkg|linux}} 4.4.5-1 and {{Pkg|linux-firmware}} 20160113.40e9ae8-1nu<br />
<br />
With packages {{Pkg|linux}} 4.6.1-2 and {{Pkg|linux-firmware}} 20160516.80d463b-1 being in stable, wireless works without any additional steps needed.<br />
<br />
=== Thinkbook 13s (Intel) ===<br />
<br />
This laptop requires firmware in order for the soundcard to work. See [[Advanced Linux Sound Architecture#ALSA firmware]].<br />
<br />
[https://jira.head-point.ru/browse/OPS-224 xf86-video-intel] causes Firefox and Chromium to freeze in X11 session. Removing solves the issue.<br />
<br />
=== Lenovo B50-70 ===<br />
<br />
* UEFI:<br />
** to be able to disable Secure Boot (necessary for dual boot, not needed for Linux only), you have to switch from "UEFI first" to "UEFI only" (or something like this) in UEFI setup menu; the Secure Boot option appears then on the Security tab<br />
** after UEFI update having Linux and Windows installed, the Linux bootloader ceased to be the default one, UEFI started to load Windows by default and it was impossible to select the Linux one in the UEFI boot menu and in the UEFI setup - reinstalling the bootloader helped; having no access to a boot media that supports UEFI, a solution might be also replacing the Windows EFI bootloader file with a Linux one temporalily, in order to be able to boot Linux from HDD<br />
** for the UEFI update, a Windows OS is needed<br />
* Touchpad:<br />
** Synaptics - works after installing Synaptics drivers from repo, possible to change behaviour (like reaction for double tap) according to your wish<br />
* Video:<br />
** in laptops with dual video card (Intel and ATI) - detects both, Intel is active as a default, not checked if it's possible at all to switch between them<br />
<br />
==== Operation with a HDD caddy ====<br />
<br />
When you install an SSD in the place of the plate HDD drive and you want to have your HDD still inside the laptop, it is possible to install it in the place of the optical drive in a special "HDD caddy". The optical drive is of 9 mm height, but a 9,5 mm caddy (ultra slim) fits in the slot. A caddy with a SATA interface is needed. It is difficult to separate the front bezel from the original optical drive (and opening its case does not help, but brings a danger of making a mess in the opening mechanism; the only option is just to pull the bezel using a bit of force, but you risk breaking the latches).<br />
<br />
While the HDD installed instead of the optical drive operates flawlessly in Windows, it was not going to work out of the box in Linux, at least in one case. The kernel tries to establish a connection with the disk, but fails to do it (''SATA link down'' entry in /var/log/messages). The solution is to force a 1.5 Gbps transfer speed (instead of 6 Gbps) by adding a ''libata.force='' kernel parameter. See [https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html] for details.<br />
<br />
=== Lenovo K450e ===<br />
<br />
After installing Arch Linux and booting, a single beep may be heard. To disable this beep, press F1 during startup, then change Boot Priority to 'UEFI First', as well as enabling 'CSM'.<br />
<br />
=== ThinkPad X1 Carbon 3rd ===<br />
<br />
* https://natalian.org/archives/2015/02/18/Archlinux_on_a_Lenovo_X1C3/<br />
<br />
=== Lenovo 3000 N200 ===<br />
<br />
* Sound:<br />
** You may have to append {{ic|1=options snd_hda_intel model=lenovo}} to {{ic|/etc/modprobe.d/modprobe.conf}} for sound to work.<br />
<br />
=== Lenovo ThinkPad T430 ===<br />
<br />
{{Accuracy | I was not able to reproduce this bug as of September 2017 }}<br />
<br />
* Bluetooth (0a5c:21e6 Broadcom Corp. BCM20702 Bluetooth 4.0 [ThinkPad]) appears to be functional, even during standby or hibernation.<br />
<br />
=== Lenovo ThinkPad T440p ===<br />
<br />
* ClickPad: the whole trackpad clicks, and disabling the trackpad using older versions of synclient makes the trackpoint essentially unusable. This has been resolved in newer versions of {{Pkg|xf86-input-synaptics}}.<br />
** See [https://who-t.blogspot.com.au/2014/03/xorg-synaptics-support-for-lenovo-t440.html] and its previous version, [https://who-t.blogspot.com.au/2013/12/lenovo-t440-touchpad-button.html].<br />
** Install {{AUR|xf86-input-mtrack}} for alternative drivers.<br />
* Audio:<br />
** HDMI audio is the default audio output device. Consult the [[ALSA]] page for details on changing the default.<br />
** As the X100e/Mini10, it's possible to mute the headset and speaker outputs separately to the master. Muting the speaker output improves bass output on the headset port.<br />
** If the system fails to wake from sleep, it can lose sync with the internal audio card and speakers/headphones may fail to work. In this case, put the system to sleep, and wake it again and audio functionality should be restored. <br />
* The fingerprint sensor is a Validity VFS5011, available in [[fprint]].<br />
* thinkpad_acpi:<br />
** To toggle Fn-Lock, press Fn + Esc, this will toggle the LED on the keyboard. While the Fn LED is on all Fn functionalities work as intended out of the box. <br />
** Controlling the 'glowing I' LED is apparently not possible.<br />
** fan control does not seem to work.<br />
* Graphics and Video:<br />
** With the integrated GPU, [[xrandr]] can crash while attaching or detaching displays connected via the dock.<br />
** The built-in miniDisplayPort will sometimes spew I²C issues into the kernel log.<br />
** [[Hardware video acceleration]] is highly recommended as it performs significantly better than CPU decoding of large media files.<br />
** '''The BIOS should not be upgraded past version 1.14, as newer BIOSes cause memory corruption when used with Bumblebee.''' See [https://github.com/Bumblebee-Project/bbswitch/issues/78#issuecomment-42741698 Bumblebee GitHub]<br />
* Connectivity:<br />
** Bluetooth is ''extremely'' fragile. The controller works fine most of the time, but can cause the system to wedge totally on sleep/wake cycles, especially if a connection was active at sleep. Disable the controller using {{ic|bluetoothctl}} before sleeping.<br />
<br />
=== Lenovo ThinkPad T560 ===<br />
<br />
* No automatic brightness adjusting when switching power supply battery <-> AC<br />
<br />
* Hardware specifications of test device<br />
** CPU: Intel CORE i7-6600U @ 2.60GHz or Intel CORE i5-6200U @ 2.30GHz or Intel CORE i5-6300U @ 2.40GHz<br />
** GPU Primary: Intel HD 520<br />
** GPU Secondary: Nvidia GeForce 940MX or None<br />
** WiFi: Intel 8260<br />
** Ethernet: Intel I219-LM<br />
** Card reader: Realtek RTS522A<br />
<br />
=== Lenovo ThinkPad T580 ===<br />
<br />
* Although not officially supported, the fingerprint scanner works with {{AUR|python-validity}} (tested 14 July 2021 on Linux 5.12.15)<br />
<br />
=== Lenovo S21e-20 ===<br />
<br />
* Tested with {{Pkg|broadcom-wl-dkms}} 802.11 wireless driver<br />
* Synaptics touchpad required 3 patches to {{Pkg|linux}}:drivers/hid/hid-rmi.c on 2015-07-26 ([https://bugs.freedesktop.org/show_bug.cgi?id=91102 bug report], [https://github.com/harisokanovic/archlinux-packages/commit/f4550c211ca7809ecf926f8074c7b7250a74bd92 kernel recipe patch]). The current 4.3 kernel includes these patches. You will also need to [[install]] the {{Pkg|xf86-input-synaptics}} package.<br />
<br />
==== tpacpi-bat ====<br />
<br />
There is an issue with tpacpi-bat not reporting the right value for the stop threshold. This seems to be related to a buggy BIOS and can not be fixed application wise. <br />
<br />
See https://github.com/teleshoes/tpacpi-bat/issues/44<br />
<br />
==== ThinkPad Edge E420s Delay with Space Bar ====<br />
<br />
Solution: Update BIOS (at least 1.08).<br />
<br />
=== Lenovo IdeaPad Y700 ===<br />
<br />
* The subwoofer does not work out of the box.<br />
** See https://gist.github.com/BXZ/48cd8173807676a1402cf4bc7928c0c0 to get it working.<br />
<br />
=== Thinkpad X260 ===<br />
<br />
* [[Wikipedia:DisplayPort#eDP|Panel Self-Refresh]] (PSR) can cause the screen to randomly freeze every few minutes. This can be fixed by [[Intel graphics#Screen flickering|disabling PSR]].<br />
** See https://reddit.com/r/archlinux/comments/gu0a8a/ for more details.<br />
<br />
=== Thinkpad T14 ===<br />
<br />
* In order to get sound you need to install {{Pkg|sof-firmware}}<br />
* On the AMD version, the internal microphone requires a kernel version of at least 5.8-rc7 with {{ic|1=CONFIG_SND_SOC_AMD_RENOIR=m}} and {{ic|1=CONFIG_SND_SOC_AMD_RENOIR_MACH=m}}. 4-pin jack plugs work with a linux kernel of 5.7.<br />
<br />
== See also ==<br />
<br />
* [https://www.thinkwiki.org/wiki ThinkWiki]<br />
* [https://kozikow.wordpress.com/2016/06/03/installing-and-configuring-arch-linux-on-thinkpad-x1-carbon/ Installing and configuring Arch Linux on ThinkPad X1 Carbon]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=725494Lenovo ThinkPad T14 (AMD) Gen 22022-04-05T21:21:08Z<p>Snakeroot: Adding supported device</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || {{ic|1022:15df}} || {{Yes}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam, the fingerprint reader and the NVME controller.<br />
<br />
=== November 2021 security update ===<br />
<br />
On November 4, 2021 Lenovo pushed System Firmware Version 1.12, a UEFI/BIOS update, to LVFS. This is described as a security update (although without further detail). See [https://fwupd.org/lvfs/devices/com.lenovo.ThinkPadR1MET.firmware LVFS page for this update].<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
Note that keeping the Microsoft Certificates should not brick the machine.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} does not seem to be configurable and shows as having no carrier even when the RJ45 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Unreliable mic mute LED ==<br />
<br />
The mic mute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per the [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 relevant thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics touchpad RMI bus non-functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see the [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 relevant thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Freezing Trackpad ==<br />
<br />
The trackpad freezes randomly. The cure is to unload the psmouse module with rmmod and reload it with modprobe.<br />
<br />
== AMD P-State ==<br />
<br />
Starting with kernel 5.17, AMD processors should have more finesse in frequency control due to the inclusion of the AMD p-states driver. Unfortunately, the {{ic|acpi_cprufreq}} driver does not play well with others. To get it working, blacklist {{ic|acpi_cpufreq}} by adding the entry {{ic|acpi_cpufreq}} to the {{ic|/etc/modprobe.d/blacklist.conf}} file and force the loading of {{ic|amd_pstate}} by creating an {{ic|/etc/modules-load.d/amd_pstate.conf}} file with "amd_pstate" as its contents. Confirm if it has worked by running {{ic|sudo cpupower frequency-info}} to confirm the driver being used.<br />
<br />
== Sleep mode (S3) ==<br />
<br />
Sleep mode and, in particular, the lid switch are slow and flaky unless the sleep mode is set to {{ic|Linux}} rather than {{ic|Windows 10}} in the BIOS. Be sure that you have logged out of, rather than suspending, any Windows 10 installation before changing this.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=725493Lenovo ThinkPad T14 (AMD) Gen 22022-04-05T21:20:07Z<p>Snakeroot: Formatting</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || {{ic|1022:15df}} || {{Yes}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== November 2021 security update ===<br />
<br />
On November 4, 2021 Lenovo pushed System Firmware Version 1.12, a UEFI/BIOS update, to LVFS. This is described as a security update (although without further detail). See [https://fwupd.org/lvfs/devices/com.lenovo.ThinkPadR1MET.firmware LVFS page for this update].<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
Note that keeping the Microsoft Certificates should not brick the machine.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} does not seem to be configurable and shows as having no carrier even when the RJ45 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Unreliable mic mute LED ==<br />
<br />
The mic mute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per the [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 relevant thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics touchpad RMI bus non-functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see the [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 relevant thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Freezing Trackpad ==<br />
<br />
The trackpad freezes randomly. The cure is to unload the psmouse module with rmmod and reload it with modprobe.<br />
<br />
== AMD P-State ==<br />
<br />
Starting with kernel 5.17, AMD processors should have more finesse in frequency control due to the inclusion of the AMD p-states driver. Unfortunately, the {{ic|acpi_cprufreq}} driver does not play well with others. To get it working, blacklist {{ic|acpi_cpufreq}} by adding the entry {{ic|acpi_cpufreq}} to the {{ic|/etc/modprobe.d/blacklist.conf}} file and force the loading of {{ic|amd_pstate}} by creating an {{ic|/etc/modules-load.d/amd_pstate.conf}} file with "amd_pstate" as its contents. Confirm if it has worked by running {{ic|sudo cpupower frequency-info}} to confirm the driver being used.<br />
<br />
== Sleep mode (S3) ==<br />
<br />
Sleep mode and, in particular, the lid switch are slow and flaky unless the sleep mode is set to {{ic|Linux}} rather than {{ic|Windows 10}} in the BIOS. Be sure that you have logged out of, rather than suspending, any Windows 10 installation before changing this.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=725492Lenovo ThinkPad T14 (AMD) Gen 22022-04-05T21:16:47Z<p>Snakeroot: Updated to reflect that pstate does work.</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || {{ic|1022:15df}} || {{Yes}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== November 2021 security update ===<br />
<br />
On November 4, 2021 Lenovo pushed System Firmware Version 1.12, a UEFI/BIOS update, to LVFS. This is described as a security update (although without further detail). See [https://fwupd.org/lvfs/devices/com.lenovo.ThinkPadR1MET.firmware LVFS page for this update].<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
Note that keeping the Microsoft Certificates should not brick the machine.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} does not seem to be configurable and shows as having no carrier even when the RJ45 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Unreliable mic mute LED ==<br />
<br />
The mic mute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per the [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 relevant thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics touchpad RMI bus non-functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see the [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 relevant thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Freezing Trackpad ==<br />
<br />
The trackpad freezes randomly. The cure is to unload the psmouse module with rmmod and reload it with modprobe.<br />
<br />
== AMD P-State ==<br />
<br />
Starting with kernel 5.17, AMD processors should have more finesse in frequency control due to the inclusion of the AMD p-states driver. Unfortunately, the acpi_cprufreq driver does not play well with others. To get it working, blacklist acpi_cpufreq by adding the entry acpi_cpufreq to the /etc/modprobe.d/blacklist.conf file and force the loading of amd_pstate by creating a /etc/modules-load.d/amd_pstate.conf file with amd_pstate as its contents. Confirm if it has worked by running sudo cpupower frequency-info to confirm the driver being used.<br />
<br />
== Sleep mode (S3) ==<br />
<br />
Sleep mode and, in particular, the lid switch are slow and flaky unless the sleep mode is set to {{ic|Linux}} rather than {{ic|Windows 10}} in the BIOS. Be sure that you have logged out of, rather than suspending, any Windows 10 installation before changing this.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=724202Lenovo ThinkPad T14 (AMD) Gen 22022-03-24T22:17:02Z<p>Snakeroot: Added info about p-state driver unavailability and psmouse flakiness.</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || {{ic|1022:15df}} || {{Yes}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== November 2021 security update ===<br />
<br />
On November 4, 2021 Lenovo pushed System Firmware Version 1.12, a UEFI/BIOS update, to LVFS. This is described as a security update (although without further detail). See [https://fwupd.org/lvfs/devices/com.lenovo.ThinkPadR1MET.firmware LVFS page for this update].<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
Note that keeping the Microsoft Certificates should not brick the machine.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} does not seem to be configurable and shows as having no carrier even when the RJ45 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Unreliable mic mute LED ==<br />
<br />
The mic mute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per the [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 relevant thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics touchpad RMI bus non-functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see the [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 relevant thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Freezing Trackpad ==<br />
<br />
The trackpad freezes randomly. The cure is to unload the psmouse module with rmmod and reload it with modprobe.<br />
<br />
== AMD P-State Non-Functional ==<br />
<br />
Starting with kernel 5.17, AMD processors should have more finesse in frequency control due to the inclusion of the AMD p-states driver. Unfortunately, this requires Lenovo to update firmware, which it has not yet done.<br />
<br />
== Sleep mode (S3) ==<br />
<br />
Sleep mode and, in particular, the lid switch are slow and flaky unless the sleep mode is set to {{ic|Linux}} rather than {{ic|Windows 10}} in the BIOS. Be sure that you have logged out of, rather than suspending, any Windows 10 installation before changing this.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Avahi&diff=705031Avahi2021-12-09T16:42:35Z<p>Snakeroot: Move "files" and "myhostname" to just before dns to conform to changes in base nsswitch.conf in filesystem 2021.12.07-1</p>
<hr />
<div>[[Category:Multicast DNS]]<br />
[[fr:Avahi]]<br />
[[ja:Avahi]]<br />
From [[Wikipedia:Avahi (software)]]:<br />
:[https://avahi.org/ Avahi] is a free [[Wikipedia:Zero-configuration networking|Zero-configuration networking]] (zeroconf) implementation, including a system for multicast DNS/DNS-SD service discovery. It allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example you can plug into a network and instantly find printers to print to, files to look at and people to talk to. It is licensed under the GNU Lesser General Public License (LGPL).<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|avahi}} package.<br />
<br />
You can manage the Avahi daemon with {{ic|avahi-daemon.service}} [[systemd#Using units|using systemd]].<br />
<br />
{{Note|[[systemd-resolved]] has a built-in multicast DNS service, make sure to disable systemd-resolved's mDNS resolver/responder (refer to {{man|5|resolved.conf}}) or [[disable]] {{ic|systemd-resolved.service}} entirely before using Avahi.}}<br />
<br />
== Using Avahi ==<br />
<br />
=== Hostname resolution ===<br />
<br />
Avahi provides local hostname resolution using a "''hostname''.local" naming scheme. To enable it, install the {{Pkg|nss-mdns}} package and [[start/enable]] {{ic|avahi-daemon.service}}.<br />
<br />
Then, edit the file {{ic|/etc/nsswitch.conf}} and change the {{ic|hosts}} line to include {{ic|1=mdns_minimal [NOTFOUND=return]}} before {{ic|resolve}} and {{ic|dns}}:<br />
<br />
hosts: ... '''mdns_minimal [NOTFOUND=return]''' resolve [!UNAVAIL=return] files ...<br />
<br />
{{Note|<br />
* If you experience slowdowns in resolving {{ic|.local}} hosts try to use {{ic|mdns4_minimal}} instead of {{ic|mdns_minimal}}.<br />
* The line above makes {{ic|nss-mdns}} authoritative for the {{ic|.local}} domain, unless your unicast DNS server responds to {{ic|SOA}} queries for the top level {{ic|local}} name, or if the request has more than two labels. See {{ic|nss-mdns}} [https://github.com/lathiat/nss-mdns/blob/master/README.md#activation activation notes].<br />
** [[systemd-resolved]] responds to these queries even if its mDNS support is disabled. See [[#systemd-resolved prevents nss-mdns from working]].<br />
}}<br />
<br />
==== Configuring mDNS for custom TLD ====<br />
<br />
The {{ic|mdns_minimal}} module handles queries for the {{ic|.local}} TLD only. Note the {{ic|<nowiki>[NOTFOUND=return]</nowiki>}}, which specifies that if {{ic|mdns_minimal}} cannot find {{ic|*.local}}, it will not continue to search for it in {{ic|dns}}, {{ic|myhostname}}, etc.<br />
<br />
In case you want Avahi to support other TLDs, you should:<br />
<br />
* replace {{ic|1=mdns_minimal [NOTFOUND=return]}} with the full {{ic|mdns}} module. There also are IPv4-only and IPv6-only modules {{ic|mdns[46](_minimal)}}<br />
* customize {{ic|/etc/avahi/avahi-daemon.conf}} with the {{ic|domain-name}} of your choice<br />
* whitelist Avahi custom TLDs in {{ic|/etc/mdns.allow}}<br />
<br />
==== Tools ====<br />
<br />
Avahi includes several utilities which help you discover the services running on a network. For example, run<br />
<br />
$ avahi-browse --all --ignore-local --resolve --terminate<br />
<br />
to discover services in your network.<br />
<br />
The Avahi Zeroconf Browser ({{ic|avahi-discover}} – note that it needs Avahi's optional dependencies {{Pkg|gtk3}}, {{Pkg|dbus-python}} and {{Pkg|python-gobject}}) shows the various services on your network. You can also browse SSH and VNC Servers using {{ic|bssh}} and {{ic|bvnc}} respectively.<br />
<br />
=== Firewall ===<br />
<br />
Be sure to open UDP port {{ic|5353}} if you are using a [[firewall]].<br />
<br />
=== Link-Local (Bonjour/Zeroconf) chat ===<br />
<br />
Avahi can be used for Bonjour protocol support under Linux. Check [[Wikipedia:Comparison of instant messaging clients]] or [[List of applications#Instant messaging clients]] for a list of clients supporting the Bonjour protocol.<br />
<br />
=== Obtaining IPv4LL IP address ===<br />
<br />
{{Merge|dhcpcd|should be merged into the main page}}<br />
<br />
By default, if you are getting IP using DHCP, you are using the {{Pkg|dhcpcd}} package. It can attempt to obtain an IPv4LL address if it failed to get one via DHCP. By default this option is disabled. To enable it, comment noipv4ll string:<br />
<br />
{{hc|/etc/dhcpcd.conf|<br />
...<br />
#noipv4ll<br />
...}}<br />
<br />
Alternatively, run {{ic|avahi-autoipd}}:<br />
<br />
# avahi-autoipd -D<br />
<br />
== Adding services ==<br />
<br />
Avahi advertises the services whose {{ic|*.service}} files are found in {{ic|/etc/avahi/services}}. Files in this directory must be readable by the {{ic|avahi}} user/group.<br />
<br />
If you want to advertise a service for which there is no {{ic|*.service}} file, it is very easy to create your own.<br />
As an example, let us say you wanted to advertise a quote of the day (QOTD) service operating per RFC 865 on TCP port {{ic|17}} which you are running on your machine<br />
<br />
The first thing to do is to determine the {{ic|<type>}}. {{man|5|avahi.service}} indicates that the type should be "the DNS-SD service type for this service. e.g. '_http._tcp'". Since the [http://www.dns-sd.org/ServiceTypes.html DNS-SD register was merged into the IANA register in 2010], we look for the service name on the [https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml IANA register] or in {{ic|/etc/services}} file. The service name shown there is {{ic|qotd}}. Since we are running QOTD on tcp, we now know the service is {{ic|_qotd._tcp}} and the port (per IANA and RFC 865) is {{ic|17}}.<br />
<br />
Our service file is thus:<br />
<br />
{{hc|qotd.service|<nowiki><br />
<?xml version="1.0" standalone='no'?><!--*-nxml-*--><br />
<!DOCTYPE service-group SYSTEM "avahi-service.dtd"><br />
<br />
<service-group><br />
<br />
<name replace-wildcards="yes">%h</name><br />
<br />
<service><br />
<type>_qotd._tcp</type><br />
<port>17</port><br />
</service><br />
<br />
</service-group><br />
</nowiki>}}<br />
<br />
For more complicated scenarios, such as advertising services running on a different server, DNS sub-types and so on, consult {{man|5|avahi.service}}.<br />
<br />
=== SSH ===<br />
<br />
Avahi comes with an example service file to advertise an SSH server. To enable it:<br />
<br />
# cp /usr/share/doc/avahi/ssh.service /etc/avahi/services/<br />
<br />
=== File sharing ===<br />
<br />
==== NFS ====<br />
<br />
If you have an [[NFS]] share set up, you can use Avahi to be able to automount them in Zeroconf-enabled browsers (such as Konqueror on KDE and Finder on macOS) or file managers such as [[GNOME/Files]].<br />
<br />
Create a {{ic|.service}} file in {{ic|/etc/avahi/services}} with the following contents:<br />
<br />
{{hc|/etc/avahi/services/nfs_Zephyrus_Music.service|<nowiki><br />
<?xml version="1.0" standalone='no'?><br />
<!DOCTYPE service-group SYSTEM "avahi-service.dtd"><br />
<service-group><br />
<name replace-wildcards="yes">NFS Music Share on %h</name><br />
<service><br />
<type>_nfs._tcp</type><br />
<port>2049</port><br />
<txt-record>path=/data/shared/Music</txt-record><br />
</service><br />
</service-group><br />
</nowiki>}}<br />
<br />
The port is correct if you have ''insecure'' as an option in your {{ic|/etc/exports}}; otherwise, it needs to be changed (note that ''insecure'' is needed for macOS clients). The path is the path to your export, or a subdirectory of it. For some reason the automount functionality has been removed from Leopard, however [http://www.macosxhints.com/article.php?story=20071116042238744 a script is available]. This was based upon [https://ubuntuforums.org/showthread.php?p=4387032#post4387032 this post].<br />
<br />
==== Samba ====<br />
<br />
With the Avahi daemon running on both the server and client, the file manager on the client should automatically find the server.<br />
<br />
==== Vsftpd ====<br />
<br />
You can also auto-discover regular FTP servers, such as [[vsftpd]]. Install the {{Pkg|vsftpd}} package and change the settings of vsftpd according to your own personal preferences (see [https://ubuntuforums.org/showthread.php?t=218630 this thread on ubuntuforums.org] or {{man|5|vsftpd.conf}}).<br />
<br />
Create a {{ic|.service}} file in {{ic|/etc/avahi/services}} with the following contents:<br />
<br />
{{hc|/etc/avahi/services/ftp.service|<nowiki><br />
<?xml version="1.0" standalone='no'?><br />
<!DOCTYPE service-group SYSTEM "avahi-service.dtd"><br />
<service-group><br />
<name>FTP file sharing</name><br />
<service><br />
<type>_ftp._tcp</type><br />
<port>21</port><br />
</service><br />
</service-group><br />
</nowiki>}}<br />
<br />
The FTP server should now be advertised by Avahi. You should now be able to find the FTP server from a file manager on another computer in your network. You might need to enable [[#Hostname resolution]] on the client.<br />
<br />
=== AirPrint from Mobile Devices ===<br />
<br />
{{Merge | AirPort#Printing | AirPrint is a feature provided by the Apple AirPort Express and by some printers. The manual configuration technique (using JetDirect) can also apply here and may be easier.}}<br />
<br />
Avahi along with [[CUPS]] also provides the capability to print to just about any printer from airprint compatible mobile devices. In order to enable print capability from your device, simply create an Avahi service file for your printer in {{ic|/etc/avahi/services/}}. An example of a generic services file for an HP-Laserjet printer would be similar to the following with the {{ic|name}}, {{ic|rp}}, {{ic|ty}}, {{ic|adminurl}} and {{ic|note}} fields changed.<br />
<br />
{{hc|/etc/avahi/services/airprint.service|<nowiki><br />
<?xml version="1.0" standalone='no'?><!--*-nxml-*--><br />
<!DOCTYPE service-group SYSTEM "avahi-service.dtd"><br />
<service-group><br />
<name>yourPrnterName</name><br />
<service><br />
<type>_ipp._tcp</type><br />
<subtype>_universal._sub._ipp._tcp</subtype><br />
<port>631</port><br />
<txt-record>txtver=1</txt-record><br />
<txt-record>qtotal=1</txt-record><br />
<txt-record>rp=printers/yourPrnterName</txt-record><br />
<txt-record>ty=yourPrnterName</txt-record><br />
<txt-record>adminurl=http://198.168.7.15:631/printers/yourPrnterName</txt-record><br />
<txt-record>note=Office Laserjet 4100n</txt-record><br />
<txt-record>priority=0</txt-record><br />
<txt-record>product=(GPL Ghostscript)</txt-record><br />
<txt-record>printer-state=3</txt-record><br />
<txt-record>printer-type=0x801046</txt-record><br />
<txt-record>Transparent=T</txt-record><br />
<txt-record>Binary=T</txt-record><br />
<txt-record>Fax=F</txt-record><br />
<txt-record>Color=T</txt-record><br />
<txt-record>Duplex=T</txt-record><br />
<txt-record>Staple=F</txt-record><br />
<txt-record>Copies=T</txt-record><br />
<txt-record>Collate=F</txt-record><br />
<txt-record>Punch=F</txt-record><br />
<txt-record>Bind=F</txt-record><br />
<txt-record>Sort=F</txt-record><br />
<txt-record>Scan=F</txt-record><br />
<txt-record>pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/urf</txt-record><br />
<txt-record>URF=W8,SRGB24,CP1,RS600</txt-record><br />
</service><br />
</service-group><br />
</nowiki>}}<br />
<br />
Alternatively, https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py can be used to generate Avahi service files. It depends on {{Pkg|python}} and {{Pkg|python-pycups}}. The script can be run using:<br />
<br />
# python3 airprint-generate.py -d /etc/avahi/services<br />
<br />
{{Note|If your printer under http://localhost:631/printers is "Not Shared", this python script will not output any file to /etc/avahi/services; in that case, you will need to "Modify Printer" under one of the CUPS drop-down menus to turn sharing on. If that does not work, check out the ArchWiki on [[CUPS printer sharing]].}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Hostname changes with appending incrementing numbers ===<br />
<br />
This is a [https://github.com/lathiat/avahi/issues/117 known bug] that is caused by a hostname race condition. One possible workaround is [https://github.com/lathiat/avahi/issues/117#issuecomment-302849130 disabling IPv6] to attempt to prevent the race condition. If multiple interfaces are present [https://github.com/lathiat/avahi/issues/117#issuecomment-401225716 use allow-interfaces] to limit Avahi to a single interface. Another possible workaround is to [https://github.com/lathiat/avahi/issues/117#issuecomment-442201162 disable the cache] to prevent Avahi from checking for host name conflicts altogether, but this prevents Avahi from performing lookups.<br />
<br />
=== systemd-resolved prevents nss-mdns from working ===<br />
<br />
''nss-mdns'' only works if the DNS server listed in {{ic|/etc/resolv.conf}} returns NXDOMAIN to SOA queries for the "local" domain.[https://github.com/lathiat/nss-mdns/blob/master/README.md#activation] Even if [[systemd-resolved]] is configured with {{ic|1=MulticastDNS=no}} in {{man|5|resolved.conf}}, it will not return NXDOMAIN for these queries. See [https://github.com/systemd/systemd/issues/21659 systemd issue 21659].<br />
<br />
A solution is to use the full {{ic|mdns}} NSS module instead of {{ic|mdns_minimal}} and create {{ic|/etc/mdns.allow}} to allow only the "local" domain. For example:<br />
<br />
{{hc|/etc/nsswitch.conf|2=<br />
hosts: mymachines '''mdns [NOTFOUND=return]''' resolve [!UNAVAIL=return] files myhostname dns<br />
}}<br />
<br />
{{hc|/etc/mdns.allow|<br />
.local.<br />
.local<br />
}}<br />
<br />
== See also ==<br />
<br />
* [https://avahi.org/ Avahi] - Official project website<br />
* [[Wikipedia:Avahi (software)]]<br />
* [https://www.apple.com/itunes/download/ iTunes (includes Bonjour)] - Enable Zeroconf on Windows<br />
* http://www.zeroconf.org/</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=701332Lenovo ThinkPad T14 (AMD) Gen 22021-11-08T20:50:02Z<p>Snakeroot: Drawing attention to security update.</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || {{ic|1022:15df}} || {{Yes}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== November 2021 security update ===<br />
<br />
On November 4, 2021 Lenovo pushed System Firmware Version 1.12, a UEFI/BIOS update, to LVFS. This is described as a security update (although without further detail). See [https://fwupd.org/lvfs/devices/com.lenovo.ThinkPadR1MET.firmware LVFS page for this update].<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} does not seem to be configurable and shows as having no carrier even when the RJ45 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Unreliable mic mute LED ==<br />
<br />
The mic mute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per the [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 relevant thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics touchpad RMI bus non-functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see the [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 relevant thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Sleep mode (S3) ==<br />
<br />
Sleep mode and, in particular, the lid switch are slow and flaky unless the sleep mode is set to {{ic|Linux}} rather than {{ic|Windows 10}} in the BIOS. Be sure that you have logged out of, rather than suspending, any Windows 10 installation before changing this.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Sway&diff=698429Sway2021-10-06T18:48:33Z<p>Snakeroot: Removed "Merge</p>
<hr />
<div>[[Category:Wayland compositors]]<br />
[[it:Sway]]<br />
[[ja:Sway]]<br />
[[pt:Sway]]<br />
{{Related articles start}}<br />
{{Related|Window manager}}<br />
{{Related articles end}}<br />
''sway'' (contracted from '''S'''irCmpwn's '''Way'''land compositor [https://github.com/swaywm/sway/blob/f0ddf6d74c98ba6c502783b8f41be859c56712c9/README.md]) is a compositor for [[Wayland]] designed to be fully compatible with [[i3]]. According to [https://swaywm.org the official website]:<br />
:Sway is a tiling Wayland compositor and a drop-in replacement for the i3 window manager for X11. It works with your existing i3 configuration and supports most of i3's features, plus a few extras.<br />
<br />
== Installation ==<br />
<br />
''sway'' can be [[install]]ed with the {{Pkg|sway}} package. The development version can be installed using {{AUR|wlroots-git}} and {{AUR|sway-git}}. It is advisable to always update ''wlroots'' when you update ''sway'', due to tight dependencies.<br />
<br />
{{Note|All proprietary graphics drivers are [https://github.com/swaywm/sway/wiki#nvidia-users not supported], including [[NVIDIA]] (though limited functionality is offered by {{AUR|wlroots-eglstreams-git}}).}}<br />
<br />
You may also install {{Pkg|swaylock}} and {{Pkg|swayidle}} to lock your screen and set up an idle manager.<br />
<br />
The default application launcher is {{Pkg|dmenu}} and the default terminal emulator is {{Pkg|alacritty}}. Before starting ''sway'' it is advisable to either install them or set a new launcher and terminal in the configuration.<br />
<br />
== Starting ==<br />
<br />
=== Manually ===<br />
<br />
To start Sway, simply type {{ic|sway}} in the Linux console.<br />
<br />
=== Automatically on TTY login ===<br />
<br />
Similarly to X, Sway can be started by adding the following to your shell initialization file (see [[Command-line shell#Login shell]]):<br />
<br />
{{bc|1=<br />
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then<br />
exec sway<br />
fi<br />
}}<br />
<br />
For more details, see [[Xinit#Autostart X at login]]<br />
<br />
=== From a display manager ===<br />
<br />
{{Note|Sway does not support display managers officially.[https://github.com/swaywm/sway/pull/3634#issuecomment-462779163]}}<br />
<br />
The sway session is located at {{ic|/usr/share/wayland-sessions/sway.desktop}}. It is automatically recognized by modern display managers like [[GDM]] and [[SDDM]].<br />
<br />
It is also possible to start sway as a [https://github.com/swaywm/sway/wiki/Systemd-integration#running-sway-itself-as-a---user-service systemd user service] through the display manager.<br />
<br />
Also you can use text-based session manager, see [[Display manager#Console]].<br />
<br />
== Configuration ==<br />
<br />
If you already use i3, you may copy your i3 configuration to {{ic|~/.config/sway/config}} and it should work out of the box. Otherwise, copy the sample configuration file located at {{ic|/etc/sway/config}} to {{ic|~/.config/sway/config}}. See {{man|5|sway}} for information on the configuration.<br />
<br />
=== Keymap ===<br />
<br />
By default, sway starts with the US QWERTY keymap. To configure per-input:<br />
<br />
{{hc|~/.config/sway/config|<br />
input * {<br />
xkb_layout "us,de,ru"<br />
xkb_variant "colemak,,typewriter"<br />
xkb_options "grp:win_space_toggle"<br />
}<br />
<br />
input <identifier> xkb_model "pc101"<br />
}}<br />
<br />
More details are available in {{man|7|xkeyboard-config}} and {{man|5|sway-input}}.<br />
<br />
The keymap can also be configured using environment variables ({{ic|XKB_DEFAULT_LAYOUT}}, {{ic|XKB_DEFAULT_VARIANT}}, etc.) when starting {{ic|sway}}. The config options take precedence over environment variables.<br />
<br />
=== Typematic delay and rate ===<br />
<br />
To change typematic delay and rate, you can add the following lines to your {{ic|input}} section:<br />
<br />
{{hc|~/.config/sway/config|<br />
input <identifier> repeat_delay 300<br />
input <identifier> repeat_rate 30<br />
}}<br />
<br />
=== Statusbar ===<br />
<br />
''sway'' ships with a default status bar in the form of ''swaybar'' which runs in a pure [[Wayland]] environment. ''swaybar'' can call a shell script or other program to show information in the status bar. See {{man|5|sway-bar}} and {{man|7|swaybar-protocol}} for details.<br />
<br />
{{Tip|{{Pkg|waybar}} is an alternative to the bar included with sway (swaybar).}}<br />
<br />
Installing [[i3#i3status|i3status]] is an option to obtain a practical, default status bar under Wayland. All you have to do is add the following snippet at the end of your sway config:<br />
<br />
{{hc|~/.config/sway/config|<br />
bar {<br />
status_command i3status<br />
}<br />
}}<br />
<br />
If you want to enable colored output for i3status, you need to adjust the following part in the i3status configuration:<br />
<br />
{{hc|~/.config/i3status/config|2=<br />
general {<br />
colors = true<br />
interval = 5<br />
}<br />
}}<br />
<br />
=== Wallpaper ===<br />
<br />
The displaying of a wallpaper in sway is handled by a dedicated program which is packaged separately as {{Pkg|swaybg}}. It is needed in order to run the output command.<br />
<br />
The following line, which can be appended at the end of your sway configuration, sets a background image on all displays (output matches all with name {{ic|"*"}}):<br />
<br />
{{hc|~/.config/sway/config|<br />
output "*" bg /path/to/image fill<br />
}}<br />
<br />
Of course you have to replace the file name and path according to your wallpaper.<br />
<br />
Solid colors may be set as follows:<br />
<br />
output * bg #000000 solid_color<br />
<br />
You may use {{AUR|azote}} as the GTK3 frontend to swaybg.<br />
<br />
=== Input devices ===<br />
<br />
It is possible to tweak specific input device configurations. For example, to enable tap-to-click and natural scrolling for all touchpads:<br />
<br />
{{hc|~/.config/sway/config|<br />
input type:touchpad {<br />
tap enabled<br />
natural_scroll enabled<br />
}<br />
}}<br />
<br />
To set the configuration for a particular touchpad, use {{ic|swaymsg -t get_inputs}} to obtain a device identifier and use it instead of {{ic|type:touchpad}}.<br />
<br />
{{Note|The output from the {{ic|swaymsg -t get_inputs}} command may contain "\" to escape symbols like "/" (e.g. {{ic|"2:14:ETPS\/2_Elantech_Touchpad"}}). These need to be removed.}}<br />
<br />
More documentation and options like acceleration profiles or disabling input entirely can be found in {{man|5|sway-input}}.<br />
<br />
=== HiDPI ===<br />
<br />
Set your displays scale factor with the {{ic|output}} command in your config file. The scale factor can be fractional, but it is usually 2 for HiDPI screens.<br />
<br />
{{hc|~/.config/sway/config|<br />
output <name> scale <factor><br />
}}<br />
<br />
You can find your display name with the following command:<br />
<br />
$ swaymsg -t get_outputs<br />
<br />
=== Custom keybindings ===<br />
<br />
[[Extra keyboard keys|Special keys]] on your keyboard can be used to execute commands, for example to control volume, monitor brightness or media players:<br />
<br />
{{hc|~/.config/sway/config|<br />
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%<br />
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%<br />
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle<br />
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle<br />
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-<br />
bindsym XF86MonBrightnessUp exec brightnessctl set +5%<br />
bindsym XF86AudioPlay exec playerctl play-pause<br />
bindsym XF86AudioNext exec playerctl next<br />
bindsym XF86AudioPrev exec playerctl previous<br />
bindsym XF86Search exec bemenu-run<br />
}}<br />
<br />
See [[PulseAudio#Keyboard volume control]], [[Advanced Linux Sound Architecture#Keyboard volume control]], [[Backlight#Backlight utilities]] and [[MPRIS]] for details and alternative utilities.<br />
<br />
To allow a keybinding to be executed while the lockscreen is active add the {{ic|--locked}} parameter to bindsym.<br />
<br />
bindsym --locked XF86AudioPlay exec playerctl play-pause<br />
<br />
{{Tip|{{AUR|wev}} is a tool which provides functionality similar to that of {{Pkg|xorg-xev}}, but on Wayland.}}<br />
<br />
{{note|Systemd handles some special keys like the power key and lid open as well as close events. These may interfere with the ones configured in sway. See {{man|1|loginctl}} and {{man|5|logind.conf}} for details on how to configure them in [[systemd]].}}<br />
<br />
==== Graphical indicator bars ====<br />
<br />
It is often desirable to have the current level of some percentage-valued setting, such as brightness or volume, be indicated by a graphical bar when it is adjusted. A good option for providing this facility in Sway is {{AUR|wob}} (alternatively {{AUR|wob-git}}), which provides a subset of the functionality of the popular X tool {{AUR|xob}} but as a native Wayland utility implementing the layer-shell protocol. See the [https://github.com/francma/wob project website] for usage examples.<br />
<br />
=== Idle ===<br />
<br />
Sway has a dedicated idle management daemon named {{pkg|swayidle}} to handle idling sessions. There are different ways to start and parameterize the daemon. The simplest is to use the config of sway itself. {{ic|swayidle}} accepts a multitude of arguments to configure events like {{ic|timeout}} (a.k.a. idling), {{ic|resume}} (resume from sleep), {{ic|before-sleep}} etc. See {{man|1|swayidle}} for more details and further explanations of the events. Each event can then be assigned an action. To assign multiple actions to an event simply repeat the trigger.<br />
<br />
The following instructs {{ic|swayidle}} to lock the screen after 30 minutes and turn it off five seconds after:<br />
<br />
{{hc|~/.config/sway/config|<br />
exec swayidle -w \<br />
timeout 1800 'swaylock' \<br />
timeout 1805 'swaymsg "output * dpms off"' \<br />
resume 'swaymsg "output * dpms on"'<br />
}}<br />
<br />
To turn off a locked screen much sooner e.g. after 10 seconds, grep the process list for your locking manager and execute {{ic|swaymsg "output * dpms off"}} accordingly like so:<br />
<br />
timeout 10 'if pgrep -x swaylock; then swaymsg "output * dpms off"; fi'<br />
<br />
In order to lock the screen before suspending and pause any playing media, amend the following instructions to the swayidle command:<br />
<br />
before-sleep 'playerctl pause'<br />
before-sleep 'swaylock'<br />
<br />
{{note|Systemd too handles some idle events which may conflict with the ones configured in sway. See {{man|1|loginctl}} and {{man|5|logind.conf}} for details on how to configure them.}}<br />
<br />
=== Floating windows ===<br />
<br />
To enable floating windows or window assignments, open the application and then use the {{ic|app_id}}, the {{ic|class}}, the {{ic|instance}} and the {{ic|title}} attributes to enable floating windows/window assignments. The following command will list the properties of all the open windows.<br />
<br />
$ swaymsg -t get_tree<br />
<br />
To get only the {{ic|app_id}}'s of all open windows use:<br />
<br />
$ swaymsg -t get_tree | grep "app_id"<br />
<br />
To get the {{ic|app_id}} of the focused window use:<br />
<br />
$ swaymsg -t get_tree | jq -r '..|try select(.focused == true)'<br />
<br />
If the {{ic|app_id}} happens to be null for some windows, you might have to use the {{ic|class}} and/or the {{ic|instance}} attributes to enable floating mode/window assignments. You can search the output and create fine grained rules for your windows.<br />
<br />
{{hc|~/.config/sway/config|2=<br />
for_window [app_id="galculator"] floating enable<br />
assign [class="firefox"] -> 3<br />
assign [class="^Urxvt$" instance="^htop$"] -> 9<br />
}}<br />
<br />
This is similar to using {{Pkg|xorg-xprop}} to find the {{ic|class}} or {{ic|wm_name}} attributes in [[X11]].<br />
<br />
When using multiple monitors, the floating scratchpad window can get too large, covering more than one monitor. This command centers and resizes the floating window to 80% of the current monitor's size:<br />
<br />
$ swaymsg move position center; swaymsg resize set 80ppt 80ppt<br />
<br />
=== Clipboard ===<br />
<br />
{{Merge|Clipboard|Not specific to Sway.}}<br />
<br />
By default, the clipboard is emptied whenever a window is closed. This can be a surprising default behaviour.<br />
<br />
A "clipboard manager" must be installed to make the clipboard's content shared amongst windows.<br />
<br />
One example of a clipboard manager, designed for Wayland, is [https://github.com/yory8/clipman clipman], which can be installed from {{AUR|clipman}} or {{AUR|clipman-git}}.<br />
<br />
To start clipman with Sway, add the following line to your config file:<br />
<br />
{{hc|~/.config/sway/config|2=<br />
exec wl-paste -t text --watch clipman store<br />
}}<br />
<br />
=== Xresources ===<br />
<br />
Copy {{ic|~/.Xresources}} to {{ic|~/.Xdefaults}} to use them in Sway.<br />
<br />
=== XWayland ===<br />
<br />
See [[Wayland#XWayland]] for details and an overview of available packages.<br />
<br />
The use of XWayland is enabled by default.<br />
<br />
If you would like to disable XWayland entirely and run a "pure" Wayland session, set the following config key to deactivate the use of XWayland:<br />
<br />
{{hc|~/.config/sway/config|<br />
xwayland disable<br />
}}<br />
<br />
{{Note|Some programs need [[Wayland#GUI_libraries|special environment variables or configuration options]] to run natively under Wayland, and other programs (including most proprietary applications) do not support Wayland at all. Currently it is recommended to keep XWayland on so that legacy applications can be used.}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Initially enable CapsLock/NumLock ===<br />
<br />
By default, sway initially disables the {{ic|CapsLock}} and {{ic|NumLock}} keys on startup. To instead enable them on startup, set the {{ic|xkb_capslock}} and/or {{ic|xkb_numlock}} input configurations to {{ic|enable}} for your keyboards. For example, to do so on all keyboards, add the following lines to your sway configuration:<br />
<br />
{{hc|~/.config/sway/config|<br />
input * xkb_capslock enable<br />
input * xkb_numlock enable<br />
}}<br />
<br />
In either case, the {{ic|CapsLock}} and {{ic|NumLock}} keys may be toggled by pressing the relevant keys on a keyboard.<br />
<br />
{{Note|1=Enabling these using the wildcard identifier may cause Firefox to crash upon reloading your sway configuration file: [https://bugzilla.mozilla.org/show_bug.cgi?id=1652820 Bugzilla 1652820]. Try [https://bugzilla.mozilla.org/show_bug.cgi?id=1652820#c31 specifying the keyboard] instead.}}<br />
<br />
=== Current keyboard layout ===<br />
<br />
The current keyboard layout can be retrieved as follows, where {{ic|''kbd_identifier''}} needs to be replaced with your keyboard's identifier:<br />
<br />
$ swaymsg -t get_inputs {{!}} jq -r '.[] {{!}} select(.identifier == "''kbd_identifier''") {{!}} .xkb_active_layout_name'<br />
<br />
=== Compose key ===<br />
<br />
To set up {{ic|PrintScreen}} as the [[Xorg/Keyboard configuration#Configuring compose key|compose key]]:<br />
<br />
$ swaymsg 'input * xkb_options compose:prsc'<br />
<br />
The combinations for the compose key can also be configured in the [[Xorg/Keyboard configuration#Key combinations|XCompose file]]. Applications need to be restarted for this change to take effect.<br />
<br />
{{Expansion|Explain what the following tip means (why is it useful).}}<br />
<br />
You can look up key names in {{ic|/usr/include/X11/keysymdef.h}}, or use the {{man|1|xev}}-like debugger: {{man|1|xkbcli-interactive-wayland}} (in {{ic|/usr/lib/xkbcommon/}}).<br />
<br />
=== Backlight toggle ===<br />
<br />
To turn off (and on) your displays with a key (e.g. {{ic|Pause}}) bind the following script in your Sway {{ic|config}}:<br />
<br />
{{bc|<br />
#!/bin/sh<br />
read lcd < /tmp/lcd<br />
if [ "$lcd" -eq "0" ]; then<br />
swaymsg "output * dpms on"<br />
echo 1 > /tmp/lcd<br />
else<br />
swaymsg "output * dpms off"<br />
echo 0 > /tmp/lcd<br />
fi<br />
}}<br />
<br />
=== Screen capture and screen sharing ===<br />
<br />
See [[Screen capture#Wayland]].<br />
<br />
=== Color temperature adjustment ===<br />
<br />
See [[Backlight#Wayland]].<br />
<br />
=== Control swaynag with the keyboard ===<br />
<br />
Swaynag, the default warning/prompt program shipped with sway, only supports user interaction with the mouse. A helper program such as {{AUR|swaynagmode}} may be used to enable interaction via keyboard shortcuts.<br />
<br />
Swaynagmode works by first launching swaynag, then listening for signals which trigger actions such as selecting the next button, dismissing the prompt, or accepting the selected button. These signals are sent by launching another instance of the swaynagmode script itself with a control argument, such as {{ic|swaynagmode --select right}} or {{ic|swaynagmode --confirm}}. <br />
<br />
Swaynagmode by default triggers the sway mode {{ic|nag}} upon initialization, followed by {{ic|default}} on exit. This makes it easy to define keybindings in your sway configuration:<br />
<br />
{{hc|~/.config/sway/config|<br />
set $nag exec swaynagmode<br />
mode "nag" {<br />
bindsym {<br />
Ctrl+d mode "default"<br />
<br />
Ctrl+c $nag --exit<br />
q $nag --exit<br />
Escape $nag --exit<br />
<br />
Return $nag --confirm<br />
<br />
Tab $nag --select prev<br />
Shift+Tab $nag --select next<br />
<br />
Left $nag --select next<br />
Right $nag --select prev<br />
<br />
Up $nag --select next<br />
Down $nag --select prev<br />
}<br />
}<br />
}}<br />
<br />
Note that, beginning in sway version 1.2, mode names are case-sensitive.<br />
<br />
You can configure sway to use swaynagmode with the configuration command {{ic|swaynag_command swaynagmode}}.<br />
<br />
=== Change cursor theme and size ===<br />
<br />
To set the [[cursor theme]] and size:<br />
<br />
{{hc|~/.config/sway/config|<br />
seat seat0 xcursor_theme ''my_cursor_theme'' ''my_cursor_size''<br />
}}<br />
<br />
Where {{ic|''my_cursor_theme''}} can be set to or replaced by a specific value like {{ic|default}}, {{ic|Adwaita}} or {{ic|Simple-and-Soft}}, and {{ic|''my_cursor_size''}} a value like {{ic|48}}.<br />
<br />
You can inspect their values with {{ic|echo $XCURSOR_SIZE}} and {{ic|echo $XCURSOR_THEME}}.<br />
<br />
Note that you need to restart the application to see the changes.<br />
<br />
{{Note|Wayland uses client-side cursors. It is possible that applications do not evaluate the values of {{ic|$XCURSOR_SIZE}} and {{ic|$XCURSOR_THEME}}.}}<br />
<br />
=== Manage Sway-specific daemons with systemd ===<br />
<br />
Systemd provides a {{ic|graphical-session.target}} which is a user unit which is active whenever any graphical session is running, whether Xorg or Wayland. User services which should run in all graphical environments can be bound to that target. It also allows for a window-manager-specific target to be bound to {{ic|graphical-session.target}} to start and stop services which should run only under that window manager. See {{man|7|systemd.special}}<br />
<br />
Users may want to start some services/daemons (such as {{Pkg|swayidle}} or {{Pkg|kanshi}}) only when the current window manager is Sway, and they may also want these services to stop when Sway stops. Additionally, users who are running {{man|8|systemd-oomd.service}} may want to have the services be in separate cgroups so that a single memory-hungry service does not take down the whole Sway session (see the [https://bugzilla.redhat.com/show_bug.cgi?id=1933494 Fedora bug report]).<br />
<br />
Some or all of this functionality is provided by Arch Sway packages. For example, the {{Pkg|sway}} package in community provides the {{ic|sway-session.target}} file and both {{Pkg|sway}} and {{AUR|sway-git}} provide a {{ic|50-systemd-user.conf}} drop-in file for the {{ic|/etc/sway/config.d/}} directory. This file imports required environment variables into the systemd user session and dbus if the Sway {{ic|config}} file contains {{ic|include /etc/sway/config.d/*}}. <br />
<br />
If you intend to provide functionality using the roll-your-own method described below or by using a specialist package such as {{AUR|sway-systemd-git}} or {{AUR|sway-services-git}} you should consider removing files that provide the same functionality.<br />
<br />
This functionality can be provided on a roll-your-own basis by creating a {{ic|sway-session.target}} and let those daemons/services wanted by {{ic|sway-session.target}}. This systemd target should be a user target (see [[systemd/User]]). For example:<br />
<br />
{{hc|1=~/.config/systemd/user/sway-session.target|2=<br />
[Unit]<br />
Description=Sway compositor session<br />
Documentation=man:systemd.special<br />
BindsTo=graphical-session.target<br />
Wants=graphical-session-pre.target<br />
After=graphical-session-pre.target<br />
}}<br />
<br />
Then, add the following line to Sway's config file (for example, append the line to {{ic|~/.config/sway/config}}, or add a new file to {{ic|/etc/sway/config.d/}}):<br />
<br />
{{hc|1=~/.config/sway/config|2=<br />
...<br />
...<br />
...<br />
exec_always "systemctl --user import-environment; systemctl --user start sway-session.target"<br />
}}<br />
<br />
With the above line in the configuration file, whenever Sway starts, it also activates {{ic|sway-session.target}}.<br />
<br />
Finally, link the desired services to {{ic|sway-session.target}}. For example, adding a {{Pkg|kanshi}} (or {{AUR|kanshi-git}}) service:<br />
<br />
{{hc|1=~/.config/systemd/user/kanshi.service|2=<br />
[Unit]<br />
Description=Dynamic output configuration for Wayland compositors<br />
Documentation=https://github.com/emersion/kanshi<br />
BindsTo=sway-session.target<br />
<br />
[Service]<br />
Type=simple<br />
ExecStart=/usr/bin/kanshi<br />
<br />
[Install]<br />
WantedBy=sway-session.target<br />
}}<br />
<br />
When this service is enabled (with {{ic|--user}} flag), it is only activated when Sway is running and deactivated when Sway stops:<br />
<br />
{{bc|$ systemctl --user enable --now kanshi.service}}<br />
<br />
The creation of the {{ic|sway-session.target}} file and the importing of the environment can also be accomplished by installing {{AUR|sway-systemd-git}}. In addition to separating services into cgroups, sway-systemd also places each GUI application in its own cgroup. This enables imposition of per-cgroup resource constraints on individual application. See the [https://github.com/alebastr/sway-systemd sway-systemd README].<br />
<br />
=== Change screen resolution after start ===<br />
<br />
You can use the graphical program {{AUR|wdisplays}} to change the resolution, rotate and arrange displays.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Application launchers ===<br />
<br />
{{Tip|Sway's wiki also has a [https://github.com/swaywm/sway/wiki#program-launchers list of known application launchers].}}<br />
<br />
i3-dmenu-desktop, {{Pkg|dmenu}}, and {{Pkg|rofi}} all function relatively well in Sway, but all run under XWayland and suffer from the same issue where they can become unresponsive if the cursor is moved to a native Wayland window. The reason for this issue is that Wayland clients/windows do not have access to input devices unless they have focus of the screen. The XWayland server is itself a client to the Wayland compositor, so one of its XWayland clients must have focus for it to access user input. However, once one of its clients has focus, it can gather input and make it available to all XWayland clients through the X11 protocol. Hence, moving the cursor to an XWayland window and pressing Escape should fix the issue, and sometimes running {{ic|pkill}} does too.<br />
<br />
{{Pkg|bemenu}} is a native Wayland dmenu replacement which can optionally be combined with {{AUR|j4-dmenu-desktop}} to provide a Wayland-native combination for launching desktop files (as i3-dmenu-desktop does):<br />
<br />
j4-dmenu-desktop --dmenu='bemenu -i --nb "#3f3f3f" --nf "#dcdccc" --fn "pango:DejaVu Sans Mono 12"' --term='termite'<br />
<br />
You may need to set {{ic|BEMENU_BACKEND}} environment variable to "wayland" if you choose not to disable XWayland.<br />
<br />
You can also build your own with a floating terminal and fzf as discussed in a [https://github.com/swaywm/sway/issues/1367 GitHub issue].<br />
<br />
Also {{ic|krunner}} binary provided by {{Pkg|plasma-workspace}} package can serve as launcher, offering both XWayland and native Wayland support.<br />
<br />
{{AUR|rofi-lbonn-wayland-git}} is a fork of {{Pkg|rofi}} that works in Wayland and also has an {{ic|-x11}} flag if you need to launch it in an X11 session. <br />
<br />
{{Pkg|wofi}} is a command launcher, that provides some of the same features as rofi but running under Wayland. wofi lacks some features from rofi like an SSH mode and a window-switching mode. It is based on {{Pkg|wlroots}} library and use GTK3 for rendering. It works pretty well with sway.<br />
<br />
=== Virtualization ===<br />
<br />
Sway works with both [[VirtualBox]] and [[VMware]] ESXi.<br />
<br />
==== Unable to start Sway from tty ====<br />
<br />
For ESXi, you need to enable 3D support under the ''Hardware Configuration > Video card settings''. See also [[VMware#Enable 3D graphics on Intel and Optimus]].<br />
<br />
==== No visible cursor ====<br />
<br />
When using the VMSVGA graphics controller, the cursor is invisible. This can be fixed by using software cursors as discussed in [https://github.com/swaywm/sway/issues/3814]:<br />
<br />
$ export WLR_NO_HARDWARE_CURSORS=1<br />
<br />
=== Sway socket not detected ===<br />
<br />
Using a {{ic|swaymsg}} argument, such as {{ic|swaymsg -t get_outputs}}, will sometimes return the message:<br />
<br />
sway socket not detected.<br />
ERROR: Unable to connect to<br />
<br />
when run inside a terminal multiplexer (such as gnu screen or tmux). This means {{ic|swaymsg}} could not connect to the socket provided in your {{ic|SWAYSOCK}}.<br />
<br />
To view what the current value of {{ic|SWAYSOCK}} is, type:<br />
<br />
$ env | fgrep SWAYSOCK<br />
SWAYSOCK=/run/user/1000/sway-ipc.1000.4981.sock<br />
<br />
To work around this problem, you may try attaching to a socket based on the running sway process:<br />
<br />
$ export SWAYSOCK=/run/user/$(id -u)/sway-ipc.$(id -u).$(pgrep -x sway).sock<br />
<br />
To avoid this error, run the command outside of a multiplexer.<br />
<br />
=== Unable to retrieve socket path ===<br />
<br />
Requesting messages from {{ic|swaymsg -t}} on a tty may return the following message:<br />
<br />
Unable to retrieve socket path<br />
<br />
{{ic|SWAYSOCK}} environment variable is set after launching Sway, therefore a workaround to this error is to request {{ic|swaymsg -t [message]}} in a terminal inside Sway.<br />
<br />
=== Keybindings and keyboard layouts ===<br />
<br />
By default, if you are using more than one keyboard layout, e.g. {{ic|input * xkb_layout "us,ru"}}, bindings may become broken when you switch on some secondary layout.<br />
<br />
Thanks to https://github.com/swaywm/sway/pull/3058, all you need is to add {{ic|--to-code}} key to sensitive {{ic|bindsym}} lines like this:<br />
<br />
{{bc|<br />
bindsym --to-code {<br />
$mod+$left focus left<br />
$mod+$down focus down<br />
$mod+$up focus up<br />
$mod+$right focus right<br />
}<br />
}}<br />
<br />
Alternatively you can create a variable {{ic|set $mybind bindsym --to-code}} and then replace all instances of {{ic|bindsym}} with {{ic|$mybind}} like so: {{ic|$mybind $mod+w thing}}<br />
<br />
=== Java applications ===<br />
<br />
Some Java-based applications will display blank screen when opened, for example any JetBrains editor such as IntelliJ, CLion, or PyCharm. To mitigate this, the application can be started with the {{ic|_JAVA_AWT_WM_NONREPARENTING}} environment variable set to 1.<br />
<br />
If you start the application from a launcher like {{Pkg|rofi}} or {{Pkg|dmenu}}, you might want to modify the application desktop entry as shown in [[Desktop entries#Modify environment variables]].<br />
<br />
Some issues with Java applications have been fixed in OpenJDK 11 and Sway 1.5. However, certain applications require additional configuration to use newer versions of OpenJDK, in the case of Android Studio you must set {{ic|1=STUDIO_JDK=/usr/lib/jvm/java-11-openjdk/}}. [https://github.com/swaywm/sway/issues/5414]<br />
<br />
=== Scroll on border ===<br />
<br />
If using the mouse scroll wheel on an application's border crashes sway, you could use {{ic|border none}} for the {{ic|app_id}} (e.g. Firefox).<br />
<br />
=== Program cannot open display ===<br />
<br />
If a program crashes on start with the error message "cannot open display", it is likely that the program you are using is an X11 program. You can use the XWayland compatibility layer to run X11 programs under Wayland, see [[#XWayland]] for details.<br />
<br />
=== Sway v1.6 shows garbage or blank screen when using nouveau ===<br />
<br />
If sway displays a corrupted image, or a blank screen on one or more displays connected to an Nvidia GPU using [[nouveau]], but starts properly otherwise, try setting {{ic|1=WLR_DRM_NO_MODIFIERS=1}} before starting sway.<br />
<br />
$ WLR_DRM_NO_MODIFIERS=1 sway<br />
<br />
The underlying issue relates to outstanding nouveau bugs in Mesa, and should be fixed in a future update. [https://github.com/swaywm/sway/wiki#sway-16-shows-garbage-on-nouveau]<br />
<br />
== See also ==<br />
<br />
* [https://github.com/swaywm/sway GitHub project]<br />
* [https://github.com/swaywm/sway/wiki Sway official wiki]<br />
* [https://swaywm.org Website]<br />
* [https://drewdevault.com/2019/03/11/Sway-1.0-released.html Announcing the release of sway 1.0]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=697642Lenovo ThinkPad T14 (AMD) Gen 22021-09-28T00:58:59Z<p>Snakeroot: Finally tested</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || {{ic|1022:15df}} || {{Yes}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} does not seem to be configurable and shows as having no carrier even when the RJ45 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Unreliable mic mute LED ==<br />
<br />
The mic mute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per the [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 relevant thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics touchpad RMI bus non-functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see the [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 relevant thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Sleep mode (S3) ==<br />
<br />
Sleep mode and, in particular, the lid switch are slow and flaky unless the sleep mode is set to {{ic|Linux}} rather than {{ic|Windows 10}} in the BIOS. Be sure that you have logged out of, rather than suspending, any Windows 10 installation before changing this.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Network_configuration/Wireless&diff=695001Network configuration/Wireless2021-09-08T14:10:19Z<p>Snakeroot: The kernel guys haven't updated this, so it is not currently accurate.</p>
<hr />
<div>[[Category:Wireless networking]]<br />
[[Category:Network configuration]]<br />
[[cs:Network configuration (Čeština)/Wireless]]<br />
[[de:(W)LAN und Arch Linux]]<br />
[[el:Network configuration (Ελληνικά)/Wireless]]<br />
[[es:Network configuration (Español)/Wireless]]<br />
[[fa:تنظیمات شبکه ی بی سیم]]<br />
[[fr:Network configuration (Français)/Wireless]]<br />
[[it:Network configuration (Italiano)/Wireless]]<br />
[[ja:ワイヤレス設定]]<br />
[[pt:Network configuration (Português)/Wireless]]<br />
[[ru:Network configuration (Русский)/Wireless]]<br />
[[zh-hans:Network configuration (简体中文)/Wireless]]<br />
{{Related articles start}}<br />
{{Related|Software access point}}<br />
{{Related|Ad-hoc networking}}<br />
{{Related|Internet sharing}}<br />
{{Related|Wireless bonding}}<br />
{{Related|Network Debugging}}<br />
{{Related|Bluetooth}}<br />
{{Related articles end}}<br />
<br />
The main article on network configuration is [[Network configuration]].<br />
<br />
Configuring wireless is a two-part process; the first part is to identify and ensure the correct driver for your wireless device is installed (they are available on the installation media, but often have to be installed explicitly), and to configure the interface. The second is choosing a method of managing wireless connections. This article covers both parts, and provides additional links to wireless management tools.<br />
<br />
The [[#iw]] section describes how to manually manage your wireless network interface / your wireless LANs using {{Pkg|iw}}. The [[Network configuration#Network managers]] section describes several programs that can be used to automatically manage your wireless interface, some of which include a GUI and all of which include support for network profiles (useful when frequently switching wireless networks, like with laptops).<br />
<br />
== Device driver ==<br />
<br />
The default Arch Linux kernel is ''modular'', meaning many of the drivers for machine hardware reside on the hard drive and are available as [[Kernel modules|modules]]. At boot, [[udev]] takes an inventory of your hardware and loads appropriate modules (drivers) for your corresponding hardware, which will in turn allow creation of a network ''interface''.<br />
<br />
Some wireless chipsets also require firmware, in addition to a corresponding driver. Many firmware images are provided by the {{Pkg|linux-firmware}} package; however, proprietary firmware images are not included and have to be installed separately. This is described in [[#Installing driver/firmware]].<br />
<br />
{{Note|If the proper module is not loaded by udev on boot, simply [[Kernel modules#Manual module handling|load it manually]]. If udev loads more than one driver for a device, the resulting conflict may prevent successful configuration. Make sure to [[blacklist]] the unwanted module.}}<br />
<br />
=== Check the driver status ===<br />
<br />
To check if the driver for your card has been loaded, check the output of the {{ic|lspci -k}} or {{ic|lsusb -v}} command, depending on if the card is connected by PCI(e) or USB. You should see that some kernel driver is in use, for example:<br />
<br />
{{hc|$ lspci -k|<br />
06:00.0 Network controller: Intel Corporation WiFi Link 5100<br />
Subsystem: Intel Corporation WiFi Link 5100 AGN<br />
Kernel driver in use: iwlwifi<br />
Kernel modules: iwlwifi<br />
}}<br />
<br />
{{Note|If the card is a USB device, running {{ic|dmesg {{!}} grep usbcore}} as root should give something like {{ic|usbcore: registered new interface driver rtl8187}} as output.}}<br />
<br />
Also check the output of the {{ic|ip link}} command to see if a wireless interface was created; usually the naming of the wireless [[network interfaces]] starts with the letter "w", e.g. {{ic|wlan0}} or {{ic|wlp2s0}}. Then bring the interface up with:<br />
<br />
# ip link set ''interface'' up<br />
<br />
For example, assuming the interface is {{ic|wlan0}}, this is {{ic|ip link set wlan0 up}}.<br />
<br />
{{Note|<br />
* If you get errors like {{ic|RTNETLINK answers: Operation not possible due to RF-kill}}, make sure that hardware switch is ''on''. See [[#Rfkill caveat]] for details.<br />
* If you get the error message {{ic|SIOCSIFFLAGS: No such file or directory}}, it most certainly means that your wireless chipset requires a firmware to function.<br />
}}<br />
<br />
Check kernel messages for firmware being loaded:<br />
<br />
{{hc|# dmesg {{!}} grep firmware|<br />
[ 7.148259] iwlwifi 0000:02:00.0: loaded firmware version 39.30.4.1 build 35138 op_mode iwldvm<br />
}}<br />
<br />
If there is no relevant output, check the messages for the full output for the module you identified earlier ({{ic|iwlwifi}} in this example) to identify the relevant message or further issues:<br />
<br />
{{hc|# dmesg {{!}} grep iwlwifi|2=<br />
[ 12.342694] iwlwifi 0000:02:00.0: irq 44 for MSI/MSI-X<br />
[ 12.353466] iwlwifi 0000:02:00.0: loaded firmware version 39.31.5.1 build 35138 op_mode iwldvm<br />
[ 12.430317] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEBUG disabled<br />
...<br />
[ 12.430341] iwlwifi 0000:02:00.0: Detected Intel(R) Corporation WiFi Link 5100 AGN, REV=0x6B<br />
}}<br />
<br />
If the kernel module is successfully loaded and the interface is up, you can skip the next section.<br />
<br />
=== Installing driver/firmware ===<br />
<br />
Check the following lists to discover if your card is supported:<br />
<br />
* See the table of [https://wireless.wiki.kernel.org/en/users/drivers existing Linux wireless drivers] and follow to the specific driver's page, which contains a list of supported devices. There is also a [https://wikidevi.com/wiki/List_of_Wi-Fi_Device_IDs_in_Linux List of Wi-Fi Device IDs in Linux].<br />
* The [https://help.ubuntu.com/community/WifiDocs/WirelessCardsSupported Ubuntu Wiki] has a good list of wireless cards and whether or not they are supported either in the Linux kernel or by a user-space driver (includes driver name).<br />
* [http://linux-wless.passys.nl/ Linux Wireless Support] and The Linux Questions' [https://web.archive.org/web/20110711100256/http://www.linuxquestions.org/hcl/index.php?cat=10 Hardware Compatibility List] (HCL) also have a good database of kernel-friendly hardware.<br />
<br />
Note that some vendors ship products that may contain different chip sets, even if the product identifier is the same. Only the usb-id (for USB devices) or pci-id (for PCI devices) is authoritative.<br />
<br />
If your wireless card is listed above, follow the [[#Troubleshooting drivers and firmware]] subsection of this page, which contains information about installing drivers and firmware of some specific wireless cards. Then [[#Check the driver status|check the driver status]] again.<br />
<br />
If your wireless card is not listed above, it is likely supported only under Windows (some Broadcom, 3com, etc). For these, you can try to use [[#ndiswrapper]].<br />
<br />
== Utilities ==<br />
<br />
Just like other network interfaces, the wireless ones are controlled with ''ip'' from the {{Pkg|iproute2}} package.<br />
<br />
Managing a wireless connection requires a basic set of tools. Either use a [[network manager]] or use one of the following directly:<br />
<br />
{| class="wikitable"<br />
! Software !! Package !! [https://wireless.wiki.kernel.org/en/developers/documentation/wireless-extensions WEXT] !! [https://wireless.wiki.kernel.org/en/developers/documentation/nl80211 nl80211] !! WEP !! WPA/WPA2 !! [[Archiso]] [https://gitlab.archlinux.org/archlinux/archiso/-/blob/master/configs/releng/packages.x86_64]<br />
|-<br />
| [https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html wireless_tools]<sup>1</sup> || {{Pkg|wireless_tools}} || {{Yes}} || {{no}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| [https://wireless.wiki.kernel.org/en/users/documentation/iw iw] || {{Pkg|iw}} || {{No}} || {{Yes}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| [[wpa_supplicant]] || {{Pkg|wpa_supplicant}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| [[iwd]] || {{Pkg|iwd}} || {{No}} || {{Yes}} || {{No}} || {{Yes}} || {{Yes}}<br />
|}<br />
<br />
# Deprecated.<br />
<br />
Note that some cards only support WEXT.<br />
<br />
=== iw and wireless_tools comparison ===<br />
<br />
The table below gives an overview of comparable commands for ''iw'' and ''wireless_tools''. See [https://wireless.wiki.kernel.org/en/users/Documentation/iw/replace-iwconfig iw replaces iwconfig] for more examples.<br />
<br />
{| class="wikitable"<br />
! ''iw'' command<br />
! ''wireless_tools'' command<br />
! Description<br />
|-<br />
| iw dev ''wlan0'' link<br />
| iwconfig ''wlan0''<br />
| Getting link status.<br />
|-<br />
| iw dev ''wlan0'' scan<br />
| iwlist ''wlan0'' scan<br />
| Scanning for available access points.<br />
|-<br />
| iw dev ''wlan0'' set type ibss<br />
| iwconfig ''wlan0'' mode ad-hoc<br />
| Setting the operation mode to ''ad-hoc''.<br />
|-<br />
| iw dev ''wlan0'' connect ''your_essid''<br />
| iwconfig ''wlan0'' essid ''your_essid''<br />
| Connecting to open network.<br />
|-<br />
| iw dev ''wlan0'' connect ''your_essid'' 2432<br />
| iwconfig ''wlan0'' essid ''your_essid'' freq 2432M<br />
| Connecting to open network specifying channel.<br />
|-<br />
| rowspan="2" | iw dev ''wlan0'' connect ''your_essid'' key 0:''your_key''<br />
| iwconfig ''wlan0'' essid ''your_essid'' key ''your_key''<br />
| Connecting to WEP encrypted network using hexadecimal key.<br />
|-<br />
| iwconfig ''wlan0'' essid ''your_essid'' key s:''your_key''<br />
| Connecting to WEP encrypted network using ASCII key.<br />
|-<br />
| iw dev ''wlan0'' set power_save on<br />
| iwconfig ''wlan0'' power on<br />
| Enabling power save.<br />
|}<br />
<br />
== iw ==<br />
<br />
{{Note|<br />
* Note that most of the commands have to be executed with [[Users and groups|root permissions]]. Executed with normal user rights, some of the commands (e.g. ''iw list''), will exit without error but not produce the correct output either, which can be confusing.<br />
* Depending on your hardware and encryption type, some of these steps may not be necessary. Some cards are known to require interface activation and/or access point scanning before being associated to an access point and being given an IP address. Some experimentation may be required. For instance, WPA/WPA2 users may try to directly activate their wireless network from step [[#Connect to an access point]].}}<br />
<br />
Examples in this section assume that your wireless device interface is {{ic|''interface''}} and that you are connecting to {{ic|''your_essid''}} wifi access point. Replace both accordingly.<br />
<br />
=== Get the name of the interface ===<br />
<br />
{{Tip|See [https://wireless.wiki.kernel.org/en/users/documentation/iw official documentation] of the ''iw'' tool for more examples.}}<br />
<br />
To get the name of your wireless interface do:<br />
<br />
$ iw dev<br />
<br />
The name of the interface will be output after the word "Interface". For example, it is commonly {{ic|wlan0}}.<br />
<br />
=== Get the status of the interface ===<br />
<br />
To check link status, use following command.<br />
<br />
$ iw dev ''interface'' link<br />
<br />
You can get statistic information, such as the amount of tx/rx bytes, signal strength etc., with following command:<br />
<br />
$ iw dev ''interface'' station dump<br />
<br />
=== Activate the interface ===<br />
<br />
{{Tip|Usually this step is not required.}}<br />
<br />
Some cards require that the kernel interface be activated before you can use ''iw'' or ''wireless_tools'':<br />
<br />
# ip link set ''interface'' up<br />
<br />
{{Note|If you get errors like {{ic|RTNETLINK answers: Operation not possible due to RF-kill}}, make sure that hardware switch is ''on''. See [[#Rfkill caveat]] for details.}}<br />
<br />
To verify that the interface is up, inspect the output of the following command:<br />
<br />
{{hc|$ ip link show ''interface''|<br />
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000<br />
link/ether 12:34:56:78:9a:bc brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
The {{ic|UP}} in {{ic|<BROADCAST,MULTICAST,UP,LOWER_UP>}} is what indicates the interface is up, not the later {{ic|state DOWN}}.<br />
<br />
=== Discover access points ===<br />
<br />
To see what access points are available:<br />
<br />
# iw dev ''interface'' scan | less<br />
<br />
{{Note|If it displays {{ic|Interface does not support scanning}}, then you probably forgot to install the firmware. In some cases this message is also displayed when not running ''iw'' as root.}}<br />
<br />
{{Tip|Depending on your location, you might need to set the correct [[#Respecting the regulatory domain|regulatory domain]] in order to see all available networks.}}<br />
<br />
The important points to check:<br />
* '''SSID:''' the name of the network.<br />
* '''Signal:''' is reported in a wireless power ratio in dBm (e.g. from -100 to 0). The closer the negative value gets to zero, the better the signal. Observing the reported power on a good quality link and a bad one should give an idea about the individual range. <br />
* '''Security:''' it is not reported directly, check the line starting with {{ic|capability}}. If there is {{ic|Privacy}}, for example {{ic|capability: ESS Privacy ShortSlotTime (0x0411)}}, then the network is protected somehow.<br />
** If you see an {{ic|RSN}} information block, then the network is protected by [[Wikipedia:IEEE 802.11i-2004|Robust Security Network]] protocol, also known as WPA2.<br />
** If you see an {{ic|WPA}} information block, then the network is protected by [[Wikipedia:Wi-Fi Protected Access|Wi-Fi Protected Access]] protocol.<br />
** In the {{ic|RSN}} and {{ic|WPA}} blocks you may find the following information:<br />
*** '''Group cipher:''' value in TKIP, CCMP, both, others.<br />
*** '''Pairwise ciphers:''' value in TKIP, CCMP, both, others. Not necessarily the same value than Group cipher.<br />
*** '''Authentication suites:''' value in PSK, 802.1x, others. For home router, you will usually find PSK (''i.e.'' passphrase). In universities, you are more likely to find 802.1x suite which requires login and password. Then you will need to know which key management is in use (e.g. EAP), and what encapsulation it uses (e.g. PEAP). See [[#WPA2 Enterprise]] and [[Wikipedia:Authentication protocol]] for details.<br />
** If you see neither {{ic|RSN}} nor {{ic|WPA}} blocks but there is {{ic|Privacy}}, then WEP is used.<br />
<br />
=== Set operating mode ===<br />
<br />
You might need to set the proper operating mode of the wireless card. More specifically, if you are going to connect an [[Ad-hoc networking|ad-hoc network]], you need to set the operating mode to {{ic|ibss}}:<br />
<br />
# iw dev ''interface'' set type ibss<br />
<br />
{{Note|Changing the operating mode on some cards might require the wireless interface to be ''down'' ({{ic|ip link set ''interface'' down}}).}}<br />
<br />
=== Connect to an access point ===<br />
<br />
Depending on the encryption, you need to associate your wireless device with the access point to use and pass the encryption key:<br />
<br />
* '''No encryption''' {{bc|# iw dev ''interface'' connect "''your_essid''"}}<br />
* '''WEP'''<br />
** using a hexadecimal or ASCII key (the format is distinguished automatically, because a WEP key has a fixed length): {{bc|# iw dev ''interface'' connect "''your_essid''" key 0:''your_key''}}<br />
** using a hexadecimal or ASCII key, specifying the third set up key as default (keys are counted from zero, four are possible): {{bc|# iw dev ''interface'' connect "''your_essid''" key d:2:''your_key''}}<br />
<br />
Regardless of the method used, you can check if you have associated successfully:<br />
<br />
# iw dev ''interface'' link<br />
<br />
== Authentication ==<br />
<br />
{{Expansion|Add [[Wikipedia:WPA3|WPA3 Enterprise]] ({{Bug|65314}}) and [[Wikipedia:Opportunistic Wireless Encryption|Opportunistic Wireless Encryption (OWE) a.k.a. Enhanced Open]]. Warn against WEP and open networks.}}<br />
<br />
=== WPA2 Personal ===<br />
<br />
WPA2 Personal, a.k.a. WPA2-PSK, is a mode of [[Wikipedia:Wi-Fi Protected_Access|Wi-Fi Protected Access]].<br />
<br />
You can authenticate to WPA2 Personal networks using [[wpa_supplicant]] or [[iwd]], or connect using a [[network manager]]. If you only authenticated to the network, then to have a fully functional connection you will still need to assign the IP address(es) and routes either [[Network configuration#Static IP address|manually]] or using a [[DHCP]] client.<br />
<br />
=== WPA2 Enterprise ===<br />
<br />
''WPA2 Enterprise'' is a mode of [[Wikipedia:Wi-Fi_Protected_Access|Wi-Fi Protected Access]]. It provides better security and key management than ''WPA2 Personal'', and supports other enterprise-type functionality, such as VLANs and [[wikipedia:Network Access Protection|NAP]]. However, it requires an external authentication server, called [[wikipedia:RADIUS|RADIUS]] server to handle the authentication of users. This is in contrast to Personal mode which does not require anything beyond the wireless router or access points (APs), and uses a single passphrase or password for all users.<br />
<br />
The Enterprise mode enables users to log onto the Wi-Fi network with a username and password and/or a digital certificate. Since each user has a dynamic and unique encryption key, it also helps to prevent user-to-user snooping on the wireless network, and improves encryption strength.<br />
<br />
This section describes the configuration of [[List of applications#Network managers|network clients]] to connect to a wireless access point with WPA2 Enterprise mode. See [[Software access point#RADIUS]] for information on setting up an access point itself. <br />
<br />
{{Note|Enterprise mode requires a more complex client configuration, whereas Personal mode only requires entering a passphrase when prompted. Clients likely need to install the server’s CA certificate (plus per-user certificates if using EAP-TLS), and then manually configure the wireless security and 802.1X authentication settings.}}<br />
<br />
For a comparison of protocols see the following [http://deployingradius.com/documents/protocols/compatibility.html table].<br />
<br />
{{Warning|It is possible to use WPA2 Enterprise without the client checking the server CA certificate. However, you should always seek to do so, because without authenticating the access point the connection can be subject to a man-in-the-middle attack. This may happen because while the connection handshake itself may be encrypted, the most widely used setups transmit the password itself either in plain text or the easily breakable [[#MS-CHAPv2]]. Hence, the client might send the password to a malicious access point which then proxies the connection.}}<br />
<br />
==== MS-CHAPv2 ====<br />
<br />
WPA2-Enterprise wireless networks demanding MSCHAPv2 type-2 authentication with PEAP sometimes require {{Pkg|pptpclient}} in addition to the stock {{Pkg|ppp}} package. [[netctl]] seems to work out of the box without ppp-mppe, however. In either case, usage of MSCHAPv2 is discouraged as it is highly vulnerable, although using another method is usually not an option.<br />
<br />
==== eduroam ====<br />
<br />
[[Wikipedia:eduroam|eduroam]] is an international roaming service for users in research, higher education and further education, based on WPA2 Enterprise.<br />
<br />
{{Note|<br />
* Check connection details '''first''' with your institution before applying any profiles listed in this section. Example profiles are not guaranteed to work or match any security requirements.<br />
* When storing connection profiles unencrypted, it is recommended restrict read access to the root account by specifying {{ic|chmod 600 ''profile''}} as root.<br />
}}<br />
<br />
{{Tip|Configuration for [[NetworkManager]] can be generated with the [https://cat.eduroam.org/ eduroam Configuration Assistant Tool].}}<br />
<br />
==== Manual/automatic setup ====<br />
<br />
* [[wpa_supplicant#Advanced usage|wpa_supplicant]] can be configured directly by its configuration file or using its CLI/GUI front ends and used in combination with a DHCP client. See the examples in {{ic|/usr/share/doc/wpa_supplicant/wpa_supplicant.conf}} for configuring the connection details.<br />
* [[iwd#WPA Enterprise]]<br />
* [[NetworkManager]] can create WPA2 Enterprise profiles with ''nmcli'' or the [[NetworkManager#Front-ends|graphical front ends]]. ''nmtui'' does not support this ([https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/376 NetworkManager issue 376]), but may use existing profiles.<br />
* [[ConnMan]] needs a separate configuration file before [[ConnMan#Wi-Fi|connecting]] to the network. See {{man|5|connman-service.config}} and [[ConnMan#Connecting to eduroam (802.1X)]] for details.<br />
* [[netctl]] supports wpa_supplicant configuration through blocks included with {{ic|1=WPAConfigSection=}}. See {{man|5|netctl.profile}} for details.<br />
: {{Note|Special quoting rules apply: see {{man|5|netctl.profile|SPECIAL QUOTING RULES}}.}}<br />
: {{Tip|Custom certificates can be specified by adding the line {{ic|1='ca_cert="/path/to/special/certificate.cer"'}} in {{ic|WPAConfigSection}}.}}<br />
<br />
=== WPA3 Personal ===<br />
<br />
WPA3 Personal, a.k.a. WPA3-SAE, is a mode of [[Wikipedia:Wi-Fi Protected_Access|Wi-Fi Protected Access]].<br />
<br />
[[wpa_supplicant]] supports WPA3 Personal ({{ic|CONFIG_SAE}} is enabled in {{Pkg|wpa_supplicant}} since version 2:2.9-4).<br />
<br />
[[iwd]] supports WPA3 since at least [https://iwd.wiki.kernel.org/networkmanager version 1.0].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Respecting the regulatory domain ===<br />
<br />
The [[wikipedia:IEEE_802.11#Regulatory_domains_and_legal_compliance|regulatory domain]], or "regdomain", is used to reconfigure wireless drivers to make sure that wireless hardware usage complies with local laws set by the FCC, ETSI and other organizations. Regdomains use [[wikipedia:ISO_3166-1_alpha-2|ISO 3166-1 alpha-2 country codes]]. For example, the regdomain of the United States would be "US", China would be "CN", etc.<br />
<br />
Regdomains affect the availability of wireless channels. In the 2.4GHz band, the allowed channels are 1-11 for the US, 1-14 for Japan, and 1-13 for most of the rest of the world. In the 5GHz band, the rules for allowed channels are much more complex. In either case, consult [[wikipedia:List_of_WLAN_channels|this list of WLAN channels]] for more detailed information.<br />
<br />
Regdomains also affect the limit on the [[wikipedia:Equivalent_isotropically_radiated_power|effective isotropic radiated power (EIRP)]] from wireless devices. This is derived from transmit power/"tx power", and is measured in [[wikipedia:DBm|dBm/mBm (1dBm=100mBm) or mW (log scale)]]. In the 2.4GHz band, the maximum is 30dBm in the US and Canada, 20dBm in most of Europe, and 20dBm-30dBm for the rest of the world. In the 5GHz band, maximums are usually lower. Consult the [https://git.kernel.org/cgit/linux/kernel/git/linville/wireless-regdb.git/tree/db.txt wireless-regdb] for more detailed information (EIRP dBm values are in the second set of brackets for each line).<br />
<br />
Misconfiguring the regdomain can be useful - for example, by allowing use of an unused channel when other channels are crowded, or by allowing an increase in tx power to widen transmitter range. However, '''this is not recommended''' as it could break local laws and cause interference with other radio devices.<br />
<br />
Since kernel 4.15, there are two ways to load the regulatory database. The first is to use the deprecated "central regulatory domain agent" provided by {{Pkg|crda}}, which loads the database via udev rule. The second is to allow the kernel to load the database directly, which is supported by {{Pkg|wireless-regdb}}. For direct loading the kernel must be configured with {{ic|CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS}} set to yes and should, for security's sake, be configured with {{ic|CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS}} set to yes to allow for cryptographic verification of the database. This is true of the stock Arch kernel, but if you are using an alternate kernel, or compiling your own, you should verify this. More information is available at [http://docker.hd-wireless.com/Support/WifiRegulatoryDomainsinLinux this guide].<br />
<br />
To configure the regdomain, install {{Pkg|crda}} or {{Pkg|wireless-regdb}} and reboot (to reload the {{ic|cfg80211}} module and all related drivers). Check the boot log to make sure that CRDA is being called or the database loaded and key verified by {{ic|cfg80211}}:<br />
<br />
# dmesg | grep cfg80211<br />
<br />
The current regdomain can be set to the United States with:<br />
<br />
# iw reg set US<br />
<br />
And queried with:<br />
<br />
$ iw reg get<br />
<br />
{{Note|<br />
* Your device may be set to country "00", which is the "world regulatory domain" and contains generic settings. If this cannot be unset, CRDA may be misconfigured.<br />
}}<br />
<br />
However, setting the regdomain may not alter your settings. Some devices have a regdomain set in firmware/EEPROM, which dictates the limits of the device, meaning that setting regdomain in software [https://wiki.openwrt.org/doc/howto/wireless.utilities#iw can only increase restrictions], not decrease them. For example, a CN device could be set in software to the US regdomain, but because CN has an EIRP maximum of 20dBm, the device will not be able to transmit at the US maximum of 30dBm.<br />
<br />
For example, to see if the regdomain is being set in firmware for an Atheros device:<br />
<br />
# dmesg | grep ath:<br />
<br />
For other chipsets, it may help to search for "EEPROM", "regdomain", or simply the name of the device driver.<br />
<br />
To see if your regdomain change has been successful, and to query the number of available channels and their allowed transmit power:<br />
<br />
$ iw list | grep -A 15 Frequencies:<br />
<br />
A more permanent configuration of the regdomain can be achieved through editing {{ic|/etc/conf.d/wireless-regdom}} and uncommenting the appropriate domain.<br />
<br />
[[wpa_supplicant]] can also use a regdomain in the {{ic|1=country=}} line of {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}.<br />
<br />
It is also possible to configure the [https://wireless.wiki.kernel.org/en/developers/documentation/cfg80211 cfg80211] kernel module to use a specific regdomain by adding, for example, {{ic|1=options cfg80211 ieee80211_regdom=JP}} as [[Kernel_modules#Setting module options|module options]]. The module option is inherited from the [https://wireless.wiki.kernel.org/en/developers/regulatory#the_ieee80211_regdom_module_parameter old regulatory implementation] and in modern kernels act as a userspace regulatory hint as if it came through {{ic|nl80211}} through utilities like {{ic|iw}} and {{ic|wpa_supplicant}}.<br />
<br />
=== Rfkill caveat ===<br />
<br />
Many laptops have a hardware button (or switch) to turn off wireless card, however, the card can also be blocked by kernel. This can be handled by ''rfkill''. To show the current status:<br />
<br />
{{hc|# rfkill list|<br />
0: phy0: Wireless LAN<br />
Soft blocked: yes<br />
Hard blocked: yes<br />
}}<br />
<br />
If the card is ''hard-blocked'', use the hardware button (switch) to unblock it. If the card is not ''hard-blocked'' but ''soft-blocked'', use the following command:<br />
<br />
# rfkill unblock wifi<br />
<br />
{{Note|It is possible that the card will go from ''hard-blocked'' and ''soft-unblocked'' state into ''hard-unblocked'' and ''soft-blocked'' state by pressing the hardware button (i.e. the ''soft-blocked'' bit is just switched no matter what). This can be adjusted by tuning some options of the {{ic|rfkill}} [[kernel module]].}}<br />
<br />
Hardware buttons to toggle wireless cards are handled by a vendor specific [[kernel module]], frequently these are [https://lwn.net/Articles/391230/ WMI] modules. Particularly for very new hardware models, it happens that the model is not fully supported in the latest stable kernel yet. In this case it often helps to search the kernel bug tracker for information and report the model to the maintainer of the respective vendor kernel module, if it has not happened already. <br />
<br />
See also [https://askubuntu.com/questions/62166/siocsifflags-operation-not-possible-due-to-rf-kill].<br />
<br />
=== Power saving ===<br />
<br />
See [[Power saving#Network interfaces]].<br />
<br />
== Troubleshooting ==<br />
<br />
This section contains general troubleshooting tips, not strictly related to problems with drivers or firmware. For such topics, see next section [[#Troubleshooting drivers and firmware]].<br />
<br />
=== Temporary internet access ===<br />
<br />
If you have problematic hardware and need internet access to, for example, download some software or get help in forums, you can make use of Android's built-in feature for internet sharing via USB cable. See [[Android tethering#USB tethering]] for more information.<br />
<br />
=== Observing logs ===<br />
<br />
A good first measure to troubleshoot is to analyze the system's logfiles first. In order not to manually parse through them all, it can help to open a second terminal/console window and watch the kernels messages with <br />
<br />
# dmesg -w<br />
<br />
while performing the action, e.g. the wireless association attempt. <br />
<br />
When using a tool for network management, the same can be done for systemd with <br />
<br />
# journalctl -f <br />
<br />
Frequently a wireless error is accompanied by a deauthentication with a particular reason code, for example: <br />
<br />
wlan0: deauthenticating from XX:XX:XX:XX:XX:XX by local choice (reason=3)<br />
<br />
Looking up [http://www.aboutcher.co.uk/2012/07/linux-wifi-deauthenticated-reason-codes/ the reason code] might give a first hint. Maybe it also helps you to look at the control message [https://wireless.wiki.kernel.org/en/developers/documentation/mac80211/auth-assoc-deauth flowchart], the journal messages will follow it. <br />
<br />
The individual tools used in this article further provide options for more detailed debugging output, which can be used in a second step of the analysis, if required.<br />
<br />
=== Failed to get IP address ===<br />
<br />
* If getting an IP address repeatedly fails using the default {{Pkg|dhcpcd}} client, try installing and using {{Pkg|dhclient}} instead. Do not forget to select ''dhclient'' as the primary DHCP client in the [[#Manual/automatic setup|connection manager]].<br />
<br />
* If you can get an IP address for a wired interface and not for a wireless interface, try disabling the wireless card's [[#Power saving|power saving]] features (specify {{ic|off}} instead of {{ic|on}}).<br />
<br />
* If you get a timeout error due to a ''waiting for carrier'' problem, then you might have to set the channel mode to {{ic|auto}} for the specific device:<br />
<br />
# iwconfig wlan0 channel auto<br />
<br />
Before changing the channel to auto, make sure your wireless interface is down. After it has successfully changed it, you can bring the interface up again and continue from there.<br />
<br />
=== Valid IP address but cannot resolve host ===<br />
<br />
If you are on a public wireless network that may have a [[wikipedia:Captive_portal|captive portal]], make sure to query an HTTP page (not an HTTPS page) from your web browser, as some captive portals only redirect HTTP.<br />
If this is not the issue, [[Domain name resolution#Resolve a domain name using NSS|check if you can resolve domain names]], it may be necessary to use the DNS server advertised via DHCP.<br />
<br />
=== Setting RTS and fragmentation thresholds ===<br />
<br />
Wireless hardware disables RTS and fragmentation by default. These are two different methods of increasing throughput at the expense of bandwidth (i.e. reliability at the expense of speed). These are useful in environments with wireless noise or many adjacent access points, which may create interference leading to timeouts or failing connections. <br />
<br />
Packet fragmentation improves throughput by splitting up packets with size exceeding the fragmentation threshold. The maximum value (2346) effectively disables fragmentation since no packet can exceed it. The minimum value (256) maximizes throughput, but may carry a significant bandwidth cost.<br />
<br />
# iw phy0 set frag 512<br />
<br />
[[Wikipedia:IEEE 802.11 RTS/CTS|RTS]] improves throughput by performing a handshake with the access point before transmitting packets with size exceeding the RTS threshold. The maximum threshold (2347) effectively disables RTS since no packet can exceed it. The minimum threshold (0) enables RTS for all packets, which is probably excessive for most situations.<br />
<br />
# iw phy0 set rts 500<br />
<br />
{{Note|{{ic|phy0}} is the name of the wireless device as listed by {{ic|$ iw phy}}.}}<br />
<br />
=== Random disconnections ===<br />
<br />
==== Cause #1 ====<br />
<br />
If [[dmesg]] says {{ic|1=wlan0: deauthenticating from MAC by local choice (reason=3)}} and you lose your Wi-Fi connection, it is likely that you have a bit too aggressive power-saving on your Wi-Fi card. Try disabling the wireless card's [[Power_management#Network_interfaces|power saving]] features (specify {{ic|off}} instead of {{ic|on}}).<br />
<br />
If your card does not support enabling/disabling power save mode, check the BIOS for power management options. Disabling PCI-Express power management in the BIOS of a Lenovo W520 resolved this issue.<br />
<br />
==== Cause #2 ====<br />
<br />
If you are experiencing frequent disconnections and ''dmesg'' shows messages such as <br />
<br />
{{ic|1=ieee80211 phy0: wlan0: No probe response from AP xx:xx:xx:xx:xx:xx after 500ms, disconnecting}}<br />
<br />
try changing the channel bandwidth to {{ic|20MHz}} through your router's settings page.<br />
<br />
==== Cause #3 ====<br />
<br />
On some laptop models with hardware rfkill switches (e.g., Thinkpad X200 series), due to wear or bad design, the switch (or its connection to the mainboard) might become loose over time resulting in seemingly random hardblocks/disconnects when you accidentally touch the switch or move the laptop.<br />
There is no software solution to this, unless your switch is electrical and the BIOS offers the option to disable the switch.<br />
If your switch is mechanical (most are), there are lots of possible solutions, most of which aim to disable the switch: Soldering the contact point on the mainboard/wifi-card, glueing or blocking the switch, using a screw nut to tighten the switch or removing it altogether.<br />
<br />
==== Cause #4 ====<br />
<br />
Another cause for frequent disconnects or a complete failure to connect may also be a sub-standard router, incomplete settings of the router, or interference by other wireless devices. <br />
<br />
To troubleshoot, first best try to connect to the router with no authentication. <br />
<br />
If that works, enable WPA/WPA2 again but choose fixed and/or limited router settings. For example: <br />
* If the router is considerably older than the wireless device you use for the client, test if it works with setting the router to one wireless mode <br />
* Disable mixed-mode authentication (e.g. only WPA2 with AES, or TKIP if the router is old) <br />
* Try a fixed/free channel rather than "auto" channel (maybe the router next door is old and interfering) <br />
* Disable [[Wikipedia:Wi-Fi Protected Setup|WPS]]<br />
* Change the router's 5 GHz channel(s) to a [[Wikipedia:List_of_WLAN_channels#5_GHz_(802.11a/h/j/n/ac/ax)|non-DFS (Dynamic Frequency Selection) channel]]. Connections on such channels [https://wifinigel.blogspot.com/2018/05/the-5ghz-problem-for-wi-fi-networks-dfs.html may be dropped or suddenly switched] due to interference from nearby weather radar.<br />
* Disable {{ic|40MHz}} channel bandwidth (lower throughput but less likely collisions) with {{ic|1=cfg80211.cfg80211_disable_40mhz_24ghz=1}}<br />
* If the router has quality of service settings, check completeness of settings (e.g. Wi-Fi Multimedia (WMM) is part of optional QoS flow control. An erroneous router firmware may advertise its existence although the setting is not enabled)<br />
<br />
==== Cause #5 ====<br />
<br />
On some wireless network adapters (e.g. Qualcomm Atheros AR9485), random disconnects can happen with a DMA error:<br />
<br />
{{hc|# journalctl -xb|2=<br />
ath: phy0: DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x02000020 DMADBG_7=0x0000a400<br />
wlp1s0: authenticate with 56:e7:ee:7b:55:bc<br />
wlp1s0: send auth to 56:e7:ee:7b:55:bc (try 1/3)<br />
wlp1s0: send auth to 56:e7:ee:7b:55:bc (try 2/3)<br />
wlp1s0: send auth to 56:e7:ee:7b:55:bc (try 3/3)<br />
wlp1s0: authentication with 56:e7:ee:7b:55:bc timed out<br />
}}<br />
<br />
A possible workaround is to disable the [https://www.kernel.org/doc/html/latest/x86/intel-iommu.html Intel IOMMU driver (DMA)], adding {{ic|1=intel_iommu=off}} to the [[kernel parameters]] [https://bbs.archlinux.org/viewtopic.php?pid=1907446#p1907446].<br />
<br />
{{Note|The Intel IOMMU driver is needed for some advanced virtual machine features, like PCI pass-through.}}<br />
<br />
==== Cause #6 ====<br />
<br />
If you are using a device with iwlwifi and iwlmvm for wireless connectivity, and your Wi-Fi card appears to disappear when on battery power (perhaps after a reboot or resuming from suspend), this can be fixed by configuring power saving settings in iwlmvm.<br />
<br />
Create the file {{ic|/etc/modprobe.d/iwlmvm.conf}} if it does not exist already, then add the following line to it:<br />
<br />
{{hc|/etc/modprobe.d/iwlmvm.conf|2=<br />
options iwlmvm power_scheme=1<br />
}}<br />
<br />
A {{ic|power_scheme}} of 1 sets iwlmvm to "Always Active." Available options are:<br />
<br />
{| class="wikitable"<br />
! Value !! Description<br />
|-<br />
| 1 || Always Active<br />
|-<br />
| 2 || Balanced<br />
|-<br />
| 3 || Low-power<br />
|}<br />
<br />
This fix was discovered at [http://forums.debian.net/viewtopic.php?t=121696#p576208].<br />
<br />
==== Cause #7 ====<br />
<br />
If your device undergoes long periods of inactivity (e.g. a file server) the disconnection may be due to power saving, which will block incoming traffic and prevent connections. Try disabling power saving for the interface:<br />
<br />
# iw dev ''interface'' set power_save off<br />
<br />
You can create a udev rule to do this on boot, see [[Power management#Network interfaces]].<br />
<br />
=== Wi-Fi networks invisible because of incorrect regulatory domain ===<br />
<br />
If the computer's Wi-Fi channels do not match those of the user's country, some in-range Wi-Fi networks might be invisible, because they use wireless channels that are not allowed by default. The solution is to configure the regulatory domain correctly, see [[#Respecting the regulatory domain]].<br />
<br />
== Troubleshooting drivers and firmware ==<br />
<br />
This section covers methods and procedures for installing kernel modules and ''firmware'' for specific chipsets, that differ from generic method.<br />
<br />
See [[Kernel modules]] for general information on operations with modules.<br />
<br />
=== Ralink/Mediatek ===<br />
<br />
==== rt2x00 ====<br />
<br />
Unified driver for Ralink chipsets (it replaces {{ic|rt2500}}, {{ic|rt61}}, {{ic|rt73}}, etc). This driver has been in the Linux kernel since 2.6.24, you only need to load the right module for the chip: {{ic|rt2400pci}}, {{ic|rt2500pci}}, {{ic|rt2500usb}}, {{ic|rt61pci}} or {{ic|rt73usb}} which will autoload the respective {{ic|rt2x00}} modules too.<br />
<br />
A list of devices supported by the modules is available at the project's [https://web.archive.org/web/20150507023412/http://rt2x00.serialmonkey.com/wiki/index.php/Hardware homepage].<br />
<br />
; Additional notes<br />
* Since kernel 3.0, rt2x00 includes also these drivers: {{ic|rt2800pci}}, {{ic|rt2800usb}}.<br />
* Since kernel 3.0, the staging drivers {{ic|rt2860sta}} and {{ic|rt2870sta}} are replaced by the mainline drivers {{ic|rt2800pci}} and {{ic|rt2800usb}} [https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fefecc6989b4b24276797270c0e229c07be02ad3].<br />
* Some devices have a wide range of options that can be configured with {{ic|iwpriv}}. These are documented in the [https://web.archive.org/web/20111105120212/http://web.ralinktech.com:80/ralink/Home/Support/Linux.html source tarballs] available from Ralink.<br />
<br />
==== rt3090 ====<br />
<br />
For devices which are using the rt3090 chipset it should be possible to use {{ic|rt2800pci}} driver, however, is not working with this chipset very well (e.g. sometimes it is not possible to use higher rate than 2Mb/s).<br />
<br />
==== rt3290 ====<br />
<br />
The rt3290 chipset is recognised by the kernel {{ic|rt2800pci}} module. However, some users experience problems and reverting to a patched Ralink driver seems to be beneficial in these [https://bbs.archlinux.org/viewtopic.php?id=161952 cases].<br />
<br />
==== rt3573 ====<br />
<br />
New chipset as of 2012. It may require proprietary drivers from Ralink. Different manufacturers use it, see the [https://bbs.archlinux.org/viewtopic.php?pid=1164228#p1164228 Belkin N750 DB wireless usb adapter] forums thread.<br />
<br />
==== mt7612u ====<br />
<br />
New chipset as of 2014, released under their new commercial name Mediatek. It is an AC1200 or AC1300 chipset. Manufacturer provides drivers for Linux on their [https://www.mediatek.com/products/broadbandWifi/mt7612u support page]. As of kernel 5.5 it should be supported by the included {{ic|mt76}} driver.<br />
<br />
=== Realtek ===<br />
<br />
See [https://wikidevi.com/wiki/Realtek] for a list of Realtek chipsets and specifications.<br />
<br />
==== rtl8192cu ====<br />
<br />
The driver is now in the kernel, but many users have reported being unable to make a connection although scanning for networks does work.<br />
<br />
{{AUR|8192cu-dkms}} includes many patches, try this if it does not work fine with the driver in kernel.<br />
<br />
==== rtl8723ae/rtl8723be ====<br />
<br />
The {{ic|rtl8723ae}} and {{ic|rtl8723be}} modules are included in the mainline Linux kernel.<br />
<br />
Some users may encounter errors with powersave on this card. This is shown with occasional disconnects that are not recognized by high level network managers ([[netctl]], [[NetworkManager]]). This error can be confirmed by running {{ic|dmesg -w}} as root or {{ic|journalctl -f}} as root and looking for output related to powersave and the {{ic|rtl8723ae}}/{{ic|rtl8723be}} module. If you are having this issue, use the {{ic|1=fwlps=0}} kernel option, which should prevent the WiFi card from automatically sleeping and halting connection. See [[Kernel module#Setting module options]].<br />
<br />
If you have poor signal, perhaps your device has only one physical antenna connected, and antenna autoselection is broken. You can force the choice of antenna with {{ic|1=ant_sel=1}} or {{ic|1=ant_sel=2}} kernel option. [https://bbs.archlinux.org/viewtopic.php?id=208472]<br />
<br />
==== rtl88xxau ====<br />
<br />
Realtek chipsets rtl8811au, rtl8812au, rtl8814au and rtl8821au designed for various USB adapters ranging from AC600 to AC1900. Several packages provide various kernel drivers, these require [[DKMS]] (the {{Pkg|dkms}} package and the kernel headers installed):<br />
<br />
{| class="wikitable"<br />
! Chipset || Driver version || Package || Notes<br />
|-<br />
| rtl8811au, rtl8812au, rtl8821au || 5.6.4.2 || {{AUR|rtl88xxau-aircrack-dkms-git}} || Aircrack-ng kernel module for 8811au, 8812au and 8821au chipsets with monitor mode and injection support.<br />
|-<br />
| rtl8814au || 5.8.5.1 || {{AUR|rtl8814au-aircrack-dkms-git}} || Aircrack-ng kernel module for 8814au chipsets with monitor mode and injection support.<br />
|-<br />
| rtl8812au || 5.9.3.2 || {{AUR|rtl8812au-dkms-git}} || Latest official Realtek driver version for rtl8812au '''only'''.<br />
|-<br />
| rtl8811au, rtl8821au || 5.8.2.3 || {{AUR|rtl8821au-dkms-git}} || Newer driver version for rtl8821au.<br />
|-<br />
| rtl8814au || 5.8.5.1 || {{AUR|rtl8814au-dkms-git}} || Possibly works for rtl8813au too. Seems to be deprecated in favor of {{AUR|rtl8814au-aircrack-dkms-git}}<br />
|}<br />
<br />
==== rtl8811cu/rtl8821cu ====<br />
<br />
{{AUR|rtl8821cu-dkms-git}} provides a kernel module for the Realtek 8811cu and 8821cu chipset.<br />
<br />
This requires [[DKMS]], so make sure you have your proper kernel headers installed.<br />
<br />
If no wireless interface shows up even though the {{ic|8821cu}} module is loaded, you may need to manually specify the {{ic|rtw_RFE_type}} option [https://forums.linuxmint.com/viewtopic.php?p=1913190&sid=68f2d6eff91cd47e184ae5a56385dc02#p1913190][https://github.com/brektrou/rtl8821CU/issues/83]. Try e.g. {{ic|1=rtw_RFE_type=0x26}}, other values might also work. See [[Kernel module#Setting module options]] for details.<br />
<br />
==== rtl8821ce ====<br />
<br />
{{AUR|rtl8821ce-dkms-git}} provides a kernel module for the Realtek 8821ce chipset found in the Asus X543UA.<br />
<br />
This requires [[DKMS]], so make sure you have your proper kernel headers installed.<br />
<br />
==== rtl8822bu ====<br />
<br />
{{AUR|rtl8822bu-dkms-git}} or {{AUR|rtl88x2bu-dkms-git}} provides a kernel module for the Realtek 8822bu chipset found in the Edimax EW7822ULC USB3, Asus AC53 Nano USB 802.11ac and TP-Link Archer T3U adapter.<br />
<br />
This requires [[DKMS]], so make sure you have your proper kernel headers installed.<br />
<br />
==== rtl8xxxu ====<br />
<br />
{{Expansion|Specific issues with the mainline module and kernel versions should be stated.}}<br />
<br />
Issues with the {{ic|rtl8xxxu}} mainline kernel module may be solved by compiling a third-party module for the specific chipset. The source code can be found in [https://github.com/lwfinger?tab=repositories GitHub repositories].<br />
<br />
Some drivers may be already prepared in the AUR, e.g. {{AUR|rtl8723bu-git-dkms}}.<br />
<br />
=== Atheros ===<br />
<br />
The [http://madwifi-project.org/ MadWifi team] currently maintains three different drivers for devices with Atheros chipset:<br />
<br />
* {{ic|madwifi}} is an old, obsolete driver. Not present in Arch kernel since 2.6.39.1<sup>[https://mailman.archlinux.org/pipermail/arch-dev-public/2011-June/020669.html]</sup>.<br />
* {{ic|ath5k}} is newer driver, which replaces the {{ic|madwifi}} driver. Currently a better choice for some chipsets, but not all chipsets are supported (see below)<br />
* {{ic|ath9k}} is the newest of these three drivers, it is intended for newer Atheros chipsets. All of the chips with 802.11n capabilities are supported.<br />
<br />
There are some other drivers for some Atheros devices. See [https://wireless.wiki.kernel.org/en/users/Drivers/Atheros#pcipci-eahb_driversrs Linux Wireless documentation] for details.<br />
<br />
==== ath5k ====<br />
<br />
External resources:<br />
* https://wireless.wiki.kernel.org/en/users/drivers/ath5k<br />
* [[Debian:ath5k]]<br />
<br />
If you find web pages randomly loading very slow, or if the device is unable to lease an IP address, try to switch from hardware to software encryption by loading the {{ic|ath5k}} module with {{ic|1=nohwcrypt=1}} option. See [[Kernel modules#Setting module options]] for details.<br />
<br />
Some laptops may have problems with their wireless LED indicator flickering red and blue. To solve this problem, do:<br />
<br />
# echo none > /sys/class/leds/ath5k-phy0::tx/trigger<br />
# echo none > /sys/class/leds/ath5k-phy0::rx/trigger<br />
<br />
For alternatives, see [https://bugzilla.redhat.com/show_bug.cgi?id=618232 this bug report].<br />
<br />
==== ath9k ====<br />
<br />
External resources:<br />
* https://wireless.wiki.kernel.org/en/users/drivers/ath9k<br />
* [[Debian:ath9k]]<br />
<br />
As of Linux 3.15.1, some users have been experiencing a decrease in bandwidth. In some cases this can fixed by setting the {{ic|1=nohwcrypt=1}} option for the {{ic|ath9k}} module. See [[Kernel module#Setting module options]].<br />
<br />
{{Note|Use the command {{ic|lsmod}} to see what modules are in use and change {{ic|ath9k}} if it is named differently (e.g. {{ic|ath9k_htc}}).}}<br />
<br />
In the unlikely event that you have stability issues that trouble you, you could try using the {{AUR|backports-patched}} package. An [https://web.archive.org/web/20201118232556/http://lists.ath9k.org/mailman/listinfo/ath9k-devel ath9k mailing list] exists for support and development related discussions.<br />
<br />
===== Power saving =====<br />
<br />
Although [https://wireless.wiki.kernel.org/en/users/Documentation/dynamic-power-save Linux Wireless] says that dynamic power saving is enabled for Atheros ath9k single-chips newer than AR9280, for some devices (e.g. AR9285) {{Pkg|powertop}} might still report that power saving is disabled. In this case enable it manually.<br />
<br />
On some devices (e.g. AR9285), enabling the power saving might result in the following error:<br />
<br />
{{hc|# iw dev wlan0 set power_save on|<br />
command failed: Operation not supported (-95)<br />
}}<br />
<br />
The solution is to set the {{ic|1=ps_enable=1}} option for the {{ic|ath9k}} module, see [[Kernel module#Setting module options]].<br />
<br />
=== Intel ===<br />
<br />
==== ipw2100 and ipw2200 ====<br />
<br />
These modules are fully supported in the kernel, but they require additional firmware. Depending on which of the chipsets you have, [[install]] either {{Pkg|ipw2100-fw}} or {{Pkg|ipw2200-fw}}. Then [[Kernel modules#Manual module handling|reload]] the appropriate module.<br />
<br />
{{Tip|You may use the following [[Kernel modules#Setting module options|module options]]:<br />
* use the {{ic|1=rtap_iface=1}} option to enable the radiotap interface<br />
* use the {{ic|1=led=1}} option to enable a front LED indicating when the wireless is connected or not<br />
}}<br />
<br />
==== iwlegacy ====<br />
<br />
[https://wireless.wiki.kernel.org/en/users/Drivers/iwlegacy iwlegacy] is the wireless driver for Intel's 3945 and 4965 wireless chips. The firmware is included in the {{Pkg|linux-firmware}} package.<br />
<br />
[[udev]] should load the driver automatically, otherwise load {{ic|iwl3945}} or {{ic|iwl4965}} manually. See [[Kernel modules]] for details.<br />
<br />
If you have problems connecting to networks in general, random failures with your card on bootup or your link quality is very poor, try to disable 802.11n:<br />
<br />
{{hc|/etc/modprobe.d/iwl4965.conf|2=<br />
options iwl4965 11n_disable=1<br />
}}<br />
<br />
If the failures persist during bootup and you are using Nouveau driver, try [[Nouveau#Enable_early_KMS|enabling early KMS]] to prevent the conflict [https://bbs.archlinux.org/viewtopic.php?pid=1748667#p1748667].<br />
<br />
==== iwlwifi ====<br />
<br />
[https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi iwlwifi] is the wireless driver for Intel's current wireless chips, such as 5100AGN, 5300AGN, and 5350AGN. See the [https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi#supported_devices full list of supported devices]. The firmware is included in the {{Pkg|linux-firmware}} package. The {{AUR|linux-firmware-iwlwifi-git}} may contain some updates sooner.<br />
<br />
If you have problems connecting to networks in general or your link quality is very poor, try to disable 802.11n, and perhaps also enable software encryption:<br />
<br />
{{hc|/etc/modprobe.d/iwlwifi.conf|2=<br />
options iwlwifi 11n_disable=1 swcrypto=1<br />
}}<br />
<br />
If you have a problem with slow uplink speed in 802.11n mode, for example 20Mbps, try to enable antenna aggregation:<br />
<br />
{{hc|/etc/modprobe.d/iwlwifi.conf|2=<br />
options iwlwifi 11n_disable=8<br />
}}<br />
<br />
Do not be confused with the option name, when the value is set to {{ic|8}} it does not disable anything but re-enables transmission antenna aggregation.[https://forums.gentoo.org/viewtopic-t-996692.html?sid=81bdfa435c089360bdfd9368fe0339a9] [https://bugzilla.kernel.org/show_bug.cgi?id=81571]<br />
<br />
In case this does not work for you, you may try disabling [[Power saving#Network interfaces|power saving]] for your wireless adapter.<br />
<br />
[https://ubuntuforums.org/showthread.php?t=2183486&p=12845473#post12845473 Some] have never gotten this to work. [https://ubuntuforums.org/showthread.php?t=2205733&p=12935783#post12935783 Others] found salvation by disabling N in their router settings after trying everything. This is known to have be the only solution on more than one occasion. The second link there mentions a 5ghz option that might be worth exploring.<br />
<br />
If you have an 802.11ax (WiFi 6) access point and have problems detecting the beacons or an unreliable connection, review [https://www.intel.com/content/www/us/en/support/articles/000054799/network-and-i-o/wireless.html Intel Article 54799].<br />
<br />
{{Note|Using {{ic|1=11n_disable=0}} will also prevent 802.11ac and only allow connection with slower protocols (802.11a in the 5GHz band or 802.11b/g in the 2.4 GHz band).}}<br />
<br />
===== Bluetooth coexistence =====<br />
<br />
If you have difficulty connecting a bluetooth headset and maintaining good downlink speed, try disabling bluetooth coexistence [https://wireless.wiki.kernel.org/en/users/Drivers/iwlwifi#wi-fibluetooth_coexistence]:<br />
<br />
{{hc|/etc/modprobe.d/iwlwifi.conf|2=<br />
options iwlwifi bt_coex_active=0<br />
}}<br />
<br />
===== Firmware stack traces =====<br />
<br />
{{Accuracy|What is the last note about ignored packages trying to say?}}<br />
<br />
You may have some issue where the driver outputs stack traces & errors, which can cause some stuttering.<br />
<br />
{{hc|# dmesg|2=<br />
Microcode SW error detected. Restarting 0x2000000.<br />
}}<br />
<br />
To fix those errors, you may downgrade the package {{Pkg|linux-firmware}} or rename the last version of the firmware used by your device so that an older version is loaded (which keeps it out of pacman's ignored packages).<br />
<br />
==== Disabling LED blink ====<br />
<br />
{{Note|This works with the {{ic|iwlegacy}} and {{ic|iwlwifi}} drivers.}}<br />
<br />
The default settings on the module are to have the LED blink on activity. Some people find this extremely annoying. To have the LED on solid when Wi-Fi is active, you can use the [[systemd-tmpfiles]]:<br />
<br />
{{hc|/etc/tmpfiles.d/phy0-led.conf|<br />
w /sys/class/leds/phy0-led/trigger - - - - phy0radio<br />
}}<br />
<br />
Run {{ic|systemd-tmpfiles --create phy0-led.conf}} for the change to take effect, or reboot.<br />
<br />
To see all the possible trigger values for this LED:<br />
<br />
# cat /sys/class/leds/phy0-led/trigger<br />
<br />
{{Tip|If you do not have {{ic|/sys/class/leds/phy0-led}}, you may try to use the {{ic|1=led_mode="1"}} [[Kernel modules#Setting module options|module option]]. It should be valid for both {{ic|iwlwifi}} and {{ic|iwlegacy}} drivers.}}<br />
<br />
=== Broadcom ===<br />
<br />
See [[Broadcom wireless]].<br />
<br />
=== Other drivers/devices ===<br />
<br />
==== Tenda w322u ====<br />
<br />
Treat this Tenda card as an {{ic|rt2870sta}} device. See [[#rt2x00]].<br />
<br />
==== orinoco ====<br />
<br />
This should be a part of the kernel package and be installed already.<br />
<br />
Some Orinoco chipsets are Hermes II. You can use the {{ic|wlags49_h2_cs}} driver instead of {{ic|orinoco_cs}} and gain WPA support. To use the driver, [[blacklist]] {{ic|orinoco_cs}} first.<br />
<br />
==== prism54 ====<br />
<br />
The driver {{ic|p54}} is included in kernel, but you have to download the appropriate firmware for your card from [https://wireless.wiki.kernel.org/en/users/drivers/p54#firmware this site] and install it into the {{ic|/usr/lib/firmware}} directory.<br />
<br />
{{Note|There is also older, deprecated driver {{ic|prism54}}, which might conflict with the newer driver ({{ic|p54pci}} or {{ic|p54usb}}). Make sure to [[blacklist]] {{ic|prism54}}.}}<br />
<br />
==== ACX100/111 ====<br />
<br />
{{Warning|The drivers for these devices [https://mailman.archlinux.org/pipermail/arch-dev-public/2011-June/020669.html are broken] and do not work with newer kernel versions.}}<br />
<br />
Packages: {{ic|tiacx}} {{ic|tiacx-firmware}} (deleted from official repositories and AUR)<br />
<br />
See [https://sourceforge.net/projects/acx100/ official page] for details.<br />
<br />
==== zd1211rw ====<br />
<br />
[https://sourceforge.net/projects/zd1211/ zd1211rw] is a driver for the ZyDAS ZD1211 802.11b/g USB WLAN chipset, and it is included in recent versions of the Linux kernel. See [https://wireless.wiki.kernel.org/en/users/Drivers/zd1211rw/devices] for a list of supported devices. You only need to [[install]] the firmware for the device, provided by the {{AUR|zd1211-firmware}} package.<br />
<br />
==== hostap_cs ====<br />
<br />
[https://hostap.epitest.fi/ Host AP] is a Linux driver for wireless LAN cards based on Intersil's Prism2/2.5/3 chipset. The driver is included in Linux kernel.<br />
<br />
{{Note|Make sure to [[blacklist]] the {{ic|orinico_cs}} driver, it may cause problems.}}<br />
<br />
=== ndiswrapper ===<br />
<br />
Ndiswrapper is a wrapper script that allows you to use some Windows drivers in Linux. You will need the {{ic|.inf}} and {{ic|.sys}} files from your Windows driver. <br />
{{Warning|Be sure to use drivers appropriate to your architecture (x86 vs. x86_64).}}<br />
<br />
{{Tip|If you need to extract these files from an {{ic|*.exe}} file, you can use {{Pkg|cabextract}}.}}<br />
<br />
Follow these steps to configure ndiswrapper.<br />
<br />
1. Install {{Pkg|ndiswrapper-dkms}}<br />
<br />
2. Install the driver to {{ic|/etc/ndiswrapper/*}}<br />
# ndiswrapper -i filename.inf<br />
<br />
3. List all installed drivers for ndiswrapper<br />
$ ndiswrapper -l<br />
<br />
4. Let ndiswrapper write its configuration in {{ic|/etc/modprobe.d/ndiswrapper.conf}}:<br />
# ndiswrapper -m<br />
# depmod -a<br />
<br />
Now the ndiswrapper install is almost finished; follow the instructions on [[Kernel modules#Automatic module loading with systemd]] to automatically load the module at boot.<br />
<br />
The important part is making sure that ndiswrapper exists on this line, so just add it alongside the other modules. It would be best to test that ndiswrapper will load now, so:<br />
# modprobe ndiswrapper<br />
# iwconfig<br />
<br />
and ''wlan0'' should now exist. If you have problems, some help is available at:<br />
[https://sourceforge.net/p/ndiswrapper/ndiswrapper/HowTos/ ndiswrapper howto] and [https://sourceforge.net/p/ndiswrapper/ndiswrapper/FAQ/ ndiswrapper FAQ].<br />
<br />
=== backports-patched ===<br />
<br />
{{AUR|backports-patched}} provide drivers released on newer kernels backported for usage on older kernels. The project started since 2007 and was originally known as compat-wireless, evolved to compat-drivers and was recently renamed simply to backports. <br />
<br />
If you are using old kernel and have wireless issue, drivers in this package may help.<br />
<br />
== See also ==<br />
<br />
* [https://wireless.wiki.kernel.org/ The Linux Wireless project]<br />
* [https://aircrack-ng.org/doku.php?id=install_drivers Aircrack-ng guide on installing drivers]<br />
* [https://wikidevi.wi-cat.ru Wireless Device Database Wiki] (This fork is hosted by wi-cat.ru since the original wiki has shut down. There are two less complete versions available: [http://en.techinfodepot.shoutwiki.com TechInfoDepot], [https://deviwiki.com/ deviwiki])</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Network_configuration/Wireless&diff=695000Network configuration/Wireless2021-09-08T14:06:13Z<p>Snakeroot: CONFIG_CFG80211_INTERNAL_REGDB hasn't been seen since kernel 4.14.</p>
<hr />
<div>[[Category:Wireless networking]]<br />
[[Category:Network configuration]]<br />
[[cs:Network configuration (Čeština)/Wireless]]<br />
[[de:(W)LAN und Arch Linux]]<br />
[[el:Network configuration (Ελληνικά)/Wireless]]<br />
[[es:Network configuration (Español)/Wireless]]<br />
[[fa:تنظیمات شبکه ی بی سیم]]<br />
[[fr:Network configuration (Français)/Wireless]]<br />
[[it:Network configuration (Italiano)/Wireless]]<br />
[[ja:ワイヤレス設定]]<br />
[[pt:Network configuration (Português)/Wireless]]<br />
[[ru:Network configuration (Русский)/Wireless]]<br />
[[zh-hans:Network configuration (简体中文)/Wireless]]<br />
{{Related articles start}}<br />
{{Related|Software access point}}<br />
{{Related|Ad-hoc networking}}<br />
{{Related|Internet sharing}}<br />
{{Related|Wireless bonding}}<br />
{{Related|Network Debugging}}<br />
{{Related|Bluetooth}}<br />
{{Related articles end}}<br />
<br />
The main article on network configuration is [[Network configuration]].<br />
<br />
Configuring wireless is a two-part process; the first part is to identify and ensure the correct driver for your wireless device is installed (they are available on the installation media, but often have to be installed explicitly), and to configure the interface. The second is choosing a method of managing wireless connections. This article covers both parts, and provides additional links to wireless management tools.<br />
<br />
The [[#iw]] section describes how to manually manage your wireless network interface / your wireless LANs using {{Pkg|iw}}. The [[Network configuration#Network managers]] section describes several programs that can be used to automatically manage your wireless interface, some of which include a GUI and all of which include support for network profiles (useful when frequently switching wireless networks, like with laptops).<br />
<br />
== Device driver ==<br />
<br />
The default Arch Linux kernel is ''modular'', meaning many of the drivers for machine hardware reside on the hard drive and are available as [[Kernel modules|modules]]. At boot, [[udev]] takes an inventory of your hardware and loads appropriate modules (drivers) for your corresponding hardware, which will in turn allow creation of a network ''interface''.<br />
<br />
Some wireless chipsets also require firmware, in addition to a corresponding driver. Many firmware images are provided by the {{Pkg|linux-firmware}} package; however, proprietary firmware images are not included and have to be installed separately. This is described in [[#Installing driver/firmware]].<br />
<br />
{{Note|If the proper module is not loaded by udev on boot, simply [[Kernel modules#Manual module handling|load it manually]]. If udev loads more than one driver for a device, the resulting conflict may prevent successful configuration. Make sure to [[blacklist]] the unwanted module.}}<br />
<br />
=== Check the driver status ===<br />
<br />
To check if the driver for your card has been loaded, check the output of the {{ic|lspci -k}} or {{ic|lsusb -v}} command, depending on if the card is connected by PCI(e) or USB. You should see that some kernel driver is in use, for example:<br />
<br />
{{hc|$ lspci -k|<br />
06:00.0 Network controller: Intel Corporation WiFi Link 5100<br />
Subsystem: Intel Corporation WiFi Link 5100 AGN<br />
Kernel driver in use: iwlwifi<br />
Kernel modules: iwlwifi<br />
}}<br />
<br />
{{Note|If the card is a USB device, running {{ic|dmesg {{!}} grep usbcore}} as root should give something like {{ic|usbcore: registered new interface driver rtl8187}} as output.}}<br />
<br />
Also check the output of the {{ic|ip link}} command to see if a wireless interface was created; usually the naming of the wireless [[network interfaces]] starts with the letter "w", e.g. {{ic|wlan0}} or {{ic|wlp2s0}}. Then bring the interface up with:<br />
<br />
# ip link set ''interface'' up<br />
<br />
For example, assuming the interface is {{ic|wlan0}}, this is {{ic|ip link set wlan0 up}}.<br />
<br />
{{Note|<br />
* If you get errors like {{ic|RTNETLINK answers: Operation not possible due to RF-kill}}, make sure that hardware switch is ''on''. See [[#Rfkill caveat]] for details.<br />
* If you get the error message {{ic|SIOCSIFFLAGS: No such file or directory}}, it most certainly means that your wireless chipset requires a firmware to function.<br />
}}<br />
<br />
Check kernel messages for firmware being loaded:<br />
<br />
{{hc|# dmesg {{!}} grep firmware|<br />
[ 7.148259] iwlwifi 0000:02:00.0: loaded firmware version 39.30.4.1 build 35138 op_mode iwldvm<br />
}}<br />
<br />
If there is no relevant output, check the messages for the full output for the module you identified earlier ({{ic|iwlwifi}} in this example) to identify the relevant message or further issues:<br />
<br />
{{hc|# dmesg {{!}} grep iwlwifi|2=<br />
[ 12.342694] iwlwifi 0000:02:00.0: irq 44 for MSI/MSI-X<br />
[ 12.353466] iwlwifi 0000:02:00.0: loaded firmware version 39.31.5.1 build 35138 op_mode iwldvm<br />
[ 12.430317] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEBUG disabled<br />
...<br />
[ 12.430341] iwlwifi 0000:02:00.0: Detected Intel(R) Corporation WiFi Link 5100 AGN, REV=0x6B<br />
}}<br />
<br />
If the kernel module is successfully loaded and the interface is up, you can skip the next section.<br />
<br />
=== Installing driver/firmware ===<br />
<br />
Check the following lists to discover if your card is supported:<br />
<br />
* See the table of [https://wireless.wiki.kernel.org/en/users/drivers existing Linux wireless drivers] and follow to the specific driver's page, which contains a list of supported devices. There is also a [https://wikidevi.com/wiki/List_of_Wi-Fi_Device_IDs_in_Linux List of Wi-Fi Device IDs in Linux].<br />
* The [https://help.ubuntu.com/community/WifiDocs/WirelessCardsSupported Ubuntu Wiki] has a good list of wireless cards and whether or not they are supported either in the Linux kernel or by a user-space driver (includes driver name).<br />
* [http://linux-wless.passys.nl/ Linux Wireless Support] and The Linux Questions' [https://web.archive.org/web/20110711100256/http://www.linuxquestions.org/hcl/index.php?cat=10 Hardware Compatibility List] (HCL) also have a good database of kernel-friendly hardware.<br />
<br />
Note that some vendors ship products that may contain different chip sets, even if the product identifier is the same. Only the usb-id (for USB devices) or pci-id (for PCI devices) is authoritative.<br />
<br />
If your wireless card is listed above, follow the [[#Troubleshooting drivers and firmware]] subsection of this page, which contains information about installing drivers and firmware of some specific wireless cards. Then [[#Check the driver status|check the driver status]] again.<br />
<br />
If your wireless card is not listed above, it is likely supported only under Windows (some Broadcom, 3com, etc). For these, you can try to use [[#ndiswrapper]].<br />
<br />
== Utilities ==<br />
<br />
Just like other network interfaces, the wireless ones are controlled with ''ip'' from the {{Pkg|iproute2}} package.<br />
<br />
Managing a wireless connection requires a basic set of tools. Either use a [[network manager]] or use one of the following directly:<br />
<br />
{| class="wikitable"<br />
! Software !! Package !! [https://wireless.wiki.kernel.org/en/developers/documentation/wireless-extensions WEXT] !! [https://wireless.wiki.kernel.org/en/developers/documentation/nl80211 nl80211] !! WEP !! WPA/WPA2 !! [[Archiso]] [https://gitlab.archlinux.org/archlinux/archiso/-/blob/master/configs/releng/packages.x86_64]<br />
|-<br />
| [https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html wireless_tools]<sup>1</sup> || {{Pkg|wireless_tools}} || {{Yes}} || {{no}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| [https://wireless.wiki.kernel.org/en/users/documentation/iw iw] || {{Pkg|iw}} || {{No}} || {{Yes}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| [[wpa_supplicant]] || {{Pkg|wpa_supplicant}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| [[iwd]] || {{Pkg|iwd}} || {{No}} || {{Yes}} || {{No}} || {{Yes}} || {{Yes}}<br />
|}<br />
<br />
# Deprecated.<br />
<br />
Note that some cards only support WEXT.<br />
<br />
=== iw and wireless_tools comparison ===<br />
<br />
The table below gives an overview of comparable commands for ''iw'' and ''wireless_tools''. See [https://wireless.wiki.kernel.org/en/users/Documentation/iw/replace-iwconfig iw replaces iwconfig] for more examples.<br />
<br />
{| class="wikitable"<br />
! ''iw'' command<br />
! ''wireless_tools'' command<br />
! Description<br />
|-<br />
| iw dev ''wlan0'' link<br />
| iwconfig ''wlan0''<br />
| Getting link status.<br />
|-<br />
| iw dev ''wlan0'' scan<br />
| iwlist ''wlan0'' scan<br />
| Scanning for available access points.<br />
|-<br />
| iw dev ''wlan0'' set type ibss<br />
| iwconfig ''wlan0'' mode ad-hoc<br />
| Setting the operation mode to ''ad-hoc''.<br />
|-<br />
| iw dev ''wlan0'' connect ''your_essid''<br />
| iwconfig ''wlan0'' essid ''your_essid''<br />
| Connecting to open network.<br />
|-<br />
| iw dev ''wlan0'' connect ''your_essid'' 2432<br />
| iwconfig ''wlan0'' essid ''your_essid'' freq 2432M<br />
| Connecting to open network specifying channel.<br />
|-<br />
| rowspan="2" | iw dev ''wlan0'' connect ''your_essid'' key 0:''your_key''<br />
| iwconfig ''wlan0'' essid ''your_essid'' key ''your_key''<br />
| Connecting to WEP encrypted network using hexadecimal key.<br />
|-<br />
| iwconfig ''wlan0'' essid ''your_essid'' key s:''your_key''<br />
| Connecting to WEP encrypted network using ASCII key.<br />
|-<br />
| iw dev ''wlan0'' set power_save on<br />
| iwconfig ''wlan0'' power on<br />
| Enabling power save.<br />
|}<br />
<br />
== iw ==<br />
<br />
{{Note|<br />
* Note that most of the commands have to be executed with [[Users and groups|root permissions]]. Executed with normal user rights, some of the commands (e.g. ''iw list''), will exit without error but not produce the correct output either, which can be confusing.<br />
* Depending on your hardware and encryption type, some of these steps may not be necessary. Some cards are known to require interface activation and/or access point scanning before being associated to an access point and being given an IP address. Some experimentation may be required. For instance, WPA/WPA2 users may try to directly activate their wireless network from step [[#Connect to an access point]].}}<br />
<br />
Examples in this section assume that your wireless device interface is {{ic|''interface''}} and that you are connecting to {{ic|''your_essid''}} wifi access point. Replace both accordingly.<br />
<br />
=== Get the name of the interface ===<br />
<br />
{{Tip|See [https://wireless.wiki.kernel.org/en/users/documentation/iw official documentation] of the ''iw'' tool for more examples.}}<br />
<br />
To get the name of your wireless interface do:<br />
<br />
$ iw dev<br />
<br />
The name of the interface will be output after the word "Interface". For example, it is commonly {{ic|wlan0}}.<br />
<br />
=== Get the status of the interface ===<br />
<br />
To check link status, use following command.<br />
<br />
$ iw dev ''interface'' link<br />
<br />
You can get statistic information, such as the amount of tx/rx bytes, signal strength etc., with following command:<br />
<br />
$ iw dev ''interface'' station dump<br />
<br />
=== Activate the interface ===<br />
<br />
{{Tip|Usually this step is not required.}}<br />
<br />
Some cards require that the kernel interface be activated before you can use ''iw'' or ''wireless_tools'':<br />
<br />
# ip link set ''interface'' up<br />
<br />
{{Note|If you get errors like {{ic|RTNETLINK answers: Operation not possible due to RF-kill}}, make sure that hardware switch is ''on''. See [[#Rfkill caveat]] for details.}}<br />
<br />
To verify that the interface is up, inspect the output of the following command:<br />
<br />
{{hc|$ ip link show ''interface''|<br />
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000<br />
link/ether 12:34:56:78:9a:bc brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
The {{ic|UP}} in {{ic|<BROADCAST,MULTICAST,UP,LOWER_UP>}} is what indicates the interface is up, not the later {{ic|state DOWN}}.<br />
<br />
=== Discover access points ===<br />
<br />
To see what access points are available:<br />
<br />
# iw dev ''interface'' scan | less<br />
<br />
{{Note|If it displays {{ic|Interface does not support scanning}}, then you probably forgot to install the firmware. In some cases this message is also displayed when not running ''iw'' as root.}}<br />
<br />
{{Tip|Depending on your location, you might need to set the correct [[#Respecting the regulatory domain|regulatory domain]] in order to see all available networks.}}<br />
<br />
The important points to check:<br />
* '''SSID:''' the name of the network.<br />
* '''Signal:''' is reported in a wireless power ratio in dBm (e.g. from -100 to 0). The closer the negative value gets to zero, the better the signal. Observing the reported power on a good quality link and a bad one should give an idea about the individual range. <br />
* '''Security:''' it is not reported directly, check the line starting with {{ic|capability}}. If there is {{ic|Privacy}}, for example {{ic|capability: ESS Privacy ShortSlotTime (0x0411)}}, then the network is protected somehow.<br />
** If you see an {{ic|RSN}} information block, then the network is protected by [[Wikipedia:IEEE 802.11i-2004|Robust Security Network]] protocol, also known as WPA2.<br />
** If you see an {{ic|WPA}} information block, then the network is protected by [[Wikipedia:Wi-Fi Protected Access|Wi-Fi Protected Access]] protocol.<br />
** In the {{ic|RSN}} and {{ic|WPA}} blocks you may find the following information:<br />
*** '''Group cipher:''' value in TKIP, CCMP, both, others.<br />
*** '''Pairwise ciphers:''' value in TKIP, CCMP, both, others. Not necessarily the same value than Group cipher.<br />
*** '''Authentication suites:''' value in PSK, 802.1x, others. For home router, you will usually find PSK (''i.e.'' passphrase). In universities, you are more likely to find 802.1x suite which requires login and password. Then you will need to know which key management is in use (e.g. EAP), and what encapsulation it uses (e.g. PEAP). See [[#WPA2 Enterprise]] and [[Wikipedia:Authentication protocol]] for details.<br />
** If you see neither {{ic|RSN}} nor {{ic|WPA}} blocks but there is {{ic|Privacy}}, then WEP is used.<br />
<br />
=== Set operating mode ===<br />
<br />
You might need to set the proper operating mode of the wireless card. More specifically, if you are going to connect an [[Ad-hoc networking|ad-hoc network]], you need to set the operating mode to {{ic|ibss}}:<br />
<br />
# iw dev ''interface'' set type ibss<br />
<br />
{{Note|Changing the operating mode on some cards might require the wireless interface to be ''down'' ({{ic|ip link set ''interface'' down}}).}}<br />
<br />
=== Connect to an access point ===<br />
<br />
Depending on the encryption, you need to associate your wireless device with the access point to use and pass the encryption key:<br />
<br />
* '''No encryption''' {{bc|# iw dev ''interface'' connect "''your_essid''"}}<br />
* '''WEP'''<br />
** using a hexadecimal or ASCII key (the format is distinguished automatically, because a WEP key has a fixed length): {{bc|# iw dev ''interface'' connect "''your_essid''" key 0:''your_key''}}<br />
** using a hexadecimal or ASCII key, specifying the third set up key as default (keys are counted from zero, four are possible): {{bc|# iw dev ''interface'' connect "''your_essid''" key d:2:''your_key''}}<br />
<br />
Regardless of the method used, you can check if you have associated successfully:<br />
<br />
# iw dev ''interface'' link<br />
<br />
== Authentication ==<br />
<br />
{{Expansion|Add [[Wikipedia:WPA3|WPA3 Enterprise]] ({{Bug|65314}}) and [[Wikipedia:Opportunistic Wireless Encryption|Opportunistic Wireless Encryption (OWE) a.k.a. Enhanced Open]]. Warn against WEP and open networks.}}<br />
<br />
=== WPA2 Personal ===<br />
<br />
WPA2 Personal, a.k.a. WPA2-PSK, is a mode of [[Wikipedia:Wi-Fi Protected_Access|Wi-Fi Protected Access]].<br />
<br />
You can authenticate to WPA2 Personal networks using [[wpa_supplicant]] or [[iwd]], or connect using a [[network manager]]. If you only authenticated to the network, then to have a fully functional connection you will still need to assign the IP address(es) and routes either [[Network configuration#Static IP address|manually]] or using a [[DHCP]] client.<br />
<br />
=== WPA2 Enterprise ===<br />
<br />
''WPA2 Enterprise'' is a mode of [[Wikipedia:Wi-Fi_Protected_Access|Wi-Fi Protected Access]]. It provides better security and key management than ''WPA2 Personal'', and supports other enterprise-type functionality, such as VLANs and [[wikipedia:Network Access Protection|NAP]]. However, it requires an external authentication server, called [[wikipedia:RADIUS|RADIUS]] server to handle the authentication of users. This is in contrast to Personal mode which does not require anything beyond the wireless router or access points (APs), and uses a single passphrase or password for all users.<br />
<br />
The Enterprise mode enables users to log onto the Wi-Fi network with a username and password and/or a digital certificate. Since each user has a dynamic and unique encryption key, it also helps to prevent user-to-user snooping on the wireless network, and improves encryption strength.<br />
<br />
This section describes the configuration of [[List of applications#Network managers|network clients]] to connect to a wireless access point with WPA2 Enterprise mode. See [[Software access point#RADIUS]] for information on setting up an access point itself. <br />
<br />
{{Note|Enterprise mode requires a more complex client configuration, whereas Personal mode only requires entering a passphrase when prompted. Clients likely need to install the server’s CA certificate (plus per-user certificates if using EAP-TLS), and then manually configure the wireless security and 802.1X authentication settings.}}<br />
<br />
For a comparison of protocols see the following [http://deployingradius.com/documents/protocols/compatibility.html table].<br />
<br />
{{Warning|It is possible to use WPA2 Enterprise without the client checking the server CA certificate. However, you should always seek to do so, because without authenticating the access point the connection can be subject to a man-in-the-middle attack. This may happen because while the connection handshake itself may be encrypted, the most widely used setups transmit the password itself either in plain text or the easily breakable [[#MS-CHAPv2]]. Hence, the client might send the password to a malicious access point which then proxies the connection.}}<br />
<br />
==== MS-CHAPv2 ====<br />
<br />
WPA2-Enterprise wireless networks demanding MSCHAPv2 type-2 authentication with PEAP sometimes require {{Pkg|pptpclient}} in addition to the stock {{Pkg|ppp}} package. [[netctl]] seems to work out of the box without ppp-mppe, however. In either case, usage of MSCHAPv2 is discouraged as it is highly vulnerable, although using another method is usually not an option.<br />
<br />
==== eduroam ====<br />
<br />
[[Wikipedia:eduroam|eduroam]] is an international roaming service for users in research, higher education and further education, based on WPA2 Enterprise.<br />
<br />
{{Note|<br />
* Check connection details '''first''' with your institution before applying any profiles listed in this section. Example profiles are not guaranteed to work or match any security requirements.<br />
* When storing connection profiles unencrypted, it is recommended restrict read access to the root account by specifying {{ic|chmod 600 ''profile''}} as root.<br />
}}<br />
<br />
{{Tip|Configuration for [[NetworkManager]] can be generated with the [https://cat.eduroam.org/ eduroam Configuration Assistant Tool].}}<br />
<br />
==== Manual/automatic setup ====<br />
<br />
* [[wpa_supplicant#Advanced usage|wpa_supplicant]] can be configured directly by its configuration file or using its CLI/GUI front ends and used in combination with a DHCP client. See the examples in {{ic|/usr/share/doc/wpa_supplicant/wpa_supplicant.conf}} for configuring the connection details.<br />
* [[iwd#WPA Enterprise]]<br />
* [[NetworkManager]] can create WPA2 Enterprise profiles with ''nmcli'' or the [[NetworkManager#Front-ends|graphical front ends]]. ''nmtui'' does not support this ([https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/376 NetworkManager issue 376]), but may use existing profiles.<br />
* [[ConnMan]] needs a separate configuration file before [[ConnMan#Wi-Fi|connecting]] to the network. See {{man|5|connman-service.config}} and [[ConnMan#Connecting to eduroam (802.1X)]] for details.<br />
* [[netctl]] supports wpa_supplicant configuration through blocks included with {{ic|1=WPAConfigSection=}}. See {{man|5|netctl.profile}} for details.<br />
: {{Note|Special quoting rules apply: see {{man|5|netctl.profile|SPECIAL QUOTING RULES}}.}}<br />
: {{Tip|Custom certificates can be specified by adding the line {{ic|1='ca_cert="/path/to/special/certificate.cer"'}} in {{ic|WPAConfigSection}}.}}<br />
<br />
=== WPA3 Personal ===<br />
<br />
WPA3 Personal, a.k.a. WPA3-SAE, is a mode of [[Wikipedia:Wi-Fi Protected_Access|Wi-Fi Protected Access]].<br />
<br />
[[wpa_supplicant]] supports WPA3 Personal ({{ic|CONFIG_SAE}} is enabled in {{Pkg|wpa_supplicant}} since version 2:2.9-4).<br />
<br />
[[iwd]] supports WPA3 since at least [https://iwd.wiki.kernel.org/networkmanager version 1.0].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Respecting the regulatory domain ===<br />
<br />
The [[wikipedia:IEEE_802.11#Regulatory_domains_and_legal_compliance|regulatory domain]], or "regdomain", is used to reconfigure wireless drivers to make sure that wireless hardware usage complies with local laws set by the FCC, ETSI and other organizations. Regdomains use [[wikipedia:ISO_3166-1_alpha-2|ISO 3166-1 alpha-2 country codes]]. For example, the regdomain of the United States would be "US", China would be "CN", etc.<br />
<br />
Regdomains affect the availability of wireless channels. In the 2.4GHz band, the allowed channels are 1-11 for the US, 1-14 for Japan, and 1-13 for most of the rest of the world. In the 5GHz band, the rules for allowed channels are much more complex. In either case, consult [[wikipedia:List_of_WLAN_channels|this list of WLAN channels]] for more detailed information.<br />
<br />
Regdomains also affect the limit on the [[wikipedia:Equivalent_isotropically_radiated_power|effective isotropic radiated power (EIRP)]] from wireless devices. This is derived from transmit power/"tx power", and is measured in [[wikipedia:DBm|dBm/mBm (1dBm=100mBm) or mW (log scale)]]. In the 2.4GHz band, the maximum is 30dBm in the US and Canada, 20dBm in most of Europe, and 20dBm-30dBm for the rest of the world. In the 5GHz band, maximums are usually lower. Consult the [https://git.kernel.org/cgit/linux/kernel/git/linville/wireless-regdb.git/tree/db.txt wireless-regdb] for more detailed information (EIRP dBm values are in the second set of brackets for each line).<br />
<br />
Misconfiguring the regdomain can be useful - for example, by allowing use of an unused channel when other channels are crowded, or by allowing an increase in tx power to widen transmitter range. However, '''this is not recommended''' as it could break local laws and cause interference with other radio devices.<br />
<br />
Since kernel 4.15, there are two ways to load the regulatory database. The first is to use the deprecated "central regulatory domain agent" provided by {{Pkg|crda}}, which loads the database via udev rule. The second is to allow the kernel to load the database directly, which is supported by {{Pkg|wireless-regdb}}. For direct loading the kernel must be configured with {{ic|CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS}} set to yes and should, for security's sake, be configured with {{ic|CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS}} set to yes to allow for cryptographic verification of the database. This is true of the stock Arch kernel, but if you are using an alternate kernel, or compiling your own, you should verify this. More information is available at [http://docker.hd-wireless.com/Support/WifiRegulatoryDomainsinLinux this guide].<br />
<br />
To configure the regdomain, install {{Pkg|crda}} or {{Pkg|wireless-regdb}} and reboot (to reload the {{ic|cfg80211}} module and all related drivers). Check the boot log to make sure that CRDA is being called or the database loaded and key verified by {{ic|cfg80211}}:<br />
<br />
# dmesg | grep cfg80211<br />
<br />
The current regdomain can be set to the United States with:<br />
<br />
# iw reg set US<br />
<br />
And queried with:<br />
<br />
$ iw reg get<br />
<br />
{{Note|<br />
* Your device may be set to country "00", which is the "world regulatory domain" and contains generic settings. If this cannot be unset, CRDA may be misconfigured.<br />
}}<br />
<br />
However, setting the regdomain may not alter your settings. Some devices have a regdomain set in firmware/EEPROM, which dictates the limits of the device, meaning that setting regdomain in software [https://wiki.openwrt.org/doc/howto/wireless.utilities#iw can only increase restrictions], not decrease them. For example, a CN device could be set in software to the US regdomain, but because CN has an EIRP maximum of 20dBm, the device will not be able to transmit at the US maximum of 30dBm.<br />
<br />
For example, to see if the regdomain is being set in firmware for an Atheros device:<br />
<br />
# dmesg | grep ath:<br />
<br />
For other chipsets, it may help to search for "EEPROM", "regdomain", or simply the name of the device driver.<br />
<br />
To see if your regdomain change has been successful, and to query the number of available channels and their allowed transmit power:<br />
<br />
$ iw list | grep -A 15 Frequencies:<br />
<br />
A more permanent configuration of the regdomain can be achieved through editing {{ic|/etc/conf.d/wireless-regdom}} and uncommenting the appropriate domain.<br />
<br />
[[wpa_supplicant]] can also use a regdomain in the {{ic|1=country=}} line of {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}.<br />
<br />
It is also possible to configure the [https://wireless.wiki.kernel.org/en/developers/documentation/cfg80211 cfg80211] kernel module to use a specific regdomain by adding, for example, {{ic|1=options cfg80211 ieee80211_regdom=JP}} as [[Kernel_modules#Setting module options|module options]]. The module option is inherited from the [https://wireless.wiki.kernel.org/en/developers/regulatory#the_ieee80211_regdom_module_parameter old regulatory implementation] and in modern kernels act as a userspace regulatory hint as if it came through {{ic|nl80211}} through utilities like {{ic|iw}} and {{ic|wpa_supplicant}}.<br />
<br />
For further information, read the [https://wireless.wiki.kernel.org/en/developers/regulatory kernel.org regulatory documentation].<br />
<br />
=== Rfkill caveat ===<br />
<br />
Many laptops have a hardware button (or switch) to turn off wireless card, however, the card can also be blocked by kernel. This can be handled by ''rfkill''. To show the current status:<br />
<br />
{{hc|# rfkill list|<br />
0: phy0: Wireless LAN<br />
Soft blocked: yes<br />
Hard blocked: yes<br />
}}<br />
<br />
If the card is ''hard-blocked'', use the hardware button (switch) to unblock it. If the card is not ''hard-blocked'' but ''soft-blocked'', use the following command:<br />
<br />
# rfkill unblock wifi<br />
<br />
{{Note|It is possible that the card will go from ''hard-blocked'' and ''soft-unblocked'' state into ''hard-unblocked'' and ''soft-blocked'' state by pressing the hardware button (i.e. the ''soft-blocked'' bit is just switched no matter what). This can be adjusted by tuning some options of the {{ic|rfkill}} [[kernel module]].}}<br />
<br />
Hardware buttons to toggle wireless cards are handled by a vendor specific [[kernel module]], frequently these are [https://lwn.net/Articles/391230/ WMI] modules. Particularly for very new hardware models, it happens that the model is not fully supported in the latest stable kernel yet. In this case it often helps to search the kernel bug tracker for information and report the model to the maintainer of the respective vendor kernel module, if it has not happened already. <br />
<br />
See also [https://askubuntu.com/questions/62166/siocsifflags-operation-not-possible-due-to-rf-kill].<br />
<br />
=== Power saving ===<br />
<br />
See [[Power saving#Network interfaces]].<br />
<br />
== Troubleshooting ==<br />
<br />
This section contains general troubleshooting tips, not strictly related to problems with drivers or firmware. For such topics, see next section [[#Troubleshooting drivers and firmware]].<br />
<br />
=== Temporary internet access ===<br />
<br />
If you have problematic hardware and need internet access to, for example, download some software or get help in forums, you can make use of Android's built-in feature for internet sharing via USB cable. See [[Android tethering#USB tethering]] for more information.<br />
<br />
=== Observing logs ===<br />
<br />
A good first measure to troubleshoot is to analyze the system's logfiles first. In order not to manually parse through them all, it can help to open a second terminal/console window and watch the kernels messages with <br />
<br />
# dmesg -w<br />
<br />
while performing the action, e.g. the wireless association attempt. <br />
<br />
When using a tool for network management, the same can be done for systemd with <br />
<br />
# journalctl -f <br />
<br />
Frequently a wireless error is accompanied by a deauthentication with a particular reason code, for example: <br />
<br />
wlan0: deauthenticating from XX:XX:XX:XX:XX:XX by local choice (reason=3)<br />
<br />
Looking up [http://www.aboutcher.co.uk/2012/07/linux-wifi-deauthenticated-reason-codes/ the reason code] might give a first hint. Maybe it also helps you to look at the control message [https://wireless.wiki.kernel.org/en/developers/documentation/mac80211/auth-assoc-deauth flowchart], the journal messages will follow it. <br />
<br />
The individual tools used in this article further provide options for more detailed debugging output, which can be used in a second step of the analysis, if required.<br />
<br />
=== Failed to get IP address ===<br />
<br />
* If getting an IP address repeatedly fails using the default {{Pkg|dhcpcd}} client, try installing and using {{Pkg|dhclient}} instead. Do not forget to select ''dhclient'' as the primary DHCP client in the [[#Manual/automatic setup|connection manager]].<br />
<br />
* If you can get an IP address for a wired interface and not for a wireless interface, try disabling the wireless card's [[#Power saving|power saving]] features (specify {{ic|off}} instead of {{ic|on}}).<br />
<br />
* If you get a timeout error due to a ''waiting for carrier'' problem, then you might have to set the channel mode to {{ic|auto}} for the specific device:<br />
<br />
# iwconfig wlan0 channel auto<br />
<br />
Before changing the channel to auto, make sure your wireless interface is down. After it has successfully changed it, you can bring the interface up again and continue from there.<br />
<br />
=== Valid IP address but cannot resolve host ===<br />
<br />
If you are on a public wireless network that may have a [[wikipedia:Captive_portal|captive portal]], make sure to query an HTTP page (not an HTTPS page) from your web browser, as some captive portals only redirect HTTP.<br />
If this is not the issue, [[Domain name resolution#Resolve a domain name using NSS|check if you can resolve domain names]], it may be necessary to use the DNS server advertised via DHCP.<br />
<br />
=== Setting RTS and fragmentation thresholds ===<br />
<br />
Wireless hardware disables RTS and fragmentation by default. These are two different methods of increasing throughput at the expense of bandwidth (i.e. reliability at the expense of speed). These are useful in environments with wireless noise or many adjacent access points, which may create interference leading to timeouts or failing connections. <br />
<br />
Packet fragmentation improves throughput by splitting up packets with size exceeding the fragmentation threshold. The maximum value (2346) effectively disables fragmentation since no packet can exceed it. The minimum value (256) maximizes throughput, but may carry a significant bandwidth cost.<br />
<br />
# iw phy0 set frag 512<br />
<br />
[[Wikipedia:IEEE 802.11 RTS/CTS|RTS]] improves throughput by performing a handshake with the access point before transmitting packets with size exceeding the RTS threshold. The maximum threshold (2347) effectively disables RTS since no packet can exceed it. The minimum threshold (0) enables RTS for all packets, which is probably excessive for most situations.<br />
<br />
# iw phy0 set rts 500<br />
<br />
{{Note|{{ic|phy0}} is the name of the wireless device as listed by {{ic|$ iw phy}}.}}<br />
<br />
=== Random disconnections ===<br />
<br />
==== Cause #1 ====<br />
<br />
If [[dmesg]] says {{ic|1=wlan0: deauthenticating from MAC by local choice (reason=3)}} and you lose your Wi-Fi connection, it is likely that you have a bit too aggressive power-saving on your Wi-Fi card. Try disabling the wireless card's [[Power_management#Network_interfaces|power saving]] features (specify {{ic|off}} instead of {{ic|on}}).<br />
<br />
If your card does not support enabling/disabling power save mode, check the BIOS for power management options. Disabling PCI-Express power management in the BIOS of a Lenovo W520 resolved this issue.<br />
<br />
==== Cause #2 ====<br />
<br />
If you are experiencing frequent disconnections and ''dmesg'' shows messages such as <br />
<br />
{{ic|1=ieee80211 phy0: wlan0: No probe response from AP xx:xx:xx:xx:xx:xx after 500ms, disconnecting}}<br />
<br />
try changing the channel bandwidth to {{ic|20MHz}} through your router's settings page.<br />
<br />
==== Cause #3 ====<br />
<br />
On some laptop models with hardware rfkill switches (e.g., Thinkpad X200 series), due to wear or bad design, the switch (or its connection to the mainboard) might become loose over time resulting in seemingly random hardblocks/disconnects when you accidentally touch the switch or move the laptop.<br />
There is no software solution to this, unless your switch is electrical and the BIOS offers the option to disable the switch.<br />
If your switch is mechanical (most are), there are lots of possible solutions, most of which aim to disable the switch: Soldering the contact point on the mainboard/wifi-card, glueing or blocking the switch, using a screw nut to tighten the switch or removing it altogether.<br />
<br />
==== Cause #4 ====<br />
<br />
Another cause for frequent disconnects or a complete failure to connect may also be a sub-standard router, incomplete settings of the router, or interference by other wireless devices. <br />
<br />
To troubleshoot, first best try to connect to the router with no authentication. <br />
<br />
If that works, enable WPA/WPA2 again but choose fixed and/or limited router settings. For example: <br />
* If the router is considerably older than the wireless device you use for the client, test if it works with setting the router to one wireless mode <br />
* Disable mixed-mode authentication (e.g. only WPA2 with AES, or TKIP if the router is old) <br />
* Try a fixed/free channel rather than "auto" channel (maybe the router next door is old and interfering) <br />
* Disable [[Wikipedia:Wi-Fi Protected Setup|WPS]]<br />
* Change the router's 5 GHz channel(s) to a [[Wikipedia:List_of_WLAN_channels#5_GHz_(802.11a/h/j/n/ac/ax)|non-DFS (Dynamic Frequency Selection) channel]]. Connections on such channels [https://wifinigel.blogspot.com/2018/05/the-5ghz-problem-for-wi-fi-networks-dfs.html may be dropped or suddenly switched] due to interference from nearby weather radar.<br />
* Disable {{ic|40MHz}} channel bandwidth (lower throughput but less likely collisions) with {{ic|1=cfg80211.cfg80211_disable_40mhz_24ghz=1}}<br />
* If the router has quality of service settings, check completeness of settings (e.g. Wi-Fi Multimedia (WMM) is part of optional QoS flow control. An erroneous router firmware may advertise its existence although the setting is not enabled)<br />
<br />
==== Cause #5 ====<br />
<br />
On some wireless network adapters (e.g. Qualcomm Atheros AR9485), random disconnects can happen with a DMA error:<br />
<br />
{{hc|# journalctl -xb|2=<br />
ath: phy0: DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x02000020 DMADBG_7=0x0000a400<br />
wlp1s0: authenticate with 56:e7:ee:7b:55:bc<br />
wlp1s0: send auth to 56:e7:ee:7b:55:bc (try 1/3)<br />
wlp1s0: send auth to 56:e7:ee:7b:55:bc (try 2/3)<br />
wlp1s0: send auth to 56:e7:ee:7b:55:bc (try 3/3)<br />
wlp1s0: authentication with 56:e7:ee:7b:55:bc timed out<br />
}}<br />
<br />
A possible workaround is to disable the [https://www.kernel.org/doc/html/latest/x86/intel-iommu.html Intel IOMMU driver (DMA)], adding {{ic|1=intel_iommu=off}} to the [[kernel parameters]] [https://bbs.archlinux.org/viewtopic.php?pid=1907446#p1907446].<br />
<br />
{{Note|The Intel IOMMU driver is needed for some advanced virtual machine features, like PCI pass-through.}}<br />
<br />
==== Cause #6 ====<br />
<br />
If you are using a device with iwlwifi and iwlmvm for wireless connectivity, and your Wi-Fi card appears to disappear when on battery power (perhaps after a reboot or resuming from suspend), this can be fixed by configuring power saving settings in iwlmvm.<br />
<br />
Create the file {{ic|/etc/modprobe.d/iwlmvm.conf}} if it does not exist already, then add the following line to it:<br />
<br />
{{hc|/etc/modprobe.d/iwlmvm.conf|2=<br />
options iwlmvm power_scheme=1<br />
}}<br />
<br />
A {{ic|power_scheme}} of 1 sets iwlmvm to "Always Active." Available options are:<br />
<br />
{| class="wikitable"<br />
! Value !! Description<br />
|-<br />
| 1 || Always Active<br />
|-<br />
| 2 || Balanced<br />
|-<br />
| 3 || Low-power<br />
|}<br />
<br />
This fix was discovered at [http://forums.debian.net/viewtopic.php?t=121696#p576208].<br />
<br />
==== Cause #7 ====<br />
<br />
If your device undergoes long periods of inactivity (e.g. a file server) the disconnection may be due to power saving, which will block incoming traffic and prevent connections. Try disabling power saving for the interface:<br />
<br />
# iw dev ''interface'' set power_save off<br />
<br />
You can create a udev rule to do this on boot, see [[Power management#Network interfaces]].<br />
<br />
=== Wi-Fi networks invisible because of incorrect regulatory domain ===<br />
<br />
If the computer's Wi-Fi channels do not match those of the user's country, some in-range Wi-Fi networks might be invisible, because they use wireless channels that are not allowed by default. The solution is to configure the regulatory domain correctly, see [[#Respecting the regulatory domain]].<br />
<br />
== Troubleshooting drivers and firmware ==<br />
<br />
This section covers methods and procedures for installing kernel modules and ''firmware'' for specific chipsets, that differ from generic method.<br />
<br />
See [[Kernel modules]] for general information on operations with modules.<br />
<br />
=== Ralink/Mediatek ===<br />
<br />
==== rt2x00 ====<br />
<br />
Unified driver for Ralink chipsets (it replaces {{ic|rt2500}}, {{ic|rt61}}, {{ic|rt73}}, etc). This driver has been in the Linux kernel since 2.6.24, you only need to load the right module for the chip: {{ic|rt2400pci}}, {{ic|rt2500pci}}, {{ic|rt2500usb}}, {{ic|rt61pci}} or {{ic|rt73usb}} which will autoload the respective {{ic|rt2x00}} modules too.<br />
<br />
A list of devices supported by the modules is available at the project's [https://web.archive.org/web/20150507023412/http://rt2x00.serialmonkey.com/wiki/index.php/Hardware homepage].<br />
<br />
; Additional notes<br />
* Since kernel 3.0, rt2x00 includes also these drivers: {{ic|rt2800pci}}, {{ic|rt2800usb}}.<br />
* Since kernel 3.0, the staging drivers {{ic|rt2860sta}} and {{ic|rt2870sta}} are replaced by the mainline drivers {{ic|rt2800pci}} and {{ic|rt2800usb}} [https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fefecc6989b4b24276797270c0e229c07be02ad3].<br />
* Some devices have a wide range of options that can be configured with {{ic|iwpriv}}. These are documented in the [https://web.archive.org/web/20111105120212/http://web.ralinktech.com:80/ralink/Home/Support/Linux.html source tarballs] available from Ralink.<br />
<br />
==== rt3090 ====<br />
<br />
For devices which are using the rt3090 chipset it should be possible to use {{ic|rt2800pci}} driver, however, is not working with this chipset very well (e.g. sometimes it is not possible to use higher rate than 2Mb/s).<br />
<br />
==== rt3290 ====<br />
<br />
The rt3290 chipset is recognised by the kernel {{ic|rt2800pci}} module. However, some users experience problems and reverting to a patched Ralink driver seems to be beneficial in these [https://bbs.archlinux.org/viewtopic.php?id=161952 cases].<br />
<br />
==== rt3573 ====<br />
<br />
New chipset as of 2012. It may require proprietary drivers from Ralink. Different manufacturers use it, see the [https://bbs.archlinux.org/viewtopic.php?pid=1164228#p1164228 Belkin N750 DB wireless usb adapter] forums thread.<br />
<br />
==== mt7612u ====<br />
<br />
New chipset as of 2014, released under their new commercial name Mediatek. It is an AC1200 or AC1300 chipset. Manufacturer provides drivers for Linux on their [https://www.mediatek.com/products/broadbandWifi/mt7612u support page]. As of kernel 5.5 it should be supported by the included {{ic|mt76}} driver.<br />
<br />
=== Realtek ===<br />
<br />
See [https://wikidevi.com/wiki/Realtek] for a list of Realtek chipsets and specifications.<br />
<br />
==== rtl8192cu ====<br />
<br />
The driver is now in the kernel, but many users have reported being unable to make a connection although scanning for networks does work.<br />
<br />
{{AUR|8192cu-dkms}} includes many patches, try this if it does not work fine with the driver in kernel.<br />
<br />
==== rtl8723ae/rtl8723be ====<br />
<br />
The {{ic|rtl8723ae}} and {{ic|rtl8723be}} modules are included in the mainline Linux kernel.<br />
<br />
Some users may encounter errors with powersave on this card. This is shown with occasional disconnects that are not recognized by high level network managers ([[netctl]], [[NetworkManager]]). This error can be confirmed by running {{ic|dmesg -w}} as root or {{ic|journalctl -f}} as root and looking for output related to powersave and the {{ic|rtl8723ae}}/{{ic|rtl8723be}} module. If you are having this issue, use the {{ic|1=fwlps=0}} kernel option, which should prevent the WiFi card from automatically sleeping and halting connection. See [[Kernel module#Setting module options]].<br />
<br />
If you have poor signal, perhaps your device has only one physical antenna connected, and antenna autoselection is broken. You can force the choice of antenna with {{ic|1=ant_sel=1}} or {{ic|1=ant_sel=2}} kernel option. [https://bbs.archlinux.org/viewtopic.php?id=208472]<br />
<br />
==== rtl88xxau ====<br />
<br />
Realtek chipsets rtl8811au, rtl8812au, rtl8814au and rtl8821au designed for various USB adapters ranging from AC600 to AC1900. Several packages provide various kernel drivers, these require [[DKMS]] (the {{Pkg|dkms}} package and the kernel headers installed):<br />
<br />
{| class="wikitable"<br />
! Chipset || Driver version || Package || Notes<br />
|-<br />
| rtl8811au, rtl8812au, rtl8821au || 5.6.4.2 || {{AUR|rtl88xxau-aircrack-dkms-git}} || Aircrack-ng kernel module for 8811au, 8812au and 8821au chipsets with monitor mode and injection support.<br />
|-<br />
| rtl8814au || 5.8.5.1 || {{AUR|rtl8814au-aircrack-dkms-git}} || Aircrack-ng kernel module for 8814au chipsets with monitor mode and injection support.<br />
|-<br />
| rtl8812au || 5.9.3.2 || {{AUR|rtl8812au-dkms-git}} || Latest official Realtek driver version for rtl8812au '''only'''.<br />
|-<br />
| rtl8811au, rtl8821au || 5.8.2.3 || {{AUR|rtl8821au-dkms-git}} || Newer driver version for rtl8821au.<br />
|-<br />
| rtl8814au || 5.8.5.1 || {{AUR|rtl8814au-dkms-git}} || Possibly works for rtl8813au too. Seems to be deprecated in favor of {{AUR|rtl8814au-aircrack-dkms-git}}<br />
|}<br />
<br />
==== rtl8811cu/rtl8821cu ====<br />
<br />
{{AUR|rtl8821cu-dkms-git}} provides a kernel module for the Realtek 8811cu and 8821cu chipset.<br />
<br />
This requires [[DKMS]], so make sure you have your proper kernel headers installed.<br />
<br />
If no wireless interface shows up even though the {{ic|8821cu}} module is loaded, you may need to manually specify the {{ic|rtw_RFE_type}} option [https://forums.linuxmint.com/viewtopic.php?p=1913190&sid=68f2d6eff91cd47e184ae5a56385dc02#p1913190][https://github.com/brektrou/rtl8821CU/issues/83]. Try e.g. {{ic|1=rtw_RFE_type=0x26}}, other values might also work. See [[Kernel module#Setting module options]] for details.<br />
<br />
==== rtl8821ce ====<br />
<br />
{{AUR|rtl8821ce-dkms-git}} provides a kernel module for the Realtek 8821ce chipset found in the Asus X543UA.<br />
<br />
This requires [[DKMS]], so make sure you have your proper kernel headers installed.<br />
<br />
==== rtl8822bu ====<br />
<br />
{{AUR|rtl8822bu-dkms-git}} or {{AUR|rtl88x2bu-dkms-git}} provides a kernel module for the Realtek 8822bu chipset found in the Edimax EW7822ULC USB3, Asus AC53 Nano USB 802.11ac and TP-Link Archer T3U adapter.<br />
<br />
This requires [[DKMS]], so make sure you have your proper kernel headers installed.<br />
<br />
==== rtl8xxxu ====<br />
<br />
{{Expansion|Specific issues with the mainline module and kernel versions should be stated.}}<br />
<br />
Issues with the {{ic|rtl8xxxu}} mainline kernel module may be solved by compiling a third-party module for the specific chipset. The source code can be found in [https://github.com/lwfinger?tab=repositories GitHub repositories].<br />
<br />
Some drivers may be already prepared in the AUR, e.g. {{AUR|rtl8723bu-git-dkms}}.<br />
<br />
=== Atheros ===<br />
<br />
The [http://madwifi-project.org/ MadWifi team] currently maintains three different drivers for devices with Atheros chipset:<br />
<br />
* {{ic|madwifi}} is an old, obsolete driver. Not present in Arch kernel since 2.6.39.1<sup>[https://mailman.archlinux.org/pipermail/arch-dev-public/2011-June/020669.html]</sup>.<br />
* {{ic|ath5k}} is newer driver, which replaces the {{ic|madwifi}} driver. Currently a better choice for some chipsets, but not all chipsets are supported (see below)<br />
* {{ic|ath9k}} is the newest of these three drivers, it is intended for newer Atheros chipsets. All of the chips with 802.11n capabilities are supported.<br />
<br />
There are some other drivers for some Atheros devices. See [https://wireless.wiki.kernel.org/en/users/Drivers/Atheros#pcipci-eahb_driversrs Linux Wireless documentation] for details.<br />
<br />
==== ath5k ====<br />
<br />
External resources:<br />
* https://wireless.wiki.kernel.org/en/users/drivers/ath5k<br />
* [[Debian:ath5k]]<br />
<br />
If you find web pages randomly loading very slow, or if the device is unable to lease an IP address, try to switch from hardware to software encryption by loading the {{ic|ath5k}} module with {{ic|1=nohwcrypt=1}} option. See [[Kernel modules#Setting module options]] for details.<br />
<br />
Some laptops may have problems with their wireless LED indicator flickering red and blue. To solve this problem, do:<br />
<br />
# echo none > /sys/class/leds/ath5k-phy0::tx/trigger<br />
# echo none > /sys/class/leds/ath5k-phy0::rx/trigger<br />
<br />
For alternatives, see [https://bugzilla.redhat.com/show_bug.cgi?id=618232 this bug report].<br />
<br />
==== ath9k ====<br />
<br />
External resources:<br />
* https://wireless.wiki.kernel.org/en/users/drivers/ath9k<br />
* [[Debian:ath9k]]<br />
<br />
As of Linux 3.15.1, some users have been experiencing a decrease in bandwidth. In some cases this can fixed by setting the {{ic|1=nohwcrypt=1}} option for the {{ic|ath9k}} module. See [[Kernel module#Setting module options]].<br />
<br />
{{Note|Use the command {{ic|lsmod}} to see what modules are in use and change {{ic|ath9k}} if it is named differently (e.g. {{ic|ath9k_htc}}).}}<br />
<br />
In the unlikely event that you have stability issues that trouble you, you could try using the {{AUR|backports-patched}} package. An [https://web.archive.org/web/20201118232556/http://lists.ath9k.org/mailman/listinfo/ath9k-devel ath9k mailing list] exists for support and development related discussions.<br />
<br />
===== Power saving =====<br />
<br />
Although [https://wireless.wiki.kernel.org/en/users/Documentation/dynamic-power-save Linux Wireless] says that dynamic power saving is enabled for Atheros ath9k single-chips newer than AR9280, for some devices (e.g. AR9285) {{Pkg|powertop}} might still report that power saving is disabled. In this case enable it manually.<br />
<br />
On some devices (e.g. AR9285), enabling the power saving might result in the following error:<br />
<br />
{{hc|# iw dev wlan0 set power_save on|<br />
command failed: Operation not supported (-95)<br />
}}<br />
<br />
The solution is to set the {{ic|1=ps_enable=1}} option for the {{ic|ath9k}} module, see [[Kernel module#Setting module options]].<br />
<br />
=== Intel ===<br />
<br />
==== ipw2100 and ipw2200 ====<br />
<br />
These modules are fully supported in the kernel, but they require additional firmware. Depending on which of the chipsets you have, [[install]] either {{Pkg|ipw2100-fw}} or {{Pkg|ipw2200-fw}}. Then [[Kernel modules#Manual module handling|reload]] the appropriate module.<br />
<br />
{{Tip|You may use the following [[Kernel modules#Setting module options|module options]]:<br />
* use the {{ic|1=rtap_iface=1}} option to enable the radiotap interface<br />
* use the {{ic|1=led=1}} option to enable a front LED indicating when the wireless is connected or not<br />
}}<br />
<br />
==== iwlegacy ====<br />
<br />
[https://wireless.wiki.kernel.org/en/users/Drivers/iwlegacy iwlegacy] is the wireless driver for Intel's 3945 and 4965 wireless chips. The firmware is included in the {{Pkg|linux-firmware}} package.<br />
<br />
[[udev]] should load the driver automatically, otherwise load {{ic|iwl3945}} or {{ic|iwl4965}} manually. See [[Kernel modules]] for details.<br />
<br />
If you have problems connecting to networks in general, random failures with your card on bootup or your link quality is very poor, try to disable 802.11n:<br />
<br />
{{hc|/etc/modprobe.d/iwl4965.conf|2=<br />
options iwl4965 11n_disable=1<br />
}}<br />
<br />
If the failures persist during bootup and you are using Nouveau driver, try [[Nouveau#Enable_early_KMS|enabling early KMS]] to prevent the conflict [https://bbs.archlinux.org/viewtopic.php?pid=1748667#p1748667].<br />
<br />
==== iwlwifi ====<br />
<br />
[https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi iwlwifi] is the wireless driver for Intel's current wireless chips, such as 5100AGN, 5300AGN, and 5350AGN. See the [https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi#supported_devices full list of supported devices]. The firmware is included in the {{Pkg|linux-firmware}} package. The {{AUR|linux-firmware-iwlwifi-git}} may contain some updates sooner.<br />
<br />
If you have problems connecting to networks in general or your link quality is very poor, try to disable 802.11n, and perhaps also enable software encryption:<br />
<br />
{{hc|/etc/modprobe.d/iwlwifi.conf|2=<br />
options iwlwifi 11n_disable=1 swcrypto=1<br />
}}<br />
<br />
If you have a problem with slow uplink speed in 802.11n mode, for example 20Mbps, try to enable antenna aggregation:<br />
<br />
{{hc|/etc/modprobe.d/iwlwifi.conf|2=<br />
options iwlwifi 11n_disable=8<br />
}}<br />
<br />
Do not be confused with the option name, when the value is set to {{ic|8}} it does not disable anything but re-enables transmission antenna aggregation.[https://forums.gentoo.org/viewtopic-t-996692.html?sid=81bdfa435c089360bdfd9368fe0339a9] [https://bugzilla.kernel.org/show_bug.cgi?id=81571]<br />
<br />
In case this does not work for you, you may try disabling [[Power saving#Network interfaces|power saving]] for your wireless adapter.<br />
<br />
[https://ubuntuforums.org/showthread.php?t=2183486&p=12845473#post12845473 Some] have never gotten this to work. [https://ubuntuforums.org/showthread.php?t=2205733&p=12935783#post12935783 Others] found salvation by disabling N in their router settings after trying everything. This is known to have be the only solution on more than one occasion. The second link there mentions a 5ghz option that might be worth exploring.<br />
<br />
If you have an 802.11ax (WiFi 6) access point and have problems detecting the beacons or an unreliable connection, review [https://www.intel.com/content/www/us/en/support/articles/000054799/network-and-i-o/wireless.html Intel Article 54799].<br />
<br />
{{Note|Using {{ic|1=11n_disable=0}} will also prevent 802.11ac and only allow connection with slower protocols (802.11a in the 5GHz band or 802.11b/g in the 2.4 GHz band).}}<br />
<br />
===== Bluetooth coexistence =====<br />
<br />
If you have difficulty connecting a bluetooth headset and maintaining good downlink speed, try disabling bluetooth coexistence [https://wireless.wiki.kernel.org/en/users/Drivers/iwlwifi#wi-fibluetooth_coexistence]:<br />
<br />
{{hc|/etc/modprobe.d/iwlwifi.conf|2=<br />
options iwlwifi bt_coex_active=0<br />
}}<br />
<br />
===== Firmware stack traces =====<br />
<br />
{{Accuracy|What is the last note about ignored packages trying to say?}}<br />
<br />
You may have some issue where the driver outputs stack traces & errors, which can cause some stuttering.<br />
<br />
{{hc|# dmesg|2=<br />
Microcode SW error detected. Restarting 0x2000000.<br />
}}<br />
<br />
To fix those errors, you may downgrade the package {{Pkg|linux-firmware}} or rename the last version of the firmware used by your device so that an older version is loaded (which keeps it out of pacman's ignored packages).<br />
<br />
==== Disabling LED blink ====<br />
<br />
{{Note|This works with the {{ic|iwlegacy}} and {{ic|iwlwifi}} drivers.}}<br />
<br />
The default settings on the module are to have the LED blink on activity. Some people find this extremely annoying. To have the LED on solid when Wi-Fi is active, you can use the [[systemd-tmpfiles]]:<br />
<br />
{{hc|/etc/tmpfiles.d/phy0-led.conf|<br />
w /sys/class/leds/phy0-led/trigger - - - - phy0radio<br />
}}<br />
<br />
Run {{ic|systemd-tmpfiles --create phy0-led.conf}} for the change to take effect, or reboot.<br />
<br />
To see all the possible trigger values for this LED:<br />
<br />
# cat /sys/class/leds/phy0-led/trigger<br />
<br />
{{Tip|If you do not have {{ic|/sys/class/leds/phy0-led}}, you may try to use the {{ic|1=led_mode="1"}} [[Kernel modules#Setting module options|module option]]. It should be valid for both {{ic|iwlwifi}} and {{ic|iwlegacy}} drivers.}}<br />
<br />
=== Broadcom ===<br />
<br />
See [[Broadcom wireless]].<br />
<br />
=== Other drivers/devices ===<br />
<br />
==== Tenda w322u ====<br />
<br />
Treat this Tenda card as an {{ic|rt2870sta}} device. See [[#rt2x00]].<br />
<br />
==== orinoco ====<br />
<br />
This should be a part of the kernel package and be installed already.<br />
<br />
Some Orinoco chipsets are Hermes II. You can use the {{ic|wlags49_h2_cs}} driver instead of {{ic|orinoco_cs}} and gain WPA support. To use the driver, [[blacklist]] {{ic|orinoco_cs}} first.<br />
<br />
==== prism54 ====<br />
<br />
The driver {{ic|p54}} is included in kernel, but you have to download the appropriate firmware for your card from [https://wireless.wiki.kernel.org/en/users/drivers/p54#firmware this site] and install it into the {{ic|/usr/lib/firmware}} directory.<br />
<br />
{{Note|There is also older, deprecated driver {{ic|prism54}}, which might conflict with the newer driver ({{ic|p54pci}} or {{ic|p54usb}}). Make sure to [[blacklist]] {{ic|prism54}}.}}<br />
<br />
==== ACX100/111 ====<br />
<br />
{{Warning|The drivers for these devices [https://mailman.archlinux.org/pipermail/arch-dev-public/2011-June/020669.html are broken] and do not work with newer kernel versions.}}<br />
<br />
Packages: {{ic|tiacx}} {{ic|tiacx-firmware}} (deleted from official repositories and AUR)<br />
<br />
See [https://sourceforge.net/projects/acx100/ official page] for details.<br />
<br />
==== zd1211rw ====<br />
<br />
[https://sourceforge.net/projects/zd1211/ zd1211rw] is a driver for the ZyDAS ZD1211 802.11b/g USB WLAN chipset, and it is included in recent versions of the Linux kernel. See [https://wireless.wiki.kernel.org/en/users/Drivers/zd1211rw/devices] for a list of supported devices. You only need to [[install]] the firmware for the device, provided by the {{AUR|zd1211-firmware}} package.<br />
<br />
==== hostap_cs ====<br />
<br />
[https://hostap.epitest.fi/ Host AP] is a Linux driver for wireless LAN cards based on Intersil's Prism2/2.5/3 chipset. The driver is included in Linux kernel.<br />
<br />
{{Note|Make sure to [[blacklist]] the {{ic|orinico_cs}} driver, it may cause problems.}}<br />
<br />
=== ndiswrapper ===<br />
<br />
Ndiswrapper is a wrapper script that allows you to use some Windows drivers in Linux. You will need the {{ic|.inf}} and {{ic|.sys}} files from your Windows driver. <br />
{{Warning|Be sure to use drivers appropriate to your architecture (x86 vs. x86_64).}}<br />
<br />
{{Tip|If you need to extract these files from an {{ic|*.exe}} file, you can use {{Pkg|cabextract}}.}}<br />
<br />
Follow these steps to configure ndiswrapper.<br />
<br />
1. Install {{Pkg|ndiswrapper-dkms}}<br />
<br />
2. Install the driver to {{ic|/etc/ndiswrapper/*}}<br />
# ndiswrapper -i filename.inf<br />
<br />
3. List all installed drivers for ndiswrapper<br />
$ ndiswrapper -l<br />
<br />
4. Let ndiswrapper write its configuration in {{ic|/etc/modprobe.d/ndiswrapper.conf}}:<br />
# ndiswrapper -m<br />
# depmod -a<br />
<br />
Now the ndiswrapper install is almost finished; follow the instructions on [[Kernel modules#Automatic module loading with systemd]] to automatically load the module at boot.<br />
<br />
The important part is making sure that ndiswrapper exists on this line, so just add it alongside the other modules. It would be best to test that ndiswrapper will load now, so:<br />
# modprobe ndiswrapper<br />
# iwconfig<br />
<br />
and ''wlan0'' should now exist. If you have problems, some help is available at:<br />
[https://sourceforge.net/p/ndiswrapper/ndiswrapper/HowTos/ ndiswrapper howto] and [https://sourceforge.net/p/ndiswrapper/ndiswrapper/FAQ/ ndiswrapper FAQ].<br />
<br />
=== backports-patched ===<br />
<br />
{{AUR|backports-patched}} provide drivers released on newer kernels backported for usage on older kernels. The project started since 2007 and was originally known as compat-wireless, evolved to compat-drivers and was recently renamed simply to backports. <br />
<br />
If you are using old kernel and have wireless issue, drivers in this package may help.<br />
<br />
== See also ==<br />
<br />
* [https://wireless.wiki.kernel.org/ The Linux Wireless project]<br />
* [https://aircrack-ng.org/doku.php?id=install_drivers Aircrack-ng guide on installing drivers]<br />
* [https://wikidevi.wi-cat.ru Wireless Device Database Wiki] (This fork is hosted by wi-cat.ru since the original wiki has shut down. There are two less complete versions available: [http://en.techinfodepot.shoutwiki.com TechInfoDepot], [https://deviwiki.com/ deviwiki])</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Network_configuration/Wireless&diff=694999Network configuration/Wireless2021-09-08T14:03:12Z<p>Snakeroot: Since kernel 4.15, crda is no longer the only game in town and is, in fact, deprecated.</p>
<hr />
<div>[[Category:Wireless networking]]<br />
[[Category:Network configuration]]<br />
[[cs:Network configuration (Čeština)/Wireless]]<br />
[[de:(W)LAN und Arch Linux]]<br />
[[el:Network configuration (Ελληνικά)/Wireless]]<br />
[[es:Network configuration (Español)/Wireless]]<br />
[[fa:تنظیمات شبکه ی بی سیم]]<br />
[[fr:Network configuration (Français)/Wireless]]<br />
[[it:Network configuration (Italiano)/Wireless]]<br />
[[ja:ワイヤレス設定]]<br />
[[pt:Network configuration (Português)/Wireless]]<br />
[[ru:Network configuration (Русский)/Wireless]]<br />
[[zh-hans:Network configuration (简体中文)/Wireless]]<br />
{{Related articles start}}<br />
{{Related|Software access point}}<br />
{{Related|Ad-hoc networking}}<br />
{{Related|Internet sharing}}<br />
{{Related|Wireless bonding}}<br />
{{Related|Network Debugging}}<br />
{{Related|Bluetooth}}<br />
{{Related articles end}}<br />
<br />
The main article on network configuration is [[Network configuration]].<br />
<br />
Configuring wireless is a two-part process; the first part is to identify and ensure the correct driver for your wireless device is installed (they are available on the installation media, but often have to be installed explicitly), and to configure the interface. The second is choosing a method of managing wireless connections. This article covers both parts, and provides additional links to wireless management tools.<br />
<br />
The [[#iw]] section describes how to manually manage your wireless network interface / your wireless LANs using {{Pkg|iw}}. The [[Network configuration#Network managers]] section describes several programs that can be used to automatically manage your wireless interface, some of which include a GUI and all of which include support for network profiles (useful when frequently switching wireless networks, like with laptops).<br />
<br />
== Device driver ==<br />
<br />
The default Arch Linux kernel is ''modular'', meaning many of the drivers for machine hardware reside on the hard drive and are available as [[Kernel modules|modules]]. At boot, [[udev]] takes an inventory of your hardware and loads appropriate modules (drivers) for your corresponding hardware, which will in turn allow creation of a network ''interface''.<br />
<br />
Some wireless chipsets also require firmware, in addition to a corresponding driver. Many firmware images are provided by the {{Pkg|linux-firmware}} package; however, proprietary firmware images are not included and have to be installed separately. This is described in [[#Installing driver/firmware]].<br />
<br />
{{Note|If the proper module is not loaded by udev on boot, simply [[Kernel modules#Manual module handling|load it manually]]. If udev loads more than one driver for a device, the resulting conflict may prevent successful configuration. Make sure to [[blacklist]] the unwanted module.}}<br />
<br />
=== Check the driver status ===<br />
<br />
To check if the driver for your card has been loaded, check the output of the {{ic|lspci -k}} or {{ic|lsusb -v}} command, depending on if the card is connected by PCI(e) or USB. You should see that some kernel driver is in use, for example:<br />
<br />
{{hc|$ lspci -k|<br />
06:00.0 Network controller: Intel Corporation WiFi Link 5100<br />
Subsystem: Intel Corporation WiFi Link 5100 AGN<br />
Kernel driver in use: iwlwifi<br />
Kernel modules: iwlwifi<br />
}}<br />
<br />
{{Note|If the card is a USB device, running {{ic|dmesg {{!}} grep usbcore}} as root should give something like {{ic|usbcore: registered new interface driver rtl8187}} as output.}}<br />
<br />
Also check the output of the {{ic|ip link}} command to see if a wireless interface was created; usually the naming of the wireless [[network interfaces]] starts with the letter "w", e.g. {{ic|wlan0}} or {{ic|wlp2s0}}. Then bring the interface up with:<br />
<br />
# ip link set ''interface'' up<br />
<br />
For example, assuming the interface is {{ic|wlan0}}, this is {{ic|ip link set wlan0 up}}.<br />
<br />
{{Note|<br />
* If you get errors like {{ic|RTNETLINK answers: Operation not possible due to RF-kill}}, make sure that hardware switch is ''on''. See [[#Rfkill caveat]] for details.<br />
* If you get the error message {{ic|SIOCSIFFLAGS: No such file or directory}}, it most certainly means that your wireless chipset requires a firmware to function.<br />
}}<br />
<br />
Check kernel messages for firmware being loaded:<br />
<br />
{{hc|# dmesg {{!}} grep firmware|<br />
[ 7.148259] iwlwifi 0000:02:00.0: loaded firmware version 39.30.4.1 build 35138 op_mode iwldvm<br />
}}<br />
<br />
If there is no relevant output, check the messages for the full output for the module you identified earlier ({{ic|iwlwifi}} in this example) to identify the relevant message or further issues:<br />
<br />
{{hc|# dmesg {{!}} grep iwlwifi|2=<br />
[ 12.342694] iwlwifi 0000:02:00.0: irq 44 for MSI/MSI-X<br />
[ 12.353466] iwlwifi 0000:02:00.0: loaded firmware version 39.31.5.1 build 35138 op_mode iwldvm<br />
[ 12.430317] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEBUG disabled<br />
...<br />
[ 12.430341] iwlwifi 0000:02:00.0: Detected Intel(R) Corporation WiFi Link 5100 AGN, REV=0x6B<br />
}}<br />
<br />
If the kernel module is successfully loaded and the interface is up, you can skip the next section.<br />
<br />
=== Installing driver/firmware ===<br />
<br />
Check the following lists to discover if your card is supported:<br />
<br />
* See the table of [https://wireless.wiki.kernel.org/en/users/drivers existing Linux wireless drivers] and follow to the specific driver's page, which contains a list of supported devices. There is also a [https://wikidevi.com/wiki/List_of_Wi-Fi_Device_IDs_in_Linux List of Wi-Fi Device IDs in Linux].<br />
* The [https://help.ubuntu.com/community/WifiDocs/WirelessCardsSupported Ubuntu Wiki] has a good list of wireless cards and whether or not they are supported either in the Linux kernel or by a user-space driver (includes driver name).<br />
* [http://linux-wless.passys.nl/ Linux Wireless Support] and The Linux Questions' [https://web.archive.org/web/20110711100256/http://www.linuxquestions.org/hcl/index.php?cat=10 Hardware Compatibility List] (HCL) also have a good database of kernel-friendly hardware.<br />
<br />
Note that some vendors ship products that may contain different chip sets, even if the product identifier is the same. Only the usb-id (for USB devices) or pci-id (for PCI devices) is authoritative.<br />
<br />
If your wireless card is listed above, follow the [[#Troubleshooting drivers and firmware]] subsection of this page, which contains information about installing drivers and firmware of some specific wireless cards. Then [[#Check the driver status|check the driver status]] again.<br />
<br />
If your wireless card is not listed above, it is likely supported only under Windows (some Broadcom, 3com, etc). For these, you can try to use [[#ndiswrapper]].<br />
<br />
== Utilities ==<br />
<br />
Just like other network interfaces, the wireless ones are controlled with ''ip'' from the {{Pkg|iproute2}} package.<br />
<br />
Managing a wireless connection requires a basic set of tools. Either use a [[network manager]] or use one of the following directly:<br />
<br />
{| class="wikitable"<br />
! Software !! Package !! [https://wireless.wiki.kernel.org/en/developers/documentation/wireless-extensions WEXT] !! [https://wireless.wiki.kernel.org/en/developers/documentation/nl80211 nl80211] !! WEP !! WPA/WPA2 !! [[Archiso]] [https://gitlab.archlinux.org/archlinux/archiso/-/blob/master/configs/releng/packages.x86_64]<br />
|-<br />
| [https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html wireless_tools]<sup>1</sup> || {{Pkg|wireless_tools}} || {{Yes}} || {{no}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| [https://wireless.wiki.kernel.org/en/users/documentation/iw iw] || {{Pkg|iw}} || {{No}} || {{Yes}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| [[wpa_supplicant]] || {{Pkg|wpa_supplicant}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| [[iwd]] || {{Pkg|iwd}} || {{No}} || {{Yes}} || {{No}} || {{Yes}} || {{Yes}}<br />
|}<br />
<br />
# Deprecated.<br />
<br />
Note that some cards only support WEXT.<br />
<br />
=== iw and wireless_tools comparison ===<br />
<br />
The table below gives an overview of comparable commands for ''iw'' and ''wireless_tools''. See [https://wireless.wiki.kernel.org/en/users/Documentation/iw/replace-iwconfig iw replaces iwconfig] for more examples.<br />
<br />
{| class="wikitable"<br />
! ''iw'' command<br />
! ''wireless_tools'' command<br />
! Description<br />
|-<br />
| iw dev ''wlan0'' link<br />
| iwconfig ''wlan0''<br />
| Getting link status.<br />
|-<br />
| iw dev ''wlan0'' scan<br />
| iwlist ''wlan0'' scan<br />
| Scanning for available access points.<br />
|-<br />
| iw dev ''wlan0'' set type ibss<br />
| iwconfig ''wlan0'' mode ad-hoc<br />
| Setting the operation mode to ''ad-hoc''.<br />
|-<br />
| iw dev ''wlan0'' connect ''your_essid''<br />
| iwconfig ''wlan0'' essid ''your_essid''<br />
| Connecting to open network.<br />
|-<br />
| iw dev ''wlan0'' connect ''your_essid'' 2432<br />
| iwconfig ''wlan0'' essid ''your_essid'' freq 2432M<br />
| Connecting to open network specifying channel.<br />
|-<br />
| rowspan="2" | iw dev ''wlan0'' connect ''your_essid'' key 0:''your_key''<br />
| iwconfig ''wlan0'' essid ''your_essid'' key ''your_key''<br />
| Connecting to WEP encrypted network using hexadecimal key.<br />
|-<br />
| iwconfig ''wlan0'' essid ''your_essid'' key s:''your_key''<br />
| Connecting to WEP encrypted network using ASCII key.<br />
|-<br />
| iw dev ''wlan0'' set power_save on<br />
| iwconfig ''wlan0'' power on<br />
| Enabling power save.<br />
|}<br />
<br />
== iw ==<br />
<br />
{{Note|<br />
* Note that most of the commands have to be executed with [[Users and groups|root permissions]]. Executed with normal user rights, some of the commands (e.g. ''iw list''), will exit without error but not produce the correct output either, which can be confusing.<br />
* Depending on your hardware and encryption type, some of these steps may not be necessary. Some cards are known to require interface activation and/or access point scanning before being associated to an access point and being given an IP address. Some experimentation may be required. For instance, WPA/WPA2 users may try to directly activate their wireless network from step [[#Connect to an access point]].}}<br />
<br />
Examples in this section assume that your wireless device interface is {{ic|''interface''}} and that you are connecting to {{ic|''your_essid''}} wifi access point. Replace both accordingly.<br />
<br />
=== Get the name of the interface ===<br />
<br />
{{Tip|See [https://wireless.wiki.kernel.org/en/users/documentation/iw official documentation] of the ''iw'' tool for more examples.}}<br />
<br />
To get the name of your wireless interface do:<br />
<br />
$ iw dev<br />
<br />
The name of the interface will be output after the word "Interface". For example, it is commonly {{ic|wlan0}}.<br />
<br />
=== Get the status of the interface ===<br />
<br />
To check link status, use following command.<br />
<br />
$ iw dev ''interface'' link<br />
<br />
You can get statistic information, such as the amount of tx/rx bytes, signal strength etc., with following command:<br />
<br />
$ iw dev ''interface'' station dump<br />
<br />
=== Activate the interface ===<br />
<br />
{{Tip|Usually this step is not required.}}<br />
<br />
Some cards require that the kernel interface be activated before you can use ''iw'' or ''wireless_tools'':<br />
<br />
# ip link set ''interface'' up<br />
<br />
{{Note|If you get errors like {{ic|RTNETLINK answers: Operation not possible due to RF-kill}}, make sure that hardware switch is ''on''. See [[#Rfkill caveat]] for details.}}<br />
<br />
To verify that the interface is up, inspect the output of the following command:<br />
<br />
{{hc|$ ip link show ''interface''|<br />
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000<br />
link/ether 12:34:56:78:9a:bc brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
The {{ic|UP}} in {{ic|<BROADCAST,MULTICAST,UP,LOWER_UP>}} is what indicates the interface is up, not the later {{ic|state DOWN}}.<br />
<br />
=== Discover access points ===<br />
<br />
To see what access points are available:<br />
<br />
# iw dev ''interface'' scan | less<br />
<br />
{{Note|If it displays {{ic|Interface does not support scanning}}, then you probably forgot to install the firmware. In some cases this message is also displayed when not running ''iw'' as root.}}<br />
<br />
{{Tip|Depending on your location, you might need to set the correct [[#Respecting the regulatory domain|regulatory domain]] in order to see all available networks.}}<br />
<br />
The important points to check:<br />
* '''SSID:''' the name of the network.<br />
* '''Signal:''' is reported in a wireless power ratio in dBm (e.g. from -100 to 0). The closer the negative value gets to zero, the better the signal. Observing the reported power on a good quality link and a bad one should give an idea about the individual range. <br />
* '''Security:''' it is not reported directly, check the line starting with {{ic|capability}}. If there is {{ic|Privacy}}, for example {{ic|capability: ESS Privacy ShortSlotTime (0x0411)}}, then the network is protected somehow.<br />
** If you see an {{ic|RSN}} information block, then the network is protected by [[Wikipedia:IEEE 802.11i-2004|Robust Security Network]] protocol, also known as WPA2.<br />
** If you see an {{ic|WPA}} information block, then the network is protected by [[Wikipedia:Wi-Fi Protected Access|Wi-Fi Protected Access]] protocol.<br />
** In the {{ic|RSN}} and {{ic|WPA}} blocks you may find the following information:<br />
*** '''Group cipher:''' value in TKIP, CCMP, both, others.<br />
*** '''Pairwise ciphers:''' value in TKIP, CCMP, both, others. Not necessarily the same value than Group cipher.<br />
*** '''Authentication suites:''' value in PSK, 802.1x, others. For home router, you will usually find PSK (''i.e.'' passphrase). In universities, you are more likely to find 802.1x suite which requires login and password. Then you will need to know which key management is in use (e.g. EAP), and what encapsulation it uses (e.g. PEAP). See [[#WPA2 Enterprise]] and [[Wikipedia:Authentication protocol]] for details.<br />
** If you see neither {{ic|RSN}} nor {{ic|WPA}} blocks but there is {{ic|Privacy}}, then WEP is used.<br />
<br />
=== Set operating mode ===<br />
<br />
You might need to set the proper operating mode of the wireless card. More specifically, if you are going to connect an [[Ad-hoc networking|ad-hoc network]], you need to set the operating mode to {{ic|ibss}}:<br />
<br />
# iw dev ''interface'' set type ibss<br />
<br />
{{Note|Changing the operating mode on some cards might require the wireless interface to be ''down'' ({{ic|ip link set ''interface'' down}}).}}<br />
<br />
=== Connect to an access point ===<br />
<br />
Depending on the encryption, you need to associate your wireless device with the access point to use and pass the encryption key:<br />
<br />
* '''No encryption''' {{bc|# iw dev ''interface'' connect "''your_essid''"}}<br />
* '''WEP'''<br />
** using a hexadecimal or ASCII key (the format is distinguished automatically, because a WEP key has a fixed length): {{bc|# iw dev ''interface'' connect "''your_essid''" key 0:''your_key''}}<br />
** using a hexadecimal or ASCII key, specifying the third set up key as default (keys are counted from zero, four are possible): {{bc|# iw dev ''interface'' connect "''your_essid''" key d:2:''your_key''}}<br />
<br />
Regardless of the method used, you can check if you have associated successfully:<br />
<br />
# iw dev ''interface'' link<br />
<br />
== Authentication ==<br />
<br />
{{Expansion|Add [[Wikipedia:WPA3|WPA3 Enterprise]] ({{Bug|65314}}) and [[Wikipedia:Opportunistic Wireless Encryption|Opportunistic Wireless Encryption (OWE) a.k.a. Enhanced Open]]. Warn against WEP and open networks.}}<br />
<br />
=== WPA2 Personal ===<br />
<br />
WPA2 Personal, a.k.a. WPA2-PSK, is a mode of [[Wikipedia:Wi-Fi Protected_Access|Wi-Fi Protected Access]].<br />
<br />
You can authenticate to WPA2 Personal networks using [[wpa_supplicant]] or [[iwd]], or connect using a [[network manager]]. If you only authenticated to the network, then to have a fully functional connection you will still need to assign the IP address(es) and routes either [[Network configuration#Static IP address|manually]] or using a [[DHCP]] client.<br />
<br />
=== WPA2 Enterprise ===<br />
<br />
''WPA2 Enterprise'' is a mode of [[Wikipedia:Wi-Fi_Protected_Access|Wi-Fi Protected Access]]. It provides better security and key management than ''WPA2 Personal'', and supports other enterprise-type functionality, such as VLANs and [[wikipedia:Network Access Protection|NAP]]. However, it requires an external authentication server, called [[wikipedia:RADIUS|RADIUS]] server to handle the authentication of users. This is in contrast to Personal mode which does not require anything beyond the wireless router or access points (APs), and uses a single passphrase or password for all users.<br />
<br />
The Enterprise mode enables users to log onto the Wi-Fi network with a username and password and/or a digital certificate. Since each user has a dynamic and unique encryption key, it also helps to prevent user-to-user snooping on the wireless network, and improves encryption strength.<br />
<br />
This section describes the configuration of [[List of applications#Network managers|network clients]] to connect to a wireless access point with WPA2 Enterprise mode. See [[Software access point#RADIUS]] for information on setting up an access point itself. <br />
<br />
{{Note|Enterprise mode requires a more complex client configuration, whereas Personal mode only requires entering a passphrase when prompted. Clients likely need to install the server’s CA certificate (plus per-user certificates if using EAP-TLS), and then manually configure the wireless security and 802.1X authentication settings.}}<br />
<br />
For a comparison of protocols see the following [http://deployingradius.com/documents/protocols/compatibility.html table].<br />
<br />
{{Warning|It is possible to use WPA2 Enterprise without the client checking the server CA certificate. However, you should always seek to do so, because without authenticating the access point the connection can be subject to a man-in-the-middle attack. This may happen because while the connection handshake itself may be encrypted, the most widely used setups transmit the password itself either in plain text or the easily breakable [[#MS-CHAPv2]]. Hence, the client might send the password to a malicious access point which then proxies the connection.}}<br />
<br />
==== MS-CHAPv2 ====<br />
<br />
WPA2-Enterprise wireless networks demanding MSCHAPv2 type-2 authentication with PEAP sometimes require {{Pkg|pptpclient}} in addition to the stock {{Pkg|ppp}} package. [[netctl]] seems to work out of the box without ppp-mppe, however. In either case, usage of MSCHAPv2 is discouraged as it is highly vulnerable, although using another method is usually not an option.<br />
<br />
==== eduroam ====<br />
<br />
[[Wikipedia:eduroam|eduroam]] is an international roaming service for users in research, higher education and further education, based on WPA2 Enterprise.<br />
<br />
{{Note|<br />
* Check connection details '''first''' with your institution before applying any profiles listed in this section. Example profiles are not guaranteed to work or match any security requirements.<br />
* When storing connection profiles unencrypted, it is recommended restrict read access to the root account by specifying {{ic|chmod 600 ''profile''}} as root.<br />
}}<br />
<br />
{{Tip|Configuration for [[NetworkManager]] can be generated with the [https://cat.eduroam.org/ eduroam Configuration Assistant Tool].}}<br />
<br />
==== Manual/automatic setup ====<br />
<br />
* [[wpa_supplicant#Advanced usage|wpa_supplicant]] can be configured directly by its configuration file or using its CLI/GUI front ends and used in combination with a DHCP client. See the examples in {{ic|/usr/share/doc/wpa_supplicant/wpa_supplicant.conf}} for configuring the connection details.<br />
* [[iwd#WPA Enterprise]]<br />
* [[NetworkManager]] can create WPA2 Enterprise profiles with ''nmcli'' or the [[NetworkManager#Front-ends|graphical front ends]]. ''nmtui'' does not support this ([https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/376 NetworkManager issue 376]), but may use existing profiles.<br />
* [[ConnMan]] needs a separate configuration file before [[ConnMan#Wi-Fi|connecting]] to the network. See {{man|5|connman-service.config}} and [[ConnMan#Connecting to eduroam (802.1X)]] for details.<br />
* [[netctl]] supports wpa_supplicant configuration through blocks included with {{ic|1=WPAConfigSection=}}. See {{man|5|netctl.profile}} for details.<br />
: {{Note|Special quoting rules apply: see {{man|5|netctl.profile|SPECIAL QUOTING RULES}}.}}<br />
: {{Tip|Custom certificates can be specified by adding the line {{ic|1='ca_cert="/path/to/special/certificate.cer"'}} in {{ic|WPAConfigSection}}.}}<br />
<br />
=== WPA3 Personal ===<br />
<br />
WPA3 Personal, a.k.a. WPA3-SAE, is a mode of [[Wikipedia:Wi-Fi Protected_Access|Wi-Fi Protected Access]].<br />
<br />
[[wpa_supplicant]] supports WPA3 Personal ({{ic|CONFIG_SAE}} is enabled in {{Pkg|wpa_supplicant}} since version 2:2.9-4).<br />
<br />
[[iwd]] supports WPA3 since at least [https://iwd.wiki.kernel.org/networkmanager version 1.0].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Respecting the regulatory domain ===<br />
<br />
The [[wikipedia:IEEE_802.11#Regulatory_domains_and_legal_compliance|regulatory domain]], or "regdomain", is used to reconfigure wireless drivers to make sure that wireless hardware usage complies with local laws set by the FCC, ETSI and other organizations. Regdomains use [[wikipedia:ISO_3166-1_alpha-2|ISO 3166-1 alpha-2 country codes]]. For example, the regdomain of the United States would be "US", China would be "CN", etc.<br />
<br />
Regdomains affect the availability of wireless channels. In the 2.4GHz band, the allowed channels are 1-11 for the US, 1-14 for Japan, and 1-13 for most of the rest of the world. In the 5GHz band, the rules for allowed channels are much more complex. In either case, consult [[wikipedia:List_of_WLAN_channels|this list of WLAN channels]] for more detailed information.<br />
<br />
Regdomains also affect the limit on the [[wikipedia:Equivalent_isotropically_radiated_power|effective isotropic radiated power (EIRP)]] from wireless devices. This is derived from transmit power/"tx power", and is measured in [[wikipedia:DBm|dBm/mBm (1dBm=100mBm) or mW (log scale)]]. In the 2.4GHz band, the maximum is 30dBm in the US and Canada, 20dBm in most of Europe, and 20dBm-30dBm for the rest of the world. In the 5GHz band, maximums are usually lower. Consult the [https://git.kernel.org/cgit/linux/kernel/git/linville/wireless-regdb.git/tree/db.txt wireless-regdb] for more detailed information (EIRP dBm values are in the second set of brackets for each line).<br />
<br />
Misconfiguring the regdomain can be useful - for example, by allowing use of an unused channel when other channels are crowded, or by allowing an increase in tx power to widen transmitter range. However, '''this is not recommended''' as it could break local laws and cause interference with other radio devices.<br />
<br />
Since kernel 4.15, there are two ways to load the regulatory database. The first is to use the deprecated "central regulatory domain agent" provided by {{Pkg|crda}}, which loads the database via udev rule. The second is to allow the kernel to load the database directly, which is supported by {{Pkg|wireless-regdb}}. For direct loading the kernel must be configured with {{ic|CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS}} set to yes and should, for security's sake, be configured with {{ic|CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS}} set to yes to allow for cryptographic verification of the database. This is true of the stock Arch kernel, but if you are using an alternate kernel, or compiling your own, you should verify this. More information is available at [http://docker.hd-wireless.com/Support/WifiRegulatoryDomainsinLinux this guide].<br />
<br />
To configure the regdomain, install {{Pkg|crda}} or {{Pkg|wireless-regdb}} and reboot (to reload the {{ic|cfg80211}} module and all related drivers). Check the boot log to make sure that CRDA is being called or the database loaded and key verified by {{ic|cfg80211}}:<br />
<br />
# dmesg | grep cfg80211<br />
<br />
The current regdomain can be set to the United States with:<br />
<br />
# iw reg set US<br />
<br />
And queried with:<br />
<br />
$ iw reg get<br />
<br />
{{Note|<br />
* Your device may be set to country "00", which is the "world regulatory domain" and contains generic settings. If this cannot be unset, CRDA may be misconfigured.<br />
* If compiling a custom kernel, {{ic|CONFIG_CFG80211_INTERNAL_REGDB}} can be enabled as an alternative to {{ic|crda}}. Once enabled, you need to place [https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git/tree/db.txt db.txt] into {{ic|net/wireless/db.txt}}. For further details and caveats see [https://wireless.wiki.kernel.org/en/developers/regulatory/crda].<br />
}}<br />
<br />
However, setting the regdomain may not alter your settings. Some devices have a regdomain set in firmware/EEPROM, which dictates the limits of the device, meaning that setting regdomain in software [https://wiki.openwrt.org/doc/howto/wireless.utilities#iw can only increase restrictions], not decrease them. For example, a CN device could be set in software to the US regdomain, but because CN has an EIRP maximum of 20dBm, the device will not be able to transmit at the US maximum of 30dBm.<br />
<br />
For example, to see if the regdomain is being set in firmware for an Atheros device:<br />
<br />
# dmesg | grep ath:<br />
<br />
For other chipsets, it may help to search for "EEPROM", "regdomain", or simply the name of the device driver.<br />
<br />
To see if your regdomain change has been successful, and to query the number of available channels and their allowed transmit power:<br />
<br />
$ iw list | grep -A 15 Frequencies:<br />
<br />
A more permanent configuration of the regdomain can be achieved through editing {{ic|/etc/conf.d/wireless-regdom}} and uncommenting the appropriate domain.<br />
<br />
[[wpa_supplicant]] can also use a regdomain in the {{ic|1=country=}} line of {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}.<br />
<br />
It is also possible to configure the [https://wireless.wiki.kernel.org/en/developers/documentation/cfg80211 cfg80211] kernel module to use a specific regdomain by adding, for example, {{ic|1=options cfg80211 ieee80211_regdom=JP}} as [[Kernel_modules#Setting module options|module options]]. The module option is inherited from the [https://wireless.wiki.kernel.org/en/developers/regulatory#the_ieee80211_regdom_module_parameter old regulatory implementation] and in modern kernels act as a userspace regulatory hint as if it came through {{ic|nl80211}} through utilities like {{ic|iw}} and {{ic|wpa_supplicant}}.<br />
<br />
For further information, read the [https://wireless.wiki.kernel.org/en/developers/regulatory kernel.org regulatory documentation].<br />
<br />
=== Rfkill caveat ===<br />
<br />
Many laptops have a hardware button (or switch) to turn off wireless card, however, the card can also be blocked by kernel. This can be handled by ''rfkill''. To show the current status:<br />
<br />
{{hc|# rfkill list|<br />
0: phy0: Wireless LAN<br />
Soft blocked: yes<br />
Hard blocked: yes<br />
}}<br />
<br />
If the card is ''hard-blocked'', use the hardware button (switch) to unblock it. If the card is not ''hard-blocked'' but ''soft-blocked'', use the following command:<br />
<br />
# rfkill unblock wifi<br />
<br />
{{Note|It is possible that the card will go from ''hard-blocked'' and ''soft-unblocked'' state into ''hard-unblocked'' and ''soft-blocked'' state by pressing the hardware button (i.e. the ''soft-blocked'' bit is just switched no matter what). This can be adjusted by tuning some options of the {{ic|rfkill}} [[kernel module]].}}<br />
<br />
Hardware buttons to toggle wireless cards are handled by a vendor specific [[kernel module]], frequently these are [https://lwn.net/Articles/391230/ WMI] modules. Particularly for very new hardware models, it happens that the model is not fully supported in the latest stable kernel yet. In this case it often helps to search the kernel bug tracker for information and report the model to the maintainer of the respective vendor kernel module, if it has not happened already. <br />
<br />
See also [https://askubuntu.com/questions/62166/siocsifflags-operation-not-possible-due-to-rf-kill].<br />
<br />
=== Power saving ===<br />
<br />
See [[Power saving#Network interfaces]].<br />
<br />
== Troubleshooting ==<br />
<br />
This section contains general troubleshooting tips, not strictly related to problems with drivers or firmware. For such topics, see next section [[#Troubleshooting drivers and firmware]].<br />
<br />
=== Temporary internet access ===<br />
<br />
If you have problematic hardware and need internet access to, for example, download some software or get help in forums, you can make use of Android's built-in feature for internet sharing via USB cable. See [[Android tethering#USB tethering]] for more information.<br />
<br />
=== Observing logs ===<br />
<br />
A good first measure to troubleshoot is to analyze the system's logfiles first. In order not to manually parse through them all, it can help to open a second terminal/console window and watch the kernels messages with <br />
<br />
# dmesg -w<br />
<br />
while performing the action, e.g. the wireless association attempt. <br />
<br />
When using a tool for network management, the same can be done for systemd with <br />
<br />
# journalctl -f <br />
<br />
Frequently a wireless error is accompanied by a deauthentication with a particular reason code, for example: <br />
<br />
wlan0: deauthenticating from XX:XX:XX:XX:XX:XX by local choice (reason=3)<br />
<br />
Looking up [http://www.aboutcher.co.uk/2012/07/linux-wifi-deauthenticated-reason-codes/ the reason code] might give a first hint. Maybe it also helps you to look at the control message [https://wireless.wiki.kernel.org/en/developers/documentation/mac80211/auth-assoc-deauth flowchart], the journal messages will follow it. <br />
<br />
The individual tools used in this article further provide options for more detailed debugging output, which can be used in a second step of the analysis, if required.<br />
<br />
=== Failed to get IP address ===<br />
<br />
* If getting an IP address repeatedly fails using the default {{Pkg|dhcpcd}} client, try installing and using {{Pkg|dhclient}} instead. Do not forget to select ''dhclient'' as the primary DHCP client in the [[#Manual/automatic setup|connection manager]].<br />
<br />
* If you can get an IP address for a wired interface and not for a wireless interface, try disabling the wireless card's [[#Power saving|power saving]] features (specify {{ic|off}} instead of {{ic|on}}).<br />
<br />
* If you get a timeout error due to a ''waiting for carrier'' problem, then you might have to set the channel mode to {{ic|auto}} for the specific device:<br />
<br />
# iwconfig wlan0 channel auto<br />
<br />
Before changing the channel to auto, make sure your wireless interface is down. After it has successfully changed it, you can bring the interface up again and continue from there.<br />
<br />
=== Valid IP address but cannot resolve host ===<br />
<br />
If you are on a public wireless network that may have a [[wikipedia:Captive_portal|captive portal]], make sure to query an HTTP page (not an HTTPS page) from your web browser, as some captive portals only redirect HTTP.<br />
If this is not the issue, [[Domain name resolution#Resolve a domain name using NSS|check if you can resolve domain names]], it may be necessary to use the DNS server advertised via DHCP.<br />
<br />
=== Setting RTS and fragmentation thresholds ===<br />
<br />
Wireless hardware disables RTS and fragmentation by default. These are two different methods of increasing throughput at the expense of bandwidth (i.e. reliability at the expense of speed). These are useful in environments with wireless noise or many adjacent access points, which may create interference leading to timeouts or failing connections. <br />
<br />
Packet fragmentation improves throughput by splitting up packets with size exceeding the fragmentation threshold. The maximum value (2346) effectively disables fragmentation since no packet can exceed it. The minimum value (256) maximizes throughput, but may carry a significant bandwidth cost.<br />
<br />
# iw phy0 set frag 512<br />
<br />
[[Wikipedia:IEEE 802.11 RTS/CTS|RTS]] improves throughput by performing a handshake with the access point before transmitting packets with size exceeding the RTS threshold. The maximum threshold (2347) effectively disables RTS since no packet can exceed it. The minimum threshold (0) enables RTS for all packets, which is probably excessive for most situations.<br />
<br />
# iw phy0 set rts 500<br />
<br />
{{Note|{{ic|phy0}} is the name of the wireless device as listed by {{ic|$ iw phy}}.}}<br />
<br />
=== Random disconnections ===<br />
<br />
==== Cause #1 ====<br />
<br />
If [[dmesg]] says {{ic|1=wlan0: deauthenticating from MAC by local choice (reason=3)}} and you lose your Wi-Fi connection, it is likely that you have a bit too aggressive power-saving on your Wi-Fi card. Try disabling the wireless card's [[Power_management#Network_interfaces|power saving]] features (specify {{ic|off}} instead of {{ic|on}}).<br />
<br />
If your card does not support enabling/disabling power save mode, check the BIOS for power management options. Disabling PCI-Express power management in the BIOS of a Lenovo W520 resolved this issue.<br />
<br />
==== Cause #2 ====<br />
<br />
If you are experiencing frequent disconnections and ''dmesg'' shows messages such as <br />
<br />
{{ic|1=ieee80211 phy0: wlan0: No probe response from AP xx:xx:xx:xx:xx:xx after 500ms, disconnecting}}<br />
<br />
try changing the channel bandwidth to {{ic|20MHz}} through your router's settings page.<br />
<br />
==== Cause #3 ====<br />
<br />
On some laptop models with hardware rfkill switches (e.g., Thinkpad X200 series), due to wear or bad design, the switch (or its connection to the mainboard) might become loose over time resulting in seemingly random hardblocks/disconnects when you accidentally touch the switch or move the laptop.<br />
There is no software solution to this, unless your switch is electrical and the BIOS offers the option to disable the switch.<br />
If your switch is mechanical (most are), there are lots of possible solutions, most of which aim to disable the switch: Soldering the contact point on the mainboard/wifi-card, glueing or blocking the switch, using a screw nut to tighten the switch or removing it altogether.<br />
<br />
==== Cause #4 ====<br />
<br />
Another cause for frequent disconnects or a complete failure to connect may also be a sub-standard router, incomplete settings of the router, or interference by other wireless devices. <br />
<br />
To troubleshoot, first best try to connect to the router with no authentication. <br />
<br />
If that works, enable WPA/WPA2 again but choose fixed and/or limited router settings. For example: <br />
* If the router is considerably older than the wireless device you use for the client, test if it works with setting the router to one wireless mode <br />
* Disable mixed-mode authentication (e.g. only WPA2 with AES, or TKIP if the router is old) <br />
* Try a fixed/free channel rather than "auto" channel (maybe the router next door is old and interfering) <br />
* Disable [[Wikipedia:Wi-Fi Protected Setup|WPS]]<br />
* Change the router's 5 GHz channel(s) to a [[Wikipedia:List_of_WLAN_channels#5_GHz_(802.11a/h/j/n/ac/ax)|non-DFS (Dynamic Frequency Selection) channel]]. Connections on such channels [https://wifinigel.blogspot.com/2018/05/the-5ghz-problem-for-wi-fi-networks-dfs.html may be dropped or suddenly switched] due to interference from nearby weather radar.<br />
* Disable {{ic|40MHz}} channel bandwidth (lower throughput but less likely collisions) with {{ic|1=cfg80211.cfg80211_disable_40mhz_24ghz=1}}<br />
* If the router has quality of service settings, check completeness of settings (e.g. Wi-Fi Multimedia (WMM) is part of optional QoS flow control. An erroneous router firmware may advertise its existence although the setting is not enabled)<br />
<br />
==== Cause #5 ====<br />
<br />
On some wireless network adapters (e.g. Qualcomm Atheros AR9485), random disconnects can happen with a DMA error:<br />
<br />
{{hc|# journalctl -xb|2=<br />
ath: phy0: DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x02000020 DMADBG_7=0x0000a400<br />
wlp1s0: authenticate with 56:e7:ee:7b:55:bc<br />
wlp1s0: send auth to 56:e7:ee:7b:55:bc (try 1/3)<br />
wlp1s0: send auth to 56:e7:ee:7b:55:bc (try 2/3)<br />
wlp1s0: send auth to 56:e7:ee:7b:55:bc (try 3/3)<br />
wlp1s0: authentication with 56:e7:ee:7b:55:bc timed out<br />
}}<br />
<br />
A possible workaround is to disable the [https://www.kernel.org/doc/html/latest/x86/intel-iommu.html Intel IOMMU driver (DMA)], adding {{ic|1=intel_iommu=off}} to the [[kernel parameters]] [https://bbs.archlinux.org/viewtopic.php?pid=1907446#p1907446].<br />
<br />
{{Note|The Intel IOMMU driver is needed for some advanced virtual machine features, like PCI pass-through.}}<br />
<br />
==== Cause #6 ====<br />
<br />
If you are using a device with iwlwifi and iwlmvm for wireless connectivity, and your Wi-Fi card appears to disappear when on battery power (perhaps after a reboot or resuming from suspend), this can be fixed by configuring power saving settings in iwlmvm.<br />
<br />
Create the file {{ic|/etc/modprobe.d/iwlmvm.conf}} if it does not exist already, then add the following line to it:<br />
<br />
{{hc|/etc/modprobe.d/iwlmvm.conf|2=<br />
options iwlmvm power_scheme=1<br />
}}<br />
<br />
A {{ic|power_scheme}} of 1 sets iwlmvm to "Always Active." Available options are:<br />
<br />
{| class="wikitable"<br />
! Value !! Description<br />
|-<br />
| 1 || Always Active<br />
|-<br />
| 2 || Balanced<br />
|-<br />
| 3 || Low-power<br />
|}<br />
<br />
This fix was discovered at [http://forums.debian.net/viewtopic.php?t=121696#p576208].<br />
<br />
==== Cause #7 ====<br />
<br />
If your device undergoes long periods of inactivity (e.g. a file server) the disconnection may be due to power saving, which will block incoming traffic and prevent connections. Try disabling power saving for the interface:<br />
<br />
# iw dev ''interface'' set power_save off<br />
<br />
You can create a udev rule to do this on boot, see [[Power management#Network interfaces]].<br />
<br />
=== Wi-Fi networks invisible because of incorrect regulatory domain ===<br />
<br />
If the computer's Wi-Fi channels do not match those of the user's country, some in-range Wi-Fi networks might be invisible, because they use wireless channels that are not allowed by default. The solution is to configure the regulatory domain correctly, see [[#Respecting the regulatory domain]].<br />
<br />
== Troubleshooting drivers and firmware ==<br />
<br />
This section covers methods and procedures for installing kernel modules and ''firmware'' for specific chipsets, that differ from generic method.<br />
<br />
See [[Kernel modules]] for general information on operations with modules.<br />
<br />
=== Ralink/Mediatek ===<br />
<br />
==== rt2x00 ====<br />
<br />
Unified driver for Ralink chipsets (it replaces {{ic|rt2500}}, {{ic|rt61}}, {{ic|rt73}}, etc). This driver has been in the Linux kernel since 2.6.24, you only need to load the right module for the chip: {{ic|rt2400pci}}, {{ic|rt2500pci}}, {{ic|rt2500usb}}, {{ic|rt61pci}} or {{ic|rt73usb}} which will autoload the respective {{ic|rt2x00}} modules too.<br />
<br />
A list of devices supported by the modules is available at the project's [https://web.archive.org/web/20150507023412/http://rt2x00.serialmonkey.com/wiki/index.php/Hardware homepage].<br />
<br />
; Additional notes<br />
* Since kernel 3.0, rt2x00 includes also these drivers: {{ic|rt2800pci}}, {{ic|rt2800usb}}.<br />
* Since kernel 3.0, the staging drivers {{ic|rt2860sta}} and {{ic|rt2870sta}} are replaced by the mainline drivers {{ic|rt2800pci}} and {{ic|rt2800usb}} [https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fefecc6989b4b24276797270c0e229c07be02ad3].<br />
* Some devices have a wide range of options that can be configured with {{ic|iwpriv}}. These are documented in the [https://web.archive.org/web/20111105120212/http://web.ralinktech.com:80/ralink/Home/Support/Linux.html source tarballs] available from Ralink.<br />
<br />
==== rt3090 ====<br />
<br />
For devices which are using the rt3090 chipset it should be possible to use {{ic|rt2800pci}} driver, however, is not working with this chipset very well (e.g. sometimes it is not possible to use higher rate than 2Mb/s).<br />
<br />
==== rt3290 ====<br />
<br />
The rt3290 chipset is recognised by the kernel {{ic|rt2800pci}} module. However, some users experience problems and reverting to a patched Ralink driver seems to be beneficial in these [https://bbs.archlinux.org/viewtopic.php?id=161952 cases].<br />
<br />
==== rt3573 ====<br />
<br />
New chipset as of 2012. It may require proprietary drivers from Ralink. Different manufacturers use it, see the [https://bbs.archlinux.org/viewtopic.php?pid=1164228#p1164228 Belkin N750 DB wireless usb adapter] forums thread.<br />
<br />
==== mt7612u ====<br />
<br />
New chipset as of 2014, released under their new commercial name Mediatek. It is an AC1200 or AC1300 chipset. Manufacturer provides drivers for Linux on their [https://www.mediatek.com/products/broadbandWifi/mt7612u support page]. As of kernel 5.5 it should be supported by the included {{ic|mt76}} driver.<br />
<br />
=== Realtek ===<br />
<br />
See [https://wikidevi.com/wiki/Realtek] for a list of Realtek chipsets and specifications.<br />
<br />
==== rtl8192cu ====<br />
<br />
The driver is now in the kernel, but many users have reported being unable to make a connection although scanning for networks does work.<br />
<br />
{{AUR|8192cu-dkms}} includes many patches, try this if it does not work fine with the driver in kernel.<br />
<br />
==== rtl8723ae/rtl8723be ====<br />
<br />
The {{ic|rtl8723ae}} and {{ic|rtl8723be}} modules are included in the mainline Linux kernel.<br />
<br />
Some users may encounter errors with powersave on this card. This is shown with occasional disconnects that are not recognized by high level network managers ([[netctl]], [[NetworkManager]]). This error can be confirmed by running {{ic|dmesg -w}} as root or {{ic|journalctl -f}} as root and looking for output related to powersave and the {{ic|rtl8723ae}}/{{ic|rtl8723be}} module. If you are having this issue, use the {{ic|1=fwlps=0}} kernel option, which should prevent the WiFi card from automatically sleeping and halting connection. See [[Kernel module#Setting module options]].<br />
<br />
If you have poor signal, perhaps your device has only one physical antenna connected, and antenna autoselection is broken. You can force the choice of antenna with {{ic|1=ant_sel=1}} or {{ic|1=ant_sel=2}} kernel option. [https://bbs.archlinux.org/viewtopic.php?id=208472]<br />
<br />
==== rtl88xxau ====<br />
<br />
Realtek chipsets rtl8811au, rtl8812au, rtl8814au and rtl8821au designed for various USB adapters ranging from AC600 to AC1900. Several packages provide various kernel drivers, these require [[DKMS]] (the {{Pkg|dkms}} package and the kernel headers installed):<br />
<br />
{| class="wikitable"<br />
! Chipset || Driver version || Package || Notes<br />
|-<br />
| rtl8811au, rtl8812au, rtl8821au || 5.6.4.2 || {{AUR|rtl88xxau-aircrack-dkms-git}} || Aircrack-ng kernel module for 8811au, 8812au and 8821au chipsets with monitor mode and injection support.<br />
|-<br />
| rtl8814au || 5.8.5.1 || {{AUR|rtl8814au-aircrack-dkms-git}} || Aircrack-ng kernel module for 8814au chipsets with monitor mode and injection support.<br />
|-<br />
| rtl8812au || 5.9.3.2 || {{AUR|rtl8812au-dkms-git}} || Latest official Realtek driver version for rtl8812au '''only'''.<br />
|-<br />
| rtl8811au, rtl8821au || 5.8.2.3 || {{AUR|rtl8821au-dkms-git}} || Newer driver version for rtl8821au.<br />
|-<br />
| rtl8814au || 5.8.5.1 || {{AUR|rtl8814au-dkms-git}} || Possibly works for rtl8813au too. Seems to be deprecated in favor of {{AUR|rtl8814au-aircrack-dkms-git}}<br />
|}<br />
<br />
==== rtl8811cu/rtl8821cu ====<br />
<br />
{{AUR|rtl8821cu-dkms-git}} provides a kernel module for the Realtek 8811cu and 8821cu chipset.<br />
<br />
This requires [[DKMS]], so make sure you have your proper kernel headers installed.<br />
<br />
If no wireless interface shows up even though the {{ic|8821cu}} module is loaded, you may need to manually specify the {{ic|rtw_RFE_type}} option [https://forums.linuxmint.com/viewtopic.php?p=1913190&sid=68f2d6eff91cd47e184ae5a56385dc02#p1913190][https://github.com/brektrou/rtl8821CU/issues/83]. Try e.g. {{ic|1=rtw_RFE_type=0x26}}, other values might also work. See [[Kernel module#Setting module options]] for details.<br />
<br />
==== rtl8821ce ====<br />
<br />
{{AUR|rtl8821ce-dkms-git}} provides a kernel module for the Realtek 8821ce chipset found in the Asus X543UA.<br />
<br />
This requires [[DKMS]], so make sure you have your proper kernel headers installed.<br />
<br />
==== rtl8822bu ====<br />
<br />
{{AUR|rtl8822bu-dkms-git}} or {{AUR|rtl88x2bu-dkms-git}} provides a kernel module for the Realtek 8822bu chipset found in the Edimax EW7822ULC USB3, Asus AC53 Nano USB 802.11ac and TP-Link Archer T3U adapter.<br />
<br />
This requires [[DKMS]], so make sure you have your proper kernel headers installed.<br />
<br />
==== rtl8xxxu ====<br />
<br />
{{Expansion|Specific issues with the mainline module and kernel versions should be stated.}}<br />
<br />
Issues with the {{ic|rtl8xxxu}} mainline kernel module may be solved by compiling a third-party module for the specific chipset. The source code can be found in [https://github.com/lwfinger?tab=repositories GitHub repositories].<br />
<br />
Some drivers may be already prepared in the AUR, e.g. {{AUR|rtl8723bu-git-dkms}}.<br />
<br />
=== Atheros ===<br />
<br />
The [http://madwifi-project.org/ MadWifi team] currently maintains three different drivers for devices with Atheros chipset:<br />
<br />
* {{ic|madwifi}} is an old, obsolete driver. Not present in Arch kernel since 2.6.39.1<sup>[https://mailman.archlinux.org/pipermail/arch-dev-public/2011-June/020669.html]</sup>.<br />
* {{ic|ath5k}} is newer driver, which replaces the {{ic|madwifi}} driver. Currently a better choice for some chipsets, but not all chipsets are supported (see below)<br />
* {{ic|ath9k}} is the newest of these three drivers, it is intended for newer Atheros chipsets. All of the chips with 802.11n capabilities are supported.<br />
<br />
There are some other drivers for some Atheros devices. See [https://wireless.wiki.kernel.org/en/users/Drivers/Atheros#pcipci-eahb_driversrs Linux Wireless documentation] for details.<br />
<br />
==== ath5k ====<br />
<br />
External resources:<br />
* https://wireless.wiki.kernel.org/en/users/drivers/ath5k<br />
* [[Debian:ath5k]]<br />
<br />
If you find web pages randomly loading very slow, or if the device is unable to lease an IP address, try to switch from hardware to software encryption by loading the {{ic|ath5k}} module with {{ic|1=nohwcrypt=1}} option. See [[Kernel modules#Setting module options]] for details.<br />
<br />
Some laptops may have problems with their wireless LED indicator flickering red and blue. To solve this problem, do:<br />
<br />
# echo none > /sys/class/leds/ath5k-phy0::tx/trigger<br />
# echo none > /sys/class/leds/ath5k-phy0::rx/trigger<br />
<br />
For alternatives, see [https://bugzilla.redhat.com/show_bug.cgi?id=618232 this bug report].<br />
<br />
==== ath9k ====<br />
<br />
External resources:<br />
* https://wireless.wiki.kernel.org/en/users/drivers/ath9k<br />
* [[Debian:ath9k]]<br />
<br />
As of Linux 3.15.1, some users have been experiencing a decrease in bandwidth. In some cases this can fixed by setting the {{ic|1=nohwcrypt=1}} option for the {{ic|ath9k}} module. See [[Kernel module#Setting module options]].<br />
<br />
{{Note|Use the command {{ic|lsmod}} to see what modules are in use and change {{ic|ath9k}} if it is named differently (e.g. {{ic|ath9k_htc}}).}}<br />
<br />
In the unlikely event that you have stability issues that trouble you, you could try using the {{AUR|backports-patched}} package. An [https://web.archive.org/web/20201118232556/http://lists.ath9k.org/mailman/listinfo/ath9k-devel ath9k mailing list] exists for support and development related discussions.<br />
<br />
===== Power saving =====<br />
<br />
Although [https://wireless.wiki.kernel.org/en/users/Documentation/dynamic-power-save Linux Wireless] says that dynamic power saving is enabled for Atheros ath9k single-chips newer than AR9280, for some devices (e.g. AR9285) {{Pkg|powertop}} might still report that power saving is disabled. In this case enable it manually.<br />
<br />
On some devices (e.g. AR9285), enabling the power saving might result in the following error:<br />
<br />
{{hc|# iw dev wlan0 set power_save on|<br />
command failed: Operation not supported (-95)<br />
}}<br />
<br />
The solution is to set the {{ic|1=ps_enable=1}} option for the {{ic|ath9k}} module, see [[Kernel module#Setting module options]].<br />
<br />
=== Intel ===<br />
<br />
==== ipw2100 and ipw2200 ====<br />
<br />
These modules are fully supported in the kernel, but they require additional firmware. Depending on which of the chipsets you have, [[install]] either {{Pkg|ipw2100-fw}} or {{Pkg|ipw2200-fw}}. Then [[Kernel modules#Manual module handling|reload]] the appropriate module.<br />
<br />
{{Tip|You may use the following [[Kernel modules#Setting module options|module options]]:<br />
* use the {{ic|1=rtap_iface=1}} option to enable the radiotap interface<br />
* use the {{ic|1=led=1}} option to enable a front LED indicating when the wireless is connected or not<br />
}}<br />
<br />
==== iwlegacy ====<br />
<br />
[https://wireless.wiki.kernel.org/en/users/Drivers/iwlegacy iwlegacy] is the wireless driver for Intel's 3945 and 4965 wireless chips. The firmware is included in the {{Pkg|linux-firmware}} package.<br />
<br />
[[udev]] should load the driver automatically, otherwise load {{ic|iwl3945}} or {{ic|iwl4965}} manually. See [[Kernel modules]] for details.<br />
<br />
If you have problems connecting to networks in general, random failures with your card on bootup or your link quality is very poor, try to disable 802.11n:<br />
<br />
{{hc|/etc/modprobe.d/iwl4965.conf|2=<br />
options iwl4965 11n_disable=1<br />
}}<br />
<br />
If the failures persist during bootup and you are using Nouveau driver, try [[Nouveau#Enable_early_KMS|enabling early KMS]] to prevent the conflict [https://bbs.archlinux.org/viewtopic.php?pid=1748667#p1748667].<br />
<br />
==== iwlwifi ====<br />
<br />
[https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi iwlwifi] is the wireless driver for Intel's current wireless chips, such as 5100AGN, 5300AGN, and 5350AGN. See the [https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi#supported_devices full list of supported devices]. The firmware is included in the {{Pkg|linux-firmware}} package. The {{AUR|linux-firmware-iwlwifi-git}} may contain some updates sooner.<br />
<br />
If you have problems connecting to networks in general or your link quality is very poor, try to disable 802.11n, and perhaps also enable software encryption:<br />
<br />
{{hc|/etc/modprobe.d/iwlwifi.conf|2=<br />
options iwlwifi 11n_disable=1 swcrypto=1<br />
}}<br />
<br />
If you have a problem with slow uplink speed in 802.11n mode, for example 20Mbps, try to enable antenna aggregation:<br />
<br />
{{hc|/etc/modprobe.d/iwlwifi.conf|2=<br />
options iwlwifi 11n_disable=8<br />
}}<br />
<br />
Do not be confused with the option name, when the value is set to {{ic|8}} it does not disable anything but re-enables transmission antenna aggregation.[https://forums.gentoo.org/viewtopic-t-996692.html?sid=81bdfa435c089360bdfd9368fe0339a9] [https://bugzilla.kernel.org/show_bug.cgi?id=81571]<br />
<br />
In case this does not work for you, you may try disabling [[Power saving#Network interfaces|power saving]] for your wireless adapter.<br />
<br />
[https://ubuntuforums.org/showthread.php?t=2183486&p=12845473#post12845473 Some] have never gotten this to work. [https://ubuntuforums.org/showthread.php?t=2205733&p=12935783#post12935783 Others] found salvation by disabling N in their router settings after trying everything. This is known to have be the only solution on more than one occasion. The second link there mentions a 5ghz option that might be worth exploring.<br />
<br />
If you have an 802.11ax (WiFi 6) access point and have problems detecting the beacons or an unreliable connection, review [https://www.intel.com/content/www/us/en/support/articles/000054799/network-and-i-o/wireless.html Intel Article 54799].<br />
<br />
{{Note|Using {{ic|1=11n_disable=0}} will also prevent 802.11ac and only allow connection with slower protocols (802.11a in the 5GHz band or 802.11b/g in the 2.4 GHz band).}}<br />
<br />
===== Bluetooth coexistence =====<br />
<br />
If you have difficulty connecting a bluetooth headset and maintaining good downlink speed, try disabling bluetooth coexistence [https://wireless.wiki.kernel.org/en/users/Drivers/iwlwifi#wi-fibluetooth_coexistence]:<br />
<br />
{{hc|/etc/modprobe.d/iwlwifi.conf|2=<br />
options iwlwifi bt_coex_active=0<br />
}}<br />
<br />
===== Firmware stack traces =====<br />
<br />
{{Accuracy|What is the last note about ignored packages trying to say?}}<br />
<br />
You may have some issue where the driver outputs stack traces & errors, which can cause some stuttering.<br />
<br />
{{hc|# dmesg|2=<br />
Microcode SW error detected. Restarting 0x2000000.<br />
}}<br />
<br />
To fix those errors, you may downgrade the package {{Pkg|linux-firmware}} or rename the last version of the firmware used by your device so that an older version is loaded (which keeps it out of pacman's ignored packages).<br />
<br />
==== Disabling LED blink ====<br />
<br />
{{Note|This works with the {{ic|iwlegacy}} and {{ic|iwlwifi}} drivers.}}<br />
<br />
The default settings on the module are to have the LED blink on activity. Some people find this extremely annoying. To have the LED on solid when Wi-Fi is active, you can use the [[systemd-tmpfiles]]:<br />
<br />
{{hc|/etc/tmpfiles.d/phy0-led.conf|<br />
w /sys/class/leds/phy0-led/trigger - - - - phy0radio<br />
}}<br />
<br />
Run {{ic|systemd-tmpfiles --create phy0-led.conf}} for the change to take effect, or reboot.<br />
<br />
To see all the possible trigger values for this LED:<br />
<br />
# cat /sys/class/leds/phy0-led/trigger<br />
<br />
{{Tip|If you do not have {{ic|/sys/class/leds/phy0-led}}, you may try to use the {{ic|1=led_mode="1"}} [[Kernel modules#Setting module options|module option]]. It should be valid for both {{ic|iwlwifi}} and {{ic|iwlegacy}} drivers.}}<br />
<br />
=== Broadcom ===<br />
<br />
See [[Broadcom wireless]].<br />
<br />
=== Other drivers/devices ===<br />
<br />
==== Tenda w322u ====<br />
<br />
Treat this Tenda card as an {{ic|rt2870sta}} device. See [[#rt2x00]].<br />
<br />
==== orinoco ====<br />
<br />
This should be a part of the kernel package and be installed already.<br />
<br />
Some Orinoco chipsets are Hermes II. You can use the {{ic|wlags49_h2_cs}} driver instead of {{ic|orinoco_cs}} and gain WPA support. To use the driver, [[blacklist]] {{ic|orinoco_cs}} first.<br />
<br />
==== prism54 ====<br />
<br />
The driver {{ic|p54}} is included in kernel, but you have to download the appropriate firmware for your card from [https://wireless.wiki.kernel.org/en/users/drivers/p54#firmware this site] and install it into the {{ic|/usr/lib/firmware}} directory.<br />
<br />
{{Note|There is also older, deprecated driver {{ic|prism54}}, which might conflict with the newer driver ({{ic|p54pci}} or {{ic|p54usb}}). Make sure to [[blacklist]] {{ic|prism54}}.}}<br />
<br />
==== ACX100/111 ====<br />
<br />
{{Warning|The drivers for these devices [https://mailman.archlinux.org/pipermail/arch-dev-public/2011-June/020669.html are broken] and do not work with newer kernel versions.}}<br />
<br />
Packages: {{ic|tiacx}} {{ic|tiacx-firmware}} (deleted from official repositories and AUR)<br />
<br />
See [https://sourceforge.net/projects/acx100/ official page] for details.<br />
<br />
==== zd1211rw ====<br />
<br />
[https://sourceforge.net/projects/zd1211/ zd1211rw] is a driver for the ZyDAS ZD1211 802.11b/g USB WLAN chipset, and it is included in recent versions of the Linux kernel. See [https://wireless.wiki.kernel.org/en/users/Drivers/zd1211rw/devices] for a list of supported devices. You only need to [[install]] the firmware for the device, provided by the {{AUR|zd1211-firmware}} package.<br />
<br />
==== hostap_cs ====<br />
<br />
[https://hostap.epitest.fi/ Host AP] is a Linux driver for wireless LAN cards based on Intersil's Prism2/2.5/3 chipset. The driver is included in Linux kernel.<br />
<br />
{{Note|Make sure to [[blacklist]] the {{ic|orinico_cs}} driver, it may cause problems.}}<br />
<br />
=== ndiswrapper ===<br />
<br />
Ndiswrapper is a wrapper script that allows you to use some Windows drivers in Linux. You will need the {{ic|.inf}} and {{ic|.sys}} files from your Windows driver. <br />
{{Warning|Be sure to use drivers appropriate to your architecture (x86 vs. x86_64).}}<br />
<br />
{{Tip|If you need to extract these files from an {{ic|*.exe}} file, you can use {{Pkg|cabextract}}.}}<br />
<br />
Follow these steps to configure ndiswrapper.<br />
<br />
1. Install {{Pkg|ndiswrapper-dkms}}<br />
<br />
2. Install the driver to {{ic|/etc/ndiswrapper/*}}<br />
# ndiswrapper -i filename.inf<br />
<br />
3. List all installed drivers for ndiswrapper<br />
$ ndiswrapper -l<br />
<br />
4. Let ndiswrapper write its configuration in {{ic|/etc/modprobe.d/ndiswrapper.conf}}:<br />
# ndiswrapper -m<br />
# depmod -a<br />
<br />
Now the ndiswrapper install is almost finished; follow the instructions on [[Kernel modules#Automatic module loading with systemd]] to automatically load the module at boot.<br />
<br />
The important part is making sure that ndiswrapper exists on this line, so just add it alongside the other modules. It would be best to test that ndiswrapper will load now, so:<br />
# modprobe ndiswrapper<br />
# iwconfig<br />
<br />
and ''wlan0'' should now exist. If you have problems, some help is available at:<br />
[https://sourceforge.net/p/ndiswrapper/ndiswrapper/HowTos/ ndiswrapper howto] and [https://sourceforge.net/p/ndiswrapper/ndiswrapper/FAQ/ ndiswrapper FAQ].<br />
<br />
=== backports-patched ===<br />
<br />
{{AUR|backports-patched}} provide drivers released on newer kernels backported for usage on older kernels. The project started since 2007 and was originally known as compat-wireless, evolved to compat-drivers and was recently renamed simply to backports. <br />
<br />
If you are using old kernel and have wireless issue, drivers in this package may help.<br />
<br />
== See also ==<br />
<br />
* [https://wireless.wiki.kernel.org/ The Linux Wireless project]<br />
* [https://aircrack-ng.org/doku.php?id=install_drivers Aircrack-ng guide on installing drivers]<br />
* [https://wikidevi.wi-cat.ru Wireless Device Database Wiki] (This fork is hosted by wi-cat.ru since the original wiki has shut down. There are two less complete versions available: [http://en.techinfodepot.shoutwiki.com TechInfoDepot], [https://deviwiki.com/ deviwiki])</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=693080Lenovo ThinkPad T14 (AMD) Gen 22021-08-27T14:56:31Z<p>Snakeroot: It really does make a huge difference.</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} doesn't seem to be configurable and shows as having no carrier even when the RJ45 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Unreliable Mic Mute LED ==<br />
<br />
The MicMute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per the [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 relevant thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics Touchpad RMI Bus Non-Functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see the [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 relevant thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Sleep Mode (S3) ==<br />
<br />
Sleep mode and, in particular, the lid switch are slow and flaky unless the sleep mode is set to {{ic|Linux}} rather than {{ic|Windows 10}} in the BIOS. Be sure that you have logged out of, rather than suspending, any Windows 10 installation before changing this.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=692911Lenovo ThinkPad T14 (AMD) Gen 22021-08-25T19:11:44Z<p>Snakeroot: More information on bug in Gen 1</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the [[#See also|user guide]].<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings.}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the [[#See also|user guide]].<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} doesn't seem to be configurable and shows as having no carrier even when the RJ45 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Unreliable Mic Mute LED ==<br />
<br />
The MicMute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 this thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Synaptics Touchpad RMI Bus Non-Functional ==<br />
<br />
The Synaptics touchpad uses the {{ic|psmouse}} module rather than its native RMI bus, which is qualitatively superior. [[dmesg]] says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the [[kernel command line]] results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
For more, see [https://forums.lenovo.com/t5/Other-Linux-Discussions/T14-AMD-touchpad-InterTouch-RMI4-mode-support/m-p/5051935 this thread in the Lenovo Ubuntu forums] and [https://bugzilla.kernel.org/show_bug.cgi?id=213879 related kernel bug report].<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=692907Lenovo ThinkPad T14 (AMD) Gen 22021-08-25T18:54:51Z<p>Snakeroot: /* Unreliable Mic Mute LED */</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} doesn't seem to be configurable and shows as having no carrier even when the RJ45 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Unreliable Mic Mute LED ==<br />
<br />
The MicMute LED on key {{ic|F4}} stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 this thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.ate<br />
<br />
== Synaptics Touchpad RMI Bus Non-Functional ==<br />
<br />
The Synaptics touchpad uses the psmouse module rather than its native RMI bus, which is qualitatively superior. {{ic|dmesg}} says:<br />
<br />
{{bc |<br />
[ 2.148382] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]<br />
[ 2.184193] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]<br />
[ 2.184214] psmouse serio1: synaptics: Your touchpad (PNP: LEN2073 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.}}<br />
<br />
Following that advice by adding {{ic|1=psmouse.synaptics_intertouch=1}} to the kernel commandline results in a different complaint:<br />
<br />
{{bc |<br />
[ 2.217261] psmouse serio1: synaptics: Trying to set up SMBus access<br />
[ 2.220337] psmouse serio1: synaptics: SMbus companion is not ready yet.<br />
}}<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=692892Lenovo ThinkPad T14 (AMD) Gen 22021-08-25T17:15:29Z<p>Snakeroot: A flaky mic mute button is a dangerous thing.</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} doesn't seem to be configurable and shows as having no carrier even when the RJ45 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Unreliable Mic Mute LED ==<br />
<br />
The MicMute LED on key F4 stays on even when the mic is live. This is a problem shared by the AMD Gen 1 T14 as well, per [https://forums.lenovo.com/t5/Ubuntu/Mic-mute-led-not-changing-it-s-state-ubuntu-20-04-2-t14s-amd/m-p/5064911?page=1 this thread in the Lenovo Ubuntu support forum]. Confirm the actual status of the mic before saying anything you may come to regret on a Zoom call.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Advanced_traffic_control&diff=692300Advanced traffic control2021-08-20T22:12:52Z<p>Snakeroot: Currently page states it is current through 3.14</p>
<hr />
<div>[[Category:Networking]]<br />
[[ja:高度なトラフィック制御]]<br />
[[zh-hans:Advanced traffic control]]<br />
The Linux kernel's network stack has network traffic control and shaping features. The {{pkg|iproute2}} package installs the {{ic|tc}} command to control these via the command line. <br />
<br />
The goal of this article is to show how to shape the traffic by using queueing disciplines. For instance, if you ever had to forbid downloads or torrents on a network that you admin, and not because you were against those services, but because users were "abusing" the bandwidth, then you could use queueing disciplines to allow that kind of traffic and, at the same time, be sure that one user cannot slowdown the entire network.<br />
<br />
This is an advanced article; you are expected to have certain knowledge of network devices, iptables, etc.<br />
<br />
== Queuing ==<br />
<br />
Queuing controls how data is '''sent'''; receiving data is much more reactive with fewer network-oriented controls. However, since TCP/IP packets are sent using a slow start the system starts sending the packets slow and keeps sending them faster and faster until packets start getting rejected - it is therefore possible to control how much traffic is received on a LAN by dropping packets that arrive at a router before they get forwarded. There are more relevant details, but they do not touch directly on queuing logic.<br />
<br />
In order to be the ones fully controlling the shape of the traffic, we need to be the slowest link of the chain. That is, if the connection has a maximum download speed of 500k, if you do not limit of the output to 450k or below it is going to be the modem shaping the traffic instead of us.<br />
<br />
Each network device has a ''root'' where a qdisc can be set. This root has a fq_codel qdisc by default. (more info below)<br />
<br />
There are two kind of disciplines: classful and classless. <br />
<br />
Classful qdiscs allow you to create classes, which work like branches on a tree. You can then set rules to filter packets into each class. Each class can itself have assigned other classful or classless qdisc.<br />
<br />
Classless qdiscs do not allow to add more qdiscs to it.<br />
<br />
Before starting to configure qdiscs, first we need to remove any existing qdisc from the root. This will remove any qdisc from the eth0 device:<br />
<br />
# tc qdisc del root dev eth0<br />
<br />
=== Classless Qdiscs ===<br />
<br />
These are queues that do basic management of traffic by reordering, slowing or dropping packets. This qdiscs do not allow the creation of classes.<br />
<br />
==== fifo_fast ====<br />
<br />
This was the default qdisc up until systemd 217. In every network device where no custom qdisc configuration has been applied, fifo_fast is the qdisc set on the root. fifo means ''First In First Out'', that is, the first packet to get in, is going to be the first to be sent. This way, no package gets special treatment.<br />
<br />
==== Token Bucket Filter (TBF) ====<br />
<br />
This qdisc allows bytes to pass, as long certain rate limit is not passed. <br />
<br />
It works by creating a virtual bucket and then dropping tokens at certain speed, filling that bucket. Each package takes a virtual token from the bucket, and uses it to get a permission to pass. If too many packets arrive, the bucket will have no more tokens left and the remaining packets are going to wait certain time for new tokens. If the tokens do not arrive fast enough, the packets are going to be dropped. On the opposite case (too few packets sent), the tokens can be used to allow some burst (uploading spikes) to happen. <br />
<br />
That means this qdisc is useful to slow down an interface.<br />
<br />
Example:<br />
<br />
Uploading can fill a modem's queue and, as result, while you are uploading a huge file, the interactivity is destroyed.<br />
<br />
# tc qdisc add dev ppp0 root tbf rate 220kbit latency 50ms burst 1540<br />
<br />
Note the above upload speed should be changed to your upload speed minus a small few percent (to be the slowest link of the chain). This configuration sets a TBF for the {{ic|ppp0}} device, limiting the upload speed to 220k, setting a latency of 50ms for a package before being dropped, and a burst of 1540.<br />
It works by keeping the queueing on the Linux machine (where it can be shaped) instead of the modem.<br />
<br />
==== Stochastic Fairness Queueing (SFQ) ====<br />
<br />
This is a round-robin qdisc. Each conversation is set on a fifo queue, and on each round, each conversation has the possibility to send data. That is why it is called "Fairness".<br />
It is also called "Stochastic" because it does not really create a queue for each conversation, instead it uses a hashing algorithm. For the hash, there is a chance for multiple sessions on the same bucket. To solve this, SFQ changes its hashing algorithm often to prevent that this becomes noticeable.<br />
<br />
Example:<br />
<br />
This configuration sets SFQ on the root on the eth0 device, configuring it to perturb (alter) its hashing algorithm every 10 seconds.<br />
<br />
# tc qdisc add dev eth0 root sfq perturb 10<br />
<br />
==== CoDel and Fair Queueing CoDel ====<br />
<br />
Since systemd 217, fq_codel is the default. [[Wikipedia:CoDel|CoDel]] (Controlled Delay) is an attempt to limit buffer bloating and minimize latency in saturated network links by distinguishing good queues (that empty quickly) from bad queues that stay saturated and slow. The [[Wikipedia:Fair_queueing|fair queueing]] Codel utilizes fair queues to more readily distribute available bandwidth between Codel flows. The configuration options are limited intentionally, since the algorithm is designed to work with dynamic networks, and there are some corner cases to consider that are discussed on the [https://www.bufferbloat.net/projects/codel/wiki bufferbloat wiki concerning Codel], including issues on very large switches and sub megabit connections. <br />
<br />
Additional information is available via the {{man|8|tc-codel}} and {{man|8|tc-fq_codel}}. <br />
<br />
{{Warning|Make sure your ethernet driver supports Byte Queue Limits before using CoDel. [https://www.bufferbloat.net/projects/bloat/wiki/BQL_enabled_drivers Here is a list of drivers supported as of kernel 3.14]}}<br />
<br />
=== Classful Qdiscs ===<br />
<br />
Classful qdiscs are very useful if you have different kinds of traffic which should have differing treatment.<br />
A classful qdisc allows you to have branches. The branches are called classes.<br />
<br />
Setting a classful qdisc requires that you name each class. To name a class,the {{ic|classid}} parameter is used . The {{ic|parent}} parameter, as the name indicates, points to the parent of the class.<br />
<br />
All the names should be set as {{ic|x:y}} where {{ic|x}} is the name of the root, and {{ic|y}} is the name of the class. Normally, the root is called {{ic|1:}} and its children are things like {{ic|1:10}}<br />
<br />
==== Hierarchical Token Bucket (HTB) ====<br />
<br />
HTB is well suited for setups where you have a fixed amount of bandwidth which you want to divide for different purposes, giving each purpose a guaranteed bandwidth, with the possibility of specifying how much bandwidth can be borrowed.<br />
Here is an example with comments explaining what each line does:<br />
{{bc|<br />
# This line sets a HTB qdisc on the root of eth0, and it specifies that the class 1:30 is used by default. It sets the name of the root as 1:, for future references.<br />
tc qdisc add dev eth0 root handle 1: htb default 30<br />
<br />
# This creates a class called 1:1, which is direct descendant of root (the parent is 1:), this class gets assigned also an HTB qdisc, and then it sets a max rate of 6mbits, with a burst of 15k<br />
tc class add dev eth0 parent 1: classid 1:1 htb rate 6mbit burst 15k<br />
<br />
# The previous class has this branches:<br />
<br />
# Class 1:10, which has a rate of 5mbit<br />
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 5mbit burst 15k<br />
<br />
# Class 1:20, which has a rate of 3mbit<br />
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 3mbit ceil 6mbit burst 15k<br />
<br />
# Class 1:30, which has a rate of 1kbit. This one is the default class.<br />
tc class add dev eth0 parent 1:1 classid 1:30 htb rate 1kbit ceil 6mbit burst 15k<br />
<br />
# Martin Devera, author of HTB, then recommends SFQ for beneath these classes:<br />
tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10<br />
tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10<br />
tc qdisc add dev eth0 parent 1:30 handle 30: sfq perturb 10<br />
}}<br />
<br />
== Filters ==<br />
<br />
Once a classful qdisc is set on root (which may contain classes with more classful qdiscs), it is necessary to use filters to indicate which package should be processed by which class.<br />
<br />
On a classless-only environment, filters are not necessary.<br />
<br />
You can filter packets by using tc, or a combination of tc + iptables.<br />
<br />
=== Using tc only ===<br />
<br />
Here is an example explaining a filter:<br />
{{bc|<br />
# This command adds a filter to the qdisc 1: of dev eth0, set the<br />
# priority of the filter to 1, matches packets with a<br />
# destination port 22, and make the class 1:10 process the<br />
# packets that match.<br />
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip dport 22 0xffff flowid 1:10<br />
<br />
# This filter is attached to the qdisc 1: of dev eth0, has a<br />
# priority of 2, and matches the ip address 4.3.2.1 exactly, and<br />
# matches packets with a source port of 80, then makes class<br />
# 1:11 process the packets that match<br />
tc filter add dev eth0 parent 1: protocol ip prio 2 u32 match ip src 4.3.2.1/32 match ip sport 80 0xffff flowid 1:11<br />
}}<br />
<br />
=== Using tc + iptables ===<br />
<br />
iptables has a method called fwmark that can be used to mark packets across interfaces.<br />
<br />
First, this makes packets marked with 6, to be processed by the 1:30 class<br />
# tc filter add dev eth0 protocol ip parent 1: prio 1 handle 6 fw flowid 1:30<br />
<br />
This sets that mark 6, using iptables<br />
<br />
# iptables -A PREROUTING -t mangle -i eth0 -j MARK --set-mark 6<br />
<br />
You can then use iptables normally to match packets and then mark them with fwmark.<br />
<br />
== Example of ingress traffic shaping with SNAT ==<br />
<br />
Qdiscs on ingress traffic provide only policing with no shaping. In order to shape ingress, the IFB (Intermediate Functional Block) device has to be used. However, another problem arises if SNAT or MASQUERADE is in use, as all incoming traffic has the same destination address. The Qdisc intercepts the incoming traffic on the external interface before reverse NAT translation so it can only see the router's IP as destination of the packets.<br />
<br />
The following solution is implemented on OpenWRT and can be applied to Archlinux: First the outgoing packets are marked with MARK and the corresponding connections (and related connections) with CONNMARK. On the incoming packets an ingress u32 filter redirects the traffic to IFB (action mirred), and also retrieves the mark of the packet from CONNTRACK (action connmark) thus providing information as to which IP behind the NAT initiated the traffic). <br />
<br />
This function is integrated in kernel since {{Pkg|linux}}-3.19 and in {{Pkg|iproute2}} since 4.1. <br />
<br />
The following is a small script with only 2 HTB classes on ingress to demonstrate it. Traffic defaults to class 3:30. Outgoing traffic from 192.168.1.50 (behind NAT) to the Internet is marked with "3" and thus incoming packets from the Internet going to 192.168.1.50 are marked also with "3" and are classified on 3:33. <br />
<br />
{{bc|<nowiki><br />
#!/bin/sh -x<br />
<br />
# Maximum allowed downlink. Set to 90% of the achievable downlink in kbits/s<br />
DOWNLINK=1800<br />
<br />
# Interface facing the Internet<br />
EXTDEV=enp0s3<br />
<br />
# Load IFB, all other modules all loaded automatically<br />
modprobe ifb<br />
ip link set dev ifb0 down<br />
<br />
# Clear old queuing disciplines (qdisc) on the interfaces and the MANGLE table<br />
tc qdisc del dev $EXTDEV root 2> /dev/null > /dev/null<br />
tc qdisc del dev $EXTDEV ingress 2> /dev/null > /dev/null<br />
tc qdisc del dev ifb0 root 2> /dev/null > /dev/null<br />
tc qdisc del dev ifb0 ingress 2> /dev/null > /dev/null<br />
iptables -t mangle -F<br />
iptables -t mangle -X QOS<br />
<br />
# appending "stop" (without quotes) after the name of the script stops here.<br />
if [ "$1" = "stop" ]<br />
then<br />
echo "Shaping removed on $EXTDEV."<br />
exit<br />
fi<br />
<br />
ip link set dev ifb0 up<br />
<br />
# HTB classes on IFB with rate limiting<br />
tc qdisc add dev ifb0 root handle 3: htb default 30<br />
tc class add dev ifb0 parent 3: classid 3:3 htb rate ${DOWNLINK}kbit<br />
tc class add dev ifb0 parent 3:3 classid 3:30 htb rate 400kbit ceil ${DOWNLINK}kbit<br />
tc class add dev ifb0 parent 3:3 classid 3:33 htb rate 1400kbit ceil ${DOWNLINK}kbit<br />
<br />
# Packets marked with "3" on IFB flow through class 3:33<br />
tc filter add dev ifb0 parent 3:0 protocol ip handle 3 fw flowid 3:33<br />
<br />
# Outgoing traffic from 192.168.1.50 is marked with "3"<br />
iptables -t mangle -N QOS<br />
iptables -t mangle -A FORWARD -o $EXTDEV -j QOS<br />
iptables -t mangle -A OUTPUT -o $EXTDEV -j QOS<br />
iptables -t mangle -A QOS -j CONNMARK --restore-mark<br />
iptables -t mangle -A QOS -s 192.168.1.50 -m mark --mark 0 -j MARK --set-mark 3<br />
iptables -t mangle -A QOS -j CONNMARK --save-mark<br />
<br />
# Forward all ingress traffic on internet interface to the IFB device<br />
tc qdisc add dev $EXTDEV ingress handle ffff:<br />
tc filter add dev $EXTDEV parent ffff: protocol ip \<br />
u32 match u32 0 0 \<br />
action connmark \<br />
action mirred egress redirect dev ifb0 \<br />
flowid ffff:1<br />
<br />
exit 0<br />
</nowiki>}}<br />
<br />
== See also ==<br />
<br />
* [https://lartc.org Linux Advanced Routing & Traffic Control]<br />
* [[wikipedia:Tc_(Linux)|Wikipedia page for the tc command]]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=691407Lenovo ThinkPad T14 (AMD) Gen 22021-08-10T00:21:52Z<p>Snakeroot: typo</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} doesn't seem to be configurable and shows as having no carrier even when the RJ45 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=691406Lenovo ThinkPad T14 (AMD) Gen 22021-08-10T00:19:59Z<p>Snakeroot: Information on strange Realtek behavior. Particularly important since Wifi driver is not in-kernel so Ethernet is near-mandatory for setup.</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the ''Config'' tab, there is a ''Setup UI'' item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Realtek Ethernet ==<br />
<br />
{{ic|lspci}} shows two distinct Ethernet controllers:<br />
<br />
{{bc|$ lspci {{!}} grep Ethernet<br />
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)<br />
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)}}<br />
<br />
However, {{ic|enp2s0f0}} doesn't seem to be configurable and shows as having no carrier even when the RJ5 is attached and {{ic|enp5s0}} shows carrier:<br />
<br />
{{bc|$ ip link<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b9 brd ff:ff:ff:ff:ff:ff<br />
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000<br />
link/ether 38:f3:ab:f4:0a:b8 brd ff:ff:ff:ff:ff:ff<br />
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000<br />
link/ether 14:5a:fc:1b:d5:15 brd ff:ff:ff:ff:ff:ff}}<br />
<br />
Check {{ic|ip link}} to see what interface has carrier and then set up that interface.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=691253Lenovo ThinkPad T14 (AMD) Gen 22021-08-07T21:05:38Z<p>Snakeroot: This should be easier for blind folks, people who can't use mice and, well, everyone. Amazing the things you find at the very bottom of a second level menu.</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. Under the config tab, there is a "Setup UI" item that toggles the BIOS look-and-feel back to the old-school Thinkpad grey-blue-and-white, all-text, keyboard navigation mode, which may be easier. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
* [https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
* [https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
* [https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=691193Lenovo ThinkPad T14 (AMD) Gen 22021-08-07T13:51:41Z<p>Snakeroot: Typo</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+Left Arrow}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+Right Arrow}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=691192Lenovo ThinkPad T14 (AMD) Gen 22021-08-07T13:50:36Z<p>Snakeroot: Initial page</p>
<hr />
<div>[[Category:Lenovo]]<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own keys bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691188User:Snakeroot2021-08-07T13:44:23Z<p>Snakeroot: /* Firmware */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=691186Lenovo ThinkPad T14 (AMD) Gen 22021-08-07T13:43:08Z<p>Snakeroot: </p>
<hr />
<div>{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Firmware ==<br />
<br />
=== fwupd ===<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691185User:Snakeroot2021-08-07T13:42:18Z<p>Snakeroot: /* Realtek WLAN */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Realtek WLAN ==<br />
<br />
As of kernel 5.13.8, the Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Firmware ==<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== SecureBoot ===<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T14_(AMD)_Gen_2&diff=691184Lenovo ThinkPad T14 (AMD) Gen 22021-08-07T13:38:56Z<p>Snakeroot: Created page with "{| class="wikitable" style="float: right;" |- ! Hardware !! PCI/USB ID !! Working? |- | Trackpoint || || {{Yes}} |- | Touchpad || || {{Yes}} |- | Keyboard || || {{Yes}} |- | G..."</p>
<hr />
<div>{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691183User:Snakeroot2021-08-07T13:33:26Z<p>Snakeroot: /* Secure boot */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Realtek WLAN ==<br />
<br />
The Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Firmware ==<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== SecureBoot ===<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s] and [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1].<br />
<br />
You break it, you keep both pieces.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691182User:Snakeroot2021-08-07T13:32:07Z<p>Snakeroot: /* Realtek WLAN */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Realtek WLAN ==<br />
<br />
The Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Firmware ==<br />
<br />
[[fwupd]] supports the UEFI BIOS, the webcam and the NVME controller.<br />
<br />
=== SecureBoot ===<br />
<br />
=== Secure boot ===<br />
<br />
For a number of Lenovo laptops of the same cohort, it has been reported that deleting SecureBoot keys and substituting your own bricks the the motherboard. Further, Lenovo classifies this as caused-by-customer and thus outside the scope of warranty coverage. See here for Lenovo forum threads on [https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/BIOS-BUG-X1C7-quot-Configuration-changed-restart-system-quot-loop-after-enrolled-my-own-secureboot-key/m-p/4607484 XC17],[https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-Secure-Boot-Key-Enrollment/m-p/5066514?page=2#5393912 T14s], [https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/Own-secure-boot-keys-on-T14/m-p/5069436?page=1#5276410 T14 (AMD) Gen 1.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691178User:Snakeroot2021-08-07T13:21:30Z<p>Snakeroot: /* Function keys */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Realtek WLAN ==<br />
<br />
The Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible? !! Marked? !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691177User:Snakeroot2021-08-07T13:18:34Z<p>Snakeroot: /* Lenovo Thinkpad T14 (AMD) Gen 2 */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| MicoSD-card reader || {{ic|17a0:9750}} || {{Y|Untested}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Realtek WLAN ==<br />
<br />
The Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible?<sup>1</sup> !! Marked?<sup>2</sup> !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691087User:Snakeroot2021-08-07T01:33:22Z<p>Snakeroot: /* Lenovo Thinkpad T14 (AMD) Gen 2 */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Trackpoint || || {{Yes}}<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| SD-card reader || {{ic|17a0:9750}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Realtek WLAN ==<br />
<br />
The Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible?<sup>1</sup> !! Marked?<sup>2</sup> !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691083User:Snakeroot2021-08-07T00:55:09Z<p>Snakeroot: /* Realtek WLAN */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| SD-card reader || {{ic|?}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Realtek WLAN ==<br />
<br />
The Realtek 8852 wireless card requires {{AUR|rtw89-dkms-git}}.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible?<sup>1</sup> !! Marked?<sup>2</sup> !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691082User:Snakeroot2021-08-07T00:54:44Z<p>Snakeroot: /* Realtek WLAN */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| SD-card reader || {{ic|?}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Realtek WLAN ==<br />
<br />
The Realtek 8852 wireless card requires the {{AUR|rtw89-dkms-git}}.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible?<sup>1</sup> !! Marked?<sup>2</sup> !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691081User:Snakeroot2021-08-07T00:42:57Z<p>Snakeroot: /* Accessibility */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| SD-card reader || {{ic|?}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
High contrast black on white with large type. Unfortunately the selected menu item is indicated with faint dotted lines, which would make it hard to read for those with visual limitations. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below).<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Realtek WLAN ==<br />
<br />
The Realtek 8852 wireless card requires the rtw89-dkms-git package.<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible?<sup>1</sup> !! Marked?<sup>2</sup> !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691051User:Snakeroot2021-08-06T22:56:40Z<p>Snakeroot: /* Lenovo Thinkpad T14 (AMD) Gen 2 */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || {{ic|1022:1638}} || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|04f2:b724}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|10ec:8168}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| SD-card reader || {{ic|?}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|1022:15e2}}|| {{Yes}}<br />
|-<br />
| Wireless (Realtek) || {{ic|10ec:8852}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
A classic, text-only grey and blue BIOS. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below). Default entries are indicated in bold text, which may not be distinguishable by screen-reading technologies.<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible?<sup>1</sup> !! Marked?<sup>2</sup> !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691046User:Snakeroot2021-08-06T22:18:49Z<p>Snakeroot: /* Lenovo Thinkpad T14 (AMD) Gen 2 */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|?}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|?}} || {{Yes}}<br />
|-<br />
| Bluetooth (Realtek) || {{ic|0bda:4852}} || {{Yes}}<br />
|-<br />
| SD-card reader || {{ic|?}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|?}}|| {{Yes}}<br />
|-<br />
| Wireless (Intel) || {{ic|?}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|06cb:00bd}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
A classic, text-only grey and blue BIOS. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below). Default entries are indicated in bold text, which may not be distinguishable by screen-reading technologies.<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible?<sup>1</sup> !! Marked?<sup>2</sup> !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroothttps://wiki.archlinux.org/index.php?title=User:Snakeroot&diff=691044User:Snakeroot2021-08-06T22:09:06Z<p>Snakeroot: /* Function keys */</p>
<hr />
<div>= Just Enough vi to Get By =<br />
<br />
There are a lot of great vi tutorials on the web. They all have one common flaw: they assume you ''want'' to learn vi. This article assumes you ''don't'' (or at least that you'd like to get some work done while you're doing so).<br />
<br />
Because vi is the default Unix editor, users can wind up having to use it like it or not. Where upstream defaults to {{ic|vi}}, Arch does as well. While it is possible to figure out which environment variable a program is looking to and override it, it is often easier just to buckle down and use vi.<br />
<br />
This is even more important since a number of the programs which default to {{ic|vi}} represent the safest way to edit certain very important (and very dangerous) files. This includes {{ic|crontab}},{{ic|vipw}}, {{ic|vigr}}, {{ic|visudo}} and {{ic|sudo -e}}. See [http://blog.sanctum.geek.nz/safely-editing-as-root/ this blogpost] for a summary of these programs and the importance of using the right tool to edit them.<br />
<br />
The purpose of this page is to teach just enough vi to allow casual editing of config files. Everything in these examples can be done "better" using other features of vi, but this is the minimum you need to know to survive. It will give you functionality about equivalent to nano.<br />
<br />
=== Modes ===<br />
<br />
The most confusing thing about vi is the modes: editing and command. Depending on which mode you are in, typing letters will either input text (editing mode) or give navigation, search or other commands (command mode). And just to make it even better, by default there is '''no''' visual cue as to what mode you're in.<br />
<br />
That problem is easily solved. The first thing you do after vi opens your file is type:<br />
<br />
:set showmode<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
Nothing will happen. That is because you are in command mode and showmode only shows the editing modes. When you enter an editing mode, showmode will display that fact in the lower right hand corner of your terminal.<br />
<br />
In command mode, there are two sorts of commands—single letters and commands (single or multiple letters) preceded by a colon ({{ic|:}}) as seen above.<br />
<br />
=== Safety First ===<br />
<br />
First off, backup your config files before you edit them. In general, and especially before you start playing with vi. '''vi has extremely limited ability to undo mistakes. Back up your files.'''<br />
<br />
Here's how to discard all changes since your last save--in command mode type <br />
<br />
:e!<br />
<br />
and hit {{ic|Enter}}.<br />
<br />
==== Changing Modes and Adding Text ====<br />
<br />
To get into editing mode and add text, in command mode hit {{ic|a}}. This will put you in editing mode with the cursor after where the character on which it was resting while you were in command mode.<br />
<br />
Now type whatever it is you want to type. Once you are done, get out of editing mode and into command mode.<br />
<br />
To get out of editing mode, hit {{ic|Esc}}. In fact, before you do anything in command mode hit {{ic|Esc}} just to make sure you're in command mode. Feel no shame: there are plenty of experienced vi users who pound on the {{ic|Esc}} key like fury chimps. Just to be sure.<br />
<br />
=== Basic Movement ===<br />
<br />
==== Moving the Cursor ====<br />
<br />
Movement is done in command mode. You can use the arrow keys on your keyboard to move around.<br />
<br />
'''In edit mode you may not be able to use your arrow keys to move around. Worse yet, using your arrow keys may actually output A, B, C or D. Repeatedly.''' Get out of edit mode before trying to move.<br />
<br />
You can make the arrow keys work in editing mode by changing your $TERM variable to "ansi" using {{ic|env}}:<br />
<br />
$env TERM=ansi vi FileYouAreEditing.conf<br />
<br />
or if you were editing {{ic|sudoers}}<br />
<br />
$sudo env TERM=ansi visudo<br />
<br />
==== Moving within the File ====<br />
<br />
To move down one screen {{ic|Ctrl+f}} and to move back one screen {{ic|Ctrl+b}}.<br />
<br />
=== Basic Editing ===<br />
<br />
==== Deleting Text ====<br />
<br />
To delete a character use the delete key. '''Backspace will not work.'''<br />
<br />
==== Inserting Text ==== <br />
<br />
In order to insert text you need to leave command mode and enter editing mode.<br />
<br />
Move the cursor to the last character ahead of where you want to insert text. Type the letter {{ic|a}}. If you {{ic|:set showmode}} (see above), in the lower right hand corner of your screen it will show {{ic|APPEND MODE}}.<br />
<br />
Type in your text and then hit the {{ic|Esc}} key once you are done. If you set showmode (see above), there will no longer be any mode indication in the lower right of your screen. '''Until you do type {{ic|Esc}} and get out of editing mode, you cannot give any commands or move—just input text.''' <br />
<br />
==== Inserting New Blank Lines ====<br />
<br />
Enter editing mode using {{ic|a}} and hit {{ic|Enter}}.<br />
<br />
==== Joining Lines ====<br />
<br />
In a typical editor you'd go to the end of the line and hit {{ic|Del}} or the start of the line and hit {{ic|Backspace}}. '''Unfortunately that won't work in vi.'''<br />
<br />
To join two lines in vi, you<br />
*enter command mode by hitting {{ic|Esc}}<br />
*navigate to the first of the two lines you want to join<br />
*type {{ic|J}}<br />
<br />
To join multiple lines in vi, you<br />
*turn on line numbers<br />
**{{ic|:show nu}}<br />
*type in the following, substituting the line number of the first line you want to join and the line ''before'' the last line you want joined for x and y<br />
**{{ic|:x,yj}}<br />
**note that the {{ic|j}} is lower case<br />
<br />
==== Cutting and Pasting Whole Lines ====<br />
To cut an entire line, in command mode type {{ic|yy}} ("y" is for "yank").<br />
To paste the line, in command mode, type {{ic|p}}. This will paste to the line below where the cursor is.<br />
<br />
=== Search and Replace ===<br />
==== Search ====<br />
You need to be in command mode to search. Search works the same way as it does in man pages:<br />
*to search forward, type {{ic|/}} followed by the search pattern, followed by {{ic|Return}}<br />
*to search backward, type {{ic|?}} followed by the search pattern, followed by {{ic|Return}}<br />
*to repeat (in either direction), hit {{ic|Return}}<br />
<br />
==== Replace ====<br />
Search and replace works in a way which is very similar to {{ic|sed}}.<br />
*to replace the first instance of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/c}} and hit Enter. <br />
*to replace all instances of "SearchString" on the line you are in, type {{ic|:s/SearchString/ReplaceString/gc}} and hit Enter<br />
*to replace all instances of "SearchString" in the entire file you are in, type {{ic|%:s/SearchString/ReplaceString/gc}} and hit Enter<br />
Each of these will ask you to confirm the change. {{ic|vi}}'s way of asking for confirmation is not at all intelligible. Basically it will show you the search string with a bunch of carets below it. If you want to make the change, hit {{ic|y}} and Enter, if you don't just hit Enter.<br />
<br />
So:<br />
<br />
:%s/foo/bar/gc<br />
<br />
I pity the foo.<br />
^^^<br />
<br />
=== Saving Your Work ===<br />
<br />
To save your work without exiting vi, type {{ic|:w}}.<br />
<br />
To save and exit, type {{ic|:wq}} or {{ic|ZZ}}.<br />
<br />
=== An Ounce of Prevention: Editing Your Configuration File ===<br />
One way to minimize the pain of using vi is to edit its configuration file to automatically fix some of the issues highlighted above.<br />
vi's configuration file is {{ic|.exrc}} and is kept in your {{ic|$HOME}} directory. Here's a sample annotated file:<br />
# sample .exrc<br />
# automatically show if vi is in editing mode in lower right hand corner of screen<br />
set showmode<br />
# automatically show line numbers<br />
set number<br />
# set terminal type to ANSI (allows use of arrow keys for motion while in edit mode)<br />
set term=ansi<br />
<br />
== See also ==<br />
* [http://www.cs.colostate.edu/helpdocs/vi.html CSU vi guide]<br />
* [https://kb.iu.edu/d/afdc IU vi Quick Reference]<br />
* [http://www.lagmonster.org/docs/vi.html Lagmonster vi Cheatsheet]<br />
* [http://www.cs.rit.edu/~cslab/vi.html RIT vi Editor Commands]<br />
<br />
= Unicode =<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! X11 Keymap<br />
|-<br />
| EUR || &#x20AC;|| 20AC || =e<br />
|-<br />
| GBP || &#x00A3;|| 00A3 || =l<br />
|-<br />
| INR || &#x20A8;|| 20A8 || Rs<br />
|-<br />
| JPY || &#x00a5;|| 00A5 || =y<br />
|-<br />
| KRW || &#x20A9;|| 20A9 || =W<br />
|-<br />
| RUB || &#x20BD;|| 20BD ||<br />
|-<br />
| USD || &#x0024;|| 0024 || <br />
|-<br />
| USD (cent) || &#x00A2; || 00A2 || /c<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Em dash || &#x2014;|| 2014 ||--- (3 minuses)<br />
|-<br />
| Left single quote || &#x2018; || 2018 || <'<br />
|-<br />
| Right single quote || &#x2019; || 2019 || >'<br />
|-<br />
| Left double quote || &#x201C; || 201C || <"<br />
|-<br />
| Right double quote || &#x201D; || 201D || >"<br />
|-<br />
| Dagger || &#x2020; || 2020 ||<br />
|-<br />
| Double Dagger || &#x2021; || 2021 ||<br />
|-<br />
| Paragraph Mark (Pilcrow) || &#x00B6; || 00B6 || PP<br />
|-<br />
| Bullet || &#x2022;|| 2022 || .=<br />
|}<br />
<br />
{| class="wikitable"<br />
! Description !! Character !! Unicode !! Compose<br />
|-<br />
| Multiplication || &#x2715;|| 2715 || xx<br />
|-<br />
| Division || &#x00F7; || 00F7 || :-<br />
|-<br />
| Square Root || &#x221A; || 221A || <br />
|-<br />
| Degree Sign || &#x00B0; || 00B0 || oo<br />
|}<br />
=Transmission=<br />
*under the {{ic|transmission}} user but adding the user to the {{ic|transmission}} group<br />
<br />
If you want to run as {{ic|transmission}} but still be able to use the transmission web interface as an ordinary user, as a compromise you can add your user to the {{ic|transmission}} group, change permissions on some of the files and directories in {{ic|<br />
/var/lib/transmission}}.<br />
<br />
#usermod -a -G transmission myusername<br />
#chmod g+rwx /var/lib/transmission<br />
#chmod g+rwx /var/lib/transmission/Downloads<br />
#chmod<br />
=Systemd Service Files=<br />
Systemd has a number of service file options that enhance security.<br />
Edit service type database<br />
As mentioned above, Avahi comes with a tool that can check the service. avahi-browseAnd avahi-discoverto display a description of the service using the even database files Both. The database contains the names of most services (not all).<br />
<br />
Unfortunately, since the QOTD service just created is not included in the database it avahi-browse -awill display the following entry:<br />
<br />
+ wlp2s0 IPv4 MyServer _ qotd._ tcp local<br />
Get source<br />
First github mirror of avahi located in service-type-databasethe sub-directory build-db.inand service-typesplease be placed in the build directory to download the file:<br />
<br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db.in <br />
$ wget https://raw.githubusercontent.com/lathiat/avahi/master/service-type -database / service-types<br />
Fix source<br />
Next, create the following script:<br />
<br />
#! / bin / bash<br />
sed -e 's, @ PYTHON \ @, / usr / bin / python 2.7, g' \<br />
-e 's, @ DBM \ @, gdbm, g' <build- db.in> build-db<br />
chmod + x build-db<br />
The above script build-dbcreates a file named:<br />
<br />
$. / whatever_you_named_the_script.sh<br />
$ ls<br />
build-db build-db.in service-types whatever_you_named_the_script.sh<br />
Then service-typesadd a new QOTD service to the file. The file is one entry per line type:Human Readable Descriptionand fills in the entry in the form. The description can contain spaces.<br />
<br />
For example, add the following entry at the end of the file:<br />
<br />
_qotd._ tcp: Quote of the Day (QOTD) Server<br />
Build and install a new database<br />
build-dbPlease run python script (use python 2 instead of python 3). service-types.dbThe file is built. gdbmtoolsPlease make sure that the new database can be loaded using the built-in and that new entries are included:<br />
<br />
$ /usr/bin/python 2.7 build-db<br />
$ ls<br />
build-db build-db.in service-types service-types.db whatever_you_ named_the_script.sh<br />
$ gdbmtool service-types.db<br />
<br />
Welcome to the gdbm tool. Type? For help.<br />
<br />
gdbmtool> fetch _ qotd._ tcp<br />
Quote of the Day (QOTD) Server<br />
gdbmtool> quit<br />
Make sure you back up your old database and move the new database so avahi-browsethat new entries are recognized:<br />
<br />
$ cp /usr/lib/avahi/service-types.db / backup-directory<br />
# cp /build-directory/service-types.db /usr/lib/avahi/service-types.db<br />
$ avahi-browse -b | grep QOTD<br />
Quote of the Day (QOTD) Server<br />
avahi-browse The entries for it are as follows:<br />
<br />
+ wlp2s0 IPv4 MyServer Quote of the Day (QOTD) Server local<br />
reference<br />
<br />
==Lenovo Thinkpad T14 (AMD) Gen 2==<br />
<br />
{| class="wikitable" style="float: right;"<br />
|-<br />
! Hardware !! PCI/USB ID !! Working?<br />
|-<br />
| Touchpad || || {{Yes}}<br />
|-<br />
| Keyboard || || {{Yes}}<br />
|-<br />
| GPU || || {{Yes}}<br />
|-<br />
| Webcam (Non-IR) || {{ic|?}} || {{Yes}}<br />
|-<br />
| Ethernet || {{ic|?}} || {{Yes}}<br />
|-<br />
| Bluetooth (Intel) || {{ic|?}} || {{Yes}}<br />
|-<br />
| SD-card reader || {{ic|?}} || {{Yes}}<br />
|-<br />
| Audio || {{ic|?}}|| {{Yes}}<br />
|-<br />
| Wireless (Intel) || {{ic|?}} || {{Yes}}<br />
|-<br />
| Fingerprint reader || {{ic|?}} || {{Yes}}<br />
|-<br />
| TPM || || {{Y|Untested}}<br />
|}<br />
<br />
== Accessibility ==<br />
<br />
A classic, text-only grey and blue BIOS. A table of navigation keys is found under the heading "Navigate in the UEFI BIOS interface" on p.31 of the User Manual (see link below). Default entries are indicated in bold text, which may not be distinguishable by screen-reading technologies.<br />
<br />
{{Note|Blind users should request the help of a sighted person to change BIOS settings}}<br />
<br />
This device has no diagnostic LEDs but relies on audible beep codes. However, those codes can be translated into visible form by using Lenovo's SmartBeep app. This is described under the heading "Beep errors" on p.53 of the User Manual (see link below).<br />
<br />
== Function keys ==<br />
<br />
{| class="wikitable"<br />
! Key !! Visible?<sup>1</sup> !! Marked?<sup>2</sup> !! Effect<br />
|-<br />
| {{ic|Fn+Esc}} || {{Yes}} || {{Yes}} || Toggles Fn lock<br />
|-<br />
| {{ic|F1}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMute}}<br />
|-<br />
| {{ic|F2}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioLowerVolume}}<br />
|-<br />
| {{ic|F3}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioRaiseVolume}}<br />
|-<br />
| {{ic|F4}} || {{Yes}} || {{Yes}} || {{ic|XF86AudioMicMute}}<br />
|-<br />
| {{ic|F5}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessDown}}<br />
|-<br />
| {{ic|F6}} || {{Yes}} || {{Yes}} || {{ic|XF86MonBrightnessUp}}<br />
|-<br />
| {{ic|F7}} || {{Yes}} || {{Yes}} || {{ic|XF86Display}}<br />
|-<br />
| {{ic|F8}} || {{Yes}} || {{Yes}} || {{ic|XF86WLAN}}<br />
|-<br />
| {{ic|F9}} || {{Yes}} || {{Yes}} || {{ic|XF86NotificationCenter}}<br />
|-<br />
| {{ic|F10}} || {{Yes}} || {{Yes}} || {{ic|XF86PickupPhone}}<br />
|-<br />
| {{ic|F11}} || {{Yes}} || {{Yes}} || {{ic|XF86HangupPhone}}<br />
|-<br />
| {{ic|F12}} || {{Yes}} || {{Yes}} || {{ic|XF86Favorites}}<br />
|-<br />
| {{ic|Fn+Space}} || {{No}} || {{Yes}} || Controls the keyboard backlight<br />
|-<br />
| {{ic|Fn+b}} || {{Yes}} || {{No}} || {{ic|Control_L+Break}}<br />
|-<br />
| {{ic|Fn+k}} || {{Yes}} || {{No}} || {{ic|Scroll_Lock}}<br />
|-<br />
| {{ic|Fn+p}} || {{Yes}} || {{No}} || {{ic|Pause}}<br />
|-<br />
| {{ic|Fn+s}} || {{Yes}} || {{No}} || {{ic|Alt_L}} {{ic|Alt_L+Sys_Req}}<br />
|-<br />
| {{ic|Fn+4}} || {{Yes}} || {{No}} || {{ic|XF86Sleep}}<br />
|-<br />
| {{ic|Fn}} || {{Yes}} || {{No}} || {{ic|XF86WakeUp}}<br />
|-<br />
| {{ic|Fn+←}} || {{Yes}} || {{No}} || {{ic|Home}}<br />
|-<br />
| {{ic|Fn+}} || {{Yes}} || {{No}} || {{ic|End}}<br />
|}<br />
<br />
== See also ==<br />
<br />
[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_T14_Gen_2_AMD/ThinkPad_T14_Gen_2_AMD_Spec.pdf Tech specs (pdf)]<br />
<br />
[https://download.lenovo.com/pccbbs/mobiles_pdf/t14_gen2_t15_gen2_p14s_gen2_p15s_gen2_ug_linux_ug_en.pdf User guide (pdf)]<br />
<br />
[https://pcsupport.lenovo.com/es/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-gen-2-type-20xk-20xl Lenovo Product page]</div>Snakeroot