Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
New plugin: kernel #366
Conversation
kyrofa
reviewed
Mar 10, 2016
| 'armv7l': { | ||
| - 'arch': 'armhf', | ||
| + 'kernel': 'arm', | ||
| + 'deb': 'armhf', |
sergiusens
Mar 16, 2016
Collaborator
What, how is that possible?
If everyone agreed we'd be jobless
kyrofa
reviewed
Mar 10, 2016
| @@ -98,20 +103,36 @@ def __init__(self): | ||
| super().__init__( | ||
| '{0} is not supported, please log a bug at ' | ||
| 'https://bugs.launchpad.net/snapcraft/+filebug?' | ||
| - 'field.title=please+add+support+for+{0}'.format( | ||
| - platform.machine())) | ||
| + 'field.title=please+add+support+for+{0}'.format(_machine)) |
kyrofa
Mar 10, 2016
Member
I know you didn't add the title in this PR, but I wanted to voice a small concern. We're introducing a dependency here on Launchpad's URL format. Do we know that will remain stable? What happens in a few years when this code is still used but Launchpad renames title to be summary for example? We'll still be printing this but people will get a 404.
sergiusens
Mar 16, 2016
Collaborator
This is stable. If it comes to it, it would need to be changed like any other link we have.
kyrofa
reviewed
Mar 10, 2016
| +provided by that plus the following kbuild specific options with semantics as | ||
| +explained above: | ||
| + | ||
| + - kdefconfig: |
kyrofa
Mar 10, 2016
Member
I suggest reversing the order of listing the variables and the above description. Much of the above description mention the below variables by name but the reader has no context as to what those variables are until they get to the bottom.
kyrofa
reviewed
Mar 10, 2016
| + explicit list of configs to force; this will override the configs that | ||
| + were set as base through kdefconfig and kconfigfile and dependent configs | ||
| + will be fixed using the defaults encoded in the kbuild config | ||
| + definitions. If you dont want default for one or more implicit configs |
kyrofa
reviewed
Mar 10, 2016
| + # note that prepending and appending the overrides seems | ||
| + # only way to convince all kbuild versions to pick up the | ||
| + # configs during oldconfig in .config | ||
| + config = '{}\n\n{}'.format(config, '\n'.join(self.options.kconfigs)) |
kyrofa
Mar 10, 2016
Member
I'm not sure I understand what's going on here. Let's say self.options.kconfigs = [A] and the config_path contents is B. Lines 142-144 would result in:
A
B
A
Right? Then line 149 would result in:
A
B
A
A
What am I missing?
sergiusens
Mar 10, 2016
Collaborator
Hah, I thought I wasn't doing A B A but it turns out I was doing the header part while doing the read and the footer while doing the write. I'll fix this to do it all in one location.
kyrofa
reviewed
Mar 10, 2016
| + def do_remake_config(self): | ||
| + # update config to include kconfig amendments using oldconfig | ||
| + cmd = 'yes "" | make {} oldconfig'.format( | ||
| + ' '.join(self.options.build_parameters)) |
kyrofa
Mar 10, 2016
Member
Referring to the subprocess security guidelines, consider using shlex.quote() here to escape user-supplied input due to the use of shell=True below.
sergiusens
changed the title from
Kernel and kbuild plugin
to
New plugin: kernel
Mar 17, 2016
coveralls
commented
Mar 19, 2016
coveralls
commented
Mar 19, 2016
coveralls
commented
Mar 19, 2016
|
@kyrofa I would be pleased for a rereview of this :-) unit test writing took me the entire day! |
coveralls
commented
Mar 21, 2016
kyrofa
reviewed
Mar 21, 2016
| + - qcom/msm8916-mtp | ||
| + 410c-firmware: | ||
| + plugin: tar-content | ||
| + source: firmware.tar # from developer.qualcomm.com v1.2 |
kyrofa
Mar 21, 2016
Member
I haven't quite woken up yet, but where is this coming from to make the example succeed?
sergiusens
Mar 21, 2016
Collaborator
from developer.qualcomm.com; you need to accept a license agreement.
sergiusens
Mar 21, 2016
Collaborator
FWIW anyone building such qualcomm kernel would know they need to do this so I didn't explain much. This will also be accompanied by a blog post (kernel plugin is subject to change).
kyrofa
Mar 21, 2016
Member
Ah, okay. I wish we could have a more complete example is all, I guess. One that a dev can just run instead of needing to hunt these down.
kyrofa
reviewed
Mar 21, 2016
| + 'kernel': 'arm64', | ||
| + 'deb': 'arm64', | ||
| + 'cross-compiler-prefix': 'aarch64-linux-gnu-', | ||
| + 'cross-build-packages': ['gcc-aarch64-linux-gnu'], |
kyrofa
reviewed
Mar 21, 2016
| + | ||
| + | ||
| +_compression_command = { | ||
| + 'gz': 'gzip', |
kyrofa
reviewed
Mar 21, 2016
| + def schema(cls): | ||
| + schema = super().schema() | ||
| + | ||
| + schema['properties']['kernel-image-target'] = { |
kyrofa
reviewed
Mar 21, 2016
| + 'default': [], | ||
| + } | ||
| + | ||
| + schema['properties']['kernel-device-trees'] = { |
kyrofa
reviewed
Mar 21, 2016
| + schema['properties']['kernel-initrd-compression'] = { | ||
| + 'type': 'string', | ||
| + 'default': 'gz', | ||
| + 'enum': ['gz'], |
kyrofa
Mar 21, 2016
Member
The docs say this can be one of none, gz, bz2, xz. Looks like it's only gz?
|
Other than some documentation issues this looks good to me, but I must admit it does go beyond my kernel experience. You may want ogra or ppisati to check this out. |
coveralls
commented
Mar 21, 2016
|
I'm going to ignore those example errors:
and
|
sergiusens commentedMar 3, 2016
Includes 2 plugins with an example for each.
Jointly developed by Alexander Sack and Sergio Schvezov
LP: #1552168
Signed-off-by: Sergio Schvezov sergio.schvezov@ubuntu.com