Project

General

Profile

Actions

Feature #751

closed

Add function to find X.org VT

Added by Hammel over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Start date:
10 Mar 2020
Due date:
% Done:

100%

Estimated time:
Severity:
01 - Critical

Description

This can be done with this command:

ps -l | grep "X :0" | grep -v grep | tr -s " "| cut -f7 -d" "

This doesn't appear to fail under ash (Busybox shell) if the first grep doesn't find anything. We can use this to find the correct "vtsrc" for any app.

Actions #1

Updated by Hammel about 2 years ago

  • Severity changed from 03 - Medium to 01 - Critical

This was a problem during release testing for 1.1 on B/B+ models so I'm moving it up in severity.

Actions #2

Updated by Hammel about 2 years ago

  • Priority changed from High to Immediate
Actions #3

Updated by Hammel about 2 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

Programmatic option (maybe): https://www.helpnetsecurity.com/2002/04/08/console-ioctls-under-linux/
Example code: https://img2.helpnetsecurity.com/dl/articles/txt/console18.txt

Look for VT_GETSTATE.

Also see console_ioctl in man pages.

The library should get the VT the app was started on. Then it can have set_vt() and restore_vt() modes to move away from and back to the original VT.

Actions #4

Updated by Hammel about 2 years ago

  • % Done changed from 10 to 20

I Have a branch with functions for supporting getting the VT for the current process (getVTNum) and any named process (getVT) in the RM-751 branch of libpibox.
The merge request for this is here: https://gitlab.com/pibox/libpibox/-/merge_requests/1

These functions need to be tested. There are unit tests already written. There is no app currently using this so I think adding it to videofe would be the best place to start (since it needs it most).

Actions #5

Updated by Hammel about 2 years ago

  • % Done changed from 20 to 50

Unit tests are implemented and run successfully.

Now I need to test with videofe.

Actions #6

Updated by Hammel about 2 years ago

  • % Done changed from 50 to 60

Initial test without full media system shows piboxGetVTNum() works as expected in videofe. It finds the vt that X is on. This was true even when I remotely logged in, set DISPLAY=unix:0.0 and ran videofe.

A more complete test is needed to make sure videofe switches vts correctly given the use of the new piboxGetVTNum() api.

Actions #7

Updated by Hammel about 2 years ago

  • % Done changed from 60 to 70

Works on touchscreen/rpi3. Need to test on monitor/rpi2.

Actions #8

Updated by Hammel about 2 years ago

  • % Done changed from 70 to 90

Verified working on monitor/rpi2.
Just need to commit and push now.

Actions #9

Updated by Hammel about 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

All changes committed and pushed. All PR's approved and merged.

Closing issue.

Actions

Also available in: Atom PDF