Subscribe via RSS
2Jul/250

Netatalk 4.x on a Raspberry Pi

I have just spent a lot of time trying to compile the Appletalk kernel module for my Asustor Lockerstor 2 running ADM 5.0 and Kernel 6.6.x, but to no avail. Instead, I resorted to side-loading the Netatalk Docker Container onto a raspi which has been serving as a VPN hotspot to allow some Japanese TV time. I wasn't even going to bother until I realised that latest Raspberry Pi OS simply contains the module ready to load:

swh@raspi-jpn:~ $ sudo modprobe configs
swh@raspi-jpn:~ $ zcat /proc/config.gz > .config
swh@raspi-jpn:~ $ cat .config | grep ATALK
CONFIG_ATALK=m

If you're starting fresh, then you'll need to update your apt-get package list....

swh@raspi-jpn:~ $ sudo apt-get update
Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 http://archive.raspberrypi.com/debian bookworm InRelease [55.0 kB]
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:4 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:5 http://archive.raspberrypi.com/debian bookworm/main arm64 Packages [543 kB]
Get:6 http://deb.debian.org/debian bookworm/main arm64 Packages [8,693 kB]
Get:7 http://archive.raspberrypi.com/debian bookworm/main armhf Packages [544 kB]
Get:8 http://deb.debian.org/debian bookworm/main armhf Packages [8,508 kB]
Get:9 http://deb.debian.org/debian bookworm/main Translation-en [6,109 kB]
Get:10 http://deb.debian.org/debian bookworm/contrib arm64 Packages [45.7 kB]
Get:11 http://deb.debian.org/debian bookworm/contrib Translation-en [48.4 kB]
Get:12 http://deb.debian.org/debian bookworm/non-free arm64 Packages [75.8 kB]
Get:13 http://deb.debian.org/debian bookworm/non-free armhf Packages [55.9 kB]
Get:14 http://deb.debian.org/debian bookworm/non-free Translation-en [68.1 kB]
Get:15 http://deb.debian.org/debian bookworm/non-free-firmware arm64 Packages [5,832 B]
Get:16 http://deb.debian.org/debian bookworm/non-free-firmware Translation-en [20.9 kB]
Get:17 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages [264 kB]
Get:18 http://deb.debian.org/debian-security bookworm-security/main armhf Packages [250 kB]
Get:19 http://deb.debian.org/debian-security bookworm-security/main Translation-en [160 kB]
Get:20 http://deb.debian.org/debian bookworm-updates/main arm64 Packages [756 B]
Get:21 http://deb.debian.org/debian bookworm-updates/main armhf Packages [756 B]
Get:22 http://deb.debian.org/debian bookworm-updates/main Translation-en [664 B]
Fetched 25.7 MB in 12s (2,094 kB/s)
Reading package lists... Done
N: Repository 'http://deb.debian.org/debian bookworm InRelease' changed its 'Version' value from '12.10' to '12.11'
swh@raspi-jpn:~ $

And then, following the docker installation instructions, add the docker package repos to the list:

sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/raspbian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/raspbian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

You're now ready to install docker proper:

apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Yada yada... test it!

sudo docker run hello-world

If that worked, then you're now ready to stand up the appletalk server. Make sure you configure a data directory and a timemachine directory somewhere and make them both writeable! The username and password can be adjusted where required... they don't have to match an actual raspi user. Finally, eth0 should be correct, unless you've done something whacky with your ras-pi, such as adding USB ethernet adapters.

Note: I have --rm in the command line which means that the docker container will perish once the container is exited with Ctrl-C. Remove the --rm once you've got the configuration correct and want the container to persist. I always make sure to have --rm at the start, otherwise you get 101 crazy named lingering containers in your catalog.

docker run --rm --network host \
  --env AFP_LOGLEVEL=debug \
  --privileged=true \
  --security-opt apparmor=unconfined \
  --cap-add=ALL \
  --volume "[ADD_DATA_DIRECTORY_HERE]:/mnt/afpshare" \
  --volume "[ADD_TIME_MACHINE_DIRECTORY_HERE]:/mnt/afpbackup" \
  --volume "/var/run/dbus:/var/run/dbus" \
  --env AFP_USER=old_user \
  --env AFP_PASS=password \
  --env AFP_GROUP=afpusers \
  --env TZ=Australia/Melbourne \
  --env ATALKD_INTERFACE=eth0 \
  --env SERVER_NAME=apple-pi \
  --name netatalk netatalk/netatalk:latest

And then it Just Worked(tm)!

Of course, AFP sharing from the Asustor Lockerstor ADM 'just worked' also, but only via TCP. This meant that nothing ever showed in Chooser and one always had to type in the IP address. I really need to get in touch with Asus and see if they'll help me work out why I can't correctly compile the kernel module.

Filed under: Apple Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


*

No trackbacks yet.