post_upgrade() {
  mkdir -p "/etc/systemd/networkd.conf.d"
  ln -srf --target-directory=/etc/systemd/networkd.conf.d ../network/networkd.conf
  # Old script has set these as ignore, restore this to normal:
  if [ -f "/etc/pacman.conf" ]; then
    sed -i -e '/^IgnorePkg/s/bpir-atf-git//g' -e '/^IgnorePkg/s/bpir-uboot-git//g' /etc/pacman.conf
  fi
}

post_install() {
  systemctl disable setmac.service
  systemctl enable  setmac.service
  mkdir -p "/etc/systemd/networkd.conf.d"
  if [ ! -L "/etc/systemd/networkd.conf.d/networkd.conf" ]; then
    ln -srT ../network/networkd.conf /etc/systemd/networkd.conf.d/networkd.conf
  fi
}

pre_remove() {
  systemctl disable setmac.service
  rm -vf  /boot/dtbos/*-fixed.dtb
}
