Re order password errors in mkuser()
This commit is contained in:
parent
7efdb466a7
commit
2cee0cd38f
10
README.md
10
README.md
@ -11,14 +11,7 @@
|
||||
|
||||
#### Requirements
|
||||
|
||||
- `coreutils`
|
||||
- `parted` for partition creation.
|
||||
- `rsync` for unpacking the squashfs.
|
||||
- `dialog` for all user input/output.
|
||||
- `vim` for editing files post install.
|
||||
- `chpasswd` to set root and user passwords.
|
||||
- `curl` for network check and mirrorlist download
|
||||
- `arch-chroot` to perform operations in a chroot.
|
||||
`coreutils`, `parted`, `rsync`, `dialog`, `vim`, `chpasswd`, `curl`, `arch-chroot`
|
||||
|
||||
|
||||
#### Manual Installation
|
||||
@ -26,6 +19,7 @@
|
||||
```
|
||||
sh -c "$(curl -fsSL https://bitbucket.org/archlabslinux/installer/raw/master/install.sh)"
|
||||
```
|
||||
|
||||
---
|
||||
A packaged version can also be found in our repos:
|
||||
[stable](https://bitbucket.org/archlabslinux/archlabs_repo/src/master/x86_64/)
|
||||
|
@ -3,16 +3,15 @@
|
||||
|
||||
# Generic
|
||||
_Done="Done"
|
||||
_Skip="Skip/None"
|
||||
_ErrTitle="Installation Error"
|
||||
_NoFileErr="\nFile does not exist.\n"
|
||||
_PassErr="\nThe passwords entered do not match.\n"
|
||||
_OnlyOne="\nOnly one partition available"
|
||||
_Pass2="\nRe-enter the password for"
|
||||
_TryAgain="Please try again.\n"
|
||||
_Exit="Exiting.\n"
|
||||
_Back="Back"
|
||||
_Name="Name:"
|
||||
_Skip="Skip/None"
|
||||
_Exit="Exiting.\n"
|
||||
_ErrTitle="Installation Error"
|
||||
_TryAgain="Please try again.\n"
|
||||
_Pass2="\nRe-enter the password for"
|
||||
_NoFileErr="\nFile does not exist.\n"
|
||||
_OnlyOne="\nOnly one partition available"
|
||||
|
||||
# Welcome
|
||||
_WelTitle="Welcome to"
|
||||
@ -53,9 +52,9 @@ _ErrChoiceConsole="\nUnmount the partitions and exit to view the error log or ke
|
||||
|
||||
# timezone
|
||||
_TimeZTitle="Set Timezone"
|
||||
_TimeZBody="\nThe time zone is used to set the system clock.\n\nSelect your country or continent from the list below"
|
||||
_TimeSubZBody="\nSelect the nearest city to your location from the list below."
|
||||
_TimeZQ="\nConfirm time zone:"
|
||||
_TimeSubZBody="\nSelect the nearest city to your location from the list below."
|
||||
_TimeZBody="\nThe time zone is used to set the system clock.\n\nSelect your country or continent from the list below"
|
||||
|
||||
# bootloader
|
||||
_MntBootBody="\nSelect which bootloader to use."
|
||||
@ -216,6 +215,7 @@ _ExtErrBody="\nCannot mount partition due to a problem with the mountpoint name.
|
||||
_PartErrBody="\nBIOS systems require at least one partition (ROOT).\n\nUEFI systems require at least two (ROOT and EFI).\n"
|
||||
_UserErrTitle="User Name Error"
|
||||
_UserErrBody="\nIncorrect user name.\n\nPlease try again.\n"
|
||||
_PassErr="\nThe passwords entered do not match.\n"
|
||||
_UserPassErr="\nThe user passwords entered do not match.\n"
|
||||
_RootPassErr="\nThe root passwords entered do not match.\n"
|
||||
_UserPassEmpty="\nThe user password cannot be left empty.\n"
|
||||
|
@ -8,10 +8,70 @@
|
||||
# Some ideas and code has been taken from other installers
|
||||
# AIF, Cnichi, Calamares, The Arch Wiki.. Credit where credit is due
|
||||
|
||||
VER="1.8.21" # version
|
||||
VER="1.8.28" # version
|
||||
DIST="ArchLabs" # distributor
|
||||
MNT="/mnt" # mountpoint
|
||||
|
||||
# Bulk defaults
|
||||
# {
|
||||
|
||||
ERR="/tmp/errlog" # error log used internally
|
||||
DBG="/tmp/debuglog" # debug log when passed -d
|
||||
RUN="/run/archiso/bootmnt/arch/boot" # path for live /boot
|
||||
BT="$DIST Installer - v$VER" # backtitle used for dialogs
|
||||
VM="$(dmesg | grep -i "hypervisor")" # is the system a vm
|
||||
|
||||
ROOT_PART="" # root partition
|
||||
BOOT_PART="" # boot partition
|
||||
BOOT_DEVICE="" # device used for BIOS grub install
|
||||
AUTO_BOOT_PART="" # filled with the boot partition from auto_partiton()
|
||||
BOOTLDR="" # bootloader selected
|
||||
EXTRA_MNT="" # holder for additional partitions while mounting
|
||||
EXTRA_MNTS="" # when an extra partition is mounted append it's info
|
||||
SWAP_PART="" # swap partition or file path
|
||||
SWAP_SIZE="" # when using a swapfile use this size
|
||||
NEWUSER="" # username for the primary user
|
||||
USER_PASS="" # password for the primary user
|
||||
ROOT_PASS="" # root password
|
||||
LOGIN_WM="" # default login session
|
||||
LOGIN_TYPE="" # login manager can be lightdm or xinit
|
||||
INSTALL_WMS="" # space separated list of chosen wm/de
|
||||
KERNEL="" # kernel can be linux or linux-lts
|
||||
PACKAGES="" # list of all packages to install including WM_PACKAGES
|
||||
WM_PACKAGES="" # full list of packages added during wm/de choice
|
||||
MYSHELL="" # login shell for root and the primary user
|
||||
UCODE="" # cpu manufacturer microcode filename (if any)
|
||||
HOOKS="shutdown" # list of additional HOOKS to add in /etc/mkinitcpio.conf
|
||||
FONT="ter-i16n" # font used in the linux console
|
||||
|
||||
# sane baseline
|
||||
BASE_PKGS="archlabs-scripts archlabs-skel-base archlabs-themes archlabs-dARK archlabs-icons archlabs-wallpapers "
|
||||
BASE_PKGS+="base-devel xorg xorg-drivers sudo git gtk3 gtk-engines gtk-engine-murrine pavucontrol tumbler "
|
||||
BASE_PKGS+="playerctl ffmpeg gstreamer libmad libmatroska gst-libav gst-plugins-base gst-plugins-good"
|
||||
|
||||
# sane extras for window managers
|
||||
WM_BASE_PKGS="arandr archlabs-networkmanager-dmenu xdg-user-dirs nitrogen polkit-gnome volumeicon xclip "
|
||||
WM_BASE_PKGS+="xdotool compton gnome-keyring dunst feh gsimplecal xfce4-power-manager xfce4-settings laptop-detect"
|
||||
|
||||
LUKS="" # empty when not using luks encryption
|
||||
LUKS_DEV="" # boot parameter string for LUKS
|
||||
LUKS_PART="" # partition used for encryption
|
||||
LUKS_PASS="" # encryption password
|
||||
LUKS_UUID="" # encrypted partition UUID
|
||||
LUKS_NAME="" # name used for encryption
|
||||
|
||||
LVM="" # empty when not using lvm
|
||||
GROUP_PARTS=() # partitions used for volume group
|
||||
VOL_GROUP_MB=0 # available space in volume group
|
||||
|
||||
WARN=false # issued mounting/partitioning warning
|
||||
SEP_BOOT=false # separate boot partition for BIOS
|
||||
AUTOLOGIN=false # enable autologin for xinit
|
||||
CONFIG_DONE=false # basic configuration is finished
|
||||
BROADCOM_WL=false # fixes for broadcom cards eg. BCM4352
|
||||
|
||||
# }
|
||||
|
||||
main()
|
||||
{
|
||||
if [[ $CURRENT_MENU != "main" && $SAVED ]]; then
|
||||
@ -69,8 +129,11 @@ show_cfg()
|
||||
{
|
||||
local cmd="${BCMDS[$BOOTLDR]}"
|
||||
local mnt="${BMNTS[$SYS-$BOOTLDR]}"
|
||||
local pkgs="${PACKAGES# }"
|
||||
local pkgs="${PACKAGES# } $BASE_PKGS"
|
||||
[[ $PACKAGES =~ (openbox|bspwm|i3-gaps) || $INSTALL_WMS == *dwm* ]] && pkgs="${pkgs# } $WM_BASE_PKGS"
|
||||
[[ $INSTALL_WMS == *dwm* ]] && pkgs="${pkgs# } dwm st dmenu"
|
||||
pkgs="${pkgs# }"
|
||||
pkgs="${pkgs% }"
|
||||
msgbox "$_PrepTitle" "
|
||||
|
||||
---------- PARTITION CONFIGURATION ------------
|
||||
@ -184,12 +247,12 @@ mkuser()
|
||||
elif [[ $pass == "" ]]; then
|
||||
msgbox "$_ErrTitle" "$_UserPassEmpty\n$_TryAgain"
|
||||
mkuser || return 1
|
||||
elif [[ "$rpass" != "$rpass2" ]]; then
|
||||
msgbox "$_ErrTitle" "$_RootPassErr\n$_TryAgain"
|
||||
mkuser || return 1
|
||||
elif [[ "$pass" != "$pass2" ]]; then
|
||||
msgbox "$_ErrTitle" "$_UserPassErr\n$_TryAgain"
|
||||
mkuser || return 1
|
||||
elif [[ "$rpass" != "$rpass2" ]]; then
|
||||
msgbox "$_ErrTitle" "$_RootPassErr\n$_TryAgain"
|
||||
mkuser || return 1
|
||||
fi
|
||||
|
||||
NEWUSER="$user"
|
||||
@ -291,16 +354,13 @@ select_wm_or_de()
|
||||
WM_PACKAGES="${WM_PACKAGES// / }" # remove double spaces
|
||||
WM_PACKAGES="${WM_PACKAGES# }" # remove leading space
|
||||
|
||||
# packages needed for the selected WMs/DEs
|
||||
for wm in $INSTALL_WMS; do
|
||||
LOGIN_CHOICES+="$wm - "
|
||||
[[ ${WM_EXT[$wm]} && $WM_PACKAGES != *"${WM_EXT[$wm]}"* ]] && WM_PACKAGES+=" ${WM_EXT[$wm]}"
|
||||
done
|
||||
|
||||
# choose how to log in
|
||||
select_login || return 1
|
||||
|
||||
# choose which WM/DE to start at login, only for xinit
|
||||
if [[ $LOGIN_TYPE == 'xinit' ]]; then
|
||||
if [[ $WM_NUM -eq 1 ]]; then
|
||||
LOGIN_WM="${WM_SESSIONS[$INSTALL_WMS]}"
|
||||
@ -313,8 +373,7 @@ select_wm_or_de()
|
||||
AUTOLOGIN=false
|
||||
fi
|
||||
|
||||
# add packages to the main package list
|
||||
[[ $PACKAGES ]] && PACKAGES+=" ${WM_PACKAGES# }" || PACKAGES="${WM_PACKAGES# }"
|
||||
PACKAGES+=" ${WM_PACKAGES# }"
|
||||
}
|
||||
|
||||
select_login()
|
||||
@ -331,6 +390,7 @@ select_login()
|
||||
else
|
||||
PACKAGES="${PACKAGES// lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice/}"
|
||||
WM_PACKAGES="${WM_PACKAGES// lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice/}"
|
||||
WM_PACKAGES+=" xorg-xinit"
|
||||
EDIT_FILES[login]="/home/$NEWUSER/.xinitrc /home/$NEWUSER/.xprofile"
|
||||
fi
|
||||
}
|
||||
@ -373,15 +433,10 @@ select_packages()
|
||||
select_packages
|
||||
fi
|
||||
|
||||
# add any extras for each package
|
||||
for pkg in $PACKAGES; do
|
||||
[[ ${PKG_EXT[$pkg]} && $PACKAGES != *"${PKG_EXT[$pkg]}"* ]] && PACKAGES+=" ${PKG_EXT[$pkg]}"
|
||||
done
|
||||
|
||||
# add mksh to package list if it was chosen as the login shell
|
||||
[[ $MYSHELL == *mksh ]] && PACKAGES+=" mksh"
|
||||
|
||||
# remove leading space
|
||||
PACKAGES="${PACKAGES# }"
|
||||
return 0
|
||||
}
|
||||
@ -1180,7 +1235,7 @@ install()
|
||||
install_base
|
||||
printf "Generating system /etc/fstab\n"
|
||||
genfstab -U $MNT >$MNT/etc/fstab 2>$ERR
|
||||
echeck "genfstab -U $MNT >$MNT/etc/fstab"
|
||||
errshow 1 "genfstab -U $MNT >$MNT/etc/fstab"
|
||||
[[ -f $MNT/swapfile ]] && sed -i "s~${MNT}~~" $MNT/etc/fstab
|
||||
mirrorlist_sort
|
||||
package_operations
|
||||
@ -1197,11 +1252,11 @@ install_base()
|
||||
{
|
||||
if [[ -e /run/archiso/sfs/airootfs/etc/skel ]]; then
|
||||
rsync -ahv /run/archiso/sfs/airootfs/ $MNT/ 2>$ERR
|
||||
echeck "rsync -ahv /run/archiso/sfs/airootfs/ $MNT/"
|
||||
errshow 1 "rsync -ahv /run/archiso/sfs/airootfs/ $MNT/"
|
||||
else
|
||||
mirrorlist_sort
|
||||
pacstrap $MNT base $KERNEL $UCODE $(grep -hv '^#' /usr/share/archlabs/installer/packages.txt) 2>$ERR
|
||||
echeck "pacstrap $MNT base $KERNEL $UCODE $(grep -hv '^#' /usr/share/archlabs/installer/packages.txt)"
|
||||
errshow 1 "pacstrap $MNT base $KERNEL $UCODE $(grep -hv '^#' /usr/share/archlabs/installer/packages.txt)"
|
||||
fi
|
||||
|
||||
printf "Removing archiso remains\n"
|
||||
@ -1244,9 +1299,9 @@ EOF
|
||||
LANG=$LOCALE
|
||||
EOF
|
||||
sed -i "s/#en_US.UTF-8/en_US.UTF-8/g; s/#${LOCALE}/${LOCALE}/g" $MNT/etc/locale.gen
|
||||
chrun "locale-gen" 2>/dev/null
|
||||
chrun "locale-gen"
|
||||
printf "Setting timezone: $ZONE/$SUBZONE\n"
|
||||
chrun "ln -svf /usr/share/zoneinfo/$ZONE/$SUBZONE /etc/localtime" 2>/dev/null
|
||||
chrun "ln -svf /usr/share/zoneinfo/$ZONE/$SUBZONE /etc/localtime"
|
||||
|
||||
if [[ $BROADCOM_WL == true ]]; then
|
||||
printf "Blacklisting modules for broadcom wireless: bmca\n"
|
||||
@ -1294,7 +1349,6 @@ create_user()
|
||||
{
|
||||
printf "Creating user $NEWUSER, setting passwords, and setting shell\n"
|
||||
|
||||
# set root password, shell if needed
|
||||
chrun "chpasswd <<< 'root:$ROOT_PASS'"
|
||||
if [[ $MYSHELL != *zsh ]]; then
|
||||
chrun "usermod -s $MYSHELL root"
|
||||
@ -1303,20 +1357,19 @@ create_user()
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create the user, set password, and make sure the ownership of ~/ is correct
|
||||
local groups='audio,autologin,floppy,log,network,rfkill,scanner,storage,optical,power,wheel'
|
||||
chrun "groupadd -r autologin"
|
||||
chrun "useradd -m -u 1000 -g users -G $groups -s $MYSHELL $NEWUSER" 2>$ERR
|
||||
echeck "useradd -m -u 1000 -g users -G $groups -s $MYSHELL $NEWUSER"
|
||||
chrun "chpasswd <<< '$NEWUSER:$USER_PASS'"
|
||||
errshow 1 "useradd -m -u 1000 -g users -G $groups -s $MYSHELL $NEWUSER"
|
||||
chrun "chpasswd <<< '$NEWUSER:$USER_PASS'" 2>$ERR
|
||||
errshow 1 "Setting new users password"
|
||||
|
||||
# for neovim set up ~/.config/nvim
|
||||
if [[ $PACKAGES =~ neovim ]]; then
|
||||
if [[ $PACKAGES == *neovim* ]]; then
|
||||
mkdir -p $MNT/home/$NEWUSER/.config/nvim
|
||||
cp -fv $MNT/home/$NEWUSER/.vimrc $MNT/home/$NEWUSER/.config/nvim/init.vim
|
||||
cp -rfv $MNT/home/$NEWUSER/.vim/colors $MNT/home/$NEWUSER/.config/nvim/colors
|
||||
fi
|
||||
[[ $INSTALL_WMS =~ dwm ]] && suckless_install
|
||||
[[ $INSTALL_WMS == *dwm* ]] && suckless_install
|
||||
if [[ $INSTALL_WMS == 'plasma' || $LOGIN_WM == 'startkde' || $INSTALL_WMS == 'gnome' || $LOGIN_WM == 'gnome-session' ]]
|
||||
then
|
||||
sed -i '/super/d' $HOME/.xprofile /root/.xprofile
|
||||
@ -1392,7 +1445,8 @@ setup_lightdm()
|
||||
{
|
||||
rm -rf $SERVICE
|
||||
rm -rf $MNT/home/$NEWUSER/.{xinitrc,profile,zprofile,bash_profile}
|
||||
chrun 'systemctl set-default graphical.target && systemctl enable lightdm.service'
|
||||
chrun 'systemctl set-default graphical.target && systemctl enable lightdm.service' 2>$ERR
|
||||
errshow 1 "systemctl set-default graphical.target && systemctl enable lightdm.service"
|
||||
cat > $MNT/etc/lightdm/lightdm-gtk-greeter.conf << EOF
|
||||
# LightDM GTK+ Configuration
|
||||
|
||||
@ -1443,7 +1497,7 @@ run_mkinitcpio()
|
||||
[[ $LVM ]] && { [[ $add ]] && add+=" lvm2" || add+="lvm2"; }
|
||||
sed -i "s/block filesystems/block ${add} filesystems ${HOOKS}/g" $MNT/etc/mkinitcpio.conf
|
||||
chrun "mkinitcpio -p $KERNEL" 2>$ERR
|
||||
echeck "mkinitcpio -p $KERNEL"
|
||||
errshow 1 "mkinitcpio -p $KERNEL"
|
||||
}
|
||||
|
||||
mirrorlist_sort()
|
||||
@ -1460,34 +1514,30 @@ mirrorlist_sort()
|
||||
|
||||
package_operations()
|
||||
{
|
||||
# add the packages chosen during setup
|
||||
if [[ $KERNEL == 'linux-lts' ]]; then
|
||||
local inpkg="linux-lts $PACKAGES"
|
||||
local rmpkg="archlabs-installer linux"
|
||||
else
|
||||
local inpkg="$PACKAGES"
|
||||
local rmpkg="archlabs-installer"
|
||||
fi
|
||||
|
||||
# update first to avoid database access errors
|
||||
chrun "pacman -Syyu --noconfirm"
|
||||
|
||||
if [[ $BOOTLDR == 'grub' ]]; then
|
||||
chrun "pacman -Rns $rmpkg grub --noconfirm"
|
||||
if [[ $inpkg =~ (openbox|bspwm|i3) || $INSTALL_WMS == *dwm* ]]; then
|
||||
local inpkg="$PACKAGES $BASE_PKGS $WM_BASE_PKGS"
|
||||
else
|
||||
chrun "pacman -Rns $rmpkg --noconfirm"
|
||||
fi
|
||||
|
||||
chrun "pacman -S iputils --noconfirm"
|
||||
chrun "pacman -S $inpkg archlabs-common archlabs-dARK archlabs-icons archlabs-scripts archlabs-skel-base archlabs-wallpapers gtk-engine-murrine gtk3 pavucontrol tumbler xorg-xinit base base-devel sudo git udisks2 mesa xorg-server xorg-apps xorg-drivers playerctl ffmpeg gstreamer libmad libmatroska gst-libav gst-plugins-base gst-plugins-good --needed --noconfirm"
|
||||
if [[ $inpkg =~ (openbox|dwm|bspwm|i3) ]]; then
|
||||
chrun "pacman -S arandr archlabs-networkmanager-dmenu xdg-user-dirs nitrogen polkit-gnome volumeicon xclip xdotool compton gnome-keyring dunst feh gsimplecal xfce4-power-manager xfce4-settings laptop-detect --needed --noconfirm"
|
||||
local inpkg="$PACKAGES $BASE_PKGS"
|
||||
fi
|
||||
|
||||
if ! [[ $INSTALL_WMS == 'plasma' || $INSTALL_WMS == 'gnome' || $INSTALL_WMS == 'cinnamon' ]]; then
|
||||
chrun "pacman -S archlabs-ksuperkey --noconfirm --needed"
|
||||
inpkg+=" archlabs-ksuperkey"
|
||||
fi
|
||||
|
||||
if [[ $KERNEL == 'linux-lts' ]]; then
|
||||
inpkg+=" linux-lts"
|
||||
rmpkg+=" linux"
|
||||
fi
|
||||
|
||||
[[ $BOOTLDR == 'grub' ]] && inpkg+=" grub"
|
||||
|
||||
chrun "pacman -Syyu --noconfirm"
|
||||
chrun "pacman -Rns $rmpkg --noconfirm"
|
||||
chrun "pacman -S iputils --noconfirm"
|
||||
chrun "pacman -S $inpkg --needed --noconfirm"
|
||||
|
||||
sed -i "s/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g" $MNT/etc/sudoers
|
||||
return 0
|
||||
}
|
||||
@ -1548,14 +1598,12 @@ setup_grub()
|
||||
BCMDS[grub]="${BCMDS[grub]} --bootloader-id=$DIST"
|
||||
fi
|
||||
|
||||
BCMDS[grub]="mkdir -p /run/udev &&
|
||||
mkdir -p /run/lvm &&
|
||||
BCMDS[grub]="mkdir -p /run/udev && mkdir -p /run/lvm &&
|
||||
mount --bind /hostrun/udev /run/udev &&
|
||||
mount --bind /hostrun/lvm /run/lvm &&
|
||||
${BCMDS[grub]} &&
|
||||
grub-mkconfig -o /boot/grub/grub.cfg &&
|
||||
umount /run/udev &&
|
||||
umount /run/lvm"
|
||||
sleep 1 && umount /run/udev && umount /run/lvm"
|
||||
return 0
|
||||
}
|
||||
|
||||
@ -1693,7 +1741,7 @@ install_bootloader()
|
||||
prerun_$BOOTLDR
|
||||
printf "Installing and setting up $BOOTLDR in ${BMNTS[$SYS-$BOOTLDR]}\n"
|
||||
chrun "${BCMDS[$BOOTLDR]}" 2>$ERR
|
||||
echeck "${BCMDS[$BOOTLDR]}"
|
||||
errshow 1 "${BCMDS[$BOOTLDR]}"
|
||||
|
||||
if [[ -d $MNT/hostrun ]]; then
|
||||
umount $MNT/hostrun/udev >/dev/null 2>&1
|
||||
@ -2170,7 +2218,7 @@ chrun()
|
||||
|
||||
json()
|
||||
{
|
||||
# get a value from http://api.ipstack.com in json format using my API key this includes: ip, geolocation, country name
|
||||
# extract a value from http://api.ipstack.com json output
|
||||
curl -s "http://api.ipstack.com/$2" | python3 -c "import sys, json; print(json.load(sys.stdin)['$1'])"
|
||||
}
|
||||
|
||||
@ -2236,7 +2284,7 @@ print4()
|
||||
{
|
||||
# takes an arbitrary number of input fields and prints them out in fourths on separate lines
|
||||
local str="$*"
|
||||
if [[ ${#str} -gt $((COLUMNS - 5)) ]]; then
|
||||
if [[ ${#str} -gt $((COLUMNS - 10)) ]]; then
|
||||
str="$(awk '{
|
||||
p1=p2=p3=p4=""
|
||||
p1=$1
|
||||
@ -2245,7 +2293,7 @@ print4()
|
||||
for (i=q; i<=q*2; i++) { p2=p2" "$i }
|
||||
for (i=q*2; i<=q*3; i++) { p3=p3" "$i }
|
||||
for (i=q*3; i<=NF; i++) { p4=p4" "$i }
|
||||
printf "%s\n\t%s\n\t%s\n\t%s", p1, p2, p3, p4
|
||||
printf "%s\n %s\n %s\n %s", p1, p2, p3, p4
|
||||
}' <<< "$str")"
|
||||
printf "%s\n" "$str"
|
||||
elif [[ $str ]]; then
|
||||
@ -2350,18 +2398,12 @@ system_checks()
|
||||
|
||||
prechecks()
|
||||
{
|
||||
if [[ $1 -ge 0 ]] && ! [[ $(lsblk -o MOUNTPOINT) =~ $MNT ]]; then
|
||||
msgbox "$_ErrTitle" "$_ErrNoMount"
|
||||
SELECTED=4
|
||||
return 1
|
||||
if [[ $1 -ge 0 ]] && ! [[ $(lsblk -lno MOUNTPOINT) =~ $MNT ]]; then
|
||||
msgbox "$_ErrTitle" "$_ErrNoMount"; SELECTED=4; return 1
|
||||
elif [[ $1 -ge 1 && ! $NEWUSER ]]; then
|
||||
msgbox "$_ErrTitle" "\nYou need to create a user first.\n"
|
||||
SELECTED=5
|
||||
return 1
|
||||
msgbox "$_ErrTitle" "\nYou need to create a user first.\n"; SELECTED=5; return 1
|
||||
elif [[ $1 -ge 2 && $CONFIG_DONE != true ]]; then
|
||||
msgbox "$_ErrTitle" "$_ErrNoConfig"
|
||||
SELECTED=6
|
||||
return 1
|
||||
msgbox "$_ErrTitle" "$_ErrNoConfig"; SELECTED=6; return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
@ -2370,22 +2412,6 @@ errshow()
|
||||
{
|
||||
local last_exit_code=$?
|
||||
(( last_exit_code == 0 )) && return 0
|
||||
|
||||
local err
|
||||
err="$(sed 's/[^[:print:]]//g; s/\[[0-9\;:]*\?m//g; s/==> //g; s/] ERROR:/]\nERROR:/g' "$ERR")"
|
||||
|
||||
if [[ $err ]]; then
|
||||
msgbox "$_ErrTitle" "\nERROR: $err"
|
||||
else
|
||||
msgbox "$_ErrTitle" "\nThe command exited abnormally: $1\n\nWith the no error message.\n"
|
||||
fi
|
||||
}
|
||||
|
||||
echeck()
|
||||
{
|
||||
local last_exit_code=$?
|
||||
(( last_exit_code == 0 )) && return 0
|
||||
|
||||
local err
|
||||
err="$(sed 's/[^[:print:]]//g; s/\[[0-9\;:]*\?m//g; s/==> //g; s/] ERROR:/]\nERROR:/g' "$ERR")"
|
||||
|
||||
@ -2395,9 +2421,10 @@ echeck()
|
||||
msgbox "$_ErrTitle" "\nThe command exited abnormally: $1\n\nWith the no error message.\n"
|
||||
fi
|
||||
|
||||
if [[ $1 == 1 ]]; then
|
||||
[[ -e $DBG && $TERM == 'linux' ]] && less $DBG
|
||||
|
||||
die 1
|
||||
fi
|
||||
}
|
||||
|
||||
debug()
|
||||
@ -2483,6 +2510,8 @@ yesno()
|
||||
|
||||
select_language()
|
||||
{
|
||||
LNG="/usr/share/archlabs/installer/lang" # translation file path
|
||||
|
||||
tput civis
|
||||
local lang
|
||||
lang=$(menubox "Select Language" \
|
||||
@ -2521,7 +2550,6 @@ select_language()
|
||||
fi
|
||||
[[ $TERM == 'linux' ]] && setfont $FONT >/dev/null 2>&1
|
||||
export LANG="$LOC"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@ -2530,55 +2558,6 @@ select_language()
|
||||
|
||||
# giant ugly variable container :P {
|
||||
|
||||
# BULK
|
||||
# {
|
||||
ERR="/tmp/errlog" # error log used internally
|
||||
DBG="/tmp/debuglog" # debug log when passed -d
|
||||
RUN="/run/archiso/bootmnt/arch/boot" # path for live /boot
|
||||
LNG="/usr/share/archlabs/installer/lang" # translation file path
|
||||
BT="$DIST Installer - v$VER" # backtitle used for dialogs
|
||||
VM="$(dmesg | grep -i "hypervisor")" # is the system a vm
|
||||
|
||||
ROOT_PART="" # root partition
|
||||
BOOT_PART="" # boot partition
|
||||
BOOT_DEVICE="" # device used for BIOS grub install
|
||||
AUTO_BOOT_PART="" # filled with the boot partition from auto_partiton()
|
||||
BOOTLDR="" # bootloader selected
|
||||
EXTRA_MNT="" # holder for additional partitions while mounting
|
||||
EXTRA_MNTS="" # when an extra partition is mounted append it's info
|
||||
SWAP_PART="" # swap partition or file path
|
||||
SWAP_SIZE="" # when using a swapfile use this size
|
||||
NEWUSER="" # username for the primary user
|
||||
USER_PASS="" # password for the primary user
|
||||
ROOT_PASS="" # root password
|
||||
LOGIN_WM="" # default login session
|
||||
LOGIN_TYPE="" # login manager can be lightdm or xinit
|
||||
INSTALL_WMS="" # space separated list of chosen wm/de
|
||||
KERNEL="" # kernel can be linux or linux-lts
|
||||
WM_PACKAGES="" # full list of packages added during wm/de choice
|
||||
PACKAGES="" # list of all packages to install including WM_PACKAGES
|
||||
MYSHELL="" # login shell for root and the primary user
|
||||
UCODE="" # cpu manufacturer microcode filename (if any)
|
||||
HOOKS="shutdown" # list of additional HOOKS to add in /etc/mkinitcpio.conf
|
||||
|
||||
LUKS="" # empty when not using luks encryption
|
||||
LUKS_DEV="" # boot parameter string for LUKS
|
||||
LUKS_PART="" # partition used for encryption
|
||||
LUKS_PASS="" # encryption password
|
||||
LUKS_UUID="" # encrypted partition UUID
|
||||
LUKS_NAME="" # name used for encryption
|
||||
|
||||
LVM="" # empty when not using lvm
|
||||
GROUP_PARTS=() # partitions used for volume group
|
||||
VOL_GROUP_MB=0 # available space in volume group
|
||||
|
||||
WARN=false # issued mounting/partitioning warning
|
||||
CONFIG_DONE=false # basic configuration is finished
|
||||
SEP_BOOT=false # separate boot partition for BIOS
|
||||
AUTOLOGIN=false # enable autologin for xinit
|
||||
BROADCOM_WL=false # fixes for broadcom cards eg. BCM4352
|
||||
# }
|
||||
|
||||
# amount of RAM in the system in Mb
|
||||
SYS_MEM="$(awk '/MemTotal/ {
|
||||
print int($2 / 1024)"M"
|
||||
@ -2607,8 +2586,8 @@ CMAPS="$(find /usr/share/kbd/keymaps -name '*.map.gz' | awk '{
|
||||
|
||||
# command used to install each bootloader
|
||||
declare -A BCMDS=(
|
||||
[syslinux]="syslinux-install_update -iam"
|
||||
[grub]="grub-install --recheck --force"
|
||||
[syslinux]="syslinux-install_update -iam"
|
||||
[systemd-boot]="bootctl --path=/boot install"
|
||||
)
|
||||
|
||||
@ -2643,24 +2622,24 @@ declare -A WM_EXT=(
|
||||
[gnome]=""
|
||||
[plasma]="kdebase-meta"
|
||||
[bspwm]="sxhkd archlabs-skel-bspwm rofi archlabs-polybar"
|
||||
[xfce4]="xfce4-goodies xfce4-pulseaudio-plugin network-manager-applet volumeicon rofi archlabs-skel-xfce4 xdg-user-dirs"
|
||||
[i3-gaps]="i3status perl-anyevent-i3 archlabs-skel-i3-gaps rofi archlabs-polybar"
|
||||
[openbox]="obconf archlabs-skel-openbox jgmenu archlabs-polybar tint2 conky rofi"
|
||||
[xfce4]="xfce4-goodies xfce4-pulseaudio-plugin network-manager-applet volumeicon rofi archlabs-skel-xfce4 xdg-user-dirs"
|
||||
)
|
||||
|
||||
# files the user can edit during the final stage of install
|
||||
declare -A EDIT_FILES=(
|
||||
[keyboard]="/etc/X11/xorg.conf.d/00-keyboard.conf /etc/default/keyboard"
|
||||
[console]="/etc/vconsole.conf"
|
||||
[locale]="/etc/locale.conf /etc/default/locale"
|
||||
[hostname]="/etc/hostname /etc/hosts"
|
||||
[sudoers]="/etc/sudoers"
|
||||
[mkinitcpio]="/etc/mkinitcpio.conf"
|
||||
[fstab]="/etc/fstab"
|
||||
[crypttab]="/etc/crypttab"
|
||||
[bootloader]="/boot/loader/entries/$DIST.conf"
|
||||
[pacman]="/etc/pacman.conf"
|
||||
[login]="" # login files.. Populated later once login method is chosen
|
||||
[fstab]="/etc/fstab"
|
||||
[sudoers]="/etc/sudoers"
|
||||
[crypttab]="/etc/crypttab"
|
||||
[pacman]="/etc/pacman.conf"
|
||||
[console]="/etc/vconsole.conf"
|
||||
[mkinitcpio]="/etc/mkinitcpio.conf"
|
||||
[hostname]="/etc/hostname /etc/hosts"
|
||||
[bootloader]="/boot/loader/entries/$DIST.conf"
|
||||
[locale]="/etc/locale.conf /etc/default/locale"
|
||||
[keyboard]="/etc/X11/xorg.conf.d/00-keyboard.conf /etc/default/keyboard"
|
||||
)
|
||||
|
||||
# PKG_EXT: if you add a package to $PACKAGES in any dialog
|
||||
@ -2671,29 +2650,39 @@ declare -A PKG_EXT=(
|
||||
[vlc]="qt4"
|
||||
[mpd]="mpc"
|
||||
[mupdf]="mupdf-tools"
|
||||
[qutebrowser]="qt5ct qt5-styleplugins"
|
||||
[qt5ct]="qt5-styleplugins"
|
||||
[vlc]="qt5ct qt5-styleplugins"
|
||||
[zathura]="zathura-pdf-poppler"
|
||||
[noto-fonts]="noto-fonts-emoji"
|
||||
[cairo-dock]="cairo-dock-plug-ins"
|
||||
[qbittorrent]="qt5ct qt5-styleplugins"
|
||||
[qutebrowser]="qt5ct qt5-styleplugins"
|
||||
[kdenlive]="kdebase-meta dvdauthor frei0r-plugins breeze breeze-gtk qt5ct qt5-styleplugins"
|
||||
)
|
||||
|
||||
# mkfs command to format a partition as a given file system
|
||||
declare -A FS_CMDS=(
|
||||
[ext2]="mkfs.ext2 -q" [ext3]="mkfs.ext3 -q" [ext4]="mkfs.ext4 -q"
|
||||
[f2fs]="mkfs.f2fs" [jfs]="mkfs.jfs -q" [xfs]="mkfs.xfs -f"
|
||||
[nilfs2]="mkfs.nilfs2 -q" [ntfs]="mkfs.ntfs -q" [reiserfs]="mkfs.reiserfs -q"
|
||||
[ext2]="mkfs.ext2 -q"
|
||||
[ext3]="mkfs.ext3 -q"
|
||||
[ext4]="mkfs.ext4 -q"
|
||||
[f2fs]="mkfs.f2fs"
|
||||
[jfs]="mkfs.jfs -q"
|
||||
[xfs]="mkfs.xfs -f"
|
||||
[vfat]="mkfs.vfat -F32"
|
||||
[nilfs2]="mkfs.nilfs2 -q"
|
||||
[ntfs]="mkfs.ntfs -q"
|
||||
[reiserfs]="mkfs.reiserfs -q"
|
||||
)
|
||||
|
||||
# mount options for a given file system
|
||||
declare -A FS_OPTS=([vfat]="" [ntfs]="" [ext2]="" [ext3]=""
|
||||
[ext4]="discard - off dealloc - off nofail - off noacl - off relatime - off noatime - off nobarrier - off nodelalloc - off"
|
||||
declare -A FS_OPTS=(
|
||||
[vfat]=""
|
||||
[ntfs]=""
|
||||
[ext2]=""
|
||||
[ext3]=""
|
||||
[jfs]="discard - off errors=continue - off errors=panic - off nointegrity - off"
|
||||
[reiserfs]="acl - off nolog - off notail - off replayonly - off user_xattr - off"
|
||||
[ext4]="discard - off dealloc - off nofail - off noacl - off relatime - off noatime - off nobarrier - off nodelalloc - off"
|
||||
[xfs]="discard - off filestreams - off ikeep - off largeio - off noalign - off nobarrier - off norecovery - off noquota - off wsync - off"
|
||||
[nilfs2]="discard - off nobarrier - off errors=continue - off errors=panic - off order=relaxed - off order=strict - off norecovery - off"
|
||||
[f2fs]="data_flush - off disable_roll_forward - off disable_ext_identify - off discard - off fastboot - off flush_merge - off inline_xattr - off inline_data - off inline_dentry - off no_heap - off noacl - off nobarrier - off noextent_cache - off noinline_data - off norecovery - off"
|
||||
@ -2712,9 +2701,7 @@ done
|
||||
# initial prep
|
||||
|
||||
#select_language
|
||||
src $LNG/english.trans
|
||||
FONT="ter-i16n"
|
||||
LOC="en_US.UTF-8"
|
||||
src /usr/share/archlabs/installer/lang/english.trans
|
||||
|
||||
select_keymap
|
||||
system_checks
|
||||
|
Reference in New Issue
Block a user