From fc132433d4da89c6ebbfd67c7798cae33acf8fd8 Mon Sep 17 00:00:00 2001 From: Michael Picht Date: Sat, 7 Dec 2019 08:30:45 +0100 Subject: [PATCH 01/13] added selection of mirrors by country Signed-off-by: Michael Picht --- archfi | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/archfi b/archfi index 26c0cc0..d65cfc3 100644 --- a/archfi +++ b/archfi @@ -725,6 +725,7 @@ installmenu(){ nextitem=${1} fi options=() + options+=("${txtselectmirrorsbycountry}" "(${txtoptional})") options+=("${txteditmirrorlist}" "(${txtoptional})") options+=("${txtinstallarchlinux}" "pacstrap base linux") options+=("${txtconfigarchlinux}" "") @@ -733,6 +734,10 @@ installmenu(){ 3>&1 1>&2 2>&3) if [ "$?" = "0" ]; then case ${sel} in + "${txtselectmirrorsbycountry}") + selectmirrorsbycountry + nextitem="${txtinstallarchlinux}" + ;; "${txteditmirrorlist}") ${EDITOR} /etc/pacman.d/mirrorlist nextitem="${txtinstallarchlinux}" @@ -752,6 +757,23 @@ installmenu(){ fi } +selectmirrorsbycountry() { + cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup + items=$( sed -n "/^##.*/N; {s/^## \(.*\)\nServer.*/\1/p}" < /etc/pacman.d/mirrorlist.backup | sort -u ) + options=() + IFS_ORIG=$IFS + IFS=$'\n' + for item in ${items}; do + options+=("${item}" "") + done + IFS=$IFS_ORIG + country=$(whiptail --backtitle "${APPTITLE}" --title "${txtselectcountry}" --menu "" 0 0 0 "${options[@]}" 3>&1 1>&2 2>&3) + if [ "$?" != "0" ]; then + return 1 + fi + sed "s/^\(Server .*\)/\#\1/;/^## $country/N; {s/^\(## .*\n\)\#Server \(.*\)/\1Server \2/}" < /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist +} + installbase(){ clear echo "pacstrap /mnt base linux" @@ -1719,6 +1741,7 @@ loadstrings(){ txtarchinstallmenu="Arch Install Menu" + txtselectmirrorsbycountry="Select mirrors by country" txteditmirrorlist="Edit mirrorlist" txtinstallarchlinux="Install Arch Linux" txtconfigarchlinux="Config Arch Linux" From 08f81dfcd0bc4bc018af3681e8e0df089c843e86 Mon Sep 17 00:00:00 2001 From: Michael Picht Date: Sat, 7 Dec 2019 08:32:37 +0100 Subject: [PATCH 02/13] corrected selection of mirrors by country Signed-off-by: Michael Picht --- archfi | 1 + 1 file changed, 1 insertion(+) diff --git a/archfi b/archfi index d65cfc3..69e61a0 100644 --- a/archfi +++ b/archfi @@ -1742,6 +1742,7 @@ loadstrings(){ txtarchinstallmenu="Arch Install Menu" txtselectmirrorsbycountry="Select mirrors by country" + txtselectcountry="Select country" txteditmirrorlist="Edit mirrorlist" txtinstallarchlinux="Install Arch Linux" txtconfigarchlinux="Config Arch Linux" From 870666d3558751bb5d56e7b5ef70655c5dee05fd Mon Sep 17 00:00:00 2001 From: Michael Picht Date: Sun, 8 Dec 2019 06:30:24 +0100 Subject: [PATCH 03/13] corrected selection of mirrors by country Signed-off-by: Michael Picht --- archfi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/archfi b/archfi index 69e61a0..c8a894e 100644 --- a/archfi +++ b/archfi @@ -758,7 +758,9 @@ installmenu(){ } selectmirrorsbycountry() { - cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup + if [[ -f /etc/pacman.d/mirrorlist.backup ]]; then + cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup + fi items=$( sed -n "/^##.*/N; {s/^## \(.*\)\nServer.*/\1/p}" < /etc/pacman.d/mirrorlist.backup | sort -u ) options=() IFS_ORIG=$IFS From 47a734cb2facb7949e70b789efe28bf9adbd3c09 Mon Sep 17 00:00:00 2001 From: Michael Picht Date: Sun, 8 Dec 2019 06:41:04 +0100 Subject: [PATCH 04/13] corrected selection of mirrors by country Signed-off-by: Michael Picht --- archfi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archfi b/archfi index c8a894e..001fa2b 100644 --- a/archfi +++ b/archfi @@ -758,7 +758,7 @@ installmenu(){ } selectmirrorsbycountry() { - if [[ -f /etc/pacman.d/mirrorlist.backup ]]; then + if [[ ! -f /etc/pacman.d/mirrorlist.backup ]]; then cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup fi items=$( sed -n "/^##.*/N; {s/^## \(.*\)\nServer.*/\1/p}" < /etc/pacman.d/mirrorlist.backup | sort -u ) From 3d84309ea35c72b3c20944e1f9c4d4bb4d426179 Mon Sep 17 00:00:00 2001 From: Diego Herculano <42254845+kwelf@users.noreply.github.com> Date: Wed, 11 Dec 2019 18:55:21 -0300 Subject: [PATCH 05/13] Change letters "e" to "ou" (and to or) --- lng/Brazilian | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lng/Brazilian b/lng/Brazilian index 6bcf8dc..ed0a25f 100644 --- a/lng/Brazilian +++ b/lng/Brazilian @@ -44,7 +44,7 @@ txtformatdevices="Formatar Dispositivos" txtformatdevice="Formatar Dispositivo" txtmount="Montar" txtunmount="Desmontar" -txtmountdesc="Instalar e Configurar" +txtmountdesc="Instalar ou Configurar" txtformatdeviceconfirm="Aviso, todos os dados nas partições selecionadas serão apagados ! \nFormatar partições ?" From 390377322d34ec44206ced6b8c243ce34e3a12bd Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sun, 15 Dec 2019 00:04:13 +0100 Subject: [PATCH 06/13] New Release : 2019.12.15.00.04.07 --- archfi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archfi b/archfi index d34a86e..758873c 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.11.02.00.13.01 (GPLv3)" +apptitle="Arch Linux Fast Install (archfi) - Version: 2019.12.15.00.04.07 (GPLv3)" baseurl=https://raw.githubusercontent.com/MatMoul/archfi/master skipfont="0" From bf31f4b350892404a78477076eae53fab433393d Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 11 Jan 2020 02:38:21 +0100 Subject: [PATCH 07/13] Update test args --- archfi | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/archfi b/archfi index 758873c..ba3c364 100644 --- a/archfi +++ b/archfi @@ -1830,14 +1830,18 @@ while (( "$#" )); do --help) echo "archfi" echo "------" - echo "-sf | --skip-font Skip setfont from language files" - echo "-efiX -efi0 : disable EFI, -efi1 efi inst, -efi2 efi hybrid inst" - echo "-t | --test ghusername ghbranch Test language files" + echo "-sf | --skip-font Skip setfont from language files" + echo "-efiX -efi0 : disable EFI, -efi1 efi inst, -efi2 efi hybrid inst" + echo "-t | --test ghusername ghbranch Test archfi script and language" exit 0 ;; -sf | --skip-font) skipfont=1;; - -t | --test) baseurl="https://raw.githubusercontent" - baseurl="${baseurl}.com/""${2}/archfi/${3}";; + -t | --test) + wget -O archfi https://raw.githubusercontent.com/${2}/archfi/${3}/archfi + sh archfi -tt ${2} ${3} + exit 0 + ;; + -tt) baseurl="https://raw.githubusercontent.com/${2}/archfi/${3}";; -efi0) efimode=0;; -efi1) eficomputer=1 From 9d8f9aeeba22827c9399801171244cff8a7d8d1d Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 11 Jan 2020 02:46:39 +0100 Subject: [PATCH 08/13] Update linux-firmware install method --- archfi | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/archfi b/archfi index ba3c364..2cdea97 100644 --- a/archfi +++ b/archfi @@ -727,8 +727,7 @@ installmenu(){ options=() options+=("${txtselectmirrorsbycountry}" "(${txtoptional})") options+=("${txteditmirrorlist}" "(${txtoptional})") - options+=("${txtinstallarchlinux}" "pacstrap base kernel") - options+=("${txtinstallfirmware}" "(${txtoptional}) pacstrap linux-firmware") + options+=("${txtinstallarchlinux}" "pacstrap base kernel firmwares") options+=("${txtconfigarchlinux}" "") sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallmenu}" --menu "" --cancel-button "${txtunmount}" --default-item "${nextitem}" 0 0 0 \ "${options[@]}" \ @@ -745,13 +744,9 @@ installmenu(){ ;; "${txtinstallarchlinux}") if(installbase) then - nextitem="${txtinstallfirmware}" + nextitem="${txtconfigarchlinux}" fi ;; - "${txtinstallfirmware}") - installfirmware - nextitem="${txtconfigarchlinux}" - ;; "${txtconfigarchlinux}") archmenu nextitem="${txtconfigarchlinux}" @@ -798,18 +793,22 @@ installbase(){ else return 1 fi + options=() + options+=("linux-firmware" "(${txtoptional})" on) + sel=$(whiptail --backtitle "${apptitle}" --title "Firmwares" --checklist "" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + if [ ! "$?" = "0" ]; then + return 1 + fi + for itm in $sel; do + pkgs="$pkgs $(echo $itm | sed 's/"//g')" + done echo "pacstrap /mnt ${pkgs}" pacstrap /mnt ${pkgs} pressanykey } -installfirmware(){ - clear - echo "pacstrap /mnt linux-firmware" - pacstrap /mnt linux-firmware - pressanykey -} - unmountdevices(){ clear echo "umount -R /mnt" From 1ebba0d3ccac2a924959cea79b2991b1c33eba6f Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 11 Jan 2020 02:56:14 +0100 Subject: [PATCH 09/13] Bug: Locale more precise --- archfi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/archfi b/archfi index 2cdea97..8d21942 100644 --- a/archfi +++ b/archfi @@ -105,7 +105,7 @@ chooselanguage(){ fi font= if [ "$(cat /etc/locale.gen | grep ""#${locale}"")" != "" ]; then - sed -i "/${locale}/s/^#//g" /etc/locale.gen + sed -i "/#${locale}/s/^#//g" /etc/locale.gen locale-gen fi export LANG=${locale} @@ -1039,8 +1039,8 @@ archsetlocale(){ echo "LANG=${locale}.UTF-8" > /mnt/etc/locale.conf echo "echo \"LC_COLLATE=C\" >> /mnt/etc/locale.conf" echo "LC_COLLATE=C" >> /mnt/etc/locale.conf - echo "sed -i '/"${locale}".UTF-8/s/^#//g' /mnt/etc/locale.gen" - sed -i '/'${locale}'.UTF-8/s/^#//g' /mnt/etc/locale.gen + echo "sed -i '/#${locale}.UTF-8/s/^#//g' /mnt/etc/locale.gen" + sed -i '/#'${locale}'.UTF-8/s/^#//g' /mnt/etc/locale.gen archchroot setlocale pressanykey fi From 0ecab91292ff6c1211c0f9a75518a276f02bbbbc Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 11 Jan 2020 03:10:49 +0100 Subject: [PATCH 10/13] Change ReiserFS menu index --- archfi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/archfi b/archfi index 8d21942..83920b1 100644 --- a/archfi +++ b/archfi @@ -565,13 +565,13 @@ formatswapdevice(){ formatdevice(){ options=() options+=("btrfs" "") - options+=("reiserfs" "") options+=("ext4" "") options+=("ext3" "") options+=("ext2" "") options+=("xfs" "") options+=("f2fs" "") options+=("jfs" "") + options+=("reiserfs" "") if [ ! "${3}" = "noluks" ]; then options+=("luks" "encrypted") fi @@ -599,10 +599,6 @@ formatdevice(){ umount /mnt fi ;; - reiserfs) - echo "mkfs.reiserfs -f ${2}" - mkfs.reiserfs -f ${2} - ;; ext4) echo "mkfs.ext4 ${2}" mkfs.ext4 ${2} @@ -627,6 +623,10 @@ formatdevice(){ echo "mkfs.xfs -f ${2}" mkfs.jfs -f ${2} ;; + reiserfs) + echo "mkfs.reiserfs -f ${2}" + mkfs.reiserfs -f ${2} + ;; luks) echo "${txtcreateluksdevice}" echo "cryptsetup luksFormat ${2}" From b7c2358bb3671ba3b657a06ec28ceb1385672a44 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 11 Jan 2020 03:37:30 +0100 Subject: [PATCH 11/13] Update README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 8f163aa..2bc043c 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,11 @@ Finally, launch the script: Then follow the on-screen instructions to completion. If you require extra help, visit the provided video playlist and follow my example. + +For developpers, you can test your script with this command : + + sh archfi -t {githubusername} {branchname} + +Example : + + sh archfi -t matmoul master From 28630d27bbe0d5f1ce1aef6a3077903fd108daf1 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 11 Jan 2020 03:44:30 +0100 Subject: [PATCH 12/13] Update README --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bc043c..f643f26 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,10 @@ Then follow the on-screen instructions to completion. If you require extra help, visit the provided video playlist and follow my example. -For developpers, you can test your script with this command : + +## For developpers + +You can test your script with this command : sh archfi -t {githubusername} {branchname} From 129f52b4fd9e780c1ec14200268c99211f9ba50b Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 11 Jan 2020 03:53:38 +0100 Subject: [PATCH 13/13] New Release : 2020.01.11.03.53.30 --- archfi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archfi b/archfi index 83920b1..26666aa 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.12.15.00.04.07 (GPLv3)" +apptitle="Arch Linux Fast Install (archfi) - Version: 2020.01.11.03.53.30 (GPLv3)" baseurl=https://raw.githubusercontent.com/MatMoul/archfi/master skipfont="0"