<feed xmlns='http://www.w3.org/2005/Atom'>
<title>talos-petitboot/test, branch v1.3.2</title>
<subtitle>Blackbird™ petitboot sources</subtitle>
<id>https://git.raptorcs.com/git/talos-petitboot/atom?h=v1.3.2</id>
<link rel='self' href='https://git.raptorcs.com/git/talos-petitboot/atom?h=v1.3.2'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/'/>
<updated>2016-09-08T04:26:27+00:00</updated>
<entry>
<title>discover: Pass UUID to discover_device_create()</title>
<updated>2016-09-08T04:26:27+00:00</updated>
<author>
<name>Samuel Mendoza-Jonas</name>
<email>sam@mendozajonas.com</email>
</author>
<published>2016-09-05T04:21:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=1def8f21aecc41ac22652e7b8bd1f5bf7a4dae98'/>
<id>urn:sha1:1def8f21aecc41ac22652e7b8bd1f5bf7a4dae98</id>
<content type='text'>
Currently discover_device_create() will search for existing discover
devices by id to determine if a new device is required. However it is
possible under some circumstances for distinct devices to have the same
name. This is especially troublesome if the following network events are
seen in network_handle_nlmsg():

	- New interface, 'foo' with uuid x:x:x:x:x:x
		-&gt; new discover device created with
			dev-&gt;device-&gt;id = 'foo'
			dev-&gt;uuid = x:x:x:x:x:x
	- New interface, 'foo' with uuid y:y:y:y:y:y
		-&gt; existing device 'foo' found
			dev-&gt;uuid = y:y:y:y:y:y

This can occur if an interface rename event arrives *after* an old name
is reused, where temporarily Petitboot will see two distinct network
interfaces with the same name. Now the two interfaces point to the same
discover device, which can quickly result in a segfault if a 'remove'
event occurs for one of the interfaces and the discover device is freed.

To generally avoid this a 'uuid' parameter is added to
discover_device_create(), which if present allows existing devices to be
looked up by UUID rather than just their name.

Signed-off-by: Samuel Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>Update tests to support changes to pxe_parser</title>
<updated>2016-06-28T06:17:21+00:00</updated>
<author>
<name>Samuel Mendoza-Jonas</name>
<email>sam@mendozajonas.com</email>
</author>
<published>2016-05-23T05:56:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=07a5f9f1c50a9185851cd486d732976573d15c4f'/>
<id>urn:sha1:07a5f9f1c50a9185851cd486d732976573d15c4f</id>
<content type='text'>
Substitute load_url_async() when running tests to support direct
callers of load_url_async() who will expect to read a file in a
callback.
Stub out device_handler_discover_context_commit() since it will remove
discover_options from the given discover_context, but the tests will
check the discover_context to count boot_options.

Signed-off-by: Samuel Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>pb-discover: add dtb support for PXE config</title>
<updated>2016-05-24T01:08:11+00:00</updated>
<author>
<name>Oliver O'Halloran</name>
<email>oohall@gmail.com</email>
</author>
<published>2016-05-09T05:38:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=6993af8a4b8bb3c6b1d12172b346c5aa41b7dc61'/>
<id>urn:sha1:6993af8a4b8bb3c6b1d12172b346c5aa41b7dc61</id>
<content type='text'>
Currently there is no way to manually specify a DTB file when with a PXE
network boot configuration file. This makes it difficult when you need
to work with or emulate a special snowflake machines with special snowflake
hardware.

Some ARM systems provide this feature with the "fdt" option so this patch
adds support for using the ftd or dtb configuration options to the PXE
config parser.

Signed-off-by: Oliver O'Halloran &lt;oohall@gmail.com&gt;
Signed-off-by: Samuel Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>Allow evaluation of arbitrarily-positioned arguments in GRUB2 parser</title>
<updated>2016-04-26T02:56:36+00:00</updated>
<author>
<name>Alan Dunn</name>
<email>amdunn@google.com</email>
</author>
<published>2016-03-02T16:59:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=013bf20025957f1b812f0c6e50f8d7afa215e1a3'/>
<id>urn:sha1:013bf20025957f1b812f0c6e50f8d7afa215e1a3</id>
<content type='text'>
GRUB2 allows essentially arbitrary numbers of positional arguments, so
ensure that they can be evaluated within scripts.  GRUB2 also appears
to support arbitrary numbers of leading 0's in positional parameters
(i.e., $01 should evalute the same as $1), but this doesn't seem like
a particularly important case to support.

Tested:
 Modified test-grub2-pos-param to cover higher-numbered positional
 arguments.

Signed-off-by: Alan Dunn &lt;amdunn@google.com&gt;
Signed-off-by: Samuel Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>test/lib: Avoid array overflow of child_argv[]</title>
<updated>2016-03-22T21:58:52+00:00</updated>
<author>
<name>Anton Blanchard</name>
<email>anton@samba.org</email>
</author>
<published>2016-01-03T10:37:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=d8c292e7e39f038374d2a6aecf6383f91a236ebc'/>
<id>urn:sha1:d8c292e7e39f038374d2a6aecf6383f91a236ebc</id>
<content type='text'>
We allocate 3 elements in child_argv, but write 4.

Signed-off-by: Anton Blanchard &lt;anton@samba.org&gt;
Signed-off-by: Samuel Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>discover/grub2: Fix handling of positional parameters</title>
<updated>2016-03-15T03:10:22+00:00</updated>
<author>
<name>Alan Dunn</name>
<email>amdunn@google.com</email>
</author>
<published>2016-03-02T16:59:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=c19daa69bc15e73b7ebf79d5280ba62c86c20b6f'/>
<id>urn:sha1:c19daa69bc15e73b7ebf79d5280ba62c86c20b6f</id>
<content type='text'>
Positional parameters are set in the environment with '$' prepended to
the name.  This causes lookups to fail because parameter lookups don't
include the '$'.

