summaryrefslogtreecommitdiff
path: root/src/vconsole
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4448 from msoltyspl/vcfixZbigniew Jędrzejewski-Szmek2016-10-262-20/+40
|\ | | | | | | Fix some formatting details in the merge.
| * vconsole: setup_remaining_vcs() - more sanity checksMichal Soltys2016-10-261-19/+40
| | | | | | | | | | | | Check if values filled up by KD_FONT_OP_GET ioctl make sense - dummy driver for example doesn't implement required functionality at all.
| * vconsole: skip unnecessary udev call for dummy deviceMichal Soltys2016-10-211-1/+1
|/ | | | | | | In particular, the font copying has no chance of succeeding as the required functionality is not implemented, see: drivers/video/console/dummycon.c
* treewide: fix typos (#4217)Torstein Husebø2016-09-261-1/+1
|
* vconsole-setup: add lots of debug messagesZbigniew Jędrzejewski-Szmek2016-07-311-14/+24
| | | | | | For error messages, make them more meaningful by printing the tty name. Follow-up for #3742.
* vconsole: correct kernel command line namespaceMichal Soltys2016-07-271-1/+5
|
* vconsole: add copyright lineMichal Soltys2016-07-271-0/+1
|
* vconsole: use KD_FONT_OP_GET/SET to handle copyingMichal Soltys2016-07-271-27/+66
| | | | | We now use KD_FONT_OP_GET & KD_FONT_OP_SET instead of problematic KD_FONT_OP_COPY.
* vconsole: updates of keyboard/font loading functionsMichal Soltys2016-07-271-21/+14
| | | | | Change return convention to -errno/==0 and use isempty() instead of just pointer tests.
* vconsole: Add generic is_*() functionsMichal Soltys2016-07-271-0/+41
| | | | | | | | | | | | is_allocated() and is_allocated_byfd(): Checks if the console is allocated by its index (first function) or its open descriptor (second function). is_settable(): Checks if the console is in xlate or unicode mode, so we can adjust is safely without interfering with X.
* vconsole: add two new toggle functions, remove old enable/disable onesMichal Soltys2016-07-271-46/+27
| | | | | | | | | Add toggle_utf8() and toggle_utf8_sysfs() and use them in place of old enable/disable functions. toggle_utf8() also adds iutf8 setting and is set up to be called per-console (in subsequent patches). Note, that old disable_utf8() didn't bother checking if it was ok to change the kbdmode.
* vconsole: copy font to 63 consoles instead of 15Michal Soltys2016-07-271-1/+1
| | | | | We copy only to allocated consoles, so the cost of looping over all possible ones is minuscule.
* vconsole: don't do GIO_SCRNMAP / GIO_UNISCRNMAPMichal Soltys2016-07-271-10/+0
| | | | | | | | | | | | | | | | GIO_SCRNMAP / GIO_UNISCRNMAP are related to what setfont does with -m option - namely setting intermediate map from 8bit values into unicode values. This map is global, so single setfont invocation sets it for all applicable consoles. Furthermore calling GIO_SCRNMAP before GIO_UNISCRNMAP causes issues as the former corrupts values > 255 (UNI alone would be sufficient). The bug can be easily tested with the following conf: KEYMAP=pl FONT=LatArCyrHeb-16 FONT_MAP=8859-2
* vconsole: add log_oom() where appropriateLennart Poettering2016-05-171-2/+2
|
* vconsole-setup: Store fonts on heap (#3268)Kyle Russell2016-05-161-1/+7
| | | More friendly to the stack.
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* tree-wide: use xsprintf() where applicableDaniel Mack2016-01-121-2/+3
| | | | Also add a coccinelle receipt to help with such transitions.
* treewide: use the negative error codes returned by our functionsMichal Schmidt2015-11-051-1/+1
| | | | | Our functions return negative error codes. Do not rely on errno being set after calling our own functions.
* util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: move more locale-related calls to locale-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split out IO related calls to io-util.[ch]Lennart Poettering2015-10-261-0/+1
|
* util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering2015-10-251-0/+1
| | | | | There are more than enough to deserve their own .c file, hence move them over.
* util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering2015-10-241-10/+11
| | | | | | | | | | | | | | string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
* basic: rework virtualization detection APILennart Poettering2015-09-071-1/+1
| | | | | | Introduce a proper enum, and don't pass around string ids anymore. This simplifies things quite a bit, and makes virtualization detection more similar to architecture detection.
* tree-wide: fix write_string_file() user that should not create filesDaniel Mack2015-07-061-2/+2
| | | | | | | The latest consolidation cleanup of write_string_file() revealed some users of that helper which should have used write_string_file_no_create() in the past but didn't. Basically, all existing users that write to files in /sys and /proc should not expect to write to a file which is not yet existant.
* fileio: consolidate write_string_file*()Daniel Mack2015-07-061-2/+2
| | | | | | | Merge write_string_file(), write_string_file_no_create() and write_string_file_atomic() into write_string_file() and provide a flags mask that allows combinations of atomic writing, newline appending and automatic file creation. Change all users accordingly.
* tree-wide: whenever we fork off a foreign child process reset signal ↵Lennart Poettering2015-06-101-0/+9
| | | | | | | | | | mask/handlers Also, when the child is potentially long-running make sure to set a death signal. Also, ignore the result of the reset operations explicitly by casting them to (void).
* shared: add terminal-util.[ch]Ronny Chevalier2015-04-111-0/+1
|
* shared: add process-util.[ch]Ronny Chevalier2015-04-101-0/+1
|
* vconsole: some modernizations, indentation fixesLennart Poettering2015-04-091-9/+10
|
* vconsole: stick to kernel-style function error handlingLennart Poettering2015-04-091-18/+24
| | | | | | | This undoes part of 8931278c8a9ef7b60f6b6963486a9e9febb20a0d. We really should stick to kernel-style "int" return values from functions, and not covnert success into boolean returns.
* vconsole-setup: check error of child processLucas De Marchi2015-03-151-44/+24
| | | | | | | | | | | | | | | | | | | | | | | If we don't check the error of the child process, systemd-vconsole-setup would exit with 0 even if it could not really setup the console. For a simple test, move loadkeys elsewhere and execute systemd-vconsole-setup: [root@localhost ~]# strace -f -e execve /usr/lib/systemd/systemd-vconsole-setup execve("/usr/lib/systemd/systemd-vconsole-setup", ["/usr/lib/systemd/systemd-vconsol"...], [/* 15 vars */]) = 0 Process 171 attached [pid 171] execve("/usr/bin/loadkeys", ["/usr/bin/loadkeys", "-q", "-C", "/dev/tty0", "br-abnt2"], [/* 15 vars */]) = -1 ENOENT (No such file or directory) [pid 171] +++ exited with 1 +++ --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=171, si_uid=0, si_status=1, si_utime=0, si_stime=0} --- +++ exited with 0 +++ Note that loadkeys returned 1 while systemd-vconsole-setup return 0. Since the font and keyboard setup are already serialized, refactor the code a little bit so the functions do the wait by themselves. One change in behavior in this patch is that we don't return early, but we do try to setup the keyboard even if the font load failed.
* vconsole: match on vtcon events, not fbcon onesJan Engelhardt2015-03-061-4/+3
| | | | | | | | | | | | | | | | I observe that upon loading of framebuffer drivers, I do not get the desired system font, but the kernel-level defaults (usually lib/fonts/font_8x16.c, but your mileage may vary depending on kernel config and boot options). The fbcon driver may be loaded at a time way before the first framebuffer device is active, such that the vconsole setup helper runs too early. The existing rule is non-fitting. The going live of the fbcon kernel component does not indicate the proper time at which to load the visuals, which really ought to be done when a new vtcon object comes into existence. (The font table is a per-vtcon property.)
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-231-5/+0
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* treewide: sanitize loop_writeZbigniew Jędrzejewski-Szmek2014-12-091-4/+6
| | | | | | | loop_write() didn't follow the usual systemd rules and returned status partially in errno and required extensive checks from callers. Some of the callers dealt with this properly, but many did not, treating partial writes as successful. Simplify things by conforming to usual rules.
* vconsole: don't hard-code systemd-vconsole-setup binary pathMichael Biebl2014-12-042-1/+2
|
* delta: diff returns 1 when files differ, ignore thisZbigniew Jędrzejewski-Szmek2014-11-291-2/+2
| | | | https://bugs.debian/org/771397
* treewide: another round of simplificationsMichal Schmidt2014-11-281-8/+6
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-281-3/+3
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-281-6/+6
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-281-6/+6
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* login: rerun vconsole-setup when switching from vgacon to fbconRay Strode2014-11-061-0/+11
| | | | | | | | | | | | | | | | | The initialization performed by systemd-vconsole-setup is reset when changing console drivers (say from vgacon to fbcon), so we need to run it in that case. See http://lists.freedesktop.org/archives/systemd-devel/2014-October/023919.html http://lists.freedesktop.org/archives/systemd-devel/2014-October/024423.html http://lists.freedesktop.org/archives/systemd-devel/2014-November/024881.html This commit adds a udev rule to make systemd-vconsole-setup get run when the fbcon device becomes available. (david: moved into new file 90-vconsole.rules instead of 71-seats.rules; build-failures are on me, not on Ray)
* vconsole: silence coverityThomas Hindoe Paaboel Andersen2014-09-301-5/+5
| | | | | Let's silence coverity here too. There is not much to do if the ioctls to copy the fonts and character maps should fail.
* vconsole-setup: fix inverted error messagesZbigniew Jędrzejewski-Szmek2014-07-071-2/+2
| | | | | | Introduced in abee28c56d. Pointed-out-by: Werner Fink <werner@suse.de>
* vconsole-setup: run setfont before loadkeysZbigniew Jędrzejewski-Szmek2014-07-061-25/+23
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=80685
* vconsole: also copy character maps (not just fonts) from vt1 to vt2, vt3, ...Carl Schaefer2014-06-231-0/+24
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=78796
* util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering2014-03-181-2/+1
| | | | | | | | | | | | | | | safe_close() automatically becomes a NOP when a negative fd is passed, and returns -1 unconditionally. This makes it easy to write lines like this: fd = safe_close(fd); Which will close an fd if it is open, and reset the fd variable correctly. By making use of this new scheme we can drop a > 200 lines of code that was required to test for non-negative fds or to reset the closed fd variable afterwards.
* move _cleanup_ attribute in front of the typeHarald Hoyer2013-04-181-1/+1
| | | | http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
* Use initalization instead of explicit zeroingZbigniew Jędrzejewski-Szmek2013-04-051-6/+3
| | | | | | | | | | | | | | | | | | | | | | | Before, we would initialize many fields twice: first by filling the structure with zeros, and then a second time with the real values. We can let the compiler do the job for us, avoiding one copy. A downside of this patch is that text gets slightly bigger. This is because all zero() calls are effectively inlined: $ size build/.libs/systemd text data bss dec hex filename before 897737 107300 2560 1007597 f5fed build/.libs/systemd after 897873 107300 2560 1007733 f6075 build/.libs/systemd … actually less than 1‰. A few asserts that the parameter is not null had to be removed. I don't think this changes much, because first, it is quite unlikely for the assert to fail, and second, an immediate SEGV is almost as good as an assert.
* vconsole-setup: fix vconsole.conf vs. cmdline overriding logicMichal Schmidt2013-04-051-17/+12
| | | | | | | | | | | | | | Skipping the parsing of /etc/vconsole.conf just because some values were already assigned from the cmdline never made sense. And by the way, commit f73141d changed the return values of parse_env_file() - it now gives 0 on success. Which means in current HEAD /etc/vconsole.conf overrides the cmdline, which is the reverse of what's expected. We need to parse /etc/vconsole.conf first and then let vconsole.* overrides from cmdline take effect. The behaviour is documented in vconsole.conf(5). https://bugzilla.redhat.com/show_bug.cgi?id=948750