summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/fancy-install-on-sda1
-rw-r--r--examples/generic-install-on-sda4
-rw-r--r--src/core/libs/lib-ui-interactive.sh27
-rw-r--r--src/core/procedures/automatic7
4 files changed, 26 insertions, 13 deletions
diff --git a/examples/fancy-install-on-sda b/examples/fancy-install-on-sda
index 1322231..19f35fd 100644
--- a/examples/fancy-install-on-sda
+++ b/examples/fancy-install-on-sda
@@ -19,6 +19,7 @@ worker_intro () {
}
worker_configure_system () {
+ prefill_configs
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 305bc9a..18dc43a 100644
--- a/examples/generic-install-on-sda
+++ b/examples/generic-install-on-sda
@@ -5,7 +5,8 @@
SOURCE=cd
FILE_URL=file:///src/core/pkg
SYNC_URL=
-
+HARDWARECLOCK=localtime
+TIMEZONE=Canada/Pacific
# Do you want to have additional pacman repositories or packages available at runtime (during installation)?
# RUNTIME_REPOSITORIES = array like this ('name1' 'location of repo 1' ['name2' 'location of repo2',..])
RUNTIME_REPOSITORIES=
@@ -24,6 +25,7 @@ worker_intro () {
}
worker_configure_system () {
+ prefill_configs
sed -i 's/^HOSTNAME="myhost"/HOSTNAME="arch-generic-install"/' $var_TARGET_DIR/etc/rc.conf
}
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 039d8ec..84517fe 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -17,23 +17,14 @@ check_depend ()
}
-interactive_configure_system()
-{
- if [ -z "$EDITOR" ]
- then
- interactive_get_editor || return 1
- fi
- FILE=""
-
- ## PREPROCESSING ##
-
+prefill_configs () {
#TODO: only need to do this once. check 'ended_ok worker configure_system' is not good because this could be done already even if worker did not exit 0
# /etc/pacman.d/mirrorlist
# add installer-selected mirror to the top of the mirrorlist
- if [ "$var_PKG_SOURCE_TYPE" = "net" -a "${var_SYNC_URL}" != "" ]; then
+ if [ "$var_PKG_SOURCE_TYPE" = "net" -n "${var_SYNC_URL}" ]; then
debug 'PROCEDURE' "Adding choosen mirror (${var_SYNC_URL}) to ${var_TARGET_DIR}/$var_MIRRORLIST"
mirrorlist=`awk "BEGIN { printf(\"# Mirror used during installation\nServer = "${var_SYNC_URL}"\n\n\") } 1 " "${var_TARGET_DIR}/$var_MIRRORLIST"`
- echo "$mirrorlist" > "${var_TARGET_DIR}/$var_MIRRORLIST" #TODO: test this, this may not work
+ echo "$mirrorlist" > "${var_TARGET_DIR}/$var_MIRRORLIST"
fi
# /etc/rc.conf
@@ -62,6 +53,17 @@ interactive_configure_system()
sed -i '/^HOOKS/ s/keymap/usbinput keymap/' ${var_TARGET_DIR}/etc/mkinitcpio.conf
fi
fi
+}
+
+interactive_configure_system()
+{
+ if [ -z "$EDITOR" ]
+ then
+ interactive_get_editor || return 1
+ fi
+ FILE=""
+
+ prefill_configs
# main menu loop
while true; do
@@ -97,6 +99,7 @@ interactive_configure_system()
# if user edited /etc/rc.conf, add the hostname to /etc/hosts if it's not already there.
# note that if the user edits rc.conf several times to change the hostname more then once, we will add them all to /etc/hosts. this is not perfect, but to avoid this, too much code would be required (feel free to prove me wrong :))
+ # we could maybe do this just once after the user is really done here, but then he doesn't get to see the updated file while being in this menu...
if [ "$FILE" = "/etc/rc.conf" ]
then
HOSTNAME=`sed -n '/^HOSTNAME/s/HOSTNAME=//p' ${var_TARGET_DIR}${FILE} | sed 's/"//g'`
diff --git a/src/core/procedures/automatic b/src/core/procedures/automatic
index 58911ff..80aecfc 100644
--- a/src/core/procedures/automatic
+++ b/src/core/procedures/automatic
@@ -55,6 +55,8 @@ worker_configure ()
var_GRUB_DEVICE=$GRUB_DEVICE
var_PARTITIONS=$PARTITIONS
var_BLOCKDATA=$BLOCKDATA
+ HARDWARECLOCK=${HARDWARECLOCK:-localtime}
+ TIMEZONE=${TIMEZONE:-Canada/Pacific}
}
worker_select_source ()
@@ -124,7 +126,12 @@ worker_auto_network () {
}
+worker_configure_system () {
+ prefill_configs
+}
+
worker_install_bootloader ()
{
grub-install $var_GRUB_DEVICE --root-directory=/mnt
+ generate_grub_menulst
}