Add efivarfs module, Add check if iso booted in uefi mode

This commit is contained in:
LinuxSquare 2023-12-31 14:34:09 +01:00
parent 74247f7e31
commit d0c11466b4
3 changed files with 37 additions and 2 deletions

View file

@ -2,4 +2,4 @@ iso:
sudo mkteaiso -o ${PWD}/out -p ${PWD}
clean:
rm -f ${PWD}/out/*.iso
sudo rm -f ${PWD}/out/*.iso

View file

@ -106,6 +106,39 @@ function preChecks() {
esac
fi
# Check if booted in UEFI
if [ ! -d /sys/firmware/efi ]; then
dialog --stdout --clear --no-collapse --yes-label "Shutdown" --nolabel "Alpine shell" --yesno "The ISO hasn't been booted in UEFI mode. Please boot the ISO in UEFI to proceed installation" 6 50
case $? in
0)
clear
COUNTER=5
echo "NoveriaOS is shutting down in: "
while [ 1 ]; do
if [ ${COUNTER} -eq 0 ]; then
break
fi
echo -n "${COUNTER}"
COUNTER=$( echo "${COUNTER}-1" | bc )
sleep 0.2
for (( i=0; i<4; i++ )); do
echo -n "."
sleep 0.2
done
done
poweroff
;;
1)
clear
exit 0
;;
255)
clear
exit
;;
esac
fi
introDialogue
}
@ -300,7 +333,7 @@ function installation() {
installationSubtaskTitle "Mount extra mounts for chroot"
mount -t proc /proc "${INSTALLATION_MOUNTPOINT}/proc" || installationFailed
mount -t sysfs /sys "${INSTALLATION_MOUNTPOINT}/sys" || installationFailed
mount -o bind /sys/firmware/efi/efivars "${INSTALLATION_MOUNTPOINT}/sys/firmware/efi/efivars/" || __installationFailed
mount -t efivarfs efivarfs "${INSTALLATION_MOUNTPOINT}/sys/firmware/efi/efivars" || installationFailed
mount -o bind /dev "${INSTALLATION_MOUNTPOINT}/dev" || installationFailed
mount -o bind /run "${INSTALLATION_MOUNTPOINT}/run" || installationFailed
@ -336,6 +369,7 @@ function installation() {
installationSubtaskTitle "Enable btrfs module"
chroot "${INSTALLATION_MOUNTPOINT}" /bin/ash -c "echo 'btrfs' >> /etc/modules"
chroot "${INSTALLATION_MOUNTPOINT}" /bin/ash -c "echo 'efivarfs' >> /etc/modules"
echo ""
echo "┌──────────────────────────────────────────┐"

View file

@ -26,3 +26,4 @@ sed -i 's~/sbin/getty 38400~/sbin/mingetty --autologin root --noclear~' /etc/ini
# Add btrfs module
echo "btrfs" | tee -a /etc/modules
echo "efivarfs" | tee -a /etc/modules