1. install necessary packages
# emerge -avt avahi netatalk
2. config netatalk
# /etc/afp.conf
[Global]
uam list = uams_dhx2.so,uams_dhx.so
log level = default:info
log file = /var/log/afpd.log
hosts allow = 172.16.10.0/24
save password = no
sleep time = 1
[TimeMachine]
path = /home/timemachine
cnid scheme = dbd
ea = auto
time machine = yes
vol size limit = 1000000 # 1TB
3. config avahi
//make netatalk disk available to MacOS time machine
# /etc/avahi/services/afpd.service
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=TimeCapsule</txt-record>
</service>
</service-group>
4. add user for time machine
# useradd -m timemachine
# passwd timemachine
//create lv for dir '/home/timemachine' or any disk partition
# mount /dev/VGNAME/LVNAME /home/timemachine
# chown -R timemachine:timemachine /home/timemachine
5. start services
# /etc/init.d/netatalk start
# /etc/init.d/avahi-daemon start
6. add netatalk & avahi to default runlevel
# cd /etc/init.d
# rc-update add netatalk default
# rc-update add avahi-daemon default