OSDN Git Service

add support for efi systems
authorpaperbenni <paperbenni@gmail.com>
Sun, 10 May 2020 14:38:58 +0000 (16:38 +0200)
committerpaperbenni <paperbenni@gmail.com>
Sun, 10 May 2020 14:38:58 +0000 (16:38 +0200)
bootloader/efi.sh [new file with mode: 0644]
bootloader/install.sh
disk/disk.sh
systeminstall.sh

diff --git a/bootloader/efi.sh b/bootloader/efi.sh
new file mode 100644 (file)
index 0000000..2451e00
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+DISK=$(cat /root/instantARCH/config/disk)
+mkdir /efi
+mount "${DISK}1" /efi
+
+sudo pacman -S efibootmgr grub --noconfirm
+
+grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB
index 153b0c1..7a71f09 100755 (executable)
@@ -1,2 +1,3 @@
 #!/bin/bash
+echo "installing grub for legacy bios"
 grub-install --target=i386-pc "$(cat /root/instantARCH/config/disk)" --root /mnt
index 52a1902..cfab38b 100755 (executable)
@@ -10,7 +10,7 @@ if efibootmgr; then
 ${DISK}1 : start=        4096, size=      614400, type=ef
 ${DISK}2: start=618496, type=83, bootable" | sfdisk "${DISK}"
 
-    mkfs.fat32 -F ${DISK}1
+    mkfs.fat -F32 ${DISK}1
     mkfs.ext4 -F ${DISK}2
 
 else
index bbe2b92..73c283a 100755 (executable)
@@ -31,7 +31,11 @@ chrootscript "depend/depend" &&
     chrootscript "lang/timezone"
 
 # grub: install package, install, generate config
-escript bootloader/install
+if efibootmgr; then
+    chrootscript "bootloader/efi"
+else
+    escript bootloader/install
+fi
 
 chrootscript "user/user" &&
     chrootscript "network/network" &&