#!/bin/sh

HOST=http://ppa.linuxfactory.or.kr/installer/pxeoem/arm64/focal

# Setup the firstboot script
wget ${HOST}/firstboot/firstboot-desktop.sh -O /root/firstboot.sh
wget ${HOST}/firstboot/firstboot.service -P /lib/systemd/system
chmod +x /root/firstboot.sh
systemctl enable firstboot.service

# Change background image
sed -i "s|/usr/share/backgrounds/warty-final-ubuntu.png|/usr/share/backgrounds/joshua-coleman-something-yellow.jpg|g" /usr/share/glib-2.0/schemas/10_ubuntu-settings.gschema.override

# Fix to prevent unexpected screen issue when ARM Mali Bifrost wayland driver is used.
if dpkg-query -W mali-bifrost-dkms >/dev/null; then
	fdtput -d /boot/dtb /soc/gpu@ffe40000 dma-coherent
fi

exit 0
