Check-in [aeb3a81a7a]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:aeb3a81a7af42194fa8b1ba63c1926a09316c474
Date: 2012-03-28 22:02:29
User: BarryK
Comment:rc.country completely rewritten, to fix non-english console-font loading. also fixed keyboard layout in xorgwizard-automatic

Tags And Properties
Changes

Changes to woof-code/boot/initrd-tree0/init

@@ -129,10 +129,11 @@
 #120130 bring back Underdog Linux. Refer "take 2": http://puppylinux.com/development/howpuppyworks.html
 #120215 internationalized (with help from L18L). /PUPPYLANG inserted by quicksetup (in future, Woof too).
 #120216 /PUPPYKEYMAP inserted by quicksetup. if PLANG but no PKEYS, try assign matching PKEYS. L18L: new fonts.
 #120217 L18L: export LANGUAGE and OUTPUT_CHARSET.
 #120222 remove setting LANGUAGE. fix if boot param shortened, ex: plang=de
+#120328 could have iso9660 f.s. booting off a usb flash/hard drive (see BootFlash). exclude /dev/sd and /dev/mmc.
 
 #Unionfs layers setup by this script...
 #unionfs layers:            RW (top)      RO1             RO2              PUPMODE
 #full install, flash drive: tmpfs         PDEV1                            3
 #First boot (or pfix=ram):  tmpfs                         pup_xxx.sfs      5
@@ -689,11 +690,12 @@
 [ "$ALLDRVS" ] && echo "$ALLDRVS0" > /tmp/ALLDRVS0 #all drives *except* usb.
 
 PCPARTSALL="`probepart_init -k`"
 PCPARTS0="`echo "$PCPARTSALL" | grep '^/dev/' | cut -f 1-2 -d '|'  | grep -E 'iso9660|ext2|ext3|ext4|reiserfs|msdos|vfat|minix|ntfs' | sed -e 's%/dev/%%'`" #ex: sda1|vfat
 LESSPARTS0="$PCPARTS0"
-OPTICALDRIVES0="`echo "$PCPARTS0" | grep 'iso9660' | cut -f 1 -d '|'`" #ex: sr0
+#120328 could have iso9660 f.s. booting off a non-optical drive (see BootFlash). exclude /dev/mmc ...
+OPTICALDRIVES0="`echo "$PCPARTS0" | grep 'iso9660' | grep -v '^mmc' | cut -f 1 -d '|'`" #ex: sr0
 touch /tmp/OPTICALDRIVES0 #110509 fix for using with grep.
 [ "$OPTICALDRIVES0" != "" ] && echo "$OPTICALDRIVES0" > /tmp/OPTICALDRIVES0 #110509 fix
 
 echo "ALLDRVS=$ALLDRVS " >> /tmp/puppy-file-search.log #for debugging.
 
@@ -752,11 +754,12 @@
  echo "$ALLDRVS0" > /tmp/ALLDRVS0 #110205
 
  PCPARTSALL="`probepart_init -k`"
  PCPARTS0="`echo "$PCPARTSALL" | grep '^/dev/' | cut -f 1-2 -d '|'  | grep -E 'iso9660|ext2|ext3|ext4|reiserfs|msdos|vfat|minix|ntfs' | sed -e 's%/dev/%%'`" #ex: sda1|vfat
  LESSPARTS0="$PCPARTS0"
- OPTICALDRIVES0="`echo "$PCPARTS0" | grep 'iso9660' | cut -f 1 -d '|'`" #ex: sr0
+ #120328 could have iso9660 f.s. booting off a usb flash/hard drive (see BootFlash). exclude /dev/sd and /dev/mmc ...
+ OPTICALDRIVES0="`echo "$PCPARTS0" | grep 'iso9660' | grep -v -E '^sd|^mmc' | cut -f 1 -d '|'`" #ex: sr0
  touch /tmp/OPTICALDRIVES0 #fix
  [ "$OPTICALDRIVES0" ] && echo "$OPTICALDRIVES0" > /tmp/OPTICALDRIVES0 #fix
  echo "ALLDRVS=$ALLDRVS " >> /tmp/puppy-file-search.log
 
  if [ "$VMLINUZ" = "" -o "$PUPSFS" = "" -o "$SAVEPART" = "" ];then

