Commit 8d3af849 authored by Alessandro Elias's avatar Alessandro Elias

Merge branch 'issue/365/warnings' into 'master'

Issue/365/warnings

See merge request !17
parents ba14495d 0d761be6
Pipeline #14559 passed with stages
in 8 minutes and 25 seconds
#!/bin/bash
# This script generates a .deb package
apt-get update && apt-get install -y devscripts
BUILD_DEPS=$(grep 'Build-Depends' package/debian/control | cut -d' ' -f2- | tr ', ' ' ' | sed -E "s/ \((>|<|=)+[0-9]\)//g")
apt-get update && apt-get install -y devscripts ${BUILD_DEPS}
CHANGELOG="package/debian/changelog"
LINE=$(head -n 1 $CHANGELOG)
......@@ -11,7 +11,7 @@ VERSION=$(echo $LINE | cut -d' ' -f2 | grep -o -E '[0-9]*\.[0-9]*\.[0-9]*')
tar --exclude=debian -czf ${PACKAGE}_${VERSION}.orig.tar.gz package/*
cd package
debuild -us -uc
debuild -us -uc --lintian-opts --profile debian
cd ../
mkdir build/
......
package/debian/le-conf
package/debian/le-conf.debhelper.log
package/debian/le-conf.substvars
package/debian/le-conf.*.debhelper
package/debian/le-multiterminal
package/debian/le-multiterminal.debhelper.log
package/debian/le-multiterminal.substvars
package/debian/files
package/debian/debhelper-build-stamp
le-conf_*.tar.xz
le-conf_*.build
le-conf_*.dsc
le-conf_*.changes
le-conf_*.deb
build.sh
build
......@@ -23,10 +23,8 @@ test:
- regular
script:
# TODO: find a way to get the dependencies automatically
- apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
- locale-gen pt_BR.UTF-8
- export LANG=pt_BR.UTF-8
- DEBIAN_FRONTEND=noninteractive apt-get -y install $(pwd)/build/*.deb
- apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y udev
- DEBIAN_FRONTEND=noninteractive apt-get -y -q install $(pwd)/build/*.deb
dependencies:
- build
......
le-multiterminal (0.0.7ubuntu1) testing; urgency=medium
* Remove warnings and fix dependencies.
-- Daniel Bissani Furlin <dbf15@inf.ufpr.br> Fri, 23 Feb 2018 17:34:10 -0300
le-multiterminal (0.0.7) testing; urgency=medium
* Adds copyright and credits to all files
......
......@@ -3,12 +3,18 @@ Section: misc
Priority: optional
Maintainer: C3SL <contato@c3sl.ufpr.br>
Uploaders: Stephanie Briere Americo <sba16@c3sl.ufpr.br>
Build-Depends: debhelper (>=9)
Standards-Version: 3.9.6
Build-Depends: debhelper (>=9), libx11-dev, libcairo2-dev
Standards-Version: 3.9.7
Vcs-Git: https://gitlab.c3sl.ufpr.br/le6/le-multiterminal.git
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/le-multiterminal.git
Package: le-multiterminal
Architecture: all
Depends: ${misc:Depends}, curl, xserver-xorg-video-siliconmotion-hwe-16.04, compton, numlockx, xserver-xephyr-hwe-16.04, libc-bin
Description: Configura multiterminal para funcionar com o LE
Architecture: amd64
Pre-Depends: lightdm
Depends: ${misc:Depends}, ${shlibs:Depends}, curl, xserver-xorg-video-siliconmotion-hwe-16.04, compton, numlockx, xserver-xephyr-hwe-16.04, systemd, policykit-1-gnome, libcairo2, pciutils
Description: Multiterminal Solution compatible with the system Linux Educational 6
Multi-terminal solution compatible with Linux Educational system 6.
The multi-terminal system configures up to three monitors simultaneously on
the same machine.
The solution relies heavily on the TN-502 video card and the Thinnetworks
Hubs, available on the 83/2008 and 71/2010 sessions of the Brazilian federal
government.
......@@ -22,4 +22,3 @@ License: GPL-3.0+
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
etc /
usr /
opt /
etc/X11/xorg.conf.d/97-proinfo-monitores.conf etc/X11/xorg.conf.d/
etc/X11/xorg.conf.d/98-proinfo-urbano.conf etc/X11/xorg.conf.d/
etc/le-multiterminal/readme etc/le-multiterminal/
etc/polkit-1/localauthority/50-local.d/90-restrict-guest-permissions.pkla etc/polkit-1/localauthority/50-local.d/
lib/systemd/system/le-multiterminal.service lib/systemd/system/
lib/systemd/system/xorg-daemon.service lib/systemd/system/
lib/systemd/system/xorg-daemon.socket lib/systemd/system/
etc/xdg/lightdm/lightdm.conf.d/97-no-screen-blanking.conf etc/xdg/lightdm/lightdm.conf.d/
lib/udev/rules.d/71-seat-usb.rules lib/udev/rules.d/
lib/udev/rules.d/73-seat-attach-assistant.rules lib/udev/rules.d/
usr/lib/find-devices usr/lib/
usr/lib/window-acess usr/lib/
usr/sbin/configurar-multiterminal usr/sbin/
usr/sbin/detect-keyboard usr/sbin/
usr/sbin/multiseat-controller usr/sbin/
usr/sbin/multiterminal usr/sbin/
usr/sbin/read-devices usr/sbin/
usr/sbin/seat-parent-window usr/sbin/
usr/sbin/write-message usr/sbin/
usr/sbin/seat-attach-assistant usr/sbin/
usr/sbin/update-xorg-conf usr/sbin/
usr/sbin/xephyr-wrapper usr/sbin/
usr/sbin/xorg-daemon usr/sbin/
binary-without-manpage
systemd-service-file-missing-documentation-key
#!/bin/sh
# postinst script for le-multiterminal
#DEBHELPER#
set -e
update-xorg-conf "Silicon.Motion" /etc/X11/xorg.conf.d/98-proinfo-*.conf
systemctl daemon-reload
systemctl enable le-multiterminal
# habilita e roda o xorg-daemon
systemctl enable xorg-daemon.socket
systemctl start xorg-daemon.socket
if [ ! -f /.dockerenv ]; then
systemctl daemon-reload
deb-systemd-helper enable le-multiterminal.service
# habilita e roda o xorg-daemon
deb-systemd-helper enable xorg-daemon.socket
deb-systemd-invoke start xorg-daemon.socket
udevadm trigger
udevadm trigger
fi
echo "Por favor reinicie o sistema para o multiterminal ser reconfigurado!"
exit 0
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@
#override_dh_usrlocal:
# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
override_dh_usrlocal:
build: build-arch build-indep
$(MAKE) -C src/
dh_testdir
dh_auto_configure
dh_auto_build
dh_auto_test
clean:
$(MAKE) -C src/ clean
dh_testdir
dh_auto_clean
dh_clean
......@@ -29,7 +29,7 @@ Before=lightdm.service
[Service]
Type=oneshot
TimeoutSec=infinity
ExecStart=/opt/le-multiterminal/multiterminal.sh
ExecStart=/usr/sbin/multiterminal
[Install]
WantedBy=graphical.target
......@@ -4,6 +4,6 @@
Description=Service for Xorg server at display :90
[Service]
ExecStartPre=/usr/local/bin/update-xorg-conf Silicon.Motion /etc/X11/xorg.conf.d/98-proinfo-urbano.conf /etc/X11/xorg.conf.d/98-proinfo-rural.conf
ExecStart=/usr/local/bin/xorg-daemon :90
ExecStartPre=/usr/sbin/update-xorg-conf Silicon.Motion /etc/X11/xorg.conf.d/98-proinfo-urbano.conf /etc/X11/xorg.conf.d/98-proinfo-rural.conf
ExecStart=/usr/sbin/xorg-daemon :90
SuccessExitStatus=0 1
......@@ -2,6 +2,6 @@
ACTION=="remove", GOTO="seat_end"
SUBSYSTEM=="usb", TAG=="master-of-seat", ENV{ID_SEAT}=="", RUN+="/usr/local/bin/seat-attach-assistant $devpath $env{ID_PATH_TAG}"
SUBSYSTEM=="usb", TAG=="master-of-seat", ENV{ID_SEAT}=="", RUN+="/usr/sbin/seat-attach-assistant $devpath $env{ID_PATH_TAG}"
LABEL="seat_end"
#!/bin/bash
# Script adapted from Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
cd ../../
# Copia arquivo que altera permissões dos usuários
install -m 644 etc/polkit-1/localauthority/50-local.d/* /etc/polkit-1/localauthority/50-local.d
# Copia arquivos do X para systemd
install -m 644 etc/systemd/system/* /etc/systemd/system
# Copia configs de usb para o udev
install -m 644 etc/udev/rules.d/* /etc/udev/rules.d
# Cria diretorio
install -d /etc/X11/xorg.conf.d
# Copia configurações de monitores para xorg
install -m 644 etc/X11/xorg.conf.d/9[78]*.conf /etc/X11/xorg.conf.d
# Copia scripts para bin
# mapeia as portas usb para monitores
install -m 755 usr/local/bin/seat-attach-assistant /usr/local/bin
# Copia script que atualiza entradas no xorg para bin (explicado no arquivo)
install -m 755 usr/local/bin/update-xorg-conf /usr/local/bin
# Copia script para executar o X para bin
install -m 755 usr/local/bin/xorg-daemon /usr/local/bin
# Copia script do Xephyr para bin
install -m 755 usr/local/bin/xephyr-wrapper /usr/local/bin
# Cria diretorio e copia configs do lightdm
install -d /etc/xdg/lightdm/lightdm.conf.d
install -m 644 etc/xdg/lightdm/lightdm.conf.d/*.conf /etc/xdg/lightdm/lightdm.conf.d
install -d /etc/le-multiterminal
install -d /opt/le-multiterminal
install -m 755 opt/le-multiterminal/* /opt/le-multiterminal
# roda o script que atualiza as configs do xorg
update-xorg-conf "Silicon.Motion" /etc/X11/xorg.conf.d/98-proinfo-*.conf
systemctl daemon-reload
systemctl enable le-multiterminal
# habilita e roda o xorg-daemon
systemctl enable xorg-daemon.socket
systemctl start xorg-daemon.socket
apt update
apt -y upgrade
apt -y install curl xserver-xorg-video-siliconmotion-hwe-16.04 compton numlockx xserver-xephyr-hwe-16.04
# Pede eventos ao kernel: "força" a identificação dos dispositivos na maquina
udevadm trigger
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CC = gcc
CFLAGSS = -O2 -Wall -fPIC -pie $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
SRC=.
DST = ../usr/sbin
all:
$(CC) $(CFLAGSS) $(SRC)/read-devices.c -o $(DST)/read-devices
$(CC) $(CFLAGSS) $(SRC)/write-message.c -o $(DST)/write-message `pkg-config --libs --cflags cairo x11`
$(CC) $(CFLAGSS) $(SRC)/seat-parent-window.c -o $(DST)/seat-parent-window `pkg-config --libs --cflags x11`
clean:
rm -f $(DST)/read-devices
rm -f $(DST)/write-message
rm -f $(DST)/seat-parent-window
/*
* Copyright (C) 2004-2007 Centro de Computacao Cientifica e Software Livre
* Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* This program monitors evdev device nodes passed as parameters to detect the
* F1...F12, ENTER or ESC keys pressed or the left mouse button.
*
* The first argument is the key that we need to check.
* - If between f1 and f12, the argument must be between 1 and 12
* - If it's the left mouse button, the argument is 13
* - If it's enter or esc, the argument is 14
* The other arguments are the device node file paths
*
* The timeout is 20 seconds.
* If "enter" or "esc" is requested, the timeout is 5 seconds.
*
* The output is:
* - "detect=|device/node/path" for f1..f12 and mouse button
* - "detect=|enter" or "detect=|esc" for enter and esc keys (no device path)
*/
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <linux/input.h>
/* No, linux/input.h doesn't have these... */
#define EV_PRESS 1
#define EV_RELEASE 0
void read_node(unsigned char* buffer, int sock, int how_many);
int main(int argc, char* argv[]) {
fd_set rfds;
struct input_event ev;
int retval, i;
int biggest_so_far = 0;
int fd_array[30];
int expected_key;
struct timeval tv;
#ifdef DEBUG
for (i = 0; i < argc; i++)
fprintf(stderr, "argv[%d] = %s\n", i, argv[i]);
#endif
/* Basic checking */
if (argc > 31) {
fprintf(stderr, "read_devices: maximum is 30 arguments\n");
fprintf(stderr, "usage: %s key files...\n",argv[0]);
exit(1);
}
if (argc <= 2) {
fprintf(stderr, "read_devices: few arguments\n");
fprintf(stderr, "usage: %s key files...\n",argv[0]);
exit(1);
}
expected_key = atoi(argv[1]);
/* Timeout is different for ESC/ENTER */
if (expected_key != 14)
tv.tv_sec = 20;
else
tv.tv_sec = 5;
tv.tv_usec = 0;
/* Open the file and store at biggest_so_far the biggest FD between the
* files */
for (i = 2; i < argc; i++) {
fd_array[i] = open(argv[i], O_RDONLY);
if (fd_array[i] == -1) {
perror("select (ERROR)");
exit(1);
}
if (fd_array[i] > biggest_so_far )
biggest_so_far = fd_array[i];
}
while(1) {
/* Zero the FD set */
FD_ZERO(&rfds);
/* Insert each FD in the set */
for (i = 2; i < argc; i++)
FD_SET(fd_array[i], &rfds);
retval = select(biggest_so_far+1, &rfds, 0, 0, &tv); /* no timeout */
/* Verify which FDs are still in the set: which ones have data to be
* read */
if (retval == -1) {
perror("select (ERROR)");
exit(1);
}
else if (retval) {
for (i = 2; i < argc; i++) {
if (FD_ISSET(fd_array[i],&rfds)) {
/* Read from FD */
read_node ((unsigned char*)&ev, fd_array[i],
sizeof(struct input_event));
/* f1..f10 */
if (ev.type == EV_KEY && ev.value == EV_PRESS &&
((ev.code - (KEY_F1) +1) == expected_key)) {
printf("detect=|%s\n", argv[i]);
exit(1);
}
/* f11 or f12 */
if (ev.type == EV_KEY && ev.value == EV_PRESS &&
((ev.code == KEY_F11 && expected_key == 11) ||
(ev.code == KEY_F12 && expected_key == 12)) ) {
printf("detect=|%s\n", argv[i]);
exit(1);
}
/* left button */
if (ev.type == EV_KEY && ev.value == EV_PRESS &&
ev.code == BTN_LEFT && expected_key == 13) {
printf("detect=|%s\n", argv[i]);
exit(1);
}
/* enter */
if (ev.type == EV_KEY && ev.value == EV_PRESS &&
(ev.code == KEY_ENTER || ev.code == KEY_KPENTER) &&
expected_key == 14) {
printf("detect=|enter\n");
exit(1);
}
/* esc */
if (ev.type == EV_KEY && ev.value == EV_PRESS &&
ev.code == KEY_ESC && expected_key == 14) {
printf("detect=|esc\n");
exit(1);
}
}
}
}
else {
printf("detect=|timeout\n");
exit(1);
}
}
return 0;
}
void read_node(unsigned char* buffer, int sock, int how_many)
{
/* Keep calling recv until everything is received */
int pointer = 0;
int maximum = how_many;
int bytes_read;
while (pointer < how_many) {
bytes_read = read(sock,(void*)(buffer+pointer), maximum);
if (bytes_read == -1) {
perror("Error reading the socket.");
exit(1);
}
else if (bytes_read == 0) {
fprintf(stderr, "End of file.\n");
exit(1);
}
pointer += bytes_read; /* Forward pointer */
maximum -= bytes_read;
}
}
/*
* Copyright (C) 2004-2007 Centro de Computacao Cientifica e Software Livre
* Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*/
/* This program creates a "parent window" for xephyr
* and waits forever.
* parameters: widthxheight+x+y, window name.
*/
# include <stdio.h>
# include <stdlib.h>
# include <unistd.h>
# include <X11/Xlib.h>
# include <X11/Xutil.h>
int main(int argc, char *argv[])
{
int screen;
int x, y;
int rc;
unsigned int width, height;
Display *display = XOpenDisplay(NULL);
if (display == NULL)
{
fprintf(stderr, "Cannot open display.\n");
exit(1);
}
screen = DefaultScreen(display);
sscanf(argv[1], "%dx%d+%d+%d", &width, &height, &x, &y);
Window win = XCreateSimpleWindow (display, DefaultRootWindow(display),
x, y, width, height, 0,
WhitePixel(display, screen),
BlackPixel(display, screen));
XTextProperty window_name_property;
rc = XStringListToTextProperty(&argv[2], 1, &window_name_property);
if (rc == 0)
{
fprintf(stderr, "XStringListToTextProperty - out of memory\n");
exit(1);
}
XSetWMName(display, win, &window_name_property);
XMapWindow(display, win);
XFlush(display);
pause();
XCloseDisplay(display);
return 0;
}
/*
* Copyright (C) 2004-2007 Centro de Computacao Cientifica e Software Livre
* Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*/
#include <stdlib.h>
#include <stdio.h>
#include <X11/Xlib.h>
#include <cairo.h>
#include <cairo-xlib.h>
int main(int argc, char *argv[])
{
int i;
int screen;
int win_x, win_y;
unsigned int width, height;
unsigned int depth;
unsigned int border_width;
unsigned int win_id;
double y_all_extents = 0.0;
double x, y;
Display *display;
Visual *visual;
Window RootWindow;
Window win;
cairo_text_extents_t extents;
cairo_surface_t *surface;
cairo_t *cr;
display = XOpenDisplay(NULL);
if(display == NULL)