#!/bin/bash echo "INFO: Disabling power management so that the PoS doesn't fall asleep during installation..." && systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target && xset s noblank && xset s off && xset dpms force off && xset -dpms && echo "INFO: Figuring out the /root." && SDCARD_DEVICE_ROOT=$(fdisk -l | grep -i "mmcblk" | grep p4 | awk 'NR==1 {print $1'}) && echo "INFO: Storage device /root: $SDCARD_DEVICE_ROOT" && echo "INFO: Mounting root." && mount $SDCARD_DEVICE_ROOT /mnt && echo "INFO: Mounting proc, dev, sys and run." && mount -t proc none /mnt/proc/ && mount -o bind /dev /mnt/dev/ && mount -o bind /sys /mnt/sys/ && mount -o bind /run /mnt/run/ && echo "INFO: Figuring out the /boot." && SDCARD_DEVICE_BOOT=$(fdisk -l | grep -i "mmcblk" | grep p1 | awk 'NR==1 {print $1'}) && echo "INFO: Storage device /boot: $SDCARD_DEVICE_BOOT" && echo "INFO: Mounting /boot." && mount $SDCARD_DEVICE_BOOT /mnt/boot/ && echo "INFO: Figuring out the /boot/efi." && SDCARD_DEVICE_EFI=$(fdisk -l | grep -i "mmcblk" | grep p2 | awk 'NR==1 {print $1'}) && echo "INFO: Storage device /boot/efi: $SDCARD_DEVICE_EFI" && echo "INFO: Mounting boot." && mount $SDCARD_DEVICE_EFI /mnt/boot/efi/ && echo "INFO: Chrooting." && chroot /mnt