|
| 1 | +# Advanced features and tasks |
| 2 | + |
| 3 | +While the underlying operating system offers tools and processes to make customizations, the **preferred method** to change most settings is using the interactive [_armbian-config_](User-Guide_Armbian-Config.md) tool which is shipped with all Armbian images. It also provides means to install [preconfigured applications and advanced services](User-Guide_Armbian-Software.md). |
| 4 | + |
| 5 | +Usually, all of the following commands require elevated permissions, and must be run as root or prefixed by the _sudo_ command. |
| 6 | + |
| 7 | + |
| 8 | +## Keyboard layout |
| 9 | + |
| 10 | +This is typically handled by [_armbian-config_](User-Guide_Armbian-Config/Localisation.md#change-keyboard-layout). For some corner cases, changing the keyboard layout can also be done with: |
| 11 | + |
| 12 | +```sh |
| 13 | +dpkg-reconfigure keyboard-configuration |
| 14 | +``` |
| 15 | + |
| 16 | +If the chosen standard is not available with the previous command, you may also need to set the keymap config. |
| 17 | + |
| 18 | +```sh |
| 19 | +# Check the actual keymap config |
| 20 | +localectl status | grep -i keymap |
| 21 | + |
| 22 | +# Set the desired keymap config. In the example below it is set to 'br-abnt2' |
| 23 | +localectl set-keymap br-abnt2 |
| 24 | +``` |
| 25 | + |
| 26 | + |
| 27 | +## System language |
| 28 | + |
| 29 | +This is typically handled by [_armbian-config_](User-Guide_Armbian-Config/Localisation.md#change-locales-reconfigure-the-language-and-character-set). If necessary, to handle it with system tools, for [Debian](https://wiki.debian.org/ChangeLanguage) run: |
| 30 | + |
| 31 | +```sh |
| 32 | +dpkg-reconfigure locales |
| 33 | +``` |
| 34 | + |
| 35 | +And for [Ubuntu](https://help.ubuntu.com/community/Locale) |
| 36 | + |
| 37 | +```sh |
| 38 | +update-locale LANG=[options] && dpkg-reconfigure locales |
| 39 | +``` |
| 40 | + |
| 41 | + |
| 42 | +## Console font and codepage |
| 43 | + |
| 44 | +```sh |
| 45 | +dpkg-reconfigure console-setup |
| 46 | +``` |
| 47 | + |
| 48 | + |
| 49 | +## Time zone |
| 50 | + |
| 51 | +This is typically handled by [_armbian-config_](User-Guide_Armbian-Config/Localisation.md#change-global-timezone). If necessary, one can also run: |
| 52 | + |
| 53 | +```sh |
| 54 | +dpkg-reconfigure tzdata |
| 55 | +``` |
| 56 | + |
| 57 | + |
| 58 | +## Default sound output |
| 59 | + |
| 60 | +!!! note |
| 61 | + |
| 62 | + In recent versions of Debian and Ubuntu, `pulseaudio` got replaced by `pipewire`. The following suggestions won't work in that case. |
| 63 | + |
| 64 | +To check the available sound output options ("sinks") with pulseaudio: |
| 65 | + |
| 66 | +```sh |
| 67 | +pacmd list-sinks | less |
| 68 | +``` |
| 69 | + |
| 70 | +The default sink will be marked with an asterisk "\*". Press <kbd>q</kbd> to exit. |
| 71 | + |
| 72 | +To define a new default sound output: |
| 73 | + |
| 74 | +```sh |
| 75 | +pacmd set-default-sink <NAME-OF-DESIRED-OPTION> |
| 76 | +``` |
| 77 | + |
| 78 | +The name of HDMI sound output devices may change accordingly to the device. If you don't want to deal with different names, you can run: |
| 79 | + |
| 80 | +```sh |
| 81 | +pacmd set-default-sink $(pactl list short sinks | grep -i 'hdmi' | awk '{print $2}') |
| 82 | +``` |
| 83 | + |
| 84 | +The command to define the default sink is not persistent. To make it persistent, add it to the file `~/.bashrc`. |
| 85 | + |
| 86 | + |
| 87 | +## Fix HDMI screen resolution for SunXi/Allwinner SoC |
| 88 | + |
| 89 | +In rare cases, some SunXi/Allwinner boards failed to detect Full-HD support for HDMI and boot with only 720p. This issue should now be resolved, and the following steps are provided only for reference if it still occurs. |
| 90 | +!!! tip "Legacy versions" |
| 91 | + |
| 92 | + Open the `/boot/boot.cmd` file with an editor of your choice (e.g. `nano`) and add or change the [`disp.screen0_output_mode`](https://linux-sunxi.org/Display#HDMI) option to the kernel command line. For a fixed mode (e.g. 1280x720 at 60 Hz), set it to: |
| 93 | + |
| 94 | + ```sh |
| 95 | + disp.screen0_output_mode=1280x720p60 |
| 96 | + ``` |
| 97 | + |
| 98 | + Then run |
| 99 | + |
| 100 | + ```sh |
| 101 | + mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr |
| 102 | + ``` |
| 103 | + |
| 104 | + |
| 105 | +## Enable a custom screen resolution within X.Org |
| 106 | + |
| 107 | +Sometimes, not all desired resolutions are supported out of the box. The following short howto shows how to enable a custom resolution and add it to your X.Org configuration. It is based on [this forum post](https://forum.armbian.com/topic/10403-add-undetected-hdmi-resolution-to-x11xorg/) by user @maxlinux2000 (Thanks!). The `xrandr` and `cvt` commands must be executed as the current user in a graphical session, **not** by the root user! |
| 108 | + |
| 109 | +First, find the matching HDMI output (the `x11-xserver-utils` package must be installed): |
| 110 | + |
| 111 | +```sh |
| 112 | +xrandr --listmonitors |
| 113 | +``` |
| 114 | + |
| 115 | +Then, calculate the VESA CVT mode line. The following command does this for a custom resolution of 1440x900. |
| 116 | + |
| 117 | +```sh |
| 118 | +cvt 1440 900 |
| 119 | +``` |
| 120 | + |
| 121 | +The command will output a new modeline. For our example, it may look like this: |
| 122 | + |
| 123 | +``` |
| 124 | +# 1440x900 59.89 Hz (CVT 1.30MA) hsync: 55.93 kHz; pclk: 106.50 MHz |
| 125 | +Modeline "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync ) |
| 126 | +``` |
| 127 | + |
| 128 | +The new modeline can then be used directly to create and add the new mode, and enable it. The following commands will do that for the output device _HDMI-1_. |
| 129 | + |
| 130 | +```sh |
| 131 | +xrandr --newmode "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync |
| 132 | +xrandr --addmode HDMI-1 1440x900_60.00 |
| 133 | +xrandr --output HDMI-1 --mode 1440x900_60.00 |
| 134 | +``` |
| 135 | + |
| 136 | +If it works well, the new mode can also be added to X.Org's configuration in `/etc/X11/xorg.conf.d/` to make it permanently available/active. Otherwise, these commands will have to be executed after every reboot. To load this resolution automatically after starting the device, add the following section to e.g. `/etc/X11/xorg.conf.d/40-monitor.conf` (create the file if it does not exist): |
| 137 | + |
| 138 | +``` |
| 139 | +Section "Monitor" |
| 140 | + Identifier "HDMI-1" |
| 141 | + Modeline "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync |
| 142 | + Option "PreferredMode" "1440x900" |
| 143 | +EndSection |
| 144 | +``` |
| 145 | + |
| 146 | +After a restart, the graphical session should automatically be shown in the chosen resolution. |
| 147 | + |
| 148 | + |
| 149 | +## Alter the CPU frequency |
| 150 | + |
| 151 | +<!--TODO: new boards? --> |
| 152 | + |
| 153 | +!!! tip "Legacy versions" |
| 154 | + |
| 155 | + Some boards allow to adjust the CPU speed by editing the file `/etc/default/cpufrequtils` and alter the **min_speed** and/or **max_speed** variable. Changing these values require restarting `cpufrequtils.service` to activate the new settings: |
| 156 | + |
| 157 | + ```sh |
| 158 | + systemctl restart cpufrequtils.service |
| 159 | + ``` |
| 160 | + |
| 161 | + |
| 162 | +## Swap for experts |
| 163 | + |
| 164 | +By default, Armbian implements ZRAM (writing nothing to 'disk', but compressing memory pages in RAM). In case you often run into out-of-memory (OOM) errors and your device has some capable storage (e.g. a securely attached NVMe or SATA SSD), you might want to use ZSWAP instead. |
| 165 | + |
| 166 | +Check whether your kernel has zswap enabled. If yes, the following command |
| 167 | + |
| 168 | +```sh |
| 169 | +dmesg | grep zswap |
| 170 | +``` |
| 171 | + |
| 172 | +should return some output. If that is the case, create a swapfile or a swap partition the traditional way: edit `/etc/default/armbian-zram-config` so that it reads `SWAP=false`. Reboot, and you're done. |
| 173 | + |
| 174 | +Zswap performs a lot better than the combination of ZRAM and 'swap on disk' in parallel. |
| 175 | + |
| 176 | + |
| 177 | +## Switch or downgrade kernels |
| 178 | + |
| 179 | +This is typically handled by [_armbian-config_](User-Guide_Armbian-Config/System.md#alternative-kernels). |
| 180 | + |
| 181 | +```bash |
| 182 | +armbian-config --cmd KER001 |
| 183 | +``` |
| 184 | + |
| 185 | +In rare cases, it can be necessary to downgrade a kernel package, e.g. to fall back to a previous version. |
| 186 | + |
| 187 | +!!! danger |
| 188 | + |
| 189 | + Version dependencies between packages can create serious conflicts when attempting a package downgrade. If you force anything here, you can easily destroy your system beyond the point of repair. Don't use that command lightly and better ask twice. |
| 190 | + |
| 191 | +```sh |
| 192 | +apt install linux-image-current-rockchip64=25.5 |
| 193 | +``` |
| 194 | + |
| 195 | + |
| 196 | +## Build a wireless driver |
| 197 | + |
| 198 | +The kernels provided by the project should contain the drivers, modules, and firmware to support most commonly used network devices/dongles. If you encounter that you have to build your own module and load it, the following example shows the general procedure because most modules follow the same structure and setup. It is, however, rarely necessary to build and load so-called "out-of-tree" kernel modules as shown in this example. Even the module we use here as an example is already supported by the current kernels. |
| 199 | + |
| 200 | +First, building a module always requires having the kernel headers installed. The correct version can be installed with: |
| 201 | + |
| 202 | +```sh |
| 203 | +armbian-config --cmd HEAD01 |
| 204 | +``` |
| 205 | + |
| 206 | +Then download the driver's sources. Most drivers can probably be found in a Git repository like in our example. |
| 207 | + |
| 208 | +```sh |
| 209 | +git clone https://github.com/morrownr/8821au-20210708.git |
| 210 | +cd 8821au-20210708 |
| 211 | +``` |
| 212 | + |
| 213 | +The build and install instructions can usually be found on the driver's homepage or in a file called `README.md` in the source. Read these instructions carefully. Usually, the following commands will suffice and result in an output as shown below. |
| 214 | + |
| 215 | +```sh |
| 216 | +make |
| 217 | +make install |
| 218 | +``` |
| 219 | + |
| 220 | +??? "Build log" |
| 221 | + |
| 222 | + ```text |
| 223 | + make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/6.6.62-current-sunxi64/build M=/root/8821au-20210708 modules |
| 224 | + make[1]: Entering directory '/usr/src/linux-headers-6.6.62-current-sunxi64' |
| 225 | + CC [M] /root/8821au-20210708/core/rtw_cmd.o |
| 226 | + CC [M] /root/8821au-20210708/core/rtw_security.o |
| 227 | + CC [M] /root/8821au-20210708/core/rtw_debug.o |
| 228 | + CC [M] /root/8821au-20210708/core/rtw_io.o |
| 229 | + CC [M] /root/8821au-20210708/core/rtw_ioctl_query.o |
| 230 | + CC [M] /root/8821au-20210708/core/rtw_ioctl_set.o |
| 231 | + CC [M] /root/8821au-20210708/core/rtw_ieee80211.o |
| 232 | + CC [M] /root/8821au-20210708/core/rtw_mlme.o |
| 233 | + CC [M] /root/8821au-20210708/core/rtw_mlme_ext.o |
| 234 | + ... |
| 235 | + [ goes on for a while ] |
| 236 | + ... |
| 237 | + LD [M] /root/8821au-20210708/8821au.o |
| 238 | + MODPOST /root/8821au-20210708/Module.symvers |
| 239 | + CC [M] /root/8821au-20210708/8821au.mod.o |
| 240 | + LD [M] /root/8821au-20210708/8821au.ko |
| 241 | + make[1]: Leaving directory '/usr/src/linux-headers-6.6.62-current-sunxi64' |
| 242 | + ``` |
| 243 | + |
| 244 | +If make succeeded, attempt to load the driver and check the `dmesg` output. |
| 245 | + |
| 246 | +```sh |
| 247 | +insmod 8821au.ko |
| 248 | +usbcore: registered new interface driver rtl8821au |
| 249 | +``` |
| 250 | + |
| 251 | +If everything was successful, plug the USB wireless adaptor in and proceed with the [network configuration](User-Guide_Networking.md). |
| 252 | + |
| 253 | + |
| 254 | +## Toggle boot output |
| 255 | + |
| 256 | +[Boot parameters](http://redsymbol.net/linux-kernel-boot-parameters/) are edited or changed directly in `/boot/boot.cmd` (**not recommended**) or via variables in `/boot/armbianEnv.txt`: |
| 257 | + |
| 258 | +```diff |
| 259 | +- console=both |
| 260 | ++ console=serial |
| 261 | +``` |
| 262 | + |
| 263 | +To disable the console entirely (also **not recommended** and only as an example) one would set `console=none`. |
| 264 | + |
| 265 | +To recompile `boot.cmd` to `boot.scr` if it was changed: |
| 266 | + |
| 267 | +```sh |
| 268 | +mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr |
| 269 | +``` |
| 270 | + |
| 271 | +And reboot. |
| 272 | + |
| 273 | +The serial console on imx6 boards is `ttymxc0` (Hummingboard, Cubox-i) or `ttymxc1` (Udoo). |
| 274 | + |
| 275 | + |
| 276 | +## Toggle boot verbosity |
| 277 | + |
| 278 | +<!-- TODO: Isn't this better suited for Troubleshooting; at least cross-link from there here --> |
| 279 | + |
| 280 | +To change the boot verbosity, alter the `verbosity=` line in `/boot/armbianEnv.txt`. The lower the value, the lower the verbosity. The default is `1` and the maximum is `7`. |
| 281 | + |
| 282 | +!!! tip "Legacy versions" |
| 283 | + |
| 284 | + Using Armbian from version 5.05 to 5.20, you have to touch or delete `/boot/.force-verbose` to increase the boot verbosity. |
| 285 | + |
| 286 | + |
| 287 | +## Enable boot logs for inspection |
| 288 | + |
| 289 | +If your SBC behaves strange, the first step is to check the power supply and the integrity of the boot media as detailed in the [_Troubleshooting_](User-Guide_Troubleshooting.md) section. Also, run |
| 290 | + |
| 291 | +```sh |
| 292 | +armbianmonitor -c "$HOME"` |
| 293 | +``` |
| 294 | + |
| 295 | +Then look into your kernel logs. Armbian also provides a tool that grabs some information and pastes it to an online pasteboard service. Please increase the boot verbosity to its maximum level (`verbosity=7`) as shown above, reboot and then run: |
| 296 | + |
| 297 | +```sh |
| 298 | +sudo armbianmonitor -u |
| 299 | +``` |
| 300 | + |
| 301 | +Then copy and past the URL of your log to the [forum, mail, etc](index.md#where-to-find-additional-help). |
| 302 | + |
| 303 | + |
| 304 | +## APT mirror selection |
| 305 | + |
| 306 | +Armbian has its own APT repository `http://apt.armbian.com` and mirrors for armbian-specific packages. The default domain is a round-robin to all mirrors. If you are having trouble updating or expereince slow speeds, you may want to choose a specific mirror. |
| 307 | + |
| 308 | +First, make sure that you have the `jq` package installed: |
| 309 | + |
| 310 | +```sh |
| 311 | +apt install -y jq |
| 312 | +``` |
| 313 | + |
| 314 | +To get a list of available mirrors from our `https://apt.armbian.com/mirrors` endpoint in JSON format, run: |
| 315 | + |
| 316 | +```bash |
| 317 | +curl -s http://apt.armbian.com/mirrors | jq |
| 318 | +``` |
| 319 | + |
| 320 | +You will see a result set similar to this (shortened), listing mirrors by region: |
| 321 | + |
| 322 | +```json |
| 323 | +{ |
| 324 | + "AS": [ |
| 325 | + "http://mirror.twds.com.tw/armbian-apt/", |
| 326 | + "http://mirror.albony.in/armbian/", |
| 327 | + "http://jp.mirrors.naho.moe/armbian/", |
| 328 | + ... |
| 329 | + ], |
| 330 | + "EU": [ |
| 331 | + "http://netcup-02.armbian.com/apt/", |
| 332 | + "http://fi.mirror.armbian.de/apt/", |
| 333 | + "http://armbian.nardol.ovh/apt/", |
| 334 | + ... |
| 335 | + ], |
| 336 | + "NA": [ |
| 337 | + "http://mirrors.jevincanders.net/armbian/apt/" |
| 338 | + ], |
| 339 | + "OC": [ |
| 340 | + "http://au.sbcmirror.org/armbian/apt/" |
| 341 | + ], |
| 342 | + "default": [ |
| 343 | + "http://mirrors.jevincanders.net/armbian/apt/", |
| 344 | + "http://netcup-02.armbian.com/apt/", |
| 345 | + "http://fi.mirror.armbian.de/apt/", |
| 346 | + ... |
| 347 | + ] |
| 348 | +} |
| 349 | +``` |
| 350 | + |
| 351 | +Choose a mirror, edit `/etc/apt/sources.list.d/armbian.sources`, and replace the URL `http(s)://apt.armbian.com` with your preferred mirror. |
| 352 | + |
| 353 | + |
| 354 | +## Install Docker |
| 355 | + |
| 356 | +Install either the minimal package ... |
| 357 | + |
| 358 | +```bash |
| 359 | +armbian-config --CON001 |
| 360 | +``` |
| 361 | + |
| 362 | +... or the fully featured one. |
| 363 | + |
| 364 | +```bash |
| 365 | +armbian-config --CON002 |
| 366 | +``` |
| 367 | + |
| 368 | +To test if Docker works correctly: |
| 369 | + |
| 370 | +<!-- TODO: Will the above have added the current user to the docker group? --> |
| 371 | + |
| 372 | +```bash |
| 373 | +docker run hello-world |
| 374 | +``` |
| 375 | + |
| 376 | +If you get that kind of output, then Docker install went fine: |
| 377 | + |
| 378 | +```bash |
| 379 | +Hello from Docker! |
| 380 | +This message shows that your installation appears to be working correctly. |
| 381 | +``` |
0 commit comments