浏览代码

fix EFI check

Noah Vogt 2 年之前
父节点
当前提交
2826f3293d
共有 3 个文件被更改,包括 6 次插入4 次删除
  1. 2 0
      .gitignore
  2. 3 3
      arch.sh
  3. 1 1
      chroot.sh

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+comp
+swapsize

+ 3 - 3
arch.sh

@@ -21,7 +21,7 @@ dialog --defaultno --title "Time Zone select" --yesno "Do you want use the defau
 
 dialog --no-cancel --inputbox "Enter swapsize in gb (only type in numbers)." 10 60 2>swapsize
 
-EFI=$(ls /sys/firmware/efi/efivars)
+ls /sys/firmware/efi/efivars && EFI=yes
 SIZE=$(cat swapsize)
 DRIVE=$(cat drive)
 PVALUE=$(echo "${DRIVE}" | grep "^nvme" | sed 's/.*[0-9]/p/')
@@ -31,8 +31,8 @@ timedatectl set-ntp true
 if [ "$EFI" = "yes" ]; then
     SWAP_LETTER="2"
     ROOT_LETTER="3"
-    kat <<EOF | fdisk -W always /dev/"${DRIVE}"
-o
+    cat <<EOF | fdisk -W always /dev/"${DRIVE}"
+g
 n
 p
 

+ 1 - 1
chroot.sh

@@ -21,7 +21,7 @@ locale-gen
 pacman --noconfirm --needed -S networkmanager
 systemctl enable NetworkManager
 
-EFI=$(ls /sys/firmware/efi/efivars)
+ls /sys/firmware/efi/efivars && EFI=yes
 
 if [ "$EFI" = "yes" ]; then
     SWAP_LETTER="2"