boottool: fix the --bootloader option

boottool takes a --bootloader=type option to suppress the autodetection.
However this has no effect as we always instantiate the base type and it
uses detection to work out which sub-class we are.

This patch contains two fixes.  Firstly, where we know which type of
bootloader we are using it specifically instaniates that type so that
we do not need to perform the redundant detection.  This is particularly
important where you are passing the type specifically because detection
is failing.

Secondly, it removes redundant new operators in each class which cause a
second object to be instantiated and the actual base class initialisation
occurs against a temporary object which is then lost.  This behaviour
prevents the use of the --config_file option when the objects are created
directly.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@744 592f7852-d20e-0410-864c-8624ca9c26a4
1 file changed