Changes to woof-code/rootfs-skeleton/etc/X11/xorg.conf-auto-pc

@@ -1,9 +1,10 @@
 #barry Kauler 2011
 #pre-constructed xorg.conf, for use by /usr/sbin/xorgwizard-automatic
 #110627 working on mageia1 build, this needs fixing.
 #111029 Terryphi reported 1cm screen displacement, changed vert freq range from 56-76 to 59-76.
+#120329 more placemarkers for xorgwizard-automatic script.
 
 # **********************************************************************
 # Module section -- this  section  is used to specify
 # which dynamically loadable modules to load.
 # **********************************************************************
@@ -99,12 +100,13 @@
 
 Section "InputDevice"
 	Identifier  "Keyboard0"
 	Driver      "kbd"
 	Option      "XkbRules" "xorg"
-	Option      "XkbModel" "pc102"
+	Option      "XkbModel" "pc102" #xkbmodel0
 	Option      "XkbLayout" "us" #xkeymap0
+	#Option      "XkbVariant" "" #xkbvariant0
 EndSection
 
 Section "InputDevice"
 	Identifier  "Mouse0"
 	Driver      "mouse"

Changes to woof-code/rootfs-skeleton/etc/rc.d/rc.country

@@ -1,41 +1,27 @@
 #!/bin/sh
-#(c) Copyright 2007 Barry Kauler
-#2007 Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html)
-#v405 called from rc.sysinit.
-#w000 /etc/DISTRO_SPECS, renamed pup_xxx.sfs, pup_save.2fs etc.
-#w001 selection of locale.
-#w019 april2009: selection of timezone.
-#091122 merge kmap mods from ecube, maps now in /lib/keymaps, /lib/consolefonts.
-#100127 added sv.
-#100319 TZ, hwclock fix.
-#100525 hardware clock can be utc or localtime (thanks to pizzasgood).
-#101112, 101115 disabled FONTMAP, see http://bkhome.org/blog/?viewDetailed=01956
-#110409 changed locale names .utf8 to .UTF-8.
-#110509 shinobar: fix, locale -a always prints .utf8 (even if ex en_US.UTF-8)
-#111020 if DISTRO_XORG_AUTO==yes, run 'quickcountry' localization after X started.
-#120215 '/usr/sbin/chooselocale cli quiet' ask no questions, will run localedef.
-#120216 L18L: modification to FONTMAP loading.
+#(c) Copyright 2012 Barry Kauler
+#2012 GPL licence v3 (refer: /usr/share/doc/legal)
+#120328 rewrite script.
 
 . /etc/rc.d/PUPSTATE
 . /etc/DISTRO_SPECS #has DISTRO_XORG_AUTO
 STATUS=0
-. /etc/clock #100525
+. /etc/clock
 
 [ $pkeys ] && PKEYS=$pkeys #boot parameter
 
-#111020
-ASKKMAP="yes"; ASKLANG="yes"
+ASKKMAP="yes"; ASKLANG="yes"; ASKCLOCK="no"
 [ "$DISTRO_XORG_AUTO" = "yes" ] && ASKKMAP="no" && ASKLANG="no"
 [ -f /tmp/bootcnt.txt ] && ASKKMAP="yes" && ASKLANG="yes" #file created in 'init' if pfix=nox.
 
+######keyboard section######
 askkbdlayout ()
 {
- KEYBOARD=""
- FONTMAP=""
- CODEPAGE=""
- FIRSTITEM="us \"(USA)\"" #111020
+ echo -n "us" > /etc/keymap #default.
+ echo -n "" > /etc/codepage # "
+ FIRSTITEM="us \"(USA)\""
  echo -n "" >/tmp/keybdlist.txt
  for AFILE in `ls /lib/keymaps/*`
  do
   AKMAP="`basename $AFILE .gz`" #us, fr, br, etc.
   case $AKMAP in
@@ -89,128 +75,104 @@
    dvorak-r) ACNTRY="(Right_single-handed)";;
    dvorak-l) ACNTRY="(Left_single-handed)";;
    *)  ACNTRY="-";;
   esac
   echo -e "$AKMAP \"${ACNTRY}\"" >> /tmp/keybdlist.txt
