summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/libs/lib-misc.sh5
-rw-r--r--src/core/libs/lib-ui.sh18
-rw-r--r--src/core/procedures/base6
-rw-r--r--src/core/procedures/interactive3
4 files changed, 26 insertions, 6 deletions
diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh
index c30e4cb..327a4c5 100644
--- a/src/core/libs/lib-misc.sh
+++ b/src/core/libs/lib-misc.sh
@@ -87,3 +87,8 @@ dohwclock() {
hwclock $HWCLOCK_PARAMS #tpowa does it without, but i would add --noadjtime here
}
+target_configure_initial_keymap_font ()
+{
+ [ -n "$var_KEYMAP" ] && sed -i "s/^KEYMAP=.*/KEYMAP=\"$var_KEYMAP\"/" ${var_TARGET_DIR}/etc/rc.conf
+ [ -n "$var_CONSOLEFONT" ] && sed -i "s/^CONSOLEFONT=.*/CONSOLEFONT=\"$var_CONSOLEFONT\"/" ${var_TARGET_DIR}/etc/rc.conf
+} \ No newline at end of file
diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh
index a8c242b..9719cbf 100644
--- a/src/core/libs/lib-ui.sh
+++ b/src/core/libs/lib-ui.sh
@@ -12,10 +12,16 @@ ANSWER=$RUNTIME_DIR/aif-dialog-answer
DIA_MENU_TEXT="Use the UP and DOWN arrows to navigate menus. Use TAB to switch between buttons and ENTER to select."
DIA_SUCCESSIVE_ITEMS=$RUNTIME_DIR/aif-dia-successive-items
-#default keymap and consolefont configured on install CD. can be overridden
-source /etc/rc.conf
-var_KEYMAP=$KEYMAP
-var_CONSOLEFONT=$CONSOLEFONT
+
+# get keymap/font (maybe configured by aif allready in another process or even in another shell)
+# otherwise, take default keymap and consolefont as configured in /etc/rc.conf. can be overridden
+# Note that the vars in /etc/rc.conf can also be empty!
+[ -e $RUNTIME_DIR/aif-keymap ] && var_KEYMAP=` cat $RUNTIME_DIR/aif-keymap`
+[ -e $RUNTIME_DIR/aif-consolefont ] && var_CONSOLEFONT=`cat $RUNTIME_DIR/aif-consolefont`
+[ -z "$var_KEYMAP" ] && source /etc/rc.conf && var_KEYMAP=$KEYMAP
+[ -z "$var_CONSOLEFONT" ] && source /etc/rc.conf && var_CONSOLEFONT=$CONSOLEFONT
+
+
### Functions that your code can use. Cli/dialog mode is fully transparant. This library takes care of it ###
@@ -645,11 +651,12 @@ set_keymap ()
for i in $(find $KBDDIR/keymaps -name "*.gz" | sort); do
KEYMAPS="$KEYMAPS ${i##$KBDDIR/keymaps/} -"
done
- ask_option "$var_KEYMAP" "Select A Keymap" '' optional $KEYMAPS
+ ask_option "${var_KEYMAP:-no}" "Select A Keymap" '' optional $KEYMAPS
if [ -n "$ANSWER_OPTION" ]
then
loadkeys -q $KBDDIR/keymaps/$ANSWER_OPTION
var_KEYMAP=$ANSWER_OPTION
+ echo "$var_KEYMAP" > $RUNTIME_DIR/aif-keymap
fi
FONTS=
@@ -669,5 +676,6 @@ set_keymap ()
setfont $KBDDIR/consolefonts/$var_CONSOLEFONT -C /dev/tty$i
fi
done
+ echo "$var_CONSOLEFONT" > $RUNTIME_DIR/aif-consolefont
fi
}
diff --git a/src/core/procedures/base b/src/core/procedures/base
index 88bd9c3..379b154 100644
--- a/src/core/procedures/base
+++ b/src/core/procedures/base
@@ -31,6 +31,7 @@ phase_system=(\
auto_fstab \
auto_network \
auto_locale \
+ auto_keymap_font \
configure_system \
mkinitcpio \
locales \
@@ -169,6 +170,11 @@ worker_auto_locale ()
}
+worker_auto_keymap_font ()
+{
+ target_configure_initial_keymap_font
+}
+
worker_configure_system ()
{
#TODO: what to do here?
diff --git a/src/core/procedures/interactive b/src/core/procedures/interactive
index ca9e489..0e59066 100644
--- a/src/core/procedures/interactive
+++ b/src/core/procedures/interactive
@@ -78,7 +78,8 @@ mainmenu()
check_depend worker package_list && \
check_depend worker select_source && execute worker install_packages && { execute worker auto_fstab ; \
ended_ok worker runtime_network && execute worker auto_network ; \
- execute worker auto_locale ; } && NEXTITEM=6 ;;
+ execute worker auto_locale ; \
+ execute worker auto_keymap_font; } && NEXTITEM=6 ;;
"6")
check_depend worker install_packages && execute worker configure_system && { execute worker mkinitcpio ; \
execute worker locales ;