create_config() {
  mkdir -p /boot/extlinux
  echo "LABEL Manjaro ARM
KERNEL /Image
FDTDIR /dtbs
APPEND initrd=/initramfs-linux.img root=LABEL=ROOT_MNJRO rw rootwait audit=0 splash plymouth.ignore-serial-consoles" \
    > /boot/extlinux/extlinux.conf
}

post_install() {
  if [ -f /boot/extlinux/extlinux.conf.pacsave ]; then
    mv /boot/extlinux/extlinux.conf.pacsave /boot/extlinux/extlinux.conf
  fi
  if [ -f /boot/extlinux/extlinux.conf ]; then
    echo "Keeping old extlinux.conf file..."
  else
    create_config
  fi
}

post_upgrade() {
  if [ -f /boot/extlinux/extlinux.conf.pacsave ]; then
    mv /boot/extlinux/extlinux.conf.pacsave /boot/extlinux/extlinux.conf
  fi
  if [ -f /boot/extlinux/extlinux.conf ]; then
    echo "Keeping old extlinux.conf file..."
  else
    create_config
  fi
}
