wtorek, 20 listopada 2012
Good news!
The Xephyr in xserver-xephyr 1.12.4-3 now contains a patch restoring correct command line parsing, so now only --enable-kdrive-evdev is required in the control file.
poniedziałek, 5 listopada 2012
Another upgrade
This time it is lightdm: the latest version in wheezy is 1.2.2-4.
The same procedure is still valid: apply the two patches, rebuild and voila.
The same procedure is still valid: apply the two patches, rebuild and voila.
środa, 24 października 2012
Still + 1
The latest Wheezy update as of this writing still contains a buggy Xephyr, version xorg-server-1.12.4. The patch
http://patchwork.freedesktop.org/patch/12146/
still needs to be applied. But Xephyr needs to be recompiled with -enable-kdrive-evdev anyway for our purposes, so applying this one-liner won't hurt. Other than that, it works fine.
http://patchwork.freedesktop.org/patch/12146/
still needs to be applied. But Xephyr needs to be recompiled with -enable-kdrive-evdev anyway for our purposes, so applying this one-liner won't hurt. Other than that, it works fine.
poniedziałek, 8 października 2012
Too much patch will kill you
In the recent Debian wheezy there is a new Xephyr which has broken options parsing due to a mismerged patch. The bug is fixed by Keith Packard, I will post more soon.
http://lists.debian.org/debian-x/2012/10/msg00071.html
http://patchwork.freedesktop.org/patch/12146/
Looks like the patch is not going to make it soon to Wheezy, so there you go, you can use the patch from freedesktop.
http://lists.debian.org/debian-x/2012/10/msg00071.html
http://patchwork.freedesktop.org/patch/12146/
Looks like the patch is not going to make it soon to Wheezy, so there you go, you can use the patch from freedesktop.
poniedziałek, 24 września 2012
helper-functions
. /etc/default/multiseat
#
# private implementation of get_sect
#
# get given section's contents from the given config file
#
# $1 filename
# $2 section number
#
__get_sect()
{
cat $1 | awk -v sect=$2 '
BEGIN {
SECT="^\\[" sect "\\]"
NEXT_SECT="^\\[" (sect + 1) "\\]"
}
$0 ~ SECT, $0 ~ NEXT_SECT {
if ($0 ~ SECT)
next;
if ($0 ~ NEXT_SECT)
next;
if (substr($1, 1, 1) == "#")
next;
print
}
'
}
#
# private implementation of get_conf
#
# get given key's contents from the given section
# from the given config file
#
# does not work for tables in the config file
#
# $1 filename
# $2 section name
# $3 key name
#
__get_conf()
{
__get_sect $1 $2 | awk -F"=" -v key=$3 '
BEGIN {
KEY=key
}
$1==KEY {
print substr($0, index($0, "=") + 1)
}
'
}
#
# private implementation of get_num_seats
#
# get number of seats from the default config file
#
# $1 filename
#
__get_num_seats()
{
cat $1 | awk '
BEGIN {
count=0
}
/^\[[0-9]*\]/ {count++}
END {
print count - 1
}
'
}
#
# get given section's contents from the default config file
#
# $1 section name
#
get_sect()
{
__get_sect $CONFIG $1
}
#
# private implementation of get_table
#
# $1 filename
# $2 section number
# $3 table name
# $4 size/entry switch [-size => size, <number> for entry]
#
__get_table()
{
SIZE=0;
ENTRY=-1
if [ $4 == "-size" ];
then
SIZE=1;
else
ENTRY=$4
fi
RESULT=`__get_sect $1 $2 | awk -v table=$3 -v get_size=$SIZE -v entry=$ENTRY '
BEGIN {
print BEGIn
TABLE=table "\\\=" "\\\("
GET_SIZE=get_size
ENTRY=entry
size=0
}
$0 ~ TABLE, /^\)/ {
if ($0 ~ TABLE)
next;
if ($0 ~ /^\)/)
next;
if (substr($1, 1, 1) == "#")
next;
if (get_size == 0 && size == entry){
print
exit
}
size++;
}
END {
if (get_size)
print size;
}
'`
RESULT=`echo $RESULT | sed 's/^[ \t]*//g'`
echo $RESULT
}
#
# get given key's contents from the given section
# from the default config file
#
# does not work for tables in the config file
#
# $1 section name
# $2 key name
#
get_conf()
{
__get_conf $CONFIG $1 $2
}
#
# get number of seats from the default config file
#
get_num_seats()
{
__get_num_seats $CONFIG
}
#
# get size of a given table in the given section of the config file or
# get specified entry of the table
#
# $1 section number
# $2 table name
# $3 size/entry switch [-size => size, <number> for entry]
#
get_table()
{
__get_table $CONFIG $1 $2 $3
}
#
# private implementation of get_sect
#
# get given section's contents from the given config file
#
# $1 filename
# $2 section number
#
__get_sect()
{
cat $1 | awk -v sect=$2 '
BEGIN {
SECT="^\\[" sect "\\]"
NEXT_SECT="^\\[" (sect + 1) "\\]"
}
$0 ~ SECT, $0 ~ NEXT_SECT {
if ($0 ~ SECT)
next;
if ($0 ~ NEXT_SECT)
next;
if (substr($1, 1, 1) == "#")
next;
}
'
}
#
# private implementation of get_conf
#
# get given key's contents from the given section
# from the given config file
#
# does not work for tables in the config file
#
# $1 filename
# $2 section name
# $3 key name
#
__get_conf()
{
__get_sect $1 $2 | awk -F"=" -v key=$3 '
BEGIN {
KEY=key
}
$1==KEY {
print substr($0, index($0, "=") + 1)
}
'
}
#
# private implementation of get_num_seats
#
# get number of seats from the default config file
#
# $1 filename
#
__get_num_seats()
{
cat $1 | awk '
BEGIN {
count=0
}
/^\[[0-9]*\]/ {count++}
END {
print count - 1
}
'
}
#
# get given section's contents from the default config file
#
# $1 section name
#
get_sect()
{
__get_sect $CONFIG $1
}
#
# private implementation of get_table
#
# $1 filename
# $2 section number
# $3 table name
# $4 size/entry switch [-size => size, <number> for entry]
#
__get_table()
{
SIZE=0;
ENTRY=-1
if [ $4 == "-size" ];
then
SIZE=1;
else
ENTRY=$4
fi
RESULT=`__get_sect $1 $2 | awk -v table=$3 -v get_size=$SIZE -v entry=$ENTRY '
BEGIN {
print BEGIn
TABLE=table "\\\=" "\\\("
GET_SIZE=get_size
ENTRY=entry
size=0
}
$0 ~ TABLE, /^\)/ {
if ($0 ~ TABLE)
next;
if ($0 ~ /^\)/)
next;
if (substr($1, 1, 1) == "#")
next;
if (get_size == 0 && size == entry){
exit
}
size++;
}
END {
if (get_size)
print size;
}
'`
RESULT=`echo $RESULT | sed 's/^[ \t]*//g'`
echo $RESULT
}
#
# get given key's contents from the given section
# from the default config file
#
# does not work for tables in the config file
#
# $1 section name
# $2 key name
#
get_conf()
{
__get_conf $CONFIG $1 $2
}
#
# get number of seats from the default config file
#
get_num_seats()
{
__get_num_seats $CONFIG
}
#
# get size of a given table in the given section of the config file or
# get specified entry of the table
#
# $1 section number
# $2 table name
# $3 size/entry switch [-size => size, <number> for entry]
#
get_table()
{
__get_table $CONFIG $1 $2 $3
}
Escape characters alive forever
The multiseat config is never managed once and for ever...
I wanted the scripts to be as little dependent as possible, so for parsing the multiseat.conf file I used only bash&sed&awk, no fancy tools like python. The helper-functions have been written in the mawk dialect of awk, and the awk found in Debian used to be mawk. Alas, no longer. So there are two options to consider: modify the helper-functions, so that mawk is used explicitly instead of awk (and make sure mawk is installed), or modify the helper-functions to speak gnu awk found in Debian now. I chose the second option. In fact only some escaping craziness differs. Instead of one backslash now two or three (!) are required here and there. You can find the new script here.
I wanted the scripts to be as little dependent as possible, so for parsing the multiseat.conf file I used only bash&sed&awk, no fancy tools like python. The helper-functions have been written in the mawk dialect of awk, and the awk found in Debian used to be mawk. Alas, no longer. So there are two options to consider: modify the helper-functions, so that mawk is used explicitly instead of awk (and make sure mawk is installed), or modify the helper-functions to speak gnu awk found in Debian now. I chose the second option. In fact only some escaping craziness differs. Instead of one backslash now two or three (!) are required here and there. You can find the new script here.
czwartek, 23 sierpnia 2012
Multiseat - final thoughts (so far)
Now I am happily running an up-to-date Debian Wheezy. However, some precautions must be made when upgrading. I wrote such a script:
#!/bin/bash
SENSITIVE="wmctrl xserver-xephyr lightdm policykit"
PACKAGES=`apt-get --dry-run dist-upgrade | awk '/^The following packages will be upgraded:/,/^[1-9]./' | tail -n +2 | head -n -1`
echo "Searching sensitive packages:"
echo
echo $SENSITIVE
echo
echo "in:"
echo
echo $PACKAGES
echo
FOUND=0
for i in $SENSITIVE; do
echo $PACKAGES | grep $i 2>&1 >/dev/null && echo Found: $i && FOUND=1
done
if [ $FOUND -eq 0 ]; then
echo No sensitive packages found in upgrade.
fi
The script can be run after apt-get update to see if any of the packages enumerated in "SENSITIVE" are to be upgraded this time. If yes, care must be taken.
Policy kit needs a paragraph of its own. At this moment Debian Wheezy comes with policykit-1 version 0.105. This is the last version in which the actions' permissions are customized using .pkla files. From 0.106 on (0.107 is the latest now) the format and naming of the directories and files has changed.
Another thing is systemd, which one day can become The Right Way of doing things.
SENSITIVE="wmctrl xserver-xephyr lightdm policykit"
PACKAGES=`apt-get --dry-run dist-upgrade | awk '/^The following packages will be upgraded:/,/^[1-9]./' | tail -n +2 | head -n -1`
echo "Searching sensitive packages:"
echo
echo $SENSITIVE
echo
echo "in:"
echo
echo $PACKAGES
echo
FOUND=0
for i in $SENSITIVE; do
echo $PACKAGES | grep $i 2>&1 >/dev/null && echo Found: $i && FOUND=1
done
if [ $FOUND -eq 0 ]; then
echo No sensitive packages found in upgrade.
fi
The script can be run after apt-get update to see if any of the packages enumerated in "SENSITIVE" are to be upgraded this time. If yes, care must be taken.
Policy kit needs a paragraph of its own. At this moment Debian Wheezy comes with policykit-1 version 0.105. This is the last version in which the actions' permissions are customized using .pkla files. From 0.106 on (0.107 is the latest now) the format and naming of the directories and files has changed.
Another thing is systemd, which one day can become The Right Way of doing things.
Subskrybuj:
Posty (Atom)