-  [ "$KMAP" = "$AKMAP" ] && FIRSTITEM="$AKMAP \"${ACNTRY}\"" #111020
  done
  KEYLIST="${FIRSTITEM} `sort /tmp/keybdlist.txt | tr '\n' ' '`"
-
  echo '#!/bin/sh' >/tmp/keydlg
  echo 'dialog --aspect 10 --no-cancel --menu "Select the keyboard layout:\n(UP/DOWN arrows then ENTER key)" 0 0 0 \' >>/tmp/keydlg #' geany fix
  echo "$KEYLIST 2> /tmp/kbdextlayout.txt" >>/tmp/keydlg
  echo 'exit $?' >>/tmp/keydlg
  chmod 755 /tmp/keydlg
  /tmp/keydlg >/dev/console
  [ $? != 0 ] && return 1
  clear > /dev/console 2>&1 #clear screen
- KEYBOARD=`cat /tmp/kbdextlayout.txt`
- case $KEYBOARD in #note, same code in /usr/sbin/input-wizard and init.
-  de*|be*|br*|dk*|es*|fi*|fr*|it*|no*|se*|sv*|pt*) #100127 added sv.
-   FONTMAP="lat1-12.psfu"
-   modprobe nls_cp850
-   CODEPAGE="850"
-  ;;
-  cz*|hu*|pl*|ro*|sk*|croat*|slovene*)
-   modprobe nls_cp852
-   modprobe nls_iso8859-2
-   FONTMAP="lat2-12.psfu"
-   CODEPAGE="852"
-   ;;
+ KMAP=`cat /tmp/kbdextlayout.txt`
+ case $KMAP in #note, same/similar code in /usr/sbin/input-wizard, init, quicksetup.
+  de*|be*|br*|dk*|es*|fi*|fr*|it*|no*|se*|sv*|pt*) echo -n "850" > /etc/codepage ;;
+  cz*|hu*|pl*|ro*|sk*|croat*|slovene*)  echo -n "852" > /etc/codepage  ;;
  esac
- FONTMAP='' #101112
+ echo -n "$KMAP" > /etc/keymap
  return 0
 }
 
-if [ "$ASKKMAP" = "no" ];then #111020
- #'quickcountry' is run 1st time X starts.
+if [ "$ASKKMAP" = "no" ];then
+ #'quicksetup' is run 1st time X starts.
  [ ! -f /etc/keymap ] && echo -n "us" > /etc/keymap
- [ ! -f /etc/fontmap ] && echo -n "" > /etc/fontmap
+ [ ! -f /etc/codepage ] && echo -n "" > /etc/codepage
 else
- if [ ! -e /etc/keymap ];then
-  KMAP="us"
-  askkbdlayout #func above.
-  #...this sets KEYBOARD, FONTMAP, CODEPAGE variables.
-  [ $? -eq 0 ] && KMAP="$KEYBOARD"
-  echo -n "$KMAP" > /etc/keymap
-  #echo -n "$FONTMAP" > /etc/fontmap
-  echo -n "$CODEPAGE" > /etc/codepage
- fi
+ [ ! -e /etc/keymap ] && askkbdlayout #creates /etc/keymap, /etc/codepage.
+fi
+
+if [ -s /etc/codepage ];then
+ CODEPAGE="`cat /etc/codepage`"
+ case $CODEPAGE in
+  850) modprobe nls_cp850 ;;
+  852) modprobe nls_cp852 ; modprobe nls_iso8859-2 ;;
+ esac
 fi
 
