From 3cb3bfc2fe070a6cda98bd2a0b63fe585fe600c4 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Thu, 10 Jan 2019 21:48:25 +0100 Subject: [PATCH 1/4] Add autopart support of nvme disk --- archfi | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/archfi b/archfi index 0c5c039..bfdd6f3 100644 --- a/archfi +++ b/archfi @@ -243,9 +243,15 @@ diskpartautodos(){ sleep 1 echo "" pressanykey - bootdev=$device"1" - swapdev=$device"2" - rootdev=$device"3" + if [ "${device::8}" == "/dev/nvm" ]; then + bootdev=$device"p1" + swapdev=$device"p2" + rootdev=$device"p3" + else + bootdev=$device"1" + swapdev=$device"2" + rootdev=$device"3" + fi efimode="0" fi fi @@ -277,9 +283,15 @@ diskpartautogpt(){ sgdisk $device -n=4:0:0 echo "" pressanykey - bootdev=$device"2" - swapdev=$device"3" - rootdev=$device"4" + if [ "${device::8}" == "/dev/nvm" ]; then + bootdev=$device"p2" + swapdev=$device"p3" + rootdev=$device"p4" + else + bootdev=$device"2" + swapdev=$device"3" + rootdev=$device"4" + fi efimode="0" fi fi @@ -309,9 +321,15 @@ diskpartautoefi(){ sgdisk $device -n=4:0:0 echo "" pressanykey - bootdev=$device"1" - swapdev=$device"3" - rootdev=$device"4" + if [ "${device::8}" == "/dev/nvm" ]; then + bootdev=$device"p1" + swapdev=$device"p3" + rootdev=$device"p4" + else + bootdev=$device"1" + swapdev=$device"3" + rootdev=$device"4" + fi efimode="1" fi fi @@ -341,9 +359,15 @@ diskpartautoefiusb(){ echo -e "r\nh\n3\nN\n\nY\nN\nw\nY\n" | gdisk $device echo "" pressanykey - bootdev=$device"1" - swapdev= - rootdev=$device"4" + if [ "${device::8}" == "/dev/nvm" ]; then + bootdev=$device"p1" + swapdev= + rootdev=$device"p4" + else + bootdev=$device"1" + swapdev= + rootdev=$device"4" + fi efimode="2" fi fi From 8f6c28fe3bfd5376a890587760c2c782f1eb0fa8 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Thu, 10 Jan 2019 22:24:26 +0100 Subject: [PATCH 2/4] Add nvme module to mkinitcpio.conf if needed --- archfi | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/archfi b/archfi index bfdd6f3..7857b0f 100644 --- a/archfi +++ b/archfi @@ -464,6 +464,13 @@ selectparts(){ msg=$msg"root : "$rootdev"\n" msg=$msg"home : "$homedev"\n\n" if (whiptail --backtitle "$apptitle" --title "$txtselectpartsmenu" --yesno "$msg" 0 0) then + isnvme=0 + if [ "${bootdev::8}" == "/dev/nvm" ]; then + isnvme=1 + fi + if [ "${rootdev::8}" == "/dev/nvm" ]; then + isnvme=1 + fi mountmenu fi } @@ -802,7 +809,10 @@ archmenu(){ options+=("${txtgenerate//%1/crypttab}" "") fi if [ "$luksroot" = "1" ]; then - options+=("${txtgenerate//%1/mkinitcpio.conf}" "(encrypt hooks)") + options+=("${txtgenerate//%1/mkinitcpio.conf-luks}" "(encrypt hooks)") + fi + if [ "$isnvme" = "1" ]; then + options+=("${txtgenerate//%1/mkinitcpio.conf-nvme}" "(nvme module)") fi options+=("${txtedit//%1/fstab}" "($txtoptional)") options+=("${txtedit//%1/crypttab}" "($txtoptional)") @@ -846,22 +856,38 @@ archmenu(){ nextitem="${txtgenerate//%1/crypttab}" else if [ "$luksroot" = "1" ]; then - nextitem="${txtgenerate//%1/mkinitcpio.conf}" + nextitem="${txtgenerate//%1/mkinitcpio.conf-luks}" else - nextitem="$txtbootloader" + if [ "$isnvme" = "1" ]; then + nextitem="${txtgenerate//%1/mkinitcpio.conf-nvme}" + else + nextitem="$txtbootloader" + fi fi fi ;; "${txtgenerate//%1/crypttab}") archgencrypttab if [ "$luksroot" = "1" ]; then - nextitem="${txtgenerate//%1/mkinitcpio.conf}" + nextitem="${txtgenerate//%1/mkinitcpio.conf-luks}" + else + if [ "$isnvme" = "1" ]; then + nextitem="${txtgenerate//%1/mkinitcpio.conf-nvme}" + else + nextitem="$txtbootloader" + fi + fi + ;; + "${txtgenerate//%1/mkinitcpio.conf-luks}") + archgenmkinitcpioluks + if [ "$isnvme" = "1" ]; then + nextitem="${txtgenerate//%1/mkinitcpio.conf-nvme}" else nextitem="$txtbootloader" fi ;; - "${txtgenerate//%1/mkinitcpio.conf}") - archgenmkinitcpio + "${txtgenerate//%1/mkinitcpio.conf-nvme}") + archgenmkinitcpionvme nextitem="$txtbootloader" ;; "${txtedit//%1/fstab}") @@ -1101,13 +1127,20 @@ archgencrypttab(){ pressanykey } -archgenmkinitcpio(){ +archgenmkinitcpioluks(){ clear echo "sed -i \"s/block filesystems/block encrypt filesystems/g\" /mnt/etc/mkinitcpio.conf" sed -i "s/block filesystems/block encrypt filesystems/g" /mnt/etc/mkinitcpio.conf archchroot genmkinitcpio pressanykey } +archgenmkinitcpionvme(){ + clear + echo "sed -i \"s/MODULES=()/MODULES=(nvme)/g\" /mnt/etc/mkinitcpio.conf" + sed -i "s/MODULES=()/MODULES=(nvme)/g" /mnt/etc/mkinitcpio.conf + archchroot genmkinitcpio + pressanykey +} archeditmkinitcpio(){ $EDITOR /mnt/etc/mkinitcpio.conf From 4b1bab46e5b5c5437981ac14058b205a78345007 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Thu, 10 Jan 2019 22:47:29 +0100 Subject: [PATCH 3/4] syslinux: add nvme support --- archfi | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/archfi b/archfi index 7857b0f..32ec7fd 100644 --- a/archfi +++ b/archfi @@ -1381,9 +1381,16 @@ archsyslinuxinstall(){ additionalpkg=$additionalpkg"efibootmgr " fi - if [ "$(parted ${realrootdev::8} print|grep gpt)" != "" ]; then - echo "$txtsyslinuxaddgptfdisk" - additionalpkg=$additionalpkg"gptfdisk " + if [ "$isnvme" = "1" ]; then + if [ "$(parted ${realrootdev::(-2)} print|grep gpt)" != "" ]; then + echo "$txtsyslinuxaddgptfdisk" + additionalpkg=$additionalpkg"gptfdisk " + fi + else + if [ "$(parted ${realrootdev::8} print|grep gpt)" != "" ]; then + echo "$txtsyslinuxaddgptfdisk" + additionalpkg=$additionalpkg"gptfdisk " + fi fi if [ "$bootdev" != "" ]; then @@ -1428,9 +1435,14 @@ archsyslinuxinstallbootloaderchroot(){ archsyslinuxinstallbootloaderefichroot(){ if [ ! "$1" = "none" ]; then echo "cp -r /usr/lib/syslinux/efi64/* /boot/syslinux" - echo "efibootmgr --create --disk ${1::8} --part ${1:(-1)} --loader /syslinux/syslinux.efi --label "Syslinux" --verbose" cp -r /usr/lib/syslinux/efi64/* /boot/syslinux - efibootmgr --create --disk ${1::8} --part ${1:(-1)} --loader /syslinux/syslinux.efi --label "Syslinux" --verbose + if [ "${1::8}" == "/dev/nvm" ]; then + echo "efibootmgr --create --disk ${1::(-2)} --part ${1:(-1)} --loader /syslinux/syslinux.efi --label "Syslinux" --verbose" + efibootmgr --create --disk ${1::(-2)} --part ${1:(-1)} --loader /syslinux/syslinux.efi --label "Syslinux" --verbose + else + echo "efibootmgr --create --disk ${1::8} --part ${1:(-1)} --loader /syslinux/syslinux.efi --label "Syslinux" --verbose" + efibootmgr --create --disk ${1::8} --part ${1:(-1)} --loader /syslinux/syslinux.efi --label "Syslinux" --verbose + fi isvbox=$(lspci | grep "VirtualBox G") if [ "$isvbox" ]; then echo "VirtualBox detected, creating startup.nsh..." From 3308527896a79ae04ec87cc99969bcae9db1ef6f Mon Sep 17 00:00:00 2001 From: MatMoul Date: Thu, 10 Jan 2019 23:04:24 +0100 Subject: [PATCH 4/4] New Release : 2019.01.10.23.04.13 --- archfi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archfi b/archfi index 32ec7fd..3808392 100644 --- a/archfi +++ b/archfi @@ -12,7 +12,7 @@ # referance : https://wiki.archlinux.org/index.php/Installation_guide -apptitle="Arch Linux Fast Install (archfi) - Version: 2019.01.01.02.09.48 (GPLv3)" +apptitle="Arch Linux Fast Install (archfi) - Version: 2019.01.10.23.04.13 (GPLv3)" baseurl=https://raw.githubusercontent.com/MatMoul/archfi/master skipfont="0"