TESTED:
 Added a test that covers positional parameters in GRUB2 parser.
 Build succeeds, tests pass.

Bootstrapped-by: Nancy Yuen &lt;yuenn@google.com&gt;
Signed-off-by: Alan Dunn &lt;amdunn@google.com&gt;
Signed-off-by: Sam Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>Change parser interface to allow stat</title>
<updated>2016-03-15T03:10:22+00:00</updated>
<author>
<name>Alan Dunn</name>
<email>amdunn@google.com</email>
</author>
<published>2016-02-24T16:12:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=939660528bf1568c55b6dcf982cc9020c1dbcdd2'/>
<id>urn:sha1:939660528bf1568c55b6dcf982cc9020c1dbcdd2</id>
<content type='text'>
Currently, the GRUB2 parser incorrectly reports "[ -f &lt;path&gt; ]" as
false if the size of the file is above 1 MB.  This patch changes the
parser interface to allow stating files (with parser_stat_file).  Then
in the implementation of "[ -f &lt;path&gt; ]", we can use parser_stat_file
instead of parser_request_file which has the size limitation.  I
eliminate parser_check_dir in lieu of this new interface, which has
the side effect of making "[ -d &lt;path&gt; ]" work (the error code for
stat was not checked correctly before).

I add a basic test for the test file operations -f, -s, and -d (to
show that my changes to test file operations do not break them) and
minorly modify the test framework to ensure it has enough fidelity to
cause the expected results.  Unfortunately the test wouldn't have
caught the issue with -d, since the test framework stubs out the
parser interface itself.  Nor can the test framework catch the initial
problem with -f because the imposed limit is (transitively) in
function parser_request_file.

Note that -f and -d follow symlinks despite the fact that GRUB does
not (see
http://lists.gnu.org/archive/html/grub-devel/2016-02/msg00142.html
discussing GRUB's behavior).  This is not a change to Petitboot's
behavior though.

Tested:
 The test test-grub2-test-file-ops passes.  I booted Petitboot against
 a GRUB snippet:

status=success

if [ ! -f /large_file -a $status = success ]
then status=fail_large_file
fi
if [ ! -d /a_directory -a $status = success ]
then status=fail_dir
fi

menuentry $status {
  linux /vmlinux
}

 (after making /large_file a file of size &gt; 1 MiB and /a_directory a
 directory) and the menuentry had title "success", as desired.

Signed-off-by: Alan Dunn &lt;amdunn@google.com&gt;
Signed-off-by: Sam Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>In GRUB2 parser save_env, treat unset variable value as empty</title>
<updated>2016-03-15T03:10:00+00:00</updated>
<author>
<name>Alan Dunn</name>
<email>amdunn@google.com</email>
</author>
<published>2016-03-15T00:40:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=6e5cd61065181460be8152a73dfc79f94ecd27fe'/>
<id>urn:sha1:6e5cd61065181460be8152a73dfc79f94ecd27fe</id>
<content type='text'>
It seems better to treat unset variable values as empty rather than
crashing in save_env.  While GRUB's behavior is actually to delete the
variable from the environment block, it seems useful to at least not
crash while later on someone can do further work to improve GRUB
compatibility if desired.

Tested:
 Modified test-grub2-save-env to cover this case.

Signed-off-by: Alan Dunn &lt;amdunn@google.com&gt;
Signed-off-by: Sam Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>discover/grub: Fix handling of empty strings</title>
<updated>2016-02-09T02:39:50+00:00</updated>
<author>
<name>Sam Mendoza-Jonas</name>
<email>sam@mendozajonas.com</email>
</author>
<published>2016-01-12T04:58:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=a1ec0710b6abad1a932d09f23010e3eb4662e8c9'/>
<id>urn:sha1:a1ec0710b6abad1a932d09f23010e3eb4662e8c9</id>
<content type='text'>
If "" or '' are used in a statement to omit a word, we must still
return a TOKEN_WORD for an empty string.

In particular this fixes an issue where Petitboot would fail to parse
the grub.cfg included in the Debian 8.2 install image, which includes a
menuentry statement with an empty name.

Signed-off-by: Sam Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
<entry>
<title>discover/grub2: Fix behavior of save_env -f</title>
<updated>2016-02-08T04:27:41+00:00</updated>
<author>
<name>Alan Dunn</name>
<email>amdunn@google.com</email>
</author>
<published>2016-01-12T23:43:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-petitboot/commit/?id=01e104dfb79a09bc28f8c5fb65bfe44596c25161'/>
<id>urn:sha1:01e104dfb79a09bc28f8c5fb65bfe44596c25161</id>
<content type='text'>
Currently, "save_env -f" in the GRUB2 parser only works with three
arguments, which means only commands of the form "save_env -f &lt;path&gt;"
that save *no* environment variables are allowed.

Allow "save_env -f &lt;path&gt; [&lt;var&gt;]*", making "save_env -f" useful.

Tested:
 Unit test test-grub2-save-env-dash-f tests this change, and the
 remaining unit tests still pass.

Signed-off-by: Alan Dunn &lt;amdunn@google.com&gt;
Signed-off-by: Sam Mendoza-Jonas &lt;sam@mendozajonas.com&gt;
</content>
</entry>
</feed>
