With integer options there's no obvious value to mean "unset" like there is for
string types (and to a lesser extent boolean types), so this commit
adds a mechanism.
Charlie Brej [Sat, 3 Jan 2009 22:18:24 +0000 (22:18 +0000)]
Add hashtable and bitarray functionality
Hashtable uses the bitarray to mark the used/dead places in the hash data array.
The hashtable functions follow the general gist of the glib ones. To create a
hashtable you supply the hashing and comparison functions. Examples of direct
and string based indexing are supplied. Hashtable is a single word because there
is no hash_somethingelse but the name may change soon. Notice the compare
function returns a signed int difference rather than an equal bool. This is
because it may be an idea to later migrate the collision system to a tree
sub-structure (currently it is a linear array search with an incrementing step
size).
Charlie Brej [Sat, 3 Jan 2009 21:33:56 +0000 (21:33 +0000)]
Allow client request answers to be greater than 255 characters.
The new limit is 2^32. This only affects the replies to the client. Data sent
along with requests (e.g. password prompt) remain limited to <256 characters.
Two new functions have been added to the ply-utils (ply_read_uint32 and
ply_write_uint32) which receive/transmit 32bit numbers on FD streams.
AFAICT in function ply_boot_client_process_incoming_replies the answer was not
NUL terminated, which may have caused some of the password error bugs.
Charlie Brej [Sat, 3 Jan 2009 19:41:21 +0000 (19:41 +0000)]
Optionally pause progress while asking for a password or a question
The "Rework input methods" commit broke the pausing of the progress bar during
password entry. This commit reimplements that functionality but this time the
pausing is optional, applied with a --pause-progress parameter. The client
program sends the (un)pause commands before/after the password requests.
The default is currently to not pause but that may change quite soon.
This also fixes a couple minor bugs and formatting from "Rework input methods".
Also changed "progress-pause" to "pause-progress" to make it more human
intuitive.
Charlie Brej [Sat, 3 Jan 2009 15:58:39 +0000 (15:58 +0000)]
Make Ctrl+C and Ctrl+D cause the password/question entry to quit
When asking for a password or a question, if the user presses Ctrl+C or Ctrl+D
the backend will reply a NULL. This is interprited as a "Stop asking me". The
client will not repeat the request (even if number of retries hasn't been
reached) and quit with an error exit_status.
Charlie Brej [Sun, 28 Dec 2008 18:34:25 +0000 (18:34 +0000)]
Add progress-pause/unpause commands to halt the progress bar
Progress bar expansion was previously halted on password entry. Now the
progress can be halted whenever the system wishes. This can be useful when the
system notices there is a big task which is normally not present during normal
boots e.g. fsck.
Charlie Brej [Fri, 19 Dec 2008 14:16:33 +0000 (14:16 +0000)]
Rework of the input methods
Previously the splash plugins would deal with password entry, which would mean
that code was repeated and upon splash unload the password entry would be lost.
Now the keyboard strokes are processed with outside the splash, and the plugins
only deal with showing an appropriate user interface. As well as password
entry, the system can ask questions with non hidden text entry and sensing of
keystrokes.
Charlie Brej [Wed, 17 Dec 2008 12:07:57 +0000 (12:07 +0000)]
Ensure ply-buffer data block always terminates with a '\0'
In some instances, ply-buffer did not terminate the data block with a '\0'.
Doing so allows the data to be used as a string. Additionally it now tries
harder to deal with very long additions to the buffer by repeatedly expanding
the capacity and dealing with appends larger than the maximum buffer size.
Ray Strode [Mon, 24 Nov 2008 22:42:11 +0000 (17:42 -0500)]
Allow NULL to be passed to ply_image_free()
free() allows NULL so there is no reason ply_image_free
shouldn't. This also papers over a bug in the solar
plugin that we haven't been able to identify yet.
Ray Strode [Wed, 19 Nov 2008 16:21:13 +0000 (11:21 -0500)]
Add a --rebuild-initrd arg for set-default-plugin
Normally when a user runs plymouth-set-default-plugin
to change which plugin plymouth uses, the change doesn't
take effect until a new kernel is installed and the initrd
is rebuilt.
This new --rebuild-initrd argument forces the currently
running initrd to get rebuilt immediately (bug 18297).
Ray Strode [Fri, 14 Nov 2008 18:25:56 +0000 (13:25 -0500)]
Don't loop forever when tty returns NUL bytes
Somehow a user was running into a case where plymouthd
would busy loop taking 100% cpu. gdb revealed that it
was stuck trying to process keyboard input. This is
apparently because we were looping forever when mbrlen()
got a NUL byte.
Charles Brej [Mon, 17 Nov 2008 14:41:58 +0000 (14:41 +0000)]
Tweak ply-progress to not progress too far beyond where it expects the next status update
This stops the progress from reaching 100% in cases such as fsck and timeouts.
It also averages the progress times from the previous one with the current one
to average out occasional slow tasks.
Charlie Brej [Fri, 14 Nov 2008 16:25:04 +0000 (11:25 -0500)]
Generate background instead of using image
The background image previously was low resolution
and created various artifacts when being upscaled
to the native resolution of the panel. This patch
ditches the background image and instead generates
a similar type of background dynamically, custom
fit to the screen it's being displayed on. As an
added bonus, since we're doing it dynamically, we
can make some of the stars in the background
lightly twinkle.
Ray Strode [Mon, 10 Nov 2008 16:07:06 +0000 (11:07 -0500)]
Track "attached" versus "redirected" separately
We only want to try to attach the terminal session
to a terminal if it's not already attached. It may
be legitimately unredirected if plymouth:nolog is
passed.
Ray Strode [Thu, 6 Nov 2008 15:44:03 +0000 (10:44 -0500)]
unredirect console messages terminal-session
Previously, we did it manually using the ioctl
straight from main.c. Now, there's a
ply_terminal_session_detach call that does it
for us. This allows us to detach from the terminal
during --hide-splash, and reattach during --show-splash
Ray Strode [Wed, 5 Nov 2008 19:09:26 +0000 (14:09 -0500)]
Reset colors and show text cursor on remove_window
Now that we retain the splash on screen and don't
explicitly hide it on quit, we need to make sure
that we leave the window as we found it when we
remove the window from the splash.
Ray Strode [Thu, 30 Oct 2008 19:56:05 +0000 (15:56 -0400)]
Don't try to start/stop animation twice in a row
Protect against multiple calls to start/stop animation.
This prevents crashes if the user presses escape when
the animation is already stopped, and prevents
super fast animations if --show-splash gets called twice
in a row.
Ray Strode [Thu, 30 Oct 2008 16:57:35 +0000 (12:57 -0400)]
Reset window mode in splash plugins before drawing
At some point during boot up the terminal gets kicked
out of raw mode. By resetting the window mode before
drawing we ensure it stays in raw mode, so things like
password characters draw correctly.
Charlie Brej [Mon, 27 Oct 2008 16:49:06 +0000 (12:49 -0400)]
Dither colors in non-default low depth color path
This patch modifies the low color mode (slow) path
to dither the colors before flushing them to the
scanout buffer. This improves the output quality
in those corner cases.