-LANG="`grep '^LANG=' /etc/profile | cut -f 2 -d '='`"
-CLANG="`echo "$LANG" | sed -e 's/\.UTF-8/\.utf8/'`" #110509 shinobar fix, locale -a always prints .utf8
-
-if [ ! -s /etc/fontmap ];then #120216 L18L see init
- FONTMAP=""
- case $LANG in
-  en*)     FONTMAP="" ;;
-  ar*|iw*) FONTMAP='LatArCyrHeb-16.psfu' ;;
-  *)       FONTMAP='LatGrkCyr-8x16.psfu' ;;
- esac
- echo -n "$FONTMAP" > /etc/fontmap
-fi
-
-NEED2LOADKMAP="yes"
-[ -d /initrd -a "$PKEYS" ] && NEED2LOADKMAP="no" #already done in initrd.
-
-if [ "$NEED2LOADKMAP" = "yes" ];then
- KMAP="`cat /etc/keymap`"
- case $KMAP in #111020 shinobar
-  *.map) loadkeys $KMAP ;;
-  *) gzip -dcf /lib/keymaps/$KMAP.gz | loadkmap ;;
- esac
- FONTMAP="`cat /etc/fontmap`"
- if [ "$FONTMAP" ];then
-  case $FONTMAP in #L18L see init
-   LatArCyrHeb-16.psfu)
-    setfont /lib/consolefonts/LatArCyrHeb-16.psfu.gz -C /dev/tty1
-   ;;
-   *)
-    zcat /lib/consolefonts/${FONTMAP}.gz | loadfont
-   ;;
+#note, "keymap-set --xopt" is run in xorgwizard and xorgwizard-automatic,
+# "keymap-set --load" is run in quicksetup.
+if [ -s /etc/keymap ];then
+ NEED2LOADKMAP="yes"
+ [ -d /initrd -a "$PKEYS" ] && NEED2LOADKMAP="no" #already done in initrd.
+ if [ "$NEED2LOADKMAP" = "yes" ];then
+  KMAP="`cat /etc/keymap`"
+  case $KMAP in
+   *.map) loadkeys $KMAP ;;
+   *) gzip -dcf /lib/keymaps/$KMAP.gz | loadkmap ;;
   esac
  fi
 fi
+######end keyboard section######
+
+######locale section######
+LANG="`grep '^LANG=' /etc/profile | cut -f 2 -d '='`"
+CLANG="`echo "$LANG" | sed -e 's/\.UTF-8/\.utf8/'`" #fix, locale -a always prints .utf8
 
-if [ "$ASKLANG" = "no" ];then #111020
- #'quickcountry' is run 1st time X starts.
+if [ "$ASKLANG" = "no" ];then
+ #'quicksetup' is run 1st time X starts.
  #need this default locale for X to start first time...
  [ ! -d /usr/lib/locale/en_US ] && localedef -f ISO-8859-1 -i en_US --no-archive en_US >/dev/null
- [ ! -d /usr/lib/locale/${CLANG} ] && /usr/sbin/chooselocale cli quiet #120215 ask no questions, will run localedef.
+ [ ! -d /usr/lib/locale/${CLANG} ] && /usr/sbin/chooselocale cli quiet #ask no questions, will run localedef.
 else
  #localedef creates locale files in /usr/lib/locale...
  if [ "`locale -a | grep "$CLANG"`" = "" ];then
   if [ "$LANG" = "en_US" ];then
    /usr/sbin/chooselocale cli > /dev/console
   else
-   /usr/sbin/chooselocale cli quiet #120215 ask no questions, will run localedef.
+   /usr/sbin/chooselocale cli quiet #ask no questions, will run localedef.
   fi
-  /usr/sbin/timezone-set cli > /dev/console
-  #100525 choose hardware clock set to local or UTC...
-  dialog --title "Set hardware-clock type" --yes-label "Local" --no-label "UTC" --yesno "Is the hardware clock on the computer set to the local time, or to UTC? Note, most PCs with Windows installed have the hardware clock set to the local time, so if in doubt choose that..." 0 0 > /dev/console
-  if [ $? -eq 1 ];then #UTC
-   HWCLOCKTIME='utc'
-   hwPATTERN="s/^HWCLOCKTIME=[^#]*/HWCLOCKTIME='utc'/"
-   sed -i "$hwPATTERN" /etc/clock #note, it is default 'localtime'.
-  fi
+  /sbin/load_consolefont #note, also called from rc.sysinit, xwin.
+  ASKCLOCK="yes"
+ fi
+fi
+######end locale section######
+
+######clock section######
+if [ "$ASKCLOCK" = "yes" ];then
+ /usr/sbin/timezone-set cli > /dev/console
+ #choose hardware clock set to local or UTC...
+ dialog --title "Set hardware-clock type" --yes-label "Local" --no-label "UTC" --yesno "Is the hardware clock on the computer set to the local time, or to UTC? Note, most PCs with Windows installed have the hardware clock set to the local time, so if in doubt choose that..." 0 0 > /dev/console
+ if [ $? -eq 1 ];then #UTC
+  HWCLOCKTIME='utc'
+  hwPATTERN="s/^HWCLOCKTIME=[^#]*/HWCLOCKTIME='utc'/"
+  sed -i "$hwPATTERN" /etc/clock #note, it is default 'localtime'.
  fi
 fi
