diff options
Diffstat (limited to 'src/lib/lib-software.sh')
-rw-r--r-- | src/lib/lib-software.sh | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/lib/lib-software.sh b/src/lib/lib-software.sh index 8ec802a..4537276 100644 --- a/src/lib/lib-software.sh +++ b/src/lib/lib-software.sh @@ -1,7 +1,7 @@ #!/bin/sh -# run_mkinitcpio() taken from setup. adapted a bit. +# run_mkinitcpio() taken from setup. adapted a lot # runs mkinitcpio on the target system, displays output run_mkinitcpio() { @@ -16,3 +16,48 @@ run_mkinitcpio() # alert the user to fatal errors [ $(cat /tmp/.mkinitcpio-retcode) -ne 0 ] && show_warning "MKINITCPIO FAILED - SYSTEM MAY NOT BOOT" "/tmp/mkinitcpio.log" text } + + +# installpkg(). taken from setup. modified bigtime +# performs package installation to the target system +installpkg() { + notify "Package installation will begin now. You can watch the output in the progress window. Please be patient." 0 0 + target_specialfs on + run_background pacman-installpkg "$PACMAN_TARGET -S $PACKAGES" /tmp/pacman.log + follow_progress " Installing... Please Wait " /tmp/pacman.log + + if [ $(cat /tmp/.pacman-retcode) -ne 0 ]; then + echo -e "\nPackage Installation FAILED." >>/tmp/pacman.log + else + echo -e "\nPackage Installation Complete." >>/tmp/pacman.log + fi + rm /tmp/setup-pacman-running + + wait_for pacman-installpkg + + local _result='' + if [ $(cat /tmp/.pacman-retcode) -ne 0 ]; then + _result="Installation Failed (see errors below)" + else + _result="Installation Complete" + fi + rm /tmp/.pacman-retcode + + DIALOG --title "$_result" --exit-label "Continue" \ + --textbox "/tmp/pacman.log" 18 70 || return 1 + + target_specialfs off + + sync +} + +# auto_locale(). taken from setup +# enable glibc locales from rc.conf and build initial locale DB +auto_locale() +{ + for i in $(grep "^LOCALE" ${TARGET_DIR}/etc/rc.conf | sed -e 's/.*="//g' -e's/\..*//g'); do + sed -i -e "s/^#$i/$i/g" ${TARGET_DIR}/etc/locale.gen + done + DIALOG --infobox "Generating glibc base locales..." 4 40 + chroot ${TARGET_DIR} locale-gen >/dev/null +} |