diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-29 18:08:49 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-29 18:08:49 +0100 |
commit | 846471086b3c581619eeda5ad706475a1a17ddf9 (patch) | |
tree | 6eea91278f4ac1a2eea7c3d826ab3a8214bb49cc /src/core/libs | |
parent | d363589e1a55874d3eb9abade701d61ea1f085b7 (diff) |
refactor locale, initcpio and initialtime code
* remove locale, initcpio and initialtime workers, move logic in new
postconfigure_target function
* for base and automatic procedures, postconfigure_target() gets called
automatically
* interactive procedure calls this in interactive_configure_system in the
same way it calls preconfigure_target
* rename target_run_mkinitcpio to target_run_mkinitcpio, to be consistent
with other functions
Diffstat (limited to 'src/core/libs')
-rw-r--r-- | src/core/libs/lib-software.sh | 3 | ||||
-rw-r--r-- | src/core/libs/lib-ui-interactive.sh | 14 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/core/libs/lib-software.sh b/src/core/libs/lib-software.sh index 3aee2f7..4e32a63 100644 --- a/src/core/libs/lib-software.sh +++ b/src/core/libs/lib-software.sh @@ -3,9 +3,8 @@ TMP_MKINITCPIO_LOG=$LOG_DIR/mkinitcpio.log TMP_PACMAN_LOG=$LOG_DIR/pacman.log -# run_mkinitcpio() taken from setup. adapted a lot # runs mkinitcpio on the target system, displays output -run_mkinitcpio() +target_run_mkinitcpio() { target_special_fs on diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index f73c5b8..2aea25b 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -80,6 +80,14 @@ preconfigure_target () { # TODO: we should probably update /etc/crypttab if the user has non-/ encrypted disks. } +# do some target configuration steps automatically, after user decided he configured his system. +# as usual, this function is okay with being called multiple times +postconfigure_target () { + target_run_mkinitcpio || return $? + target_locale-gen || return $? + cp /etc/localtime ${var_TARGET_DIR}/etc/localtime || return $? +} + interactive_configure_system() { seteditor || return 1 @@ -139,6 +147,12 @@ interactive_configure_system() # temporary backup files are not useful anymore past this point. find "${var_TARGET_DIR}/etc/" -name '*~' -delete &>/dev/null + if ! postconfigure_target + then + show_warning "Postconfigure failed" "Beware: I just tried to automatically configure some stuff, but something failed. Please report this. Continue at your own risk" + ask_yesno "Do you want to continue?" no || return 1 + fi + return 0 } |