-
-if [ -f /etc/localtime ];then #111020
- #100319 moved from /etc/profile
- #Ref: http://www.gnu.org/s/libc/manual/html_node/TZ-Variable.html
- TZ=$(readlink /etc/localtime|sed -e 's,/usr/share/zoneinfo/,,' -e 's,Etc/,,') #111020 shinobar
- export TZ
- HWCLOCKTIME="localtime"
- [ -s /etc/clock ] && grep -qw '^[^#]*utc' /etc/clock && HWCLOCKTIME="utc" #111020 shinobar
-
- #100319 moved down.
- #need to set Linux system time/date, from hardware clock...
- #hwclock --hctosys --localtime
- hwclock --hctosys --${HWCLOCKTIME} #100525
- #...--hctosys reads cmos clock to system.
- #...--localtime means that cmos clock is set to local-time.
-fi
+[ ! -e /etc/localtime ] && ln -s /usr/share/zoneinfo/Australia/Perth /etc/localtime
+#Ref: http://www.gnu.org/s/libc/manual/html_node/TZ-Variable.html
+TZ=$(readlink /etc/localtime|sed -e 's,/usr/share/zoneinfo/,,' -e 's,Etc/,,') #shinobar
+export TZ
+HWCLOCKTIME="localtime"
+[ -s /etc/clock ] && grep -qw '^[^#]*utc' /etc/clock && HWCLOCKTIME="utc" #shinobar
+#need to set Linux system time/date, from hardware clock...
+#hwclock --hctosys --localtime
+hwclock --hctosys --${HWCLOCKTIME}
+#...--hctosys reads cmos clock to system.
+#...--localtime means that cmos clock is set to local-time.
+######end clock section######
 
 exit $STATUS
 ###END###

Changes to woof-code/rootfs-skeleton/usr/sbin/quicksetup

@@ -34,10 +34,11 @@
 #120305 check if langpack available in noarch repo.
 #120311 change persistence logic for 120227.
 #120313 hardcode translations for popup if user changes locale.
 #120313 restrict network frame to only be in main quicksetup window.
 #120315 dutch (nl) hardcode translation for locale-change popup. added pt, es, it.
+#120328 have rewritten rc.country, try to make chooselocale compatible.
 
 [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@}
 
 export TEXTDOMAIN=quicksetup
 export OUTPUT_CHARSET=UTF-8
@@ -901,43 +902,43 @@
     NEWLANGLINE="LANG=${LANGCHOICE}.UTF-8"
    fi
   fi
   NEWLANG="`echo -n "$NEWLANGLINE" | cut -f 2 -d '='`" #ex: de_DE.UTF-8
 
+  if [ "$OLDLANGLINE" != "$NEWLANGLINE" ];then
+   #langPATTERN="s/${OLDLANGLINE}/${NEWLANGLINE}/"
+   langPATTERN="s%^LANG=.*%${NEWLANGLINE}%" #111022
+   sed -i -e "$langPATTERN" /etc/profile
+   #120328 code moved up, to be compatible for chooselocale call from rc.country...
+   #120224 load console font... (code based on that in 'init')
+   #120301 don't load console font here. seems to get dropped on exit from X. (instead, do it in xwin. now have /sbin/load_consolefont)
+   case $NEWLANG in
+    en*)
+     #er, no, really want to unload all console fonts.
+     echo -n "" > /etc/fontmap #well, next boot, no font will be loaded.
+    ;;
+    ar*|iw*) #L18L no Greek
+     echo -n 'LatArCyrHeb-16.psfu' > /etc/fontmap
+    ;;
+    *) #L18L All European languages; new default ?!
+     echo -n 'LatGrkCyr-8x16.psfu' > /etc/fontmap
+    ;;
+   esac
+  fi
+
   if [ "$PARAM2" = "quiet" ];then #120215 refer to /etc/rc.d/rc.country.
    #scripts fixdesk and fixmenus translate files to new language (as specified in /usr/share/sss/menu_strings and desk_strings).
    #so need to call them here...
    #note, these are also called in /etc/rc.d/rc.update, and further down.
    LANG=${NEWLANG} fixscripts
    LANG=${NEWLANG} fixdesk
    LANG=${NEWLANG} fixmenus
    exit
   fi
