From 4791a3f8a9026e161dcca23185bc33a02a00034f Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Tue, 10 Aug 2021 15:04:03 -0300 Subject: [PATCH] Fix several issues --- install.sh | 12 ++++++++---- post-install.sh | 7 ++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 3598b43..76b50c8 100755 --- a/install.sh +++ b/install.sh @@ -228,8 +228,10 @@ setup_grub() { } setup_users() { + echo -n "Configuring users..." right_chroot /mnt useradd -m "$PERSONAL_USER" - right_chroot /mnt echo -e "root:$ROOT_PASSWORD\n$PERSONAL_USER:$PERSONAL_PASSWORD" | chpasswd -q + echo -e "root:$ROOT_PASSWORD\n$PERSONAL_USER:$PERSONAL_PASSWORD" | chpasswd -R /mnt + echo "done" } setup_network() { @@ -255,11 +257,13 @@ ask_password() { stty -echo read USER_PASSWORD stty echo + echo echo -n "Confirm password: " stty -echo local PASSWORD_CONFIRM read PASSWORD_CONFIRM stty echo + echo if [ "$USER_PASSWORD" != "$PASSWORD_CONFIRM" ]; then echo "Wrong passwords. Please try again." ask_password $1 @@ -293,11 +297,11 @@ prompt_all() { post_install() { curl -sL "$POST_INSTALL_SCRIPT" -o post-install.sh - mv post-install /mnt/root - chmod +x /mnt/root + mv post-install.sh /mnt/root + chmod +x /mnt/root/post-install.sh echo -n "Ready for post-install script. Press any key to continue..." read dummy - right_chroot /root/post-install.sh + right_chroot /mnt /root/post-install.sh } configure() { diff --git a/post-install.sh b/post-install.sh index f2574af..94c19b3 100755 --- a/post-install.sh +++ b/post-install.sh @@ -39,9 +39,10 @@ USER_OUT="" PACMAN_CONF="/etc/pacman.conf" PACMAN_TEMP_CONF="/tmp/pacman.conf" DOAS_CONF="/etc/doas.conf" -DISTRO=$(lsb_release -is) +DISTRO=$(cat /etc/os-release | sed -nE 's/^ID=(.*)/\1/p') +INIT_SYS=$(basename $(readlink /bin/init)) DEFAULT_INCLUDE='/etc/pacman.d/mirrorlist' -if [ "$DISTRO" != "Arch" -a "$DISTRO" != "Artix" ]; then +if [ "$DISTRO" != "arch" -a "$DISTRO" != "artix" ]; then echo "Error: $(lsb_release -ds) not supported" usage fi @@ -403,7 +404,7 @@ install_doas() { repos() { echo "Detected distro $DISTRO Linux. Proceeding with enabling more repositories." - if [ "$DISTRO" = "Artix" ]; then + if [ "$DISTRO" = "artix" ]; then pacman_repo lib32 local ARCH_REPOS="$DEFAULT_INCLUDE-arch" install archlinux-mirrorlist