summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-software.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-02 22:04:36 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-02 22:04:36 +0100
commit4019db7a540d6dfcef6431cfc11ca748595e2ca1 (patch)
treefc47df27708360c71699609f80d0b732b28412d8 /src/core/libs/lib-software.sh
parentc8a41a8f2afdb46e9da3bc9a677210b74b82eaab (diff)
file hierarchy overhaul. now a structure that makes more sense: user and core separated. we now differentiate between procedures and libraries - no more "profiles" - + some bug fixed + probably quite a few introduced + runtime directory + separated my own stuff more
Diffstat (limited to 'src/core/libs/lib-software.sh')
-rw-r--r--src/core/libs/lib-software.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/core/libs/lib-software.sh b/src/core/libs/lib-software.sh
new file mode 100644
index 0000000..95bc07a
--- /dev/null
+++ b/src/core/libs/lib-software.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+
+# run_mkinitcpio() taken from setup. adapted a lot
+# runs mkinitcpio on the target system, displays output
+run_mkinitcpio()
+{
+ target_special_fs on
+
+ run_background mkinitcpio "chroot $var_TARGET_DIR /sbin/mkinitcpio -p kernel26" /tmp/mkinitcpio.log
+ follow_progress "Rebuilding initcpio images ..." /tmp/mkinitcpio.log
+ wait_for mkinitcpio
+
+ target_special_fs off
+
+ # 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
+
+ wait_for pacman-installpkg
+
+ local _result=''
+ if [ $(cat /tmp/.pacman-retcode) -ne 0 ]; then
+ _result="Installation Failed (see errors below)"
+ echo -e "\nPackage Installation FAILED." >>/tmp/pacman.log
+ else
+ _result="Installation Complete"
+ echo -e "\nPackage Installation Complete." >>/tmp/pacman.log
+ fi
+ rm /tmp/.pacman-retcode
+
+ show_warning "$_result" "/tmp/pacman.log" text || 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" ${var_TARGET_DIR}/etc/rc.conf | sed -e 's/.*="//g' -e's/\..*//g'); do
+ sed -i -e "s/^#$i/$i/g" ${var_TARGET_DIR}/etc/locale.gen
+ done
+ DIALOG --infobox "Generating glibc base locales..." 4 40
+ chroot ${var_TARGET_DIR} locale-gen >/dev/null
+}