<feed xmlns='http://www.w3.org/2005/Atom'>
<title>talos-petitboot/lib/process, branch master</title>
<subtitle>Blackbird™ petitboot sources</subtitle>
<id>https://git.raptorcs.com/git/talos-petitboot/atom?h=master</id>
<link rel='self' href='https://git.raptorcs.com/git/talos-petitboot/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/'/>
<updated>2019-03-05T20:54:10+00:00</updated>
<entry>
<title>lib/process: Add option to pipe to process stdin</title>
<updated>2019-03-05T20:54:10+00:00</updated>
<author>
<name>Samuel Mendoza-Jonas</name>
<email>sam@mendozajonas.com</email>
</author>
<published>2019-02-14T23:39:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=ba8144f917f5603e507e9c72aed4ae3257c6b0ce'/>
<id>urn:sha1:ba8144f917f5603e507e9c72aed4ae3257c6b0ce</id>
<content type='text'>
If pipe_stdin exists, create a second pipe to write to the child
process's STDIN. This allows Petitboot to pipe information to a process,
for example piping a LUKS password to cryptsetup.

Signed-off-by: Samuel Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>lib/process: Add process_get_stdout</title>
<updated>2018-08-07T01:30:36+00:00</updated>
<author>
<name>Geoff Levand</name>
<email>geoff@infradead.org</email>
</author>
<published>2018-08-02T17:29:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=51fb307dfdbb8f238d15520a74e33ef4fea52e4d'/>
<id>urn:sha1:51fb307dfdbb8f238d15520a74e33ef4fea52e4d</id>
<content type='text'>
Add a new structure 'struct process_stdout' and optional parameter
'stdout' to the process_run_simple functions to allow the caller
to get a buffer filled with the stdout from the child process.

Rename the process_run_simple functions to process_get_stdout
and add wrappers for the old process_run_simple function names.

Signed-off-by: Geoff Levand &lt;geoff@infradead.org&gt;
Signed-off-by: Samuel Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>lib/process: Cleanup stdout callback</title>
<updated>2018-08-07T01:30:36+00:00</updated>
<author>
<name>Geoff Levand</name>
<email>geoff@infradead.org</email>
</author>
<published>2018-08-02T17:29:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=214de247193d14a2de014e5e4cad1ab3df956c13'/>
<id>urn:sha1:214de247193d14a2de014e5e4cad1ab3df956c13</id>
<content type='text'>
General cleanup of async stdout processing.

The process_stdout_cb and process_stdout_custom routines were doing the
same thing, so rename process_stdout_custom to process_process_stdout
and make process_stdout_cb a wrapper that calls process_process_stdout.

Signed-off-by: Geoff Levand &lt;geoff@infradead.org&gt;
Signed-off-by: Samuel Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>lib/log: Switch to pb_log_fn</title>
<updated>2018-08-07T01:30:36+00:00</updated>
<author>
<name>Geoff Levand</name>
<email>geoff@infradead.org</email>
</author>
<published>2018-08-02T17:29:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=c78f9ec47ba92b74698dacdae963dbbefd9b676f'/>
<id>urn:sha1:c78f9ec47ba92b74698dacdae963dbbefd9b676f</id>
<content type='text'>
The only functional change should be an additional '/n' to
a few log messagees that seemed to be missing it.

Signed-off-by: Geoff Levand &lt;geoff@infradead.org&gt;
Signed-off-by: Samuel Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>lib/process: Add raw stdout mode</title>
<updated>2017-08-15T03:03:28+00:00</updated>
<author>
<name>Samuel Mendoza-Jonas</name>
<email>sam@mendozajonas.com</email>
</author>
<published>2017-02-14T04:52:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=2914110af0cc490566446f18c929452368121b98'/>
<id>urn:sha1:2914110af0cc490566446f18c929452368121b98</id>
<content type='text'>
Allow process users to set 'raw_stdout', which if set skips redirecting
and saving output from processes.

