[PC-BSD Commits] r1937 - pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts

svn at pcbsd.org svn at pcbsd.org
Wed May 21 08:00:47 PDT 2008


Author: kris
Date: 2008-05-21 08:00:47 -0700 (Wed, 21 May 2008)
New Revision: 1937

Modified:
   pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SaveKeyboard.sh
   pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SetKeyboard.sh
   pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh
Log:

Updated the keyboard layout scripts to reflect upcoming changes to installer GUI



Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SaveKeyboard.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SaveKeyboard.sh	2008-05-21 14:46:16 UTC (rev 1936)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SaveKeyboard.sh	2008-05-21 15:00:47 UTC (rev 1937)
@@ -1,7 +1,15 @@
 #!/bin/sh
 
-KEYMAP="${1}"
+# Check that we have a valid keyboard layout
+if [ ! -e "/uzip/.keylayout" ]
+then
+  exit
+fi
 
+KEYMAP="`cat /uzip/.keylayout`" ; export KEYMAP
+MODEL="`cat /uzip/.keymodel`" ; export MODEL
+VARIANT="`cat /uzip/.keyvariant`" ; export VARIANT
+
 HEADERS="xorg.conf.generic
 ati.xorg.conf
 ati-3d-enable.xorg.conf
@@ -15,133 +23,115 @@
 
 # Change KDE keyboard model
 change_kxkbrc() {
-    kbdmodel=$1
 
     KXKBRC="/mnt/usr/share/skel/.kde/share/config/kxkbrc"
     KXKBRC_TMP="/mnt/kxkbrc.tmp"
     cp ${KXKBRC} ${KXKBRC_TMP}
-    sed "s/Model=pc104/Model=${kbdmodel}/" < ${KXKBRC_TMP} > ${KXKBRC}
+    sed "s/Model=pc104/Model=${MODEL}/" < ${KXKBRC_TMP} > ${KXKBRC}
 
+    KXKBRC_TMP="/mnt/kxkbrc.tmp"
+    cp ${KXKBRC} ${KXKBRC_TMP}
+    sed "s/CHANGEME/${KEYMAP}/" < ${KXKBRC_TMP} > ${KXKBRC}
+
     for i in `ls /mnt/usr/home`
     do
 	KXKBRC="/mnt/usr/home/${i}/.kde/share/config/kxkbrc"
 	cp ${KXKBRC} ${KXKBRC_TMP}
-	sed "s/Model=pc104/Model=${kbdmodel}/" < ${KXKBRC_TMP} > ${KXKBRC}
+	sed "s/Model=pc104/Model=${MODEL}/" < ${KXKBRC_TMP} > ${KXKBRC}
+	
+        KXKBRC="/mnt/usr/home/${i}/.kde/share/config/kxkbrc"
+	cp ${KXKBRC} ${KXKBRC_TMP}
+	sed "s/CHANGEME/${KEYMAP}/" < ${KXKBRC_TMP} > ${KXKBRC}
     done
     rm -f ${KXKBRC_TMP}
 }
 
+# change the key model now
+change_kxkbrc
 
-# Make sure they keyboard layout is saved
+
+# Make sure they keyboard type is saved in all xorg files
 for i in $HEADERS
 do
 
+# Set the model
 XF86_CFG="/mnt/PCBSD/xorg-gui/templates/header/${i}"
 XF86_TMP_CFG="/mnt/xorg.conf.tmp"
 cp ${XF86_CFG} ${XF86_TMP_CFG}
-sed "s/\"us\"/\"${KEYMAP}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
+sed "s/\"pc105\"/\"${MODEL}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
 rm -f ${XF86_TMP_CFG}
 
