From c64cd3421bbb14e3743eefb48a8376a45bf78da4 Mon Sep 17 00:00:00 2001 From: grm34 Date: Tue, 12 May 2020 21:58:07 +0200 Subject: [PATCH 01/15] Allow user to install additional packages from file --- archboot | 44 ++++++++++++++++++++++++++++++++------------ locale/english | 1 + locale/french | 1 + locale/german | 1 + src/arch/base | 40 ++++++++++++++++++++++++---------------- 5 files changed, 59 insertions(+), 28 deletions(-) diff --git a/archboot b/archboot index 8ff7d0ab..abc774dc 100755 --- a/archboot +++ b/archboot @@ -31,22 +31,27 @@ _help() { echo -e "${BLUE} Arch Linux Installer - A script made with love by ${AUTHOR} -${BOLD}Usage: ${NC}sh ${APPNAME} [options] +${BOLD}Usage: ${NC}sh ${APPNAME} [option] [argument] ${BOLD}Options${NC} -h, --help show this help message -l, --lang set installer language -k, --keyboard set keyboard layout + -f, --file install packages from file - ${BOLD}Language${NC} + ${BOLD}Installer language${NC} -l, --lang english french german (by @At1768) - ${BOLD}Keyboard${NC} - -k, --keyboard keyboard layout - (run loadkeys on start) - (e.q., --keyboard fr) + ${BOLD}Keyboard layout${NC} + -k, --keyboard keyboard code + language code + country code + + ${BOLD}Additional packages${NC} + -f, --file packages_file_list + (AUR packages available) ${BOLD}For more information, see the wiki: \ ${CYAN}${NC}" @@ -198,7 +203,8 @@ ${AUTHOR} ${RED}under ${LICENSE} ${GREEN}>>>${NC}" # HELP AND USAGE # ============================================================================ # Here we manage help and usage to properly describe and run archboot. -# The only options are to select script language and to load keyboard layout. +# The only options are to select script language, to load keyboard layout +# and to allow installation of additional packages from a file. # Then we ensure not running script from repository folder to avoid deletes. # # Usage: sh archboot [options] (e.g., sh archboot -l french -k fr) @@ -211,12 +217,13 @@ for OPT in "${@}"; do "--help") set -- "${@}" "-h"; break;; "--lang") set -- "${@}" "-l";; "--keyboard") set -- "${@}" "-k";; + "--file") set -- "${@}" "-f";; *) set -- "${@}" "${OPT}" esac done ### Option processing -while getopts ':hl:k:' OPTION; do +while getopts ':hl:k:f:' OPTION; do case ${OPTION} in # Help (-h, --help) @@ -226,7 +233,7 @@ while getopts ':hl:k:' OPTION; do l) if [[ ${OPTARG} =~ ^(english$|french$|german$) ]]; then ARCHBOOT_LANG="${OPTARG}" else - echo -e "${RED}Error:${NC} invalid language '${OPTARG}'" + echo -e "${RED}Error:${NC} invalid language '${OPTARG}' !" _help; rm -f old_vars.log; _exit_msg; exit 1 fi;; @@ -235,16 +242,24 @@ while getopts ':hl:k:' OPTION; do if [[ ${STATUS} -ne 1 ]]; then export KEYMAP="${OPTARG}" else - echo -e "${RED}Error:${NC} invalid keyboard '${OPTARG}'" + echo -e "${RED}Error:${NC} invalid keyboard '${OPTARG}' !" + _help; rm -f old_vars.log; _exit_msg; exit 1 + fi;; + + # Packages file list (-f, --file) + f) if [[ -f ${OPTARG} ]]; then + export PACKAGES_FILE="${OPTARG}" + else + echo -e "${RED}Error:${NC} '${OPTARG}' is not a file !" _help; rm -f old_vars.log; _exit_msg; exit 1 fi;; # Missing argument - :) echo -e "${RED}Error:${NC} missing argument for -${OPTARG}" + :) echo -e "${RED}Error:${NC} missing argument for -${OPTARG} !" _help; rm -f old_vars.log; _exit_msg; exit 1;; # Invalid option - \?) echo -e "${RED}Error:${NC} invalid option -${OPTARG}" + \?) echo -e "${RED}Error:${NC} invalid option -${OPTARG} !" _help; rm -f old_vars.log; _exit_msg; exit 1 esac done @@ -435,6 +450,11 @@ _install_display_manager; _enable_user_rights) 2>&1 | tee -a "${INSTALL_LOG}" (_install_AUR_helper) 2>&1 | tee -a "${INSTALL_LOG}" fi + ### Install user personal packages + if [[ ${PACKAGES_FILE} ]]; then + (_install_personal_packages) 2>&1 | tee -a "${INSTALL_LOG}" + fi + ### Clean cache and unused dependencies (src/arch/base) (_clean_dependencies) 2>&1 | tee -a "${INSTALL_LOG}" diff --git a/locale/english b/locale/english index 4b470a89..44a1d338 100644 --- a/locale/english +++ b/locale/english @@ -44,6 +44,7 @@ export MSG_INSTALL_NTFS="Installing NTFS filesystem support" export MSG_BOOT_HOOKS="Adding kernel parameters for bootloader" export MSG_SET_USER="Setting user" export MSG_INSTALL_AUR="Installing AUR Helper" +export MSG_INSTALL_ADDONS="Installing user personal packages" export MSG_CLEAN_CACHE="Cleaning cache and unused dependencies" ### src/arch/bootloader diff --git a/locale/french b/locale/french index c9ca0222..f9f2b78b 100644 --- a/locale/french +++ b/locale/french @@ -44,6 +44,7 @@ export MSG_INSTALL_NTFS="Installation du support pour le système de fichiers NT export MSG_BOOT_HOOKS="Ajout des paramètres kernel pour le bootloader" export MSG_SET_USER="Création de l'utilisateur" export MSG_INSTALL_AUR="Installation d'un AUR Helper" +export MSG_INSTALL_ADDONS="Installation des paquets personnels de l'utilisateur" export MSG_CLEAN_CACHE="Nettoyage du cache et des dépendences inutiles" ### src/arch/bootloader diff --git a/locale/german b/locale/german index 6ffbdb4c..f14f33ef 100644 --- a/locale/german +++ b/locale/german @@ -44,6 +44,7 @@ export MSG_INSTALL_NTFS="Installiere Unterstützung für NTFS Dateisystem" export MSG_BOOT_HOOKS="Füge Kernelparameter für systemd-boot hinzu" export MSG_SET_USER="Erstelle Benutzer" export MSG_INSTALL_AUR="Installiere AUR-Helper" +export MSG_INSTALL_ADDONS="Installing user personal packages" export MSG_CLEAN_CACHE="Bereinige Cache und nicht benötigte Abhängigkeiten" ### src/arch/bootloader diff --git a/src/arch/base b/src/arch/base index e6ba655d..9cfaf989 100644 --- a/src/arch/base +++ b/src/arch/base @@ -7,7 +7,7 @@ # Then we create user account and we allow him to run commands with sudo. # # AUR Helpers (optional) -# +# Installation of additional packages from a file is available as an option. # Last function is used to remove unused packages and to clean pacman cache. # # All steps are described in the official documentation: @@ -121,27 +121,35 @@ EOF _install_AUR_helper() { _info "${MSG_INSTALL_AUR} (${AUR_HELPER,,})" - ### Allow user to run sudo without passwd - sed -i -e \ -"s/${USER_NAME} ALL=(ALL) ALL/${USER_NAME} ALL=(ALL) NOPASSWD: ALL/g" \ -/mnt/etc/sudoers + ### Clone and install AUR Helper + _allow_user_sudoers _chroot "cd /home/${USER_NAME} && sudo -u \ +${USER_NAME} git clone https://aur.archlinux.org/${AUR_HELPER,,}.git && cd \ +${AUR_HELPER,,} && sudo -u ${USER_NAME} makepkg --noconfirm --needed -sic" + + ### Clean AUR Helper sources + rm -rf "/mnt/home/${USER_NAME}/${AUR_HELPER,,}" + echo "-> ${MSG_DONE}" +} - ### Clone AUR Helper from aur.archlinux.org - _chroot "cd /home/${USER_NAME} && \ -sudo -u ${USER_NAME} git clone https://aur.archlinux.org/${AUR_HELPER,,}.git" +_install_personal_packages() { + _info "${MSG_INSTALL_ADDONS}" - ### Install AUR Helper - _chroot "cd /home/${USER_NAME}/${AUR_HELPER,,} && sudo -u ${USER_NAME} \ -makepkg --noconfirm --needed -sic" + if [[ ${AUR_HELPER} ]]; then + _allow_user_sudoers _chroot \ +"${AUR_HELPER,,} --noconfirm --needed -S - < ${PACKAGES_FILE}" - ### Deny user to run sudo without passwd + else + _chroot "pacman --noconfirm --needed -S - < ${PACKAGES_FILE}" + fi + echo "-> ${MSG_DONE}" +} + +_allow_user_sudoers() { sed -i -e \ +"s/${USER_NAME} ALL=(ALL) ALL/${USER_NAME} ALL=(ALL) NOPASSWD: ALL/g" \ +/mnt/etc/sudoers; ${1}; sed -i -e \ "s/${USER_NAME} ALL=(ALL) NOPASSWD: ALL/${USER_NAME} ALL=(ALL) ALL/g" \ /mnt/etc/sudoers - - ### Clean AUR Helper sources - rm -rf "/mnt/home/${USER_NAME}/${AUR_HELPER,,}" - echo "-> ${MSG_DONE}" } _clean_dependencies() { From 436f3bd847d0d6da387b08892aef3bffcfe8d55b Mon Sep 17 00:00:00 2001 From: grm34 Date: Tue, 12 May 2020 22:12:57 +0200 Subject: [PATCH 02/15] Updates options description --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 23e3a567..f05c19e7 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ The only thing you need is one USB bootable device of [Arch Linux](https://mir.a |:------ |:-------- |:----------- |:------- | |_`-l`_, _`--lang`_|`language`|set installer language|_`sh archboot -l french`_| |_`-k`_, _`--keyboard`_|`keyboard`|run loadkeys on start|_`sh archboot -k azerty`_| +|_`-f`_, _`--file`_|`file.txt`|install packages from file|_`sh archboot -f file.txt`_| |_`-h`_, _`--help`_||show help and usage|_`sh archboot --help`_| * > _`--lang` sets only installer language (archboot supports all [languages](https://github.com/grm34/archboot/wiki/Language-code) available in Arch Linux)._ From e0851f4711823f0847dde1330184658585db9e03 Mon Sep 17 00:00:00 2001 From: grm34 Date: Tue, 12 May 2020 22:39:20 +0200 Subject: [PATCH 03/15] Updates options error messages --- archboot | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/archboot b/archboot index abc774dc..bdc2579c 100755 --- a/archboot +++ b/archboot @@ -233,7 +233,7 @@ while getopts ':hl:k:f:' OPTION; do l) if [[ ${OPTARG} =~ ^(english$|french$|german$) ]]; then ARCHBOOT_LANG="${OPTARG}" else - echo -e "${RED}Error:${NC} invalid language '${OPTARG}' !" + echo -e "${RED}Error:${NC} invalid language \"${OPTARG}\"" _help; rm -f old_vars.log; _exit_msg; exit 1 fi;; @@ -242,7 +242,7 @@ while getopts ':hl:k:f:' OPTION; do if [[ ${STATUS} -ne 1 ]]; then export KEYMAP="${OPTARG}" else - echo -e "${RED}Error:${NC} invalid keyboard '${OPTARG}' !" + echo -e "${RED}Error:${NC} invalid keyboard \"${OPTARG}\"" _help; rm -f old_vars.log; _exit_msg; exit 1 fi;; @@ -250,16 +250,16 @@ while getopts ':hl:k:f:' OPTION; do f) if [[ -f ${OPTARG} ]]; then export PACKAGES_FILE="${OPTARG}" else - echo -e "${RED}Error:${NC} '${OPTARG}' is not a file !" + echo -e "${RED}Error:${NC} invalid file \"${OPTARG}\"" _help; rm -f old_vars.log; _exit_msg; exit 1 fi;; # Missing argument - :) echo -e "${RED}Error:${NC} missing argument for -${OPTARG} !" + :) echo -e "${RED}Error:${NC} missing argument for \"-${OPTARG}\"" _help; rm -f old_vars.log; _exit_msg; exit 1;; # Invalid option - \?) echo -e "${RED}Error:${NC} invalid option -${OPTARG} !" + \?) echo -e "${RED}Error:${NC} invalid option \"-${OPTARG}\"" _help; rm -f old_vars.log; _exit_msg; exit 1 esac done From 614e129b8a2d442a09b4f0ed825820713d4fee4d Mon Sep 17 00:00:00 2001 From: grm34 Date: Tue, 12 May 2020 22:42:37 +0200 Subject: [PATCH 04/15] Updates help and usage contributors --- archboot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archboot b/archboot index bdc2579c..32813574 100755 --- a/archboot +++ b/archboot @@ -40,8 +40,8 @@ ${BOLD}Usage: ${NC}sh ${APPNAME} [option] [argument] -f, --file install packages from file ${BOLD}Installer language${NC} - -l, --lang english - french + -l, --lang english (by @grm34) + french (by @grm34) german (by @At1768) ${BOLD}Keyboard layout${NC} From e70b6afc37bc697d41ee74f9dfb67522e891c167 Mon Sep 17 00:00:00 2001 From: grm34 Date: Tue, 12 May 2020 22:44:06 +0200 Subject: [PATCH 05/15] Updates help and usage layout --- archboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archboot b/archboot index 32813574..16b58b63 100755 --- a/archboot +++ b/archboot @@ -47,7 +47,7 @@ ${BOLD}Usage: ${NC}sh ${APPNAME} [option] [argument] ${BOLD}Keyboard layout${NC} -k, --keyboard keyboard code language code - country code + country code ${BOLD}Additional packages${NC} -f, --file packages_file_list From 7fc01b4846e16c02815f76e8cdb0c35d1a777839 Mon Sep 17 00:00:00 2001 From: grm34 Date: Tue, 12 May 2020 22:47:09 +0200 Subject: [PATCH 06/15] Updates language trad authors --- archboot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archboot b/archboot index 16b58b63..fb7c82bb 100755 --- a/archboot +++ b/archboot @@ -40,8 +40,8 @@ ${BOLD}Usage: ${NC}sh ${APPNAME} [option] [argument] -f, --file install packages from file ${BOLD}Installer language${NC} - -l, --lang english (by @grm34) - french (by @grm34) + -l, --lang english (by @${AUTHOR}) + french (by @${AUTHOR}) german (by @At1768) ${BOLD}Keyboard layout${NC} From 06b6bca401b4847997fc56373532bb85744f3195 Mon Sep 17 00:00:00 2001 From: grm34 Date: Tue, 12 May 2020 22:53:08 +0200 Subject: [PATCH 07/15] Updates project stats --- STATS.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/STATS.md b/STATS.md index 78f4a523..256ac23f 100644 --- a/STATS.md +++ b/STATS.md @@ -2,10 +2,10 @@ File|blank|comment|code :-------|-------:|-------:|-------: -archboot|82|121|284 +archboot|85|124|298 src/arch/partitioning|86|87|230 src/arch/user|48|53|153 -src/arch/base|30|39|94 +src/arch/base|31|36|104 src/arch/display|23|29|66 src/arch/bootloader|23|25|57 src/arch/gpu_driver|20|22|52 @@ -14,36 +14,36 @@ src/arch/firmware|14|13|47 src/arch/desktop|11|17|25 src/arch/mounting|9|15|13 --------|--------|--------|-------- -SUM:|368|443|1072 +SUM:|372|443|1096 ### Config files File|blank|comment|code :-------|-------:|-------:|-------: -locale/english|13|15|130 -locale/german|13|15|130 -locale/french|13|15|130 -src/apps/desktop_apps|20|24|24 +locale/english|13|15|131 +locale/german|13|15|131 +locale/french|13|15|131 src/conf/xinitrc|8|8|24 +src/apps/desktop_apps|20|24|24 src/apps/gpu_apps|12|15|17 src/apps/system_apps|12|14|17 src/apps/display_apps|8|10|10 --------|--------|--------|-------- -SUM:|99|116|482 +SUM:|99|116|485 ### Markdown files File|blank|comment|code :-------|-------:|-------:|-------: +README.md|25|0|49 .github/CODE_OF_CONDUCT.md|35|0|49 -README.md|25|0|48 STATS.md|5|0|44 .github/CONTRIBUTING.md|10|0|29 .github/PULL_REQUEST_TEMPLATE.md|9|0|20 .github/ISSUE_TEMPLATE/feature_request.md|2|0|9 -.github/ISSUE_TEMPLATE/update.md|1|0|8 .github/ISSUE_TEMPLATE/bug_report.md|1|0|8 .github/ISSUE_TEMPLATE/question.md|1|0|8 +.github/ISSUE_TEMPLATE/update.md|1|0|8 .github/ISSUE_TEMPLATE/config.yml|0|0|1 --------|--------|--------|-------- -SUM:|89|0|224 +SUM:|89|0|225 From c2c03c16ab2a422b8227749127dcd7d0cad917b9 Mon Sep 17 00:00:00 2001 From: grm34 Date: Wed, 13 May 2020 12:48:05 +0200 Subject: [PATCH 08/15] Fix invalid arch-chroot ident --- src/arch/base | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arch/base b/src/arch/base index 9cfaf989..c0d9e365 100644 --- a/src/arch/base +++ b/src/arch/base @@ -122,9 +122,9 @@ _install_AUR_helper() { _info "${MSG_INSTALL_AUR} (${AUR_HELPER,,})" ### Clone and install AUR Helper - _allow_user_sudoers _chroot "cd /home/${USER_NAME} && sudo -u \ + _allow_user_sudoers "_chroot 'cd /home/${USER_NAME} && sudo -u \ ${USER_NAME} git clone https://aur.archlinux.org/${AUR_HELPER,,}.git && cd \ -${AUR_HELPER,,} && sudo -u ${USER_NAME} makepkg --noconfirm --needed -sic" +${AUR_HELPER,,} && sudo -u ${USER_NAME} makepkg --noconfirm --needed -sic'" ### Clean AUR Helper sources rm -rf "/mnt/home/${USER_NAME}/${AUR_HELPER,,}" @@ -135,8 +135,8 @@ _install_personal_packages() { _info "${MSG_INSTALL_ADDONS}" if [[ ${AUR_HELPER} ]]; then - _allow_user_sudoers _chroot \ -"${AUR_HELPER,,} --noconfirm --needed -S - < ${PACKAGES_FILE}" + _allow_user_sudoers \ +"_chroot '${AUR_HELPER,,} --noconfirm --needed -S - < ${PACKAGES_FILE}'" else _chroot "pacman --noconfirm --needed -S - < ${PACKAGES_FILE}" From 0d425ec966b971078cdb5cf0f1eb49764166f86e Mon Sep 17 00:00:00 2001 From: grm34 Date: Thu, 14 May 2020 12:14:15 +0200 Subject: [PATCH 09/15] Fix UEFI boot index --- src/arch/partitioning | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/partitioning b/src/arch/partitioning index 2309b6a7..61ced4ef 100755 --- a/src/arch/partitioning +++ b/src/arch/partitioning @@ -225,7 +225,7 @@ _default_partitioning_scheme() { elif [[ ${SET_LVM} && ${PART} != "BOOT_PARTITION" ]]; then _info "${MSG_PART_TYPE} ${PART_NAME} ${DRIVE}${ORDER[${INDEX}]}" - printf "t\n%s\n8e00\nw\n" "${INDEX}" | gdisk "${DRIVE}" + printf "t\n1\n8e00\nw\n" | gdisk "${DRIVE}" partprobe "${DRIVE}" && sleep 1 fi From 898dba158ea0fdae6d9450909ee0360a422c7bc6 Mon Sep 17 00:00:00 2001 From: grm34 Date: Thu, 14 May 2020 12:26:11 +0200 Subject: [PATCH 10/15] Adds mmc support --- src/arch/partitioning | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/arch/partitioning b/src/arch/partitioning index 61ced4ef..b7c3361e 100755 --- a/src/arch/partitioning +++ b/src/arch/partitioning @@ -192,8 +192,11 @@ _default_partitioning_scheme() { fi ### Set partition order - if [[ ${DRIVE} =~ "/dev/nvme0n" ]]; then ORDER=(p1 p2 p3 p4) - else ORDER=(1 2 3 4); fi + if [[ ${DRIVE} =~ "/dev/nvme" || ${DRIVE} =~ "/dev/mmcblk" ]]; then + ORDER=(p1 p2 p3 p4) + else + ORDER=(1 2 3 4) + fi ### Partition processing INDEX=0 From 18732039b1c7dc0639345f9144a0a1a8b6d040a3 Mon Sep 17 00:00:00 2001 From: grm34 Date: Thu, 14 May 2020 13:03:33 +0200 Subject: [PATCH 11/15] Fix UEFI part_type (FW) --- src/arch/firmware | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/firmware b/src/arch/firmware index c924b494..b3cf26b4 100644 --- a/src/arch/firmware +++ b/src/arch/firmware @@ -17,7 +17,7 @@ _firmware() { export FIRMWARE="UEFI" export PART_TABLE="GPT" export PART_CODE="g" - export PART_TYPE="" + export PART_TYPE="\n" export MOUNT_TYPE="-t vfat " export BOOT_FILESYSTEM="fat -F32" _note "UEFI ${MSG_FW_TRUE}" From 6e48f26e8540cae1551ac5cda2a452a4a49c6d0a Mon Sep 17 00:00:00 2001 From: grm34 Date: Thu, 14 May 2020 15:29:44 +0200 Subject: [PATCH 12/15] UEFI part_table (revert) --- src/arch/firmware | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/firmware b/src/arch/firmware index b3cf26b4..c924b494 100644 --- a/src/arch/firmware +++ b/src/arch/firmware @@ -17,7 +17,7 @@ _firmware() { export FIRMWARE="UEFI" export PART_TABLE="GPT" export PART_CODE="g" - export PART_TYPE="\n" + export PART_TYPE="" export MOUNT_TYPE="-t vfat " export BOOT_FILESYSTEM="fat -F32" _note "UEFI ${MSG_FW_TRUE}" From 14325a0477639cf39bb450135a23a91d336b3fc7 Mon Sep 17 00:00:00 2001 From: grm34 Date: Thu, 14 May 2020 17:10:33 +0200 Subject: [PATCH 13/15] Fix new partition [UEFI) --- src/arch/partitioning | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/arch/partitioning b/src/arch/partitioning index b7c3361e..e2315b01 100755 --- a/src/arch/partitioning +++ b/src/arch/partitioning @@ -109,7 +109,7 @@ _default_partitioning_scheme() { umount -fv "/dev/${PART}"; sleep 1 fi _info "${MSG_DELETE_PART} /dev/${PART}" - printf "d\n\nw\n" | fdisk --wipe=always "${DRIVE}" + printf "d\n\nw" | fdisk --wipe=always "${DRIVE}" partprobe "${DRIVE}" && sleep 1 done fi @@ -118,7 +118,7 @@ _default_partitioning_scheme() { _info "${MSG_FORMAT_DRIVE} ${DRIVE}" dd if=/dev/zero of="${DRIVE}" bs=512 count=1 conv=notrunc status=progress wipefs --force --all "${DRIVE}"; sleep 1 - printf "%s\nw\n" "${PART_CODE}" | fdisk "${DRIVE}" + printf "%s\nw" "${PART_CODE}" | fdisk "${DRIVE}" partprobe "${DRIVE}" && sleep 1 ### Logical Volume Manager ? (UEFI only) @@ -209,26 +209,32 @@ _default_partitioning_scheme() { if [[ (${SET_LVM} && ${PART} == "ROOT_PARTITION") || \ (${PART} == "HOME_PARTITION" && ${SIZES[${INDEX}]} == "freespace") ]]; then - printf "n\n%s\n\n\nw\n" "${PART_TYPE}" | fdisk "${DRIVE}" - partprobe "${DRIVE}" && sleep 1 + if [[ ${FIRMWARE} == "BIOS" ]]; then + printf "n\np\n\n\nw" | fdisk "${DRIVE}" + else + printf "n\n\n\n\nw" | fdisk "${DRIVE}" + fi elif [[ ! ${SET_LVM} || ${PART} == "BOOT_PARTITION" ]]; then - printf "n\n%s\n\n\n+%s\nw\n" \ -"${PART_TYPE}" "${SIZES[${INDEX}]}" | fdisk "${DRIVE}" - - partprobe "${DRIVE}" && sleep 1 + if [[ ${FIRMWARE} == "BIOS" ]]; then + printf \ +"n\np\n\n\n+%s\nw" "${SIZES[${INDEX}]}" | fdisk "${DRIVE}" + else + printf "n\n\n\n+%s\nw" "${SIZES[${INDEX}]}" | fdisk "${DRIVE}" + fi fi + partprobe "${DRIVE}" && sleep 1 ## Set required partition types if [[ ${PART} == "BOOT_PARTITION" && ${FIRMWARE} == "UEFI" ]]; then _info "${MSG_PART_TYPE} ${FIRMWARE/U/} ${DRIVE}${ORDER[${INDEX}]}" - printf "t\nef00\nw\n" | gdisk "${DRIVE}" + printf "t\nef00\nw" | gdisk "${DRIVE}" partprobe "${DRIVE}" && sleep 1 elif [[ ${SET_LVM} && ${PART} != "BOOT_PARTITION" ]]; then _info "${MSG_PART_TYPE} ${PART_NAME} ${DRIVE}${ORDER[${INDEX}]}" - printf "t\n1\n8e00\nw\n" | gdisk "${DRIVE}" + printf "t\n1\n8e00\nw" | gdisk "${DRIVE}" partprobe "${DRIVE}" && sleep 1 fi From b5df4162f114f2801cf9198244e4af766ce8070d Mon Sep 17 00:00:00 2001 From: grm34 Date: Thu, 14 May 2020 17:24:46 +0200 Subject: [PATCH 14/15] Adds UEFI 32bits support --- src/arch/firmware | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arch/firmware b/src/arch/firmware index c924b494..8feea1c9 100644 --- a/src/arch/firmware +++ b/src/arch/firmware @@ -13,7 +13,8 @@ _firmware() { _info "${MSG_GET_FW}" ### UEFI - if [ -d /sys/firmware/efi/efivars ]; then + EFI_TYPE=$( cat /sys/firmware/efi/fw_platform_size ) + if [[ -d /sys/firmware/efi/efivars && ${EFI_TYPE} == "64" ]]; then export FIRMWARE="UEFI" export PART_TABLE="GPT" export PART_CODE="g" From ce2a2256feed50cffeaabfb95c96ef71ef028f13 Mon Sep 17 00:00:00 2001 From: grm34 Date: Thu, 14 May 2020 17:52:00 +0200 Subject: [PATCH 15/15] Adds mmc drive support in custom partitioning --- src/arch/partitioning | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arch/partitioning b/src/arch/partitioning index e2315b01..f7cd0f51 100755 --- a/src/arch/partitioning +++ b/src/arch/partitioning @@ -348,7 +348,8 @@ grep "NAME\|disk\|part" done ### Set and return boot drive - if [[ ${BOOT_PARTITION} =~ "/dev/nvme0n" ]]; then + if [[ ${BOOT_PARTITION} =~ "/dev/nvme" || \ +${BOOT_PARTITION} =~ "/dev/mmcblk" ]]; then export DRIVE=${BOOT_PARTITION%p*} else export DRIVE=${BOOT_PARTITION//[0-9]}