From 7bb766696cfecdc85560fe492b8c6c50bbf594f7 Mon Sep 17 00:00:00 2001 From: Michael Picht Date: Tue, 29 Oct 2019 07:08:50 +0100 Subject: [PATCH 1/3] added disk size to disk selection menues --- archfi | 82 +++++++++++++++++++--------------------------------------- 1 file changed, 26 insertions(+), 56 deletions(-) diff --git a/archfi b/archfi index fc91e5c..26c0cc0 100644 --- a/archfi +++ b/archfi @@ -163,6 +163,25 @@ rebootpc(){ # -------------------------------------------------------- +selectdisk(){ + items=$(lsblk -d -p -n -l -o NAME,SIZE -e 7,11) + options=() + IFS_ORIG=$IFS + IFS=$'\n' + for item in ${items} + do + options+=("${item}" "") + done + IFS=$IFS_ORIG + result=$(whiptail --backtitle "${APPTITLE}" --title "${1}" --menu "" 0 0 0 "${options[@]}" 3>&1 1>&2 2>&3) + if [ "$?" != "0" ] + then + return 1 + fi + echo ${result%%\ *} + return 0 +} + diskpartmenu(){ if [ "${1}" = "" ]; then nextitem="." @@ -217,14 +236,7 @@ diskpartmenu(){ diskpartautodos(){ - items=$(lsblk -d -p -n -l -o NAME -e 7,11) - options=() - for item in ${items}; do - options+=("${item}" "") - done - device=$(whiptail --backtitle "${apptitle}" --title "${txtautoparts} (dos)" --menu "" 0 0 0 \ - "${options[@]}" \ - 3>&1 1>&2 2>&3) + device=$(selectdisk "${txtautoparts} (dos)") if [ "$?" = "0" ]; then if (whiptail --backtitle "${apptitle}" --title "${txtautoparts} (dos)" --yesno "${txtautopartsconfirm//%1/${device}}" --defaultno 0 0) then clear @@ -259,14 +271,7 @@ diskpartautodos(){ } diskpartautogpt(){ - items=$(lsblk -d -p -n -l -o NAME -e 7,11) - options=() - for item in ${items}; do - options+=("${item}" "") - done - device=$(whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt)" --menu "" 0 0 0 \ - "${options[@]}" \ - 3>&1 1>&2 2>&3) + device=$(selectdisk "${txtautoparts} (gpt)") if [ "$?" = "0" ]; then if (whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt)" --yesno "${txtautopartsconfirm//%1/${device}}" --defaultno 0 0) then clear @@ -299,14 +304,7 @@ diskpartautogpt(){ } diskpartautoefi(){ - items=$(lsblk -d -p -n -l -o NAME -e 7,11) - options=() - for item in ${items}; do - options+=("${item}" "") - done - device=$(whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt,efi)" --menu "" 0 0 0 \ - "${options[@]}" \ - 3>&1 1>&2 2>&3) + device=$(selectdisk "${txtautoparts} (gpt,efi)") if [ "$?" = "0" ]; then if (whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt,efi)" --yesno "${txtautopartsconfirm//%1/${device}}" --defaultno 0 0) then clear @@ -337,14 +335,7 @@ diskpartautoefi(){ } diskpartautoefiusb(){ - items=$(lsblk -d -p -n -l -o NAME -e 7,11) - options=() - for item in ${items}; do - options+=("${item}" "") - done - device=$(whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt,efi)" --menu "" 0 0 0 \ - "${options[@]}" \ - 3>&1 1>&2 2>&3) + device=$(selectdisk "${txtautoparts} (gpt,efi)") if [ "$?" = "0" ]; then if (whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt,efi)" --yesno "${txtautopartsconfirm//%1/${device}}" --defaultno 0 0) then clear @@ -375,14 +366,7 @@ diskpartautoefiusb(){ } diskpartcfdisk(){ - items=$(lsblk -d -p -n -l -o NAME -e 7,11) - options=() - for item in ${items}; do - options+=("${item}" "") - done - device=$(whiptail --backtitle "${apptitle}" --title "${txteditparts} (cfdisk)" --menu "" 0 0 0 \ - "${options[@]}" \ - 3>&1 1>&2 2>&3) + device=$( selectdisk "${txteditparts} (cfdisk)" ) if [ "$?" = "0" ]; then clear cfdisk ${device} @@ -390,14 +374,7 @@ diskpartcfdisk(){ } diskpartcgdisk(){ - items=$(lsblk -d -p -n -l -o NAME -e 7,11) - options=() - for item in ${items}; do - options+=("${item}" "") - done - device=$(whiptail --backtitle "${apptitle}" --title "${txteditparts} (cfdisk)" --menu "" 0 0 0 \ - "${options[@]}" \ - 3>&1 1>&2 2>&3) + device=$( selectdisk "${txteditparts} (cgdisk)" ) if [ "$?" = "0" ]; then clear cgdisk ${device} @@ -1270,14 +1247,7 @@ archgrubinstallchroot(){ } archgrubinstallbootloader(){ - items=$(lsblk -d -p -n -l -o NAME -e 7,11) - options=() - for item in ${items}; do - options+=("${item}" "") - done - device=$(whiptail --backtitle "${apptitle}" --title "${txtinstall//%1/bootloader}" --menu "" 0 0 0 \ - "${options[@]}" \ - 3>&1 1>&2 2>&3) + device=$( selectdisk "${txtinstall//%1/bootloader}" ) if [ "$?" = "0" ]; then if [ "${eficomputer}" == "1" ]; then options=() From 5bbb3ab3d2acfb2cfb9e7ccb1b19a3979f16e032 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 2 Nov 2019 00:03:50 +0100 Subject: [PATCH 2/3] Add kernel and firmware selection --- archfi | 36 ++++++++++++++++++++++++++++++++---- lng/English | 1 + lng/French | 1 + 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/archfi b/archfi index 26c0cc0..15b4673 100644 --- a/archfi +++ b/archfi @@ -726,7 +726,8 @@ installmenu(){ fi options=() options+=("${txteditmirrorlist}" "(${txtoptional})") - options+=("${txtinstallarchlinux}" "pacstrap base linux") + options+=("${txtinstallarchlinux}" "pacstrap base kernel") + options+=("${txtinstallfirmware}" "(${txtoptional}) pacstrap linux-firmware") options+=("${txtconfigarchlinux}" "") sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallmenu}" --menu "" --cancel-button "${txtunmount}" --default-item "${nextitem}" 0 0 0 \ "${options[@]}" \ @@ -738,7 +739,12 @@ installmenu(){ nextitem="${txtinstallarchlinux}" ;; "${txtinstallarchlinux}") - installbase + if(installbase) then + nextitem="${txtinstallfirmware}" + fi + ;; + "${txtinstallfirmware}") + installfirmware nextitem="${txtconfigarchlinux}" ;; "${txtconfigarchlinux}") @@ -754,8 +760,29 @@ installmenu(){ installbase(){ clear - echo "pacstrap /mnt base linux" - pacstrap /mnt base linux + pkgs="base" + options=() + options+=("linux" "") + options+=("linux-lts" "") + options+=("linux-zen" "") + options+=("linux-hardened" "") + sel=$(whiptail --backtitle "${apptitle}" --title "Kernel" --menu "" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + if [ "$?" = "0" ]; then + pkgs+=" ${sel}" + else + return 1 + fi + echo "pacstrap /mnt ${pkgs}" + pacstrap /mnt ${pkgs} + pressanykey +} + +installfirmware(){ + clear + echo "pacstrap /mnt linux-firmware" + pacstrap /mnt linux-firmware pressanykey } @@ -1721,6 +1748,7 @@ loadstrings(){ txteditmirrorlist="Edit mirrorlist" txtinstallarchlinux="Install Arch Linux" + txtinstallfirmware="Install Firmware" txtconfigarchlinux="Config Arch Linux" txtsethostname="Set Computer Name" diff --git a/lng/English b/lng/English index 36c084b..8262d77 100644 --- a/lng/English +++ b/lng/English @@ -60,6 +60,7 @@ txtarchinstallmenu="Arch Install Menu" txteditmirrorlist="Edit mirrorlist" txtinstallarchlinux="Install Arch Linux" +txtinstallfirmware="Install Firmware" txtconfigarchlinux="Config Arch Linux" txtsethostname="Set Computer Name" diff --git a/lng/French b/lng/French index fca0614..6b914d7 100644 --- a/lng/French +++ b/lng/French @@ -60,6 +60,7 @@ txtarchinstallmenu="Menu Installation Arch Linux" txteditmirrorlist="Éditer mirrorlist" txtinstallarchlinux="Installer Arch Linux" +txtinstallfirmware="Installer les firmwares" txtconfigarchlinux="Configurer Arch Linux" txtsethostname="Définir le nom de l'ordinateur" From bb41e897dca76e4d210382158b4006ca3d0857e7 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 2 Nov 2019 00:13:09 +0100 Subject: [PATCH 3/3] New Release : 2019.11.02.00.13.01 --- archfi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archfi b/archfi index 15b4673..7bf0b84 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.10.06.21.58.07 (GPLv3)" +apptitle="Arch Linux Fast Install (archfi) - Version: 2019.11.02.00.13.01 (GPLv3)" baseurl=https://raw.githubusercontent.com/MatMoul/archfi/master skipfont="0"