-
-  if [ "$OLDLANGLINE" != "$NEWLANGLINE" ];then
-   #langPATTERN="s/${OLDLANGLINE}/${NEWLANGLINE}/"
-   langPATTERN="s%^LANG=.*%${NEWLANGLINE}%" #111022
-   sed -i -e "$langPATTERN" /etc/profile
-
-   #120224 load console font... (code based on that in 'init')
-   #120301 no, don't load console font here. seems to get dropped on exit from X. (instead, do it in xwin. now have /sbin/load_consolefont)
-   case $NEWLANG in
-    en*)
-     #er, no, really want to unload all console fonts.
-     #zcat /lib/consolefonts/lat1-12.psfu.gz | loadfont
-     echo -n "" > /etc/fontmap #well, next boot, no font will be loaded.
-    ;;
-    ar*|iw*) #L18L no Greek
-     #setfont /lib/consolefonts/LatArCyrHeb-16.psfu.gz -C /dev/tty1
-     echo -n 'LatArCyrHeb-16.psfu' > /etc/fontmap
-    ;;
-    *) #L18L All European languages; new default ?!
-     #zcat /lib/consolefonts/LatGrkCyr-8x16.psfu.gz | loadfont
-     echo -n 'LatGrkCyr-8x16.psfu' > /etc/fontmap
-    ;;
-   esac
-
+  [ "$MYBASE" = "chooselocale" ] && [ "$PARAM1" = "cli" ] && exit #refer rc.country.
+
+  if [ "$OLDLANGLINE" != "$NEWLANGLINE" ];then
    #120213 need language-pack...
    LANG1=${LANGCHOICE%_*}  #"`echo -n $LANGCHOICE | cut -f 1 -d '_'`"  #ex: de
    LANG12=${LANGCHOICE%.*} #"`echo -n $LANGCHOICE | cut -f 1 -d '.'`" #ex: de_DE
    l1PTN="|langpack_${LANG1}|"
    l12PTN="|langpack_${LANG12}|"

Changes to woof-code/rootfs-skeleton/usr/sbin/shutdownconfig

@@ -16,10 +16,12 @@
 #110925 L18L: i18n conversion, please see /usr/share/doc/nls/shutdownconfig. 110926 BK minor tweaks. 110928 missing \\\. 111003 syntax error.
 #111012 a pupdialog window had wrong text, needed different from non-X dialog.
 #111015 typo.
 #111110 need to export CRYPTO in /tmp/shutdownconfig_results, for rc.shutdown.
 #120323 replace 'xmessage' with 'pupmessage'.
+#120327 only show "*RECOMMENDED*" partition for savefile if >256MB free.
+#120327 expBOOTDRV needs to be exported to rc.shutdown.
 
 if [ ! $DISPLAY ];then
  export LANG=C #110928 console shutdown using 'dialog', disable i18n.
 else
  export OUTPUT_CHARSET=UTF-8
@@ -164,12 +166,12 @@
  while read APART
  do
   ATAG="`echo -n "$APART" | cut -f 1 -d '|' | cut -f 3 -d '/'`"
   ASIZE="`echo -n "$APART" | cut -f 3 -d '|'`"
   AFS="`echo -n "$APART" | cut -f 2 -d '|'`"
-  AFREE="`df -m | grep "/dev/${ATAG} " | tr -s " " | cut -f 4 -d " "`"
-  if [ ! "$AFREE" ];then
+  AFREE=`df -m | grep "/dev/${ATAG} " | tr -s " " | cut -f 4 -d " "`
+  if [ ! $AFREE ];then
    mount -t $AFS /dev/$ATAG /mnt/data > /dev/null 2>&1
    #need to put in a check that it is not mounted ro. the
    #mount script will fallback to ro for ntfs if rw mnt fails...
    RETMNTVAL=$?
    if [ $RETMNTVAL -eq 0 ];then
