From 1aa91f496161d327e59d8fa1ba55c7210d42dd1c Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 19 Feb 2015 13:26:01 +0100 Subject: [PATCH] [livecd] some fixes --- lib/util-livecd.sh | 71 ++++++++++++++++++++++++++++------------------ scripts/livecd | 11 ++++--- 2 files changed, 49 insertions(+), 33 deletions(-) diff --git a/lib/util-livecd.sh b/lib/util-livecd.sh index 96a4512..4017f4b 100644 --- a/lib/util-livecd.sh +++ b/lib/util-livecd.sh @@ -35,32 +35,32 @@ get_layout(){ echo $(kernel_cmdline layout) } -# find_legacy_keymap(){ -# file="/opt/livecd/kbd-model-map" -# while read -r line || [[ -n $line ]]; do -# if [[ -z $line ]] || [[ $line == \#* ]]; then -# continue -# fi -# -# mapping=( $line ); # parses columns -# if [[ ${#mapping[@]} != 5 ]]; then -# continue -# fi -# -# if [[ "$KEYMAP" != "${mapping[0]}" ]]; then -# continue -# fi -# -# if [[ "${mapping[3]}" = "-" ]]; then -# mapping[3]="" -# fi -# -# X11_LAYOUT=${mapping[1]} -# X11_MODEL=${mapping[2]} -# X11_VARIANT=${mapping[3]} -# x11_OPTIONS=${mapping[4]} -# done < $file -# } +find_legacy_keymap(){ + file="/opt/livecd/kbd-model-map" + while read -r line || [[ -n $line ]]; do + if [[ -z $line ]] || [[ $line == \#* ]]; then + continue + fi + + mapping=( $line ); # parses columns + if [[ ${#mapping[@]} != 5 ]]; then + continue + fi + + if [[ "$KEYMAP" != "${mapping[0]}" ]]; then + continue + fi + + if [[ "${mapping[3]}" = "-" ]]; then + mapping[3]="" + fi + + X11_LAYOUT=${mapping[1]} + X11_MODEL=${mapping[2]} + X11_VARIANT=${mapping[3]} + x11_OPTIONS=${mapping[4]} + done < $file +} write_x11_config(){ # find a x11 layout that matches the keymap @@ -70,7 +70,7 @@ write_x11_config(){ local X11_MODEL="pc105" local X11_VARIANT="" local X11_OPTIONS="terminate:ctrl_alt_bksp" -# find_legacy_keymap + find_legacy_keymap # layout not found, use KBLAYOUT if [[ -z "$X11_LAYOUT" ]]; then @@ -362,6 +362,23 @@ configure_alsa(){ $alsa_amixer -c 0 sset "Audigy Analog/Digital Output Jack" off &>/dev/null } +rm_kalu(){ + local base_check_virtualbox=`dmidecode | grep innotek` + local base_check_vmware=`dmidecode | grep VMware` + local base_check_qemu=`dmidecode | grep QEMU` + local base_check_vpc=`dmidecode | grep Microsoft` + + if [ -n "$base_check_virtualbox" ]; then + pacman -R kalu --noconfirm --noprogressbar --root $1 &> /dev/null + elif [ -n "$base_check_vmware" ]; then + pacman -R kalu --noconfirm --noprogressbar --root $1 &> /dev/null + elif [ -n "$base_check_qemu" ]; then + pacman -R kalu --noconfirm --noprogressbar --root $1 &> /dev/null + elif [ -n "$base_check_vpc" ]; then + pacman -R kalu --noconfirm --noprogressbar --root $1 &> /dev/null + fi +} + ### end shared functions with cli installer configure_machine_id(){ diff --git a/scripts/livecd b/scripts/livecd index 8be75ce..31b4954 100755 --- a/scripts/livecd +++ b/scripts/livecd @@ -41,24 +41,23 @@ echo "depmod extramodules" >> /tmp/livecd.log # depmod extramodules depmod $(cat /usr/lib/modules/$(uname -r)/extramodules/version) -# check if we are running inside a virtual machine and unistall kalu -DESTDIR="/" -[[ -e "/usr/bin/kalu" ]] && _rm_kalu - install_localization configure_displaymanager echo "configure root password" >> /tmp/livecd.log -configure_user_root "${DESTDIR}" +configure_user_root "/" cp -a /etc/skel/. /root/ # configure documentation [[ -e "/etc/skel/Manjaro/Beginner_User_Guide.pdf" ]] && ln -sf \ /etc/skel/Manjaro/Beginner_User_Guide.pdf "/home/${username}/Desktop/Beginner User Guide.pdf" -configure_alsa "${DESTDIR}" +configure_alsa "/" # save settings alsactl -f /etc/asound.state store &>/dev/null + +# check if we are running inside a virtual machine and unistall kalu +[[ -e "/usr/bin/kalu" ]] && rm_kalu "/"