pmbootstrap init: kernel selection
Created by: ollieparanoid
Example output
[17:12:27] Device [qemu-amd64]: sony-amami
[17:12:29] Which kernel do you want to use with your device?
[17:12:29] Upstream kernels (mainline, stable, lts) get security updates, but may have less working features than downstream kernels.
[17:12:29] Available kernels (2):
[17:12:29] * downstream: Display and wifi works (see device table for details)
[17:12:29] * mainline: For kernel development only (most features aren't working)
[17:12:29] Kernel [downstream]:
Details
- new config option
"kernel"
with possible values:"downstream", "mainline", "stable", "lts"
(downstream is alwayslinux-$devicename
) - ask for the kernel during
pmbootstrap init
if the device package has kernel subpackages and install it in_install.py
- postmarketos-mkinitfs: display note instead of exit with error when
the
deviceinfo_dtb
file is missing (because we expect it to be missing for downstream kernels) - device-sony-amami:
- add kernel subpackages for downstream, mainline
- set
deviceinfo_dtb
- device-qemu-amd64: add kernel subpackages for stable, lts, mainline
- test cases and test data for new functions
- test case that checks all aports for right usage of the feature:
- don't mix specifying kernels in depends and subpackages
- 1 kernel in depends is maximum
- kernel subpackages must have a valid name
Closes #1263 (closed). When this is merged, I will update the device specific package wiki page.
Merge request reports
Activity
also maybe add a testcase to check if one kernel is added at all if we're at it?
Also I remembered, potentially different cmdlines are needed for different kernels (e.g. on mainline I use
cma=64m msm.vram=16m
and downstreamconsole=ttyHSL0,115200,n8
)By Luca Weiss on 2018-03-26T21:04:38
Edited by Ghost UserCreated by: ollieparanoid
also maybe add a testcase to check if one kernel is added at all if we're at it?
Good idea!
Also I remembered, potentially different cmdlines are needed for different kernels (e.g. on mainline I use
cma=64m msm.vram=16m
and downstreamconsole=ttyHSL0,115200,n8
)I have two solutions for this, and I recommend to pick the appropriate one when we hit this case:
- package the
deviceinfo
in the kernel subpackage, so we can have 2 versions (one for upstream kernels and one where we replace the kernel commandline with sed or something) - add two kernel cmdline variables to the deviceinfo, one for upstream and one for downstream kernels.
By * postmarketOS Bot on 2018-03-26T21:18:31
- package the
Two deviceinfo packages would probably be better (or partial deviceinfo files??) as
==> kernel: appending device-tree qcom-msm8974-fairphone-fp2 ==> initramfs: creating boot.img ERROR: File not found: /boot/dt.img, but 'deviceinfo_bootimg_qcdt' is set. Please verify that your device is a QCDT device by analyzing the boot.img file (e.g. 'pmbootstrap bootimg_analyze path/to/twrp.img') and based on that, set the deviceinfo variable to false or adjust your linux APKBUILD to properly generate the dt.img file. See also: <https://postmarketos.org/deviceinfo> ERROR: postmarketos-mkinitfs-0.6.3-r0.trigger: script exited with error 1
mainline is (of course) not qcdt...
By Luca Weiss on 2018-03-26T21:20:46
Created by: ollieparanoid
@z3ntu: See my answer above to the
deviceinfo
problem. Thoughts?@craftyguy: Good point. I've adopted the term from various talks on mainlining, which talk about upstream and downstream kernels. We could explain the term right above the "available kernels", would that work?
By * postmarketOS Bot on 2018-03-26T21:34:23
@ollieparanoid sound good :)
By clayton craft on 2018-03-26T21:36:33
@ollieparanoid FYI, also for the Samsung S5 I have different
cmdline
and QCDT should be set only for downstream kernel. Solution 1.) simple but the actual cmdline will be stored in the APKBUILD instead of thedeviceinfo
file. Solution 2.) Requires additional changes in the various commands using it What about a solution similar to 2. by having both lines indeviceinfo
, e.g.:deviceinfo_kernel_cmdline_mainline="cma=64m msm.vram=16m" deviceinfo_kernel_cmdline_downstream="console=ttyHSL0,115200,n8"
but in the subpackage installation just remove all the other lines and rename the variable to
deviceinfo_kernel_cmdline
? That way we can have a common logic between all the APKBUILDsBy Daniele Debernardi on 2018-03-26T22:07:46
Edited by Ghost UserCreated by: ollieparanoid
@drebrez: Wow, that sounds like one really nice solution
EDIT: The code to generate the new deviceinfo file from the one with the _mainline and _downstream variables could be part of the devicepkg-dev package which we have already.
By * postmarketOS Bot on 2018-03-26T22:14:34
Edited by Ghost UserThe change is going to be useful for Droid 4 as well, since currently it has downstream kernel packages, but there is mostly working mainline kernel for it. As for "downstream" term, another proporsal from me would be "vendor" kernel, as the sources usually come from device's vendor.
By NotKit on 2018-03-27T20:47:16
Edited by Ghost UserCreated by: ollieparanoid
I've put @drebrez proposal into a new issue #1368 (closed) and addressed the review comments, as well as deleted the
lts
kernel (as discussed in IRC yesterday - we don't really use it, and updates come in about once a week which is a lot maintenance extra effort). If someone has time, it would be nice to review it again and test it. Thanks!By * postmarketOS Bot on 2018-03-27T20:54:33
1 _flavor=postmarketos-lts @ollieparanoid
linux-postmarketos-lts
is still used by thedevice-qemu-vexpress
packageBy Daniele Debernardi on 2018-04-02T21:43:53
Edited by Ghost User
29 35 "$subpkgdir"/etc/xdg/weston/weston.ini 30 36 } 31 37 38 kernel_stable() { 39 pkgdesc="Stable for everyday usage (recommended)" 40 depends="linux-postmarketos-mainline" @ollieparanoid depends on the wrong
linux-postmarketos
package, should belinux-postmarketos-stable
By Daniele Debernardi on 2018-04-02T21:43:53
Edited by Ghost User
Created by: ollieparanoid
@drebrez: thanks for finding these bugs, updated the PR!
By * postmarketOS Bot on 2018-03-30T01:15:00
@ollieparanoid I get another error: (device: soni-amami, kernel: mainline)
drebrez@drebrez-pc:~/Development/pmbootstrap$ pmbootstrap initfs build [00:38:53] ERROR: list index out of range
File "/home/drebrez/Development/pmbootstrap/pmb/__init__.py", line 61, in main getattr(frontend, args.action)(args) File "/home/drebrez/Development/pmbootstrap/pmb/helpers/frontend.py", line 170, in initfs pmb.chroot.initfs.frontend(args) File "/home/drebrez/Development/pmbootstrap/pmb/chroot/initfs.py", line 98, in frontend flavor = pmb.chroot.other.kernel_flavor_autodetect(args, suffix) File "/home/drebrez/Development/pmbootstrap/pmb/chroot/other.py", line 43, in kernel_flavor_autodetect return kernel_flavors_installed(args, suffix)[0] IndexError: list index out of range
kernel_flavor_autodetect
function seems broken: https://github.com/postmarketOS/pmbootstrap/blob/master/pmb/chroot/other.py#L37-L43By Daniele Debernardi on 2018-03-30T23:18:50
Edited by Ghost UserCreated by: ollieparanoid
@drebrez: Thanks for your incredible patience and for all the testing! \o/
By * postmarketOS Bot on 2018-04-03T23:45:49