@@ -193,21 +195,21 @@
    fi
    [ -f /tmp/ntfsmnterr.txt ] && rm -f /tmp/ntfsmnterr.txt
    if [ $RETMNTVAL -eq 0 ];then
     if [ "$ATAG" = "fd0" ];then
      FFREE=`df -k | grep "/dev/$ATAG" | tr -s " " | cut -f 4 -d " "`
-     AFREE="`dc $FFREE 1000 \/ p`" #not 1024
+     AFREE=`dc $FFREE 1000 \/ p` #not 1024
     else
      #for ntfs cannot use /dev/$ATAG, use mnt point in grep...
-     AFREE="`df -m | grep "/mnt/data" | tr -s " " | cut -f 4 -d " "`"
+     AFREE=`df -m | grep "/mnt/data" | tr -s " " | cut -f 4 -d " "`
     fi
     #umount /dev/$ATAG  v2.02 must use mnt point for ntfs...
     umount /mnt/data
    fi
   fi
-  if [ "$AFREE" != "0" ];then
-   if [ "$ATAG" = "$PDEV1" ];then
+  if [ $AFREE -ne 0 ];then
+   if [ "$ATAG" = "$PDEV1" -a $AFREE -gt 256 ];then #120327
     echo -n " --default-item ${ATAG}" > /tmp/shutdownconfig_deftag
     echo "${ATAG} \"f.s.: $AFS  `gettext 'Size:'` ${ASIZE}M  `gettext 'Free:'` ${AFREE}M `gettext '*RECOMMENDED*'`\" " >> /tmp/schoices.txt
    else
     echo "${ATAG} \"`gettext 'Filesystem:'` $AFS  `gettext 'Size:'` ${ASIZE}M  `gettext 'Free:'` ${AFREE}M\" " >> /tmp/schoices.txt
    fi
@@ -717,9 +719,10 @@
 MYPASSWORD='${MYPASSWORD}'
 SFEXT='${SFEXT}'
 xPDEV='${xPDEV}'
 xDEVFS='${xDEVFS}'
 SMNTPT='${SMNTPT}'
-CRYPTO='${CRYPTO}'" > /tmp/shutdownconfig_results
+CRYPTO='${CRYPTO}'
+expBOOTDRV='${expBOOTDRV}'" > /tmp/shutdownconfig_results
 
 exit 0
 #the end#

Changes to woof-code/rootfs-skeleton/usr/sbin/xorgwizard-automatic

@@ -7,40 +7,46 @@
 #110701 synaptics stuff seems to clash with xorg-server 1.10.1.
 #110727 ddcprobe segfaults on my new laptop.
 #110912 fix syntax error. Message at exit of script.
 #110913 ddcprobe working new laptop latest wary with xorg7.6. fix 1366x768 resolution. fix touchpad.
 #120129 jemimah: add Option "SHMConfig" "on".
+#120329 correctly set keyboard layout, model and variant.
 
 . /etc/rc.d/MODULESCONFIG
 
 #110701
 XORGVER="`Xorg -version 2>&1 | grep '^X\.Org' | rev | cut -f 1 -d ' ' | rev`"
 [ ! "$XORGVER" ] && XORGVER="1.3" #110913 precaution.
 
