Create fallback config for systemd-boot

This commit is contained in:
natemaia 2019-01-12 16:56:00 -08:00
parent b4e5e00147
commit 7efdb466a7
4 changed files with 106 additions and 151 deletions

View File

@ -1,9 +1,9 @@
# ArchLabs Installer # ArchLabs Installer
#### Features #### Features
- LUKS/LVM
- Basic setup - LUKS/LVM setup
- Auto partition - Full device auto partition
- Package selection - Package selection
- Error detection - Error detection
- Written in Bash - Written in Bash
@ -11,23 +11,23 @@
#### Requirements #### Requirements
- Network connection. - `coreutils`
- `parted` for partition creation. - `parted` for partition creation.
- `rsync` for unpacking the squashfs. - `rsync` for unpacking the squashfs.
- `dialog` for all user input/output. - `dialog` for all user input/output.
- `vim` for editing files post install. - `vim` for editing files post install.
- `chpasswd` to set root and user passwords.
- `curl` for network check and mirrorlist download - `curl` for network check and mirrorlist download
- `arch-chroot` to perform operations in a chroot. - `arch-chroot` to perform operations in a chroot.
- `chpasswd` to set root and user passwords.
- `coreutils`
#### Manual Installation #### Manual Installation
``` ```
sh -c "$(curl -fsSL https://bitbucket.org/archlabslinux/installer/raw/master/install.sh)" sh -c "$(curl -fsSL https://bitbucket.org/archlabslinux/installer/raw/master/install.sh)"
``` ```
---
- A packaged version can also be found in our repos: A packaged version can also be found in our repos:
[stable](https://bitbucket.org/archlabslinux/archlabs_repo/src/master/x86_64/) [stable](https://bitbucket.org/archlabslinux/archlabs_repo/src/master/x86_64/)
[unstable](https://bitbucket.org/archlabslinux/archlabs_unstable/src/master/x86_64/) [unstable](https://bitbucket.org/archlabslinux/archlabs_unstable/src/master/x86_64/)

View File

@ -20,12 +20,12 @@ _WelBody="\nThis will unpack and help you setup $DIST on your system.\n\n\nMenu
# Requirements # Requirements
_NotRoot="\nThis installer must be run as root or using sudo.\n" _NotRoot="\nThis installer must be run as root or using sudo.\n"
_Not64Bit="\nThis installer only supports x86_64 capable hardware or virtual machines.\n" _Not64Bit="\nThis installer only supports x86_64 capable machines.\n"
_NoNetwork="\nThis installer needs to be run with an active internet connection in order to update and install packages.\n" _NoNetwork="\nThis installer needs to be run with an active internet connection in order to update and install packages.\n"
# Preparation Menu # Preparation Menu
_PrepTitle="Prepare System for Install" _PrepTitle="Prepare System for Install"
_PrepBody="\nThis is the menu in which you will prepare your system for the install.\n\nTo begin the install you must first have:\n\n - A root (/) partition mounted (UEFI systems also require a seperate boot partition)\n - System settings must be configured\n - A new user must be created and the passwords set.\n\nIf you have already created your partition(s) there is no need to use the edit partition step, simply move on to mounting." _PrepBody="\nThis is the menu in which you will prepare your system for the install.\n\nTo begin the install you must first have:\n\n - A root (/) partition mounted (UEFI systems also require a seperate boot partition)\n - System settings must be configured\n - A new user must be created and the passwords set.\n\nIf you have already created your partition(s) there is no need to use the edit partition step, simply move on to mounting."
_PrepLayout="Select keyboard layout" _PrepLayout="Select keyboard layout"
_PrepShowDev="Show device tree (optional)" _PrepShowDev="Show device tree (optional)"
_PrepParts="Edit partitions (optional)" _PrepParts="Edit partitions (optional)"
@ -83,9 +83,9 @@ _WMLoginBody="\nSelect which to use as your primary login session.\n\nThis can b
# Set keymap, hwclock, local and timezone # Set keymap, hwclock, local and timezone
_CMapTitle="Virtual Console Keymap" _CMapTitle="Virtual Console Keymap"
_CMapBody="\nSelect virtual console keymap.\n\nVirtual console is the shell prompt before reaching a graphical environment (Xorg).\n\nIts keymap is seperate from the one used by Xorg.\n\nDefault: us" _CMapBody="\nSelect virtual console keymap, virtual console is the shell before reaching a graphical environment (Xorg).\n\nIts keymap is seperate from the one used by Xorg.\n\nDefault: us"
_XMapBody="\nSelect the system wide keymap, this is the keyboard layout used once a graphical environment (Xorg) is running.\n\nIf a matching virtual console keymap exists it will be used, otherwise you will be asked to pick one.\n\nDefault: us" _XMapBody="\nSelect the system wide keymap, this is the keyboard layout used once a graphical environment (Xorg) is running.\n\nIf a matching virtual console keymap exists it will be used, otherwise you will be asked to pick one.\n\nDefault: us"
_LocaleBody="\nLocale determines the system language and currency formats.\n\nThe format for locale name structure is languagecode_COUNTRYCODE\n\neg. en_US is: english United States\n en_GB is: english Great Britain" _LocaleBody="\nLocale determines the system language and currency formats.\n\nThe format for locale names is languagecode_COUNTRYCODE\n\neg. en_US is: english United States\n en_GB is: english Great Britain"
# Configure # Configure
_ConfLocale="System Language and Locale" _ConfLocale="System Language and Locale"
@ -107,7 +107,7 @@ _MntSucc="\nMount Succeeded!\n"
_MntFail="\nMount Failed!\n" _MntFail="\nMount Failed!\n"
_WarnMount="\nIMPORTANT: Please choose carefully during mounting and formatting.\n\nDuring mounting, partitions can be mounted without formatting by selecting '$_Skip'.\nThis can be useful for data partitions or previously formatted partitions.\n\nThe one exception to this is the root (/) partition, it must be formatted before unpacking to ensure the system stability.\n" _WarnMount="\nIMPORTANT: Please choose carefully during mounting and formatting.\n\nDuring mounting, partitions can be mounted without formatting by selecting '$_Skip'.\nThis can be useful for data partitions or previously formatted partitions.\n\nThe one exception to this is the root (/) partition, it must be formatted before unpacking to ensure the system stability.\n"
_MntBody="\nUse [Space] to de/select the desired mount options.\n\nIf the device is an SSD the 'discard' option provides active TRIM support and will be automatically selected.\n\nChoosing none will result in an automatic mount with system applied options." _MntBody="\nUse [Space] to de/select the desired mount options.\n\nIf the device is an SSD the 'discard' option provides active TRIM support and will be automatically selected.\n\nChoosing none will result in an automatic mount with system applied options."
_MntConfBody="\nConfirm the following mount options:" _MntConfBody="\nConfirm mount options:"
# Select Device # Select Device
_DevSelTitle="Select Device" _DevSelTitle="Select Device"
@ -150,7 +150,7 @@ _SelBiosBody="\nDo you want to use a separate boot partition? (required for LUKS
_SelSwpFile="Swapfile" _SelSwpFile="Swapfile"
_SelSwpSetup="Swap Setup" _SelSwpSetup="Swap Setup"
_SelSwpBody="\nSelect whether to use a swap partition, swapfile, or none.\n\nWhen selecting swapfile the size will be filled in to the size of your system memory, however this can be changed to suit your needs." _SelSwpBody="\nSelect whether to use a swap partition, swapfile, or none."
_SelSwpNone="None" _SelSwpNone="None"
_SelSwpErr="Swap Setup Error: Must be 1(M|G) or greater, and can only contain whole numbers\n\nSize Entered:" _SelSwpErr="Swap Setup Error: Must be 1(M|G) or greater, and can only contain whole numbers\n\nSize Entered:"
@ -158,8 +158,9 @@ _SelSwpSize="\nEnter the size to use for swap in MB or GB.\n\nFor ease of use an
_SelUefiBody="\nSelect the system EFI boot partition.\n\nThis is a required partition for booting UEFI systems. It's usually the first partition on the drive, less than 512M, and will be formatted as vfat/fat32 if not already." _SelUefiBody="\nSelect the system EFI boot partition.\n\nThis is a required partition for booting UEFI systems. It's usually the first partition on the drive, less than 512M, and will be formatted as vfat/fat32 if not already."
_FormUefiBody="IMPORTANT:\n\nThe EFI partition" _FormUefiBody="IMPORTANT:\n\nThe EFI partition"
_FormBiosBody="IMPORTANT:\n\nThe boot partition"
_FormUefiBody2="is already formatted as vfat/fat32.\n\nFor a clean install, previously existing partitions should be reformatted, however this removes ALL data (bootloaders) on the partition so choose carefully.\n\nDo you want to reformat the partition?\n" _FormUefiBody2="is already formatted as vfat/fat32.\n\nFor a clean install, previously existing partitions should be reformatted, however this removes ALL data (bootloaders) on the partition so choose carefully.\n\nDo you want to reformat the partition?\n"
_FormBiosBody="IMPORTANT:\n\nThe boot partition"
_FormBiosBody2="is already formatted as ext3/4.\n\nFor a clean install, previously existing partitions should be reformatted, however this removes ALL data (bootloaders) on the partition so choose carefully.\n\nDo you want to reformat the partition?\n"
# LUKS / DM-Crypt / Encryption # LUKS / DM-Crypt / Encryption
_LuksMenuBody="\nDevices and volumes encrypted using dm_crypt cannot be accessed or seen without being first unlocked." _LuksMenuBody="\nDevices and volumes encrypted using dm_crypt cannot be accessed or seen without being first unlocked."

View File

@ -8,7 +8,7 @@
# Some ideas and code has been taken from other installers # Some ideas and code has been taken from other installers
# AIF, Cnichi, Calamares, The Arch Wiki.. Credit where credit is due # AIF, Cnichi, Calamares, The Arch Wiki.. Credit where credit is due
VER="1.8.16" # version VER="1.8.21" # version
DIST="ArchLabs" # distributor DIST="ArchLabs" # distributor
MNT="/mnt" # mountpoint MNT="/mnt" # mountpoint
@ -135,7 +135,7 @@ cfg_menu()
tput civis tput civis
if ! LOCALE="$(dialog --cr-wrap --no-cancel --stdout --backtitle "$BT" \ if ! LOCALE="$(dialog --cr-wrap --no-cancel --stdout --backtitle "$BT" \
--title " $_ConfLocale " --menu "$_LocaleBody" 0 0 $((LINES - 10)) $LOCALES)"; then --title " $_ConfLocale " --menu "$_LocaleBody" 0 0 $((LINES - 20)) $LOCALES)"; then
return 1 return 1
fi fi
@ -202,7 +202,7 @@ select_keymap()
{ {
tput civis tput civis
if ! KEYMAP="$(dialog --cr-wrap --no-cancel --stdout --backtitle "$BT" \ if ! KEYMAP="$(dialog --cr-wrap --no-cancel --stdout --backtitle "$BT" \
--title " $_PrepLayout " --menu "$_XMapBody" 0 0 $((LINES - 10)) \ --title " $_PrepLayout " --menu "$_XMapBody" 0 0 $((LINES - 20)) \
'us' 'English' 'cm' 'English' 'gb' 'English' 'au' 'English' 'gh' 'English' \ 'us' 'English' 'cm' 'English' 'gb' 'English' 'au' 'English' 'gh' 'English' \
'za' 'English' 'ng' 'English' 'ca' 'French' 'cd' 'French' 'gn' 'French' \ 'za' 'English' 'ng' 'English' 'ca' 'French' 'cd' 'French' 'gn' 'French' \
'tg' 'French' 'fr' 'French' 'de' 'German' 'at' 'German' 'ch' 'German' \ 'tg' 'French' 'fr' 'French' 'de' 'German' 'at' 'German' 'ch' 'German' \
@ -230,7 +230,8 @@ select_keymap()
if [[ $CMAPS == *"$KEYMAP"* ]]; then if [[ $CMAPS == *"$KEYMAP"* ]]; then
CMAP="$KEYMAP" CMAP="$KEYMAP"
else else
if ! CMAP="$(menubox "$_CMapTitle" "$_CMapBody" $CMAPS)"; then if ! CMAP="$(dialog --cr-wrap --no-cancel --stdout --backtitle "$BT" \
--title " $_CMapTitle " --menu "$_CMapBody" 0 0 $((LINES - 17)) $CMAPS)"; then
return 1 return 1
fi fi
fi fi
@ -260,7 +261,7 @@ select_timezone()
fi fi
if ! SUBZONE="$(dialog --cr-wrap --no-cancel --stdout --backtitle "$BT" \ if ! SUBZONE="$(dialog --cr-wrap --no-cancel --stdout --backtitle "$BT" \
--title " $_TimeZTitle " --menu "$_TimeSubZBody" 0 0 $((LINES - 10)) ${SUBZONES[$ZONE]})"; then --title " $_TimeZTitle " --menu "$_TimeSubZBody" 0 0 $((LINES - 17)) ${SUBZONES[$ZONE]})"; then
return 1 return 1
fi fi
@ -630,7 +631,8 @@ partition()
"gparted -" \ "gparted -" \
"cfdisk" "-" \ "cfdisk" "-" \
"parted" "-" \ "parted" "-" \
"$_PartWipe" "-")"; then "$_PartWipe" "-" \
"$_Done" "-")"; then
return 1 return 1
fi fi
else else
@ -639,13 +641,16 @@ partition()
"$_PartAuto" "-" \ "$_PartAuto" "-" \
"cfdisk" "-" \ "cfdisk" "-" \
"parted" "-" \ "parted" "-" \
"$_PartWipe" "-")"; then "$_PartWipe" "-" \
"$_Done" "-")"; then
return 1 return 1
fi fi
fi fi
tput civis tput civis
if [[ $choice != "$_PartWipe" && $choice != "$_PartAuto" && $choice != "$_PartShowTree" ]]; then if [[ $choice == "$_Done" || $choice == "" ]]; then
return 0
elif [[ $choice != "$_PartWipe" && $choice != "$_PartAuto" && $choice != "$_PartShowTree" ]]; then
clear; tput cnorm; $choice $device clear; tput cnorm; $choice $device
elif [[ $choice == "$_PartShowTree" ]]; then elif [[ $choice == "$_PartShowTree" ]]; then
msgbox "$_PrepShowDev" "\n$(lsblk -o NAME,MODEL,TYPE,FSTYPE,SIZE,MOUNTPOINT "$device")\n" msgbox "$_PrepShowDev" "\n$(lsblk -o NAME,MODEL,TYPE,FSTYPE,SIZE,MOUNTPOINT "$device")\n"
@ -868,10 +873,10 @@ mount_partition()
mkdir -p "$mountp" mkdir -p "$mountp"
if [[ $fs && ${FS_OPTS[$fs]} && $part != "$BOOT_PART" ]] && select_mount_opts "$part" "$fs"; then if [[ $fs && ${FS_OPTS[$fs]} && $part != "$BOOT_PART" ]] && select_mount_opts "$part" "$fs"; then
mount -o $MNT_OPTS $part "$mountp" 2>$ERR mount -o $MNT_OPTS "$part" "$mountp" 2>$ERR
errshow "mount -o $MNT_OPTS $part $mountp" errshow "mount -o $MNT_OPTS $part $mountp"
else else
mount $part "$mountp" 2>$ERR mount "$part" "$mountp" 2>$ERR
errshow "mount $part $mountp" errshow "mount $part $mountp"
fi fi
@ -1113,7 +1118,7 @@ select_boot_partition()
BOOT_PART="" BOOT_PART=""
else else
if grep -q 'ext[34]' <<< "$(fsck -N "$BOOT_PART")"; then if grep -q 'ext[34]' <<< "$(fsck -N "$BOOT_PART")"; then
local msg="$_FormBiosBody $BOOT_PART $_FormUefiBody2" local msg="$_FormBiosBody $BOOT_PART $_FormBiosBody2"
if [[ $AUTO_BOOT_PART != "$BOOT_PART" ]] && yesno "$_PrepMount" "$msg" "Format $BOOT_PART" "Skip Formatting" "no"; then if [[ $AUTO_BOOT_PART != "$BOOT_PART" ]] && yesno "$_PrepMount" "$msg" "Format $BOOT_PART" "Skip Formatting" "no"; then
format "$BOOT_PART" "ext4" format "$BOOT_PART" "ext4"
sleep 1 sleep 1
@ -1173,7 +1178,7 @@ install()
clear clear
tput cnorm tput cnorm
install_base install_base
printf "\nGenerating system /etc/fstab\n\n" printf "Generating system /etc/fstab\n"
genfstab -U $MNT >$MNT/etc/fstab 2>$ERR genfstab -U $MNT >$MNT/etc/fstab 2>$ERR
echeck "genfstab -U $MNT >$MNT/etc/fstab" echeck "genfstab -U $MNT >$MNT/etc/fstab"
[[ -f $MNT/swapfile ]] && sed -i "s~${MNT}~~" $MNT/etc/fstab [[ -f $MNT/swapfile ]] && sed -i "s~${MNT}~~" $MNT/etc/fstab
@ -1195,20 +1200,21 @@ install_base()
echeck "rsync -ahv /run/archiso/sfs/airootfs/ $MNT/" echeck "rsync -ahv /run/archiso/sfs/airootfs/ $MNT/"
else else
mirrorlist_sort mirrorlist_sort
pacstrap $MNT base $KERNEL $UCODE $(grep -hv '^#' /usr/share/archlabs/installer/packages.txt) 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)" echeck "pacstrap $MNT base $KERNEL $UCODE $(grep -hv '^#' /usr/share/archlabs/installer/packages.txt)"
fi fi
printf "\nRemoving archiso remains\n\n" printf "Removing archiso remains\n"
rm -rf $MNT/etc/mkinitcpio-archiso.conf rm -rf $MNT/etc/mkinitcpio-archiso.conf
find $MNT/usr/lib/initcpio -name 'archiso*' -type f -exec rm -rf '{}' \; find $MNT/usr/lib/initcpio -name 'archiso*' -type f -exec rm -rf '{}' \;
sed -i 's/volatile/auto/g' $MNT/etc/systemd/journald.conf sed -i 's/volatile/auto/g' $MNT/etc/systemd/journald.conf
if [[ $VM ]]; then if [[ $VM ]]; then
printf "\nRemoving xorg configs in /etc/X11/xorg.conf.d/ to avoid conflict in VMs\n\n" printf "Removing xorg configs in /etc/X11/xorg.conf.d/ to avoid conflict in VMs\n"
rm -rfv $MNT/etc/X11/xorg.conf.d/*?.conf rm -rfv $MNT/etc/X11/xorg.conf.d/*?.conf
sleep 1
elif [[ $(lspci | grep ' VGA ' | grep 'Intel') != "" ]]; then elif [[ $(lspci | grep ' VGA ' | grep 'Intel') != "" ]]; then
printf "\nCreating intel GPU 'TearFree' config in /etc/X11/xorg.conf.d/20-intel.conf\n\n" printf "Creating intel GPU 'TearFree' config in /etc/X11/xorg.conf.d/20-intel.conf\n"
cat > $MNT/etc/X11/xorg.conf.d/20-intel.conf <<EOF cat > $MNT/etc/X11/xorg.conf.d/20-intel.conf <<EOF
Section "Device" Section "Device"
Identifier "Intel Graphics" Identifier "Intel Graphics"
@ -1219,18 +1225,18 @@ EOF
fi fi
if [[ -e /run/archiso/sfs/airootfs ]]; then if [[ -e /run/archiso/sfs/airootfs ]]; then
printf "\nCopying vmlinuz and ucode to /boot\n\n" printf "Copying vmlinuz and ucode to /boot\n"
[[ $KERNEL != 'linux-lts' ]] && cp -vf $RUN/x86_64/vmlinuz $MNT/boot/vmlinuz-linux [[ $KERNEL != 'linux-lts' ]] && cp -vf $RUN/x86_64/vmlinuz $MNT/boot/vmlinuz-linux
[[ $UCODE && ! $VM ]] && cp -vf $RUN/${UCODE/-/_}.img $MNT/boot/${UCODE}.img [[ $UCODE && ! $VM ]] && cp -vf $RUN/${UCODE/-/_}.img $MNT/boot/${UCODE}.img
fi fi
printf "\nCopying network settings to /etc\n\n" printf "Copying network settings to /etc\n"
cp -fv /etc/resolv.conf $MNT/etc/ cp -fv /etc/resolv.conf $MNT/etc/
if [[ -e /etc/NetworkManager/system-connections ]]; then if [[ -e /etc/NetworkManager/system-connections ]]; then
cp -rvf /etc/NetworkManager/system-connections $MNT/etc/NetworkManager/ cp -rvf /etc/NetworkManager/system-connections $MNT/etc/NetworkManager/
fi fi
printf "\nSetting locale to $LOCALE\n\n" printf "Setting locale to $LOCALE\n"
cat > $MNT/etc/locale.conf << EOF cat > $MNT/etc/locale.conf << EOF
LANG=$LOCALE LANG=$LOCALE
EOF EOF
@ -1238,17 +1244,17 @@ EOF
LANG=$LOCALE LANG=$LOCALE
EOF EOF
sed -i "s/#en_US.UTF-8/en_US.UTF-8/g; s/#${LOCALE}/${LOCALE}/g" $MNT/etc/locale.gen sed -i "s/#en_US.UTF-8/en_US.UTF-8/g; s/#${LOCALE}/${LOCALE}/g" $MNT/etc/locale.gen
chrun "echo && locale-gen" 2>/dev/null chrun "locale-gen" 2>/dev/null
printf "\nSetting timezone: $ZONE/$SUBZONE\n\n" 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" 2>/dev/null
if [[ $BROADCOM_WL == true ]]; then if [[ $BROADCOM_WL == true ]]; then
printf "\nBlacklisting modules for broadcom wireless: bmca\n\n" printf "Blacklisting modules for broadcom wireless: bmca\n"
echo 'blacklist bcma' >> $MNT/etc/modprobe.d/blacklist.conf echo 'blacklist bcma' >> $MNT/etc/modprobe.d/blacklist.conf
rm -f $MNT/etc/modprobe/ rm -f $MNT/etc/modprobe/
fi fi
printf "\nCreating keyboard configurations for keymap: $KEYMAP\n\n" printf "Creating keyboard configurations for keymap: $KEYMAP\n"
cat > $MNT/etc/X11/xorg.conf.d/00-keyboard.conf <<EOF cat > $MNT/etc/X11/xorg.conf.d/00-keyboard.conf <<EOF
# Use localectl(1) to instruct systemd-localed to update it. # Use localectl(1) to instruct systemd-localed to update it.
Section "InputClass" Section "InputClass"
@ -1270,7 +1276,7 @@ EOF
KEYMAP=$CMAP KEYMAP=$CMAP
FONT=$FONT FONT=$FONT
EOF EOF
printf "\nSetting system hostname: $HOSTNAME\n\n" printf "Setting system hostname: $HOSTNAME\n"
cat > $MNT/etc/hostname << EOF cat > $MNT/etc/hostname << EOF
$HOSTNAME $HOSTNAME
EOF EOF
@ -1286,11 +1292,10 @@ EOF
create_user() create_user()
{ {
printf "\nCreating user $NEWUSER, setting passwords, and setting shell\n\n" printf "Creating user $NEWUSER, setting passwords, and setting shell\n"
# set root password, shell if needed # set root password, shell if needed
chrun "chpasswd <<< 'root:$ROOT_PASS'" chrun "chpasswd <<< 'root:$ROOT_PASS'"
cp -rf /etc/skel/. $MNT/root/
if [[ $MYSHELL != *zsh ]]; then if [[ $MYSHELL != *zsh ]]; then
chrun "usermod -s $MYSHELL root" chrun "usermod -s $MYSHELL root"
if [[ $MYSHELL == "/usr/bin/mksh" ]]; then if [[ $MYSHELL == "/usr/bin/mksh" ]]; then
@ -1312,8 +1317,10 @@ create_user()
cp -rfv $MNT/home/$NEWUSER/.vim/colors $MNT/home/$NEWUSER/.config/nvim/colors cp -rfv $MNT/home/$NEWUSER/.vim/colors $MNT/home/$NEWUSER/.config/nvim/colors
fi fi
[[ $INSTALL_WMS =~ dwm ]] && suckless_install [[ $INSTALL_WMS =~ dwm ]] && suckless_install
[[ $INSTALL_WMS == 'plasma' || $LOGIN_WM == 'startkde' || $INSTALL_WMS == 'gnome' || $LOGIN_WM == 'gnome-session' ]] && if [[ $INSTALL_WMS == 'plasma' || $LOGIN_WM == 'startkde' || $INSTALL_WMS == 'gnome' || $LOGIN_WM == 'gnome-session' ]]
then
sed -i '/super/d' $HOME/.xprofile /root/.xprofile sed -i '/super/d' $HOME/.xprofile /root/.xprofile
fi
return 0 return 0
} }
@ -1323,7 +1330,7 @@ setup_xinit()
if [[ -e $MNT/home/$NEWUSER/.xinitrc ]]; then if [[ -e $MNT/home/$NEWUSER/.xinitrc ]]; then
sed -i "s/openbox-session/${LOGIN_WM}/g" $MNT/home/$NEWUSER/.xinitrc sed -i "s/openbox-session/${LOGIN_WM}/g" $MNT/home/$NEWUSER/.xinitrc
else else
printf "%s\n" "exec $LOGIN_WM" > $MNT/home/$NEWUSER/.xinitrc printf "exec $LOGIN_WM\n" > $MNT/home/$NEWUSER/.xinitrc
fi fi
# automatic startx for login shells # automatic startx for login shells
@ -1402,7 +1409,7 @@ EOF
login_manager() login_manager()
{ {
printf "\nSetting up $LOGIN_TYPE\n\n" printf "Setting up $LOGIN_TYPE\n"
SERVICE="$MNT/etc/systemd/system/getty@tty1.service.d" SERVICE="$MNT/etc/systemd/system/getty@tty1.service.d"
# remove welcome message # remove welcome message
@ -1435,13 +1442,13 @@ run_mkinitcpio()
[[ $LUKS ]] && add="encrypt" [[ $LUKS ]] && add="encrypt"
[[ $LVM ]] && { [[ $add ]] && add+=" lvm2" || add+="lvm2"; } [[ $LVM ]] && { [[ $add ]] && add+=" lvm2" || add+="lvm2"; }
sed -i "s/block filesystems/block ${add} filesystems ${HOOKS}/g" $MNT/etc/mkinitcpio.conf sed -i "s/block filesystems/block ${add} filesystems ${HOOKS}/g" $MNT/etc/mkinitcpio.conf
chrun "mkinitcpio -p $KERNEL" 2>$ERR || chrun "mkinitcpio -p $KERNEL" 2>$ERR chrun "mkinitcpio -p $KERNEL" 2>$ERR
echeck "mkinitcpio -p $KERNEL" echeck "mkinitcpio -p $KERNEL"
} }
mirrorlist_sort() mirrorlist_sort()
{ {
printf "\n%s\n\n" "Sorting the mirrorlist" printf "Sorting the mirrorlist\n"
if hash reflector >/dev/null 2>&1; then if hash reflector >/dev/null 2>&1; then
$MIRROR_CMD --save $MNT/etc/pacman.d/mirrorlist --verbose || $MIRROR_CMD --save $MNT/etc/pacman.d/mirrorlist --verbose ||
reflector --score 100 -l 50 -f 10 --sort rate --verbose --save $MNT/etc/pacman.d/mirrorlist reflector --score 100 -l 50 -f 10 --sort rate --verbose --save $MNT/etc/pacman.d/mirrorlist
@ -1465,22 +1472,22 @@ package_operations()
# update first to avoid database access errors # update first to avoid database access errors
chrun "pacman -Syyu --noconfirm" chrun "pacman -Syyu --noconfirm"
if ! [[ $INSTALL_WMS == 'plasma' || $INSTALL_WMS == 'gnome' || $INSTALL_WMS == 'cinnamon' ]]; then if [[ $BOOTLDR == 'grub' ]]; then
chrun "pacman -S archlabs-ksuperkey --noconfirm --needed" chrun "pacman -Rns $rmpkg grub --noconfirm"
else
chrun "pacman -Rns $rmpkg --noconfirm"
fi fi
if [[ $BOOTLDR != 'grub' ]]; then
chrun "pacman -Rns grub --noconfirm"
fi
chrun "pacman -Rns $rmpkg --noconfirm"
chrun "pacman -S iputils --noconfirm" 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 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" 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 [[ $LOGIN_TYPE == 'xinit' ]]; then
chrun "pacman -S xorg-xinit --needed --noconfirm"
fi
if [[ $inpkg =~ (openbox|dwm|bspwm|i3) ]]; then 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" 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"
fi fi
if ! [[ $INSTALL_WMS == 'plasma' || $INSTALL_WMS == 'gnome' || $INSTALL_WMS == 'cinnamon' ]]; then
chrun "pacman -S archlabs-ksuperkey --noconfirm --needed"
fi
sed -i "s/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g" $MNT/etc/sudoers sed -i "s/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g" $MNT/etc/sudoers
return 0 return 0
} }
@ -1488,7 +1495,7 @@ package_operations()
suckless_install() suckless_install()
{ {
# install and setup dwm # install and setup dwm
printf "\n%s\n\n" "Installing and setting up dwm." printf "Installing and setting up dwm\n"
mkdir -pv $MNT/home/$NEWUSER/suckless mkdir -pv $MNT/home/$NEWUSER/suckless
for i in dwm dmenu st; do for i in dwm dmenu st; do
@ -1498,13 +1505,12 @@ suckless_install()
if (( e == 0 )); then if (( e == 0 )); then
chrun "cd $p; rm -f config.h; make clean install; make clean" chrun "cd $p; rm -f config.h; make clean install; make clean"
else else
printf "\n\nFailed to clone $i repo\n\n" printf "Failed to clone $i repo\n"
fi fi
done done
if [[ -d /home/$NEWUSER/suckless/dwm ]]; then if [[ -d /home/$NEWUSER/suckless/dwm ]]; then
printf "\n\n%s" "To configure dwm edit /home/$NEWUSER/suckless/dwm/config.h" printf "To configure dwm edit /home/$NEWUSER/suckless/dwm/config.h\n"
printf "\n%s\n\n" "You can then recompile it with 'sudo make clean install'" printf "You can then recompile it with 'sudo make clean install'\n"
sleep 2 sleep 2
fi fi
} }
@ -1607,6 +1613,12 @@ title $DIST Linux
linux /vmlinuz-${KERNEL}$([[ $UCODE ]] && printf "\ninitrd %s" "/${UCODE}.img") linux /vmlinuz-${KERNEL}$([[ $UCODE ]] && printf "\ninitrd %s" "/${UCODE}.img")
initrd /initramfs-$KERNEL.img initrd /initramfs-$KERNEL.img
options root=$ROOT_PART_ID $([[ $LUKS_DEV ]] && printf "%s " "$LUKS_DEV")rw options root=$ROOT_PART_ID $([[ $LUKS_DEV ]] && printf "%s " "$LUKS_DEV")rw
EOF
cat > ${MNT}${BMNTS[$SYS-systemd-boot]}/loader/entries/${DIST}-fallback.conf << EOF
title $DIST Linux Fallback
linux /vmlinuz-${KERNEL}$([[ $UCODE ]] && printf "\ninitrd %s" "/${UCODE}.img")
initrd /initramfs-$KERNEL-fallback.img
options root=$ROOT_PART_ID $([[ $LUKS_DEV ]] && printf "%s " "$LUKS_DEV")rw
EOF EOF
# add pacman hook to update the bootloader when systemd receives an update # add pacman hook to update the bootloader when systemd receives an update
mkdir -p $MNT/etc/pacman.d/hooks mkdir -p $MNT/etc/pacman.d/hooks
@ -1679,8 +1691,8 @@ install_bootloader()
fi fi
prerun_$BOOTLDR prerun_$BOOTLDR
printf "\nInstalling and setting up $BOOTLDR in ${BMNTS[$SYS-$BOOTLDR]}\n\n" printf "Installing and setting up $BOOTLDR in ${BMNTS[$SYS-$BOOTLDR]}\n"
chrun "${BCMDS[$BOOTLDR]}" chrun "${BCMDS[$BOOTLDR]}" 2>$ERR
echeck "${BCMDS[$BOOTLDR]}" echeck "${BCMDS[$BOOTLDR]}"
if [[ -d $MNT/hostrun ]]; then if [[ -d $MNT/hostrun ]]; then
@ -2018,10 +2030,7 @@ luks_open()
return 1 return 1
fi fi
if ! luks_pass "$_LuksOpen" "${LUKS_NAME:-cryptroot}"; then luks_pass "$_LuksOpen" "${LUKS_NAME:-cryptroot}" || return 1
return 1
fi
infobox "$_LuksOpen" "$_LuksOpenWaitBody $LUKS_NAME $_LuksWaitBody2 $LUKS_PART\n" 0 infobox "$_LuksOpen" "$_LuksOpenWaitBody $LUKS_NAME $_LuksWaitBody2 $LUKS_PART\n" 0
cryptsetup open --type luks $LUKS_PART "$LUKS_NAME" <<< "$LUKS_PASS" 2>$ERR cryptsetup open --type luks $LUKS_PART "$LUKS_NAME" <<< "$LUKS_PASS" 2>$ERR
errshow "cryptsetup open --type luks $LUKS_PART $LUKS_NAME" errshow "cryptsetup open --type luks $LUKS_PART $LUKS_NAME"
@ -2169,7 +2178,7 @@ src()
{ {
# source file ($1), if it fails we die with an error message # source file ($1), if it fails we die with an error message
if ! . "$1" 2>/dev/null; then if ! . "$1" 2>/dev/null; then
printf "\nFailed to source file %s\n" "$1" printf "Failed to source file %s\n" "$1"
die 1 die 1
fi fi
return 0 return 0
@ -2219,7 +2228,7 @@ die()
sigint() sigint()
{ {
# used to trap SIGINT and cleanly exit the program # used to trap SIGINT and cleanly exit the program
printf "\nCTRL-C caught\nCleaning up...\n" printf "CTRL-C caught\nCleaning up...\n"
die 1 die 1
} }
@ -2227,29 +2236,21 @@ print4()
{ {
# takes an arbitrary number of input fields and prints them out in fourths on separate lines # takes an arbitrary number of input fields and prints them out in fourths on separate lines
local str="$*" local str="$*"
if [[ ${#str} -gt $((COLUMNS / 2)) ]]; then if [[ ${#str} -gt $((COLUMNS - 5)) ]]; then
str="$(awk -v q="$(awk '{print int(NF / 4)}' <<< "$str")" '{ str="$(awk '{
pkgs1=pkgs2=pkgs3=pkgs4="" p1=p2=p3=p4=""
for (i=1; i<q; i++) { p1=$1
if (i == 1) { q=int(NF / 4)
pkgs1=$i for (i=2; i<=q; i++) { p1=p1" "$i }
} else { for (i=q; i<=q*2; i++) { p2=p2" "$i }
pkgs1=pkgs1" "$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
for (i=q; i<q * 2; i++) {
pkgs2=pkgs2" "$i
}
for (i=q * 2; i<q * 3; i++) {
pkgs3=pkgs3" "$i
}
for (i=q * 3; i<NF; i++) {
pkgs4=pkgs4" "$i
}
printf "%s\n %s\n %s\n %s", pkgs1, pkgs2, pkgs3, pkgs4
}' <<< "$str")" }' <<< "$str")"
printf "%s\n" "$str"
elif [[ $str ]]; then
printf "%s\n" "$str"
fi fi
printf "%s\n" "$str"
} }
system_devices() system_devices()
@ -2389,7 +2390,7 @@ echeck()
err="$(sed 's/[^[:print:]]//g; s/\[[0-9\;:]*\?m//g; s/==> //g; s/] ERROR:/]\nERROR:/g' "$ERR")" err="$(sed 's/[^[:print:]]//g; s/\[[0-9\;:]*\?m//g; s/==> //g; s/] ERROR:/]\nERROR:/g' "$ERR")"
if [[ $err ]]; then if [[ $err ]]; then
msgbox "$_ErrTitle" "\nERROR: $err" msgbox "$_ErrTitle" "\nThe command exited abnormally: $1\n\nWith the following message: $err"
else else
msgbox "$_ErrTitle" "\nThe command exited abnormally: $1\n\nWith the no error message.\n" msgbox "$_ErrTitle" "\nThe command exited abnormally: $1\n\nWith the no error message.\n"
fi fi
@ -2484,7 +2485,8 @@ select_language()
{ {
tput civis tput civis
local lang local lang
lang=$(menubox "Select Language" "\nLanguage - sprache - taal - språk - lingua - idioma - nyelv - língua\n" \ lang=$(menubox "Select Language" \
"\nLanguage - sprache - taal - språk - lingua - idioma - nyelv - língua\n" \
"1" "English (en_**)" \ "1" "English (en_**)" \
"2" "Español (es_ES)" \ "2" "Español (es_ES)" \
"3" "Português [Brasil] (pt_BR)" \ "3" "Português [Brasil] (pt_BR)" \
@ -2597,8 +2599,8 @@ CMAPS="$(find /usr/share/kbd/keymaps -name '*.map.gz' | awk '{
}' | sort)" }' | sort)"
# make sure these are defined for some dialog size calculation # make sure these are defined for some dialog size calculation
: "${LINES=$(tput lines)}" [[ $LINES ]] || LINES=$(tput lines)
: "${COLUMNS=$(tput cols)}" [[ $COLUMNS ]] || COLUMNS=$(tput cols)
# various associative arrays # various associative arrays
# { # {
@ -2641,7 +2643,7 @@ declare -A WM_EXT=(
[gnome]="" [gnome]=""
[plasma]="kdebase-meta" [plasma]="kdebase-meta"
[bspwm]="sxhkd archlabs-skel-bspwm rofi archlabs-polybar" [bspwm]="sxhkd archlabs-skel-bspwm rofi archlabs-polybar"
[xfce4]="xfce4-goodies xfce4-pulseaudio-plugin archlabs-skel-xfce4" [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" [i3-gaps]="i3status perl-anyevent-i3 archlabs-skel-i3-gaps rofi archlabs-polybar"
[openbox]="obconf archlabs-skel-openbox jgmenu archlabs-polybar tint2 conky rofi" [openbox]="obconf archlabs-skel-openbox jgmenu archlabs-polybar tint2 conky rofi"
) )

View File

@ -1,4 +1,3 @@
# base
arch-install-scripts arch-install-scripts
b43-firmware b43-firmware
b43-fwcutter b43-fwcutter
@ -6,17 +5,16 @@ broadcom-wl
clonezilla clonezilla
dhclient dhclient
dhcpcd dhcpcd
efibootmgr
ethtool ethtool
exfat-utils exfat-utils
f2fs-tools f2fs-tools
fakeroot
gptfdisk gptfdisk
grub grub
vim vim
hdparm hdparm
ipw2100-fw ipw2100-fw
ipw2200-fw ipw2200-fw
laptop-detect
nfs-utils nfs-utils
nilfs-utils nilfs-utils
ntfs-3g ntfs-3g
@ -26,82 +24,36 @@ refind-efi
rsync rsync
sdparm sdparm
smartmontools smartmontools
sudo
wget wget
wireless_tools wireless_tools
wpa_actiond wpa_actiond
xl2tpd xl2tpd
dialog
# xorg parted
mesa
xorg-apps
xorg-drivers
xorg-server
xorg-xinit
# install
os-prober os-prober
wipe
# codecs
alsa-firmware alsa-firmware
alsa-lib alsa-lib
alsa-plugins alsa-plugins
ffmpeg
gst-libav
gst-plugins-base
gst-plugins-good
gstreamer
libmad
libmatroska
pulseaudio pulseaudio
pulseaudio-alsa pulseaudio-alsa
# xfce
xfce4-settings
xfce4-power-manager
gtk-engine-murrine
# network
networkmanager networkmanager
wireless-regdb wireless-regdb
wpa_supplicant wpa_supplicant
# filesystem
gvfs gvfs
gvfs-afc
gvfs-mtp
gvfs-nfs
tumbler
# utilities
gnome-keyring
lm_sensors lm_sensors
lsb-release lsb-release
numlockx
p7zip p7zip
pamixer pamixer
playerctl
polkit-gnome
reflector reflector
scrot scrot
unrar unrar
volumeicon
wmctrl
xclip
xdotool
# applications
arandr
compton
dunst
feh
gsimplecal
htop htop
nitrogen
pavucontrol
ranger ranger
w3m w3m
# fonts
terminus-font terminus-font
ttf-dejavu ttf-dejavu
archlabs-common
archlabs-keyring
archlabs-scripts
archlabs-installer