post_install() {
  if [ -f /boot/uEnv.ini.pacsave ]; then
  mv /boot/uEnv.ini.pacsave /boot/uEnv.ini
  fi
  if [ -f /boot/uEnv.ini ]; then
  echo "Keeping old uEnv.ini file..."
  else
  echo "dtb_name=/dtbs/amlogic/meson-g12a-radxa-zero.dtb
bootargs=root=LABEL=ROOT_MNJRO rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles" > /boot/uEnv.ini
  fi
}

post_upgrade() {
   if [ -f /boot/uEnv.ini.pacsave ]; then
  mv /boot/uEnv.ini.pacsave /boot/uEnv.ini
  fi
  if [ -f /boot/uEnv.ini ]; then
  echo "Keeping old uEnv.ini file..."
  else
  
  echo "dtb_name=/dtbs/amlogic/meson-g12a-radxa-zero.dtb
bootargs=root=LABEL=ROOT_MNJRO rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles"
  fi
}

post_remove() {
  rm -f boot/uInitrd
  rm -f boot/uImage
}
