User:Przemoc/Notes

I finally installed AL and I'm poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don't hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.

Alpine Linux 3.3.3

Shell

Even though I always try to write POSIX sh-compliant scripts, I like to have bash as my default shell, because it's quite handy. Being able to write for instance quick diff -u <(COMMAND1) <(COMMAND2) (to compare output of two commands) or mv FILE{,SUFFIX} (to rename file by adding suffix) is very convenient.

Bash as default shell

AL doesn't have vipw, so root has to perform vi /etc/passwd himself to change the last field of root record (should be the first line in the file). You have to install util-linux package to get chsh utility.

Activate color prompt

Initial prompt: baytrail:~#

mv /etc/profile.d/color_prompt{,.sh}

Prompt after above change and relogin: baytrail [~]#

In case of normal users it's: baytrail [~]$

Long history

I like to have long history, so I created following file:

Contents of /etc/profile.d/long_history.sh

export HISTSIZE=9999999
export HISTFILESIZE=$HISTSIZE

Console

If you have physical access to screen connected to your machine with AL, it's nice to have properly configured console.

UTF-8 encoding

To have UTF-8 from OpenRC point of view, you have to set in /etc/rc.conf:

unicode="YES"

and add /etc/init.d/termencoding to autostart:

rc-update add termencoding

In fact it's mostly irrelevant (prove me wrong).

Font with polish letters

To be able to see polish letters, you have to install kbd-misc package, set in /etc/conf.d/consolefont:

If you don't like default default8x16.psf.gz font, then use lat2-16.psfu.gz instead. If you're comfortable with lower letter height, then I suggest using lat2-14.psfu.gz, which is still readable, yet on my 1920x1200 display increases LINES number from 75 to 85.

Keymap with only right Alt used for inputting polish letters

Default polish keymap pl uses both Alt keys for polish letters. If you prefer left Alt to be usable for other stuff (like switching to active window in irssi via Alt+A), then you have to switch to pl1 variant. bkeymaps package is needed for setting, but can be removed later.

setup-keymap pl pl1

UTF-8 in tmux

tmux checks upon start-up whether environment variable LC_ALL, or if it's empty then LC_CTYPE, or if it's empty then LANG, contain string UTF-8 or UTF8 to activate its UTF-8 mode. It can be also triggered by -u option. Important part is that globally turning on utf8 window option in tmux configuration doesn't enforce UTF-8 mode.

musl has locale system since v1.1.4, it was incomplete and experimental, but I'm not sure how it is now. The thing is it's not leveraged by AL and by default you have no LC_* variables set. In musl built-in default is C.UTF-8, so we can simply create one file to set LC_CTYPE to such default value and it will satisfy tmux check:

Contents of /etc/profile.d/locale.sh

export LC_CTYPE=C.UTF-8

Possible alternative is to alias tmux to tmux -u, but it seems clunky.

Serial console

To get tty on serial port you have to uncomment line in /etc/inittab:

ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100

If you want to be able to log as root using serial console, you have to add the serial port (here: ttyS0) to /etc/securetty.

It seems that nowadays you don't have to add lm_sensors to autostart, because in AL lm_sensors package is patched to create file /etc/modules-load.d/lm_sensors.conf (files in this directory are inspected by /etc/init.d/modules). /etc/init.d/lm_sensors seems in fact superfluous and it also doesn't work

Mail

I don't need my own real mail server (as it's kind of PITA to set it up properly nowadays). Simple MTA is good enough. In the old days I used ssmtp, but it stopped being maintained (apparently debian devs maintain it now), so I switched to msmtp.

msmtp

After installing msmtp package, you need to create configuration file in your home directory. You can find example for Zoho Mail account.