Skip to content

Commit

Permalink
sync /etc/keymap and /mnt/wkg/sfs/settings/initrd/CONFIG
Browse files Browse the repository at this point in the history
  • Loading branch information
bkauler committed Nov 25, 2023
1 parent 630d292 commit f12d153
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
11 changes: 7 additions & 4 deletions easyos/easy-code/boot/initrd-tree/init
Expand Up @@ -171,6 +171,7 @@
#20231109 hack for nvidia sfs. NO, reverted. check nvidia major version.
#20231111 fix history depth detection.
#20231124 for nvidia.sfs check that nvidia gpu exists.
#20231125 moved up reading sfs/settings/initrd/CONFIG; want to read KEYMAP further down even if no fscrypt.

#20230429
. /build-choices #3buildeasydistro copies it here.
Expand Down Expand Up @@ -302,6 +303,7 @@ ask_kb() { #181010
43 sv-latin1 44 tr 45 us 46 wangbe \e[0;;m'

#20210424 want word-wrapped text block in background colour rectangle...
#S015='Please enter the number corresponding to your keyboard layout.'
echo -n -e '\033[1;;44m'
while read aLINE
do
Expand All @@ -324,15 +326,15 @@ $(echo "${S017}" | fold -s -w 70)
EOT
echo -n -e '\033[0;;m'

echo -n " ${S018} "
echo -n " ${S018} " #S018='Keyboard layout:'
read -r -t 300 KBnum
[ $? -ne 0 ] && return 1 #timed out
KBnum=$(echo -n "$KBnum" | sed -e 's%[^0-9]%%g')
[ ! $KBnum ] && KBnum=45 #20230622
[ $KBnum -gt 46 ] && KBnum=45 #20230622
[ $KBnum -eq 0 ] && KBnum=45 #20230622
KEYMAP="$(ls -1 /lib/keymaps | head -n ${KBnum} | tail -n 1 | sed -e 's%\.gz%%')"
echo " ${S019} ${KEYMAP}"
echo " ${S019} ${KEYMAP}" #S019='...ok, keymap chosen:'
return 0
}

Expand Down Expand Up @@ -1283,10 +1285,11 @@ else
POLICYflg='xxx'
fi
fi
#20231125 moved up; want to read KEYMAP further down even if no fscrypt...
touch /mnt/${WKG_DEV}/${WKG_DIR}sfs/settings/initrd/CONFIG
. /mnt/${WKG_DEV}/${WKG_DIR}sfs/settings/initrd/CONFIG #has KEYMAP, ALLOW_ASK_PW
if [ "$POLICYflg" == "" ];then
#folder has fscrypt enabled.
touch /mnt/${WKG_DEV}/${WKG_DIR}sfs/settings/initrd/CONFIG
. /mnt/${WKG_DEV}/${WKG_DIR}sfs/settings/initrd/CONFIG #has KEYMAP, ALLOW_ASK_PW
#20211212 took out some "precaution stuff". cannot read .session folder yet anyway.
#if [ ! "$QLANG" ];then #20230113 20230522
# load_font ${KEYMAP:0:2}
Expand Down
5 changes: 5 additions & 0 deletions easyos/easy-code/rootfs-skeleton/etc/rc.d/rc.country
Expand Up @@ -12,6 +12,7 @@
#20220715 hardware-profile /etc/clock, see also /usr/sbin/quicksetup, /usr/sbin/delayedrun
#20220912 PC_HARDWARE_PROFILE not set, try hack.
#20230622 new tr console keyboard layout.
#20231125 also update KEYMAP in /mnt/wkg/sfs/settings/initrd/CONFIG; read in initrd.

. /etc/rc.d/PUPSTATE
. /etc/DISTRO_SPECS #has DISTRO_XORG_AUTO
Expand Down Expand Up @@ -152,6 +153,10 @@ askkbdlayout ()
tr*) echo -n "857" > /etc/codepage ;; #20230622
esac
echo -n "${KMAP}${KEXT}" > /etc/keymap
#20231125 also write here, read in initrd...
if [ "$KMAPPATH" == "/lib/keymaps" ];then #check same keymaps as used in initrd.
sed -i -e "s%^KEYMAP=.*%KEYMAP='${KMAP}'%" /mnt/wkg/sfs/settings/initrd/CONFIG
fi
return 0
}

