[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Extending libdebian-installer's API to include certainty on subarch detection

Hey d-boot,

I've recently been doing some work on improving sub-architecture detection
support to be more generic. I currently have several ARM platforms (Marvell
Dove, and TI OMAP3 + OMAP4) which have common kernels which work across
multiple boards. I have found the explicit whitelist/board name to subarch
we currently use for subarch detection on armel to be insufficent for my
needs, and I'd like to propose extending the libdebian-installer API with
the following function to the API:

const char *di_system_subarch_analyze_with_certainity(int * certainity)

This function behaves just like the existing di_system_subarch_analyze()
function, expect the passed pointer returns a subarch specific level of
certainity. This certianity is availability by the API, or returned as the
exit code of archdetect (and thus available to base-insatller and

With this patch in place, the following actions during subarchitecture
detection are possible.

1. Fully-supported (board is whitelisted); /proc/cpuinfo's Hardware field
matches an entry in the table in libd-i.

Under this case, we simply provide the kernel list as normal, and then continue
with installation.

2. Board is unknown, but generic detection has managed to make a reasonable
guess at the board (in the current written code, the subarch string is
extracted from the end of the kernel version, and then compared against
a list of "known good" subarches that are known to support kernels that
work across an entire line of boards (i.e., TI OMAP3's kernel will work on
any OMAP3 board if the proper options are compiled in. The same is true
for Marvell dove, and I believe its also true for Marvell kirkwood).

Under this case, we display a warning to the user that the detection was fuzzy,
that we may not be able to properly install the kernel via flash-kernel, and
that they should proceed with caution. The user is allowed to select a kernel
from the list.

3. Board is unknown, generic detection has failed. archdetect returns

Present the normal "No installable kernels" warning. Allow the user to proceed.

I have a set of diffs which implement this API change as an example and also
add a few new boards and subarches as required by my project. The diffs for
hw-detect and libdebian-installer are here:

These patches are not in a mergable state, nor do I plan to have
anyone commit them
"as is", they are simply a proof of concept at this stage.

I'm hoping to solicit reviews of my patches, and discuss the API inclusion.

Any feedback is welcome.

Reply to: