FINAL
This commit is contained in:
parent
7c31233858
commit
92058a9864
21
installer.sh
21
installer.sh
|
@ -41,6 +41,9 @@ else
|
|||
uefi=false
|
||||
fi
|
||||
|
||||
insmod /root/vfat-modules/fat.ko.zst
|
||||
insmod /root/vfat-modules/vfat.ko.zst
|
||||
|
||||
dialog --title "Welcome" --msgbox "Welcome to the EvolutionOS installer! \n\nThis installer is meant to be straightforward, no need for technical skill. \n\nPress enter to select buttons, tab to move between text boxes, and left / right to move between buttons." 0 0
|
||||
choice=$(dialog --menu "Select an installation drive:" 20 60 10 $(create_menu $(parted -l | grep -oE '^Disk /dev/[a-zA-Z0-9]+' | cut -d' ' -f2- | cut -c 6-)) 2>&1 >/dev/tty)
|
||||
|
||||
|
@ -83,7 +86,8 @@ if [[ $? = 0 ]]; then
|
|||
dialog --msgbox "Mounting failed!" 0 0
|
||||
failinstall
|
||||
fi
|
||||
mount /dev/${choice}1 /mnt/boot/efi --mkdir
|
||||
mkdir -p /mnt/boot/efi
|
||||
sh -c "mount /dev/${choice}1 /mnt/boot/efi"
|
||||
if [[ $? = 1 ]]; then
|
||||
dialog --msgbox "Mounting ESP failed!" 0 0
|
||||
failinstall
|
||||
|
@ -129,13 +133,14 @@ while true; do
|
|||
failinstall
|
||||
fi
|
||||
mkdir /mnt/dev /mnt/tmp /mnt/proc /mnt/sys
|
||||
rm -rf /etc/dinit.d/rcboot.sh
|
||||
mv /etc/dinit.d/rcboot-real.sh /etc/dinit.d/rcboot.sh
|
||||
rm -rf /mnt/etc/dinit.d/rcboot.sh
|
||||
rm -rf /mnt/root/vfat-modules
|
||||
mv /mnt/etc/dinit.d/rcboot-real.sh /mnt/etc/dinit.d/rcboot.sh
|
||||
xbps-remove -OoR dialog parted e2fsprogs btrfs-progs xtools-minimal ncurses -r /mnt -y
|
||||
if [[ $uefi = false ]]; then
|
||||
xbps-remove -OoR dosfstools grub-x86_64-efi -y
|
||||
xbps-remove -OoR dosfstools grub-x86_64-efi -r /mnt -y
|
||||
fi
|
||||
rm -rf /mnt/usr/bin/evolution-installer /mnt/usr/bin/genfstab
|
||||
rm -rf /mnt/usr/bin/evolution-installer
|
||||
break
|
||||
else
|
||||
ping -c 1 example.org >/dev/null 2>&1
|
||||
|
@ -175,7 +180,10 @@ xchroot /mnt useradd -m "${username}"
|
|||
echo -e "$userpasswd\n$userpasswd" | xchroot /mnt passwd "${username}"
|
||||
echo $hostname > /mnt/etc/hostname
|
||||
if [[ $uefi = true ]]; then
|
||||
xchroot /mnt grub-install --efi-directory=/boot/efi /dev/${choice}
|
||||
xchroot /mnt grub-install --no-nvram --efi-directory=/boot/efi /dev/${choice}
|
||||
mkdir -p /mnt/boot/efi/EFI/boot/
|
||||
mv /mnt/boot/efi/EFI/void*/grubx64.efi /mnt/boot/efi/EFI/boot/bootx64.efi
|
||||
rm -rf /mnt/boot/efi/EFI/void*
|
||||
else
|
||||
xchroot /mnt grub-install /dev/${choice}
|
||||
fi
|
||||
|
@ -190,7 +198,6 @@ if [[ $? = 1 ]]; then
|
|||
dialog --msgbox "Package configuration failed!" 0 0
|
||||
failinstall
|
||||
fi
|
||||
genfstab -t UUID /mnt > /mnt/etc/fstab
|
||||
dialog --yesno "EvolutionOS has been installed! Would you like to reboot?" 0 0
|
||||
if [[ $? = 1 ]]; then
|
||||
clear
|
||||
|
|
Reference in New Issue