Add support to different deviceinfo variables in mainline/downstream subpackages
TODO:
- Test whole workflow: from
pmbootstrap init
, kernel selection, flashing to device and verify
Changes:
- New version of
devicepkg-dev
with changes described in https://github.com/postmarketOS/pmbootstrap/issues/1368#issuecomment-387809557 - Added the logic suggested by @ollieparanoid (https://gitlab.com/postmarketOS/pmbootstrap/issues/1368#note_85245801)
...always installs the deviceinfo file, but the subpackage then clears it from the package in case it will get installed in the kernel subpackages
- It's not limited to the
kernel_cmdline
but works with every variable - Added a validation check: if there is a variable with the kernel subpackage suffix, it should not exist the same variable without the prefix
How to test:
pmbootstrap -y zap
pmbootstrap build devicepkg-dev --force --arch armhf
# Test device with both cmdlines
pmbootstrap build device-samsung-klte --force --arch armhf
pmbootstrap chroot -b armhf -- find /home/pmos/build/pkg/
# output should contain the deviceinfo file in both subpackages and not in the device package
pmbootstrap chroot -b armhf -- cat /home/pmos/build/pkg/device-samsung-klte-kernel-downstream/etc/deviceinfo
# output should contain the lines:
# deviceinfo_kernel_cmdline="androidboot.boot_recovery=1"
# deviceinfo_bootimg_qcdt="true"
pmbootstrap chroot -b armhf -- cat /home/pmos/build/pkg/device-samsung-klte-kernel-mainline/etc/deviceinfo
# output should contain the lines:
# deviceinfo_kernel_cmdline="console=ttyMSM0,115200,n8 PMOS_NO_OUTPUT_REDIRECT"
# deviceinfo_bootimg_qcdt="false"
# Test device with normal cmdline
pmbootstrap build device-samsung-maguro --force --arch armhf
pmbootstrap chroot -b armhf -- find /home/pmos/build/pkg/
# output should contain the deviceinfo file in the device package as usual
pmbootstrap chroot -b armhf -- diff -s /home/pmos/build/pkg/device-samsung-maguro/etc/deviceinfo /home/pmos/build/src/deviceinfo
# output should contain the exact content as the source file
# Test device without cmdline
pmbootstrap build device-samsung-i9070 --force --arch armhf
pmbootstrap chroot -b armhf -- find /home/pmos/build/pkg/
# output should contain the deviceinfo file in the device package as usual
pmbootstrap chroot -b armhf -- diff -s /home/pmos/build/pkg/device-samsung-i9070/etc/deviceinfo /home/pmos/build/src/deviceinfo
# output should contain the exact content as the source file
Closes: https://gitlab.com/postmarketOS/pmbootstrap/issues/1368
Edited by Administrator