-done
-
-
-
-# Do it for the saved configuration as well
-XF86_CFG="/mnt/PCBSD/xorg-gui/conf/xorg.conf.basic"
+# Set the layout
+XF86_CFG="/mnt/PCBSD/xorg-gui/templates/header/${i}"
 XF86_TMP_CFG="/mnt/xorg.conf.tmp"
 cp ${XF86_CFG} ${XF86_TMP_CFG}
 sed "s/\"us\"/\"${KEYMAP}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
 rm -f ${XF86_TMP_CFG}
 
-# Do it for the generic VESA config
-XF86_CFG="/mnt/PCBSD/xorg-gui/cardDetect/XF86Config.compat"
+# Set the variant
+XF86_CFG="/mnt/PCBSD/xorg-gui/templates/header/${i}"
 XF86_TMP_CFG="/mnt/xorg.conf.tmp"
 cp ${XF86_CFG} ${XF86_TMP_CFG}
-sed "s/\"us\"/\"${KEYMAP}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
+sed "s/\"intl\"/\"${VARIANT}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
 rm -f ${XF86_TMP_CFG}
 
-# And for the cardDetect header
-XF86_CFG="/mnt/PCBSD/xorg-gui/cardDetect/XF86Config.default"
+done
+
+
+
+# Do it for the saved configuration as well
+XF86_CFG="/mnt/PCBSD/xorg-gui/conf/xorg.conf.basic"
 XF86_TMP_CFG="/mnt/xorg.conf.tmp"
 cp ${XF86_CFG} ${XF86_TMP_CFG}
 sed "s/\"us\"/\"${KEYMAP}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
 rm -f ${XF86_TMP_CFG}
 
-
-if [ "${1}" = "br" ]
-then
-
-for i in $HEADERS
-do
-
-XF86_CFG="/mnt/PCBSD/xorg-gui/templates/header/${i}"
+XF86_CFG="/mnt/PCBSD/xorg-gui/conf/xorg.conf.basic"
+XF86_TMP_CFG="/mnt/xorg.conf.tmp"
 cp ${XF86_CFG} ${XF86_TMP_CFG}
-sed "s/\"pc105\"/\"abnt2\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
+sed "s/\"intl\"/\"${VARIANT}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
 rm -f ${XF86_TMP_CFG}
 
-change_kxkbrc "abnt2" 
-
-done
-
-# Do it for the saved configuration as well
 XF86_CFG="/mnt/PCBSD/xorg-gui/conf/xorg.conf.basic"
 XF86_TMP_CFG="/mnt/xorg.conf.tmp"
 cp ${XF86_CFG} ${XF86_TMP_CFG}
-sed "s/\"pc105\"/\"abnt2\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
+sed "s/\"pc105\"/\"${MODEL}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
 rm -f ${XF86_TMP_CFG}
 
 # Do it for the generic VESA config
 XF86_CFG="/mnt/PCBSD/xorg-gui/cardDetect/XF86Config.compat"
 XF86_TMP_CFG="/mnt/xorg.conf.tmp"
 cp ${XF86_CFG} ${XF86_TMP_CFG}
-sed "s/\"pc105\"/\"anbt2\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
+sed "s/\"us\"/\"${KEYMAP}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
 rm -f ${XF86_TMP_CFG}
 
-# And for the cardDetect header
-XF86_CFG="/mnt/PCBSD/xorg-gui/cardDetect/XF86Config.default"
+XF86_CFG="/mnt/PCBSD/xorg-gui/cardDetect/XF86Config.compat"
 XF86_TMP_CFG="/mnt/xorg.conf.tmp"
 cp ${XF86_CFG} ${XF86_TMP_CFG}
-sed "s/\"pc105\"/\"abnt2\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
+sed "s/\"intl\"/\"${VARIANT}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
 rm -f ${XF86_TMP_CFG}
 
-
-fi
-
-if [ "${1}" = "jp" ]
-then
-
-for i in $HEADERS
-do
-
-XF86_CFG="/mnt/PCBSD/xorg-gui/templates/header/${i}"
+XF86_CFG="/mnt/PCBSD/xorg-gui/cardDetect/XF86Config.compat"
+XF86_TMP_CFG="/mnt/xorg.conf.tmp"
 cp ${XF86_CFG} ${XF86_TMP_CFG}
