Fix various issues

This commit is contained in:
natemaia 2020-05-03 12:47:39 -07:00
parent 87ffbdcb42
commit 2208c3afba

View File

@ -7,7 +7,7 @@
# shellcheck disable=SC2086,SC2046,SC2254
VER=2.1.40
VER=2.1.41
# default values {
@ -309,7 +309,7 @@ _vconsole="\nSelect the console keymap, the console is the tty shell you reach b
_prep="\nThis is the installer main menu, once a step is complete you will return here.\n\nOn successful completion of a step the cursor will be advanced to the next step\nOn failure the cursor will be placed on the step required to advance (when possible).\n\nSteps beginning with an asterisk (*) are required.\n\nOnce you're happy with the choices and the required steps are complete, selecting the final step will begin the install."
_device="\nSelect a device to use from the list below.\n\nDevices (/dev) are the available drives on the system. /sda, /sdb, /sdc ..."
_mount="\nUse [Space] to toggle mount options from below, press [Enter] when done to confirm selection.\n\nNot selecting any and confirming will run an automatic mount."
_warn="\nIMPORTANT: Choose carefully when editing, formatting, and mounting partitions or your DATA MAY BE LOST.\n\nTo mount a partition without formatting it, select 'skip' when prompted to choose a filesystem during the mounting stage.\nThis can only be used for partitions that already contain a filesystem and cannot be the root (/) partition, it needs to be formatted before install.\n"
_warn="\nIMPORTANT: Choose carefully when editing, formatting, and mounting partitions or your DATA MAY BE LOST.\n\nTo mount a partition without formatting it, select 'skip' when prompted to choose a file system during the mounting stage.\nThis can only be used for partitions that already contain a file system and cannot be the root (/) partition, it needs to be formatted before install.\n"
_part="\nFull device auto partitioning is available for beginners otherwise cfdisk is recommended.\n\n - All systems will require a root partition (8G or greater).\n - UEFI or BIOS using LUKS without LVM require a separate boot partition (100-512M)."
_uefi="\nSelect the EFI boot partition (/boot), required for UEFI boot.\n\nIt's usually the first partition on the device, 100-512M, and will be formatted as vfat/fat32 if not already."
_bios="\nDo you want to use a separate boot partition? (optional)\n\nIt's usually the first partition on the device, 100-512M, and will be formatted as ext3/4 if not already."
@ -756,7 +756,7 @@ select_packages()
nmap "Utility for network discovery and security auditing" "$(ofn nmap "${USER_PKGS[*]}")" \
noto-fonts "Google Noto fonts" "$(ofn noto-fonts "${USER_PKGS[*]}")" \
noto-fonts-cjk "Google Noto CJK fonts (Chinese, Japanese, Korean)" "$(ofn noto-fonts-cjk "${USER_PKGS[*]}")" \
ntfs-3g "NTFS filesystem driver and utilities" "$(ofn ntfs-3g "${USER_PKGS[*]}")" \
ntfs-3g "NTFS file system driver and utilities" "$(ofn ntfs-3g "${USER_PKGS[*]}")" \
obs-studio "Free opensource streaming/recording software" "$(ofn obs-studio "${USER_PKGS[*]}")" \
openshot "An open-source, non-linear video editor for Linux" "$(ofn openshot "${USER_PKGS[*]}")" \
opera "A Fast and secure, free of charge web browser from Opera Software" "$(ofn opera "${USER_PKGS[*]}")" \
@ -1039,7 +1039,7 @@ part_format()
local delay="$3"
shift 3
msg "Format" "\nFormatting $(part_pretty "$part") as $fs\n" 0
msg "File System Format" "\nFormatting\n\npart: $(part_pretty "$part")\n\nfs: $fs\n" 0
mkfs.$fs ${FS_CMD_FLAGS[$fs]} "$part" > /dev/null 2> "$ERR"
errshow 0 "mkfs.$fs ${FS_CMD_FLAGS[$fs]} '$part' > /dev/null" || return 1
sleep "$delay"
@ -1386,42 +1386,31 @@ select_filesystem()
{
local part="$1"
local fs=''
local cur txt
local cur txt pt
pt="$(part_pretty "$part")"
cur="$(lsblk -lno FSTYPE "$part" 2> /dev/null)"
txt="\nSelect which filesystem to use for: $(part_pretty "$part")\n\nDefault: ext4"
txt="\nSelect which file system to use\n\npart: $pt\n\nfs default: ext4"
if [[ $cur ]]; then
# bail early if the partition was created in part_auto()
[[ $cur && $part == "$AUTO_ROOT" ]] && return 0
[[ $part == "$AUTO_ROOT" ]] && return 0
[[ $part != "$ROOT" ]] && txt+="\nCurrent: $cur"
fi
until [[ $fs ]]; do
if [[ $cur && $part != "$ROOT" ]]; then
dlg fs menu "Filesystem" "$txt\nCurrent: $cur" \
skip - \
ext4 "The evolution of the most used Linux filesystem, successor to Ext3" \
ext3 "3rd extended file system, successor to Ext2" \
ext2 "2nd extended filesystem, unlike 3/4 it is not journaled and largely obsolete" \
vfat "A legacy file system which is simple and robust" \
ntfs "Windows NT file system" \
dlg fs menu "File System" "$txt" $([[ $cur && $part != "$ROOT" ]] && printf "skip -") \
ext4 "The evolution of the most used Linux file system, successor to Ext3" \
ext3 "Third extended file system, successor to Ext2" \
ext2 "Second extended file system, unlike 3/4 it is not journaled and obsolete" \
vfat "File allocation table, a legacy file system which is simple and robust" \
ntfs "NT file system, a journaling file system created by Microsoft" \
f2fs "Flash-friendly file system, intended for NAND-based flash memory" \
jfs "Journaled file system created by IBM" \
xfs "Journaling file system created by Silicon Graphics (SGI)" \
jfs "Journaled file system created by IBM and open-sourced in 1999" \
xfs "Journaled file system created by Silicon Graphics Inc. (SGI)" \
nilfs2 "A log-structured file system implementation for the Linux kernel" \
reiserfs "Journaled file system initially created by a team at Namesys led by Hans Reiser" || return 1
else
dlg fs menu "Filesystem" "$txt" \
ext4 "The evolution of the most used Linux filesystem, successor to Ext3" \
ext3 "3rd extended file system, successor to Ext2" \
ext2 "2nd extended filesystem, unlike 3/4 it is not journaled and largely obsolete" \
vfat "A legacy file system which is simple and robust" \
ntfs "Windows NT file system" \
f2fs "Flash-friendly file system, intended for NAND-based flash memory" \
jfs "Journaled file system created by IBM" \
xfs "Journaling file system created by Silicon Graphics (SGI)" \
nilfs2 "A log-structured file system implementation for the Linux kernel" \
reiserfs "Journaled file system initially created by a team at Namesys led by Hans Reiser" || return 1
fi
reiserfs "Journaled file system created by a team at Namesys led by Hans Reiser" || return 1
[[ $fs == 'skip' ]] && return 0
yesno "Filesystem" "\nFormat $(part_pretty "$part") as $fs?\n" || fs=''
yesno "File System" "\nConfirm Format\n\npart: $pt\n\nfs: $fs\n" || fs=''
done
part_format "$part" "$fs" 0
}
@ -1457,7 +1446,12 @@ install_main()
chrun "hwclock --systohc --utc" || chrun "hwclock --systohc --utc --directisa"
install_user
install_login
# allow members of the wheel group to run commands as root
sed -i "s/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g" "$MNT/etc/sudoers"
chrun "chown -Rf $NEWUSER:users /home/$NEWUSER"
if [[ "$USER_CMD" ]]; then
chrun "$USER_CMD" 2> "$ERR" 2>&1
errshow 0 "chrun '$USER_CMD'"
@ -1506,7 +1500,10 @@ install_base()
unset BG_PID
fi
if (( PACSTRAP )); then
mkdir -pv "$MNT/etc/default"
mkdir -pv "$MNT/etc/X11/xorg.conf.d/"
if [[ $PACSTRAP == 1 ]]; then
cp -vf /etc/modprobe.d/* "$MNT/etc/modprobe.d/"
cp -vf /etc/X11/xorg.conf.d/* "$MNT/etc/X11/xorg.conf.d/"
# we have some customizations in /etc on the iso we want to preserve
@ -1547,14 +1544,12 @@ install_base()
# allow members of the wheel group to run commands as root
sed -i "s/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g" "$MNT/etc/sudoers"
mkdir -pv "$MNT/etc/default"
echo "LANG=$LOCALE" > "$MNT/etc/locale.conf"
cp -fv "$MNT/etc/locale.conf" "$MNT/etc/default/locale"
sed -i "s/#en_US.UTF-8/en_US.UTF-8/g; s/#${LOCALE}/${LOCALE}/g" "$MNT/etc/locale.gen"
chrun "locale-gen"
chrun "ln -svf /usr/share/zoneinfo/$ZONE/$SUBZ /etc/localtime"
mkdir -pv "$MNT/etc/X11/xorg.conf.d"
cat > "$MNT/etc/X11/xorg.conf.d/00-keyboard.conf" <<- EOF
# Use localectl(1) to instruct systemd-localed to update it.
Section "InputClass"
@ -1965,7 +1960,7 @@ install_background()
(
install_mirrorlist "/etc/pacman.d/mirrorlist" > /tmp/bgout 2>&1
if (( PACSTRAP )); then
if [[ $PACSTRAP == 1 ]]; then
pacstrap /mnt >> /tmp/bgout 2>&1
else
rsync -avh /run/archiso/sfs/airootfs/ "$MNT/" >> /tmp/bgout 2>&1
@ -1976,7 +1971,7 @@ install_background()
cp /etc/pacman.d/mirrorlist "$MNT/etc/pacman.d/mirrorlist"
al_repo "$MNT/etc/pacman.conf"
if (( PACSTRAP )); then
if [[ $PACSTRAP == 1 ]]; then
chrun "pacman -S ${ISO_PKGS[*]} $net $luks --noconfirm --needed" >> /tmp/bgout 2>&1
else
chrun "pacman -Syyu $net --noconfirm --needed" >> /tmp/bgout 2>&1
@ -2228,7 +2223,7 @@ prerun_systemd-boot()
mkdir -pv "$MNT/boot/loader/entries"
cat > "$MNT/boot/loader/loader.conf" <<- EOF
default $DIST
default $DIST.conf
timeout 5
editor no
EOF