summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-12-29 17:34:46 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2010-12-29 17:34:46 +0100
commitdb638937e81daf4ba01efa81d9fd0cbeb053fcc2 (patch)
treef002a31a803a5c794ef6a6ef401327b973f0b0f9
parentae36bcc5786faf625ca56b28a2f6d738f01d2ddb (diff)
Make locale generation and keymap/font setting part of system configuration
* remove auto_locale and auto_keymap_font workers, no need for middle-man. * call relevant code directly from prefill_configs, which is now renamed to preconfigure_target * make base procedure run preconfigure_target in configure_system worker. (this also removes the need for the configure_system worker definition in the automatic procedure) * warn user in interactive_configure_system() when preconfigure_target() failed, and allow him to go back * simplify interactive worker_install_packages () a little bit
-rw-r--r--examples/fancy-install-on-sda2
-rw-r--r--examples/generic-install-on-sda2
-rw-r--r--src/core/libs/lib-software.sh1
-rw-r--r--src/core/libs/lib-ui-interactive.sh12
-rw-r--r--src/core/procedures/automatic8
-rw-r--r--src/core/procedures/base15
-rw-r--r--src/core/procedures/interactive7
7 files changed, 16 insertions, 31 deletions
diff --git a/examples/fancy-install-on-sda b/examples/fancy-install-on-sda
index 28c5f1b..ec920d4 100644
--- a/examples/fancy-install-on-sda
+++ b/examples/fancy-install-on-sda
@@ -19,7 +19,7 @@ worker_intro () {
}
worker_configure_system () {
- prefill_configs
+ preconfigure_target
sed -i 's/^HOSTNAME="myhost"/HOSTNAME="arch-fancy-install"/' $var_TARGET_DIR/etc/rc.conf
}
diff --git a/examples/generic-install-on-sda b/examples/generic-install-on-sda
index 473198a..a5b9a2e 100644
--- a/examples/generic-install-on-sda
+++ b/examples/generic-install-on-sda
@@ -25,7 +25,7 @@ worker_intro () {
}
worker_configure_system () {
- prefill_configs
+ preconfigure_target
sed -i 's/^HOSTNAME="myhost"/HOSTNAME="arch-generic-install"/' $var_TARGET_DIR/etc/rc.conf
}
diff --git a/src/core/libs/lib-software.sh b/src/core/libs/lib-software.sh
index 467e658..3aee2f7 100644
--- a/src/core/libs/lib-software.sh
+++ b/src/core/libs/lib-software.sh
@@ -64,7 +64,6 @@ installpkg() {
}
-# auto_locale(). taken from setup
# enable glibc locales from rc.conf and build initial locale DB
target_configure_initial_locale()
{
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 57cb153..f73c5b8 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -15,10 +15,12 @@ check_depend ()
show_warning "Cannot Continue. Going back to $2" "You must do $subject first before going here!." && return 1
}
-# populate config files with what we know about the system
+# populate config and data files with what we know about the target system
# note that you could run this function multiple times (i.e. you change some stuff and then come back),
# all logic in here is written to do the right thing in that case
-prefill_configs () {
+preconfigure_target () {
+ target_configure_initial_locale || return $?
+ target_configure_initial_keymap_font || return $?
target_configure_fstab || return $?
execute worker auto_network || return $?
# /etc/pacman.d/mirrorlist
@@ -83,7 +85,11 @@ interactive_configure_system()
seteditor || return 1
FILE=""
- prefill_configs
+ if ! preconfigure_target
+ then
+ show_warning "Preconfigure 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
# main menu loop
while true; do
diff --git a/src/core/procedures/automatic b/src/core/procedures/automatic
index 4fba65b..a61468a 100644
--- a/src/core/procedures/automatic
+++ b/src/core/procedures/automatic
@@ -6,7 +6,7 @@
# It should be:
# phase_preparation=(configure intro sysprep select_source runtime_network runtime_repositories runtime_packages)
# phase_basics=(set_clock prepare_disks)
-# phase_system=(package_list install_packages auto_locale auto_keymap_font configure_system mkinitcpio locales install_bootloader)
+# phase_system=(package_list install_packages configure_system mkinitcpio locales install_bootloader)
# phase_finish=(msg_report)
# In theory, the only manual thing should maybe be configuring the runtime network and putting the configfile in place
@@ -14,7 +14,7 @@
# TODO: implement setting hostname, keymap, consolefont, network settings, root pass, etc
# for a list of recognized variables, see examples/generic-install-on-sda
-depend_procedure core base
+depend_procedure core base # important, don't be confused when worker/variable definitions seem to be missing here.
var_OPTS_STRING="c:"
var_ARGS_USAGE="-c <config>: Specify a configfile (profile) to be used"
@@ -108,10 +108,6 @@ worker_set_clock ()
}
-worker_configure_system () {
- prefill_configs
-}
-
worker_install_bootloader ()
{
get_grub_map
diff --git a/src/core/procedures/base b/src/core/procedures/base
index a7cd382..e2d470d 100644
--- a/src/core/procedures/base
+++ b/src/core/procedures/base
@@ -28,8 +28,6 @@ phase_basics=(\
phase_system=(\
package_list \
install_packages \
- auto_locale \
- auto_keymap_font \
configure_system \
mkinitcpio \
locales \
@@ -157,20 +155,9 @@ worker_auto_network ()
}
-worker_auto_locale ()
-{
- target_configure_initial_locale
-}
-
-
-worker_auto_keymap_font ()
-{
- target_configure_initial_keymap_font
-}
-
worker_configure_system ()
{
- true
+ preconfigure_target
}
diff --git a/src/core/procedures/interactive b/src/core/procedures/interactive
index 448a273..3318aeb 100644
--- a/src/core/procedures/interactive
+++ b/src/core/procedures/interactive
@@ -72,9 +72,7 @@ mainmenu()
check_depend worker select_source && execute worker package_list && default=6 ;;
"6")
check_depend worker package_list && \
- check_depend worker select_source && execute worker install_packages && { execute worker auto_locale ; \
- execute worker auto_keymap_font;
- true ; } && default=7 ;;
+ check_depend worker select_source && execute worker install_packages && default=7 ;;
"7")
check_depend worker install_packages && execute worker configure_system && { execute worker mkinitcpio ; \
execute worker locales ;
@@ -165,8 +163,7 @@ worker_package_list() {
worker_install_packages ()
{
- installpkg && return 0
- return 1
+ installpkg
}