From ef2db51842ac9ce130c1405eb2150d5f303337c2 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Mon, 27 Feb 2017 02:06:38 +0100 Subject: [PATCH] more logging --- lib/util-base.sh | 19 ++++++++++++++----- lib/util-desktop.sh | 6 +++++- lib/util-disk.sh | 2 +- lib/util-menu.sh | 1 + 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lib/util-base.sh b/lib/util-base.sh index d007f8e..58c8cbc 100644 --- a/lib/util-base.sh +++ b/lib/util-base.sh @@ -249,9 +249,11 @@ install_base() { install_base_menu fi if [[ $(cat ${INIT}) -eq 2 ]]; then + check_for_error "init openrc" touch /mnt/.openrc cat /usr/share/manjaro-architect/package-lists/base-openrc-manjaro > /tmp/.base else + check_for_error "init systemd" [[ -e /mnt/.openrc ]] && rm /mnt/.openrc cat /usr/share/manjaro-architect/package-lists/base-systemd-manjaro > /tmp/.base fi @@ -264,6 +266,8 @@ install_base() { if [[ $(cat ${PACKAGES}) == "" ]]; then install_base_menu fi + check_for_error "selected: $(cat ${PACKAGES})" + # Choose wanted kernel modules DIALOG "$_ChsAddPkgs" --checklist "\n\n$_UseSpaceBar" 0 0 12 \ "KERNEL-headers" "-" off \ @@ -281,6 +285,7 @@ install_base() { if [[ $(cat /tmp/.modules) == "" ]]; then install_base_menu fi + check_for_error "modules: $(cat /tmp/.modules)" for kernel in $(cat ${PACKAGES} | grep -v "base-devel") ; do cat /tmp/.modules | sed "s/KERNEL/\ $kernel/g" >> /tmp/.base done @@ -290,6 +295,7 @@ install_base() { # Check to see if a kernel is already installed ls ${MOUNTPOINT}/boot/*.img >/dev/null 2>&1 if [[ $? == 0 ]]; then + check_for_error "linux-$(ls ${MOUNTPOINT}/boot/*.img | cut -d'-' -f2) is already installed" KERNEL="y" else for i in $(cat /tmp/.available_kernels); do @@ -300,19 +306,21 @@ install_base() { # If no kernel selected, warn and restart if [[ $KERNEL == "n" ]]; then DIALOG " $_ErrTitle " --msgbox "$_ErrNoKernel" 0 0 + check_for_error "no kernel selected." install_base else - + check_for_error "packages to install: $(cat /tmp/.base | tr '\n' ' ')" # If at least one kernel selected, proceed with installation. basestrap ${MOUNTPOINT} $(cat /tmp/.base) 2>$ERR check_for_error "install basepkgs" $? install_base # If root is on btrfs volume, amend mkinitcpio.conf - [[ $(lsblk -lno FSTYPE,MOUNTPOINT | awk '/ \/mnt$/ {print $1}') == btrfs ]] && sed -e '/^HOOKS=/s/\ fsck//g' -i ${MOUNTPOINT}/etc/mkinitcpio.conf + [[ $(lsblk -lno FSTYPE,MOUNTPOINT | awk '/ \/mnt$/ {print $1}') == btrfs ]] && sed -e '/^HOOKS=/s/\ fsck//g' -i ${MOUNTPOINT}/etc/mkinitcpio.conf && \ + check_for_error "root on btrfs volume. amend mkinitcpio." # If root is on nilfs2 volume, amend mkinitcpio.conf - [[ $(lsblk -lno FSTYPE,MOUNTPOINT | awk '/ \/mnt$/ {print $1}') == nilfs2 ]] && sed -e '/^HOOKS=/s/\ fsck//g' -i ${MOUNTPOINT}/etc/mkinitcpio.conf - + [[ $(lsblk -lno FSTYPE,MOUNTPOINT | awk '/ \/mnt$/ {print $1}') == nilfs2 ]] && sed -e '/^HOOKS=/s/\ fsck//g' -i ${MOUNTPOINT}/etc/mkinitcpio.conf && \ + check_for_error "root on nilfs2 volume. amend mkinitcpio." # Use mhwd to install selected kernels with right kernel modules # This is as of yet untested @@ -333,12 +341,13 @@ install_base() { # if branch was chosen, use that also in installed system. If not, use the system setting if [[ -e ${BRANCH} ]]; then sed -i "/Branch =/c\Branch = $(cat ${BRANCH})/" ${MOUNTPOINT}/etc/pacman-mirrors.conf 2>$ERR - check_for_error "set target branch -> $(cat ${BRANCH})" $? install_base + check_for_error "set target branch $(cat ${BRANCH})" $? install_base else sed -i "/Branch =/c$(grep "Branch =" /etc/pacman-mirrors.conf)" ${MOUNTPOINT}/etc/pacman-mirrors.conf 2>$ERR check_for_error "use host branch \($(grep "Branch =" /etc/pacman-mirrors.conf)\)" $? install_base fi touch /mnt/.base_installed + check_for_error "base installed succesfully." fi fi } diff --git a/lib/util-desktop.sh b/lib/util-desktop.sh index 3349939..51ae209 100644 --- a/lib/util-desktop.sh +++ b/lib/util-desktop.sh @@ -77,7 +77,7 @@ install_manjaro_de_wm() { echo "" > /tmp/.desktop # DE/WM Menu - DIALOG " $_InstDETitle " --radiolist "$_InstManDEBody\n:: $(evaluate_profiles) ::\n\n$_UseSpaceBar" 0 0 12 \ + DIALOG " $_InstDETitle " --radiolist "\n$_InstManDEBody\n$(evaluate_profiles)\n\n$_UseSpaceBar" 0 0 12 \ $(echo $PROFILES/{manjaro,community}/* | xargs -n1 | cut -f7 -d'/' | grep -vE "netinstall|architect" | awk '$0=$0" - off"') 2> /tmp/.desktop # If something has been selected, install @@ -134,8 +134,10 @@ install_manjaro_de_wm() { "2" "minimal" 2>/tmp/.version if [[ $(cat /tmp/.version) -eq 2 ]]; then + check_for_error "selected 'minimal' profile" touch /tmp/.minimal else + check_for_error "selected 'full' profile" [[ -e /tmp/.minimal ]] && rm /tmp/.minimal fi fi @@ -173,6 +175,8 @@ install_manjaro_de_wm() { # remove zsh sed -i '/^zsh$/d' /tmp/.edition + check_for_error "packages to install: $(cat /tmp/.edition | tr '\n' ' ')" + # basestrap the parsed package list to the new root basestrap -i ${MOUNTPOINT} $(cat /tmp/.edition /usr/share/manjaro-architect/package-lists/input-drivers | sort | uniq) 2>$ERR check_for_error "install pkgs: $(cat /tmp/.desktop)" "$?" diff --git a/lib/util-disk.sh b/lib/util-disk.sh index b1ddc62..6571ed8 100644 --- a/lib/util-disk.sh +++ b/lib/util-disk.sh @@ -327,7 +327,7 @@ mount_partitions() { mount ${PARTITION} ${MOUNTPOINT}${MOUNT} 2>$ERR fi - check_for_error "$FUNCNAME" "$?" + check_for_error "mount (-o) $(cat ${MOUNT_OPTS}) ${PARTITION} ${MOUNTPOINT}${MOUNT}" "$?" confirm_mount ${MOUNTPOINT}${MOUNT} # Identify if mounted partition is type "crypt" (LUKS on LVM, or LUKS alone) diff --git a/lib/util-menu.sh b/lib/util-menu.sh index 7fbc5a6..bbfae58 100644 --- a/lib/util-menu.sh +++ b/lib/util-menu.sh @@ -119,6 +119,7 @@ install_base_menu() { pacman-key --init pacman-key --populate archlinux manjaro pacman-key --refresh-keys + check_for_error "refresh pacman-keys" ;; "3") install_base ;;