diff --git a/README.md b/README.md index 32d6c20..a799eb1 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,17 @@ # ArchLabs Installer +Shell script to install Arch Linux based distributions with a focus on customization + #### Features - Minimal dependencies. - LUKS and/or LVM support. - Btrfs and subvolume support. - Full device auto partitioning. -- Mirror country selection and sorting. +- Mirror selection and sorting. - Self updating with persistent settings. -- Background base install process while you customize. -- Choose kernel, file system, bootloader, packages, sessions, shell, login manager, etc. +- Base packages install in the background for faster installs. +- Choose your own kernel, file system, bootloader, packages, sessions, shell, login manager, etc. #### Requirements @@ -17,6 +19,7 @@ - `awk` - `sed` - `curl` +- `bash` - `dialog` - `parted` - `coreutils` @@ -28,14 +31,5 @@ #### Manual Installation ``` -curl -fSL https://bitbucket.org/archlabslinux/installer/raw/master/installer -o /usr/bin/installer +curl -fSL https://bitbucket.org/archlabslinux/installer/raw/master/installer -o /usr/local/bin/installer ``` - ---- - -A packaged version can also be found in our repos: - -- stable: https://bitbucket.org/archlabslinux/archlabs\_repo - -- unstable: https://bitbucket.org/archlabslinux/archlabs\_unstable - diff --git a/installer b/installer index bebb05a..a1205e4 100755 --- a/installer +++ b/installer @@ -5,7 +5,7 @@ # Some ideas and code reworked from other resources # AIF, Calamares, and the Arch Wiki.. Credit where credit is due -# shellcheck disable=2086,2046,2254,2164,2030,2031 +# shellcheck disable=2086,2046,2254,2164,2030,2031,2001 VER=2.16 # default values { @@ -1235,8 +1235,8 @@ part_mount() part_pretty() { - local part="$1" - local regexp="$2" + local part="$1" # valid block device partition or empty string for all + local regexp="$2" # awk search regex for partition type or empty string for all local s dev size isize model # invalid block device passed in @@ -1252,11 +1252,9 @@ part_pretty() s=${size%%__*} size_t="${s: -1:1}" isize=${s:0:-1} - if [[ $dev = /dev/nvme* ]]; then - model=$(lsblk -lno MODEL "${dev%p[1-9]}" | awk '{gsub(/ |\t/, "_"); print}') - else - model=$(lsblk -lno MODEL "${dev%[1-9]}" | awk '{gsub(/ |\t/, "_"); print}') - fi + # find the root device: /dev/sda1 -> /dev/sda, /dev/nvme0n1p12 -> /dev/nvme0n1 + drive="$(sed 's/p\?[1-9][0-9]*$//' <<< "$dev")" + model=$(lsblk -lno MODEL "$drive" | awk '{gsub(/ |\t/, "_"); print}') [[ $size_t == 'K' || ($size_t == 'M' && ${isize%.*} -lt 80) ]] || printf "%s\n" "$dev ${size}__$model" done < <(lsblk -lno TYPE,PATH,SIZE,FSTYPE,LABEL $part | awk "/$regexp/"' && !'"/${IGNORE_DEV:-NONEXX}/"' { @@ -1371,10 +1369,10 @@ part_cryptlv() } part_countdec() -{ - for pt; do +{ # loop all passed partitions and remove them from the list, decrementing the counter + for p; do if (( PART_COUNT )); then - PARTS="$(sed "/${pt//\//\\/}/d" <<< "$PARTS")" + PARTS="$(sed "/${p##/dev/} /d" <<< "$PARTS")" # sed //d doesn't like slashes so strip the /dev/ (( PART_COUNT-- )) fi done @@ -1398,6 +1396,7 @@ mount_menu() return 1 fi fi + # we don't show the underlying partition(s) for LVM and/or LUKS [[ $LUKS && $LUKS_PART ]] && part_countdec $LUKS_PART [[ $LVM && $LVM_PARTS ]] && part_countdec $LVM_PARTS mount_root || { ROOT=''; return 1; } @@ -3919,7 +3918,7 @@ fi mirrorpid='' if [[ ! -f /tmp/new ]]; then - msg "Update" "\nChecking for newer installer versions.\n" 0 + msg "Update" "\nChecking for installer updates.\n" 0 if hash reflector > /dev/null 2>&1; then ( reflector --list-countries 2>/dev/null | sed '1,2d' | awk 'NF{NF--}; {print}' > /tmp/mcountry ) & mirrorpid=$!