Signed-off-by: Samuel Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>process: Cancel all asynchronous jobs on reinit</title>
<updated>2017-01-31T02:18:38+00:00</updated>
<author>
<name>Samuel Mendoza-Jonas</name>
<email>sam@mendozajonas.com</email>
</author>
<published>2017-01-23T03:53:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=d94bb8c48f42678a5f1cf0041429b82aa1938540'/>
<id>urn:sha1:d94bb8c48f42678a5f1cf0041429b82aa1938540</id>
<content type='text'>
If an asynchronous job is running over a reinit, the process can return
and run its callback function after the reinit. This becomes a problem
if the callback function accesses pointers that were only valid before
the reinit (eg. device structs).
If a reinit is requested explicitly stop all active asynchronous jobs
and clear their callback functions before the reinit.

Signed-off-by: Samuel Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>lib/process: Allow process output to be retrieved on each event</title>
<updated>2016-12-20T05:40:21+00:00</updated>
<author>
<name>Samuel Mendoza-Jonas</name>
<email>sam@mendozajonas.com</email>
</author>
<published>2016-10-21T04:54:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=0ba871a497f156dd474a333889cd92eaab9b08dc'/>
<id>urn:sha1:0ba871a497f156dd474a333889cd92eaab9b08dc</id>
<content type='text'>
Allow a custom callback function to be set when registering the IO
waiter for asynchronous processes.

To allow output from processes to be parsed as it is received, add
process_stdout_custom() which passes a new "line" parameter to
process_read_stdout_once() in order to consume output as it appears.

Users of a custom IO callback will only have access to the process_info
struct which is internal to lib/process; the function
procinfo_get_process() is added to allow these callers to access process
information.

Signed-off-by: Samuel Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>lib/process: Add debug on process kill</title>
<updated>2014-04-03T06:25:48+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@ozlabs.org</email>
</author>
<published>2014-04-03T06:25:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=5f206b3d7960b79a4c85067132caa7e7a29dfc59'/>
<id>urn:sha1:5f206b3d7960b79a4c85067132caa7e7a29dfc59</id>
<content type='text'>
Signed-off-by: Jeremy Kerr &lt;jk@ozlabs.org&gt;
</content>
</entry>
<entry>
<title>lib/process: Don't abort stdout reads on EINTR</title>
<updated>2014-02-20T02:11:52+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@ozlabs.org</email>
</author>
<published>2014-02-20T01:22:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=ffb84fc1bf1d138d1ac1bb8ece0b7d625f288d97'/>
<id>urn:sha1:ffb84fc1bf1d138d1ac1bb8ece0b7d625f288d97</id>
<content type='text'>
If our read() of the process stdout pipe fails with EINTR (eg, if we
receive a SIGCHLD because the process exited), then
process_read_stdout_once will return a non-zero exit code, and we'll
abort any further stdout collection.

Instead, we should check for EINTR, and allow the reads to continue.

This change normalises the return value from process_read_stdout_once to
return positive on success, negative on failure, and zero on competion.
We use a positive return value for the non-error EINTR case.

Also, add a pb_log if the read fails for non-EINTR reasons.

Signed-off-by: Jeremy Kerr &lt;jk@ozlabs.org&gt;
</content>
</entry>
<entry>
<title>lib/process: Add helper for check process clean exit</title>
<updated>2014-01-21T05:36:01+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@ozlabs.org</email>
</author>
<published>2014-01-21T02:00:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=2ad0e66f61e8f8488cff208f8bb7f5127ec9f813'/>
<id>urn:sha1:2ad0e66f61e8f8488cff208f8bb7f5127ec9f813</id>
<content type='text'>
We have a few incorrect checks for the exit status of a process; this
change adds a helper with the correct WIFEXITED &amp;&amp; WEXITSTATUS==0 logic.

Signed-off-by: Jeremy Kerr &lt;jk@ozlabs.org&gt;
</content>
</entry>
</feed>