-#read the console keymap (country layout), apply to xkb...
-CONSKEYMAP="`cat /etc/keymap | cut -c 1-2`"
-[ "$CONSKEYMAP" = "" ] && CONSKEYMAP="us"
-case $CONSKEYMAP in
-  az) XKEYMAP="fr" ;;     #azerty
-  wa) XKEYMAP="fr" ;;     #wangbe
-  dv) XKEYMAP="dvorak" ;; #dvorak
-  cr) XKEYMAP="cz" ;;     #croat
-  sl) XKEYMAP="si" ;;     #slovene v2.12 bugfix, changed from 'sk' to 'si' (sk is slovakia)
-  sv) XKEYMAP="se" ;;     #sweden
-  uk) XKEYMAP="gb" ;;     #united kingdom
-  *)  XKEYMAP="$CONSKEYMAP" ;;
-esac
-[ -d /usr/share/X11/xkb ] && XKBPATH='/usr/share/X11'
-[ -d /etc/X11/xkb ] && XKBPATH='/etc/X11'
-if [ -d ${XKBPATH}/xkb/symbols/pc ];then #fallback...
- if [ ! -f ${XKBPATH}/xkb/symbols/pc/${XKEYMAP} ];then
-  if [ ! -f ${XKBPATH}/xkb/symbols/${XKEYMAP} ];then
-   echo "ERROR: Console keyboard `cat /etc/keymap` no matching Xorg layout. PLEASE REPORT TO BK"
-   XKEYMAP='us'
-  fi
- fi
-fi
+#120329 broken, use shinobar's keymap-set...
+##read the console keymap (country layout), apply to xkb...
+#CONSKEYMAP="`cat /etc/keymap | cut -c 1-2`"
+#[ "$CONSKEYMAP" = "" ] && CONSKEYMAP="us"
+#case $CONSKEYMAP in
+#  az) XKEYMAP="fr" ;;     #azerty
+#  wa) XKEYMAP="fr" ;;     #wangbe
+#  dv) XKEYMAP="dvorak" ;; #dvorak
+#  cr) XKEYMAP="cz" ;;     #croat
+#  sl) XKEYMAP="si" ;;     #slovene v2.12 bugfix, changed from 'sk' to 'si' (sk is slovakia)
+#  sv) XKEYMAP="se" ;;     #sweden
+#  uk) XKEYMAP="gb" ;;     #united kingdom
+#  *)  XKEYMAP="$CONSKEYMAP" ;;
+#esac
+#[ -d /usr/share/X11/xkb ] && XKBPATH='/usr/share/X11'
+#[ -d /etc/X11/xkb ] && XKBPATH='/etc/X11'
+#if [ -d ${XKBPATH}/xkb/symbols/pc ];then #fallback...
+# if [ ! -f ${XKBPATH}/xkb/symbols/pc/${XKEYMAP} ];then
+#  if [ ! -f ${XKBPATH}/xkb/symbols/${XKEYMAP} ];then
+#   echo "ERROR: Console keyboard `cat /etc/keymap` no matching Xorg layout. PLEASE REPORT TO BK"
+#   XKEYMAP='us'
+#  fi
+# fi
+#fi
+RETVALS="`keymap-set --xopt`"
+eval "$RETVALS" #ex: XKBMODEL="pc102", XKBLAYOUT="us", XKBVARIANT=""
+[ "$XKBLAYOUT" = "" ] && XKBLAYOUT='us'
+[ "$XKBMODEL" = "" ] && XKBMODEL='pc102'
 
 #probe monitor...
 ddcprobe >/tmp/ddcprobe.txt
 #weird (ddcprobe is very weird), on some hardware, probe fails every alternate run of ddcprobe...
 case "`cat /tmp/ddcprobe.txt`" in *edidfail*)
@@ -90,12 +96,18 @@
 fi
 
 #cp -f /etc/X11/Xorg.conf-generic-laptop /etc/X11/xorg.conf
 cp -f /etc/X11/xorg.conf-auto-pc /etc/X11/xorg.conf
 
-REGEX4="s%.*#xkeymap0%	Option      \"XkbLayout\" \"${XKEYMAP}\" #xkeymap0%"
-sed -i -e "$REGEX4" /etc/X11/xorg.conf
+#120329
+REGEX4="s%.*#xkeymap0%	Option      \"XkbLayout\" \"${XKBLAYOUT}\" #xkeymap0%"
+REGEX5="s%.*#xkbmodel0%	Option      \"XkbModel\" \"${XKBMODEL}\" #xkbmodel0%"
+sed -i -e "$REGEX4" -e "$REGEX5" /etc/X11/xorg.conf
+if [ "$XKBVARIANT" ];then
+ REGEX6="s%.*#xkbvariant0%	Option      \"XkbVariant\" \"${XKBVARIANT}\" #xkbvariant0%"
+ sed -i -e "$REGEX6" /etc/X11/xorg.conf
+fi
 
 if [ "$CHOSENRES" ];then
  REGEX1="s%.*#screen0modes%		Modes       \"${CHOSENRES}\" #screen0modes%"
  REGEX2="s%.*#monitor0prefmode%	Option      \"PreferredMode\" \"${CHOSENRES}\" #monitor0prefmode%"
  sed -i -e "$REGEX1" -e "$REGEX2" /etc/X11/xorg.conf