-sed "s/\"pc105\"/\"jp106\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
+sed "s/\"pc105\"/\"${MODEL}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
 rm -f ${XF86_TMP_CFG}
 
-change_kxkbrc "jp106"
-
-done
-
-# Do it for the saved configuration as well
-XF86_CFG="/mnt/PCBSD/xorg-gui/conf/xorg.conf.basic"
+# And for the cardDetect header
+XF86_CFG="/mnt/PCBSD/xorg-gui/cardDetect/XF86Config.default"
 XF86_TMP_CFG="/mnt/xorg.conf.tmp"
 cp ${XF86_CFG} ${XF86_TMP_CFG}
-sed "s/\"pc105\"/\"jp106\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
+sed "s/\"us\"/\"${KEYMAP}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
 rm -f ${XF86_TMP_CFG}
 
-# Do it for the generic VESA config
-XF86_CFG="/mnt/PCBSD/xorg-gui/cardDetect/XF86Config.compat"
+XF86_CFG="/mnt/PCBSD/xorg-gui/cardDetect/XF86Config.default"
 XF86_TMP_CFG="/mnt/xorg.conf.tmp"
 cp ${XF86_CFG} ${XF86_TMP_CFG}
-sed "s/\"pc105\"/\"jp106\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
+sed "s/\"intl\"/\"${VARIANT}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
 rm -f ${XF86_TMP_CFG}
 
-# And for the cardDetect header
 XF86_CFG="/mnt/PCBSD/xorg-gui/cardDetect/XF86Config.default"
 XF86_TMP_CFG="/mnt/xorg.conf.tmp"
 cp ${XF86_CFG} ${XF86_TMP_CFG}
-sed "s/\"pc105\"/\"jp106\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
+sed "s/\"pc105\"/\"${MODEL}\"/" < ${XF86_TMP_CFG} > ${XF86_CFG}
 rm -f ${XF86_TMP_CFG}
-
-
-fi

Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SetKeyboard.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SetKeyboard.sh	2008-05-21 14:46:16 UTC (rev 1936)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SetKeyboard.sh	2008-05-21 15:00:47 UTC (rev 1937)
@@ -1,10 +1,12 @@
 #!/bin/sh
 
 layout=$1
-case ${1} in
-   br) map="abnt2" ;; # Brazilian
-   jp) map="jp106" ; layout="jp" ;; # Japanese
-    *) map="pc104" ;;
-esac
+model=$2
+variant=$3
 
-setxkbmap -model $map -layout $layout
+setxkbmap -model $model -layout $layout -variant $variant
+
+# Save the keyboard setup so the SaveKeyboard.sh script can later use values
+echo "$model" >/uzip/.keymodel
+echo "$layout" >/uzip/.keylayout
+echo "$variant" >/uzip/.keyvariant

Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh	2008-05-21 14:46:16 UTC (rev 1936)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh	2008-05-21 15:00:47 UTC (rev 1937)
@@ -1,12 +1,10 @@
 #!/bin/sh
 
 LANG="${1}"
-KEYLAYOUT="${2}"
 
 if [ "${1}" = "IGNORE" ]
 then
   LANG="" ; export LANG
-  KEYLAYOUT="" ; export KEYLAYOUT
 fi
 
 # Check if we are on an AMD processor and disable powerd if so
@@ -75,7 +73,7 @@
 
 
 # Setup the keyboard as its supposed to be
-/usr/local/pcbsd/scripts/PCBSD.SaveKeyboard.sh ${KEYLAYOUT} 
+/usr/local/pcbsd/scripts/PCBSD.SaveKeyboard.sh
 
 
 # Setup the proper boot-loader 



More information about the Commits mailing list