diff options
Diffstat (limited to 'src/lib/lib-software.sh')
-rw-r--r-- | src/lib/lib-software.sh | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/src/lib/lib-software.sh b/src/lib/lib-software.sh index d2fc82f..8ec802a 100644 --- a/src/lib/lib-software.sh +++ b/src/lib/lib-software.sh @@ -1,39 +1,18 @@ #!/bin/sh -# run_mkinitcpio() taken from setup. adapted a bit. TODO: GET ALL THE UI CODE OUT OF HERE !! +# run_mkinitcpio() taken from setup. adapted a bit. # runs mkinitcpio on the target system, displays output -# run_mkinitcpio() { target_special_fs on - # all mkinitcpio output goes to /tmp/mkinitcpio.log, which we tail - # into a dialog - ( \ - touch /tmp/setup-mkinitcpio-running - echo "mkinitcpio progress ..." > /tmp/mkinitcpio.log; \ - echo >> /tmp/mkinitcpio.log; \ - chroot "$TARGET_DIR" /sbin/mkinitcpio -p kernel26 >>/tmp/mkinitcpio.log 2>&1 - echo $? > /tmp/.mkinitcpio-retcode - echo >> /tmp/mkinitcpio.log - rm -f /tmp/setup-mkinitcpio-running - ) & - sleep 2 + run_background mkinitcpio "chroot $TARGET_DIR /sbin/mkinitcpio -p kernel26" /tmp/mkinitcpio.log + follow_progress "Rebuilding initcpio images ..." /tmp/mkinitcpio.log + wait_for mkinitcpio - DIALOG --title "Rebuilding initcpio images ..." \ - --no-kill --tailboxbg "/tmp/mkinitcpio.log" 18 70 2>$ANSWER - while [ -f /tmp/setup-mkinitcpio-running ]; do - sleep 1 - done - kill $(cat $ANSWER) + target_special_fs off - target_special_fs off - - # alert the user to fatal errors - if [ $(cat /tmp/.mkinitcpio-retcode) -ne 0 ]; then - DIALOG --title "MKINITCPIO FAILED - SYSTEM MAY NOT BOOT" --exit-label \ - "Continue" --textbox "/tmp/mkinitcpio.log" 18 70 - return 1 - fi + # alert the user to fatal errors + [ $(cat /tmp/.mkinitcpio-retcode) -ne 0 ] && show_warning "MKINITCPIO FAILED - SYSTEM MAY NOT BOOT" "/tmp/mkinitcpio.log" text } |