https://wiki.alpinelinux.org/w/index.php?title=Special:NewPages&feed=atom&hideredirs=1&limit=50&offset=&namespace=0&username=&tagfilter=&size-mode=max&size=0Alpine Linux - New pages [en]2024-03-28T20:30:22ZFrom Alpine LinuxMediaWiki 1.40.0https://wiki.alpinelinux.org/wiki/MuslMusl2024-03-15T13:28:37Z<p>WhyNotHugo: New article, mostly hints on locale</p>
<hr />
<div>Alpine Linux uses musl as its C standard library.<br />
<br />
= Locale =<br />
<br />
Musl does not implement most of the locale features that glibc implements. The {{Pkg|musl-locales}} provides the <code>locale</code> command and [https://git.adelielinux.org/adelie/musl-locales translations with varying degrees of completion].<br />
<br />
{{Note|this package includes a file in <code>/etc/profile.d/00locale.sh</code>. You'll need to re-login or source it manually for locales to work}}</div>WhyNotHugohttps://wiki.alpinelinux.org/wiki/Seat_managerSeat manager2024-03-06T21:23:30Z<p>Sertonix: add desktop category</p>
<hr />
<div>{{todo|This article needs verification for X11 based setups}}<br />
<br />
A seat manager dictates access to input and output devices like keyboard and monitor.<br />
<br />
On alpine linux 2 seat managers are available:<br />
* [[seatd]]: a minimal seat management daemon<br />
* [[elogind]]: from systemd extracted login manager<br />
<br />
== Input and video groups ==<br />
Some instructions mention the need for the <code>input</code> and <code>video</code> groups. This is in most cases not correct and insecure! The seat manager already provides the necessary permissions.<br />
<br />
Due to issue {{issue|15409}} there is currently 1 exception: If you aren't using elogind and need [[PipeWire#Device_access|PipeWire]] to access a webcam you need the <code>video</code> group.<br />
<br />
== See Also ==<br />
* [https://man.sr.ht/~kennylevinsen/seatd/#what-is-a-seat seatd: what is a seat]<br />
* [https://docs.voidlinux.org/config/session-management.html void docs: Session and Seat Management]<br />
<br />
[[Category:Desktop]]</div>Sertonixhttps://wiki.alpinelinux.org/wiki/SeatdSeatd2024-03-03T09:58:36Z<p>Sertonix: link to seat manager article</p>
<hr />
<div>Seatd is a [[seat manager]] and provides user sessions (mostly compositors) with access to input and output devices.<br />
<br />
See [https://man.sr.ht/~kennylevinsen/seatd/ the seatd documentation] for further details.<br />
<br />
When using [[elogind]], seatd is not required and viceversa.<br />
<br />
= Installation =<br />
<br />
{{Cmd|apk add {{Pkg|seatd}} # install seatd<br />
rc-update add seatd # configure it to auto-start<br />
service seatd start # start it now<br />
adduser $USER seat # allow current user to access seatd<br />
}}<br />
<br />
If you are already logged in as a <code>$USER</code>, you will need to relogin.<br />
<br />
[[Category:Desktop]]<br />
[[Category:Seat_manager]]</div>WhyNotHugohttps://wiki.alpinelinux.org/wiki/GreetdGreetd2024-02-29T14:17:49Z<p>Sertonix: may need to add greetd to the seat group</p>
<hr />
<div>{{DISPLAYTITLE:greetd}}<br />
<br />
[https://git.sr.ht/~kennylevinsen/greetd greetd] is a minimal and flexible login manager daemon that makes no assumptions about what you want to launch.<br />
<br />
This article focuses on alpine specific instructions. It is recommended to read the [https://man.sr.ht/~kennylevinsen/greetd/ greetd wiki] first.<br />
<br />
== Installation ==<br />
<br />
greetd needs to be combined with a greeter. You can find a list of available greeters here: {{pkg|greetd-*}}. Install the main package and the greeter you selected:<br />
<br />
{{cmd|# apk add {{pkg|greetd}} <greeter>}}<br />
<br />
You need to [[#Configuration|configure]] greetd before you can start it.<br />
<br />
Enable and start greetd:<br />
{{cmd|<nowiki># rc-update add greetd<br />
# rc-service greetd start</nowiki>}}<br />
<br />
== Configuration ==<br />
<br />
Some graphical greeters (like gtkgreet) require <code>seatd</code> or [[elogind]]. Add <code>rc_need=seatd</code> or <code>rc_need=elogind</code> to {{path|/etc/conf.d/greetd}}.<br />
When you use <code>seatd</code> with a graphical greeter it needs the <code>seatd</code> group:<br />
{{cmd|# adduser greetd seat}}<br />
<br />
For text based greeters you want to make sure that <code>vt</code> is set to <code>7</code> in {{path|/etc/greetd/config.toml}}. (This will be the default in alpine 3.20)<br />
<br />
You might want to start a [[D-Bus#D-Bus_session|D-Bus session]] when the greetd session is started. <br />
<br />
== See Also ==<br />
* [https://man.sr.ht/~kennylevinsen/greetd/ greetd wiki]<br />
* [https://wiki.archlinux.org/title/Greetd Arch wiki]</div>Sertonixhttps://wiki.alpinelinux.org/wiki/Configure_action_when_power-button_is_pressedConfigure action when power-button is pressed2024-02-29T00:49:05Z<p>Ncrav: Add instructions on how to configure the action for when the power button is pressed</p>
<hr />
<div>This article explains how to configure what happens when you press the power button. This might be useful to allow for desktop environments to control what happens instead of shutting down.<br />
<br />
# Install {{pkg|acpid}}: {{cmd|# apk add acpid}}<br />
# Enable and start the acpid daemon: {{cmd|# rc-update add acpid && rc-service acpid start}}<br />
<br />
== Busybox acpid ==<br />
<br />
This can be done via [[Busybox acpid]] by creating/modifying the hook in {{path|/etc/acpi/PWRF/00000080}}. <br />
<br />
=== Configuring for shutdown === <br />
In a newly installed system this might be already defined, however you can create the hook as follows:<br />
<br />
{{cat|/etc/acpi/PWRF/00000080|#!/bin/sh<br />
poweroff}}<br />
<br />
=== Configuring for sleep === <br />
<br />
# Install {{pkg|zzz}}: {{cmd|# apk add zzz}}<br />
# Modify the hook as follows: {{cat|/etc/acpi/PWRF/00000080|#!/bin/sh<br />
zzz}}<br />
<br />
=== Disabling === <br />
<br />
To disable simply comment or remove the hook. This is useful to allow desktop environments to handle the power button.<br />
<br />
{{cat|/etc/acpi/PWRF/00000080|#!/bin/sh<br />
#Nothing}}<br />
<br />
[[Category:Power Management]]<br />
[[category: Desktop]]</div>Ncravhttps://wiki.alpinelinux.org/wiki/FontconfigFontconfig2024-02-26T14:06:29Z<p>WhyNotHugo: New article: extracted from sway</p>
<hr />
<div>The default font for most applications is configured via {{Pkg|fontconfig}}. See <code>man 5 fonts-conf</code> for details.<br />
<br />
The following example changes the default <code>sans-serif</code>, <code>serif</code> and <code>monospace</code> fonts:<br />
<br />
<pre><br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'><br />
<fontconfig><br />
<!-- Default fonts --><br />
<alias binding="same"><br />
<family>sans-serif</family><br />
<prefer><br />
<family>DejaVu Sans</family><br />
</prefer><br />
</alias><br />
<alias binding="same"><br />
<family>serif</family><br />
<prefer><br />
<family>DejaVu Serif</family><br />
</prefer><br />
</alias><br />
<alias binding="same"><br />
<family>monospace</family><br />
<prefer><br />
<family>DejaVu Sans Mono</family><br />
</prefer><br />
</alias><br />
</fontconfig><br />
</pre><br />
<br />
To change default font selection system wide, copy the above into <code>/etc/fonts/conf.d/52-my-default-fonts.conf</code>.<br />
<br />
To change default font selection for a single user, copy the above into <code>$HOME/.config/fontconfig/conf.d/52-my-default-fonts.conf</code>.<br />
<br />
A list of installed can be obtained with fonts with <code>fc-list</code>.</div>WhyNotHugohttps://wiki.alpinelinux.org/wiki/LogbookdLogbookd2024-02-24T11:07:19Z<p>WhyNotHugo: /* See also */ Formatting</p>
<hr />
<div>[https://sr.ht/~martijnbraam/logbookd/ logbookd] is a syslogd implementation that uses an sqlite database as a backend.<br />
<br />
The default mode of operation uses a reduced write mode, where lots are written to memory and only flushed to disk when the service is interrupted or receives SIGUSR1.<br />
<br />
== Setup ==<br />
<br />
Logbook is provided via the {{pkg|logbookd}} package.<br />
<br />
Setting it up is quite straightforward:<br />
<br />
apk add logbookd<br />
<br />
# Disable and stop the default syslog.<br />
rc-update del syslog boot<br />
service syslog stop<br />
<br />
# Enable and start logbookd<br />
rc-update add logbookd boot<br />
service logbookd start<br />
<br />
After the next reboot, you may want to review previous log files in <code>/var/log</code>, which will remain unused and stale. Only the sqlite database should remain relevant.<br />
<br />
= See also =<br />
<br />
* [https://blog.brixit.nl/looking-closer-at-the-syslog/ Looking closer at the syslog]: an introductory article to syslog and logbookd.</div>WhyNotHugohttps://wiki.alpinelinux.org/wiki/EmacsEmacs2024-02-23T23:50:15Z<p>Quq: create dir file for info</p>
<hr />
<div>= Empty Info directory node =<br />
<br />
Emacs uses the texinfo documenting system, but the docs are shipped in a separate package in Alpine Linux. You need to install<br />
<br />
apk add texinfo emacs-docs<br />
<br />
Then generate the [https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Directory-File.html dir] index file for Info documenting system.<br />
<br />
# run as root<br />
find /usr/share/info/ -name '*.info*' -print0 | xargs -0I{} install-info {} /usr/share/info/dir</div>Quqhttps://wiki.alpinelinux.org/wiki/Raspberry_Pi_-_Upgrade_kernel_from_reposRaspberry Pi - Upgrade kernel from repos2024-01-25T12:41:26Z<p>Krystianch: Remove todo</p>
<hr />
<div>In diskless setups the kernel upgrade is not part of the regular upgrade process.<br />
To do that, one can [[Upgrading_Alpine#Update_to_latest_kernel_on_armhf_(eg._Raspberry_Pi_0_or_1)|get the new kernel from the latest release tarball]].<br />
<br />
However, if you need a newer kernel that is available in the repositories but is not yet part of a release, you might consider using the {{ic|update-kernel}} script.<br />
The catch is, on a Raspberry Pi 1B+, 512M of RAM is not enough to successfully run it.<br />
Also, the script doesn't work in diskless mode because of the read-only modloop mount.<br />
There is a workaround, though.<br />
<br />
1. Generate boot files, including the new kernel in sys mode.<br />
<br />
2. Transfer boot files to the target diskless mode microSD card.<br />
<br />
== Generate boot files ==<br />
<br />
Grab a fresh microSD card and install Alpine Linux on it.<br />
Boot it on a Raspberry Pi, install the system in sys mode by running {{ic|setup-disks}} and reboot.<br />
Log in as root, then run update-kernel as follows.<br />
This will take a while.<br />
<br />
{{Cmd|# mkdir /root/tmp<br />
mkdir /root/boot<br />
TMPDIR{{=}}/root/tmp update-kernel -a armhf -f rpi -M /root/boot}}<br />
<br />
All files necessary to boot the newest kernel available in repos are now in {{path|/root/boot}}.<br />
<br />
== Transfer boot files ==<br />
<br />
Copy all files from {{path|/root/boot}} to the target microSD card's root.<br />
The Pi should be able to boot from this card and the kernel should now be upgraded.<br />
<br />
[[Category:Raspberry]]</div>Krystianchhttps://wiki.alpinelinux.org/wiki/TwmTwm2024-01-14T22:47:25Z<p>Zcrayfish: Add customization ideas.</p>
<hr />
<div>{{DISPLAYTITLE:twm}}<br />
[[File:VirtualBox Alpine with twm.png|thumb|alt=A depiction of Alpine Linux interface with twm window manager|A depiction of Alpine Linux interface with twm window manager]]<br />
<br />
twm (Tab Window Manager) is the standard window manager for the X Window System since version X11R4.<br />
<br />
== Prerequisites ==<br />
* [[Installation|Install]] Alpine Linux<br />
* [[Setting_up_a_new_user#Creating_a_new_user|Create a user account]] (optional but recommended)<br />
* [[Repositories#Enabling_the_community_repository|Enable the Community repository]]<br />
* [[Alpine_setup_scripts#setup-xorg-base|Install Xorg]]<br />
{{clear}}<br />
= Installation =<br />
In home directory create a file named ".xinitrc":<br />
{{Cmd|vi ~/.xinitrc}}<br />
Or, if you prefer nano text editor<br />
{{Cmd|nano ~/.xinitrc}}<br />
<br />
Write to file:<br />
{{cat|~/.xinitrc|exec twm}}<br />
Save the file.<br />
<br />
Install twm<br />
{{Cmd|# apk add {{pkg|twm|arch=}}}}<br />
<br />
If doing no further configuration, you will also need xterm to open apps:<br />
{{Cmd|# apk add {{pkg|xterm|arch=}}}}<br />
<br />
Start the X window manager<br />
{{Cmd|startx}}<br />
<br />
You will be greeted with a black screen. Hold left mouse button and select "XTerm". Type in a program name to launch it.<br />
<br />
= Keyboard layout =<br />
The keyboard layout defaults to US qwerty. If you use an alternative layout (e.g. Colemak) you can install setxkbmap:<br />
{{Cmd|# apk add {{pkg|setxkbmap|arch=}}}}<br />
<br />
Then switch to another layout (example for colemak):<br />
{{Cmd|setxkbmap us -variant colemak}}<br />
<br />
= Customizing twm =<br />
twm can be extensively modified. The default system-wide default configuration file for twm is {{path|/usr/share/X11/twm/system.twmrc}} and the per-user configuration is {{path|~/.twmrc}}. The user file completely overrides the system, so it's recommended to start modifications by copying the system-wide file to the per-user file.<br><br />
Some very basic customizations which many users do are below:<br />
<br />
==Add basic alt+tab support==<br />
The following can be added to the config enable basic alt+tab support for rapidly switching windows to the front:<br />
<pre>"Tab" = m : root|window|frame|title : f.circleup</pre><br />
<br />
==Add maximize, and close buttons==<br />
First install some bitmaps for the buttons:<br />
{{cmd|# apk add {{pkg|xbitmaps|arch=}}}}<br />
Then edit the config file and add the following:<br />
<pre><br />
Function "maximize" { f.fullzoom f.focus f.nop }<br />
RightTitleButton "icon"=f.function "maximize"<br />
RightTitleButton "xlogo11"=f.delete<br />
</pre><br />
[[Category:Desktop]]<br />
[[Category:Window Managers]]</div>Carbon-starlighthttps://wiki.alpinelinux.org/wiki/Chroot/start-chrootChroot/start-chroot2024-01-13T18:05:34Z<p>Zcrayfish: Move script from Chroot; removed grsec stuff.</p>
<hr />
<div>#!/bin/sh -e<br />
<br />
if [ 0 -ne `id -u` ]; then<br />
echo "This script needs root access" >&2<br />
exit 1<br />
fi<br />
<br />
if ! [ -d "$1" ] || [ x-h = x"$*" ] || [ x--help = x"$*" ]; then<br />
echo "Usage: ${0##*/} <chroot_directory>" >&2<br />
exit 1<br />
fi<br />
<br />
cd "$1"<br />
if ! [ -d ./etc ]; then<br />
echo "No etc directory inside $1" >&2<br />
exit 1<br />
fi<br />
shift<br />
<br />
MOUNTED=<br />
umount_all() {<br />
case $MOUNTED in<br />
shm\ *) if [ -L ./dev/shm ]; then<br />
umount ./`readlink ./dev/shm`<br />
else<br />
umount ./dev/shm<br />
fi<br />
MOUNTED=${MOUNTED#shm };;<br />
esac<br />
case $MOUNTED in<br />
run\ *) umount ./run<br />
MOUNTED=${MOUNTED#run };;<br />
esac<br />
case $MOUNTED in<br />
tmp\ *) umount ./tmp<br />
MOUNTED=${MOUNTED#tmp };;<br />
esac<br />
case $MOUNTED in<br />
proc\ *) umount ./proc<br />
MOUNTED=${MOUNTED#proc };;<br />
esac<br />
case $MOUNTED in<br />
sys\ *) umount ./sys<br />
MOUNTED=${MOUNTED#sys };;<br />
esac<br />
case $MOUNTED in<br />
pts\ *) umount ./dev/pts<br />
MOUNTED=${MOUNTED#pts };;<br />
esac<br />
case $MOUNTED in<br />
dev\ *) umount ./dev<br />
MOUNTED=${MOUNTED#dev };;<br />
esac<br />
}<br />
trap 'umount_all' EXIT<br />
<br />
#mkdir -p ./etc ./dev/pts ./sys ./proc ./tmp ./run ./boot ./root<br />
<br />
cp -iL /etc/resolv.conf ./etc/ || true # if ^C, will cancel script<br />
<br />
mount --bind /dev ./dev<br />
MOUNTED="dev $MOUNTED"<br />
<br />
mount -t devpts devpts ./dev/pts -o nosuid,noexec<br />
MOUNTED="pts $MOUNTED"<br />
<br />
mount -t sysfs sys ./sys -o nosuid,nodev,noexec,ro<br />
MOUNTED="sys $MOUNTED"<br />
<br />
mount -t proc proc ./proc -o nosuid,nodev,noexec<br />
MOUNTED="proc $MOUNTED"<br />
<br />
mount -t tmpfs tmp ./tmp -o mode=1777,nosuid,nodev,strictatime<br />
MOUNTED="tmp $MOUNTED"<br />
mount -t tmpfs run ./run -o mode=0755,nosuid,nodev<br />
MOUNTED="run $MOUNTED"<br />
if [ -L ./dev/shm ]; then<br />
mkdir -p ./`readlink ./dev/shm`<br />
mount -t tmpfs shm ./`readlink ./dev/shm` -o mode=1777,nosuid,nodev<br />
else<br />
#mkdir -p ./dev/shm<br />
mount -t tmpfs shm ./dev/shm -o mode=1777,nosuid,nodev<br />
fi<br />
MOUNTED="shm $MOUNTED"<br />
<br />
case $1 in<br />
-l) shift;;<br />
-l*) one=${1#-l}; shift; set -- -"$one" "$@";;<br />
esac<br />
chroot . /usr/bin/env -i SHELL=/bin/sh HOME=/root TERM="$TERM" \<br />
PATH=/usr/sbin:/usr/bin:/sbin:/bin PS1='chroot # ' /bin/sh -l "$@"<br />
<br />
# FIXME<br />
# are USER and LOGNAME set automatically?<br />
# perhaps: source /etc/profile && export PS1="chroot $PS1"</div>Zcrayfishhttps://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.20.0Release Notes for Alpine 3.20.02024-01-05T23:33:15Z<p>Ikke: Update cause of issues</p>
<hr />
<div>== Base System ==<br />
<br />
=== grub 2.12 ===<br />
<br />
When upgrading existing installations using grub on UEFI systems, make sure to update the installed bootloader before rebooting, otherwise your machine might not boot.<br />
<br />
The problem is that grub added new configuration that executes <code>fwsetup --is-supported</code>. The problem is that grub 2.06 does not supported the <code>--is-supported<code> argument yet, causing grub to unconditionally try to reboot into firmware.<br />
<br />
Here is an example assuming the default setup. Don't blindly copy this examples but verify what's applicable to your system.<br />
<br />
==== EFI ====<br />
<br />
{{Cmd|<br />
# grub-install --target{{=}}<var>$target</var> --efi-directory{{=}}<var>$efi_directory</var> \<br />
--bootloader-id{{=}}alpine --boot-directory{{=}}/boot --no-nvram<br />
# install -D <var>$efi_directory</var>/EFI/alpine/grub<var>$fwa</var>.efi <var>$efi_directory</var>/EFI/boot/boot<var>$fwa</var>.efi<br />
<br />
}}<br />
<br />
; target : The relevant [https://gitlab.alpinelinux.org/alpine/alpine-conf/-/blob/master/setup-disk.in#L320-324 target] for your system<br />
; efi_directory : Either {{Path|/boot/efi}} or {{Path|/boot}}. Run <code>awk '$2 ~ /boot/ && $3 ~ /fat|msdos/ { print $2 }' /proc/mounts</code> to confirm.<br />
; fwa : The respective [https://gitlab.alpinelinux.org/alpine/alpine-conf/-/blob/master/setup-disk.in#L320-324 firmware architecture] for your system<br />
<br />
==== Short-term work-around ====<br />
<br />
A short-term work-around to get the system bootable again is to restore the backup configuration:<br />
<br />
{{Cmd|cp /boot/grub/grub.cfg.back /boot/grub.cfg }}<br />
<br />
This should allow you to boot the system again to fix it permanently. This will be reverted again when either grub or the kernel is updated again.<br />
<br />
This will only work if <code>update-grub</code> has not been executed any more since the upgrade to grub 2.12.</div>Ikkehttps://wiki.alpinelinux.org/wiki/Kexec/kexec-execKexec/kexec-exec2024-01-02T19:06:59Z<p>Zcrayfish: Moved from Kexec</p>
<hr />
<div>#! /sbin/openrc-run<br />
description="kexec for faster reboot"<br />
depend() {<br />
after killprocs savecache mount-ro<br />
}<br />
start() {<br />
ebegin "kexec-exec: Using kexec for faster reboot" <br />
kexec -e<br />
ewend $? "kexec-exec No kernel loaded."<br />
return 0<br />
}</div>Zcrayfishhttps://wiki.alpinelinux.org/wiki/Kexec/kexec-loadKexec/kexec-load2024-01-02T18:55:55Z<p>Zcrayfish: typo</p>
<hr />
<div>#!/sbin/openrc-run<br />
description="kexec for faster reboot"<br />
# Define defaults<br />
: "${BOOTPART:=/boot}"<br />
: "${KERNEL:=vmlinuz-$(uname -r | awk -F \- '{print $NF }')}"<br />
: "${INITRD:=initramfs-$(uname -r | awk -F \- '{print $NF}')}"<br />
<br />
depend() {<br />
need localmount<br />
}<br />
<br />
start() {<br />
:<br />
}<br />
<br />
stop() {<br />
if ! yesno ${RC_GOINGDOWN}; then<br />
einfo "kexec-load: Not rebooting or powering off; not loading kernel"<br />
exit<br />
fi<br />
ebegin "kexec-load: loading kernel for faster reboot"<br />
kexec -l "${BOOTPART}/${KERNEL}" \<br />
--initrd "${BOOTPART}/${INITRD}" \<br />
--reuse-cmdline<br />
ewend $? Failed.<br />
}</div>Zcrayfish