Well, that obsoleted quickly!
I mean the
alarm-bluetooth-raspberrypi package. There’s finally a more or less native support for bluetooth in Arch ARM kernel and libraries, so there’s no need for external packages or weird configurations any more. Here’s how to take it in use:
- Remove the line
dtoverlay=bcmbt (if present) from
/boot/config.txt and add the following line to the same file.
- Make sure that
enable_uart=0 is also in
/boot/cmdline.txt, remove all references to
bluez-utils-compat package with standard
bluez-utils, unless you really need the old utilities. The system does not need them anymore to work.
- Enjoy the working bluetooth!
There seems to be a lot of problems in getting a working bluetooth system on Raspberry Pi’s with Arch Linux, and the solutions are as numerous as the problems.
When I originally installed Arch on my RPi4, I was able to make bluetooth working by some little tweaks to
pi-bluetooth AUR package – or, at least bluetooth keyboard and mouse worked. I didn’t have any bluetooth-enabled audio devices, so I couldn’t test those. That situation continued as such for some half an year until a recent big update including a 5.*.* series kernel. After a reboot, no bluetooth… and kernel and other messages saying they don’t recognize any bluetooth adapters. I still don’t know which update actually broke bluetooth then, I tried downgrading some relevant packages, with no effect.
I found a working solution via a discussion in
pi-bluetooth AUR pages. Instead of
pi-bluetooth, which seems to be outdated, I chose to use
alarm-bluetooth-raspberrypi. Let’s start the installation process (use
su where applicable):
#Next step should remove bluez-utils* too, you don't really need it anymore.
pacman -Rs pi-bluetooth
git clone https://github.com/RoEdAl/alarm-bluetooth-raspberrypi.git
#If you are using RPi4, you need to change "depends=*linux-raspberrypi*"
#to "linux-raspberrypi4" in PKGBUILD. Otherwise, skip next step.
pacman -U bluetooth-raspberrypi-6-2-any.pkg.tar.xz
/boot/config.txt and add a line
and reboot. That’s it!
It is also advisable to install and configure
rpi-eeprom (AUR) to ensure that your EEPROM firmware is up-to-date.
UPDATE June 8th, 2020: I ended up modifying and cleaning up the original PKGBUILD to make an AUR version of See next post.
The main configuration file of Awesome wm is
~/.config/awesome/rc.lua. The default function in
rc.lua on multihead systems is to install the same, maximized,
theme.lua-defined wallpaper to all screens. That is all well, if a) you really want the same wallpaper on all screens, and b) if all of your screens are of the same aspect ratio. But if, for example, your main screen is 16:9 and secondary 4:3, or, like in my case, the secondary screen is in portrait mode, the default function creates a mess.
I didn’t find any example code anywhere, so I had to figure it out for myself. This is the lua code I ended up with:
local function set_d_wallpaper()
themes_path = gears.filesystem.get_configuration_dir() .. "themes/dualhead/"
d_wallpaper = themes_path .. "right.jpg"
gears.wallpaper.maximized(d_wallpaper, 1, true)
d_wallpaper = themes_path .. "left.jpg"
gears.wallpaper.maximized(d_wallpaper, 2, true)
Insert it after the original
rc.lua. After that, edit the two calls to
set_wallpaper() below it to use
set_d_wallpaper() instead. In my case, the secondary screen is to the left of the main screen, so adjust the above code accordingly to suit your layout.
Systemd-using Linuxes like Arch Linux does not generally support the old SysV init functions like rc.local. The support is easy to add, though.
systemctl enable rc-local.service
Original source: Raymii
Posted in Linux
Tagged ArchLinux, Linux
I made this post primarily for my own reference by combining several tutorials in the net and my own observations into one comprehensive tutorial, but I hope this can be for the benefit of other Arch Linux ARM users, too. Of course this tutorial applies as such only on Raspberry Pi models with WiFi: RPi Zero W, RPi 3A+, RPi 4B and so on.
All these instructions must be run as root from a Linux computer with a SD card reader, Windows is useless here. Replace sdX in the following instructions with the device name for the SD card as it appears on your computer.
- Start fdisk to partition the SD card:
- At the fdisk prompt, delete old partitions and create a new one:
- Type o. This will clear out any partitions on the drive.
- Type p to list partitions. There should be no partitions left.
- Type n, then p for primary, 1 for the first partition on the drive, press ENTER to accept the default first sector, then type +100M for the last sector.
- Type t, then c to set the first partition to type W95 FAT32 (LBA).
- Type n, then p for primary, 2 for the second partition on the drive, and then press ENTER twice to accept the default first and last sector.
- Write the partition table and exit by typing w.
- Create and mount the FAT filesystem:
mount /dev/sdX1 boot
- Create and mount the ext4 filesystem:
mount /dev/sdX2 root
- The root filesystem versions for different Raspberry Pi models are:
- ArchLinuxARM-rpi-latest.tar.gz for Zero and old RPis
- ArchLinuxARM-rpi-2-latest.tar.gz for RPi2s
- ArchLinuxARM-rpi-3-latest.tar.gz for RPi3s
- ArchLinuxARM-rpi-4-latest.tar.gz for RPi4s
Download and extract the correct root filesystem:
bsdtar -xpf ArchLinuxARM-rpi-latest.tar.gz -C root
- Move boot files to the first partition:
- Configure the system for WiFi networking by first editing
- Then, replace SSID and PASS with the relevant ones for your WiFi network in the following wpa_supplicant configuration steps:
wpa_passphrase "SSID" "PASS" > root/etc/wpa_supplicant/wpa_supplicant-wlan0.conf
ln -s /usr/lib/systemd/system/wpa_supplicant@.service email@example.com
- Unmount the two partitions:
- Remove the SD card, insert it into the Raspberry Pi, and apply 5V power.
- SSH to the IP address given to the board by your router.
- Login as the default user alarm with the password alarm.
- Then su to root. The default root password is root.
- Initialize the pacman keyring and populate the Arch Linux ARM package signing keys:
pacman-key --populate archlinuxarm
- The default name resolution does not work with WiFi, so to have a working DNS you need to type in the following (Replace the nameserver IP address with one of your preference, if needed):
systemctl stop systemd-resolved
systemctl disable systemd-resolved
echo "nameserver 184.108.40.206" > /etc/resolv.conf
- And finally, update the system:
- If you install later networkmanager or equivalent, remember to undo step 8 before starting it for the first time to prevent networking issues:
systemctl stop firstname.lastname@example.org
systemctl disable email@example.com
- Last, if you are using a RPi 4B, remember to update its firmware at the earliest possible opportunity to prevent issues with other hardware, please see here.
Now you can continue with normal Arch Linux installation guide!
Original sources: Arch Linux ARM / Ladvien