Expand Down
5 changes: 5 additions & 0 deletions easyos/easy-code/rootfs-skeleton/usr/bin/input-wizard
Expand Up @@ -24,6 +24,7 @@
#20201109 console font "uk" changed to "gb", as it is for Great Britain, not Ukraine.
#20230522 now using 512-glyph zap font.
#20230622 new tr console keyboard layout.
#20231125 also update KEYMAP in /mnt/wkg/sfs/settings/initrd/CONFIG; read in initrd.

export TEXTDOMAINDIR=/usr/share/locale
export TEXTDOMAIN=input-wizard
Expand Down Expand Up @@ -562,6 +563,10 @@ while :; do

if [ "$KMAP" ];then
echo -n "${KMAP}${KEXT}" > /etc/keymap #120627
#20231125 also write here, read in initrd...
if [ "$KMAPPATH" == "/lib/keymaps" ];then #check same keymaps as used in initrd.
sed -i -e "s%^KEYMAP=.*%KEYMAP='${KMAP}'%" /mnt/wkg/sfs/settings/initrd/CONFIG
fi
echo -n "$FONTMAP" > /etc/fontmap
echo -n "$CODEPAGE" > /etc/codepage
case $KMAPPATH in #120627
Expand Down
9 changes: 9 additions & 0 deletions easyos/easy-code/rootfs-skeleton/usr/bin/keymap-set
Expand Up @@ -13,6 +13,7 @@
#150302 handle srp (serbia).
#160914 no longer using mouse and keyboard xorg drivers, now evdev, see /etc/X11/xorg.conf.d/10-evdev-puppy.conf
#160914 remove writing to xorg.conf
#20231125 also update KEYMAP in /mnt/wkg/sfs/settings/initrd/CONFIG; read in initrd.

MYNAME=$(basename $0)
VERSION=20100812
Expand Down Expand Up @@ -181,6 +182,10 @@ if [ "$NEW" != "" ];then
#[ "$NEWMAP" = "$OLDMAP" ] && exit 0
[ "$VERBOSE" ] && echo -ne "Loading \"$NEWMAP\" keyboard map... "
echo -n $NEWMAP > /etc/keymap
#20231125 also write here, read in initrd...
if [ "$KMAPPATH" == "/lib/keymaps" ];then #check same keymaps as used in initrd.
sed -i -e "s%^KEYMAP=.*%KEYMAP='${KMAP}'%" /mnt/wkg/sfs/settings/initrd/CONFIG
fi
cp -f /etc/keymap /etc/keymap_previous # prevent xwin rewrites
case $NEWMAP in
*.map|*.kmap) loadkeys $NEWMAP || exit 1 #120627
Expand All @@ -194,6 +199,10 @@ elif [ -s /usr/share/i18n/layouts ]; then
fi
[ "$NEW" != "" ] && NEWMAP=$NEW || exit 1
echo -n $NEWMAP > /etc/keymap
#20231125 also write here, read in initrd... hmmm, maybe check why doing twice
if [ "$KMAPPATH" == "/lib/keymaps" ];then #check same keymaps as used in initrd.
sed -i -e "s%^KEYMAP=.*%KEYMAP='${KMAP}'%" /mnt/wkg/sfs/settings/initrd/CONFIG
fi

#[ "$NEWMAP" = "$OLDMAP" ] && exit 0
# apply xkeymap now
Expand Down
5 changes: 5 additions & 0 deletions easyos/easy-code/rootfs-skeleton/usr/bin/quicksetup
Expand Up @@ -136,6 +136,7 @@
#20230511 make sure /etc/clock.$PC_HARDWARE_PROFILE gets created.
#20230622 new tr console keyboard layout.
#20230626 new sudo-sh replaces sudo.
#20231125 also update KEYMAP in /mnt/wkg/sfs/settings/initrd/CONFIG; read in initrd.

#20230626
if [ "$(whoami)" != "root" ];then
Expand Down Expand Up @@ -1299,6 +1300,10 @@ if [ "$SET_KEYBOARD" ];then
;;
esac
echo -n "${NEW_KMAP}${KEXT}" > /etc/keymap #120627
#20231125 also write here, read in initrd...
if [ "$KMAPPATH" == "/lib/keymaps" ];then #check same keymaps as used in initrd.
sed -i -e "s%^KEYMAP=.*%KEYMAP='${NEW_KMAP}'%" /mnt/wkg/sfs/settings/initrd/CONFIG
fi
#echo -n "$FONTMAP" > /etc/fontmap
echo -n "$CODEPAGE" > /etc/codepage

Expand Down

0 comments on commit f12d153

Please sign in to comment.