From 0fa66a2251018f5ced649150aacedb394db9312b Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Thu, 12 Aug 2021 17:39:06 -0300 Subject: [PATCH] Fix post-installation issues --- install.sh | 10 +++++----- packages.csv | 3 +-- post-install.sh | 31 +++++++++++++------------------ 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/install.sh b/install.sh index 3db0db8..44922bc 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e qpushd() { @@ -217,9 +217,9 @@ set_timezone() { set_locale() { echo -n "Configuring locale..." - cat /mnt/etc/locale.gen | sed "s/^#$LOCALE/$LOCALE/" > /tmp/locale.gen - mv /tmp/locale.gen /mnt/etc/locale.gen - quiet right_chroot /mnt locale-gen + sed "s/^#$LOCALE/$LOCALE/" < /mnt/etc/locale.gen > /etc/locale.gen + locale-gen + cp -f /usr/lib/locale/locale-archive /mnt/usr/lib/locale/locale-archive echo "export LANG=\"en_US.UTF-8\"" > /mnt/etc/locale.conf echo "export LC_COLLATE=\"C\"" >> /mnt/etc/locale.conf @@ -300,7 +300,7 @@ prompt_all() { qpopd echo "Choose locale:" - LOCALE=$(cat /etc/locale.gen | sed '/^#\s/D' | sed '/^#$/D' | sed 's/^#//' | fzf --layout=reverse --height=20) + LOCALE=$(sed '/^#\s/D' < /etc/locale.gen | sed '/^#$/D' | sed 's/^#//' | fzf --layout=reverse --height=20) ask_password root ROOT_PASSWORD="$USER_PASSWORD" diff --git a/packages.csv b/packages.csv index b3d4631..2ebb942 100644 --- a/packages.csv +++ b/packages.csv @@ -4,7 +4,6 @@ PAC,cmake,Meta-build system PAC,cmus,Terminal music player AUR,compiledb,Utility for generating compile_commands.json from Makefile FUN,install_dash, -FUN,install_doas, PAC,dunst,Notification daemon SRC,https://github.com/augustogunsch/dmenu,Graphical dynamic menu SRC,https://github.com/augustogunsch/dwm,Tiling window manager @@ -13,7 +12,6 @@ PAC,feh,Image viewer PAC,firejail,Sandbox program PAC,fzf,Fuzzy finder PAC,gcc,C compiler -PAC,git,Version control system PAC,go,Go compiler PAC,gvim,Text editor PAC,libnotify,Implementation of the Desktop Notifications Specification @@ -22,6 +20,7 @@ PAC,lxsession,Graphical authentication agent PAC,man,Interface to system manuals PAC,mpv,Media player PAC,mupdf,Lightweight PDF viewer +PAC,opendoas,Sudo alternative PAC,openssh,Secure shell PAC,picom,X11 compositor PAC,polkit,Toolkit for handling the policy that allows unprivileged processes to speak to privileged ones diff --git a/post-install.sh b/post-install.sh index 76bc386..3203c98 100755 --- a/post-install.sh +++ b/post-install.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e qpushd() { @@ -169,10 +169,9 @@ print_phase() { install_aur() { [ -z "$INSTALL_USER" ] && return 0 if [ -z "$2" ]; then - echo -n "Installing $1 from AUR..." + echo -n "Installing ${LGREEN}$1${NC} from AUR..." else - echo "Installing $1 from AUR. Description:" - echo "$2" + echo -n "Installing ${LGREEN}$1${NC} from AUR ($2)..." fi local dir="$HOME_DIR/$1" quiet sudo -u "$INSTALL_USER" git clone -q "https://aur.archlinux.org/$1.git" "$dir" @@ -401,7 +400,10 @@ append_line() { } configure_doas() { - [ -f /bin/doas ] || return 0 + remove sudo + pacman_opt IgnorePkg sudo + pacman_opt NoUpgrade bin/sudo + link /bin/doas /bin/sudo echo "Configuring doas..." prompt_user 'doas will be configured' local DOAS_USER="$USER_OUT" @@ -412,14 +414,6 @@ configure_doas() { fi } -install_doas() { - remove sudo - install opendoas "Sudo alternative" - pacman_opt IgnorePkg sudo - pacman_opt NoUpgrade bin/sudo - link /bin/doas /bin/sudo -} - install_dash() { install dash "Lightweight POSIX shell" pacman_opt NoUpgrade bin/sh @@ -443,6 +437,7 @@ repos() { quiet pacman -Sy echo "done" + install archlinux-keyring echo -n "Configuring pacman keyring..." quiet pacman-key --init quiet pacman-key --populate archlinux @@ -498,10 +493,9 @@ install_src() { qpushd "$HOME" local PKG_NAME="$(basename "$1")" if [ -z "$2" ]; then - echo -n "Installing $PKG_NAME from source..." + echo -n "Installing ${LGREEN}$PKG_NAME${NC} from source..." else - echo "Installing $PKG_NAME from source. Description:" - echo "$2" + echo -n "Installing ${LGREEN}$PKG_NAME${NC} from source ($2)..." fi quiet git clone -q "$1" qpushd "$PKG_NAME" @@ -509,6 +503,7 @@ install_src() { make install qpopd qpopd + echo "done" } install_loop() { @@ -532,8 +527,8 @@ install_packages() { quiet pacman -Sqyu --noconfirm echo "done" - install_doas - install_dash + install sudo + install git "Version control system" install_loop }