here the part of the initskript that enable the serial console
# Enable serial console in GRUB defaults
echo "GRUB_TERMINAL=\"serial console\"" >> /etc/default/grub
echo "GRUB_SERIAL_COMMAND=\"serial --unit=0 --speed=115200\"" >> /etc/default/grub
sed -i -e "s|panic=10|& console=ttyS0,115200n8|g" /etc/default/grub
# Re-generate GRUB configuration
/usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg