From 3d98bf272c00d6b181119e0197f27aa49697efe5 Mon Sep 17 00:00:00 2001 From: pixrobot Date: Tue, 2 Apr 2024 20:50:05 +0100 Subject: [PATCH 1/2] use variables for partition numbers (script doesnt work) --- installer.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/installer.sh b/installer.sh index da5b915..876a878 100755 --- a/installer.sh +++ b/installer.sh @@ -68,37 +68,37 @@ if [[ $? = 0 ]]; then filesystem=$(dialog --menu "Select a filesystem:" 0 0 0 "ext4" "Fast basic filesystem (recommended)" "btrfs" "Great for data recovery and servers" 2>&1 >/dev/tty) if [[ $uefi = true ]]; then if [[ "$filesystem" = "ext4" ]]; then - mkfs.ext4 /dev/${choice}2 | dialog --title "Creating file system..." --programbox 24 80 + mkfs.ext4 /dev/${choice}${part2} | dialog --title "Creating file system..." --programbox 24 80 else - mkfs.btrfs -f /dev/${choice}2 | dialog --title "Creating file system..." --programbox 24 80 + mkfs.btrfs -f /dev/${choice}${part2} | dialog --title "Creating file system..." --programbox 24 80 fi if [[ $? = 1 ]]; then dialog --msgbox "Formatting failed!" 0 0 failinstall fi - mkfs.fat -v -F 32 /dev/${choice}1 | dialog --title "Creating boot partition..." --programbox 24 80 + mkfs.fat -v -F 32 /dev/${choice}${part1} | dialog --title "Creating boot partition..." --programbox 24 80 if [[ $? = 1 ]]; then dialog --msgbox "Formatting failed!" 0 0 failinstall fi - mount /dev/${choice}2 /mnt + mount /dev/${choice}${part2} /mnt if [[ $? = 1 ]]; then dialog --msgbox "Mounting failed!" 0 0 failinstall fi mkdir -p /mnt/boot/efi - sh -c "mount /dev/${choice}1 /mnt/boot/efi" + sh -c "mount /dev/${choice}${part1} /mnt/boot/efi" if [[ $? = 1 ]]; then dialog --msgbox "Mounting ESP failed!" 0 0 failinstall fi else - mkfs.$filesystem /dev/${choice}1 | dialog --title "Creating file system..." --programbox 24 80 + mkfs.$filesystem /dev/${choice}${part1} | dialog --title "Creating file system..." --programbox 24 80 if [[ $? = 1 ]]; then dialog --msgbox "Formatting failed!" 0 0 failinstall fi - mount /dev/${choice}1 /mnt + mount /dev/${choice}${part1} /mnt if [[ $? = 1 ]]; then dialog --msgbox "Mounting failed!" 0 0 failinstall -- 2.39.2 From f5c20d724e5c7de327d5208e2bb7b162a596fcae Mon Sep 17 00:00:00 2001 From: pixrobot Date: Tue, 2 Apr 2024 20:56:19 +0100 Subject: [PATCH 2/2] assign partition variables --- installer.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/installer.sh b/installer.sh index 876a878..baccdca 100755 --- a/installer.sh +++ b/installer.sh @@ -47,6 +47,17 @@ 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) +if [[ ${choice} =~ "nvme" ]]; then + part1="p1" + part2="p2" +elif [[ ${choice} =~ "mmcblk" ]]; then + part1="p1" + part2="p2" +else + part1="1" + part2="2" +fi + if [[ "$(cat /sys/block/${choice}/ro)" = "1" ]]; then dialog --title "Scan disk" --msgbox "You are not able to install evolutionOS on a non-writable disk" 0 0 failinstall -- 2.39.2